| | |
| | | |
| | | |
| | | /** |
| | | * param_data_expect |
| | | * param_data |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-04 |
| | |
| | | @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)); |
| | |
| | | @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(); |
| | |
| | | ParamData data =new ParamData(); |
| | | data.setShipId(id); |
| | | data.setProductId(id); |
| | | data.setPageCode("expect"); |
| | | |
| | | paramDataService.insert(data); |
| | | } |
| | | |
| | |
| | | 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(); |
| | |
| | | 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); |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * param_data_expect |
| | | * param_data |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-04 |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private Long productIdInit; |
| | | |
| | | private String pageCode; |
| | | |
| | | @TableField(exist = false) |
| | | private List<ParamData> dataThreeList; |
| | |
| | | |
| | | |
| | | /** |
| | | * param_data_expect |
| | | * param_data |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-04 |
| | |
| | | */ |
| | | 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; |
| | | } |
| | |
| | | /** |
| | | * 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> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | |
| | | * @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; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | |
| | | Long curXtId = null; |
| | | Long curFxtId = null; |
| | | Long curSbId = null; |
| | | Long curSbId; |
| | | String curXtName = ""; |
| | | String curFxtName = ""; |
| | | |
| | |
| | | ParamData itemEntity = new ParamData(); |
| | | itemEntity.setShipId(shipId); |
| | | itemEntity.setProductId(curXtId); |
| | | itemEntity.setPageCode("expect"); |
| | | paramDataService.insert(itemEntity); |
| | | } |
| | | |
| | |
| | | ParamData itemEntity = new ParamData(); |
| | | itemEntity.setShipId(shipId); |
| | | itemEntity.setProductId(curFxtId); |
| | | itemEntity.setPageCode("expect"); |
| | | paramDataService.insert(itemEntity); |
| | | } |
| | | |
| | |
| | | //绑定设备ID |
| | | itemEntity.setShipId(shipId); |
| | | itemEntity.setProductId(curSbId); |
| | | itemEntity.setPageCode("expect"); |
| | | itemEntity.setReliabDistribType(reliabType.get(reliabDistribType)); |
| | | itemEntity.setBasicJoinCompute(isOrNot.get(basicJoinCompute)); |
| | | if (StringUtils.isNotBlank(basicMtbfRegulate)) { |
| | |
| | | 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); |
| | | } |
| | |
| | | public class SimulaDataDto { |
| | | private Double Mttr; |
| | | private Double Mtbf; |
| | | private Double Msr; |
| | | private Long productId; |
| | | private CurveParam curveParam; |
| | | } |
| | |
| | | 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 <> 10 |
| | |
| | | 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"> |
| | |
| | | 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}) |
| | |
| | | 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.* |
| | |
| | | }, |
| | | mounted() { |
| | | this.$refs.modelTree.getProductList() |
| | | console.log(this.pageCode, 'this.pageCode this.pageCode') |
| | | }, |
| | | methods: { |
| | | onProductSelected(data) { |
| | |
| | | effect: '', |
| | | hit: false, |
| | | dataForm: { |
| | | pageCode: this.$route.query.pageCode, |
| | | id: '', |
| | | pid: '', |
| | | srcId: '', |
| | |
| | | }, |
| | | 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') |
| | | }, |
| | |
| | | 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: '', |
| | |
| | | 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> |
| | |
| | | data() { |
| | | return { |
| | | url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=`, |
| | | productType: '', |
| | | shipId: '', |
| | | namePath:'', |
| | | dataForm: { |
| | |
| | | methods: { |
| | | add() { |
| | | this.dataForm.type = this.productType |
| | | |
| | | if (this.dataForm.type !== '1') { |
| | | this.$refs.SelectTyModel.$refs.dialog.init(null, { |
| | | type: this.dataForm.type, |
| | |
| | | } |
| | | }, |
| | | 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) |
| | |
| | | }, |
| | | onDefault(defaultId) { |
| | | this.dataForm.pid = defaultId |
| | | this.dataForm.type = 1 |
| | | this.productType = 1 |
| | | this.dataForm.type = '1' |
| | | this.productType = '1' |
| | | this.$refs.tableObj.query() |
| | | }, |
| | | } |
| | |
| | | async getProductList() { |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList') |
| | | this.productList = res.data |
| | | this.onProductSelected(this.productList[0]) |
| | | }, |
| | | async getTaskList() { |
| | | let params = { |
| | |
| | | yDataList: [], |
| | | mttr: '', |
| | | mtbf: '', |
| | | msr: '', |
| | | myChart: {}, |
| | | myChartStyle: {float: "left", width: "100%", height: "600px"}, //图表样式 |
| | | option: {} |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | async getProductList() { |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList') |
| | | this.productList = res.data |
| | | this.onProductSelected(this.productList[0]) |
| | | }, |
| | | async getTaskList() { |
| | | let params = { |
| | |
| | | async getProductList() { |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList') |
| | | this.productList = res.data |
| | | this.onProductSelected(this.productList[0]) |
| | | }, |
| | | async getTaskList() { |
| | | let params = { |