|  |  |  | @ -27,150 +27,5 @@ import java.util.List; | 
			
		
	
		
			
				
					|  |  |  |  | @Transactional(rollbackFor = Exception.class) | 
			
		
	
		
			
				
					|  |  |  |  | public class ThrProductsAddDiServiceImpl implements ThrProductsAddDiService { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     private ThrProductsAddDiDao thrProductsAddDiDao; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     private ProductInfoService productInfoService; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public List<ThrProductsAddDiResponse> filterThrProductsList(FilterThrProductsRequest filterThrProductsRequest) { | 
			
		
	
		
			
				
					|  |  |  |  |         if (null != filterThrProductsRequest && filterThrProductsRequest.getPage() != null) { | 
			
		
	
		
			
				
					|  |  |  |  |             int offset = (filterThrProductsRequest.getPage() - 1) * filterThrProductsRequest.getLimit(); | 
			
		
	
		
			
				
					|  |  |  |  |             PageHelper.offsetPage(offset, filterThrProductsRequest.getLimit()); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         List<ThrProductsAddDiResponse> thrProductsAddDiResponses = thrProductsAddDiDao.filterThrProductsList(filterThrProductsRequest); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (CollUtil.isNotEmpty(thrProductsAddDiResponses)) { | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiResponses.forEach(thrProductsAddDiResponse -> { | 
			
		
	
		
			
				
					|  |  |  |  |                 thrProductsAddDiResponse.setStandard(thrProductsAddDiResponse.getSpec()); | 
			
		
	
		
			
				
					|  |  |  |  |                 thrProductsAddDiResponse.setZczbhhzbapzbh(thrProductsAddDiResponse.getRegisterNo()); | 
			
		
	
		
			
				
					|  |  |  |  |             }); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         return thrProductsAddDiResponses; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public ThrProductsAddDiResponse selecById(Long id) { | 
			
		
	
		
			
				
					|  |  |  |  |         FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |         filterThrProductsRequest.setId(id); | 
			
		
	
		
			
				
					|  |  |  |  |         List<ThrProductsAddDiResponse> thrProductsAddDiResponses = thrProductsAddDiDao.filterThrProductsList(filterThrProductsRequest); | 
			
		
	
		
			
				
					|  |  |  |  |         if (CollUtil.isNotEmpty(thrProductsAddDiResponses)) { | 
			
		
	
		
			
				
					|  |  |  |  |             return thrProductsAddDiResponses.get(0); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         return null; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public ThrProductsAddDiResponse selecByUuid(String uuid) { | 
			
		
	
		
			
				
					|  |  |  |  |         if (StrUtil.isEmpty(uuid)) { | 
			
		
	
		
			
				
					|  |  |  |  |             return null; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |         filterThrProductsRequest.setUuid(uuid); | 
			
		
	
		
			
				
					|  |  |  |  |         List<ThrProductsAddDiResponse> thrProductsAddDiResponses = thrProductsAddDiDao.filterThrProductsList(filterThrProductsRequest); | 
			
		
	
		
			
				
					|  |  |  |  |         if (CollUtil.isNotEmpty(thrProductsAddDiResponses)) { | 
			
		
	
		
			
				
					|  |  |  |  |             return thrProductsAddDiResponses.get(0); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         return null; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public boolean delThrDiProducts(Long id) { | 
			
		
	
		
			
				
					|  |  |  |  |         return thrProductsAddDiDao.deleteById(id); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public boolean updateDiProduct(ThrProductsAddDiEntity thrProductsAddDiEntity) { | 
			
		
	
		
			
				
					|  |  |  |  |         return thrProductsAddDiDao.updateDiProduct(thrProductsAddDiEntity); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public boolean addThrAddDiProducts(AddThrDiProductsRequest thrDiProductsRequest) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         List<String> uuids = thrDiProductsRequest.getUuids(); | 
			
		
	
		
			
				
					|  |  |  |  |         Long customerId = thrDiProductsRequest.getCustomerId(); | 
			
		
	
		
			
				
					|  |  |  |  |         List<ThrProductsAddDiEntity> list = new ArrayList<>(uuids.size()); | 
			
		
	
		
			
				
					|  |  |  |  |         Date date = new Date(); | 
			
		
	
		
			
				
					|  |  |  |  |         for (String uuid : uuids) { | 
			
		
	
		
			
				
					|  |  |  |  |             ProductInfoEntity productInfoEntity = productInfoService.selectByUuid(uuid).get(0); | 
			
		
	
		
			
				
					|  |  |  |  |             ThrProductsAddDiEntity thrProductsAddDiEntity = new ThrProductsAddDiEntity(); | 
			
		
	
		
			
				
					|  |  |  |  |             BeanUtils.copyProperties(thrDiProductsRequest, thrProductsAddDiEntity); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setCustomerId(customerId + ""); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setUuid(uuid); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setType(1); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setYlqxzcrbarywmc(productInfoEntity.getYlqxzcrbarywmc()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setCplb(productInfoEntity.getCplb()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setCpms(productInfoEntity.getCpms()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setFlbm(productInfoEntity.getFlbm()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setQxlb(productInfoEntity.getQxlb()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setTyshxydm(productInfoEntity.getTyshxydm()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setCode(productInfoEntity.getNameCode()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setName(productInfoEntity.getCpmctymc()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setStandard(productInfoEntity.getGgxh()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setSpec(productInfoEntity.getGgxh()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setRegisterNo(productInfoEntity.getZczbhhzbapzbh()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setYlqxzcrbarmc(productInfoEntity.getYlqxzcrbarmc()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setZczbhhzbapzbh(productInfoEntity.getZczbhhzbapzbh()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             //设置编辑区参数
 | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setSptm(thrDiProductsRequest.getSptm()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setYbbm(thrDiProductsRequest.getYbbm()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setMeasname(thrDiProductsRequest.getMeasname()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setManufactory(thrDiProductsRequest.getManufactory()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setSpmc(thrDiProductsRequest.getSpmc()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setCpms(thrDiProductsRequest.getCpms()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setPrice(thrDiProductsRequest.getPrice()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setCreateTime(date); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setUpdateTime(new Date()); | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setStatus(1); //未审核
 | 
			
		
	
		
			
				
					|  |  |  |  |             thrProductsAddDiEntity.setSelectThridSysStr(JSONUtil.toJsonStr(thrDiProductsRequest.getSelectThirdSys())); | 
			
		
	
		
			
				
					|  |  |  |  |             list.add(thrProductsAddDiEntity); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         return thrProductsAddDiDao.insertThrDiProducts(list); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public UdiInfoResponse getDiProductDetail(String uuid) { | 
			
		
	
		
			
				
					|  |  |  |  |         ThrProductsAddDiEntity thrProductsAddDiEntity = thrProductsAddDiDao.filterThrProductsGetUuid(uuid); | 
			
		
	
		
			
				
					|  |  |  |  |         UdiInfoResponse udiInfoResponse = thrProductsAddDiDao.getDiProductDetail(uuid); | 
			
		
	
		
			
				
					|  |  |  |  |         if(udiInfoResponse!=null){ | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setSptm(thrProductsAddDiEntity.getSptm()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setYbbm(thrProductsAddDiEntity.getYbbm()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setManufactory(thrProductsAddDiEntity.getManufactory()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setCpms(thrProductsAddDiEntity.getCpms()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setMeasname(thrProductsAddDiEntity.getMeasname()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setManufactory(thrProductsAddDiEntity.getManufactory()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setPrice(thrProductsAddDiEntity.getPrice()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setBasicPrductRemak1(thrProductsAddDiEntity.getBasicPrductRemak1()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setBasicPrductRemak2(thrProductsAddDiEntity.getBasicPrductRemak2()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setBasicPrductRemak3(thrProductsAddDiEntity.getBasicPrductRemak3()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setBasicPrductRemak4(thrProductsAddDiEntity.getBasicPrductRemak4()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setBasicPrductRemak5(thrProductsAddDiEntity.getBasicPrductRemak5()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setBasicPrductRemak6(thrProductsAddDiEntity.getBasicPrductRemak6()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setBasicPrductRemak7(thrProductsAddDiEntity.getBasicPrductRemak7()); | 
			
		
	
		
			
				
					|  |  |  |  |             udiInfoResponse.setBasicPrductRemak8(thrProductsAddDiEntity.getBasicPrductRemak8()); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         return udiInfoResponse; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public ThrProductsAddDiEntity filterThrProductsGetId(Integer id) { | 
			
		
	
		
			
				
					|  |  |  |  |         return thrProductsAddDiDao.filterThrProductsGetId(id); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public boolean insertThrProducts(ThrProductsAddDiEntity thrProductsAddDiEntity) { | 
			
		
	
		
			
				
					|  |  |  |  |         return thrProductsAddDiDao.insert(thrProductsAddDiEntity); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public List<ThrProductsAddDiResponse> filterThrProductsDiList(FilterThrProductsRequest filterThrProductsRequest) { | 
			
		
	
		
			
				
					|  |  |  |  |         return thrProductsAddDiDao.filterThrProductsDiList(filterThrProductsRequest); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public List<ThrProductsAddDiEntity> filterThrProductsDiLists(FilterThrProductsRequest filterThrProductsRequest) { | 
			
		
	
		
			
				
					|  |  |  |  |         return thrProductsAddDiDao.filterThrProductsDiLists(filterThrProductsRequest); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |