From 8d37c0ebf9c89b4067b7d4c8de3370329be113da Mon Sep 17 00:00:00 2001 From: yanyang Date: Tue, 21 Mar 2023 15:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=AF=BC=E5=87=BA=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChangePackagingBoxHistoryController.java | 22 ++++++++++++- .../WoPackagingBoxSubstrateController.java | 19 ++++++++++- .../dto/ChangePackagingBoxHistoryDTO.java | 6 ++++ .../dto/WoPackagingBoxSubstrateDTO.java | 6 ++++ .../excel/ChangePackagingBoxHistoryExcel.java | 4 +-- .../excel/WoPackagingBoxSubstrateExcel.java | 12 +++---- .../WoPackagingBoxSubstrateManualExcel.java | 32 +++++++++++++++++++ ...angePackagingBoxHistoryServiceBizImpl.java | 1 + 8 files changed, 92 insertions(+), 10 deletions(-) create mode 100644 ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateManualExcel.java diff --git a/ym-packing/src/main/java/com/cnbm/packing/controller/ChangePackagingBoxHistoryController.java b/ym-packing/src/main/java/com/cnbm/packing/controller/ChangePackagingBoxHistoryController.java index 1ad04f4..c145426 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/controller/ChangePackagingBoxHistoryController.java +++ b/ym-packing/src/main/java/com/cnbm/packing/controller/ChangePackagingBoxHistoryController.java @@ -3,6 +3,7 @@ package com.cnbm.packing.controller; import com.cnbm.admin.annotation.LogOperation; import com.cnbm.common.constant.Constant; import com.cnbm.common.page.PageData; +import com.cnbm.common.utils.ConvertUtils; import com.cnbm.common.utils.ExcelUtils; import com.cnbm.common.utils.Result; import com.cnbm.common.validator.AssertUtils; @@ -25,6 +26,7 @@ import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletResponse; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Map; @@ -119,8 +121,26 @@ public class ChangePackagingBoxHistoryController { @PreAuthorize("@ex.hasAuthority('packing:changePackagingBoxHistory:export')") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { List list = changePackagingBoxHistoryService.historyList(params); + List dtoList = ConvertUtils.sourceToTarget(list, ChangePackagingBoxHistoryDTO.class); if(list.size()>0) { - ExcelUtils.exportExcelToTarget(response, "包装箱模组操作记录", list, ChangePackagingBoxHistoryExcel.class); + for(ChangePackagingBoxHistoryDTO dto:dtoList){ + //操作时间 转化 + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + if(dto.getCreateTime()!=null){ + dto.setCreateTime1(df.format(dto.getCreateTime())); + } + //操作类型 1=模组加入包装箱;2=模组移出包装箱;3=模组换箱 + if(dto.getType()==1){ + dto.setType1("模组加入包装箱"); + } + if(dto.getType()==2){ + dto.setType1("模组移出包装箱"); + } + if(dto.getType()==3){ + dto.setType1("模组换箱"); + } + } + ExcelUtils.exportExcelToTarget(response, "包装箱模组操作记录", dtoList, ChangePackagingBoxHistoryExcel.class); } } diff --git a/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxSubstrateController.java b/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxSubstrateController.java index 73c25ca..7da01ab 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxSubstrateController.java +++ b/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxSubstrateController.java @@ -18,6 +18,7 @@ import com.cnbm.packing.dto.WoPackagingBoxSubstrateDTO; import com.cnbm.packing.entity.WoPackagingBox; import com.cnbm.packing.entity.WoPackagingBoxSubstrate; import com.cnbm.packing.excel.WoPackagingBoxSubstrateExcel; +import com.cnbm.packing.excel.WoPackagingBoxSubstrateManualExcel; import com.cnbm.packing.mapper.WoPackagingBoxMapper; import com.cnbm.packing.mapper.WoPackagingBoxSubstrateMapper; import com.cnbm.packing.param.PowerReportQueryParam; @@ -36,6 +37,7 @@ import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletResponse; import java.text.DecimalFormat; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.time.LocalDateTime; import java.util.List; @@ -360,7 +362,22 @@ public class WoPackagingBoxSubstrateController { public void exportPackingInfo(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { List list = woPackagingBoxSubstrateService.substrateList(params); if(list.size()>0) { - ExcelUtils.exportExcelToTarget(response, "装箱单信息", list, WoPackagingBoxSubstrateExcel.class); + //包装箱创建时间 最近打印时间 转化 + for(WoPackagingBoxSubstrateDTO dto:list){ + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + if(dto.getBoxCreateTime()!=null){ + dto.setBoxCreateTime1(df.format(dto.getBoxCreateTime())); + } + if(dto.getPrintTime()!=null){ + dto.setPrintTime1(df.format(dto.getPrintTime())); + } + } + if(Integer.parseInt(params.get("model").toString())==1){ + ExcelUtils.exportExcelToTarget(response, "手动装箱单信息", list, WoPackagingBoxSubstrateManualExcel.class); + } + else { + ExcelUtils.exportExcelToTarget(response, "自动装箱单信息", list, WoPackagingBoxSubstrateExcel.class); + } } } } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/dto/ChangePackagingBoxHistoryDTO.java b/ym-packing/src/main/java/com/cnbm/packing/dto/ChangePackagingBoxHistoryDTO.java index aed4463..b387127 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/dto/ChangePackagingBoxHistoryDTO.java +++ b/ym-packing/src/main/java/com/cnbm/packing/dto/ChangePackagingBoxHistoryDTO.java @@ -75,4 +75,10 @@ public class ChangePackagingBoxHistoryDTO implements Serializable { @ApiModelProperty(value = "版本号") private Integer version; + @ApiModelProperty(value = "操作时间(转)") + private String createTime1; + + @ApiModelProperty(value = "操作类型(转)") + private String type1; + } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/dto/WoPackagingBoxSubstrateDTO.java b/ym-packing/src/main/java/com/cnbm/packing/dto/WoPackagingBoxSubstrateDTO.java index 76ad776..12abb01 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/dto/WoPackagingBoxSubstrateDTO.java +++ b/ym-packing/src/main/java/com/cnbm/packing/dto/WoPackagingBoxSubstrateDTO.java @@ -179,4 +179,10 @@ public class WoPackagingBoxSubstrateDTO implements Serializable { @ApiModelProperty(value = "打印时间(最近一次打印时间)") private LocalDateTime printTime; + @ApiModelProperty(value = "包装箱创建时间(转)") + private String boxCreateTime1; + + @ApiModelProperty(value = "最近打印时间(转)") + private String printTime1; + } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/excel/ChangePackagingBoxHistoryExcel.java b/ym-packing/src/main/java/com/cnbm/packing/excel/ChangePackagingBoxHistoryExcel.java index fc10100..d3485fa 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/excel/ChangePackagingBoxHistoryExcel.java +++ b/ym-packing/src/main/java/com/cnbm/packing/excel/ChangePackagingBoxHistoryExcel.java @@ -28,8 +28,8 @@ public class ChangePackagingBoxHistoryExcel { @Excel(name = "目的位置") private Integer targetSlot; @Excel(name = "操作类型") - private Integer type; + private String type1; @Excel(name = "操作时间") - private LocalDateTime createTime; + private String createTime1; } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateExcel.java b/ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateExcel.java index 45d9871..256948a 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateExcel.java +++ b/ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateExcel.java @@ -19,26 +19,26 @@ import java.util.Date; public class WoPackagingBoxSubstrateExcel { @Excel(name = "创建时间") - private LocalDateTime boxCreateTime; + private String boxCreateTime1; @Excel(name = "模组ID") private String woSubstrateId; @Excel(name = "BoxID") private String packagingBoxId; @Excel(name = "模组所在包装箱位置") private Integer slot; + @Excel(name = "订单号") + private String orderName; + @Excel(name = "SAP物料号") + private String sapMaterial; @Excel(name = "档位功率") private String powerLevel; @Excel(name = "补偿功率") private Float pmpp; @Excel(name = "实测功率") private Float actualPmpp; - @Excel(name = "订单") - private String orderName; @Excel(name = "线体") private Integer lineBody; - @Excel(name = "SAP物料号") - private String sapMaterial; @Excel(name = "最近打印时间") - private LocalDateTime printTime; + private String printTime1; } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateManualExcel.java b/ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateManualExcel.java new file mode 100644 index 0000000..af6d26c --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateManualExcel.java @@ -0,0 +1,32 @@ +package com.cnbm.packing.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 包装箱基板关联表 ( 基板表 ) + * + * @author codeGenerator + * @since 2023-02-21 + */ +@Data +public class WoPackagingBoxSubstrateManualExcel { + + @Excel(name = "创建时间") + private String boxCreateTime1; + @Excel(name = "模组ID") + private String woSubstrateId; + @Excel(name = "BoxID") + private String packagingBoxId; + @Excel(name = "模组所在包装箱位置") + private Integer slot; + @Excel(name = "SAP物料号") + private String sapMaterial; + @Excel(name = "功率等级") + private String powerLevel; + @Excel(name = "线体") + private Integer lineBody; + @Excel(name = "最近打印时间") + private String printTime1; + +} \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/service/impl/ChangePackagingBoxHistoryServiceBizImpl.java b/ym-packing/src/main/java/com/cnbm/packing/service/impl/ChangePackagingBoxHistoryServiceBizImpl.java index a732963..15a8f75 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/service/impl/ChangePackagingBoxHistoryServiceBizImpl.java +++ b/ym-packing/src/main/java/com/cnbm/packing/service/impl/ChangePackagingBoxHistoryServiceBizImpl.java @@ -51,6 +51,7 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl