change - 修改看板接口

master
yinq 8 months ago
parent 85a7aa0144
commit fc32d1eddd

@ -62,4 +62,11 @@ public interface BoardReportMapper {
* @return
*/
List<HashMap<String, Object>> getCurrentTeamTimeList(HashMap<String, String> paramMap);
/**
* 线
* @param paramMap
* @return
*/
HashMap<String, Object> todayOfflineProduction(HashMap<String, String> paramMap);
}

@ -1,8 +1,10 @@
package com.aucma.report.service.impl;
import com.aucma.common.utils.StringUtils;
import com.aucma.report.mapper.BoardReportMapper;
import com.aucma.report.service.IBoardReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@ -49,7 +51,6 @@ public class BoardReportServiceImpl implements IBoardReportService {
Long planOrderSum = 0L;
Long prodOrderSum = 0L;
Long planProductSum = 0L;
Long compProductSum = 0L;
for (HashMap<String, Object> map : todayOrderList) {
if (Integer.parseInt(String.valueOf(map.get("STATUS"))) != 0){
continue;
@ -60,15 +61,13 @@ public class BoardReportServiceImpl implements IBoardReportService {
}
Long orderAmount = Long.parseLong(String.valueOf(map.get("ORDER_AMOUNT")));
planProductSum += orderAmount;
Long completeAmount = Long.parseLong(String.valueOf(map.get("COMPLETE_AMOUNT")));
compProductSum += completeAmount;
}
result.put("planOrderSum", planOrderSum);
result.put("prodOrderSum", prodOrderSum);
result.put("planProductSum", planProductSum);
result.put("compProductSum", compProductSum);
}
HashMap<String, Object> map = boardReportMapper.todayOfflineProduction(paramMap);
result.put("compProductSum", map.get("OFFLINE_SUM"));
List<HashMap<String, Object>> columnarList = boardReportMapper.homeColumnarInterface(paramMap);
result.put("columnarList", columnarList);

@ -40,34 +40,51 @@
</select>
<select id="homeColumnarInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BEGIN_DATE,
bm.PRODUCT_LINE_CODE,
SUM(boi.COMPLETE_AMOUNT) COMPLETE_AMOUNT,
ROUND(SUM(boi.COMPLETE_AMOUNT) / SUM(boi.ORDER_AMOUNT) * 100, 0) RATE
FROM BASE_ORDERINFO boi
JOIN BASE_MATERIALINFO bm ON bm.MATERIAL_CODE = boi.material_code AND bm.DISPO IN ('100')
WHERE TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BETWEEN TO_CHAR(SYSDATE - 2, 'YYYY-MM-DD') AND TO_CHAR(SYSDATE - 1, 'YYYY-MM-DD')
GROUP BY TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD')
JOIN BASE_PRODUCTLINE bm ON bm.WORK_CENTER_CODE = boi.WORK_CENTER_CODE
WHERE TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') IN
(SELECT TO_CHAR(TRUNC(SYSDATE, 'IW') + LEVEL - 1, 'YYYY-MM-DD') AS day_of_week
FROM DUAL
CONNECT BY LEVEL &lt;= 7)
GROUP BY TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD'), bm.PRODUCT_LINE_CODE
ORDER BY BEGIN_DATE
</select>
<select id="homeLineInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BEGIN_DATE,
bm.PRODUCT_LINE_CODE,
ROUND(SUM(CASE WHEN boi.COMPLETE_AMOUNT = boi.ORDER_AMOUNT THEN 1 ELSE 0 END) / COUNT(*) * 100,
2) COMPLETE_AMOUNT
FROM BASE_ORDERINFO boi
JOIN BASE_MATERIALINFO bm ON bm.MATERIAL_CODE = boi.material_code AND bm.DISPO IN ('100')
WHERE TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') BETWEEN TO_CHAR(SYSDATE - 2, 'YYYY-MM-DD') AND TO_CHAR(SYSDATE - 1, 'YYYY-MM-DD')
GROUP BY TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD')
JOIN BASE_PRODUCTLINE bm ON bm.WORK_CENTER_CODE = boi.WORK_CENTER_CODE
WHERE TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD') IN
(SELECT TO_CHAR(TRUNC(SYSDATE, 'IW') + LEVEL - 1, 'YYYY-MM-DD') AS day_of_week
FROM DUAL
CONNECT BY LEVEL &lt;= 7)
GROUP BY TO_CHAR(boi.BEGIN_DATE, 'YYYY-MM-DD'), bm.PRODUCT_LINE_CODE
ORDER BY BEGIN_DATE
</select>
<select id="homePieChartInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT QUALITY_DEFECT_NAME, SUM
FROM (
SELECT QUALITY_DEFECT_NAME, COUNT(*) SUM
FROM REPORT_QUALITY_INSPECTION
WHERE QUALITY_DEFECT_NAME IS NOT NULL
GROUP BY QUALITY_DEFECT_NAME
ORDER BY SUM
SELECT xl.DICT_LABEL QUALITY_DEFECT_NAME, COUNT(*) SUM
FROM REPORT_QUALITY_INSPECTION QI
LEFT JOIN BASE_QUALITY_INSPECTION_ITEM QII ON QII.QUALITY_DEFECT_CODE = QI.QUALITY_DEFECT_CODE
left join SYS_DICT_DATA xl
on xl.DICT_TYPE = 'defect_subclass' and QII.MATERIAL_SUBCLASS = xl.DICT_VALUE
WHERE QI.QUALITY_DEFECT_NAME IS NOT NULL
AND TO_CHAR(INSPECTOR_TIME, 'YYYY-MM-DD') IN
(SELECT TO_CHAR(TRUNC(SYSDATE, 'IW') + LEVEL - 1, 'YYYY-MM-DD') AS day_of_week
FROM DUAL
CONNECT BY LEVEL &lt;= 7)
GROUP BY xl.DICT_LABEL
ORDER BY SUM DESC
)
WHERE ROWNUM &lt;= 5
WHERE ROWNUM &lt;= 10
</select>
<select id="boxFoamingProductionInterface" resultType="java.util.HashMap" parameterType="java.util.HashMap">
@ -145,4 +162,10 @@
FROM VIEW_CURRENT_TEAM_TIME
</select>
<select id="todayOfflineProduction" resultType="java.util.HashMap">
SELECT COUNT(*) OFFLINE_SUM
FROM C##AUCMA_SCADA.PRODUCT_OFFLINE
WHERE TO_CHAR(PRODUCT_SCANTIME, 'YYYY-MM-DD') = TO_CHAR(SYSDATE, 'YYYY-MM-DD')
</select>
</mapper>

@ -176,8 +176,35 @@
ORDER BY INSPECTOR_TIME DESC
</select>
<select id="qualityIssuesReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT *
FROM VIEW_MATERIAL_COMPLETION
SELECT BF.FACTORY_NAME,
PL2.PRODUCT_LINE_CODE,
PL2.PRODUCT_LINE_NAME,
RQI.QUALITY_DEFECT_CODE,
QI.QUALITY_DEFECT_NAME,
COUNT(*) Q_SUM,
TO_CHAR(ROUND(COUNT(*) / OS.OFFLINE_NUM * 100, 2), 'FM99990.00') || '%' OFFLINE_NUM
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
CROSS JOIN (SELECT COUNT(*) OFFLINE_NUM
FROM C##AUCMA_SCADA.PRODUCT_OFFLINE
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
WHERE TO_CHAR(PRODUCT_SCANTIME, 'YYYY-MM-DD HH24:MI:SS') BETWEEN #{beginBeginTime} AND #{endBeginTime}
</if>
) OS
WHERE RQI.QUALITY_DEFECT_CODE IS NOT NULL
<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>
<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,
RQI.QUALITY_DEFECT_CODE,
QI.QUALITY_DEFECT_NAME, OS.OFFLINE_NUM
ORDER BY PL2.PRODUCT_LINE_CODE, Q_SUM DESC
</select>
<select id="ScanOfflineRecordReportList" resultType="java.util.HashMap" parameterType="java.util.HashMap">
SELECT *
@ -225,11 +252,17 @@
LEFT JOIN BASE_ORDERINFO BO ON BO.ORDER_CODE = SUBSTR(PO.PRODUCT_ORDER_NO, -8)
LEFT JOIN BASE_PRODUCTLINE PL ON PL.WORK_CENTER_CODE = BO.WORK_CENTER_CODE
<where>
<if test="PRODUCT_LINE_CODE != null and PRODUCT_LINE_CODE != ''">and PO.PRODUCT_LINE_CODE = #{PRODUCT_LINE_CODE}</if>
<if test="PRODUCT_LINE_CODE != null and PRODUCT_LINE_CODE != ''">and PO.PRODUCT_LINE_CODE =
#{PRODUCT_LINE_CODE}
</if>
<if test="ORDER_CODE != null and ORDER_CODE != ''">and BO.ORDER_CODE = #{ORDER_CODE}</if>
<if test="MATERIAL_CODE != null and MATERIAL_CODE != ''">and BO.MATERIAL_CODE = #{MATERIAL_CODE}</if>
<if test="MATERIAL_NAME != null and MATERIAL_NAME != ''">and BO.MATERIAL_NAME LIKE '%' || #{MATERIAL_NAME} || '%'</if>
<if test="PRODUCT_SNCODE != null and PRODUCT_SNCODE != ''">and PO.PRODUCT_SNCODE LIKE '%' || #{PRODUCT_SNCODE} || '%'</if>
<if test="MATERIAL_NAME != null and MATERIAL_NAME != ''">and BO.MATERIAL_NAME LIKE '%' || #{MATERIAL_NAME}
|| '%'
</if>
<if test="PRODUCT_SNCODE != null and PRODUCT_SNCODE != ''">and PO.PRODUCT_SNCODE LIKE '%' ||
#{PRODUCT_SNCODE} || '%'
</if>
<if test="BOX_CODE != null and BOX_CODE != ''">and PO.BOX_CODE = #{BOX_CODE}</if>
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
AND TO_CHAR(PO.PRODUCT_SCANTIME, 'YYYY-MM-DD HH24:MI:SS') BETWEEN #{beginBeginTime} AND #{endBeginTime}
@ -248,6 +281,9 @@
U.NICK_NAME USER_NAME
FROM C##AUCMA_SCADA.PRODUCT_OFFLINE PO
JOIN REPORT_QUALITY_INSPECTION RQI ON RQI.BAR_CODE = PO.BOX_CODE
LEFT JOIN (SELECT BOX_CODE, LINER_CODE
FROM C##AUCMA_SCADA.CODE_BINDING
WHERE LINER_CODE IS NOT NULL) CB ON RQI.BAR_CODE = CB.LINER_CODE
LEFT JOIN BASE_PRODUCTLINE PL on RQI.STATION_CODE = PL.PRODUCT_LINE_CODE
LEFT JOIN SYS_USER U on U.USER_NAME = RQI.INSPECTOR_CODE
WHERE PO.BOX_CODE = #{BOX_CODE}

Loading…
Cancel
Save