From 2f0cf6428804436ec70f1bc395432f8a721ed891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Sun, 8 Jan 2023 14:11:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E4=BC=81=E4=B8=9A=E8=B5=84?= =?UTF-8?q?=E8=B4=A8=E6=89=93=E5=8D=B0=E5=8A=9F=E8=83=BD=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/SupCertController.java | 155 +++++++++++++----- .../req/purchase/purPlanPrintRequest.java | 7 +- .../mapper/purchase/SupManufacturerDao.xml | 4 +- 3 files changed, 122 insertions(+), 44 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 1b41dba1..b99c2b6b 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 @@ -17,10 +17,7 @@ import com.glxp.api.admin.req.info.DeleteCompanyFileRequest; import com.glxp.api.admin.req.info.SystemPDFModuleRequest; import com.glxp.api.admin.req.inventory.InvCountOrderPrintRequest; import com.glxp.api.admin.req.itextpdf.InspectionPDFTemplateRequest; -import com.glxp.api.admin.req.purchase.FilterSupCertRequest; -import com.glxp.api.admin.req.purchase.PostSelCertRequest; -import com.glxp.api.admin.req.purchase.PostSupCertRequest; -import com.glxp.api.admin.req.purchase.purPlanPrintRequest; +import com.glxp.api.admin.req.purchase.*; import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.res.purchase.SupProductResponse; import com.glxp.api.admin.service.auth.AuthAdminService; @@ -251,42 +248,42 @@ public class SupCertController { SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(purPlanPrintRequest.getTemplateId()); //打印单号标签 Map data = new HashMap<>(1); - List list=new ArrayList<>(); + List list = new ArrayList<>(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式 //查询配送企业信息 - SupCompanyEntity supCompanyEntity=supCompanyService.findCompany(purPlanPrintRequest.getCustomerId()); + SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(purPlanPrintRequest.getCustomerId()); //查询详情 - List selectSupCertList=supCertService.selectSupCertList(purPlanPrintRequest); - int i=1; - if(selectSupCertList!=null && selectSupCertList.size()>0){ - for(SupCertEntity obj:selectSupCertList){ + List selectSupCertList = supCertService.selectSupCertList(purPlanPrintRequest); + int i = 1; + if (selectSupCertList != null && selectSupCertList.size() > 0) { + for (SupCertEntity obj : selectSupCertList) { //组装数据 - Map supData=new HashMap<>(); - supData.put("companyName",supCompanyEntity.getCompanyName()==null ? ' ' :supCompanyEntity.getCompanyName()); - supData.put("creditNum",supCompanyEntity.getCreditNum()==null ? ' ' :supCompanyEntity.getCreditNum()); - supData.put("classes",supCompanyEntity.getClasses()==null ? ' ' :supCompanyEntity.getClasses()); - supData.put("area",supCompanyEntity.getArea()==null ? ' ' :supCompanyEntity.getArea()); - supData.put("contacts",supCompanyEntity.getContacts()==null ? ' ' :supCompanyEntity.getContacts()); - supData.put("detailAddr",supCompanyEntity.getDetailAddr()==null ? ' ' :supCompanyEntity.getDetailAddr()); - supData.put("mobile",supCompanyEntity.getMobile()==null ? ' ' :supCompanyEntity.getMobile()); - supData.put("email",supCompanyEntity.getEmail()==null ? ' ' :supCompanyEntity.getEmail()); - 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("remark",obj.getRemark()==null ? ' ' :obj.getRemark()); - supData.put("filePath","d:/1s/udiwms/register/file/image2/" + obj.getFilePath()); + Map supData = new HashMap<>(); + supData.put("companyName", supCompanyEntity.getCompanyName() == null ? ' ' : supCompanyEntity.getCompanyName()); + supData.put("creditNum", supCompanyEntity.getCreditNum() == null ? ' ' : supCompanyEntity.getCreditNum()); + supData.put("classes", supCompanyEntity.getClasses().equals(1) ? "医院" : "经营企业"); + supData.put("area", supCompanyEntity.getArea() == null ? ' ' : supCompanyEntity.getArea()); + supData.put("contacts", supCompanyEntity.getContacts() == null ? ' ' : supCompanyEntity.getContacts()); + supData.put("detailAddr", supCompanyEntity.getDetailAddr() == null ? ' ' : supCompanyEntity.getDetailAddr()); + supData.put("mobile", supCompanyEntity.getMobile() == null ? ' ' : supCompanyEntity.getMobile()); + supData.put("email", supCompanyEntity.getEmail() == null ? ' ' : supCompanyEntity.getEmail()); + 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("remark", 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); + String param = JSON.toJSONString(list); JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf"); } @@ -300,32 +297,106 @@ public class SupCertController { @PostMapping("/sup/info/filterCompanyCertIdList") public BaseResponse filterCompanyCertIdList(@RequestBody FilterSupCertRequest filterSupCertRequest) { - if(StrUtil.isNotEmpty(filterSupCertRequest.getCustomerId()) && filterSupCertRequest.getType()!=null){ - List supCertEntityList=supCertService.filterCompanyCert(filterSupCertRequest); - List idsList=supCertEntityList .stream().map(SupCertEntity::getId).distinct().collect(Collectors.toList()); - return ResultVOUtils.success(idsList); + if (StrUtil.isNotEmpty(filterSupCertRequest.getCustomerId()) && filterSupCertRequest.getType() != null) { + List supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest); + List idsList = supCertEntityList.stream().map(SupCertEntity::getId).distinct().collect(Collectors.toList()); + return ResultVOUtils.success(idsList); } - return ResultVOUtils.error(999,"参数错误"); + return ResultVOUtils.error(999, "参数错误"); } - public String getAuditStatus(int type){ + public String getAuditStatus(int type) { - if(type==0){ + if (type == 0) { return "草稿"; - }else if(type==1){ + } else if (type == 1) { return "审核通过"; - }else if(type==2){ + } else if (type == 2) { return "审核不通过"; - }else if(type==3){ + } else if (type == 3) { return "申请变更"; - }else if(type==4){ + } else if (type == 4) { return "申请变更通过"; - }else if(type==5){ + } else if (type == 5) { return "申请变更不通过"; - }else if(type==6){ + } else if (type == 6) { return "已提交未审核"; } return ""; } + public String getRegisterStatus(String type) { + + if (type.equals("1")) { + return "续存(在营,开业,在册)"; + } else if (type.equals("2")) { + return "吊销"; + } else if (type.equals("3")) { + return "注销"; + } else if (type.equals("4")) { + return "迁出"; + } + return ""; + } + + + + /** + * 打印生产企业模板单号标签 + * + * @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");//定义新的日期格式 + + + FilterSupManufacturerRequest filterSupManufacturerRequest=new FilterSupManufacturerRequest(); + filterSupManufacturerRequest.setId(purPlanPrintRequest.getId()); + //查询生产企业信息 + 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("companyName", supManufacturerEntity.getCompanyName() == null ? ' ' : supManufacturerEntity.getCompanyName()); + supData.put("companyType", supManufacturerEntity.getCompanyType().equals(1) ? "境内企业" : "境外企业"); + supData.put("creditCode", supManufacturerEntity.getCreditCode() == null ? ' ' : supManufacturerEntity.getCreditCode()); + supData.put("placeArea", supManufacturerEntity.getPlaceArea() == null ? ' ' : supManufacturerEntity.getPlaceArea()); + supData.put("productionArea", supManufacturerEntity.getProductionArea() == null ? ' ' : supManufacturerEntity.getProductionArea()); + supData.put("registerStatus", getRegisterStatus(supManufacturerEntity.getRegisterStatus())); + supData.put("placeAddress", supManufacturerEntity.getPlaceAddress() == null ? ' ' : supManufacturerEntity.getPlaceAddress()); + supData.put("productionAddress", supManufacturerEntity.getProductionAddress() == null ? ' ' : supManufacturerEntity.getProductionAddress()); + supData.put("remark1", supManufacturerEntity.getRemark() == null ? ' ' : supManufacturerEntity.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()); + list.add(supData); + i++; + } + } + + String param = JSON.toJSONString(list); + JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf"); + } + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/purchase/purPlanPrintRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/purchase/purPlanPrintRequest.java index 3599d8d3..7dc67f3a 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/purchase/purPlanPrintRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/purchase/purPlanPrintRequest.java @@ -5,7 +5,7 @@ import lombok.Data; import java.util.List; /** - * 盘点单据打印参数 + * 采购单据打印参数 */ @Data public class purPlanPrintRequest { @@ -25,4 +25,9 @@ public class purPlanPrintRequest { */ private String customerId; + /** + * 采购id + */ + private Long id; + } 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 777e09ac..779add66 100644 --- a/api-admin/src/main/resources/mybatis/mapper/purchase/SupManufacturerDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/purchase/SupManufacturerDao.xml @@ -137,7 +137,9 @@ and creditCode = #{creditCode} - + + and id = #{id} + and sup_manufacturer.customerId = #{customerId}