Crunchy
2024-04-23 4f986140a10e71c07c7001ccbcda6e93e17736b1
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java
@@ -4,6 +4,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.common.GetLook;
@@ -153,6 +154,7 @@
    public void reTreeBySampleType(String sampleType) {
        Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
        CompletableFuture.supplyAsync(() -> {
            //根据样品名称查询所有检测项目参数(能力)
            List<StandardProductList> productList = standardTreeMapper.getStandardProductListBySample(sampleType);
            List<StandardProductList> productList1 = JSON.parseArray(JSON.toJSONString(productList), StandardProductList.class);
            List<StandardMethodList> methodList = standardTreeMapper.getStandardMethodListBySample(sampleType);
@@ -169,6 +171,7 @@
                            sl1.setRemark(sl2.getRemark());
                            sl2.setId(sl1.getId());
                            standardMethodListMapper.updateById(sl1);
                            //通过检验标准id查询检验项目(标准库)
                            List<StandardProductList> standardProductList = standardProductListService.selectStandardProductListByMethodId(sl1.getId());
                            for (StandardProductList pl1 : standardProductList) {
                                int count2 = 0;
@@ -178,6 +181,14 @@
                                        pl2.setUpdateTime(LocalDateTime.now());
                                        pl2.setId(pl1.getId());
                                        pl2.setSample(tree.getSample());
                                        pl2.setDic(pl1.getDic());
                                        //如果标准库里面的要求有值则不更新,要求为null则同步更新
                                        if (ObjectUtils.isNotEmpty(pl1.getAsk())){
                                            pl2.setAsk(null);
                                        }
                                        if (ObjectUtils.isNotEmpty(pl1.getTell())){
                                            pl2.setTell(null);
                                        }
                                        standardProductListMapper.updateById(pl2);
                                        break;
                                    } else {