inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
@@ -50,6 +50,7 @@
import com.ruoyi.inspect.service.RawMaterialOrderService;
import com.ruoyi.common.numgen.NumberGenerator;
import com.ruoyi.framework.exception.ErrorException;
import com.ruoyi.basic.vo.IfsInventoryQuantityVO;
import com.ruoyi.performance.mapper.AuxiliaryOutputWorkingHoursMapper;
import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHours;
import com.ruoyi.system.mapper.UserMapper;
@@ -146,8 +147,15 @@
    }
    @Override
    public IPage<IfsInventoryQuantity> getWarehouseSubmit(IPage<IfsInventoryQuantity> page, IfsInventoryQuantity ifsInventoryQuantity) {
        return standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity));
    public IPage<IfsInventoryQuantityVO> getWarehouseSubmit(IPage<IfsInventoryQuantity> page, IfsInventoryQuantity ifsInventoryQuantity) {
        IPage<IfsInventoryQuantityVO> ifsInventoryQuantityIPage = standardTreeMapper.selectIfsPage(page, QueryWrappers.queryWrappers(ifsInventoryQuantity));
        ifsInventoryQuantityIPage.getRecords().forEach(f->{
            Long count = ifsInventoryQuantityMapper.selectCount(Wrappers.<IfsInventoryQuantity>lambdaQuery()
                    .ne(IfsInventoryQuantity::getId,f.getId())
                    .eq(IfsInventoryQuantity::getUpdateBatchNo, f.getUpdateBatchNo()));
            f.setLotBatchNoHasRepeat(count>0);
        });
        return ifsInventoryQuantityIPage;
    }
    @Override
@@ -241,13 +249,32 @@
        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);
            //查询相同批号的历史ifs订单
            List<IfsInventoryQuantity> historyRecords = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery()
                    .ne(IfsInventoryQuantity::getId, ifsInventoryQuantity.getId())
                    .eq(IfsInventoryQuantity::getIsInspect, 1)
                    .eq(IfsInventoryQuantity::getUpdateBatchNo, ifsInventoryQuantity.getUpdateBatchNo())
            );
            if(CollUtil.isEmpty(historyRecords)){
                // 企业微信通知
                String message = "";
                message += "新增报检通知";
                message += "\n批次号: " + inventoryQuantity.getUpdateBatchNo();
                message += "\n零件描述: " + inventoryQuantity.getPartDesc();
                message += "\n抵达数量: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas();
                WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message);
            }else{
                //获取历史抵达数量
                double sum = historyRecords.stream().map(IfsInventoryQuantity::getQtyArrived).mapToDouble(BigDecimal::doubleValue).sum();
                String historyQuantity = sum + inventoryQuantity.getBuyUnitMeas();
                String messageMarkdown = "";
                messageMarkdown += "新增报检通知";
                messageMarkdown += "\n批次号: <font color='warning'>" + inventoryQuantity.getUpdateBatchNo() + "</font>";
                messageMarkdown += "\n零件描述: "+ inventoryQuantity.getPartDesc();
                messageMarkdown += "\n抵达数量: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas();
                messageMarkdown += "\n历史抵达数量: " + historyQuantity;
                WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), messageMarkdown,"markdown");
            }
        });
        return 1;
    }