change - 生产报表导出

master
yinq 6 months ago
parent c9e27123dd
commit b6fcf4828b

@ -5,9 +5,7 @@ import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo; 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.*;
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.*;
@ -56,19 +54,43 @@ public class ProductionReportController extends BaseController {
*/ */
@GetMapping("/productionExecutionReportList") @GetMapping("/productionExecutionReportList")
public AjaxResult productionExecutionReportList(@RequestParam(required = false) Map hashMap) { public AjaxResult productionExecutionReportList(@RequestParam(required = false) Map hashMap) {
List<HashMap<String, Object>> list = productionReportService.productionExecutionReportList(hashMap); List<ProductionExecutionReport> list = productionReportService.productionExecutionReportList(hashMap);
return success(list); return success(list);
} }
/**
*
* @param hashMap
* @return
*/
@PostMapping("/productionExecutionReportList/export")
public void productionExecutionReportListExport(HttpServletResponse response, @RequestParam(required = false) Map hashMap) {
List<ProductionExecutionReport> list = productionReportService.productionExecutionReportList(hashMap);
ExcelUtil<ProductionExecutionReport> util = new ExcelUtil<>(ProductionExecutionReport. class);
util.exportExcel(response, list, "清单率报表" );
}
/** /**
* *
*/ */
@GetMapping("/WIPInquiryReportList") @GetMapping("/WIPInquiryReportList")
public AjaxResult WIPInquiryReportList(@RequestParam(required = false) Map hashMap) { public AjaxResult WIPInquiryReportList(@RequestParam(required = false) Map hashMap) {
List<HashMap<String, Object>> list = productionReportService.WIPInquiryReportList(hashMap); List<WIPInquiryReport> list = productionReportService.WIPInquiryReportList(hashMap);
return success(list); return success(list);
} }
/**
*
* @param hashMap
* @return
*/
@PostMapping("/WIPInquiryReportList/export")
public void WIPInquiryReportListExport(HttpServletResponse response, @RequestParam(required = false) Map hashMap) {
List<WIPInquiryReport> list = productionReportService.WIPInquiryReportList(hashMap);
ExcelUtil<WIPInquiryReport> util = new ExcelUtil<>(WIPInquiryReport. class);
util.exportExcel(response, list, "清单率报表" );
}
/** /**
* 线 * 线
*/ */

@ -176,4 +176,27 @@ public class QualityReportController extends BaseController {
List<HashMap<String, Object>> list = qualityReportService.pourRecordReportList(hashMap); List<HashMap<String, Object>> list = qualityReportService.pourRecordReportList(hashMap);
return success(list); return success(list);
} }
/**
*
* @param hashMap
* @return
*/
@GetMapping("/repairRateReportList")
public AjaxResult repairRateReportList(@RequestParam(required = false) Map hashMap) {
List<RepairRateReport> list = qualityReportService.repairRateReportList(hashMap);
return success(list);
}
/**
*
* @param hashMap
* @return
*/
@PostMapping("/repairRateReportList/export" )
public void repairRateReportListExport(HttpServletResponse response, @RequestParam(required = false) Map hashMap) {
List<RepairRateReport> list = qualityReportService.repairRateReportList(hashMap);
ExcelUtil<RepairRateReport> util = new ExcelUtil<>(RepairRateReport. class);
util.exportExcel(response, list, "质量返修率报表" );
}
} }

@ -78,6 +78,30 @@ public class DeviceAlarmRecord extends BaseEntity {
@Excel(name = "批次标识") @Excel(name = "批次标识")
private String batchId; private String batchId;
/** 参数编号 */
@Excel(name = "参数编号")
private String paramCode;
/** 参数值 */
@Excel(name = "参数值")
private String paramValue;
public String getParamCode() {
return paramCode;
}
public void setParamCode(String paramCode) {
this.paramCode = paramCode;
}
public String getParamValue() {
return paramValue;
}
public void setParamValue(String paramValue) {
this.paramValue = paramValue;
}
public void setObjId(Long objId) { public void setObjId(Long objId) {
this.objId = objId; this.objId = objId;
} }

@ -0,0 +1,182 @@
package com.aucma.report.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @author Yinq
* @date 2024-03-15
*/
public class ProductionExecutionReport extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 线
*/
@Excel(name = "产线编号")
@JsonProperty("PRODUCT_LINE_CODE")
private String PRODUCT_LINE_CODE;
/**
* 线
*/
@Excel(name = "产线名称")
@JsonProperty("PRODUCT_LINE_NAME")
private String PRODUCT_LINE_NAME;
/**
* SAP
*/
@Excel(name = "SAP订单编号")
@JsonProperty("ORDER_CODE")
private String ORDER_CODE;
/**
*
*/
@Excel(name = "工位编号")
@JsonProperty("STATION_CODE")
private String STATION_CODE;
/**
*
*/
@Excel(name = "工位名称")
@JsonProperty("STATION_NAME")
private String STATION_NAME;
/**
*
*/
@Excel(name = "物料编号")
@JsonProperty("MATERIAL_CODE")
private String MATERIAL_CODE;
/**
*
*/
@Excel(name = "物料名称")
@JsonProperty("MATERIAL_NAME")
private String MATERIAL_NAME;
/**
*
*/
@Excel(name = "产品编码")
@JsonProperty("PRODUCT_CODE")
private String PRODUCT_CODE;
/**
*
*/
@Excel(name = "产品名称")
@JsonProperty("PRODUCT_NAME")
private String PRODUCT_NAME;
/**
*
*/
@Excel(name = "数量")
@JsonProperty("COMP_AMOUNT")
private Long COMP_AMOUNT;
public String getPRODUCT_LINE_CODE() {
return PRODUCT_LINE_CODE;
}
public void setPRODUCT_LINE_CODE(String PRODUCT_LINE_CODE) {
this.PRODUCT_LINE_CODE = PRODUCT_LINE_CODE;
}
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 String getSTATION_CODE() {
return STATION_CODE;
}
public void setSTATION_CODE(String STATION_CODE) {
this.STATION_CODE = STATION_CODE;
}
public String getSTATION_NAME() {
return STATION_NAME;
}
public void setSTATION_NAME(String STATION_NAME) {
this.STATION_NAME = STATION_NAME;
}
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 String getPRODUCT_CODE() {
return PRODUCT_CODE;
}
public void setPRODUCT_CODE(String PRODUCT_CODE) {
this.PRODUCT_CODE = PRODUCT_CODE;
}
public String getPRODUCT_NAME() {
return PRODUCT_NAME;
}
public void setPRODUCT_NAME(String PRODUCT_NAME) {
this.PRODUCT_NAME = PRODUCT_NAME;
}
public Long getCOMP_AMOUNT() {
return COMP_AMOUNT;
}
public void setCOMP_AMOUNT(Long COMP_AMOUNT) {
this.COMP_AMOUNT = COMP_AMOUNT;
}
@Override
public String toString() {
return "ProductionExecutionReport{" +
"PRODUCT_LINE_CODE='" + PRODUCT_LINE_CODE + '\'' +
", PRODUCT_LINE_NAME='" + PRODUCT_LINE_NAME + '\'' +
", ORDER_CODE='" + ORDER_CODE + '\'' +
", STATION_CODE='" + STATION_CODE + '\'' +
", STATION_NAME='" + STATION_NAME + '\'' +
", MATERIAL_CODE='" + MATERIAL_CODE + '\'' +
", MATERIAL_NAME='" + MATERIAL_NAME + '\'' +
", PRODUCT_CODE='" + PRODUCT_CODE + '\'' +
", PRODUCT_NAME='" + PRODUCT_NAME + '\'' +
", COMP_AMOUNT=" + COMP_AMOUNT +
'}';
}
}

@ -0,0 +1,90 @@
package com.aucma.report.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* 80
*
* @author Yinq
* @date 2024-03-15
*/
public class RepairRateReport extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@Excel(name = "日期")
@JsonProperty("INSPECTOR_TIME")
private String INSPECTOR_TIME;
/**
*
*/
@Excel(name = "异常数")
@JsonProperty("QUALITY_SUM")
private Long QUALITY_SUM;
/**
* 线
*/
@Excel(name = "下线数")
@JsonProperty("OFF_LINE_NUM")
private Long OFF_LINE_NUM;
/**
*
*/
@Excel(name = "返修率")
@JsonProperty("REPAIR_RATE")
private String REPAIR_RATE;
/**
*
*/
// @Excel(name = "目标返修率")
@JsonProperty("TARGET")
private String TARGET;
public String getINSPECTOR_TIME() {
return INSPECTOR_TIME;
}
public void setINSPECTOR_TIME(String INSPECTOR_TIME) {
this.INSPECTOR_TIME = INSPECTOR_TIME;
}
public Long getQUALITY_SUM() {
return QUALITY_SUM;
}
public void setQUALITY_SUM(Long QUALITY_SUM) {
this.QUALITY_SUM = QUALITY_SUM;
}
public Long getOFF_LINE_NUM() {
return OFF_LINE_NUM;
}
public void setOFF_LINE_NUM(Long OFF_LINE_NUM) {
this.OFF_LINE_NUM = OFF_LINE_NUM;
}
public String getREPAIR_RATE() {
return REPAIR_RATE;
}
public void setREPAIR_RATE(String REPAIR_RATE) {
this.REPAIR_RATE = REPAIR_RATE;
}
public String getTARGET() {
return TARGET;
}
public void setTARGET(String TARGET) {
this.TARGET = TARGET;
}
}

@ -0,0 +1,152 @@
package com.aucma.report.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @author Yinq
* @date 2024-03-15
*/
public class WIPInquiryReport extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 线
*/
@Excel(name = "产线编号")
@JsonProperty("PRODUCT_LINE_CODE")
private String PRODUCT_LINE_CODE;
/**
* 线
*/
@Excel(name = "产线名称")
@JsonProperty("PRODUCT_LINE_NAME")
private String PRODUCT_LINE_NAME;
/**
* SAP
*/
@Excel(name = "SAP订单编号")
@JsonProperty("ORDER_CODE")
private String ORDER_CODE;
/**
*
*/
@Excel(name = "物料编号")
@JsonProperty("MATERIAL_CODE")
private String MATERIAL_CODE;
/**
*
*/
@Excel(name = "物料名称")
@JsonProperty("MATERIAL_NAME")
private String MATERIAL_NAME;
/**
*
*/
@Excel(name = "产品编码")
@JsonProperty("PRODUCT_CODE")
private String PRODUCT_CODE;
/**
*
*/
@Excel(name = "产品名称")
@JsonProperty("PRODUCT_NAME")
private String PRODUCT_NAME;
/**
*
*/
@Excel(name = "数量")
@JsonProperty("COMP_AMOUNT")
private Long COMP_AMOUNT;
public String getPRODUCT_LINE_CODE() {
return PRODUCT_LINE_CODE;
}
public void setPRODUCT_LINE_CODE(String PRODUCT_LINE_CODE) {
this.PRODUCT_LINE_CODE = PRODUCT_LINE_CODE;
}
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 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 String getPRODUCT_CODE() {
return PRODUCT_CODE;
}
public void setPRODUCT_CODE(String PRODUCT_CODE) {
this.PRODUCT_CODE = PRODUCT_CODE;
}
public String getPRODUCT_NAME() {
return PRODUCT_NAME;
}
public void setPRODUCT_NAME(String PRODUCT_NAME) {
this.PRODUCT_NAME = PRODUCT_NAME;
}
public Long getCOMP_AMOUNT() {
return COMP_AMOUNT;
}
public void setCOMP_AMOUNT(Long COMP_AMOUNT) {
this.COMP_AMOUNT = COMP_AMOUNT;
}
@Override
public String toString() {
return "ProductionExecutionReport{" +
"PRODUCT_LINE_CODE='" + PRODUCT_LINE_CODE + '\'' +
", PRODUCT_LINE_NAME='" + PRODUCT_LINE_NAME + '\'' +
", ORDER_CODE='" + ORDER_CODE + '\'' +
", MATERIAL_CODE='" + MATERIAL_CODE + '\'' +
", MATERIAL_NAME='" + MATERIAL_NAME + '\'' +
", PRODUCT_CODE='" + PRODUCT_CODE + '\'' +
", PRODUCT_NAME='" + PRODUCT_NAME + '\'' +
", COMP_AMOUNT=" + COMP_AMOUNT +
'}';
}
}

@ -28,14 +28,14 @@ public interface GeneralReportMapper {
* @param hashMap * @param hashMap
* @return * @return
*/ */
List<HashMap<String, Object>> productionExecutionReportList(Map hashMap); List<ProductionExecutionReport> productionExecutionReportList(Map hashMap);
/** /**
* *
* @param hashMap * @param hashMap
* @return * @return
*/ */
List<HashMap<String, Object>> WIPInquiryReportList(Map hashMap); List<WIPInquiryReport> WIPInquiryReportList(Map hashMap);
/** /**
* *
@ -115,4 +115,11 @@ public interface GeneralReportMapper {
* @return * @return
*/ */
List<BoxTraceabilityDetailReport> boxTraceabilityDetailReport(Map hashMap); List<BoxTraceabilityDetailReport> boxTraceabilityDetailReport(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<RepairRateReport> repairRateReportList(Map hashMap);
} }

@ -1,8 +1,6 @@
package com.aucma.report.service; package com.aucma.report.service;
import com.aucma.report.domain.BoxTraceabilityDetailReport; import com.aucma.report.domain.*;
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;
@ -28,7 +26,7 @@ public interface IProductionReportService
* @param hashMap * @param hashMap
* @return * @return
*/ */
List<HashMap<String, Object>> productionExecutionReportList(Map hashMap); List<ProductionExecutionReport> productionExecutionReportList(Map hashMap);
/** /**
@ -36,7 +34,7 @@ public interface IProductionReportService
* @param hashMap * @param hashMap
* @return * @return
*/ */
List<HashMap<String, Object>> WIPInquiryReportList(Map hashMap); List<WIPInquiryReport> WIPInquiryReportList(Map hashMap);
/** /**
* 线 * 线

@ -78,4 +78,11 @@ public interface IQualityReportService
* @return * @return
*/ */
List<QualityDefectsDetail> qualityDefectsDetailListExport(Map hashMap); List<QualityDefectsDetail> qualityDefectsDetailListExport(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<RepairRateReport> repairRateReportList(Map hashMap);
} }

@ -1,8 +1,6 @@
package com.aucma.report.service.impl; package com.aucma.report.service.impl;
import com.aucma.report.domain.BoxTraceabilityDetailReport; import com.aucma.report.domain.*;
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;
@ -37,7 +35,7 @@ public class ProductionReportServiceImpl implements IProductionReportService {
* @return * @return
*/ */
@Override @Override
public List<HashMap<String, Object>> productionExecutionReportList(Map hashMap) { public List<ProductionExecutionReport> productionExecutionReportList(Map hashMap) {
return reportMapper.productionExecutionReportList(hashMap); return reportMapper.productionExecutionReportList(hashMap);
} }
@ -47,7 +45,7 @@ public class ProductionReportServiceImpl implements IProductionReportService {
* @return * @return
*/ */
@Override @Override
public List<HashMap<String, Object>> WIPInquiryReportList(Map hashMap) { public List<WIPInquiryReport> WIPInquiryReportList(Map hashMap) {
return reportMapper.WIPInquiryReportList(hashMap); return reportMapper.WIPInquiryReportList(hashMap);
} }

@ -137,4 +137,20 @@ public class QualityReportServiceImpl implements IQualityReportService {
return defectsDetailArrayList; return defectsDetailArrayList;
} }
/**
*
* @param hashMap
* @return
*/
@Override
public List<RepairRateReport> repairRateReportList(Map hashMap) {
if (hashMap.containsKey("stationCodeList")){
hashMap.put("stationCodeList", String.valueOf(hashMap.get("stationCodeList")).split(","));
}else {
String[] stationCodeLists = {"null"};
hashMap.put("stationCodeList", stationCodeLists);
}
return reportMapper.repairRateReportList(hashMap);
}
} }

@ -36,7 +36,7 @@
ORDER BY ROUND(NVL(boi.COMPLETE_AMOUNT, 0) / boi.ORDER_AMOUNT * 100, 2) 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="com.aucma.report.domain.ProductionExecutionReport" parameterType="java.util.HashMap">
SELECT B2.PRODUCT_LINE_CODE, SELECT B2.PRODUCT_LINE_CODE,
B2.PRODUCT_LINE_NAME, B2.PRODUCT_LINE_NAME,
VMC.ORDER_CODE, VMC.ORDER_CODE,
@ -77,7 +77,7 @@
ORDER BY B2.PRODUCT_LINE_CODE, VMC.ORDER_CODE, BP.PRODUCT_LINE_CODE ORDER BY B2.PRODUCT_LINE_CODE, VMC.ORDER_CODE, BP.PRODUCT_LINE_CODE
</select> </select>
<select id="WIPInquiryReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap"> <select id="WIPInquiryReportList" resultType="com.aucma.report.domain.WIPInquiryReport" parameterType="java.util.HashMap">
SELECT B2.PRODUCT_LINE_CODE, SELECT B2.PRODUCT_LINE_CODE,
B2.PRODUCT_LINE_NAME, B2.PRODUCT_LINE_NAME,
SD.ORDER_CODE, SD.ORDER_CODE,
@ -494,5 +494,50 @@
LEFT JOIN BASE_PRODUCTLINE PL ON PL.EXECUTION_SORT = SD.EXECUTION_SORT LEFT JOIN BASE_PRODUCTLINE PL ON PL.EXECUTION_SORT = SD.EXECUTION_SORT
ORDER BY PL.EXECUTION_SORT ORDER BY PL.EXECUTION_SORT
</select> </select>
<select id="repairRateReportList" resultType="com.aucma.report.domain.RepairRateReport"
parameterType="java.util.HashMap">
SELECT RQI.INSPECTOR_TIME,
RQI.QUALITY_SUM,
VPO.OFF_LINE_NUM,
CASE
WHEN NVL(OFF_LINE_NUM, 0) = 0 THEN '0.00'
ELSE TO_CHAR(ROUND(QUALITY_SUM / NVL(OFF_LINE_NUM, 0) * 100, 2), 'FM99990.00') END || '%' REPAIR_RATE,
TARGET
FROM (SELECT INSPECTOR_TIME, COUNT(*) QUALITY_SUM
FROM (
SELECT TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD') INSPECTOR_TIME, RQI.BAR_CODE
FROM REPORT_QUALITY_INSPECTION RQI
WHERE RQI.TREATMENT_MEASURE = '1'
<if test="stationCodeList != null and stationCodeList != ''">
AND RQI.STATION_CODE IN
<foreach collection="stationCodeList" item="stationCode" open="(" separator="," close=")">
#{stationCode}
</foreach>
</if>
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
AND TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD') BETWEEN #{beginBeginTime} AND #{endBeginTime}
</if>
GROUP BY TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD'), RQI.BAR_CODE
)
GROUP BY INSPECTOR_TIME) RQI
LEFT JOIN (
SELECT PRODUCT_SCANTIME, COUNT(*) OFF_LINE_NUM
FROM (
SELECT TO_CHAR(VPO.PRODUCT_SCANTIME, 'YYYY-MM-DD') PRODUCT_SCANTIME,
VPO.BOX_CODE
FROM C##AUCMA_SCADA.PRODUCT_OFFLINE VPO
WHERE VPO.BOX_CODE IS NOT NULL
<if test="PRODUCT_LINE_CODE != null and PRODUCT_LINE_CODE != ''">
AND VPO.PRODUCT_LINE_CODE = #{PRODUCT_LINE_CODE}
</if>
GROUP BY TO_CHAR(VPO.PRODUCT_SCANTIME, 'YYYY-MM-DD'), VPO.BOX_CODE
)
GROUP BY PRODUCT_SCANTIME) VPO
ON PRODUCT_SCANTIME = RQI.INSPECTOR_TIME
CROSS JOIN (SELECT TO_CHAR(CUSTOM_DATA) TARGET
FROM BASE_CUSTOM_DATA
WHERE CUSTOM_CODE = 'REPAIR_RATE_' || #{PRODUCT_LINE_CODE}) TARGET
ORDER BY RQI.INSPECTOR_TIME
</select>
</mapper> </mapper>

Loading…
Cancel
Save