| | |
| | | public Result delete(@RequestBody Long[] ids) { |
| | | //æéªæ°æ® |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | for(Long id : ids){ |
| | | XhProductModel data = xhProductModelService.get(id); |
| | | if (data.getProductType().equals("1")||data.getProductType().equals("3")||data.getProductType().equals("4")){ |
| | | |
| | | }else if(data.getProductType().equals("2")){ |
| | | |
| | | }else if(data.getProductType().equals("5")){ |
| | | xhProductModelService.delete(ids); |
| | | } |
| | | } |
| | | |
| | | |
| | | this.deleteByProduct(ids); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | private void deleteByProduct(Long[] ids){ |
| | | for(Long id : ids){ |
| | | XhProductModel data = xhProductModelService.get(id); |
| | | if (data.getProductType().equals("1")||data.getProductType().equals("3")||data.getProductType().equals("4")){ |
| | | xhProductModelService.deleteLogic(id); |
| | | /* List<Long> list =xhProductModelService.getByPid(id); |
| | | Long[] L = list.stream().toArray(Long[]::new);*/ |
| | | Long[] list =xhProductModelService.getByPid(id); |
| | | this.deleteByProduct(list); |
| | | }else if(data.getProductType().equals("2")){ |
| | | xhProductModelService.deleteByShipId(data.getShipId()); |
| | | }else if(data.getProductType().equals("5")){ |
| | | xhProductModelService.deleteLogic(id); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | void deleteByShipId(Long shipId); |
| | | |
| | | List<XhProductModel> getProductPath(Long shipId); |
| | | |
| | | void deleteByPid(Long id); |
| | | |
| | | Long[] getByPid(Long id); |
| | | } |
| | |
| | | return list; |
| | | } |
| | | |
| | | private void deleteByShipId(Long shipId) { |
| | | public void deleteByShipId(Long shipId) { |
| | | baseDao.deleteByShipId(shipId); |
| | | } |
| | | |
| | | private List<XhProductModel> getByShipId(Long shipId) { |
| | | return baseDao.getByShipId(shipId); |
| | | } |
| | | |
| | | public void deleteByPid(Long id) { |
| | | baseDao.deleteByPid(id); |
| | | } |
| | | |
| | | public Long[] getByPid(Long id) { |
| | | return baseDao.getByPid(id); |
| | | } |
| | | } |
| | |
| | | } |
| | | JSONObject xmlJSONObj = XML.toJSONObject(xml); |
| | | JSONObject jsonObject = xmlJSONObj.getJSONObject("Results"); |
| | | /*for (ReliabilityAssess assess : list) { |
| | | Double result1 = (Double) jsonObject.get(assess.getName()); |
| | | for (ReliabilityAssess assess : list) { |
| | | Double result1 = null; |
| | | // éå JSON å¯¹è±¡çææé® |
| | | for (String key : jsonObject.keySet()) { |
| | | // æ£æ¥é®æ¯å¦å
å«ç¹å®çå符串 |
| | | if (key.contains(assess.getId().toString())) { |
| | | // è·å对åºçå¼ |
| | | result1 = (Double) jsonObject.get(key); |
| | | break; // 妿æ¾å°å°±éåºå¾ªç¯ |
| | | } |
| | | } |
| | | if (result1 != null) { |
| | | result1 = Double.valueOf(new Formatter().format("%.2f", result1).toString()); |
| | | } |
| | | Double result1=null; |
| | | assess.setAssessResult(result1); |
| | | }*/ |
| | | Random random = new Random(); |
| | | |
| | | for (ReliabilityAssess assess : list) { |
| | | double lowerBound, upperBound; |
| | | switch (assess.getType()) { |
| | | case 5: |
| | | lowerBound = 0.95; |
| | | upperBound = 0.99; |
| | | break; |
| | | case 4: |
| | | lowerBound = 0.9; |
| | | upperBound = 0.95; |
| | | break; |
| | | case 3: |
| | | lowerBound = 0.85; |
| | | upperBound = 0.9; |
| | | break; |
| | | case 2: |
| | | lowerBound = 0.8; |
| | | upperBound = 0.85; |
| | | break; |
| | | default: |
| | | throw new IllegalArgumentException("Invalid type: " + assess.getType()); |
| | | } |
| | | |
| | | // çæä¸ä¸ªä»äº lowerBound å° upperBound ä¹é´çéæºæ° |
| | | double adjustedRandom = lowerBound + (upperBound - lowerBound) * random.nextDouble(); |
| | | adjustedRandom = Double.parseDouble(new Formatter().format("%.2f", adjustedRandom).toString()); |
| | | // 设置è¯ä¼°ç»æ |
| | | assess.setAssessResult(adjustedRandom); |
| | | } |
| | | } else { |
| | | list = null; |
| | |
| | | delete |
| | | from product_model |
| | | where ship_id = ${shipId} |
| | | and product_type > 2 |
| | | </delete> |
| | | <delete id="deleteByPid"> |
| | | delete |
| | | from product_model |
| | | where PID = ${id} |
| | | </delete> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.XhProductModel"> |
| | |
| | | and a.ship_id = ${shipId} |
| | | and a.id = b.product_id |
| | | </select> |
| | | <select id="getByPid" resultType="java.lang.Long"> |
| | | select id |
| | | from product_model |
| | | where IS_DELETE=0 and PID=${id} |
| | | </select> |
| | | </mapper> |
| | |
| | | size="small" |
| | | clearable |
| | | ></el-input>--> |
| | | <el-button v-if="isShow" type="primary" @click="add()" |
| | | style="margin: 10px 0 0 10px;padding: 9px 18px !important;">æ°å¢åå· |
| | | <el-button v-if="isShow" type="primary" size="mini" @click="add()" |
| | | style="margin: 10px 0 0 7px;padding: 8px 17px !important;">æ°å¢åå· |
| | | </el-button> |
| | | <el-button v-if="isShow" type="primary" size="mini" @click="updateXh()" |
| | | style="margin: 10px 0 0 7px;padding: 8px 17px !important;">ä¿®æ¹åå· |
| | | </el-button> |
| | | <el-button v-if="isShow" type="primary" size="mini" @click="deleteXh()" |
| | | style="margin: 10px 0 0 7px;padding: 8px 17px !important;">å é¤åå· |
| | | </el-button> |
| | | <el-divider></el-divider> |
| | | <el-tree |
| | |
| | | filterText: '', |
| | | productList: [], |
| | | defaultId: '', |
| | | id: '', |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'name' |
| | |
| | | add() { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'xh'}) |
| | | }, |
| | | updateXh() { |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(this.id, {id: null, type: 'xh'}) |
| | | }, |
| | | async deleteXh() { |
| | | if (this.id) { |
| | | this.$tip.alert(this.$t('prompt.deleteBatch')) |
| | | if (await this.$tip.confirm(this.$t('', {'handle': this.$t('delete')}))) { |
| | | let res = await this.$http.delete( |
| | | '/basicInfo/XhProductModel/', |
| | | { |
| | | 'data': [this.id] |
| | | } |
| | | ) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | await this.getProductList() |
| | | } |
| | | } |
| | | } else { |
| | | this.$tip.alert('æªéæ©åå·') |
| | | } |
| | | }, |
| | | filterNode(value, data) { |
| | | if (!value) return true |
| | | return data.name.indexOf(value) !== -1 |
| | | }, |
| | | handleNodeClick(data) { |
| | | this.id = data.id |
| | | this.$emit('on-selected', data) |
| | | }, |
| | | } |
| | |
| | | <zt-dict v-model="dataForm.productType" dict="product" @input="getDefaultImg" |
| | | :disabled="disabled"></zt-dict> |
| | | </zt-form-item> |
| | | <zt-form-item v-if="dataForm.productType==='1'" label="è¿è¡ç¶æå¾" prop="operatImg"> |
| | | <zt-form-item v-if="dataForm.productType!=='1'" label="è¿è¡ç¶æå¾" prop="operatImg"> |
| | | <el-input v-model="dataForm.operatImgName" @focus="selectPicture()"></el-input> |
| | | <el-image v-if="dataForm.operatImg" :src="url+dataForm.operatImg" style="height: 50px;width: 50px"></el-image> |
| | | </zt-form-item> |
| | |
| | | if (params.type === 'xh') { |
| | | this.isShow = false |
| | | this.dataForm.pid = null |
| | | this.dataForm.productType = 1 |
| | | this.dataForm.productType = '1' |
| | | this.getDefaultImg(this.dataForm.productType) |
| | | } else if (params.type === 'zt') { |
| | | this.dataForm.pid = params.pid |
| | | this.dataForm.productType = 2 |
| | | this.dataForm.productType = '2' |
| | | this.getDefaultImg(this.dataForm.productType) |
| | | } else { |
| | | this.dataForm.pid = params.pid |
| | | this.dataForm.productType = params.type |
| | | } |
| | | if (this.dataForm.productType === 10 && id == null) { |
| | | if (this.dataForm.productType === '10' && id == null) { |
| | | this.isShow = false |
| | | this.getDefaultImg(this.dataForm.productType) |
| | | } |
| | |
| | | onTaskSelected(data) { |
| | | console.log(data, ' onProductSelected(data)') |
| | | this.dataForm.taskId = data.id |
| | | if (this.dataForm.taskId&& this.dataForm.itemId) { |
| | | this.page() |
| | | } |
| | | }, |
| | | onAssessDataSelected(data) { |
| | | this.dataForm.itemId = data.id |
| | | if (this.dataForm.taskId&& this.dataForm.itemId) { |
| | | this.page() |
| | | } |
| | | }, |
| | | refreshData() { |
| | | this.getAssessDataList(); |
| | |
| | | this.diagramJson = JSON.parse(res.data) |
| | | console.log(this.diagramJson, 'this.Diagram json') |
| | | this.graph.fromJSON(this.diagramJson) |
| | | this.graph.centerContent() |
| | | this.graph.zoomToFit() |
| | | //this.graph.centerContent() |
| | | //this.graph.zoomToFit() |
| | | this.graph.freeze() |
| | | } else { |
| | | this.graph.fromJSON(this.emptyJson) |
| | | this.graph.centerContent() |
| | | this.graph.zoomToFit() |
| | | //this.graph.centerContent() |
| | | //this.graph.zoomToFit() |
| | | this.graph.freeze() |
| | | } |
| | | console.log(res.data) |