change - 清单率报表导出

master
yinq 8 months ago
parent 5a0ece62de
commit 5cb1d898f0

@ -7,6 +7,7 @@ import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.utils.poi.ExcelUtil; import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.report.domain.BoxTraceabilityDetailReport; import com.aucma.report.domain.BoxTraceabilityDetailReport;
import com.aucma.report.domain.BoxTraceabilityReport; import com.aucma.report.domain.BoxTraceabilityReport;
import com.aucma.report.domain.InventoryRateReport;
import com.aucma.report.service.IProductionReportService; import com.aucma.report.service.IProductionReportService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -32,9 +33,22 @@ public class ProductionReportController extends BaseController {
* *
*/ */
@GetMapping("/inventoryRateReportList") @GetMapping("/inventoryRateReportList")
public AjaxResult inventoryRateReportList(@RequestParam(required = false) Map hashMap) { public TableDataInfo inventoryRateReportList(@RequestParam(required = false) Map hashMap) {
List<HashMap<String, Object>> list = productionReportService.inventoryRateReportList(hashMap); startPage();
return success(list); List<InventoryRateReport> list = productionReportService.inventoryRateReportList(hashMap);
return getDataTable(list);
}
/**
*
* @param hashMap
* @return
*/
@PostMapping("/inventoryRateReportList/export")
public void inventoryRateReportListExport(HttpServletResponse response, @RequestParam(required = false) Map hashMap) {
List<InventoryRateReport> list = productionReportService.inventoryRateReportList(hashMap);
ExcelUtil<InventoryRateReport> util = new ExcelUtil<>(InventoryRateReport. class);
util.exportExcel(response, list, "清单率报表" );
} }
/** /**

@ -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 + '\'' +
'}';
}
}

@ -20,7 +20,7 @@ public interface GeneralReportMapper {
* @param hashMap * @param hashMap
* @return * @return
*/ */
List<HashMap<String, Object>> inventoryRateReportList(Map hashMap); List<InventoryRateReport> inventoryRateReportList(Map hashMap);
/** /**

@ -2,6 +2,7 @@ package com.aucma.report.service;
import com.aucma.report.domain.BoxTraceabilityDetailReport; import com.aucma.report.domain.BoxTraceabilityDetailReport;
import com.aucma.report.domain.BoxTraceabilityReport; import com.aucma.report.domain.BoxTraceabilityReport;
import com.aucma.report.domain.InventoryRateReport;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -19,7 +20,7 @@ public interface IProductionReportService
/** /**
* *
*/ */
List<HashMap<String, Object>> inventoryRateReportList(Map hashMap); List<InventoryRateReport> inventoryRateReportList(Map hashMap);
/** /**

@ -2,6 +2,7 @@ package com.aucma.report.service.impl;
import com.aucma.report.domain.BoxTraceabilityDetailReport; import com.aucma.report.domain.BoxTraceabilityDetailReport;
import com.aucma.report.domain.BoxTraceabilityReport; import com.aucma.report.domain.BoxTraceabilityReport;
import com.aucma.report.domain.InventoryRateReport;
import com.aucma.report.mapper.GeneralReportMapper; import com.aucma.report.mapper.GeneralReportMapper;
import com.aucma.report.service.IProductionReportService; import com.aucma.report.service.IProductionReportService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -26,7 +27,7 @@ public class ProductionReportServiceImpl implements IProductionReportService {
* *
*/ */
@Override @Override
public List<HashMap<String, Object>> inventoryRateReportList(Map hashMap) { public List<InventoryRateReport> inventoryRateReportList(Map hashMap) {
return reportMapper.inventoryRateReportList(hashMap); return reportMapper.inventoryRateReportList(hashMap);
} }

@ -5,7 +5,7 @@
<mapper namespace="com.aucma.report.mapper.GeneralReportMapper"> <mapper namespace="com.aucma.report.mapper.GeneralReportMapper">
<select id="inventoryRateReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap"> <select id="inventoryRateReportList" resultType="com.aucma.report.domain.InventoryRateReport" parameterType="java.util.HashMap">
SELECT boi.ORDER_CODE, SELECT boi.ORDER_CODE,
boi.BEGIN_DATE, boi.BEGIN_DATE,
boi.MATERIAL_CODE, boi.MATERIAL_CODE,
@ -33,7 +33,7 @@
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''"> <if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
AND TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BETWEEN #{beginBeginTime} AND #{endBeginTime} AND TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BETWEEN #{beginBeginTime} AND #{endBeginTime}
</if> </if>
ORDER BY ORDER_RATE ORDER BY ROUND(NVL(boi.COMPLETE_AMOUNT, 0) / boi.ORDER_AMOUNT * 100, 2)
</select> </select>
<select id="productionExecutionReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap"> <select id="productionExecutionReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">

Loading…
Cancel
Save