@ -65,6 +65,9 @@
<result column= "SHOP_ORDER_TYPE" property= "shopOrderType" />
<result column= "ITEM_DESCRIPTION" property= "itemDescription" />
<result column= "COMPONENT" property= "component" />
<result column= "COMPONENT_DESCRIPTION" property= "componentDescription" />
<result column= "TEXTURE" property= "texture" />
<result column= "MAT_SPEC" property= "matSpec" />
<result column= "COMPLETED_QTY" property= "completedQty" />
<result column= "RESOURCE_DESCRIPTION" property= "resourceDescription" />
<result column= "COMPONENT_DESCRIPTION" property= "componentDescription" />
@ -676,12 +679,12 @@
WHEN WIP.DISPATCH_STATUS = 'PAUSE' THEN N'暂停' WHEN WIP.DISPATCH_STATUS = 'RELEASE' THEN N'发布'
END AS STATUS_NAME, 'ADMINISTRATOR' AS ROLE
FROM (
SELECT DISTINCT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C2.VALUE ITEM_NUMBER, C1.VALUE WORK_ORDER, IM.HANDLE ITEM_BO, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,
SELECT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C2.VALUE ITEM_NUMBER, C1.VALUE WORK_ORDER, IM.HANDLE ITEM_BO, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,
SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION OPERATION_DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE USER_NAME, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION RESOURCE_DESCRIPTION,
CASE WHEN SD.DISPATCH_STATUS = 'COMPLETE' THEN SD.DISPATCH_QTY ELSE 0 END COMPLETED_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION,
SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.DISPATCH_SEQ-1 BEFORE_SEQ, SD.DISPATCH_SEQ+1 AFTER_SEQ, SD.EARLIEST_START_DATE, SD.LATEST_END_DATE,
CASE WHEN IM.LOT_SIZE = 1 THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.BLANKING_SIZE,
WR.WORK_CENTER RESOURCE_WORK_CENTER
CASE WHEN IM.LOT_SIZE = 1 THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.BLANKING_SIZE, MAX(BC.COMPONENT_GBO) COMPONENT_BO,
WR.WORK_CENTER RESOURCE_WORK_CENTER, MAX(CP.ITEM) COMPONENT, MAX(CT.DESCRIPTION) COMPONENT_DESCRIPTION, MAX(C3.VALUE) TEXTURE, MAX(C4.VALUE) MAT_SPEC
FROM Z_SFC_DISPATCH SD
LEFT JOIN RESRCE RS ON SD.SITE = RS.SITE AND SD.RESRCE = RS.RESRCE
INNER JOIN SHOP_ORDER SO ON SO.SITE = SD.SITE AND SO.SHOP_ORDER = SD.SHOP_ORDER
@ -692,8 +695,10 @@
INNER JOIN OPERATION O ON O.SITE = SD.SITE AND O.OPERATION = SD.OPERATION AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE AND OT.LOCALE = 'zh'
INNER JOIN BOM_COMPONENT BC ON BC.BOM_BO = SO.BOM_BO
INNER JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO
LEFT JOIN ITEM_T CPT ON CPT.ITEM_BO = CP.HANDLE AND CPT.LOCALE = 'zh'
LEFT JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO
LEFT JOIN ITEM_T CT ON CT.ITEM_BO = CP.HANDLE AND CT.LOCALE = 'zh'
LEFT JOIN CUSTOM_FIELDS C3 ON C3.HANDLE = CP.HANDLE AND C3.ATTRIBUTE = 'TEXTTURE'
LEFT JOIN CUSTOM_FIELDS C4 ON C4.HANDLE = CP.HANDLE AND C4.ATTRIBUTE = 'MAT_SPEC'
LEFT JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = 'ResourceBO:' || SD.SITE || ',' || SD.RESRCE
LEFT JOIN WORK_CENTER WR ON WR.HANDLE = WCM.WORK_CENTER_BO
WHERE SD.SITE = #{site}
@ -733,17 +738,23 @@
<if test= "turnOperation != null and turnOperation != ''" >
AND SD.TURN_OPERATION = #{turnOperation}
</if>
<if test= "isDispatch != null and isDispatch != ''" >
AND SD.IS_DISPATCH = #{isDispatch}
</if>
<if test= "blankingSize != null and blankingSize != ''" >
AND SD.BLANKING_SIZE LIKE '%'||#{blankingSize}||'%'
</if>
<if test= "component != null and component != ''" >
AND CP.ITEM = #{component}
</if>
<if test= "componentDescription != null and componentDescription != ''" >
AND CPT.DESCRIPTION LIKE '%' || #{componentDescription} || '%'
AND CT.DESCRIPTION LIKE '%' || #{componentDescription} || '%'
</if>
<if test= " isDispatch != null and isDispatch != ''">
AND SD.IS_DISPATCH = #{isDispatch}
<if test= " texture != null and texture != ''">
AND C3.VALUE LIKE '%'|| #{texture} ||'%'
</if>
<if test= " blankingSize != null and blankingSize != ''">
AND SD.BLANKING_SIZE LIKE '%'||#{blankingSize}|| '%'
<if test= " matSpec != null and matSpec != ''">
AND C4.VALUE LIKE '%'|| #{matSpec}|| '%'
</if>
<if test= "startFromDate != null" >
AND SO.PLANNED_START_DATE >= TO_DATE(#{startFromDate}, 'YYYY-MM-DD')
@ -757,6 +768,11 @@
<if test= "completeToDate != null" >
AND SO.PLANNED_COMP_DATE < = TO_DATE(#{completeToDate}|| '23:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
GROUP BY SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C2.VALUE, C1.VALUE, IM.HANDLE, IM.ITEM, IT.DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,
SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION,
SD.DISPATCH_STATUS, SD.DISPATCH_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION,
SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.EARLIEST_START_DATE, SD.LATEST_END_DATE,
IM.LOT_SIZE, SD.TURN_OPERATION, SD.BLANKING_SIZE, WR.WORK_CENTER
) WIP
LEFT JOIN Z_SFC_DISPATCH V1 ON V1.SITE = WIP.SITE AND V1.SFC = WIP.SFC AND V1.DISPATCH_SEQ = WIP.BEFORE_SEQ
LEFT JOIN Z_SFC_DISPATCH V2 ON V2.SITE = WIP.SITE AND V2.SFC = WIP.SFC AND V2.DISPATCH_SEQ = WIP.AFTER_SEQ