|  |  | @ -34,6 +34,7 @@ import com.glxp.api.service.basic.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.inout.IoCodeTempService; |  |  |  | import com.glxp.api.service.inout.IoCodeTempService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.inout.IoOrderDetailBizService; |  |  |  | import com.glxp.api.service.inout.IoOrderDetailBizService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.inout.IoOrderService; |  |  |  | import com.glxp.api.service.inout.IoOrderService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.service.inout.IoSplitFifoCodeService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.inout.impl.IoCodeService; |  |  |  | import com.glxp.api.service.inout.impl.IoCodeService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.IntUtil; |  |  |  | import com.glxp.api.util.IntUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.MsDateUtil; |  |  |  | import com.glxp.api.util.MsDateUtil; | 
			
		
	
	
		
		
			
				
					|  |  | @ -43,6 +44,7 @@ import org.springframework.transaction.annotation.Transactional; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import javax.annotation.Resource; |  |  |  | import javax.annotation.Resource; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.util.*; |  |  |  | import java.util.*; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import java.util.stream.Collectors; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | @Service |  |  |  | @Service | 
			
		
	
		
		
			
				
					
					|  |  |  | public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoCollectOrder> { |  |  |  | public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoCollectOrder> { | 
			
		
	
	
		
		
			
				
					|  |  | @ -73,6 +75,8 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC | 
			
		
	
		
		
			
				
					
					|  |  |  |     SysWorkplaceService sysWorkplaceService; |  |  |  |     SysWorkplaceService sysWorkplaceService; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     SysWorkplaceDocumentService sysWorkplaceDocumentService; |  |  |  |     SysWorkplaceDocumentService sysWorkplaceDocumentService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     IoSplitFifoCodeService splitFifoCodeService; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public IoCollectOrder getByBillNo(String billNo) { |  |  |  |     public IoCollectOrder getByBillNo(String billNo) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return collectOrderMapper.selectOne(new LambdaQueryWrapper<IoCollectOrder>().eq(IoCollectOrder::getBillNo, billNo).last("limit 1")); |  |  |  |         return collectOrderMapper.selectOne(new LambdaQueryWrapper<IoCollectOrder>().eq(IoCollectOrder::getBillNo, billNo).last("limit 1")); | 
			
		
	
	
		
		
			
				
					|  |  | @ -192,6 +196,7 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC | 
			
		
	
		
		
			
				
					
					|  |  |  |         filterOrderRequest.setProductType(null); |  |  |  |         filterOrderRequest.setProductType(null); | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<IoOrderResponse> list = orderService.filterList(filterOrderRequest); |  |  |  |         List<IoOrderResponse> list = orderService.filterList(filterOrderRequest); | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<IoCollectOrder> collectOrderList = new ArrayList<>(); |  |  |  |         List<IoCollectOrder> collectOrderList = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<SysWorkplaceResponse> allWorksList = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         for (IoOrderResponse ioOrderEntity : list) { |  |  |  |         for (IoOrderResponse ioOrderEntity : list) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (collectOrderMapper.exists(new LambdaQueryWrapper<IoCollectOrder>().eq(IoCollectOrder::getBillNo, ioOrderEntity.getBillNo()))) { |  |  |  |             if (collectOrderMapper.exists(new LambdaQueryWrapper<IoCollectOrder>().eq(IoCollectOrder::getBillNo, ioOrderEntity.getBillNo()))) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -276,20 +281,30 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 collectOrderBizs.add(collectOrderBiz); |  |  |  |                 collectOrderBizs.add(collectOrderBiz); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (CollUtil.isNotEmpty(collectOrderBizs)) |  |  |  |             if (CollUtil.isNotEmpty(collectOrderBizs)) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 collectOrderBizService.saveBatch(collectOrderBizs); |  |  |  |                 collectOrderBizService.saveBatch(collectOrderBizs); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             allWorksList.addAll(sysWorkplaces); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (CollUtil.isNotEmpty(collectOrderList)) { |  |  |  |         if (CollUtil.isNotEmpty(collectOrderList)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             saveBatch(collectOrderList); |  |  |  |             saveBatch(collectOrderList); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         Map<Long, SysWorkplaceResponse> sysWorkplaceMap = new HashMap<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (SysWorkplaceResponse sysWorkplace : allWorksList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sysWorkplaceMap.put(sysWorkplace.getId(), sysWorkplace); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (SysWorkplaceResponse value : sysWorkplaceMap.values()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             splitFifoCodeService.preAllotInv(value.getWorkplaceId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public void importPrescribe() { |  |  |  |     public void importPrescribe() { | 
			
		
	
		
		
			
				
					
					|  |  |  |         //下载处方
 |  |  |  |         //下载处方
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<BasicSkPrescribeEntity> basicSkPrescribeEntities = basicSkPrescribeService.list(); |  |  |  |         List<BasicSkPrescribeEntity> basicSkPrescribeEntities = basicSkPrescribeService.list(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |         List<SysWorkplaceResponse> allWorksList = new ArrayList<>(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         List<IoCollectOrder> collectOrderList = new ArrayList<>(); |  |  |  |         List<IoCollectOrder> collectOrderList = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         for (BasicSkPrescribeEntity basicSkPrescribeEntity : basicSkPrescribeEntities) { |  |  |  |         for (BasicSkPrescribeEntity basicSkPrescribeEntity : basicSkPrescribeEntities) { | 
			
		
	
		
		
			
				
					
					|  |  |  | //            BasicCollectBustypeEntity collectBustypeEntity = collectBustypeService.findByFromCode(String.valueOf(basicSkPrescribeEntity.getAddr()));
 |  |  |  | //            BasicCollectBustypeEntity collectBustypeEntity = collectBustypeService.findByFromCode(String.valueOf(basicSkPrescribeEntity.getAddr()));
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -374,10 +389,19 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (CollUtil.isNotEmpty(collectOrderBizs)) |  |  |  |             if (CollUtil.isNotEmpty(collectOrderBizs)) | 
			
		
	
		
		
			
				
					
					|  |  |  |                 collectOrderBizService.saveBatch(collectOrderBizs); |  |  |  |                 collectOrderBizService.saveBatch(collectOrderBizs); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             allWorksList.addAll(sysWorkplaces); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (CollUtil.isNotEmpty(collectOrderList)) { |  |  |  |         if (CollUtil.isNotEmpty(collectOrderList)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             saveBatch(collectOrderList); |  |  |  |             saveBatch(collectOrderList); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         Map<Long, SysWorkplaceResponse> sysWorkplaceMap = new HashMap<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (SysWorkplaceResponse sysWorkplace : allWorksList) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             sysWorkplaceMap.put(sysWorkplace.getId(), sysWorkplace); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         for (SysWorkplaceResponse value : sysWorkplaceMap.values()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             splitFifoCodeService.preAllotInv(value.getWorkplaceId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Transactional(rollbackFor = Exception.class) |  |  |  |     @Transactional(rollbackFor = Exception.class) | 
			
		
	
	
		
		
			
				
					|  |  | @ -430,16 +454,17 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     /** |  |  |  |     /** | 
			
		
	
		
		
			
				
					
					|  |  |  |      * 更新排序时间 |  |  |  |      * 更新排序时间 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |      * | 
			
		
	
		
		
			
				
					
					|  |  |  |      * @param collectOrderRequest |  |  |  |      * @param collectOrderRequest | 
			
		
	
		
		
			
				
					
					|  |  |  |      */ |  |  |  |      */ | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Transactional(rollbackFor = Exception.class) |  |  |  |     @Transactional(rollbackFor = Exception.class) | 
			
		
	
		
		
			
				
					
					|  |  |  |     public void orderTop(CollectOrderRequest collectOrderRequest) { |  |  |  |     public void orderTop(CollectOrderRequest collectOrderRequest) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         Assert.notNull(collectOrderRequest.getId(),"id不能为空"); |  |  |  |         Assert.notNull(collectOrderRequest.getId(), "id不能为空"); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         this.lambdaUpdate() |  |  |  |         this.lambdaUpdate() | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .set(IoCollectOrder::getUpdateTime, new Date()) |  |  |  |                 .set(IoCollectOrder::getUpdateTime, new Date()) | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .set(collectOrderRequest.getUpdateUser() != null,IoCollectOrder::getUpdateUser, collectOrderRequest.getUpdateUser()) |  |  |  |                 .set(collectOrderRequest.getUpdateUser() != null, IoCollectOrder::getUpdateUser, collectOrderRequest.getUpdateUser()) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 .set(IoCollectOrder::getOrderTime, new Date()) |  |  |  |                 .set(IoCollectOrder::getOrderTime, new Date()) | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .eq(IoCollectOrder::getId,collectOrderRequest.getId()).update(); |  |  |  |                 .eq(IoCollectOrder::getId, collectOrderRequest.getId()).update(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |