|  |  |  | @ -124,16 +124,15 @@ public class IoCollectOriginService { | 
			
		
	
		
			
				
					|  |  |  |  |         if (StrUtil.isBlank(collectOrderRequest.getBillNo())) { | 
			
		
	
		
			
				
					|  |  |  |  |             throw new JsonException(500, "单据号不能为空"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         if (collectOrderRequest.getTagStatus() != 4) { | 
			
		
	
		
			
				
					|  |  |  |  |             throw new JsonException(500, "非异常单据,无需处理"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | //        if (collectOrderRequest.getTagStatus() != 4) {
 | 
			
		
	
		
			
				
					|  |  |  |  | //            throw new JsonException(500, "非异常单据,无需处理");
 | 
			
		
	
		
			
				
					|  |  |  |  | //        }
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (StrUtil.isBlank(collectOrderRequest.getBusType())) { | 
			
		
	
		
			
				
					|  |  |  |  |             throw new JsonException(500, "单据类型不能为空"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         String billNo = collectOrderRequest.getBillNo(); | 
			
		
	
		
			
				
					|  |  |  |  |         List<IoCollectOrderOrigin> thrOrderEntities = collectOrderOriginService.list(new LambdaUpdateWrapper<IoCollectOrderOrigin>().eq(IoCollectOrderOrigin::getBillNo, billNo)); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         List<IoCollectOrder> ioCollectOrderList = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |  |         if (CollUtil.isNotEmpty(thrOrderEntities)) { | 
			
		
	
		
			
				
					|  |  |  |  |             for (IoCollectOrderOrigin thrOrder : thrOrderEntities) { | 
			
		
	
		
			
				
					|  |  |  |  |                 IoCollectOrder ioCollectOrder = new IoCollectOrder(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -159,7 +158,7 @@ public class IoCollectOriginService { | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrderBiz.setUnTagCount(0); | 
			
		
	
		
			
				
					|  |  |  |  |                     bizList.add(collectOrderBiz); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |                 if (StrUtil.isNotBlank(errorMsg)) { | 
			
		
	
		
			
				
					|  |  |  |  |                 if (StrUtil.isNotEmpty(errorMsg)) { | 
			
		
	
		
			
				
					|  |  |  |  |                     thrOrder.setTagStatus(4); | 
			
		
	
		
			
				
					|  |  |  |  |                     thrOrder.setErrorMsg(errorMsg.toString()); | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrderOriginService.updateById(thrOrder); | 
			
		
	
	
		
			
				
					|  |  |  | @ -173,6 +172,15 @@ public class IoCollectOriginService { | 
			
		
	
		
			
				
					|  |  |  |  |                     List<IoCollectOrderBizOrigin> ioCollectOrderBizOrigins = BeanCopyUtils.copyList(bizList, IoCollectOrderBizOrigin.class); | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrderBizOriginService.updateBatchById(ioCollectOrderBizOrigins); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     //删除
 | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrderService.remove(new LambdaQueryWrapper<IoCollectOrder>().eq(IoCollectOrder::getBillNo, billNo)); | 
			
		
	
		
			
				
					|  |  |  |  |                     //更改 原始单据表 为未处理
 | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrderBizService.remove(new LambdaUpdateWrapper<IoCollectOrderBiz>().eq(IoCollectOrderBiz::getOrderIdFk, billNo)); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     for (IoCollectOrderBiz ioCollectOrderBiz : bizList) { | 
			
		
	
		
			
				
					|  |  |  |  |                         ioCollectOrderBiz.setId(null); | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |  |                     //新增
 | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrderBizService.saveBatch(bizList); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCollectOrder.setFromType("HIS系统"); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCollectOrder.setWorkPlaceCode(collectOrderRequest.getWorkPlaceCode()); | 
			
		
	
	
		
			
				
					|  |  |  | @ -181,7 +189,7 @@ public class IoCollectOriginService { | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCollectOrder.setBackupOrderRemark1(null); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCollectOrder.setUpdateTime(new Date()); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCollectOrder.setSplitStatus(0); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCollectOrder.setTagStatus(0); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCollectOrder.setTagStatus(1); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     collectOrderService.save(ioCollectOrder); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |