|
|
|
@ -15,8 +15,10 @@ import com.glxp.api.constant.ConstantStatus;
|
|
|
|
|
import com.glxp.api.constant.SocketMsgType;
|
|
|
|
|
import com.glxp.api.controller.BaseController;
|
|
|
|
|
import com.glxp.api.controller.sync.SpsSyncWebSocket;
|
|
|
|
|
import com.glxp.api.dao.auth.WarehouseUserDao;
|
|
|
|
|
import com.glxp.api.dao.basic.UdiRelevanceDao;
|
|
|
|
|
import com.glxp.api.dto.DictDto;
|
|
|
|
|
import com.glxp.api.entity.auth.InvWarehouseEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.*;
|
|
|
|
|
import com.glxp.api.entity.sync.SocketMsgEntity;
|
|
|
|
|
import com.glxp.api.entity.system.SystemParamConfigEntity;
|
|
|
|
@ -24,6 +26,7 @@ import com.glxp.api.entity.thrsys.CodeRel;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrProductsEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrSystemEntity;
|
|
|
|
|
import com.glxp.api.http.ErpBasicClient;
|
|
|
|
|
import com.glxp.api.req.auth.FilterInvLinkDataRequest;
|
|
|
|
|
import com.glxp.api.req.basic.*;
|
|
|
|
|
import com.glxp.api.req.system.DeleteRequest;
|
|
|
|
|
import com.glxp.api.req.thrsys.FilterBasicThirdSysRequest;
|
|
|
|
@ -51,10 +54,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
public class UdiRelevanceController extends BaseController {
|
|
|
|
@ -75,6 +76,8 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
@Resource
|
|
|
|
|
UdiRlSupService udiRlSupService;
|
|
|
|
|
@Resource
|
|
|
|
|
WarehouseUserDao warehouseUserDao;
|
|
|
|
|
@Resource
|
|
|
|
|
ProductInfoService productInfoService;
|
|
|
|
|
@Resource
|
|
|
|
|
UdiRelevanceDao udiRelevanceDao;
|
|
|
|
@ -644,6 +647,23 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
|
|
|
|
|
FilterBasicThirdSysRequest filterBasicThirdSysRequest = new FilterBasicThirdSysRequest();
|
|
|
|
|
filterBasicThirdSysRequest.setEnabled(true);
|
|
|
|
|
String customerId = getCustomerId();
|
|
|
|
|
if (!"110".equals(customerId)){
|
|
|
|
|
FilterInvLinkDataRequest filterInvLinkDataRequest = new FilterInvLinkDataRequest();
|
|
|
|
|
filterInvLinkDataRequest.setCustomerId(customerId);
|
|
|
|
|
List<InvWarehouseEntity> invWarehouseEntities = warehouseUserDao.authWarehouseListByCustomerId(filterInvLinkDataRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(invWarehouseEntities)){
|
|
|
|
|
|
|
|
|
|
List<String> thirdIds = invWarehouseEntities.stream()
|
|
|
|
|
.map(InvWarehouseEntity::getThirdId) // 提取 thirdId
|
|
|
|
|
.filter(Objects::nonNull) // 排除 null 值
|
|
|
|
|
.filter(s -> !s.isEmpty()) // 排除空字符串
|
|
|
|
|
.distinct() // 去重
|
|
|
|
|
.collect(Collectors.toList()); // 收集到 List
|
|
|
|
|
|
|
|
|
|
filterBasicThirdSysRequest.setThirdIds(thirdIds);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<ThrSystemEntity> basicThirdSysEntities = thrSystemService.filterBasicThiSys(filterBasicThirdSysRequest);
|
|
|
|
|
List<BasicProductThirdSysResponse> basicProductThirdSysResponses = new ArrayList<>();
|
|
|
|
|
|
|
|
|
@ -750,7 +770,23 @@ public class UdiRelevanceController extends BaseController {
|
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private BasicProductThirdSysResponse createResponse(ThrSystemEntity thrSystemEntity, UdiRelevanceEntity udiRelevanceEntity, ThrDataService thrDataService, String thirdId) {
|
|
|
|
|
BasicProductThirdSysResponse basicProductThirdSysResponse = new BasicProductThirdSysResponse();
|
|
|
|
|
if (StrUtil.isNotEmpty(udiRelevanceEntity.getThirdId()))
|
|
|
|
|
basicProductThirdSysResponse.setThirdId(udiRelevanceEntity.getThirdId());
|
|
|
|
|
basicProductThirdSysResponse.setSysName(thrSystemEntity.getThirdName());
|
|
|
|
|
basicProductThirdSysResponse.setSysId(thrSystemEntity.getThirdId());
|
|
|
|
|
if (udiRelevanceEntity.getThirdId()!= null &&!udiRelevanceEntity.getThirdId().isEmpty()) {
|
|
|
|
|
ThrProductsEntity thrProductsEntity = thrDataService.getProducts(udiRelevanceEntity.getThirdId(), thirdId);
|
|
|
|
|
if (thrProductsEntity!= null) {
|
|
|
|
|
basicProductThirdSysResponse.setManufactory(thrProductsEntity.getManufactory());
|
|
|
|
|
basicProductThirdSysResponse.setRegisterNo(thrProductsEntity.getRegisterNo());
|
|
|
|
|
basicProductThirdSysResponse.setSpec(thrProductsEntity.getSpec());
|
|
|
|
|
basicProductThirdSysResponse.setThirdName(thrProductsEntity.getName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return basicProductThirdSysResponse;
|
|
|
|
|
}
|
|
|
|
|
//获取是否启用供应商维护产品信息
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udiwms/udiinfo/spcombie")
|
|
|
|
|