From cf7c7074757cfc35e0eb27c61fc38168209797b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Mon, 9 Jan 2023 15:26:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E9=80=81=E4=BA=A7=E5=93=81=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/SupCertController.java | 72 +++++++++++++++++-- .../mapper/purchase/SupManufacturerDao.xml | 3 + 2 files changed, 70 insertions(+), 5 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCertController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCertController.java index 2685e077..d601a248 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCertController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/purchase/SupCertController.java @@ -274,7 +274,7 @@ public class SupCertController { supData.put("code", obj.getCode() == null ? ' ' : obj.getCode()); supData.put("vaiDate", formatter.format(obj.getVailDate())); supData.put("expireDate", formatter.format(obj.getExpireDate())); - supData.put("status", obj.getStatus() == 0 ? "启用" : "禁用"); + supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); supData.put("remark", obj.getRemark() == null ? ' ' : obj.getRemark()); supData.put("filePath", "d:/1s/udiwms/register/file/image2/" + obj.getFilePath()); @@ -325,6 +325,7 @@ public class SupCertController { } return ""; } + public String getRegisterStatus(String type) { if (type.equals("1")) { @@ -340,7 +341,6 @@ public class SupCertController { } - /** * 打印生产企业模板单号标签 * @@ -359,11 +359,11 @@ public class SupCertController { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式 - FilterSupManufacturerRequest filterSupManufacturerRequest=new FilterSupManufacturerRequest(); + FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest(); filterSupManufacturerRequest.setId(purPlanPrintRequest.getId()); //查询生产企业信息 List supManufacturerEntityList = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); - SupManufacturerEntity supManufacturerEntity=supManufacturerEntityList.get(0); + SupManufacturerEntity supManufacturerEntity = supManufacturerEntityList.get(0); //查询详情 List selectSupCertList = supCertService.selectSupCertList(purPlanPrintRequest); int i = 1; @@ -386,7 +386,69 @@ public class SupCertController { supData.put("code", obj.getCode() == null ? ' ' : obj.getCode()); supData.put("vaiDate", formatter.format(obj.getVailDate())); supData.put("expireDate", formatter.format(obj.getExpireDate())); - supData.put("status", obj.getStatus() == 0 ? "启用" : "禁用"); + supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); + supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); + supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark()); + supData.put("filePath", "d:/1s/udiwms/register/file/image2/" + obj.getFilePath()); + list.add(supData); + i++; + } + } + + String param = JSON.toJSONString(list); + JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf"); + } + + /** + * 打印生产企业模板单号标签 + * + * @param purPlanPrintRequest + * @param request + * @param response + * @throws Exception + */ + @AuthRuleAnnotation("") + @PostMapping("/sup/info/printSupCertProduction") + public void printSupCertProduction(@RequestBody purPlanPrintRequest purPlanPrintRequest, HttpServletRequest request, HttpServletResponse response) throws Exception { + SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(purPlanPrintRequest.getTemplateId()); + //打印单号标签 + Map data = new HashMap<>(1); + List list = new ArrayList<>(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式 + + //查询配送产品信息 + SupProductEntity supProductEntity = supProductService.findRegistration(purPlanPrintRequest.getId()); + //查询生产企业信息 + FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest(); + filterSupManufacturerRequest.setManufacturerId(supProductEntity.getManufacturerIdFk()); + List supManufacturerEntityList = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); + SupManufacturerEntity supManufacturerEntity = supManufacturerEntityList.get(0); + + //查询详情 + List selectSupCertList = supCertService.selectSupCertList(purPlanPrintRequest); + int i = 1; + if (selectSupCertList != null && selectSupCertList.size() > 0) { + for (SupCertEntity obj : selectSupCertList) { + //组装数据 + Map supData = new HashMap<>(); + supData.put("customerName", supManufacturerEntity.getSupName() == null ? ' ' : supManufacturerEntity.getSupName()); + supData.put("manufacturerldFk", supManufacturerEntity.getCompanyName() == null ? ' ' : supManufacturerEntity.getCompanyName()); + supData.put("recordProductName", supProductEntity.getRecordProductName() == null ? ' ' : supProductEntity.getRecordProductName()); + supData.put("recordCode", supProductEntity.getRecordCode() == null ? ' ' : supProductEntity.getRecordCode()); + supData.put("recordPeopleName", supProductEntity.getRecordPeopleName() == null ? ' ' : supProductEntity.getRecordPeopleName()); + supData.put("hchzsb", supProductEntity.getHchzsb() == null ? ' ' : supProductEntity.getHchzsb()); + supData.put("productType", supProductEntity.getProductType() == null ? ' ' : supProductEntity.getProductType()); + supData.put("productDirectoryCode", supProductEntity.getProductDirectoryCode() == null ? ' ' : supProductEntity.getProductDirectoryCode()); + supData.put("specification", supProductEntity.getSpecification() == null ? ' ' : supProductEntity.getSpecification()); + supData.put("cpms", supProductEntity.getCpms() == null ? ' ' : supProductEntity.getCpms()); + supData.put("remark1", supProductEntity.getRemark() == null ? ' ' : supProductEntity.getRemark()); + + supData.put("index", String.valueOf(i)); + supData.put("name", obj.getName() == null ? ' ' : obj.getName()); + supData.put("code", obj.getCode() == null ? ' ' : obj.getCode()); + supData.put("vaiDate", formatter.format(obj.getVailDate())); + supData.put("expireDate", formatter.format(obj.getExpireDate())); + supData.put("status", obj.getStatus() == 0 ? "有效" : "失效"); supData.put("auditStatus", getAuditStatus(obj.getAuditStatus())); supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark()); supData.put("filePath", "d:/1s/udiwms/register/file/image2/" + obj.getFilePath()); diff --git a/api-admin/src/main/resources/mybatis/mapper/purchase/SupManufacturerDao.xml b/api-admin/src/main/resources/mybatis/mapper/purchase/SupManufacturerDao.xml index 779add66..0efd84c9 100644 --- a/api-admin/src/main/resources/mybatis/mapper/purchase/SupManufacturerDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/purchase/SupManufacturerDao.xml @@ -146,6 +146,9 @@ and id != #{id} + + and sup_manufacturer.manufacturerId = #{manufacturerId} +