inspect-server/src/main/java/com/ruoyi/inspect/aspect/MoveLocationAfterPushMesStockAspect.java
@@ -35,6 +35,8 @@ @Autowired private MesApiUtils mesApiUtils; private final static String LOCATION_NO = "WG-02-001";//mes外购合格库位 @AfterReturning(value = "execution(* com.ruoyi.inspect.service.impl.InsOrderServiceImpl.moveRawMaterial(..))") @Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED) public void doAfterReturning(JoinPoint joinPoint) { @@ -65,7 +67,7 @@ requestMap.put("outerColor", one.getOuterColor()); // 外护颜色 requestMap.put("letteringInfo", one.getLetteringInfo()); // 印字信息 requestMap.put("reelNumber", one.getDrumNo()); // 盘号 requestMap.put("locationNo", "1302"); // 库位编号 requestMap.put("locationNo", LOCATION_NO); // 库位编号 requestMap.put("customerOrderNo", one.getOrderNo()); // 销售订单号 requestMap.put("stockSource", one.getStockSource()); // 库存来源 requestMap.put("remark", one.getRemark()); // 备注 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -919,24 +919,23 @@ InsSample insSample = insSampleMapper.selectOne(Wrappers.<InsSample>lambdaQuery() .eq(InsSample::getInsOrderId, orderId) .last("limit 1")); // threadPoolTaskExecutor.execute(() -> { // String message = ""; // message += "耐丝系统检验任务复核通知"; // message += "\n提交人: " + userName; // message += "\n委托编号: " + order.getEntrustCode(); // message += "\n样品名称: " + insSample.getModel(); // message += "\n规格型号: " + order.getPartDetail(); // if (ifsInventoryQuantity != null) { // message += "\n批次号: " + ifsInventoryQuantity.getUpdateBatchNo(); // } // //发送企业微信消息通知 提交复核 // try { // WxCpUtils.inform(sendUserAccount, message, null); // } catch (Exception e) { // throw new RuntimeException(e); // } // }); threadPoolTaskExecutor.execute(() -> { String message = ""; message += "耐丝系统检验任务复核通知"; message += "\n提交人: " + userName; message += "\n委托编号: " + order.getEntrustCode(); message += "\n样品名称: " + insSample.getModel(); message += "\n规格型号: " + order.getPartDetail(); if (ifsInventoryQuantity != null) { message += "\n批次号: " + ifsInventoryQuantity.getUpdateBatchNo(); } //发送企业微信消息通知 提交复核 try { WxCpUtils.inform(sendUserAccount, message, null); } catch (Exception e) { throw new RuntimeException(e); } }); // 14.ifs移库(原材料需要进行移库操作) --> 最后执行,因为失败无法回滚 if (ifsInventoryQuantity != null) { // 登记检验结果 @@ -950,8 +949,6 @@ // 添加分析数据 addAnalysis(productList, ifsInventoryQuantity, order, sendUserAccount); }); } else { // 修改成品状态 // 判断是否有不合格 @@ -966,7 +963,6 @@ .set(InsOrder::getInsResult, 0)); } } return 1; } inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java
@@ -43,6 +43,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletResponse; @@ -1149,12 +1150,14 @@ /** * ifs移库操作 * @param one * @param inventoryQuantity * @return */ @Override @Transactional(rollbackFor = Exception.class) public String moveRawMaterial(IfsInventoryQuantity one) { @Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED) public String moveRawMaterial(IfsInventoryQuantity inventoryQuantity) { //查询ifs订单详情 IfsInventoryQuantity one = ifsInventoryQuantityMapper.selectById(inventoryQuantity.getId()); String toLocation; // 登记采购检验结果STD if (one.getIsRegister().equals(0)) { @@ -1175,7 +1178,7 @@ if (result.getCode() != 200) { throw new ErrorException("IFS登记采购检验结果失败: " + result.getMessage()); } //如果是拆分订单,则将同一接受号的订单标记已登记接收 //如果是拆分订单,则将同一接收号的订单标记已登记校验 if(one.getIsSplitOrder()==1){ //查询其余拆分的订单 List<IfsInventoryQuantity> quantityList = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery() inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsReportServiceImpl.java
@@ -49,6 +49,7 @@ import org.springframework.core.io.ClassPathResource; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; @@ -796,7 +797,7 @@ @Override @Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED) public void isRawMaterial(InsOrder insOrder,Boolean registerInsResults,Boolean hasExemption) { IfsInventoryQuantity one = ifsInventoryQuantityMapper.selectOne(new LambdaQueryWrapper<IfsInventoryQuantity>() .eq(IfsInventoryQuantity::getId, insOrder.getIfsInventoryId())); @@ -822,9 +823,9 @@ if(Objects.isNull(vo.getInsOrderId())){ rawMaterialOrderService.rawOrderRelease(vo.getId(), vo.getPartDesc()); }else if(Objects.equals(vo.getInsOrderId(),insOrder.getId())){ toLocation = insOrderService.moveRawMaterial(one); toLocation = insOrderService.moveRawMaterial(vo); }else if(Objects.nonNull(vo.getInsResult()) && 1 == vo.getInsResult()){ toLocation = insOrderService.moveRawMaterial(one); toLocation = insOrderService.moveRawMaterial(vo); } } }else{ @@ -855,23 +856,23 @@ .eq(IfsInventoryQuantity::getId, insOrder.getIfsInventoryId())); } // threadPoolTaskExecutor.execute(() -> { // // 企业微信通知 // String message = ""; // message += "检测结果提交通知"; // message += "\n批次号: " + one.getUpdateBatchNo(); // message += "\n零件号: " + one.getPartNo(); // message += "\n零件描述: " + one.getPartDesc(); // message += "\n供应商名称: " + one.getSupplierName(); // message += "\n抵达数量: " + one.getQtyArrived().stripTrailingZeros().toPlainString() + one.getBuyUnitMeas(); // // 发送企业inspectStatus信通知 // if (inspectStatus == 1) { // message += "\n检测结果: 合格"; // } else { // message += "\n检测结果: 不合格"; // } // WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); // }); threadPoolTaskExecutor.execute(() -> { // 企业微信通知 String message = ""; message += "检测结果提交通知"; message += "\n批次号: " + one.getUpdateBatchNo(); message += "\n零件号: " + one.getPartNo(); message += "\n零件描述: " + one.getPartDesc(); message += "\n供应商名称: " + one.getSupplierName(); message += "\n抵达数量: " + one.getQtyArrived().stripTrailingZeros().toPlainString() + one.getBuyUnitMeas(); // 发送企业inspectStatus信通知 if (inspectStatus == 1) { message += "\n检测结果: 合格"; } else { message += "\n检测结果: 不合格"; } WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message); }); } inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
@@ -172,31 +172,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; } ruoyi-admin-ztns/src/main/resources/application-druid.yml
@@ -150,7 +150,7 @@ # 企业微信通知 wechat: # 质量报检通知 examiningUrl: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=21993616-9966-4fe4-81b0-68e99a40c964 examiningUrl: # https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=21993616-9966-4fe4-81b0-68e99a40c964 ifs: contract: ZTNS @@ -159,6 +159,12 @@ custorder: http://192.168.20.47/PurchService.ashx? custorder-port: http://192.168.20.47:8008/PurchService.ashx? erp-services: http://192.168.20.47:8081 mes: ztns: ip: http://10.16.173.36 user: lims password: qCzOMJlqE8TYOHDWGva/Tw== # 备注 18083密码:zttZTT123!@ mqtt: @@ -169,7 +175,7 @@ keepalive: 60 # 心跳 (单位:秒) qos: 1 # 心跳包级别 completion-timeout: 3000 # 连接超时时间(单位:秒) clientId: ztns01 # clientId clientId: ztns01a # clientId subscribe: /ztt/v3/2455220/publish # 订阅主题 client: true # 如果开发需要启动测试,需要改为false不然会一直报错 - url: tcp://mqtt-ztt.zttiot.com:1883 # 服务器ip @@ -179,7 +185,7 @@ keepalive: 60 # 心跳 (单位:秒) qos: 1 # 心跳包级别 completion-timeout: 3000 # 连接超时时间(单位:秒) clientId: ztns02 # clientId clientId: ztns02b # clientId subscribe: /ztt/v3/2455221/publish # 订阅主题 client: true # 如果开发需要启动测试,需要改为false不然会一直报错 ruoyi-admin-ztns/src/main/resources/application-ztns.yml
@@ -161,6 +161,12 @@ custorder-port: http://192.168.20.50:8008/PurchService.ashx? erp-services: http://192.168.20.50:8081 mes: ztns: ip: http://10.1.51.128 user: lims password: q1CItm6Zl7P4SQkfczu/oQ== # 备注 18083密码:zttZTT123!@ mqtt: - url: tcp://mqtt-ztt.zttiot.com:1883 # 服务器ip ruoyi-common/src/main/java/com/ruoyi/common/utils/api/MesApiUtils.java
@@ -15,13 +15,13 @@ @Component public class MesApiUtils { @Value("${mes.ztzb.ip}") @Value("${mes.ztns.ip}") String ip; @Value("${mes.ztzb.user}") @Value("${mes.ztns.user}") String user; @Value("${mes.ztzb.password}") @Value("${mes.ztns.password}") String password; /**