value
2024-04-30 ec6c3bc0b778178b2518302ffc9099ac8f6cc8a2
标准库修复
已修改9个文件
83 ■■■■■ 文件已修改
cnas-server/src/main/java/com/yuanchu/mom/dto/PageTestObjectDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/pojo/StructureTestObject.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/resources/mapper/StructureTestMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/mapper/StandardMethodListMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/StandardMethodListMapper.xml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/StandardTreeMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/dto/PageTestObjectDto.java
@@ -16,7 +16,7 @@
    @ApiModelProperty(value = "产品")
    private String product;
    @ValueTableShow(2)
    @ValueTableShow(3)
    @ApiModelProperty(value = "创建人")
    private String createUserName;
cnas-server/src/main/java/com/yuanchu/mom/pojo/StructureTestObject.java
@@ -31,6 +31,10 @@
    @ApiModelProperty(value = "检验对象")
    private String specimenName;
    @ValueTableShow(1)
    @ApiModelProperty(value = "检验对象EN")
    private String specimenNameEn;
    @ValueTableShow(2)
    @ApiModelProperty(value = "对象代号")
    private String code;
@@ -43,7 +47,7 @@
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
    @ValueTableShow(3)
    @ValueTableShow(4)
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
cnas-server/src/main/resources/mapper/StructureTestMapper.xml
@@ -14,7 +14,8 @@
        sto.update_time,
        sto.code,
        sto.laboratory_id,
        GROUP_CONCAT(p.name) product
        GROUP_CONCAT(p.name) product,
        sto.specimen_name_en
        from structure_test_object sto
        left join user u1 on sto.create_user = u1.id
        left join user u2 on sto.update_user = u2.id
inspect-server/src/main/java/com/yuanchu/mom/mapper/StandardMethodListMapper.java
@@ -21,6 +21,8 @@
    List<StandardMethodList> selectStandardMethodLists(String tree);
    List<StandardMethodList> selectStandardMethodLists3(String tree);
    List<StandardMethodList> selectStandardMethodLists2(String data1,String data2,String data3,String data4, String data5);
    List<StandardProductList> selectParameterList(String code);
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java
@@ -9,7 +9,6 @@
import com.yuanchu.mom.service.StandardMethodListService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
@@ -31,7 +30,6 @@
    private StandardProductListMapper standardProductListMapper;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int addStandardMethodList(Integer standardId, String tree) {
        String[] trees = tree.split(" - ");
        Map<String, String> map = standardMethodListMapper.selectStandardMethodById(standardId);
@@ -83,18 +81,25 @@
        switch (trees.length){
            case 5:
                str += "\"" + trees[2] + "\",\"" + trees[3] + "\",\"" + trees[4] + "\"";
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists(str));
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\",\"" + trees[3] + "\""));
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\""));
                break;
            case 4:
                str += "\"" + trees[2] + "\",\"" + trees[3] + "\"";
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists(str));
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\""));
                break;
            case 3:
                str += "\"" + trees[2] + "\"";
                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists3(str));
                break;
            default:
                map.put("standardMethodList", null);
                return map;
        }
        map.put("standardMethodList", standardMethodListMapper.selectStandardMethodLists(str));
        map.put("standardMethodList", standardMethodLists);
        return map;
    }
@@ -125,12 +130,10 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int delStandardMethodByFLSSM(Integer id) {
        standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id));
        return standardMethodListMapper.deleteById(id);
    }
    @Override
    public List<StandardMethodList> selectStandardMethodEnum() {
        return standardMethodListMapper.selectList(Wrappers.<StandardMethodList>lambdaQuery().select(StandardMethodList::getId,StandardMethodList::getCode,StandardMethodList::getName));
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -13,6 +13,7 @@
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
@@ -46,7 +47,7 @@
    @Override
    public List<StandardProductList> selectStandardProductList(InsSample insSample) {
        List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1));
        List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1).eq(StandardProductList::getModel, insSample.getModel()));
        list = list.stream().filter(a -> {
            try {
                if (a.getSection() != null && !Objects.equals(a.getSection(), "")) {
@@ -82,16 +83,19 @@
    public List<StandardProductList> selectStandardProductListByMethodId(Integer id, String tree) {
        String[] trees = tree.split(" - ");
        StringBuffer str = new StringBuffer();
        List<StandardProductList> list = new ArrayList<>();
        if (trees.length == 3) {
            str.append("\"").append(trees[2]).append("\"");
        } else {
            str.append("\"").append(trees[2]).append("\",\"").append(trees[3]).append("\"");
            list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\""));
        }
        List<StandardProductList> list = standardTreeMapper.selectStandardProductListByTree(str + "");
        list.addAll(standardTreeMapper.selectStandardProductListByTree(str + ""));
        List<StandardProductList> standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, id).eq(StandardProductList::getTree, tree));
        for (StandardProductList sp : standardProductLists) {
            for (StandardProductList pl : list) {
                if (sp.getInspectionItem().equals(pl.getInspectionItem()) && sp.getInspectionItemSubclass().equals(pl.getInspectionItemSubclass())) {
                if (Objects.equals(sp.getInspectionItem(), pl.getInspectionItem())
                        && Objects.equals(sp.getInspectionItemSubclass(), pl.getInspectionItemSubclass())) {
                    pl.setId(sp.getId());
                    pl.setState(sp.getState());
                    pl.setFactory(sp.getFactory());
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java
@@ -2,7 +2,6 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.dto.FactoryDto;
@@ -20,7 +19,6 @@
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
 * @author Administrator
@@ -61,7 +59,7 @@
            case 5:
                standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3]).eq(StandardTree::getModel, trees[4]));
                break;
            case 4:
            /*case 4:
                standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]).eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3]));
                break;
            case 3:
@@ -72,18 +70,7 @@
                break;
            case 1:
                standardTreeMapper.delete(Wrappers.<StandardTree>lambdaUpdate().eq(StandardTree::getFactory, trees[0]));
                break;
        }
        Map<String, List<?>> listMap = standardMethodListService.selectsStandardMethodByFLSSM2(tree);
        if (listMap.get("standardMethodList").size() != 0) {
            for (Object o : listMap.get("standardMethodList")) {
                JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(o));
                List<StandardProductList> list = standardProductListService.selectStandardProductListByMethodId((Integer) jsonObject.get("id"), tree);
                if (list.size() != 0) {
                    standardProductListMapper.deleteBatchIds(list);
                }
            }
            standardMethodListMapper.deleteBatchIds(listMap.get("standardMethodList"));
                break;*/
        }
        return 1;
    }
inspect-server/src/main/resources/mapper/StandardMethodListMapper.xml
@@ -31,16 +31,14 @@
        where is_use = 1
        and is_product = 1
        and (
                structure_test_object_id is null
                OR structure_test_object_id = ''
                OR structure_test_object_id = '[]'
                or structure_test_object_id LIKE CONCAT('%', #{tree}, '%')
            )
            structure_test_object_id is null
            OR structure_test_object_id = ''
            OR structure_test_object_id = '[]'
            or structure_test_object_id LIKE CONCAT('%[', #{tree}, ']%')
        )
    </select>
    <select id="selectParameterList" resultType="standardProductList">
        select
               inspection_item,
               inspection_item_classify,
        select inspection_item,
               inspection_item_subclass,
               laboratory,
               unit,
@@ -49,10 +47,8 @@
               man_hour_group,
               inspection_item_type,
               inspection_value_type,
               device_group,
               checkout_number,
               section,
               value_type,
               method,
               man_day,
               bsm,
@@ -79,4 +75,16 @@
            and model = #{data5}
        </if>
    </select>
    <select id="selectStandardMethodLists3" resultType="com.yuanchu.mom.pojo.StandardMethodList">
        select id, code, name, remark
        from standard_method
        where is_use = 1
          and is_product = 1
          and (
                structure_test_object_id is null
                OR structure_test_object_id = ''
                OR structure_test_object_id = '[]'
                or structure_test_object_id LIKE CONCAT('%', #{tree}, '%')
            )
    </select>
</mapper>
inspect-server/src/main/resources/mapper/StandardTreeMapper.xml
@@ -158,7 +158,7 @@
                      sample is NULL
                      OR sample = ''
                      or sample = '[]'
                      OR sample LIKE CONCAT('%', #{tree}, '%')
                      OR sample LIKE CONCAT('%[', #{tree}, ']%')
                  )
    </select>