|  |  | @ -1,6 +1,7 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | package com.glxp.api.controller.inout; |  |  |  | package com.glxp.api.controller.inout; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import cn.hutool.core.collection.CollUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.util.StrUtil; |  |  |  | import cn.hutool.core.util.StrUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.github.pagehelper.PageInfo; |  |  |  | import com.github.pagehelper.PageInfo; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.annotation.AuthRuleAnnotation; |  |  |  | import com.glxp.api.annotation.AuthRuleAnnotation; | 
			
		
	
	
		
		
			
				
					|  |  | @ -34,6 +35,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.util.ArrayList; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.util.Date; |  |  |  | import java.util.Date; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.util.List; |  |  |  | import java.util.List; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -75,7 +77,7 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |     public BaseResponse addBizProduct(@RequestBody AddBizProductReqeust addBizProductReqeust) { |  |  |  |     public BaseResponse addBizProduct(@RequestBody AddBizProductReqeust addBizProductReqeust) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         AuthAdmin authAdmin = getUser(); |  |  |  |         AuthAdmin authAdmin = getUser(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (addBizProductReqeust.getRelId() == null) |  |  |  |         if (addBizProductReqeust.getRelId() == null && CollUtil.isEmpty(addBizProductReqeust.getDatas())) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(500, "未选择产品信息"); |  |  |  |             return ResultVOUtils.error(500, "未选择产品信息"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (addBizProductReqeust.getOrderEntity() == null) |  |  |  |         if (addBizProductReqeust.getOrderEntity() == null) | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(500, "未指定订单"); |  |  |  |             return ResultVOUtils.error(500, "未指定订单"); | 
			
		
	
	
		
		
			
				
					|  |  | @ -88,6 +90,10 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |             orderEntity.setCreateUser(authAdmin.getId() + ""); |  |  |  |             orderEntity.setCreateUser(authAdmin.getId() + ""); | 
			
		
	
		
		
			
				
					
					|  |  |  |             orderEntity.setCreateTime(new Date()); |  |  |  |             orderEntity.setCreateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             orderEntity.setMainAction(bussinessTypeEntity.getMainAction()); |  |  |  |             orderEntity.setMainAction(bussinessTypeEntity.getMainAction()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (StrUtil.isNotEmpty(orderEntity.getFromInvCode())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 InvWarehouseEntity fromEntity = invWarehouseService.findByInvSubByCode(orderEntity.getInvCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderEntity.setFromDeptCode(fromEntity.getParentId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             orderEntity.setFromType(ConstantStatus.FROM_WEBNEW); |  |  |  |             orderEntity.setFromType(ConstantStatus.FROM_WEBNEW); | 
			
		
	
		
		
			
				
					
					|  |  |  |             orderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE); |  |  |  |             orderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE); | 
			
		
	
		
		
			
				
					
					|  |  |  |             orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_DRAFT); |  |  |  |             orderEntity.setDealStatus(ConstantStatus.ORDER_DEAL_DRAFT); | 
			
		
	
	
		
		
			
				
					|  |  | @ -100,7 +106,15 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |             orderEntity.setInvCode(orderEntity.getInvCode()); |  |  |  |             orderEntity.setInvCode(orderEntity.getInvCode()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             orderService.insertOrder(orderEntity); |  |  |  |             orderService.insertOrder(orderEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(addBizProductReqeust.getRelId()); |  |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<AddBizProductReqeust> datas = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (CollUtil.isNotEmpty(addBizProductReqeust.getDatas())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             datas.addAll(addBizProductReqeust.getDatas()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             datas.add(addBizProductReqeust); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (AddBizProductReqeust item : datas) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(item.getRelId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); |  |  |  |             IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             ioOrderDetailBizEntity.setOrderIdFk(orderEntity.getBillNo()); |  |  |  |             ioOrderDetailBizEntity.setOrderIdFk(orderEntity.getBillNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             ioOrderDetailBizEntity.setBindRlFk(udiRelevanceResponse.getId()); |  |  |  |             ioOrderDetailBizEntity.setBindRlFk(udiRelevanceResponse.getId()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -113,8 +127,13 @@ public class IoOrderDetailBizController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |             ioOrderDetailBizEntity.setMeasname(udiRelevanceResponse.getMeasname()); |  |  |  |             ioOrderDetailBizEntity.setMeasname(udiRelevanceResponse.getMeasname()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             ioOrderDetailBizEntity.setSpec(udiRelevanceResponse.getGgxh()); |  |  |  |             ioOrderDetailBizEntity.setSpec(udiRelevanceResponse.getGgxh()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             ioOrderDetailBizEntity.setPrice(udiRelevanceResponse.getPrice()); |  |  |  |             ioOrderDetailBizEntity.setPrice(udiRelevanceResponse.getPrice()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         ioOrderDetailBizEntity.setSupId(addBizProductReqeust.getSupId()); |  |  |  |             ioOrderDetailBizEntity.setProductDate(item.getProductDate()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ioOrderDetailBizEntity.setExpireDate(item.getExpireDate()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ioOrderDetailBizEntity.setBatchNo(item.getBatchNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ioOrderDetailBizEntity.setSupId(item.getSupId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             orderDetailBizService.insert(ioOrderDetailBizEntity); |  |  |  |             orderDetailBizService.insert(ioOrderDetailBizEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         orderEntity.setUpdateTime(new Date()); |  |  |  |         orderEntity.setUpdateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         orderEntity.setUpdateUser(authAdmin.getId() + ""); |  |  |  |         orderEntity.setUpdateUser(authAdmin.getId() + ""); | 
			
		
	
		
		
			
				
					
					|  |  |  |         orderService.update(orderEntity); |  |  |  |         orderService.update(orderEntity); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |