jinlin
2024-08-06 e9d48b14eb8496737495a659a6f126d88ef7d353
修改
19个文件已修改
140 ■■■■ 已修改文件
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataDao.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamData.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/TyProductModelService.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/SimulaDataDto.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataDao.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/baseReliability/ParamDataBasic.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/ParamData.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/SelectTyModel.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/XhProductModel.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/SimulatAssess.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/SimulatCurve.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/SimulatHistory.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/TimeDiagram.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/ParamDataController.java
@@ -25,7 +25,7 @@
/**
 * param_data_expect
 * param_data
 *
 * @author zt generator
 * @since 1.0.0 2024-03-04
@@ -47,8 +47,7 @@
            @ApiImplicitParam(name = "repairable", value = "可维修", dataType = Constant.QT.STRING, format = "repairable^EQ"),
            @ApiImplicitParam(name = "basicJoinCompute", value = "参与计算", dataType = Constant.QT.STRING, format = "basic_join_compute^EQ"),
            @ApiImplicitParam(name = "nodeType", value = "类型", dataType = Constant.QT.STRING),
            @ApiImplicitParam(name = "srcId", value = "上级ID", dataType = Constant.QT.STRING),
            @ApiImplicitParam(name = "pageCode", value = "", dataType = Constant.QT.STRING)})
            @ApiImplicitParam(name = "srcId", value = "上级ID", dataType = Constant.QT.STRING)})
    public Result<List<ParamData>> page(@ApiIgnore @QueryParam QueryFilter queryFilter) {
        return Result.ok(paramDataService.page(queryFilter));
@@ -75,12 +74,11 @@
    @PostMapping("save")
    public Result save(@RequestBody ParamData paramData) {
        //效验数据
        for (ParamData expect : paramData.getDataThreeList()) {
            if (expect.getId()!=null){
                paramDataService.update(expect);
        for (ParamData data : paramData.getDataThreeList()) {
            if (data.getId()!=null){
                paramDataService.update(data);
            }else{
                expect.setPageCode(paramData.getPageCode());
                paramDataService.insert(expect);
                paramDataService.insert(data);
            }
        }
        return Result.ok();
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
@@ -140,7 +140,7 @@
            ParamData data =new ParamData();
            data.setShipId(id);
            data.setProductId(id);
            data.setPageCode("expect");
            paramDataService.insert(data);
        }
@@ -156,6 +156,11 @@
            xhProductModel.setId(null);
            xhProductModel.setSort(xhProductModel.getSort());
            xhProductModel.setProductType(xhProductModel.getNodeType());
            if (xhProductModel.getNamePath()==null){
                xhProductModel.setNamePath(xhProductModel.getName());
            }else{
                xhProductModel.setNamePath(xhProductModel.getNamePath()+","+xhProductModel.getName());
            }
            this.insert(xhProductModel);
        }
        return Result.ok();
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/dao/ParamDataDao.java
@@ -19,12 +19,10 @@
public interface ParamDataDao extends BaseDao<ParamData> {
    List<ParamData> getList(Map<String, Object> params);
    ParamData getParamData(Long productId, String pageCode);
    ParamData getParamData(Long productId);
    List<ParamData> getByShipId(Long shipId);
    List<ParamData> getDeviceParams(Long shipId);
    void deleteByShipId(Long shipId);
    void recalculate(Long shipId);
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/ParamData.java
@@ -13,7 +13,7 @@
import java.util.List;
/**
 * param_data_expect
 * param_data
 *
 * @author zt generator
 * @since 1.0.0 2024-03-04
@@ -113,8 +113,6 @@
    @TableField(exist = false)
    private Long productIdInit;
    private String pageCode;
    @TableField(exist = false)
    private List<ParamData> dataThreeList;
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/ParamDataService.java
@@ -10,7 +10,7 @@
/**
 * param_data_expect
 * param_data
 *
 * @author zt generator
 * @since 1.0.0 2024-03-04
@@ -26,8 +26,8 @@
     */
    public List<ParamData> page(QueryFilter queryFilter) {
        List<ParamData> list = baseDao.getList(queryFilter.getQueryParams());
        for (ParamData expect : list) {
            expect.setProductId(expect.getProductIdInit());
        for (ParamData data : list) {
            data.setProductId(data.getProductIdInit());
        }
        return list;
    }
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/TyProductModelService.java
@@ -15,11 +15,11 @@
/**
 * product_model_common
 *
 * @author zt generator
 * @author zt generator
 * @since 1.0.0 2024-02-28
 */
@Service
public class TyProductModelService  extends BaseService<TyProductModelDao, TyProductModel> {
public class TyProductModelService extends BaseService<TyProductModelDao, TyProductModel> {
    /**
     * 分页查询
@@ -28,8 +28,8 @@
     * @return
     */
    public List<TyProductModel> page(QueryFilter queryFilter) {
        List<TyProductModel> list =baseDao.getList(queryFilter.getQueryParams());
        return list ;
        List<TyProductModel> list = baseDao.getList(queryFilter.getQueryParams());
        return list;
    }
    /**
@@ -42,20 +42,20 @@
    }
    public List<TyProductModel> getProductList() {
        List<TyProductModel> ProductList = baseDao.getProductList();
        return ProductList;
        return baseDao.getProductList();
    }
    public List<TyProductModel> getAllTree() {
            List<TyProductModel> productList = baseDao.selectList(new QueryWrapper<TyProductModel>().eq(Constant.TableColumn.IS_DELETE,
                    Constant.Bool.NO).orderByAsc("node_type").orderByAsc(Constant.TableColumn.SORT));
            return TreeUtils.build(productList);
        List<TyProductModel> productList = baseDao.selectList(new QueryWrapper<TyProductModel>().eq(Constant.TableColumn.IS_DELETE,
                Constant.Bool.NO).orderByAsc("node_type").orderByAsc(Constant.TableColumn.SORT));
        return TreeUtils.build(productList);
    }
    public Integer getNo(Long pid, String nodeType) {
        if (baseDao.getNo(pid,nodeType) == null){
        Integer no = baseDao.getNo(pid, nodeType);
        if (no == null) {
            return 0;
        }
        return baseDao.getNo(pid,nodeType);
        return baseDao.getNo(pid, nodeType);
    }
}
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
@@ -159,7 +159,7 @@
            Long curXtId = null;
            Long curFxtId = null;
            Long curSbId = null;
            Long curSbId;
            String curXtName = "";
            String curFxtName = "";
@@ -281,7 +281,6 @@
                        ParamData itemEntity = new ParamData();
                        itemEntity.setShipId(shipId);
                        itemEntity.setProductId(curXtId);
                        itemEntity.setPageCode("expect");
                        paramDataService.insert(itemEntity);
                    }
@@ -301,7 +300,6 @@
                        ParamData itemEntity = new ParamData();
                        itemEntity.setShipId(shipId);
                        itemEntity.setProductId(curFxtId);
                        itemEntity.setPageCode("expect");
                        paramDataService.insert(itemEntity);
                    }
@@ -323,7 +321,6 @@
                    //绑定设备ID
                    itemEntity.setShipId(shipId);
                    itemEntity.setProductId(curSbId);
                    itemEntity.setPageCode("expect");
                    itemEntity.setReliabDistribType(reliabType.get(reliabDistribType));
                    itemEntity.setBasicJoinCompute(isOrNot.get(basicJoinCompute));
                    if (StringUtils.isNotBlank(basicMtbfRegulate)) {
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/controller/SimulatAssessController.java
@@ -181,8 +181,12 @@
                        doubleArray.add(Double.parseDouble(arr[a]));
                    }
                    param.setYData(doubleArray);
                    data.setMtbf((Double) jsonArray.getJSONObject(i).get("mttf"));
                    data.setMttr((Double) jsonArray.getJSONObject(i).get("mttr"));
                    Double mtbf = (Double) jsonArray.getJSONObject(i).get("mttf");
                    Double mttr = (Double) jsonArray.getJSONObject(i).get("mttr");
                    Double msr = (Double) jsonArray.getJSONObject(i).get("msr");
                    data.setMtbf(mtbf);
                    data.setMttr(mttr);
                    data.setMsr(msr);
                }
                data.setCurveParam(param);
            }
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/dto/SimulaDataDto.java
@@ -7,6 +7,7 @@
public class SimulaDataDto {
    private Double Mttr;
    private Double Mtbf;
    private Double Msr;
    private Long productId;
    private CurveParam curveParam;
}
modules/mainPart/src/main/resources/mapper/basicInfo/ParamDataDao.xml
@@ -19,7 +19,7 @@
        END AS productIdInit
        FROM
        product_model a
        LEFT JOIN param_data b ON b.product_id = a.id and b.page_code = '${pageCode}' and b.is_delete = 0
        LEFT JOIN param_data b ON b.product_id = a.id  and b.is_delete = 0
        <where>
            a.is_delete = 0
            and a.product_type &lt;&gt; 10
@@ -41,7 +41,6 @@
        FROM param_data a
        WHERE a.is_delete = 0
          and a.product_id = #{productId}
          and a.page_code = #{pageCode}
        limit 1
    </select>
    <select id="getByShipId" resultType="com.zt.life.modules.mainPart.basicInfo.model.ParamData">
modules/mainPart/src/main/resources/mapper/basicInfo/XhProductModelDao.xml
@@ -70,7 +70,7 @@
               p.repair_mttcr_other_params3 as repairMttcrOtherParams3
        FROM product_model a
                 left join sys_dict_data d on d.DICT_VALUE = a.product_type and dict_type_id = '1728965873022050306'
                 left join param_data p on p.product_id = a.id and p.page_code = 'expect'
                 left join param_data p on p.product_id = a.id
                 left join sys_picture_base s on s.id = a.operat_img
        WHERE a.is_delete = 0
          AND ((a.PID = ${productId})
@@ -109,6 +109,7 @@
        from product_model a
        where a.is_delete = 0
          and a.product_type = 2
        order by sort
    </select>
    <select id="getById" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel">
        select a.*
web/src/views/modules/baseReliability/ParamDataBasic.vue
@@ -86,7 +86,6 @@
    },
    mounted() {
      this.$refs.modelTree.getProductList()
      console.log(this.pageCode, 'this.pageCode this.pageCode')
    },
    methods: {
      onProductSelected(data) {
web/src/views/modules/basicInfo/ParamData.vue
@@ -304,7 +304,6 @@
        effect: '',
        hit: false,
        dataForm: {
          pageCode: this.$route.query.pageCode,
          id: '',
          pid: '',
          srcId: '',
@@ -382,16 +381,13 @@
    },
    mounted() {
      this.$refs.modelTree.getProductList()
      this.pageCode = this.$route.query.pageCode
      this.dataForm.pageCode = this.$route.query.pageCode
      console.log(this.pageCode, 'this.pageCode this.pageCode')
    },
    methods: {
      add() {
        this.$refs.SelectTyModel.$refs.dialog.init(null, {
          type: this.dataForm.productType + 1,
          id: this.dataForm.srcId,
          pageCode: this.pageCode
          pageCode: 'expect'
        })
        console.log(this.dataForm.srcId, 'add')
      },
web/src/views/modules/basicInfo/SelectTyModel.vue
@@ -28,16 +28,17 @@
    name: 'SelectTyModel',
    data() {
      return {
        url: '/basicInfo/XhProductModel/page',
        url: '/basicInfo/TyProductModel/page',
        selectList: [],
        data: '',
        pageCode:'',
        dataForm: {
          type: 'noTree',
          nodeType: '',
          shipId:'',
          id: '',
          pid: '',
          name: '',
          namePath: '',
          operationalStatus: '',
          standbyState: '',
          faultState: '',
@@ -50,39 +51,28 @@
      init(id, params) {
        this.dataForm.nodeType = params.type
        this.dataForm.pid = params.id
        this.pageCode = params.pageCode
        if (!this.pageCode) {
          this.url = '/basicInfo/TyProductModel/page'
        }
        this.dataForm.shipId =params.shipId
        this.dataForm.namePath =params.namePath
        console.log(params, 'init()')
      },
      changeRow(selection) {
        console.log(selection, ' changeRow(selection)')
        let item = {}
        for (item of selection) {
          console.log(item)
          item.pid = this.dataForm.pid
          item.namePath = this.dataForm.namePath
          item.shipId = this.dataForm.shipId
        }
        this.selectList = selection
        this.selectList.forEach( item => {
          item.pageCode = this.pageCode
        })
      },
      async formSubmit() {
        let res
        if (this.pageCode) {
          if (this.pageCode === 'expect' || this.pageCode === 'assign') {
            res = await this.$http.post('/basicInfo/ParamData/get', this.selectList)
          }
          } else {
            res = await this.$http.post('/basicInfo/XhProductModel/get', this.selectList)
          }
          if (res.success) {
            await this.$tip.success()
            this.$refs.dialog.close()
            this.$emit('refreshDataList')
          }
        let res = await this.$http.post('/basicInfo/XhProductModel/get', this.selectList)
        if (res.success) {
          await this.$tip.success()
          this.$refs.dialog.close()
          this.$emit('refreshDataList')
        }
      }
    }
  }
</script>
web/src/views/modules/basicInfo/XhProductModel.vue
@@ -70,7 +70,6 @@
    data() {
      return {
        url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=`,
        productType: '',
        shipId: '',
        namePath:'',
        dataForm: {
@@ -94,6 +93,7 @@
    methods: {
      add() {
        this.dataForm.type = this.productType
        if (this.dataForm.type !== '1') {
          this.$refs.SelectTyModel.$refs.dialog.init(null, {
            type: this.dataForm.type,
@@ -126,17 +126,15 @@
        }
      },
      onProductSelected(data) {
        console.log(data, 'onProductSelected')
        this.shipId = data.shipId
        this.dataForm.pid = data.id
        this.dataForm.type = data.productType
        this.productType = data.productType
        this.namePath = data.namePath
        console.log(data.namePath,'data.namePath')
        if (data.productType !== '10') {
          this.$refs.tableObj.query()
        }
        console.log(data.productType, ' data.productType')
        console.log(this.productType, ' data.productType')
      },
      importData(row) {
        this.$refs.ProductImport.$refs.dialog.init(row)
@@ -146,8 +144,8 @@
      },
      onDefault(defaultId) {
        this.dataForm.pid = defaultId
        this.dataForm.type = 1
        this.productType = 1
        this.dataForm.type = '1'
        this.productType = '1'
        this.$refs.tableObj.query()
      },
    }
web/src/views/modules/taskReliability/SimulatAssess.vue
@@ -113,6 +113,7 @@
      async getProductList() {
        let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList')
        this.productList = res.data
        this.onProductSelected(this.productList[0])
      },
      async getTaskList() {
        let params = {
web/src/views/modules/taskReliability/SimulatCurve.vue
@@ -15,6 +15,7 @@
        yDataList: [],
        mttr: '',
        mtbf: '',
        msr: '',
        myChart: {},
        myChartStyle: {float: "left", width: "100%", height: "600px"}, //图表样式
        option: {}
@@ -31,10 +32,11 @@
          this.xDataList = res.data.curveParam.xdata
          this.mttr = res.data.mttr.toFixed(4)
          this.mtbf = res.data.mtbf.toFixed(4)
          this.msr = res.data.msr.toFixed(4)
        }
        this.option = {
          title: {
            text: "mttr:" + this.mttr + "    mtbf:" + this.mtbf,
            text: "mttr:" + this.mttr + "    mtbf:" + this.mtbf+ "    msr:" + this.msr,
            textStyle: { // 主标题文本样式{"fontSize": 18,"fontWeight": "bolder","color": "#333"}
              fontFamily: 'Arial',
              fontSize: 30,
@@ -81,10 +83,11 @@
          this.xDataList = res.data.curveParam.xdata
          this.mttr = res.data.mttr.toFixed(4)
          this.mtbf = res.data.mtbf.toFixed(4)
          this.msr = res.data.msr.toFixed(4)
        }
        this.option = {
          title: {
            text: "mttr:" + this.mttr + "    mtbf:" + this.mtbf,
            text: "mttr:" + this.mttr + "    mtbf:" + this.mtbf+ "    msr:" + this.msr,
            textStyle: { // 主标题文本样式{"fontSize": 18,"fontWeight": "bolder","color": "#333"}
              fontFamily: 'Arial',
              fontSize: 30,
web/src/views/modules/taskReliability/SimulatHistory.vue
@@ -81,6 +81,7 @@
      async getProductList() {
        let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList')
        this.productList = res.data
        this.onProductSelected(this.productList[0])
      },
      async getTaskList() {
        let params = {
web/src/views/modules/taskReliability/TimeDiagram.vue
@@ -497,6 +497,7 @@
      async getProductList() {
        let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList')
        this.productList = res.data
        this.onProductSelected(this.productList[0])
      },
      async getTaskList() {
        let params = {