change - add焊漏率、高故障TOP20

master
yinq 7 months ago
parent ee47ccebee
commit 4277f1ccbf

@ -247,4 +247,27 @@ public class QualityReportController extends BaseController {
List<AdverseRecordYearOnYearReport> list = qualityReportService.adverseRecordYearOnYearList(hashMap);
return success(list);
}
/**
* TOP20
* @param hashMap
* @return
*/
@GetMapping("/highFaultList")
public AjaxResult highFaultList(@RequestParam(required = false) Map hashMap) {
List<HighFaultReport> list = qualityReportService.highFaultList(hashMap);
return success(list);
}
/**
*
* @param hashMap
* @return
*/
@GetMapping("/weldLeakRateList")
public AjaxResult weldLeakRateList(@RequestParam(required = false) Map hashMap) {
List<WeldLeakRateReport> list = qualityReportService.weldLeakRateList(hashMap);
return success(list);
}
}

@ -0,0 +1,75 @@
package com.aucma.report.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* TOP20
*
* @author Yinq
* @date 2024-03-15
*/
public class HighFaultReport extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@Excel(name = "工厂")
@JsonProperty("FACTORY_NAME")
private String FACTORY_NAME;
/**
* 线
*/
@Excel(name = "产线")
@JsonProperty("PRODUCT_LINE_NAME")
private String PRODUCT_LINE_NAME;
/**
*
*/
@Excel(name = "产品型号")
@JsonProperty("MATERIAL_MODEL")
private String MATERIAL_MODEL;
/**
*
*/
@Excel(name = "数量")
@JsonProperty("Q_SUM")
private Long Q_SUM;
public String getFACTORY_NAME() {
return FACTORY_NAME;
}
public void setFACTORY_NAME(String FACTORY_NAME) {
this.FACTORY_NAME = FACTORY_NAME;
}
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 getMATERIAL_MODEL() {
return MATERIAL_MODEL;
}
public void setMATERIAL_MODEL(String MATERIAL_MODEL) {
this.MATERIAL_MODEL = MATERIAL_MODEL;
}
public Long getQ_SUM() {
return Q_SUM;
}
public void setQ_SUM(Long q_SUM) {
Q_SUM = q_SUM;
}
}

@ -0,0 +1,89 @@
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 WeldLeakRateReport extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@Excel(name = "工厂")
@JsonProperty("FACTORY_NAME")
private String FACTORY_NAME;
/**
* 线
*/
@Excel(name = "产线")
@JsonProperty("PRODUCT_LINE_NAME")
private String PRODUCT_LINE_NAME;
/**
*
*/
@Excel(name = "产品型号")
@JsonProperty("MATERIAL_MODEL")
private String MATERIAL_MODEL;
/**
*
*/
@Excel(name = "检验数")
@JsonProperty("Q_SUM")
private Long Q_SUM;
/**
*
*/
@Excel(name = "焊漏数")
@JsonProperty("LEAK_SUM")
private Long LEAK_SUM;
/**
*
*/
@Excel(name = "焊漏率")
@JsonProperty("REPAIR_RATE")
private String REPAIR_RATE;
public String getFACTORY_NAME() {
return FACTORY_NAME;
}
public void setFACTORY_NAME(String FACTORY_NAME) {
this.FACTORY_NAME = FACTORY_NAME;
}
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 getMATERIAL_MODEL() {
return MATERIAL_MODEL;
}
public void setMATERIAL_MODEL(String MATERIAL_MODEL) {
this.MATERIAL_MODEL = MATERIAL_MODEL;
}
public Long getQ_SUM() {
return Q_SUM;
}
public void setQ_SUM(Long q_SUM) {
Q_SUM = q_SUM;
}
}

@ -157,4 +157,18 @@ public interface GeneralReportMapper {
* @return
*/
List<AdverseRecordYearOnYearReport> adverseRecordYearOnYearList(Map hashMap);
/**
* TOP20
* @param hashMap
* @return
*/
List<HighFaultReport> highFaultList(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<WeldLeakRateReport> weldLeakRateList(Map hashMap);
}

@ -99,4 +99,18 @@ public interface IQualityReportService
* @return
*/
List<AdverseRecordYearOnYearReport> adverseRecordYearOnYearList(Map hashMap);
/**
* TOP20
* @param hashMap
* @return
*/
List<HighFaultReport> highFaultList(Map hashMap);
/**
*
* @param hashMap
* @return
*/
List<WeldLeakRateReport> weldLeakRateList(Map hashMap);
}

@ -186,4 +186,24 @@ public class QualityReportServiceImpl implements IQualityReportService {
return reportMapper.adverseRecordYearOnYearList(hashMap);
}
/**
* TOP20
* @param hashMap
* @return
*/
@Override
public List<HighFaultReport> highFaultList(Map hashMap) {
return reportMapper.highFaultList(hashMap);
}
/**
*
* @param hashMap
* @return
*/
@Override
public List<WeldLeakRateReport> weldLeakRateList(Map hashMap) {
return reportMapper.weldLeakRateList(hashMap);
}
}

@ -4,7 +4,6 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aucma.report.mapper.GeneralReportMapper">
<select id="inventoryRateReportList" resultType="com.aucma.report.domain.InventoryRateReport" parameterType="java.util.HashMap">
SELECT boi.ORDER_CODE,
boi.BEGIN_DATE,
@ -766,4 +765,62 @@
ORDER BY PROCESS_CODE, INSPECTOR_MONTH
</select>
<select id="highFaultList" resultType="com.aucma.report.domain.HighFaultReport" parameterType="java.util.HashMap">
SELECT ZSD.FACTORY_NAME,
ZSD.PRODUCT_LINE_CODE,
ZSD.PRODUCT_LINE_NAME,
ZSD.MATERIAL_MODEL,
COUNT(*) Q_SUM
FROM (SELECT BF.FACTORY_NAME,
PL2.PRODUCT_LINE_CODE,
PL2.PRODUCT_LINE_NAME,
GET_MATERIAL_TYPE(RQI.MATERIAL_NAME) MATERIAL_MODEL,
RQI.BAR_CODE
FROM REPORT_QUALITY_INSPECTION RQI
LEFT JOIN BASE_PRODUCTLINE PL on RQI.STATION_CODE = PL.PRODUCT_LINE_CODE
LEFT JOIN BASE_PRODUCTLINE PL2 on PL2.PRODUCT_LINE_CODE = PL.PARENT_ID
LEFT JOIN BASE_FACTORY BF on BF.FACTORY_CODE = PL.PLANT_CODE
LEFT JOIN BASE_QUALITY_INSPECTION_ITEM QI on QI.QUALITY_DEFECT_CODE = RQI.QUALITY_DEFECT_CODE
WHERE RQI.TREATMENT_MEASURE = '1'
<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>
<if test="FACTORY_CODE != null and FACTORY_CODE != ''">
AND BF.FACTORY_CODE = #{FACTORY_CODE}
</if>
<if test="PRODUCT_LINE_CODE != null and PRODUCT_LINE_CODE != ''">
AND PL2.PRODUCT_LINE_CODE = #{PRODUCT_LINE_CODE}
</if>
GROUP BY BF.FACTORY_NAME, PL2.PRODUCT_LINE_CODE, PL2.PRODUCT_LINE_NAME,
GET_MATERIAL_TYPE(RQI.MATERIAL_NAME), RQI.BAR_CODE
) ZSD
GROUP BY ZSD.FACTORY_NAME, ZSD.PRODUCT_LINE_CODE, ZSD.PRODUCT_LINE_NAME, ZSD.MATERIAL_MODEL
ORDER BY ZSD.PRODUCT_LINE_CODE, Q_SUM DESC
</select>
<select id="weldLeakRateList" resultType="com.aucma.report.domain.WeldLeakRateReport" parameterType="java.util.HashMap">
SELECT WEEK_NUMBER,
WEEK_START,
WEEK_END,
NVL(COUNT(*), 0) Q_SUM,
NVL(SUM(LEAK_SUM), 0) LEAK_SUM,
TO_CHAR(ROUND(SUM(LEAK_SUM) / COUNT(*) * 100, 2), 'FM99990.00') REPAIR_RATE
FROM (
SELECT TO_NUMBER(COLUMN_A) WEEK_NUMBER,
COLUMN_B WEEK_START,
COLUMN_C WEEK_END,
BAR_CODE,
MAX(CASE WHEN QUALITY_DEFECT_NAME LIKE '%漏%' THEN 1 ELSE 0 END) LEAK_SUM
FROM (SELECT COLUMN_A, COLUMN_B, COLUMN_C
FROM TABLE (GET_YEAR_WEEK_TIME(${year}))) WEE
LEFT JOIN REPORT_QUALITY_INSPECTION RQI
ON RQI.BAR_CODE LIKE 'B%' AND
TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') > WEE.COLUMN_B AND
TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') &lt;= WEE.COLUMN_C
GROUP BY COLUMN_A, COLUMN_B, COLUMN_C, BAR_CODE
)
GROUP BY WEEK_NUMBER, WEEK_START, WEEK_END
ORDER BY WEEK_NUMBER
</select>
</mapper>

Loading…
Cancel
Save