每日生产状态报表

master
zpl 3 years ago
parent ff4cffe3d6
commit 4751c67aa0

@ -82,7 +82,6 @@ public class ReportDataController {
@GetMapping("/findProductStateInfo") @GetMapping("/findProductStateInfo")
public R findProductStateInfo(@RequestParam(required = false) Map paramMap) { public R findProductStateInfo(@RequestParam(required = false) Map paramMap) {
try { try {
paramMap.put("site", CommonMethods.getSite());
List<Map<String, Object>> result = reportDataService.findProductStateInfo(paramMap); List<Map<String, Object>> result = reportDataService.findProductStateInfo(paramMap);
return R.ok(result); return R.ok(result);
} catch (Exception e) { } catch (Exception e) {

@ -2,6 +2,7 @@ package com.foreverwin.mesnac.common.service.impl;
import com.foreverwin.mesnac.common.mapper.ReportDataMapper; import com.foreverwin.mesnac.common.mapper.ReportDataMapper;
import com.foreverwin.mesnac.common.service.ReportDataService; import com.foreverwin.mesnac.common.service.ReportDataService;
import com.foreverwin.modular.core.util.CommonMethods;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -33,6 +34,7 @@ public class ReportDataServiceImpl implements ReportDataService{
@Override @Override
public List<Map<String, Object>> findProductStateInfo(Map paramMap) { public List<Map<String, Object>> findProductStateInfo(Map paramMap) {
paramMap.put("site", CommonMethods.getSite());
return reportDataMapper.findProductStateInfo(paramMap); return reportDataMapper.findProductStateInfo(paramMap);
} }
} }

@ -42,10 +42,10 @@
AND ZT.RESULT = #{result} AND ZT.RESULT = #{result}
</if> </if>
<if test="startFromDate != null and startFromDate != ''" > <if test="startFromDate != null and startFromDate != ''" >
AND ZT.MODIFIED_DATE_TIME >= TO_DATE(#{startFromDate}, 'YYYY-MM-DD') AND ZT.MODIFIED_DATE_TIME >= TO_DATE(#{startFromDate}, 'YYYY-MM-DD') - 8/24
</if> </if>
<if test="startToDate != null and startToDate != ''" > <if test="startToDate != null and startToDate != ''" >
AND ZT.MODIFIED_DATE_TIME &lt;= TO_DATE(#{startToDate}|| '23:59:59', 'YYYY-MM-DD HH24:MI:SS') AND ZT.MODIFIED_DATE_TIME &lt;= TO_DATE(#{startToDate}|| '15:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if> </if>
</select> </select>
@ -61,6 +61,67 @@
<!--每日生产状态报表--> <!--每日生产状态报表-->
<select id="findProductStateInfo" resultType="java.util.HashMap" parameterType="java.util.HashMap" > <select id="findProductStateInfo" resultType="java.util.HashMap" parameterType="java.util.HashMap" >
SELECT CFB.VALUE ITEM_NUMBER , ZSD.SHOP_ORDER , I.ITEM , IT.DESCRIPTION ITEM_DESCRIPTION , S.QTY PLAN_QTY ,CFA.VALUE WORK_ORDER ,
ZSD.SFC , ZSD.WORK_CENTER , WCT.DESCRIPTION WORK_CENTER_DESCRIPTION , RU.ROUTER_TYPE , ZSD.STEP_ID , ZSD.OPERATION ,
OT.DESCRIPTION OPERATION_DESCRIPTION, ZSD.RESRCE , R.DESCRIPTION RESOURCE_DESCRIPTION , ZSD.DISPATCH_STATUS OPERATION_STATUS ,
ZSD.PROD_HOURS ,ZSD.ACTUAL_PROD_HOURS , ZSD.PLANNED_START_DATE , ZSD.PLANNED_COMP_DATE , ZSD.ACTUAL_START_DATE , ZSD.ACTUAL_COMPLETE_DATE
FROM Z_SFC_DISPATCH ZSD
LEFT JOIN SHOP_ORDER SO ON SO.SHOP_ORDER = ZSD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS CFA ON CFA.HANDLE = SO.HANDLE AND CFA."ATTRIBUTE" = 'WORK_ORDER'
LEFT JOIN CUSTOM_FIELDS CFB ON CFB.HANDLE = SO.HANDLE AND CFB."ATTRIBUTE" = 'ITEM_NUMBER'
LEFT JOIN SFC S ON S.SFC = ZSD.SFC
LEFT JOIN ITEM I ON I.HANDLE = S.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = S.ITEM_BO
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZSD.WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
LEFT JOIN OPERATION O ON O.OPERATION = ZSD.OPERATION
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
LEFT JOIN RESRCE R ON R.RESRCE = ZSD.RESRCE
LEFT JOIN ROUTER RU ON RU.HANDLE = ZSD.ROUTER_BO
WHERE ZSD.SITE = #{site}
<if test="itemNumber != null and itemNumber != ''" >
AND CFB.VALUE LIKE '%'||#{itemNumber}||'%'
</if>
<if test="workOrder != null and workOrder != ''" >
AND CFA.VALUE LIKE '%'||#{workOrder}||'%'
</if>
<if test="shopOrder != null and shopOrder != ''" >
AND ZSD.SHOP_ORDER = #{shopOrder}
</if>
<if test="workCenter != null and workCenter != ''" >
AND ZSD.WORK_CENTER = #{workCenter}
</if>
<if test="resrce != null and resrce != ''" >
AND ZSD.RESRCE = #{resrce}
</if>
<if test="routerType != null and routerType != ''" >
<if test="routerType = 'C'.toString()" >
AND RU.ROUTER_TYPE = #{routerType}
</if>
<if test="routerType != 'C'.toString()" >
AND RU.ROUTER_TYPE != #{routerType}
</if>
</if>
<if test="operationStatus != null and operationStatus != ''" >
<if test="operationStatus = 'OTHER'.toString()" >
AND ZSD.DISPATCH_STATUS != 'START' AND ZSD.DISPATCH_STATUS != 'COMPLETE'
</if>
<if test="operationStatus != 'OTHER'.toString()" >
AND ZSD.DISPATCH_STATUS = #{operationStatus}
</if>
</if>
<if test="startFromDate != null and startFromDate != ''" >
AND ZSD.PLANNED_START_DATE >= TO_DATE(#{startFromDate}, 'YYYY-MM-DD') - 8/24
</if>
<if test="startToDate != null and startToDate != ''" >
AND ZSD.PLANNED_COMP_DATE &lt;= TO_DATE(#{startToDate}|| '15:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
<if test="actualStartFromDate != null and actualStartFromDate != ''" >
AND ZSD.ACTUAL_START_DATE >= TO_DATE(#{actualStartFromDate}, 'YYYY-MM-DD') - 8/24
</if>
<if test="actualStartToDate != null and actualStartToDate != ''" >
AND ZSD.ACTUAL_COMPLETE_DATE &lt;= TO_DATE(#{actualStartToDate}|| '15:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
</select> </select>

Loading…
Cancel
Save