diff --git a/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java b/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java index 65d19b38..c35664c6 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java @@ -123,7 +123,7 @@ public class BasicOrderPrintController { for (IoOrderDetailBizEntity obj : ioOrderDetailBizEntityList) { //查询产品表 UdiProductEntity udiProductEntity = udiProductService.findByUuid(obj.getUuidFk()); - List ioOrderInvoiceResponses = ioOrderDetailBizService.selectByorderIdFk(obj.getOrderIdFk()); +// List ioOrderInvoiceResponses = ioOrderDetailBizService.selectByorderIdFk(obj.getOrderIdFk()); //组装数据 Map bizData = new HashMap<>(); bizData.put("index", i); @@ -146,19 +146,19 @@ public class BasicOrderPrintController { bizData.put("manufactor", obj.getManufacturer()); bizData.put("zczbhhzbapzbh", obj.getCertCode() == null ? ' ' : obj.getCertCode()); bizData.put("ylqxzcrbarmc", udiProductEntity.getYlqxzcrbarmc() == null ? ' ' : udiProductEntity.getYlqxzcrbarmc()); - bizData.put("cplb", udiProductEntity.getCplb() == null ? ' ' : udiProductEntity.getCplb()); - if(ioOrderInvoiceResponses != null && ioOrderInvoiceResponses.size()>0){ - String encode=""; - for (IoOrderInvoiceResponse respons : ioOrderInvoiceResponses) { - encode+=respons.getInvoiceEncode()+","; - } - encode = encode.substring(0,encode.length()-1); - bizData.put("invoiceEncode", encode == null ? ' ' : encode); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String dateStr = sdf.format(ioOrderInvoiceResponses.get(0).getCreateTime()); - bizData.put("createTime", dateStr == null ? ' ' : dateStr); - - } +// bizData.put("cplb", udiProductEntity.getCplb() == null ? ' ' : udiProductEntity.getCplb()); +// if(ioOrderInvoiceResponses != null && ioOrderInvoiceResponses.size()>0){ +// String encode=""; +// for (IoOrderInvoiceResponse respons : ioOrderInvoiceResponses) { +// encode+=respons.getInvoiceEncode()+","; +// } +// encode = encode.substring(0,encode.length()-1); +// bizData.put("invoiceEncode", encode == null ? ' ' : encode); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); +// String dateStr = sdf.format(ioOrderInvoiceResponses.get(0).getCreateTime()); +// bizData.put("createTime", dateStr == null ? ' ' : dateStr); +// +// } list.add(bizData); i++; } @@ -185,7 +185,7 @@ public class BasicOrderPrintController { } //查询产品表 UdiProductEntity udiProductEntity = udiProductService.findByUuid(ioOrderDetailBizEntity.getUuidFk()); - List ioOrderInvoiceResponses = ioOrderDetailBizService.selectByorderIdFk(ioOrderDetailBizEntity.getOrderIdFk()); +// List ioOrderInvoiceResponses = ioOrderDetailBizService.selectByorderIdFk(ioOrderDetailBizEntity.getOrderIdFk()); //组装数据 Map bizData = new HashMap<>(); bizData.put("index", i); @@ -208,18 +208,18 @@ public class BasicOrderPrintController { bizData.put("manufactor", ioOrderDetailBizEntity.getManufacturer()); bizData.put("zczbhhzbapzbh", ioOrderDetailBizEntity.getCertCode() == null ? ' ' : ioOrderDetailBizEntity.getCertCode()); bizData.put("ylqxzcrbarmc", udiProductEntity.getYlqxzcrbarmc() == null ? ' ' : udiProductEntity.getYlqxzcrbarmc()); - bizData.put("cplb", udiProductEntity.getCplb() == null ? ' ' : udiProductEntity.getCplb()); - if(ioOrderInvoiceResponses != null && ioOrderInvoiceResponses.size()>0){ - String encode=""; - for (IoOrderInvoiceResponse respons : ioOrderInvoiceResponses) { - encode+=respons.getInvoiceEncode()+","; - } - encode = encode.substring(0,encode.length()-1); - bizData.put("invoiceEncode", encode == null ? ' ' : encode); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String dateStr = sdf.format(ioOrderInvoiceResponses.get(0).getCreateTime()); - bizData.put("createTime", dateStr == null ? ' ' : dateStr); - } +// bizData.put("cplb", udiProductEntity.getCplb() == null ? ' ' : udiProductEntity.getCplb()); +// if(ioOrderInvoiceResponses != null && ioOrderInvoiceResponses.size()>0){ +// String encode=""; +// for (IoOrderInvoiceResponse respons : ioOrderInvoiceResponses) { +// encode+=respons.getInvoiceEncode()+","; +// } +// encode = encode.substring(0,encode.length()-1); +// bizData.put("invoiceEncode", encode == null ? ' ' : encode); +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); +// String dateStr = sdf.format(ioOrderInvoiceResponses.get(0).getCreateTime()); +// bizData.put("createTime", dateStr == null ? ' ' : dateStr); +// } list.add(bizData); i++; } diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java index 8d1b671c..d4742b0b 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailResultController.java @@ -11,13 +11,16 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.ConstantType; import com.glxp.api.controller.BaseController; +import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.AuthCompany; import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; import com.glxp.api.entity.inout.IoOrderEntity; +import com.glxp.api.entity.inout.IoOrderInvoiceEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity; +import com.glxp.api.entity.thrsys.ThrProductsEntity; import com.glxp.api.req.inout.*; import com.glxp.api.res.inout.CptTraceOrderResponse; import com.glxp.api.res.inout.CptTraceResultResponse; @@ -26,11 +29,14 @@ import com.glxp.api.res.inout.IoOrderDetailResultResponse; import com.glxp.api.service.auth.AuthCompanyService; import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.service.inout.*; +import com.glxp.api.service.inout.impl.IoOrderInvoiceService; import com.glxp.api.service.system.SystemPDFModuleService; import com.glxp.api.service.system.SystemPDFTemplateService; +import com.glxp.api.service.thrsys.ThrProductsService; import com.glxp.api.util.DateUtil; import com.glxp.api.util.JasperUtils; import net.sf.jasperreports.engine.JRException; +import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; @@ -66,6 +72,10 @@ public class IoOrderDetailResultController extends BaseController { private String filePath; @Resource AuthCompanyService authCompanyService; + @Resource + private ThrProductsService thrProductsService; + @Resource + private IoOrderInvoiceService ioOrderInvoiceService; /** * 查询单据扫码明细列表 @@ -205,6 +215,7 @@ public class IoOrderDetailResultController extends BaseController { if (filterOrderDetailResultRequest.getList() != null && filterOrderDetailResultRequest.getList().size() > 0) { ioOrderDetailResultResponseList = filterOrderDetailResultRequest.getList(); } else { + //按查询打印 FilterOrderRequest filterOrderRequest = new FilterOrderRequest(); filterOrderRequest.setVueType(filterOrderDetailResultRequest.getActionType()); @@ -226,6 +237,25 @@ public class IoOrderDetailResultController extends BaseController { } int i = 1; for (IoOrderDetailResultResponse ioOrderDetailResultResponse : ioOrderDetailResultResponseList) { + //查询第三方产品产品类别 + ThrProductsEntity thrProductsEntity = thrProductsService.filterThrProductsByMainId(ioOrderDetailResultResponse.getBindRlFk() + ""); + //查询发票信息 + String dateStr=""; + List encodeList=new ArrayList<>(); + IoOrderInvoiceRequest ioOrderInvoiceRequest=new IoOrderInvoiceRequest(); + ioOrderInvoiceRequest.setBindRlFk(ioOrderDetailResultResponse.getBindRlFk() + ""); + ioOrderInvoiceRequest.setOrderIdFk(ioOrderDetailResultResponse.getOrderIdFk()); + ioOrderInvoiceRequest.setBatchNo(ioOrderDetailResultResponse.getBatchNo()); + List ioOrderInvoiceEntityList=ioOrderInvoiceService.selectOrderInvoice(ioOrderInvoiceRequest); + for (IoOrderInvoiceEntity ioOrderInvoiceEntity : ioOrderInvoiceEntityList) { + encodeList.add(ioOrderInvoiceEntity.getInvoiceEncode()); + } + String encode=String.join(",", encodeList); + if(CollectionUtils.isNotEmpty(ioOrderInvoiceEntityList)){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + dateStr = sdf.format(ioOrderInvoiceEntityList.get(0).getCreateTime()); + } + //组装数据 Map ioOrderDetailResultData = new HashMap<>(); ioOrderDetailResultData.put("index", String.valueOf(i)); @@ -248,11 +278,15 @@ public class IoOrderDetailResultController extends BaseController { ioOrderDetailResultData.put("billTypeName", ioOrderDetailResultResponse.getBillTypeName() == null ? ' ' : ioOrderDetailResultResponse.getBillTypeName()); ioOrderDetailResultData.put("mainAction", ioOrderDetailResultResponse.getMainAction() == null ? ' ' : ioOrderDetailResultResponse.getMainAction()); ioOrderDetailResultData.put("auditTime", ioOrderDetailResultResponse.getAuditTime() == null ? ' ' : formatter.format(ioOrderDetailResultResponse.getAuditTime())); + if(thrProductsEntity!=null){ + ioOrderDetailResultData.put("cplb", thrProductsEntity.getCplb() == null ? ' ' : thrProductsEntity.getCplb()); + } + ioOrderDetailResultData.put("invoiceEncode", encode); + ioOrderDetailResultData.put("createTime", dateStr); list.add(ioOrderDetailResultData); i++; } - data.put("data", list); String param = JSON.toJSONString(data); JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); @@ -260,6 +294,7 @@ public class IoOrderDetailResultController extends BaseController { } + /** * 提供UDI协调调用单据明细 */ diff --git a/src/main/java/com/glxp/api/dao/thrsys/ThrProductsDao.java b/src/main/java/com/glxp/api/dao/thrsys/ThrProductsDao.java index de7235d6..6e345000 100644 --- a/src/main/java/com/glxp/api/dao/thrsys/ThrProductsDao.java +++ b/src/main/java/com/glxp/api/dao/thrsys/ThrProductsDao.java @@ -34,5 +34,5 @@ public interface ThrProductsDao extends BaseMapperPlus selectThrProducts(FilterThrProductsRequest filterThrProductsRequest); int insertOrUpdateEntity(ThrProductsEntity record); - + ThrProductsEntity filterThrProductsByMainId(@Param("relId") String relId); } diff --git a/src/main/java/com/glxp/api/service/thrsys/ThrProductsService.java b/src/main/java/com/glxp/api/service/thrsys/ThrProductsService.java index 8ba96fbb..98ab868f 100644 --- a/src/main/java/com/glxp/api/service/thrsys/ThrProductsService.java +++ b/src/main/java/com/glxp/api/service/thrsys/ThrProductsService.java @@ -35,5 +35,6 @@ public interface ThrProductsService extends IService { Boolean isExit(String code, String thirdIdFk); + ThrProductsEntity filterThrProductsByMainId(String relId); } diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java index 375002ab..1161cc34 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java @@ -114,4 +114,10 @@ public class ThrProductsServiceImpl extends ServiceImpl + + + +