jinlin
2024-07-15 878b3569173004ea52ad7c6a538abc86e056d5c8
修改
10个文件已修改
191 ■■■■ 已修改文件
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataDao.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamData.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataService.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java 77 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelLineService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataDao.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/resources/mapper/sysPictureBase/SysPictureBaseDao.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/ParamData.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataDao.java
@@ -21,4 +21,7 @@
    List<ParamData> getList(Map<String, Object> params);
    ParamData getParamData(Long productId, String pageCode);
    List<ParamData> getByShipId(Long shipId);
    void deleteByShipId(Long shipId);
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/XhProductModelDao.java
@@ -30,4 +30,8 @@
    List<XhProductModel> getTaskProductList();
    XhProductModel getById(Long id);
    List<XhProductModel> getByShipId(Long shipId);
    void deleteByShipId(Long shipId);
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamData.java
@@ -24,30 +24,33 @@
    @ApiModelProperty(value = "源ID")
    private Long productId;
    @ApiModelProperty(value = "船ID")
    private Long shipId;
    @TableField(exist = false)
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "基本可靠性运行比")
    private String baseOperatRatio;
    private Double baseOperatRatio;
    @ApiModelProperty(value = "实际运行时间")
    private String actualRunTime;
    private Double actualRunTime;
    @ApiModelProperty(value = "参加计算")
    private Integer basicJoinCompute;
    @ApiModelProperty(value = "规定MTBF")
    private String basicMtbfRegulate;
    private Double basicMtbfRegulate;
    @ApiModelProperty(value = "可接受的MTBF")
    private String basicMtbfAccept;
    private Double basicMtbfAccept;
    @ApiModelProperty(value = "MTBF规定成功率")
    private String basicMtbfRegulSuccRate;
    private Double basicMtbfRegulSuccRate;
    @ApiModelProperty(value = "MTBF可接受成功率")
    private String basicMtbfAcceptSuccRate;
    private Double basicMtbfAcceptSuccRate;
    @ApiModelProperty(value = "单元数量")
    private Integer basicUnitNum;
@@ -56,28 +59,31 @@
    private Integer basicRunsNum;
    @ApiModelProperty(value = "MTBF运行比")
    private String basicMtbfOperatingRatio;
    private Double basicMtbfOperatingRatio;
    @ApiModelProperty(value = "单次运行时间")
    private String basicSingleRunTime;
    private Double basicSingleRunTime;
    @ApiModelProperty(value = "规定MTBCF")
    private String taskMtbcfRegulate;
    private Double taskMtbcfRegulate;
    @ApiModelProperty(value = "可接受的MTBCF")
    private String taskMtbcfAccept;
    private Double taskMtbcfAccept;
    @ApiModelProperty(value = "MTBCF规定成功率")
    private String taskMtbcfRegulSuccRate;
    private Double taskMtbcfRegulSuccRate;
    @ApiModelProperty(value = "MTBCF可接受成功率")
    private String taskMtbcfAcceptSuccRate;
    private Double taskMtbcfAcceptSuccRate;
    @ApiModelProperty(value = "MTBCF运行比")
    private String taskMtbcfOperatingRatio;
    private Double taskMtbcfOperatingRatio;
    @ApiModelProperty(value = "MTBCF其他参数")
    private String taskMtbcfOtherParams;
    @ApiModelProperty(value = "MTBCF其他参数2")
    private Double taskMtbcfOtherParams2;
    @ApiModelProperty(value = "MTBCF其他参数3")
    private Double taskMtbcfOtherParams3;
    @ApiModelProperty(value = "可维修")
    private Integer repairable;
@@ -86,16 +92,19 @@
    private Integer repairDistribType;
    @ApiModelProperty(value = "MTTCR")
    private String repairMttcr;
    private Double repairMttcr;
    @ApiModelProperty(value = "MTTCR其他参数")
    private String repairMttcrOtherParams;
    @ApiModelProperty(value = "MTTCR其他参数2")
    private Double repairMttcrOtherParams2;
    @ApiModelProperty(value = "MTTCR其他参数3")
    private Double repairMttcrOtherParams3;
    @ApiModelProperty(value = "可靠性分布类型")
    private Integer reliabDistribType;
    @ApiModelProperty(value = "运行时间")
    private String runTime;
    private Double runTime;
    @TableField(exist = false)
    private Long productIdInit;
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataService.java
@@ -12,7 +12,7 @@
/**
 * param_data_expect
 *
 * @author zt generator
 * @author zt generator
 * @since 1.0.0 2024-03-04
 */
@Service
@@ -26,7 +26,7 @@
     */
    public List<ParamData> page(QueryFilter queryFilter) {
        List<ParamData> list = baseDao.getList(queryFilter.getQueryParams());
        for (ParamData expect :list){
        for (ParamData expect : list) {
            expect.setProductId(expect.getProductIdInit());
        }
        return list;
@@ -41,4 +41,11 @@
        super.deleteLogic(ids);
    }
    public List<ParamData> getByShipId(Long shipId) {
        return baseDao.getByShipId(shipId);
    }
    public void deleteByShipId(Long shipId) {
        baseDao.deleteByShipId(shipId);
    }
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
@@ -8,15 +8,12 @@
import com.zt.common.utils.TreeUtils;
import com.zt.common.utils.UUIDUtil;
import com.zt.core.shiro.ImportUtil;
import com.zt.life.core.model.ZtProduct;
import com.zt.life.modules.mainPart.basicInfo.dao.XhProductModelDao;
import com.zt.life.modules.mainPart.basicInfo.model.ParamData;
import com.zt.life.modules.mainPart.basicInfo.model.ProductImg;
import com.zt.life.modules.mainPart.basicInfo.model.XhProductModel;
import com.zt.life.modules.mainPart.sysPictureBase.service.SysPictureBaseService;
import com.zt.modules.sys.dto.DictTypeDto;
import com.zt.modules.sys.model.SysDictData;
import com.zt.modules.sys.model.SysDictType;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
@@ -28,11 +25,7 @@
import com.zt.common.db.query.QueryFilter;
import org.springframework.web.multipart.MultipartFile;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@@ -129,8 +122,19 @@
        repairType.put("指数分布", 1);
        repairType.put("威布尔分布", 2);
        Map<String, Integer> isOrNot = new HashMap<>();
        isOrNot.put("是", 0);
        isOrNot.put("否", 1);
        isOrNot.put("是", 1);
        isOrNot.put("否", 0);
        //获取是否有数据,如果有则删除数据
        List<XhProductModel> productList = this.getByShipId(shipId);
        List<ParamData> dataList = paramDataService.getByShipId(shipId);
        if (productList.size() > 0) {
            this.deleteByShipId(shipId);
        }
        if (dataList.size()>0){
            paramDataService.deleteByShipId(shipId);
        }
        try {
            // 获取导入文件的后缀名
            String fileName = mutFile.getOriginalFilename();
@@ -150,8 +154,10 @@
            Long xtId = null;
            Long fxtId = null;
            //导入预计参数
            ParamData itemEntity1 = new ParamData();
            itemEntity1.setShipId(shipId);
            itemEntity1.setProductId(shipId);
            itemEntity1.setPageCode("expect");
            paramDataService.insert(itemEntity1);
@@ -259,6 +265,7 @@
                        //导入预计参数
                        ParamData itemEntity = new ParamData();
                        itemEntity.setShipId(shipId);
                        itemEntity.setProductId(xtId);
                        itemEntity.setPageCode("expect");
                        paramDataService.insert(itemEntity);
@@ -277,6 +284,7 @@
                        //导入预计参数
                        ParamData itemEntity = new ParamData();
                        itemEntity.setShipId(shipId);
                        itemEntity.setProductId(fxtId);
                        itemEntity.setPageCode("expect");
                        paramDataService.insert(itemEntity);
@@ -299,21 +307,46 @@
                    //导入预计参数
                    ParamData itemEntity = new ParamData();
                    //绑定设备ID
                    itemEntity.setShipId(shipId);
                    itemEntity.setProductId(sbId);
                    itemEntity.setPageCode("expect");
                    itemEntity.setReliabDistribType(reliabType.get(reliabDistribType));
                    itemEntity.setBasicJoinCompute(isOrNot.get(basicJoinCompute));
                    itemEntity.setBasicMtbfRegulate(basicMtbfRegulate);
                    itemEntity.setBasicMtbfRegulSuccRate(basicMtbfRegulSuccRate);
                    itemEntity.setBasicMtbfOperatingRatio(basicMtbfOperatingRatio);
                    itemEntity.setTaskMtbcfRegulate(taskMtbcfRegulate);
                    itemEntity.setTaskMtbcfOtherParams(taskMtbcfOtherParams2 + "," + taskMtbcfOtherParams3);
                    itemEntity.setTaskMtbcfRegulSuccRate(taskMtbcfRegulSuccRate);
                    itemEntity.setTaskMtbcfOperatingRatio(taskMtbcfOperatingRatio);
                    if (StringUtils.isNotBlank(basicMtbfRegulate)){
                        itemEntity.setBasicMtbfRegulate(Double.valueOf(basicMtbfRegulate));
                    }
                    if (StringUtils.isNotBlank(basicMtbfRegulSuccRate)){
                        itemEntity.setBasicMtbfRegulSuccRate(Double.valueOf(basicMtbfRegulSuccRate));
                    }
                    if (StringUtils.isNotBlank(basicMtbfOperatingRatio)){
                        itemEntity.setBasicMtbfOperatingRatio(Double.valueOf(basicMtbfOperatingRatio));
                    }
                    if (StringUtils.isNotBlank(taskMtbcfRegulate)){
                        itemEntity.setTaskMtbcfRegulate(Double.valueOf(taskMtbcfRegulate));
                    }
                    if (StringUtils.isNotBlank(taskMtbcfOtherParams2)){
                        itemEntity.setTaskMtbcfOtherParams2(Double.valueOf(taskMtbcfOtherParams2));
                    }
                    if (StringUtils.isNotBlank(taskMtbcfOtherParams3)){
                        itemEntity.setTaskMtbcfOtherParams3(Double.valueOf(taskMtbcfOtherParams3));
                    }
                    if (StringUtils.isNotBlank(taskMtbcfRegulSuccRate)){
                        itemEntity.setTaskMtbcfRegulSuccRate(Double.valueOf(taskMtbcfRegulSuccRate));
                    }
                    if (StringUtils.isNotBlank(taskMtbcfOperatingRatio)){
                        itemEntity.setTaskMtbcfOperatingRatio(Double.valueOf(taskMtbcfOperatingRatio));
                    }
                    itemEntity.setRepairable(isOrNot.get(repairable));
                    itemEntity.setRepairDistribType(repairType.get(repairDistribType));
                    itemEntity.setRepairMttcr(repairMttcr);
                    itemEntity.setRepairMttcrOtherParams(repairMttcrOtherParams2 + "," + repairMttcrOtherParams3);
                    if (StringUtils.isNotBlank(repairMttcr)){
                        itemEntity.setRepairMttcr(Double.valueOf(repairMttcr));
                    }
                    if (StringUtils.isNotBlank(repairMttcrOtherParams2)){
                        itemEntity.setRepairMttcrOtherParams2(Double.valueOf(repairMttcrOtherParams2));
                    }
                    if (StringUtils.isNotBlank(repairMttcrOtherParams3)){
                        itemEntity.setRepairMttcrOtherParams3(Double.valueOf(repairMttcrOtherParams3));
                    }
                    paramDataService.insert(itemEntity);
                }
            }
@@ -342,4 +375,12 @@
        list.add(errMap);
        return list;
    }
    private void deleteByShipId(Long shipId) {
        baseDao.deleteByShipId(shipId);
    }
    private List<XhProductModel> getByShipId(Long shipId) {
        return baseDao.getByShipId(shipId);
    }
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/ModelLineService.java
@@ -276,7 +276,7 @@
                    value = 1.0/value;
                    argsTag.addAttribute("value", value.toString());
                    Element repairTimeLimitTag = element.addElement("RepairTimeLimit");
                    repairTimeLimitTag.setText(paramData.getRepairMttcr());
                    repairTimeLimitTag.setText(String.valueOf(paramData.getRepairMttcr()));
                }
            } else if ("10".equals(xhProductModel.getProductType())) {
                // 虚单位
modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataDao.xml
@@ -2,6 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zt.life.modules.mainPart.basicInfo.dao.ParamDataDao">
    <delete id="deleteByShipId">
        delete from param_data where ship_id =${shipId}
    </delete>
    <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.ParamData">
        SELECT
@@ -38,5 +41,11 @@
          and a.page_code = #{pageCode}
        limit 1
    </select>
    <select id="getByShipId" resultType="com.zt.life.modules.mainPart.basicInfo.model.ParamData">
        SELECT a.*
        FROM param_data a
        where a.is_delete = 0
          and a.ship_id = #{shipId}
    </select>
</mapper>
modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml
@@ -2,6 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zt.life.modules.mainPart.basicInfo.dao.XhProductModelDao">
    <delete id="deleteByShipId">
        delete from product_model where ship_id =${shipId} and product_type &gt; 2
    </delete>
    <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel">
        select *
@@ -108,5 +111,12 @@
        where a.is_delete = 0
          and a.id = #{id}
    </select>
    <select id="getByShipId" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel">
        select a.*
        from product_model a
        where a.is_delete = 0
          and a.ship_id = #{shipId}
          and a.product_type &gt; 2
    </select>
</mapper>
modules/mainPart/src/main/resources/mapper/sysPictureBase/SysPictureBaseDao.xml
@@ -39,13 +39,13 @@
                and ${whereSql}
            </if>
        </where>
            ORDER BY is_default,product_type,id
            ORDER BY is_default desc,product_type,id
    </select>
    <select id="getDefaultImg" resultType="com.zt.life.modules.mainPart.sysPictureBase.model.SysPictureBase">
        select a.name, a.id
        from sys_picture_base a
        where a.is_delete = 0
          and a.is_default = 0
          and a.is_default = 1
          and a.product_type = ${productType}
    </select>
</mapper>
web/src/views/modules/basicInfo/ParamData.vue
@@ -194,10 +194,16 @@
                        <span v-else v-text="scope.row.taskMtbcfOperatingRatio"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="taskMtbcfOtherParams" :key="21" label="MTBCF其他参数" >
                    <el-table-column prop="taskMtbcfOtherParams2" :key="21" label="MTBCF其他参数2" >
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfOtherParams"></el-input>
                        <span v-else v-text="scope.row.taskMtbcfOtherParams"></span>
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfOtherParams2"></el-input>
                        <span v-else v-text="scope.row.taskMtbcfOtherParams2"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="taskMtbcfOtherParams3" :key="30" label="MTBCF其他参数3" >
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfOtherParams3"></el-input>
                        <span v-else v-text="scope.row.taskMtbcfOtherParams3"></span>
                      </template>
                    </el-table-column>
                  </el-table-column>
@@ -240,10 +246,16 @@
                        <span v-else v-text="scope.row.repairMttcr"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="repairMttcrOtherParams" :key="26" label="MTTCR其他参数" >
                    <el-table-column prop="repairMttcrOtherParams2" :key="26" label="MTTCR其他参数2" >
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.repairMttcrOtherParams"></el-input>
                        <span v-else v-text="scope.row.repairMttcrOtherParams"></span>
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.repairMttcrOtherParams2"></el-input>
                        <span v-else v-text="scope.row.repairMttcrOtherParams2"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="repairMttcrOtherParams3" :key="27" label="MTTCR其他参数3" >
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.repairMttcrOtherParams3"></el-input>
                        <span v-else v-text="scope.row.repairMttcrOtherParams3"></span>
                      </template>
                    </el-table-column>
                  </el-table-column>