From 23d35c163bd5308fc4a8e94cda87881d9547a251 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期五, 29 八月 2025 13:31:12 +0800 Subject: [PATCH] 去除与其他系统的对接配置 --- inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java | 204 +++++++++++++++++++++++--------------------------- 1 files changed, 95 insertions(+), 109 deletions(-) diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java index 4c81840..95c5e8d 100644 --- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java +++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java @@ -15,17 +15,33 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.ruoyi.basic.dto.FactoryDto; -import com.ruoyi.basic.dto.LaboratoryDto; +import com.ruoyi.basic.dto.*; +import com.ruoyi.basic.pojo.IfsInventoryQuantity; +import com.ruoyi.common.constant.InsOrderTypeConstants; +import com.ruoyi.common.core.domain.Result; +import com.ruoyi.common.core.domain.entity.User; +import com.ruoyi.common.config.WechatProperty; +import com.ruoyi.common.utils.LimsDateUtil; +import com.ruoyi.common.utils.QueryWrappers; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.WxCpUtils; +import com.ruoyi.inspect.dto.CopperInsOrderDto; import com.ruoyi.inspect.dto.RawMaterialStandardTreeDto; -import com.ruoyi.basic.dto.SampleTypeDto; import com.ruoyi.basic.mapper.IfsInventoryQuantityMapper; import com.ruoyi.basic.mapper.StandardTreeMapper; +import com.ruoyi.inspect.dto.SampleProductDto; +import com.ruoyi.inspect.mapper.InsOrderMapper; +import com.ruoyi.inspect.mapper.InsProductMapper; +import com.ruoyi.inspect.mapper.InsSampleMapper; import com.ruoyi.inspect.pojo.InsOrder; +import com.ruoyi.inspect.pojo.InsReport; import com.ruoyi.inspect.service.InsOrderService; +import com.ruoyi.inspect.service.InsReportService; import com.ruoyi.inspect.service.RawMaterialOrderService; import com.ruoyi.common.numgen.NumberGenerator; import com.ruoyi.framework.exception.ErrorException; +import com.ruoyi.performance.mapper.AuxiliaryOutputWorkingHoursMapper; +import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours; import com.ruoyi.system.mapper.UserMapper; import lombok.AllArgsConstructor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; @@ -53,27 +69,23 @@ private StandardTreeMapper standardTreeMapper; private IfsInventoryQuantityMapper ifsInventoryQuantityMapper; - private GetLook getLook; private UserMapper userMapper; private InsOrderService insOrderService; private InsOrderMapper insOrderMapper; private InsSampleMapper insSampleMapper; private final NumberGenerator<InsOrder> numberGenerator; private InsReportService insReportService; - private WechatProperty wechatProperty; +// private WechatProperty wechatProperty; private ThreadPoolTaskExecutor threadPoolTaskExecutor; private InsProductMapper insProductMapper; private AuxiliaryOutputWorkingHoursMapper auxiliaryOutputWorkingHoursMapper; @Override - public RawMaterialStandardTreeDto selectStandardTreeListByPartNo(String partNo) { - if (StringUtils.isBlank(partNo)) { - throw new ErrorException("闆朵欢鍙蜂涪澶�"); - } + public Result selectStandardTreeListByPartNo(String partNo) { List<FactoryDto> factoryDtos = standardTreeMapper.selectStandardTreeListByPartNo(partNo); if (CollectionUtil.isEmpty(factoryDtos)) { - throw new ErrorException("闆朵欢鍙蜂负" + partNo + "鐨勫師鏉愭枡娌℃湁瀵瑰簲鐨勬爣鍑嗗簱閰嶇疆"); + return Result.success(null, "闆朵欢鍙蜂负" + partNo + "鐨勫師鏉愭枡娌℃湁瀵瑰簲鐨勬爣鍑嗗簱閰嶇疆"); } RawMaterialStandardTreeDto rawMaterialStandardTreeDto = new RawMaterialStandardTreeDto(); for (FactoryDto factoryDto : factoryDtos) { @@ -85,8 +97,8 @@ // 鍒ゆ柇缁戝畾鐨勬槸鍚︽槸褰撳墠闆朵欢鍙� if (sampleTypeDto.getPartNo() != null && sampleTypeDto.getPartNo().equals(partNo)) { // 娣诲姞瀵硅薄 - rawMaterialStandardTreeDto.setTreeName(factoryDto.getValue() + "-" - + laboratoryDto.getValue() + "-" + rawMaterialStandardTreeDto.setTreeName(factoryDto.getValue() + " - " + + laboratoryDto.getValue() + " - " + sampleTypeDto.getValue()); rawMaterialStandardTreeDto.setCode(sampleTypeDto.getCode()); rawMaterialStandardTreeDto.setLabel(sampleTypeDto.getLabel()); @@ -96,9 +108,9 @@ for (SampleDto sampleDto : sampleTypeDto.getChildren()) { if (sampleDto.getPartNo() != null && sampleDto.getPartNo().equals(partNo)) { // 娣诲姞瀵硅薄 - rawMaterialStandardTreeDto.setTreeName(factoryDto.getValue() + "-" - + laboratoryDto.getValue() + "-" - + sampleTypeDto.getValue() + "-" + rawMaterialStandardTreeDto.setTreeName(factoryDto.getValue() + " - " + + laboratoryDto.getValue() + " - " + + sampleTypeDto.getValue() + " - " + sampleDto.getValue()); rawMaterialStandardTreeDto.setCode(sampleDto.getCode()); rawMaterialStandardTreeDto.setLabel(sampleDto.getLabel()); @@ -110,29 +122,17 @@ } } } - return rawMaterialStandardTreeDto; + return Result.success(rawMaterialStandardTreeDto); } @Override - public Map<String, Object> getWarehouseSubmit(IPage<IfsInventoryQuantity> page, IfsInventoryQuantity ifsInventoryQuantity) { - Map<String, Object> map = new HashMap<>(); - map.put("head", PrintChina.printChina(IfsInventoryQuantity.class)); - map.put("body", standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity))); - return map; + public IPage<IfsInventoryQuantity> getWarehouseSubmit(IPage<IfsInventoryQuantity> page, IfsInventoryQuantity ifsInventoryQuantity) { + return standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity)); } @Override - public Map<String, Object> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto) { - Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("getIfsByStateOne"); - if (map1.get("look") == 1) { - //涓汉 - ifsInventoryQuantityDto.setCreateUser(map1.get("userId")); - } - Map<String, Object> map = new HashMap<>(); -// ifsInventoryQuantityDto.setOrderState(null); - map.put("head", PrintChina.printChina(IfsInventoryQuantityDto.class)); - map.put("body", standardTreeMapper.getIfsByStateOne(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto))); - return map; + public IPage<IfsInventoryQuantityDto> getIfsByStateOne(IPage<IfsInventoryQuantityDto> page, IfsInventoryQuantityDto ifsInventoryQuantityDto) { + return standardTreeMapper.getIfsByStateOne(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto)); } @@ -143,7 +143,7 @@ */ @Override public int inspectionReport(List<Integer> ids) { - Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); + Integer userId = SecurityUtils.getUserId().intValue(); ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() .in(IfsInventoryQuantity::getId, ids) .set(IfsInventoryQuantity::getDeclareUser, userMapper.selectById(userId).getName()) @@ -151,31 +151,31 @@ .set(IfsInventoryQuantity::getIsInspect, 1) .set(IfsInventoryQuantity::getDeclareDate, LocalDateTime.now()) ); - threadPoolTaskExecutor.execute(() -> { - List<IfsInventoryQuantity> quantityList = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery() - .in(IfsInventoryQuantity::getId, ids)); - // 浼佷笟寰俊閫氱煡 - String message = ""; - message += "鏂板鎶ユ閫氱煡"; - for (IfsInventoryQuantity inventoryQuantity : quantityList) { - message += "\n鎵规鍙�: " + inventoryQuantity.getUpdateBatchNo(); - message += "\n闆朵欢鎻忚堪: " + inventoryQuantity.getPartDesc(); - message += "\n鎶佃揪鏁伴噺: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas(); - - // 鍒ゆ柇鏈夋病鏈夊埌20鍚�. 鎴栬�呰兘鍚﹀厤妫� - int result = notificationRawOrder(inventoryQuantity.getId()); - switch (result) { - case 1: - message += "\n褰撳墠鏍峰搧宸叉楠岃繃, 鍙互鍏嶆"; - break; - case 2: - message += "\n褰撳墠鏍峰搧宸茶秴杩�20鍚�"; - break; - } - message += "\n"; - } - WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); - }); +// threadPoolTaskExecutor.execute(() -> { +// List<IfsInventoryQuantity> quantityList = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery() +// .in(IfsInventoryQuantity::getId, ids)); +// // 浼佷笟寰俊閫氱煡 +// String message = ""; +// message += "鏂板鎶ユ閫氱煡"; +// for (IfsInventoryQuantity inventoryQuantity : quantityList) { +// message += "\n鎵规鍙�: " + inventoryQuantity.getUpdateBatchNo(); +// message += "\n闆朵欢鎻忚堪: " + inventoryQuantity.getPartDesc(); +// message += "\n鎶佃揪鏁伴噺: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas(); +// +// // 鍒ゆ柇鏈夋病鏈夊埌20鍚�. 鎴栬�呰兘鍚﹀厤妫� +// int result = notificationRawOrder(inventoryQuantity.getId()); +// switch (result) { +// case 1: +// message += "\n褰撳墠鏍峰搧宸叉楠岃繃, 鍙互鍏嶆"; +// break; +// case 2: +// message += "\n褰撳墠鏍峰搧宸茶秴杩�20鍚�"; +// break; +// } +// message += "\n"; +// } +// WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); +// }); return 1; } @@ -209,7 +209,7 @@ */ @Override public int inspectionReportOne(IfsInventoryQuantity ifsInventoryQuantity) { - Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); + Integer userId = SecurityUtils.getUserId().intValue(); ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() .eq(IfsInventoryQuantity::getId, ifsInventoryQuantity.getId()) .set(IfsInventoryQuantity::getDeclareUser, userMapper.selectById(userId).getName()) @@ -219,16 +219,16 @@ .set(IfsInventoryQuantity::getUpdateBatchNo, ifsInventoryQuantity.getUpdateBatchNo()) ); - threadPoolTaskExecutor.execute(() -> { - IfsInventoryQuantity inventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsInventoryQuantity.getId()); - // 浼佷笟寰俊閫氱煡 - String message = ""; - message += "鏂板鎶ユ閫氱煡"; - message += "\n鎵规鍙�: " + inventoryQuantity.getUpdateBatchNo(); - message += "\n闆朵欢鎻忚堪: " + inventoryQuantity.getPartDesc(); - message += "\n鎶佃揪鏁伴噺: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas(); - WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); - }); +// threadPoolTaskExecutor.execute(() -> { +// IfsInventoryQuantity inventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsInventoryQuantity.getId()); +// // 浼佷笟寰俊閫氱煡 +// String message = ""; +// message += "鏂板鎶ユ閫氱煡"; +// message += "\n鎵规鍙�: " + inventoryQuantity.getUpdateBatchNo(); +// message += "\n闆朵欢鎻忚堪: " + inventoryQuantity.getPartDesc(); +// message += "\n鎶佃揪鏁伴噺: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas(); +// WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); +// }); return 1; } @@ -351,11 +351,8 @@ * @return */ @Override - public Map<String, Object> selectIfsInventoryQuantity(Page<IfsInventoryQuantityCheckDto> page, IfsInventoryQuantityCheckDto ifsInventoryQuantity) { - Map<String, Object> map = new HashMap<>(); - map.put("head", PrintChina.printChina(IfsInventoryQuantityCheckDto.class)); - map.put("body", standardTreeMapper.selectIfsInventoryQuantity(page, QueryWrappers.queryWrappers(ifsInventoryQuantity))); - return map; + public IPage<IfsInventoryQuantityCheckDto> selectIfsInventoryQuantity(Page<IfsInventoryQuantityCheckDto> page, IfsInventoryQuantityCheckDto ifsInventoryQuantity) { + return standardTreeMapper.selectIfsInventoryQuantity(page, QueryWrappers.queryWrappers(ifsInventoryQuantity)); } /** @@ -365,21 +362,15 @@ * @return */ @Override - public Map<String, Object> getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) { - Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("getIfsByStateOne"); - if (map1.get("look") == 1) { - //涓汉 - ifsInventoryQuantityDto.setCreateUser(map1.get("userId")); - } + public IPage<IfsInventoryQuantitySupplierDto> getIfsByOver(Page<IfsInventoryQuantitySupplierDto> page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) { + // todo: 鍙湅鎴� String beginDeclareDate = ifsInventoryQuantityDto.getBeginDeclareDate(); String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate(); ifsInventoryQuantityDto.setBeginDeclareDate(null); ifsInventoryQuantityDto.setEndDeclareDate(null); - Map<String, Object> map = new HashMap<>(); - map.put("head", PrintChina.printChina(IfsInventoryQuantitySupplierDto.class)); - map.put("body", standardTreeMapper.getIfsByOver(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate)); - return map; + IPage<IfsInventoryQuantitySupplierDto> ifsByOver = standardTreeMapper.getIfsByOver(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate); + return ifsByOver; } /** @@ -498,14 +489,8 @@ ifsInventoryQuantityMapper.insert(ifsInventoryQuantity); } - @Override - public void shiftingParking(List<Integer> ids) { - for (Integer id : ids) { - InsOrder order = insOrderService.getById(id); - // todo: ifs鐩存帴绉诲簱 - insReportService.isRawMaterial(order); - } - } + + /** * 閾滃崟涓濅笅鍗曞厤妫� @@ -688,12 +673,19 @@ */ @Override public void rawAllExport(IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto, HttpServletResponse response) throws UnsupportedEncodingException { - //鏌ヨ瀵煎嚭鐨勮垂鐢ㄧ粺璁℃暟鎹� - String beginDeclareDate = ifsInventoryQuantityDto.getBeginDeclareDate(); - String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate(); - ifsInventoryQuantityDto.setBeginDeclareDate(null); - ifsInventoryQuantityDto.setEndDeclareDate(null); - List<IfsInventoryQuantitySupplierDto> ifsByOverList = standardTreeMapper.getIfsByOverList(QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate); + // 鍒ゆ柇鏄惁鏄牴鎹�夋嫨鐨勫鍑� + List<IfsInventoryQuantitySupplierDto> ifsByOverList = new ArrayList<>(); + if (StringUtils.isNotBlank(ifsInventoryQuantityDto.getIds())) { + List<String> ifsIds = StrUtil.split(ifsInventoryQuantityDto.getIds(), ","); + ifsByOverList = standardTreeMapper.getIfsByIds(ifsIds); + } else { + String beginDeclareDate = ifsInventoryQuantityDto.getBeginDeclareDate(); + String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate(); + ifsInventoryQuantityDto.setBeginDeclareDate(null); + ifsInventoryQuantityDto.setEndDeclareDate(null); + ifsInventoryQuantityDto.setIds(null); + ifsByOverList = standardTreeMapper.getIfsByOverList(QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate); + } for (IfsInventoryQuantitySupplierDto dto : ifsByOverList) { dto.setSendTimeString(dto.getSendTime() == null ? "" : dto.getSendTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); @@ -750,21 +742,15 @@ * @return */ @Override - public Map<String, Object> getIfsByQuarter(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) { - Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("getIfsByStateOne"); - if (map1.get("look") == 1) { - //涓汉 - ifsInventoryQuantityDto.setCreateUser(map1.get("userId")); - } + public IPage<IfsInventoryQuantitySupplierDto> getIfsByQuarter(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) { + + // todo: 鍙湅鎴� String beginDeclareDate = ifsInventoryQuantityDto.getBeginDeclareDate(); String endDeclareDate = ifsInventoryQuantityDto.getEndDeclareDate(); ifsInventoryQuantityDto.setBeginDeclareDate(null); ifsInventoryQuantityDto.setEndDeclareDate(null); - Map<String, Object> map = new HashMap<>(); - map.put("head", PrintChina.printChina(IfsInventoryQuantitySupplierDto.class)); - map.put("body", standardTreeMapper.getIfsByQuarter(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate)); - return map; + return standardTreeMapper.getIfsByQuarter(page, QueryWrappers.queryWrappers(ifsInventoryQuantityDto), beginDeclareDate, endDeclareDate); } /** @@ -817,7 +803,7 @@ DateTime parse = DateUtil.parse(localDateTime.format(formatter)); auxiliaryOutputWorkingHours.setWeekDay(getWeek(localDateTime.format(formatters)));//鏄熸湡 auxiliaryOutputWorkingHours.setWeek(String.valueOf(DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1))));//鍛ㄦ - auxiliaryOutputWorkingHours.setCheck(getLook.selectPowerByMethodAndUserId(null).get("userId"));//妫�娴嬩汉 + auxiliaryOutputWorkingHours.setCheck(SecurityUtils.getUserId().intValue());//妫�娴嬩汉 auxiliaryOutputWorkingHours.setPrice(new BigDecimal("1"));//鍗曚环 auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours); -- Gitblit v1.9.3