|  |  | @ -30,6 +30,7 @@ import com.glxp.api.res.inout.IoOrderDetailResultResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.inout.IoOrderResponse; |  |  |  | import com.glxp.api.res.inout.IoOrderResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.sync.SpsSyncOrderResponse; |  |  |  | import com.glxp.api.res.sync.SpsSyncOrderResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.auth.AuthAdminService; |  |  |  | import com.glxp.api.service.auth.AuthAdminService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.service.auth.InvBusUserService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.basic.EntrustReceService; |  |  |  | import com.glxp.api.service.basic.EntrustReceService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.basic.IBasicBussinessTypeService; |  |  |  | import com.glxp.api.service.basic.IBasicBussinessTypeService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.inout.*; |  |  |  | import com.glxp.api.service.inout.*; | 
			
		
	
	
		
		
			
				
					|  |  | @ -48,6 +49,7 @@ import org.springframework.web.bind.annotation.RequestBody; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.web.bind.annotation.RestController; |  |  |  | import org.springframework.web.bind.annotation.RestController; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import javax.annotation.Resource; |  |  |  | import javax.annotation.Resource; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import java.awt.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.util.ArrayList; |  |  |  | import java.util.ArrayList; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.util.Date; |  |  |  | import java.util.Date; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.util.List; |  |  |  | import java.util.List; | 
			
		
	
	
		
		
			
				
					|  |  | @ -435,6 +437,11 @@ public class IoOrderReviewController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (StrUtil.isEmpty(reviewSpmsRequest.getBillNo())) { |  |  |  |         if (StrUtil.isEmpty(reviewSpmsRequest.getBillNo())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); |  |  |  |             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         Long userId = getUserId(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String errMsg = checkReviewAuth(billNo, userId + ""); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (StrUtil.isNotEmpty(errMsg)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return ResultVOUtils.error(500, errMsg); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         AcceptOrderResponse acceptOrderEntity = new AcceptOrderResponse(); |  |  |  |         AcceptOrderResponse acceptOrderEntity = new AcceptOrderResponse(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         acceptOrderEntity.setBillNo(billNo); |  |  |  |         acceptOrderEntity.setBillNo(billNo); | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<IoOrderDetailResultResponse> datas = (List<IoOrderDetailResultResponse>) redisUtil.get(ConstantStatus.REDIS_BILLNO + billNo); |  |  |  |         List<IoOrderDetailResultResponse> datas = (List<IoOrderDetailResultResponse>) redisUtil.get(ConstantStatus.REDIS_BILLNO + billNo); | 
			
		
	
	
		
		
			
				
					|  |  | @ -456,7 +463,7 @@ public class IoOrderReviewController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 acceptOrderEntity.setExitAccept(false); |  |  |  |                 acceptOrderEntity.setExitAccept(false); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } else { |  |  |  |             } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 //获取自助平台待审核单据,并插入到数据库
 |  |  |  |                 //获取自助平台待审核单据,并插入到数据库
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 BaseResponse<SpsSyncOrderResponse> baseResponse = spGetHttp.getReviewOrder(reviewSpmsRequest); |  |  |  |                 BaseResponse<SpsSyncOrderResponse> baseResponse = spGetHttp.getReviewOrder(reviewSpmsRequest, userId + ""); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 if (baseResponse.getCode() == 20000) { |  |  |  |                 if (baseResponse.getCode() == 20000) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     SpsSyncOrderResponse spsSyncOrderResponse = baseResponse.getData(); |  |  |  |                     SpsSyncOrderResponse spsSyncOrderResponse = baseResponse.getData(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     List<IoOrderEntity> orderEntities = spsSyncOrderResponse.getOrderEntities(); |  |  |  |                     List<IoOrderEntity> orderEntities = spsSyncOrderResponse.getOrderEntities(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -490,5 +497,26 @@ public class IoOrderReviewController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return ResultVOUtils.success(acceptOrderEntity); |  |  |  |         return ResultVOUtils.success(acceptOrderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     InvBusUserService invBusUserService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     //校验用户是否验收权限
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private String checkReviewAuth(String orderId, String userId) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         IoOrderEntity orderEntity = orderService.findByBillNo(orderId); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_REW || orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return "单据非未验收状态,无法审核!"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (!invBusUserService.exitBus(userId, orderEntity.getAction())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             EntrustReceEntity entrustReceEntity = entrustReceService.findByUnique(orderEntity.getAction(), Long.parseLong(userId)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (entrustReceEntity == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return "无验收权限!"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return "无验收权限!"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |