change - add降级率报表

master
yinq 7 months ago
parent 504f0284a5
commit 4badbaaa23

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

@ -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;
/**
*
*
* @author Yinq
* @date 2024-03-15
*/
public class DowngradeProportionReport 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;
}
}

@ -5,7 +5,7 @@ import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* 80
*
*
* @author Yinq
* @date 2024-03-15

@ -143,4 +143,11 @@ public interface GeneralReportMapper {
* @return
*/
List<WIPInquiryDetailReport> WIPInquiryDetailReportList(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<DowngradeProportionReport> downgradeProportionReportList(Map hashMap);
}

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

@ -159,4 +159,18 @@ public class QualityReportServiceImpl implements IQualityReportService {
return reportMapper.repairRateReportList(hashMap);
}
/**
*
* @param hashMap
* @return
*/
@Override
public List<DowngradeProportionReport> downgradeProportionReportList(Map hashMap) {
if (!hashMap.containsKey("dateType")){
return null;
}
hashMap.put("timeSub", Integer.parseInt(String.valueOf(hashMap.get("dateType"))));
return reportMapper.downgradeProportionReportList(hashMap);
}
}

@ -687,4 +687,39 @@
ORDER BY SD.COMPLETE_DATE
</select>
<select id="downgradeProportionReportList" resultType="com.aucma.report.domain.DowngradeProportionReport"
parameterType="java.util.HashMap">
WITH DT AS (SELECT #{timeSub} TIMESUB FROM DUAL)
SELECT SUBSTR(VPO.PRODUCT_SCANTIME, 1, DT.TIMESUB) INSPECTOR_TIME,
SUM(NVL(RQI.QUALITY_SUM, 0)) QUALITY_SUM,
SUM(VPO.OFF_LINE_NUM) OFF_LINE_NUM,
NVL(TO_CHAR(ROUND(SUM(NVL(QUALITY_SUM, 0)) / SUM(NVL(OFF_LINE_NUM, 0)) * 100, 2), 'FM99990.00'), '0.00') ||
'%' REPAIR_RATE,
TARGET
FROM (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>
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
AND TO_CHAR(VPO.PRODUCT_SCANTIME, 'YYYY-MM-DD') BETWEEN #{beginBeginTime} AND #{endBeginTime}
</if>
GROUP BY TO_CHAR(VPO.PRODUCT_SCANTIME, 'YYYY-MM-DD'), VPO.BOX_CODE)
GROUP BY PRODUCT_SCANTIME) VPO
LEFT JOIN (SELECT INSPECTOR_TIME, NVL(COUNT(*), 0) QUALITY_SUM
FROM (SELECT TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD') INSPECTOR_TIME, RQI.BAR_CODE
FROM REPORT_QUALITY_INSPECTION RQI
WHERE RQI.PROCESS_RESULT = 'KA'
GROUP BY TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD'), RQI.BAR_CODE)
GROUP BY INSPECTOR_TIME) RQI ON VPO.PRODUCT_SCANTIME = RQI.INSPECTOR_TIME
CROSS JOIN (SELECT TO_CHAR(CUSTOM_DATA) || '%' TARGET
FROM BASE_CUSTOM_DATA
WHERE CUSTOM_CODE = 'DOWNGRADE_RATE_' || 'CX_02')
CROSS JOIN DT
GROUP BY SUBSTR(VPO.PRODUCT_SCANTIME, 1, DT.TIMESUB), TARGET
ORDER BY INSPECTOR_TIME
</select>
</mapper>

Loading…
Cancel
Save