jinlin
2024-08-02 91c26508f76c35d9cc889958426fbe48cc205ed9
修改
3个文件已修改
34 ■■■■■ 已修改文件
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java
@@ -57,4 +57,7 @@
    @ApiModelProperty(value = "子节点")
    @TableField(exist = false)
    private List<XhProductModel> children = new ArrayList<>();
    @TableField(exist = false)
    private Long paramId;
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
@@ -175,13 +175,12 @@
            String curXtName = "";
            String curFxtName = "";
            Map<String, XhProductModel> modelMap = new HashMap<>();
            List<XhProductModel> prductList =baseDao.getProductPath(shipId);
            List<XhProductModel> prductList = baseDao.getProductPath(shipId);
            for (XhProductModel product :prductList){
                if(StringUtils.isNotBlank(product.getNamePath())){
                    modelMap.put(product.getNamePath(),product);
            for (XhProductModel product : prductList) {
                if (StringUtils.isNotBlank(product.getNamePath())) {
                    modelMap.put(product.getNamePath(), product);
                }
            }
@@ -280,19 +279,21 @@
                        }
                    }
                    Long paramId = null;
                    String sbPath = curXtName + "," + (StringUtils.isBlank(curFxtName) ? "" : curFxtName + ",") + sb;
                    if (modelMap.get(sbPath) == null) {
                        curSbId = UUIDUtil.generateId();
                        insertSb = true;
                    } else {
                        curSbId = modelMap.get(sbPath).getId();
                        paramId = modelMap.get(sbPath).getParamId();
                    }
                    if (StringUtils.isEmpty(sb)) {
                        com.zt.life.util.ImportUtil.updateErrMap(errMap, "没有填写设备名称", sheetName, row1);
                        continue;
                    }
                    //导入型号产品结果库
                    XhProductModel xhProductModel = new XhProductModel();
@@ -352,7 +353,6 @@
                        this.insert(xhProductModel);
                    }
                    //导入预计参数
                    ParamData itemEntity = new ParamData();
                    //绑定设备ID
@@ -400,10 +400,12 @@
                    if (StringUtils.isNotBlank(repairMttcrOtherParams3)) {
                        itemEntity.setRepairMttcrOtherParams3(Double.valueOf(repairMttcrOtherParams3));
                    }
                    if (modelMap.get(sbPath) == null)
                    if (modelMap.get(sbPath) == null) {
                        paramDataService.insert(itemEntity);
                    else
                    } else {
                        itemEntity.setId(paramId);
                        paramDataService.update(itemEntity);
                    }
                }
            }
modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml
@@ -133,9 +133,12 @@
        </if>
    </select>
    <select id="getProductPath" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel">
        select *
        from product_model
        where IS_DELETE = 0
          and ship_id =${shipId}
        select a.*, b.id as paramId
        from product_model a,
             param_data b
        where a.IS_DELETE = 0
          and b.IS_DELETE = 0
          and a.ship_id = ${shipId}
          and a.id = b.product_id
    </select>
</mapper>