From e6cf46a50c11fb57a7b4f640af981c68a488de68 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Sat, 27 May 2023 10:51:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=85=A8=E9=83=A8=E5=86=85?= =?UTF-8?q?=E9=83=A8=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/BasicOrderPrintController.java | 34 ++++++++++--------- .../inv/InvInnerOrderPrintController.java | 12 ++++--- .../com/glxp/api/req/auth/PCLoginRequest.java | 1 - 3 files changed, 25 insertions(+), 22 deletions(-) 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 3cabb78d..f63903b0 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicOrderPrintController.java @@ -80,8 +80,7 @@ public class BasicOrderPrintController { public BaseResponse inspectionStockOrderPDFFromTemplateFile(@RequestBody FilterOrderPrintRequest filterOrderPrintRequest) { - - String name=getStatusName(filterOrderPrintRequest.getStatus()); + String name = getStatusName(filterOrderPrintRequest.getStatus()); SysPdfTemplateRelevanceCodeEntity sysPdfTemplateRelevanceCodeEntity = systemPDFTemplateRelevanceCodeService.selectNameAndAction(name, filterOrderPrintRequest.getAction()); if (sysPdfTemplateRelevanceCodeEntity != null) { SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(sysPdfTemplateRelevanceCodeEntity.getTemplateId() + ""); @@ -101,7 +100,7 @@ public class BasicOrderPrintController { @PostMapping("/udiwms/pdf/template/order/file") public void printSupCertProduction(@RequestBody FilterOrderPrintRequest filterOrderPrintRequest, HttpServletRequest request, HttpServletResponse response) throws Exception { SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(filterOrderPrintRequest.getTemplateId()); - String name=getStatusName(filterOrderPrintRequest.getStatus()); + String name = getStatusName(filterOrderPrintRequest.getStatus()); SysPdfTemplateRelevanceCodeEntity sysPdfTemplateRelevanceCodeEntity = systemPDFTemplateRelevanceCodeService.selectNameAndAction(name, filterOrderPrintRequest.getAction()); //打印单号标签 Map data = new HashMap<>(1); @@ -203,20 +202,20 @@ public class BasicOrderPrintController { data.put("data", list); String param = JSON.toJSONString(data); - JasperUtils.jasperReport(request, response, param, filePath+"pdf/template/"+FileUtils.getLastFileName(systemPDFTemplateEntity.getPath()), "pdf"); + JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + FileUtils.getLastFileName(systemPDFTemplateEntity.getPath()), "pdf"); } - public String getStatusName(Integer type){ - String name=""; - if(type==3){ - name="ScanCodeVerification"; - }else if(type==5){ - name="ScanCodeCheck"; - }else if(type==10){ - name="ScanCode"; - }else if(type==7){ - name="ScanCodeAlready"; + public String getStatusName(Integer type) { + String name = ""; + if (type == 3) { + name = "ScanCodeVerification"; + } else if (type == 5) { + name = "ScanCodeCheck"; + } else if (type == 10) { + name = "ScanCode"; + } else if (type == 7) { + name = "ScanCodeAlready"; } return name; } @@ -228,7 +227,7 @@ public class BasicOrderPrintController { @RequestBody FilterOrderPrintRequest filterOrderPrintRequest) throws Exception { //查询模板文件是否存在 - SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(filterOrderPrintRequest.getLabelId()+""); + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(filterOrderPrintRequest.getLabelId() + ""); if (null == sysPdfTemplateRelevanceStatemenEntity) { return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); } @@ -273,7 +272,10 @@ public class BasicOrderPrintController { Map bizData = new HashMap<>(); bizData.put("index", i); bizData.put("nameCode", obj.getNameCode() == null ? ' ' : obj.getNameCode()); - bizData.put("udiCode", udiProductEntity.getUuid() == null ? ' ' : udiProductEntity.getUuid()); + String udiCode = "#" + obj.getNameCode() + "#" + obj.getProduceDate() + "#" + obj.getExpireDate() + + "#" + obj.getBatchNo() + "#" + obj.getSerialNo() + "#" + obj.getWarehouseCode() + "#" + obj.getDeptCode(); + udiCode = udiCode.replaceAll("#null", "#"); + bizData.put("udiCode", udiCode); bizData.put("cpmctymc", udiProductEntity.getCpmctymc() == null ? ' ' : udiProductEntity.getCpmctymc()); bizData.put("ggxh", udiProductEntity.getGgxh() == null ? ' ' : udiProductEntity.getGgxh()); bizData.put("batchNo", obj.getBatchNo() == null ? ' ' : obj.getBatchNo()); diff --git a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java index 28380a50..66a0a627 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java @@ -10,11 +10,10 @@ import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BusinessType; import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.inv.InnerOrderEntity; -import com.glxp.api.entity.inv.InvInnerOrderPrintEntity; import com.glxp.api.entity.inv.InvInnerOrderPdfTempEntity; +import com.glxp.api.entity.inv.InvInnerOrderPrintEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; -import com.glxp.api.entity.system.SystemPDFModuleEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.req.inout.InspectionPDFTemplateRequest; import com.glxp.api.req.inv.*; @@ -42,7 +41,10 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; @RestController public class InvInnerOrderPrintController { @@ -280,8 +282,8 @@ public class InvInnerOrderPrintController { } - Map map=new HashMap<>(); - map.put("data",printEntities); + Map map = new HashMap<>(); + map.put("data", printEntities); String param = JSON.toJSONString(map); JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + FileUtils.getLastFileName(systemPDFTemplateEntity.getPath()), "pdf"); diff --git a/src/main/java/com/glxp/api/req/auth/PCLoginRequest.java b/src/main/java/com/glxp/api/req/auth/PCLoginRequest.java index dd63ab7a..910d2014 100644 --- a/src/main/java/com/glxp/api/req/auth/PCLoginRequest.java +++ b/src/main/java/com/glxp/api/req/auth/PCLoginRequest.java @@ -13,7 +13,6 @@ public class PCLoginRequest { @NotEmpty(message = "密码不能为空") private String password; - @NotEmpty(message = "机器码不能为空") private String machineInfo; }