|  |  | @ -1,6 +1,9 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | package com.glxp.api.controller.basic; |  |  |  | package com.glxp.api.controller.basic; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import cn.hutool.core.collection.CollectionUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import cn.hutool.core.util.StrUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.alibaba.fastjson.JSON; |  |  |  | import com.alibaba.fastjson.JSON; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.annotation.AuthRuleAnnotation; |  |  |  | import com.glxp.api.annotation.AuthRuleAnnotation; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.common.enums.ResultEnum; |  |  |  | import com.glxp.api.common.enums.ResultEnum; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.common.res.BaseResponse; |  |  |  | import com.glxp.api.common.res.BaseResponse; | 
			
		
	
	
		
		
			
				
					|  |  | @ -10,10 +13,12 @@ import com.glxp.api.entity.basic.UdiProductEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.basic.UdiRelevanceEntity; |  |  |  | import com.glxp.api.entity.basic.UdiRelevanceEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.inout.IoCodeEntity; |  |  |  | import com.glxp.api.entity.inout.IoCodeEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.inout.IoOrderDetailBizEntity; |  |  |  | import com.glxp.api.entity.inout.IoOrderDetailBizEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.entity.inout.IoOrderInvoiceEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.system.*; |  |  |  | import com.glxp.api.entity.system.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.thrsys.ThrProductsEntity; |  |  |  | import com.glxp.api.entity.thrsys.ThrProductsEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.req.basic.FilterOrderPrintRequest; |  |  |  | import com.glxp.api.req.basic.FilterOrderPrintRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.req.inout.FilterOrderRequest; |  |  |  | import com.glxp.api.req.inout.FilterOrderRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.req.thrsys.UdiwmsOrderDetailRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.basic.UdiRelevanceResponse; |  |  |  | import com.glxp.api.res.basic.UdiRelevanceResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.inout.IoOrderResponse; |  |  |  | import com.glxp.api.res.inout.IoOrderResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.basic.IBasicBussinessTypeService; |  |  |  | import com.glxp.api.service.basic.IBasicBussinessTypeService; | 
			
		
	
	
		
		
			
				
					|  |  | @ -22,8 +27,10 @@ import com.glxp.api.service.basic.UdiRelevanceService; | 
			
		
	
		
		
			
				
					
					|  |  |  | 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.impl.IoCodeService; |  |  |  | import com.glxp.api.service.inout.impl.IoCodeService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.service.inout.impl.IoOrderInvoiceService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.system.*; |  |  |  | import com.glxp.api.service.system.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.thrsys.ThrProductsService; |  |  |  | import com.glxp.api.service.thrsys.ThrProductsService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.util.DateUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.FileUtils; |  |  |  | import com.glxp.api.util.FileUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.IntUtil; |  |  |  | import com.glxp.api.util.IntUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.JasperUtils; |  |  |  | import com.glxp.api.util.JasperUtils; | 
			
		
	
	
		
		
			
				
					|  |  | @ -72,6 +79,8 @@ public class BasicOrderPrintController { | 
			
		
	
		
		
			
				
					
					|  |  |  |     SystemParamConfigService systemParamConfigService; |  |  |  |     SystemParamConfigService systemParamConfigService; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     ThrProductsService thrProductsService; |  |  |  |     ThrProductsService thrProductsService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     IoOrderInvoiceService orderInvoiceService; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     //校验模板是否正确
 |  |  |  |     //校验模板是否正确
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @AuthRuleAnnotation("") |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
	
		
		
			
				
					|  |  | @ -168,10 +177,26 @@ public class BasicOrderPrintController { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     //添加发票号
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     String fphm = ""; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     String fprq = null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     List<IoOrderInvoiceEntity> invoiceList = orderInvoiceService.list(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class).eq(IoOrderInvoiceEntity::getOrderIdFk, ioOrderResponse.getBillNo()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             .eq(IoOrderInvoiceEntity::getBindRlFk, obj.getBindRlFk()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             .eq(StrUtil.isNotEmpty(obj.getBatchNo()), IoOrderInvoiceEntity::getBatchNo, obj.getBatchNo()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             .groupBy(IoOrderInvoiceEntity::getInvoiceEncode)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (CollectionUtil.isNotEmpty(invoiceList)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         fphm = invoiceList.stream().map(IoOrderInvoiceEntity::getInvoiceEncode).collect(Collectors.joining(",")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         if (invoiceList.get(0).getInvoiceDate() != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             fprq = invoiceList.get(0).getInvoiceDate(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     bizData.put("invoiceDate", fprq); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     bizData.put("invoiceNo", fphm); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     list.add(bizData); |  |  |  |                     list.add(bizData); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     i++; |  |  |  |                     i++; | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         } else { |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |             //查询单据表
 |  |  |  |             //查询单据表
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             FilterOrderRequest filterOrderRequest = new FilterOrderRequest(); |  |  |  |             FilterOrderRequest filterOrderRequest = new FilterOrderRequest(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -241,7 +266,20 @@ public class BasicOrderPrintController { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         bizData.put("ylqxzcrbarmc", thrProductsEntity.getYlqxzcrbarmc() == null ? ' ' : thrProductsEntity.getYlqxzcrbarmc()); |  |  |  |                         bizData.put("ylqxzcrbarmc", thrProductsEntity.getYlqxzcrbarmc() == null ? ' ' : thrProductsEntity.getYlqxzcrbarmc()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                     //添加发票号
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     String fphm = ""; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     String fprq = null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     List<IoOrderInvoiceEntity> invoiceList = orderInvoiceService.list(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class).eq(IoOrderInvoiceEntity::getOrderIdFk, ioOrderResponse.getBillNo()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             .eq(IoOrderInvoiceEntity::getBindRlFk, obj.getRelId()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             .eq(StrUtil.isNotEmpty(obj.getBatchNo()), IoOrderInvoiceEntity::getBatchNo, obj.getBatchNo()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             .groupBy(IoOrderInvoiceEntity::getInvoiceEncode)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (CollectionUtil.isNotEmpty(invoiceList)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         fphm = invoiceList.stream().map(IoOrderInvoiceEntity::getInvoiceEncode).collect(Collectors.joining(",")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         if (invoiceList.get(0).getInvoiceDate() != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             fprq = invoiceList.get(0).getInvoiceDate(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     bizData.put("invoiceDate", fprq); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     bizData.put("invoiceNo", fphm); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     list.add(bizData); |  |  |  |                     list.add(bizData); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     i++; |  |  |  |                     i++; | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |