|  |  |  | @ -1,10 +1,14 @@ | 
			
		
	
		
			
				
					|  |  |  |  | package com.glxp.api.controller.basic; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import cn.hutool.core.collection.CollUtil; | 
			
		
	
		
			
				
					|  |  |  |  | import cn.hutool.core.util.StrUtil; | 
			
		
	
		
			
				
					|  |  |  |  | import com.github.pagehelper.PageInfo; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.enums.ResultEnum; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.res.BaseResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.util.ResultVOUtils; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.constant.ConstantStatus; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.constant.ConstantType; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.auth.InvWarehouseEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.BasicBusTypePreEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.BasicBussinessTypeEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.basic.FilterBusTypeChangeRequest; | 
			
		
	
	
		
			
				
					|  |  |  | @ -47,8 +51,29 @@ public class BasicBusTypePreController { | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse filterList(FilterBusTypePreRequest filterBusTypePreRequest) { | 
			
		
	
		
			
				
					|  |  |  |  |         //查询扫码单据类型
 | 
			
		
	
		
			
				
					|  |  |  |  |         BasicBussinessTypeEntity basicBussinessType = basicBussinessTypeService.findByAction(filterBusTypePreRequest.getAction()); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         return ResultVOUtils.success(null); | 
			
		
	
		
			
				
					|  |  |  |  |         List<BasicBusTypePreEntity> basicBusTypePreEntities = basicBusTypePreService.findByAction(filterBusTypePreRequest.getAction()); | 
			
		
	
		
			
				
					|  |  |  |  |         if (CollUtil.isEmpty(basicBusTypePreEntities)) { | 
			
		
	
		
			
				
					|  |  |  |  |             //创建对应补单设置
 | 
			
		
	
		
			
				
					|  |  |  |  |             if (filterBusTypePreRequest.getType() != null && "changEnable".equals(filterBusTypePreRequest.getType())) { | 
			
		
	
		
			
				
					|  |  |  |  |                 if (ConstantType.TYPE_OUT.equals(basicBussinessType.getMainAction()) && !basicBussinessType.isAdvanceType()) { | 
			
		
	
		
			
				
					|  |  |  |  |                     BasicBusTypePreEntity basicBusTypePreEntity = new BasicBusTypePreEntity(); | 
			
		
	
		
			
				
					|  |  |  |  |                     basicBusTypePreEntity.setChangeType(ConstantStatus.ORDER_CHANGE_INNOR_NORMAL_IN); | 
			
		
	
		
			
				
					|  |  |  |  |                     basicBusTypePreEntity.setIndex(1); | 
			
		
	
		
			
				
					|  |  |  |  |                     basicBusTypePreEntity.setAction(filterBusTypePreRequest.getAction()); | 
			
		
	
		
			
				
					|  |  |  |  |                     basicBusTypePreEntity.setBeforeTime(1); | 
			
		
	
		
			
				
					|  |  |  |  |                     basicBusTypePreService.insertBusChangeType(basicBusTypePreEntity); | 
			
		
	
		
			
				
					|  |  |  |  |                 } else if (ConstantType.TYPE_OUT.equals(basicBussinessType.getMainAction()) && basicBussinessType.isAdvanceType()) { | 
			
		
	
		
			
				
					|  |  |  |  |                     BasicBusTypePreEntity basicBusTypePreEntity = new BasicBusTypePreEntity(); | 
			
		
	
		
			
				
					|  |  |  |  |                     basicBusTypePreEntity.setChangeType(ConstantStatus.ORDER_CHANGE_ADVANCE_IN); | 
			
		
	
		
			
				
					|  |  |  |  |                     basicBusTypePreEntity.setIndex(1); | 
			
		
	
		
			
				
					|  |  |  |  |                     basicBusTypePreEntity.setBeforeTime(1); | 
			
		
	
		
			
				
					|  |  |  |  |                     basicBusTypePreEntity.setAction(filterBusTypePreRequest.getAction()); | 
			
		
	
		
			
				
					|  |  |  |  |                     basicBusTypePreService.insertBusChangeType(basicBusTypePreEntity); | 
			
		
	
		
			
				
					|  |  |  |  |                     basicBusTypePreEntities = basicBusTypePreService.findByAction(filterBusTypePreRequest.getAction()); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         return ResultVOUtils.success(basicBusTypePreEntities); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     /** | 
			
		
	
	
		
			
				
					|  |  |  | @ -139,15 +164,14 @@ public class BasicBusTypePreController { | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         if (basicBusTypePreEntity != null) { | 
			
		
	
		
			
				
					|  |  |  |  |             //TODO 补充补单单据类型仓库信息
 | 
			
		
	
		
			
				
					|  |  |  |  |             //if (StrUtil.isNotEmpty(basicBusTypePreEntity.getDefaultSubInv())) {
 | 
			
		
	
		
			
				
					|  |  |  |  |             //    InvWarehouseEntity byInvSubByCode = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getDefaultSubInv());
 | 
			
		
	
		
			
				
					|  |  |  |  |             //    basicBusTypePreEntity.setDefaultInv(invSubWarehouseEntity.getParentId());
 | 
			
		
	
		
			
				
					|  |  |  |  |             //}
 | 
			
		
	
		
			
				
					|  |  |  |  |             //if (StrUtil.isNotEmpty(basicBusTypePreEntity.getLocSubInv())) {
 | 
			
		
	
		
			
				
					|  |  |  |  |             //    InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getLocSubInv());
 | 
			
		
	
		
			
				
					|  |  |  |  |             //    basicBusTypePreEntity.setLocInv(invSubWarehouseEntity.getParentId());
 | 
			
		
	
		
			
				
					|  |  |  |  |             //}
 | 
			
		
	
		
			
				
					|  |  |  |  |             if (StrUtil.isNotBlank(basicBusTypePreEntity.getDefaultInvCode())) { | 
			
		
	
		
			
				
					|  |  |  |  |                 InvWarehouseEntity invWarehouse = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getDefaultInvCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                 basicBusTypePreEntity.setDefaultDeptCode(invWarehouse.getParentId()); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |             if (StrUtil.isNotBlank(basicBusTypePreEntity.getInvCode())) { | 
			
		
	
		
			
				
					|  |  |  |  |                 InvWarehouseEntity invWarehouse = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getInvCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                 basicBusTypePreEntity.setDeptCode(invWarehouse.getParentId()); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |             basicBusTypePreService.insertBusChangeType(basicBusTypePreEntity); | 
			
		
	
		
			
				
					|  |  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |  |             ResultVOUtils.error(999, "参数错误"); | 
			
		
	
	
		
			
				
					|  |  |  | 
 |