zouyu
7 天以前 3793ba4a9b6be8faa6df0d4a76c06763ac03f873
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -11,6 +11,7 @@
import com.alibaba.fastjson.JSONObject;
import com.aspose.words.License;
import com.aspose.words.SaveFormat;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@@ -168,9 +169,7 @@
    public IPage<InsOrderPlanVO> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) {
        // todo: 仅看自己或者实验室
        //获取当前人所属实验室id
        String laboratory = null;
        String userName = null;
        Integer userId = null;
        if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId())) {
@@ -181,8 +180,17 @@
        Integer isCheck = insOrderPlanDTO.getIsCheck();
        insOrderPlanDTO.setIsCheck(null);
        String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//试验室
        Integer typeSource = insOrderPlanDTO.getTypeSource();
        QueryWrapper<InsOrderPlanDTO> queryWrapper = new QueryWrapper<>();
        if(ObjectUtils.isNotEmpty(typeSource)){
            insOrderPlanDTO.setTypeSource(null);
            queryWrapper = QueryWrappers.queryWrappers(insOrderPlanDTO)
                    .eq(!Objects.equals(-1,typeSource),"type_source",typeSource)
                    .isNotNull(!Objects.equals(-1,typeSource),"ifs_inventory_id")
                    .isNull(Objects.equals(-1,typeSource),"ifs_inventory_id");//委托试验查询非ifs报检订单
        }
        IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page,
                QueryWrappers.queryWrappers(insOrderPlanDTO),
                queryWrapper,
                userName,
                userId,
                sonLaboratory,
@@ -919,24 +927,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 +957,6 @@
                // 添加分析数据
                addAnalysis(productList, ifsInventoryQuantity, order, sendUserAccount);
            });
        } else {
            // 修改成品状态
            // 判断是否有不合格
@@ -966,7 +971,6 @@
                        .set(InsOrder::getInsResult, 0));
            }
        }
        return 1;
    }