|  |  |  | @ -1,13 +1,16 @@ | 
			
		
	
		
			
				
					|  |  |  |  | package com.glxp.api.service.inout.impl; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import cn.hutool.core.util.IdUtil; | 
			
		
	
		
			
				
					|  |  |  |  | import cn.hutool.core.util.StrUtil; | 
			
		
	
		
			
				
					|  |  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.github.pagehelper.PageHelper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.res.BaseResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.util.ResultVOUtils; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.basic.BasicSkProjectMapper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.inout.IoDestinyProcessCodeMapper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.inout.IoDestinyProcessMapper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.auth.AuthAdmin; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.BasicSkProjectEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.UdiEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.inout.IoDestinyProcessCodeEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.inout.IoDestinyProcessEntity; | 
			
		
	
	
		
			
				
					|  |  |  | @ -18,6 +21,7 @@ import com.glxp.api.res.inout.IodestinyProcessResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.auth.CustomerService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.basic.UdiRelevanceService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.basic.impl.BasicDestinyRelService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.util.StringUtils; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.util.udi.FilterUdiUtils; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.util.udi.UdiCalCountUtil; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
	
		
			
				
					|  |  |  | @ -40,7 +44,8 @@ public class IoDestinyProcessDetailServiceImpl implements IoDestinyProcessDetail | 
			
		
	
		
			
				
					|  |  |  |  |     private IoDestinyProcessDetailMapper ioDestinyProcessDetailMapper; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     private IoDestinyProcessCodeMapper ioDestinyProcessCodeMapper; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     private BasicSkProjectMapper basicSkProjectMapper; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     CustomerService customerService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
	
		
			
				
					|  |  |  | @ -81,7 +86,8 @@ public class IoDestinyProcessDetailServiceImpl implements IoDestinyProcessDetail | 
			
		
	
		
			
				
					|  |  |  |  |             ioDestinyProcessMapper.updateById(ioDestinyProcessEntity); | 
			
		
	
		
			
				
					|  |  |  |  |         }else{ | 
			
		
	
		
			
				
					|  |  |  |  |             ioDestinyProcessEntity.setId(IdUtil.getSnowflakeNextId()); | 
			
		
	
		
			
				
					|  |  |  |  |             ioDestinyProcessEntity.setDestinyNo(filterUdiRelRequest.getDestinyNo()); | 
			
		
	
		
			
				
					|  |  |  |  |             //destinyNo 处理为  destinyId + 00000001 格式
 | 
			
		
	
		
			
				
					|  |  |  |  |             ioDestinyProcessEntity.setDestinyNo(generateDestinyNoByDestinyId(filterUdiRelRequest.getDestinyId())); | 
			
		
	
		
			
				
					|  |  |  |  |             ioDestinyProcessEntity.setDestinyId(filterUdiRelRequest.getDestinyId()); | 
			
		
	
		
			
				
					|  |  |  |  |             ioDestinyProcessEntity.setBillNo(filterUdiRelRequest.getBillNo()); | 
			
		
	
		
			
				
					|  |  |  |  |             ioDestinyProcessEntity.setBillDate(filterUdiRelRequest.getBillDate()); | 
			
		
	
	
		
			
				
					|  |  |  | @ -113,6 +119,27 @@ public class IoDestinyProcessDetailServiceImpl implements IoDestinyProcessDetail | 
			
		
	
		
			
				
					|  |  |  |  |         return true; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |  |      * 处理  定数包模版编码####000001 | 
			
		
	
		
			
				
					|  |  |  |  |      * @param destinyId | 
			
		
	
		
			
				
					|  |  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |  |     private String generateDestinyNoByDestinyId(String destinyId) { | 
			
		
	
		
			
				
					|  |  |  |  |         //查数据库编码的最大值 然后加1
 | 
			
		
	
		
			
				
					|  |  |  |  |         String maxDestinyNo = ioDestinyProcessMapper.selectMaxDestinyNo(destinyId); | 
			
		
	
		
			
				
					|  |  |  |  |         BasicSkProjectEntity basicSkProjectEntity = basicSkProjectMapper.selectById(destinyId); | 
			
		
	
		
			
				
					|  |  |  |  |         String code = basicSkProjectEntity.getCode(); | 
			
		
	
		
			
				
					|  |  |  |  |         if (StrUtil.isNotEmpty(maxDestinyNo)){ | 
			
		
	
		
			
				
					|  |  |  |  |             //解析加1
 | 
			
		
	
		
			
				
					|  |  |  |  |             String newString = maxDestinyNo.replace(code, ""); | 
			
		
	
		
			
				
					|  |  |  |  |             long parseLong = Long.parseLong(newString); | 
			
		
	
		
			
				
					|  |  |  |  |             return code+ StringUtils.padl(parseLong+1,8); | 
			
		
	
		
			
				
					|  |  |  |  |         }else { | 
			
		
	
		
			
				
					|  |  |  |  |             //初始化
 | 
			
		
	
		
			
				
					|  |  |  |  |             return code+"00000001"; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |  |     public List<IoDestinyProcessDetailEntity> addDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |