diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java index 7c7fa5e9..bd840050 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java @@ -949,6 +949,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl - AND WC.WORK_CENTER = #{workCenter} + AND (WC.WORK_CENTER = #{workCenter} OR WT.DESCRIPTION = #{workCenter}) AND ZT.CATEGORY = #{category} @@ -325,26 +325,22 @@ LEFT JOIN Z_NWA_USER znu2 ON znu2.USER_NAME = zabd.RESOLVE_USER AND znu2.SITE = zab.SITE zab.SITE = #{site} AND zab."TYPE" ='Z' - - AND (wc.WORK_CENTER LIKE '%${workCenter}%' OR wct.DESCRIPTION LIKE '%${workCenter}%') + + AND zab.ABNORMAL_NO = #{abnormalNo} - - AND (CASE WHEN itemNumber.VALUE IS NOT NULL THEN itemNumber.VALUE ELSE zab.ITEM_NUMBER END) = #{itemNumber} + + AND so.SHOP_ORDER = #{shopOrder} AND (dflt.DATA_TAG = #{productCategory} OR zab.PRODUCT_CATEGORY = #{productCategory} ) - - AND (o.OPERATION LIKE '%${operation}%' OR - ot.DESCRIPTION LIKE '%${operation}%' - ) + + AND zab.DISCOVER = #{discover} - - AND (r2.RESRCE LIKE '%${resrce}%' OR - r2.DESCRIPTION LIKE '%${resrce}%' - ) + + AND (zab.CREATED_USER = #{createdUser} OR znu.FULL_NAME = #{createdUser}) AND zab.CREATED_DATE_TIME >= TO_DATE(#{startDateTime},'YYYY-MM-DD') @@ -472,16 +468,18 @@ SELECT wct.DESCRIPTION WORK_CENTER_DESCRIPTION,cf.VALUE ITEM_NUMBER, COALESCE(dflt.DATA_TAG,cf2.VALUE) PRODUCT_CATEGORY, zsd.SHOP_ORDER,it.DESCRIPTION ITEM_DESCRIPTION,zsd.PLANNED_START_DATE, - zsd.PLANNED_COMP_DATE ,zsd.ACTUAL_START_DATE ,ot.DESCRIPTION CURRENT_OPERATION_DESCRIPTION, + zsd.PLANNED_COMP_DATE ,zsd.ACTUAL_START_DATE ,zsd.ACTUAL_COMPLETE_DATE,ot.DESCRIPTION CURRENT_OPERATION_DESCRIPTION, ot2.DESCRIPTION OPERATION_DESCRIPTION, CASE WHEN zab.HANDLE IS NOT NULL THEN '是' ELSE '否' END IS_ANOMALY, - CASE WHEN zsd.PLANNED_COMP_DATE IS NOT NULL THEN TO_CHAR(TO_NUMBER(zsd.PLANNED_COMP_DATE - SYSDATE),'FM9999990.000') + CASE WHEN zsd.PLANNED_COMP_DATE IS NOT NULL THEN TO_CHAR(TO_NUMBER(zsd.PLANNED_COMP_DATE + 8/24 - SYSDATE),'FM9999990.000') ELSE '' END SURPLUS_DAY, - CASE WHEN zsd.ACTUAL_START_DATE IS NOT null AND cf3.VALUE IS NOT null AND cf3.VALUE != 0 AND zsd.ACTUAL_COMPLETE_DATE IS NULL - THEN ROUND(TO_NUMBER(SYSDATE - zsd.ACTUAL_START_DATE)*24/TO_NUMBER(cf3.VALUE),2)*100 || '%' + CASE WHEN zsd.ACTUAL_START_DATE IS NOT NULL AND cf3.VALUE IS NOT NULL AND cf3.VALUE != 0 AND zsd.ACTUAL_COMPLETE_DATE IS NULL + THEN ROUND(TO_NUMBER(SYSDATE - (zsd.ACTUAL_START_DATE+8/24))*24/TO_NUMBER(cf3.VALUE),2)*100 || '%' + WHEN zsd.ACTUAL_START_DATE IS NOT NULL AND cf3.VALUE IS NOT NULL AND cf3.VALUE != 0 AND zsd.ACTUAL_COMPLETE_DATE IS NOT NULL + THEN ROUND(TO_NUMBER((zsd.ACTUAL_COMPLETE_DATE+8/24) - (zsd.ACTUAL_START_DATE+8/24))*24/TO_NUMBER(cf3.VALUE),2)*100 || '%' ELSE '' END PROCESS_HOURS FROM Z_SFC_DISPATCH zsd