|  |  |  | @ -51,52 +51,52 @@ public class ioCodeRelController { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         //判断码有没有重复
 | 
			
		
	
		
			
				
					|  |  |  |  |         List<IoCodeRelEntity> list=ioCodeRelServicec.selectIoCodeRelByCode("",code); | 
			
		
	
		
			
				
					|  |  |  |  |         if(list.size()>0){ | 
			
		
	
		
			
				
					|  |  |  |  |          return    ResultVOUtils.error(999,"此码已做关联!"); | 
			
		
	
		
			
				
					|  |  |  |  |         List<IoCodeRelEntity> list = ioCodeRelServicec.selectIoCodeRelByCode("", code); | 
			
		
	
		
			
				
					|  |  |  |  |         if (list.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(999, "此码已做关联!"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(StrUtil.isNotEmpty(code)){ | 
			
		
	
		
			
				
					|  |  |  |  |             UdiEntity udiEntity=FilterUdiUtils.getGS1Udi(code); | 
			
		
	
		
			
				
					|  |  |  |  |             UdiProductEntity udiProductEntity=udiProductService.findByNameCode(udiEntity.getUdi()); | 
			
		
	
		
			
				
					|  |  |  |  |             if(udiProductEntity.getPackLevel()!=null){ | 
			
		
	
		
			
				
					|  |  |  |  |                 if(Integer.valueOf(udiProductEntity.getPackLevel())>1){ | 
			
		
	
		
			
				
					|  |  |  |  |         if (StrUtil.isNotEmpty(code)) { | 
			
		
	
		
			
				
					|  |  |  |  |             UdiEntity udiEntity = FilterUdiUtils.getUdi(code); | 
			
		
	
		
			
				
					|  |  |  |  |             UdiProductEntity udiProductEntity = udiProductService.findByNameCode(udiEntity.getUdi()); | 
			
		
	
		
			
				
					|  |  |  |  |             if (udiProductEntity.getPackLevel() != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                 if (Integer.valueOf(udiProductEntity.getPackLevel()) > 1) { | 
			
		
	
		
			
				
					|  |  |  |  |                     return ResultVOUtils.success(udiProductEntity.getBhxjcpbm()); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |        return  ResultVOUtils.error(999,"扫码错误!"); | 
			
		
	
		
			
				
					|  |  |  |  |         return ResultVOUtils.error(999, "扫码错误!"); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @GetMapping("/udi/ioCode/Rel/checkLowProduct") | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse checkLowProduct(String upCode,String lowCode) { | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse checkLowProduct(String upCode, String lowCode) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         UdiProductEntity udiProductEntity=new UdiProductEntity(); | 
			
		
	
		
			
				
					|  |  |  |  |         UdiProductEntity udiProductEntity = new UdiProductEntity(); | 
			
		
	
		
			
				
					|  |  |  |  |         //查询上级产品信息
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(StrUtil.isNotEmpty(upCode)){ | 
			
		
	
		
			
				
					|  |  |  |  |             UdiEntity udiEntity=FilterUdiUtils.getGS1Udi(upCode); | 
			
		
	
		
			
				
					|  |  |  |  |             udiProductEntity=udiProductService.findByNameCode(udiEntity.getUdi()); | 
			
		
	
		
			
				
					|  |  |  |  |         if (StrUtil.isNotEmpty(upCode)) { | 
			
		
	
		
			
				
					|  |  |  |  |             UdiEntity udiEntity = FilterUdiUtils.getGS1Udi(upCode); | 
			
		
	
		
			
				
					|  |  |  |  |             udiProductEntity = udiProductService.findByNameCode(udiEntity.getUdi()); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         //判断码有没有重复
 | 
			
		
	
		
			
				
					|  |  |  |  |         List<IoCodeRelEntity> list=ioCodeRelServicec.selectIoCodeRelByCode(lowCode,upCode); | 
			
		
	
		
			
				
					|  |  |  |  |         if(list.size()>0){ | 
			
		
	
		
			
				
					|  |  |  |  |           return   ResultVOUtils.error(999,"此码已做关联!"); | 
			
		
	
		
			
				
					|  |  |  |  |         List<IoCodeRelEntity> list = ioCodeRelServicec.selectIoCodeRelByCode(lowCode, upCode); | 
			
		
	
		
			
				
					|  |  |  |  |         if (list.size() > 0) { | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(999, "此码已做关联!"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         //判断条数是否超出
 | 
			
		
	
		
			
				
					|  |  |  |  |         Long count=ioCodeRelServicec.selectIoCodeRelCount(upCode); | 
			
		
	
		
			
				
					|  |  |  |  |         if(count>=udiProductEntity.getBhxjsl()){ | 
			
		
	
		
			
				
					|  |  |  |  |             return  ResultVOUtils.error(999,"数量超出!"); | 
			
		
	
		
			
				
					|  |  |  |  |         Long count = ioCodeRelServicec.selectIoCodeRelCount(upCode); | 
			
		
	
		
			
				
					|  |  |  |  |         if (count >= udiProductEntity.getBhxjsl()) { | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(999, "数量超出!"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         //查询下级产品信息
 | 
			
		
	
		
			
				
					|  |  |  |  |         if(StrUtil.isNotEmpty(lowCode)){ | 
			
		
	
		
			
				
					|  |  |  |  |             UdiEntity udiEntity=FilterUdiUtils.getGS1Udi(lowCode); | 
			
		
	
		
			
				
					|  |  |  |  |             UdiProductEntity udiProductEntity1=udiProductService.findByNameCode(udiEntity.getUdi()); | 
			
		
	
		
			
				
					|  |  |  |  |               if(udiProductEntity!=null){ | 
			
		
	
		
			
				
					|  |  |  |  |                   if(udiProductEntity1.getNameCode().equals(udiProductEntity.getBhxjcpbm())){ | 
			
		
	
		
			
				
					|  |  |  |  |                       IoCodeRelEntity ioCodeRelEntity=new IoCodeRelEntity(); | 
			
		
	
		
			
				
					|  |  |  |  |         if (StrUtil.isNotEmpty(lowCode)) { | 
			
		
	
		
			
				
					|  |  |  |  |             UdiEntity udiEntity = FilterUdiUtils.getGS1Udi(lowCode); | 
			
		
	
		
			
				
					|  |  |  |  |             UdiProductEntity udiProductEntity1 = udiProductService.findByNameCode(udiEntity.getUdi()); | 
			
		
	
		
			
				
					|  |  |  |  |             if (udiProductEntity != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                 if (udiProductEntity1.getNameCode().equals(udiProductEntity.getBhxjcpbm())) { | 
			
		
	
		
			
				
					|  |  |  |  |                     IoCodeRelEntity ioCodeRelEntity = new IoCodeRelEntity(); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCodeRelEntity.setCode(lowCode); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCodeRelEntity.setParentCode(upCode); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCodeRelEntity.setNameCode(udiProductEntity1.getNameCode()); | 
			
		
	
	
		
			
				
					|  |  |  | @ -109,12 +109,12 @@ public class ioCodeRelController { | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCodeRelEntity.setUpdateTime(new Date()); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCodeRelServicec.insert(ioCodeRelEntity); | 
			
		
	
		
			
				
					|  |  |  |  |                     return ResultVOUtils.success(); | 
			
		
	
		
			
				
					|  |  |  |  |                   }else{ | 
			
		
	
		
			
				
					|  |  |  |  |                       return  ResultVOUtils.error(999,"该条码不属于下级产品!"); | 
			
		
	
		
			
				
					|  |  |  |  |                 } else { | 
			
		
	
		
			
				
					|  |  |  |  |                     return ResultVOUtils.error(999, "该条码不属于下级产品!"); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         return  ResultVOUtils.error(999,""); | 
			
		
	
		
			
				
					|  |  |  |  |         return ResultVOUtils.error(999, ""); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @GetMapping("/udi/ioCode/Rel/delectList") | 
			
		
	
	
		
			
				
					|  |  |  | @ -131,13 +131,13 @@ public class ioCodeRelController { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @GetMapping("/udi/ioCode/Rel/del") | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse del(String code,String parentCode) { | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse del(String code, String parentCode) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         int count=ioCodeRelServicec.delIoCodeRel(code,parentCode); | 
			
		
	
		
			
				
					|  |  |  |  |         if(count>0){ | 
			
		
	
		
			
				
					|  |  |  |  |         int count = ioCodeRelServicec.delIoCodeRel(code, parentCode); | 
			
		
	
		
			
				
					|  |  |  |  |         if (count > 0) { | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.success("删除成功"); | 
			
		
	
		
			
				
					|  |  |  |  |         }else{ | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(999,"删除失败"); | 
			
		
	
		
			
				
					|  |  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(999, "删除失败"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |