change - 在制品查询报表接口

master
yinq 11 months ago
parent bbec4e6d27
commit 92ecfb386f

@ -37,10 +37,9 @@ public class ProductionReportController extends BaseController {
*
*/
@GetMapping("/productionExecutionReportList")
public TableDataInfo productionExecutionReportList(@RequestParam(required = false) Map hashMap) {
startPage();
public AjaxResult productionExecutionReportList(@RequestParam(required = false) Map hashMap) {
List<HashMap<String, Object>> list = productionReportService.productionExecutionReportList(hashMap);
return getDataTable(list);
return success(list);
}
/**

@ -44,9 +44,9 @@
BP.PRODUCT_LINE_NAME STATION_NAME,
VMC.MATERIAL_CODE,
BM.MATERIAL_NAME,
BO.MATERIAL_CODE PRODUCT_CODE,
BO.MATERIAL_NAME PRODUCT_NAME,
COUNT(*) COMP_AMOUNT
BO.MATERIAL_CODE PRODUCT_CODE,
BO.MATERIAL_NAME PRODUCT_NAME,
COUNT(*) COMP_AMOUNT
FROM VIEW_MATERIAL_COMPLETION VMC
LEFT JOIN BASE_PRODUCTLINE BP ON BP.PRODUCT_LINE_CODE = VMC.STATION_NAME
LEFT JOIN BASE_PRODUCTLINE B2 ON B2.PRODUCT_LINE_CODE = BP.PARENT_ID
@ -77,9 +77,44 @@
ORDER BY B2.PRODUCT_LINE_CODE, VMC.ORDER_CODE, BP.PRODUCT_LINE_CODE
</select>
<select id="WIPInquiryReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT *
FROM VIEW_MATERIAL_COMPLETION
<select id="WIPInquiryReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">SELECT
B2.PRODUCT_LINE_CODE,
B2.PRODUCT_LINE_NAME,
VMC.ORDER_CODE,
VMC.MATERIAL_CODE,
BM.MATERIAL_NAME,
BO.MATERIAL_CODE PRODUCT_CODE,
BO.MATERIAL_NAME PRODUCT_NAME,
COUNT(*) COMP_AMOUNT
FROM VIEW_MATERIAL_COMPLETION VMC
LEFT JOIN BASE_PRODUCTLINE BP ON BP.PRODUCT_LINE_CODE = VMC.STATION_NAME
LEFT JOIN BASE_PRODUCTLINE B2 ON B2.PRODUCT_LINE_CODE = BP.PARENT_ID
LEFT JOIN BASE_ORDERINFO BO ON BO.ORDER_CODE = VMC.ORDER_CODE AND BO.ORDER_AMOUNT > BO.COMPLETE_AMOUNT
LEFT JOIN BASE_MATERIALINFO BM ON BM.MATERIAL_CODE = VMC.MATERIAL_CODE
<where>
VMC.IS_DOWN_LINE = 0
<if test="productLineCode != null and productLineCode != ''">
AND VMC.PRODUCT_LINE_CODE = #{productLineCode}
</if>
<if test="beginStationCode != null and beginStationCode != ''">
AND BP.EXECUTION_SORT >= #{beginStationCode}
</if>
<if test="endStationCode != null and endStationCode != ''">
AND #{endStationCode} >= BP.EXECUTION_SORT
</if>
<if test="ORDER_CODE != null and ORDER_CODE != ''">
and VMC.ORDER_CODE = #{ORDER_CODE}
</if>
<if test="PRODUCT_CODE != null and PRODUCT_CODE != ''">
and BO.MATERIAL_CODE like concat(#{PRODUCT_CODE}, '%')
</if>
<if test="PRODUCT_NAME != null and PRODUCT_NAME != ''">
and BO.MATERIAL_NAME like concat(concat('%', #{PRODUCT_NAME}), '%')
</if>
</where>
GROUP BY B2.PRODUCT_LINE_CODE, B2.PRODUCT_LINE_NAME, VMC.ORDER_CODE, VMC.MATERIAL_CODE, BM.MATERIAL_NAME,
BO.MATERIAL_CODE, BO.MATERIAL_NAME
ORDER BY B2.PRODUCT_LINE_CODE, VMC.ORDER_CODE
</select>
<select id="qualityDefectsStatisticalAnalysisList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
@ -110,18 +145,18 @@
</select>
<select id="fewerMistakesReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT FY.FACTORY_NAME,
BPP.PRODUCT_LINE_NAME,
TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD') INSPECTOR_TIME,
RQI.STATION_CODE,
BP.PRODUCT_LINE_NAME STATION_NAME,
GET_MATERIAL_TYPE(RQI.MATERIAL_NAME) MATERIAL_MODEL,
RQI.QUALITY_DEFECT_CODE,
RQI.QUALITY_DEFECT_NAME,
COUNT(*) DEFECT_NUMBER
BPP.PRODUCT_LINE_NAME,
TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD') INSPECTOR_TIME,
RQI.STATION_CODE,
BP.PRODUCT_LINE_NAME STATION_NAME,
GET_MATERIAL_TYPE(RQI.MATERIAL_NAME) MATERIAL_MODEL,
RQI.QUALITY_DEFECT_CODE,
RQI.QUALITY_DEFECT_NAME,
COUNT(*) DEFECT_NUMBER
FROM REPORT_QUALITY_INSPECTION RQI
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
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 RQI.TREATMENT_MEASURE = 1
<if test="PRODUCT_LINE_CODE != null and PRODUCT_LINE_CODE != ''">
AND BPP.PRODUCT_LINE_CODE = #{PRODUCT_LINE_CODE}
@ -136,8 +171,8 @@
AND TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD') BETWEEN #{beginBeginTime} AND #{endBeginTime}
</if>
GROUP BY FY.FACTORY_NAME, BPP.PRODUCT_LINE_NAME, TO_CHAR(RQI.INSPECTOR_TIME, 'YYYY-MM-DD'),
RQI.STATION_CODE, BP.PRODUCT_LINE_NAME, GET_MATERIAL_TYPE(RQI.MATERIAL_NAME),
RQI.QUALITY_DEFECT_CODE, RQI.QUALITY_DEFECT_NAME
RQI.STATION_CODE, BP.PRODUCT_LINE_NAME, GET_MATERIAL_TYPE(RQI.MATERIAL_NAME),
RQI.QUALITY_DEFECT_CODE, RQI.QUALITY_DEFECT_NAME
ORDER BY INSPECTOR_TIME DESC
</select>
<select id="qualityIssuesReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
@ -163,10 +198,11 @@
<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) || '%' RATE
SELECT ROWNUM SEQ, SD.QUALITY_DEFECT_NAME, SD.DEFECT_NUMBER, ROUND(DEFECT_NUMBER / ALL_DEFECT * 100, 0) || '%'
RATE
FROM (
SELECT RQI.QUALITY_DEFECT_NAME,
COUNT(*) DEFECT_NUMBER,
COUNT(*) DEFECT_NUMBER,
SUM(COUNT(*)) OVER () ALL_DEFECT
FROM REPORT_QUALITY_INSPECTION RQI
WHERE RQI.TREATMENT_MEASURE = 1

Loading…
Cancel
Save