diff --git a/aucma-report/src/main/java/com/aucma/report/controller/ProductionReportController.java b/aucma-report/src/main/java/com/aucma/report/controller/ProductionReportController.java index cffed5f..c6d2c47 100644 --- a/aucma-report/src/main/java/com/aucma/report/controller/ProductionReportController.java +++ b/aucma-report/src/main/java/com/aucma/report/controller/ProductionReportController.java @@ -7,6 +7,7 @@ import com.aucma.common.core.page.TableDataInfo; import com.aucma.common.utils.poi.ExcelUtil; import com.aucma.report.domain.BoxTraceabilityDetailReport; import com.aucma.report.domain.BoxTraceabilityReport; +import com.aucma.report.domain.InventoryRateReport; import com.aucma.report.service.IProductionReportService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -32,9 +33,22 @@ public class ProductionReportController extends BaseController { * 查询清单率报表 */ @GetMapping("/inventoryRateReportList") - public AjaxResult inventoryRateReportList(@RequestParam(required = false) Map hashMap) { - List> list = productionReportService.inventoryRateReportList(hashMap); - return success(list); + public TableDataInfo inventoryRateReportList(@RequestParam(required = false) Map hashMap) { + startPage(); + List list = productionReportService.inventoryRateReportList(hashMap); + return getDataTable(list); + } + + /** + * 查询清单率报表导出 + * @param hashMap + * @return + */ + @PostMapping("/inventoryRateReportList/export") + public void inventoryRateReportListExport(HttpServletResponse response, @RequestParam(required = false) Map hashMap) { + List list = productionReportService.inventoryRateReportList(hashMap); + ExcelUtil util = new ExcelUtil<>(InventoryRateReport. class); + util.exportExcel(response, list, "清单率报表" ); } /** diff --git a/aucma-report/src/main/java/com/aucma/report/domain/InventoryRateReport.java b/aucma-report/src/main/java/com/aucma/report/domain/InventoryRateReport.java new file mode 100644 index 0000000..f27dfa4 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/domain/InventoryRateReport.java @@ -0,0 +1,154 @@ +package com.aucma.report.domain; + +import com.aucma.common.annotation.Excel; +import com.aucma.common.core.domain.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.Date; + +/** + * 发泡箱体追溯报表 + * + * @author Yinq + * @date 2024-03-15 + */ +public class InventoryRateReport extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 产线 + */ + @Excel(name = "产线") + @JsonProperty("PRODUCT_LINE_NAME") + private String PRODUCT_LINE_NAME; + + /** + * SAP订单编号 + */ + @Excel(name = "SAP订单编号") + @JsonProperty("ORDER_CODE") + private String ORDER_CODE; + + + /** + * 计划日期 + */ + @Excel(name = "计划日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @JsonProperty("BEGIN_DATE") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date BEGIN_DATE; + + /** + * 产品编码 + */ + @Excel(name = "产品编码") + @JsonProperty("MATERIAL_CODE") + private String MATERIAL_CODE; + + /** + * 产品名称 + */ + @Excel(name = "产品名称") + @JsonProperty("MATERIAL_NAME") + private String MATERIAL_NAME; + + /** + * 计划数量 + */ + @Excel(name = "计划数量") + @JsonProperty("ORDER_AMOUNT") + private Long ORDER_AMOUNT; + + /** + * 完成数量 + */ + @Excel(name = "完成数量") + @JsonProperty("COMPLETE_AMOUNT") + private Long COMPLETE_AMOUNT; + + /** + * 完成率 + */ + @Excel(name = "完成率") + @JsonProperty("ORDER_RATE") + private String ORDER_RATE; + + public String getPRODUCT_LINE_NAME() { + return PRODUCT_LINE_NAME; + } + + public void setPRODUCT_LINE_NAME(String PRODUCT_LINE_NAME) { + this.PRODUCT_LINE_NAME = PRODUCT_LINE_NAME; + } + + public String getORDER_CODE() { + return ORDER_CODE; + } + + public void setORDER_CODE(String ORDER_CODE) { + this.ORDER_CODE = ORDER_CODE; + } + + public Date getBEGIN_DATE() { + return BEGIN_DATE; + } + + public void setBEGIN_DATE(Date BEGIN_DATE) { + this.BEGIN_DATE = BEGIN_DATE; + } + + public String getMATERIAL_CODE() { + return MATERIAL_CODE; + } + + public void setMATERIAL_CODE(String MATERIAL_CODE) { + this.MATERIAL_CODE = MATERIAL_CODE; + } + + public String getMATERIAL_NAME() { + return MATERIAL_NAME; + } + + public void setMATERIAL_NAME(String MATERIAL_NAME) { + this.MATERIAL_NAME = MATERIAL_NAME; + } + + public Long getORDER_AMOUNT() { + return ORDER_AMOUNT; + } + + public void setORDER_AMOUNT(Long ORDER_AMOUNT) { + this.ORDER_AMOUNT = ORDER_AMOUNT; + } + + public Long getCOMPLETE_AMOUNT() { + return COMPLETE_AMOUNT; + } + + public void setCOMPLETE_AMOUNT(Long COMPLETE_AMOUNT) { + this.COMPLETE_AMOUNT = COMPLETE_AMOUNT; + } + + public String getORDER_RATE() { + return ORDER_RATE; + } + + public void setORDER_RATE(String ORDER_RATE) { + this.ORDER_RATE = ORDER_RATE; + } + + @Override + public String toString() { + return "InventoryRateReport{" + + "PRODUCT_LINE_NAME='" + PRODUCT_LINE_NAME + '\'' + + ", ORDER_CODE='" + ORDER_CODE + '\'' + + ", BEGIN_DATE=" + BEGIN_DATE + + ", MATERIAL_CODE='" + MATERIAL_CODE + '\'' + + ", MATERIAL_NAME='" + MATERIAL_NAME + '\'' + + ", ORDER_AMOUNT=" + ORDER_AMOUNT + + ", COMPLETE_AMOUNT=" + COMPLETE_AMOUNT + + ", ORDER_RATE='" + ORDER_RATE + '\'' + + '}'; + } +} diff --git a/aucma-report/src/main/java/com/aucma/report/mapper/GeneralReportMapper.java b/aucma-report/src/main/java/com/aucma/report/mapper/GeneralReportMapper.java index eafdec5..fda7623 100644 --- a/aucma-report/src/main/java/com/aucma/report/mapper/GeneralReportMapper.java +++ b/aucma-report/src/main/java/com/aucma/report/mapper/GeneralReportMapper.java @@ -20,7 +20,7 @@ public interface GeneralReportMapper { * @param hashMap * @return */ - List> inventoryRateReportList(Map hashMap); + List inventoryRateReportList(Map hashMap); /** diff --git a/aucma-report/src/main/java/com/aucma/report/service/IProductionReportService.java b/aucma-report/src/main/java/com/aucma/report/service/IProductionReportService.java index 2ce0809..b7fe0ca 100644 --- a/aucma-report/src/main/java/com/aucma/report/service/IProductionReportService.java +++ b/aucma-report/src/main/java/com/aucma/report/service/IProductionReportService.java @@ -2,6 +2,7 @@ package com.aucma.report.service; import com.aucma.report.domain.BoxTraceabilityDetailReport; import com.aucma.report.domain.BoxTraceabilityReport; +import com.aucma.report.domain.InventoryRateReport; import java.util.HashMap; import java.util.List; @@ -19,7 +20,7 @@ public interface IProductionReportService /** * 查询清单率报表 */ - List> inventoryRateReportList(Map hashMap); + List inventoryRateReportList(Map hashMap); /** diff --git a/aucma-report/src/main/java/com/aucma/report/service/impl/ProductionReportServiceImpl.java b/aucma-report/src/main/java/com/aucma/report/service/impl/ProductionReportServiceImpl.java index 29a5972..a7558cb 100644 --- a/aucma-report/src/main/java/com/aucma/report/service/impl/ProductionReportServiceImpl.java +++ b/aucma-report/src/main/java/com/aucma/report/service/impl/ProductionReportServiceImpl.java @@ -2,6 +2,7 @@ package com.aucma.report.service.impl; import com.aucma.report.domain.BoxTraceabilityDetailReport; import com.aucma.report.domain.BoxTraceabilityReport; +import com.aucma.report.domain.InventoryRateReport; import com.aucma.report.mapper.GeneralReportMapper; import com.aucma.report.service.IProductionReportService; import org.springframework.beans.factory.annotation.Autowired; @@ -26,7 +27,7 @@ public class ProductionReportServiceImpl implements IProductionReportService { * 查询清单率报表 */ @Override - public List> inventoryRateReportList(Map hashMap) { + public List inventoryRateReportList(Map hashMap) { return reportMapper.inventoryRateReportList(hashMap); } diff --git a/aucma-report/src/main/resources/mapper/report/GeneralReportMapper.xml b/aucma-report/src/main/resources/mapper/report/GeneralReportMapper.xml index dc7296e..6cac09a 100644 --- a/aucma-report/src/main/resources/mapper/report/GeneralReportMapper.xml +++ b/aucma-report/src/main/resources/mapper/report/GeneralReportMapper.xml @@ -5,7 +5,7 @@ - SELECT boi.ORDER_CODE, boi.BEGIN_DATE, boi.MATERIAL_CODE, @@ -33,7 +33,7 @@ AND TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BETWEEN #{beginBeginTime} AND #{endBeginTime} - ORDER BY ORDER_RATE + ORDER BY ROUND(NVL(boi.COMPLETE_AMOUNT, 0) / boi.ORDER_AMOUNT * 100, 2)