|  |  | @ -345,4 +345,108 @@ public class ThrProductsAddDiController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return ResultVOUtils.success(); |  |  |  |         return ResultVOUtils.success(); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     /** | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      * 更新DI产品信息 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      * | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      * @param | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      * @return | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      */ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @PostMapping("udiwms/thrsys/updateThrAddDiProductsList") | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Log(title = "DI产品信息", businessType = BusinessType.UPDATE) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public BaseResponse updateThrAddDiProductsList() { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         FilterThrProductsRequest filterThrProductsRequest=new FilterThrProductsRequest(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         filterThrProductsRequest.setStatus(2); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<ThrProductsAddDiEntity>  thrProductsAddDiEntityList=thrProductsAddDiService.filterThrProductsDiLists(filterThrProductsRequest); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (ThrProductsAddDiEntity thrProductsAddDiEntity:thrProductsAddDiEntityList){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             thrProductsAddDiEntity.setAuditTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             thrProductsAddDiEntity.setAuditUser(customerService.getUserId() + ""); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             thrProductsAddDiEntity = thrProductsAddDiService.selecById(thrProductsAddDiEntity.getId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //自增的数据就再到第三方产品里面
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ThrProductsAddDiResponse thrProductsAddDiResponse = thrProductsAddDiService.selecById(thrProductsAddDiEntity.getId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (thrProductsAddDiEntity.getStatus() == 2) { //审核通过
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 //第三方产品审核通过
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (thrProductsAddDiEntity.getType() == 2) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     ThrProductsEntity thrProductsEntity = new ThrProductsEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     BeanUtils.copyProperties(thrProductsAddDiEntity, thrProductsEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     thrProductsService.insertThrProducts(thrProductsEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     ThrSystemEntity basicThirdSysEntity = thrSystemService.selectMainThrSys(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (basicThirdSysEntity.getThirdId().equals(thrProductsAddDiEntity.getThirdSysFk())) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         if (!udiContrastService.isExit(null, thrProductsAddDiEntity.getCode(), null)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             udiContrastService.createOnlyMainId(thrProductsAddDiEntity.getCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } else {   //选入DI信息审核通过
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     //审核通过后追加到耗材字典中
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     UdiCombineRequest combineRequest = new UdiCombineRequest(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     combineRequest.setCustomerId(Long.valueOf(thrProductsAddDiEntity.getCustomerId())); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     //插入数据,并获取关联主键
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (udiContrastService.isExit(thrProductsAddDiEntity.getUuid(), null, null)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         Long udiRelIdFk = udiContrastService.createOnlyUuid(combineRequest, thrProductsAddDiEntity.getUuid()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         //回填关联关系到关联表
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         companyProductRelevanceEntity.setCustomerId(thrProductsAddDiEntity.getCustomerId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         companyProductRelevanceEntity.setUdiRlIdFk(udiRelIdFk); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         companyProductRelevanceEntity.setCreateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         companyProductRelevanceEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         companyProductRelevanceEntity.setUnitFk(thrProductsAddDiEntity.getCustomerId().toString()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         companyProductRelevanceEntity.setAuditStatus("1"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         if (StrUtil.isNotEmpty(thrProductsAddDiEntity.getPrice())) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             companyProductRelevanceEntity.setPrice(new BigDecimal(thrProductsAddDiEntity.getPrice())); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         companyProductRelevanceService.insertCompanyProductRelevance(companyProductRelevanceEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        Long udiRelIdFk = udiContrastService.createOnlyUuid(combineRequest, thrProductsAddDiEntity.getUuid());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        //字段更新
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(udiRelIdFk);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        //更新产品信息
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        UdiProductEntity udiProductEntity = udiProductService.findByUuid(udiRelevanceEntity.getUuid());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setSptm(thrProductsAddDiResponse.getSptm());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setYbbm(thrProductsAddDiResponse.getYbbm());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setMeasname(thrProductsAddDiResponse.getMeasname());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setManufactory(thrProductsAddDiResponse.getManufactory());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setSpmc(thrProductsAddDiResponse.getSpmc());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setCpms(thrProductsAddDiResponse.getCpms());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setPrice(thrProductsAddDiResponse.getPrice());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setBasicPrductRemak1(thrProductsAddDiResponse.getBasicPrductRemak1());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setBasicPrductRemak2(thrProductsAddDiResponse.getBasicPrductRemak2());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setBasicPrductRemak3(thrProductsAddDiResponse.getBasicPrductRemak3());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setBasicPrductRemak4(thrProductsAddDiResponse.getBasicPrductRemak4());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setBasicPrductRemak5(thrProductsAddDiResponse.getBasicPrductRemak5());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setBasicPrductRemak6(thrProductsAddDiResponse.getBasicPrductRemak6());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setBasicPrductRemak7(thrProductsAddDiResponse.getBasicPrductRemak7());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setBasicPrductRemak8(thrProductsAddDiResponse.getBasicPrductRemak8());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductEntity.setNameCode(null);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiProductService.updateUdiInfoByUuid(udiProductEntity);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        UdiRelevanceEntity udiRelevanceEntity1 = new UdiRelevanceEntity();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceEntity1);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        udiRelevanceService.updateUdiRelevance(udiRelevanceEntity1);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                udiInfoService.updateUdiInfo(udiInfoEntity);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         //回填关联关系到关联表
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        companyProductRelevanceEntity.setCustomerId(thrProductsAddDiEntity.getCustomerId());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        companyProductRelevanceEntity.setUdiRlIdFk(udiRelIdFk);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        companyProductRelevanceEntity.setCreateTime(new Date());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        companyProductRelevanceEntity.setUpdateTime(new Date());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        companyProductRelevanceEntity.setUnitFk(thrProductsAddDiEntity.getCustomerId().toString());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        companyProductRelevanceEntity.setAuditStatus("1");
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        if (StrUtil.isNotEmpty(thrProductsAddDiEntity.getPrice()))
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                            companyProductRelevanceEntity.setPrice(new BigDecimal(thrProductsAddDiEntity.getPrice()));
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //                        companyProductRelevanceService.insertCompanyProductRelevance(companyProductRelevanceEntity);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return ResultVOUtils.success("更新成功"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |