change - 修改质量缺陷统计分析取数逻辑

master
yinq 8 months ago
parent edf5f9236e
commit f3a52e3fa8

@ -4,6 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.aucma.common.utils.DateUtils;
import com.aucma.report.domain.BoxTemperatureHistory;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -98,4 +99,15 @@ public class ReportQualityInspectionController extends BaseController {
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(reportQualityInspectionService.deleteReportQualityInspectionByObjIds(objIds));
}
/**
*
* @param temperatureHistory
* @return
*/
@PostMapping("/temperatureApi" )
public AjaxResult temperatureApi(BoxTemperatureHistory temperatureHistory) {
System.out.println(temperatureHistory.toString());
return success(null);
}
}

@ -158,6 +158,25 @@ public class ReportQualityInspection extends BaseEntity {
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
private String beginBeginTime;
private String endBeginTime;
public String getBeginBeginTime() {
return beginBeginTime;
}
public void setBeginBeginTime(String beginBeginTime) {
this.beginBeginTime = beginBeginTime;
}
public String getEndBeginTime() {
return endBeginTime;
}
public void setEndBeginTime(String endBeginTime) {
this.endBeginTime = endBeginTime;
}
public String getOrderCode() {
return orderCode;
}

@ -3,6 +3,7 @@ package com.aucma.report.service;
import java.util.HashMap;
import java.util.List;
import com.aucma.report.domain.BoxTemperatureHistory;
import com.aucma.report.domain.ReportQualityInspection;
/**
@ -67,4 +68,13 @@ public interface IReportQualityInspectionService {
* @return
*/
public HashMap<String, Integer> pdaQueryQuantityNumber(String reportQualityInspection);
/**
*
*
* @param reportQualityInspection
* @return
*/
public int temperatureApi(BoxTemperatureHistory temperatureHistory);
}

@ -65,7 +65,7 @@ public class RecordQualityMaterialServiceImpl implements IRecordQualityMaterialS
throw new ServiceException("此SAP计划未维护!");
}
RecordQualityMaterial material = new RecordQualityMaterial();
material.setMaterialCode(recordQualityMaterial.getMaterialCode());
material.setMaterialCode(baseOrderInfos.get(0).getMaterialCode());
material.setInfoType(recordQualityMaterial.getInfoType());
List<RecordQualityMaterial> qualityMaterials = recordQualityMaterialMapper.selectRecordQualityMaterialList(material);
if (qualityMaterials.size() > 0) {

@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.List;
import com.aucma.common.utils.StringUtils;
import com.aucma.report.domain.BoxTemperatureHistory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.report.mapper.ReportQualityInspectionMapper;
@ -103,4 +104,16 @@ public class ReportQualityInspectionServiceImpl implements IReportQualityInspect
}
/**
*
* @param temperatureHistory
* @return
*/
@Override
public int temperatureApi(BoxTemperatureHistory temperatureHistory) {
return 1;
}
}

@ -118,15 +118,24 @@
</select>
<select id="qualityDefectsStatisticalAnalysisList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT FACTORY_NAME,
PRODUCT_LINE_NAME,
STATION_CODE,
STATION_NAME,
COUNT(*) INSPECTION_NUMBER,
SUM(REWORK_NUMBER) REWORK_NUMBER,
ROUND((1 - SUM(REWORK_NUMBER) / COUNT(*)) * 100, 0) || '%' RATE
FROM (
SELECT FY.FACTORY_NAME,
BPP.PRODUCT_LINE_NAME,
BP.PRODUCT_LINE_CODE STATION_CODE,
BP.PRODUCT_LINE_NAME STATION_NAME,
COUNT(*) INSPECTION_NUMBER,
SUM(REWORK_NUMBER) REWORK_NUMBER,
ROUND((1 - SUM(REWORK_NUMBER) / COUNT(*)) * 100, 0) || '%' RATE
BP.PRODUCT_LINE_CODE STATION_CODE,
BP.PRODUCT_LINE_NAME STATION_NAME,
RQI.BAR_CODE,
MAX(CASE WHEN RQI.TREATMENT_MEASURE = '1' THEN 1 ELSE 0 END) REWORK_NUMBER
FROM REPORT_QUALITY_INSPECTION RQI
LEFT JOIN BASE_PRODUCTLINE BP ON BP.PRODUCT_LINE_CODE = RQI.STATION_CODE
LEFT JOIN BASE_PRODUCTLINE BP
ON BP.PRODUCT_LINE_CODE = RQI.STATION_CODE
LEFT JOIN BASE_PRODUCTLINE BPP ON BPP.PRODUCT_LINE_CODE = BP.PARENT_ID
LEFT JOIN BASE_FACTORY FY ON FY.FACTORY_CODE = BPP.PLANT_CODE
<where>
@ -140,8 +149,11 @@
AND TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') BETWEEN #{beginBeginTime} AND #{endBeginTime}
</if>
</where>
GROUP BY FY.FACTORY_NAME, BPP.PRODUCT_LINE_NAME, BP.PRODUCT_LINE_CODE, BP.PRODUCT_LINE_NAME
ORDER BY BP.PRODUCT_LINE_CODE
GROUP BY FY.FACTORY_NAME, BPP.PRODUCT_LINE_NAME, BP.PRODUCT_LINE_CODE, BP.PRODUCT_LINE_NAME,
RQI.BAR_CODE
)
GROUP BY FACTORY_NAME, PRODUCT_LINE_NAME, STATION_CODE, STATION_NAME
ORDER BY REWORK_NUMBER
</select>
<select id="fewerMistakesReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT FY.FACTORY_NAME,
@ -220,21 +232,53 @@
</select>
<select id="qualityDefectsDetailList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT ROWNUM SEQ, SD.QUALITY_DEFECT_NAME, SD.DEFECT_NUMBER, ROUND(DEFECT_NUMBER / ALL_DEFECT * 100, 0) || '%'
WITH TotalDefects AS (
SELECT
COUNT(*) AS ALL_DEFECT
FROM
REPORT_QUALITY_INSPECTION RQI
WHERE
RQI.TREATMENT_MEASURE = 1
<if test="stationCode != null and stationCode != ''">
AND RQI.STATION_CODE = #{stationCode}
</if>
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
AND TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') BETWEEN #{beginBeginTime} AND #{endBeginTime}
</if>
)
SELECT
ROW_NUMBER() OVER (ORDER BY RATE) AS SEQ,
SD.QUALITY_DEFECT_NAME,
SD.DEFECT_NUMBER,
RATE
FROM (
SELECT RQI.QUALITY_DEFECT_NAME,
COUNT(*) DEFECT_NUMBER,
SUM(COUNT(*)) OVER () ALL_DEFECT
FROM REPORT_QUALITY_INSPECTION RQI
WHERE RQI.TREATMENT_MEASURE = 1
SELECT
DA.QUALITY_DEFECT_NAME,
COUNT(*) AS DEFECT_NUMBER,
ROUND(COUNT(*) / TD.ALL_DEFECT * 100, 0) || '%' AS RATE
FROM (
SELECT
RQI.QUALITY_DEFECT_NAME,
RQI.BAR_CODE,
RQI.QUALITY_DEFECT_CODE
FROM
REPORT_QUALITY_INSPECTION RQI
WHERE
RQI.TREATMENT_MEASURE = 1
<if test="stationCode != null and stationCode != ''">
AND RQI.STATION_CODE = #{stationCode}
</if>
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
AND TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD HH24:MI:SS') BETWEEN #{beginBeginTime} AND #{endBeginTime}
</if>
GROUP BY RQI.QUALITY_DEFECT_NAME) SD
GROUP BY
RQI.QUALITY_DEFECT_NAME, RQI.BAR_CODE, RQI.QUALITY_DEFECT_CODE
) DA
CROSS JOIN TotalDefects TD
GROUP BY
DA.QUALITY_DEFECT_NAME, TD.ALL_DEFECT
) SD
ORDER BY RATE
</select>
<select id="productTraceabilityReportList" resultType="ProductTraceabilityReport" parameterType="java.util.HashMap">

@ -67,7 +67,7 @@
</if>
<if test="productSncode != null and productSncode != ''">and po.product_sncode = #{productSncode}</if>
<if test="productOrderNo != null and productOrderNo != ''">and po.product_order_no like concat(concat('%',
#{product_order_no}), '%')</if>
#{productOrderNo}), '%')</if>
<if test="productSaleNo != null and productSaleNo != ''">and po.product_sale_no = #{productSaleNo}</if>
<if test="productSaleLineNo != null and productSaleLineNo != ''">and po.product_sale_line_no =
#{productSaleLineNo}

@ -84,12 +84,15 @@
<if test="isLowerLine != null and isLowerLine != ''">and rqi.is_lower_line = #{isLowerLine}</if>
<if test="groupCode != null and groupCode != ''">and rqi.group_code = #{groupCode}</if>
<if test="inspectorCode != null and inspectorCode != ''">and rqi.inspector_code = #{inspectorCode}</if>
<if test="inspectorTime != null ">and rqi.inspector_time = #{inspectorTime}</if>
<if test="stationCode != null and stationCode != ''">and rqi.station_code = #{stationCode}</if>
<if test="reworkNumber != null ">and rqi.rework_number = #{reworkNumber}</if>
<if test="finishTime != null ">and rqi.finish_time = #{finishTime}</if>
<if test="isFlag != null ">and rqi.is_flag = #{isFlag}</if>
<if test="updatedBy != null and updatedBy != ''">and rqi.updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and rqi.updated_time = #{updatedTime}</if>
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
AND TO_CHAR(rqi.inspector_time, 'YYYY-MM-DD HH24:MI:SS') BETWEEN #{beginBeginTime} AND #{endBeginTime}
</if>
</where>
order by rqi.inspector_time desc
</select>

Loading…
Cancel
Save