Browse Source

【微浦MES】锡膏物料判定

caosy 1 year ago
parent
commit
aabfd72505
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/com/uas/mes/pda/service/impl/PdaSpmServiceImpl.java

+ 7 - 7
src/com/uas/mes/pda/service/impl/PdaSpmServiceImpl.java

@@ -295,7 +295,7 @@ public  class PdaSpmServiceImpl implements PdaSpmService {
             throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码不允许为空!");
         }
         SqlRowList rs = baseDao.queryForRowSet("select pr_kind3,nvl(round(months_between(sysdate,bar_validtime),2),-1) validMonth," +
-                "spb_status,spb_status STATUS,bar_code BARCODE,pr_brand BRAND,pr_spec SPEC,nvl(spb_restorecount,0) RESTORECOUNT," +
+                "spb_status,spb_status STATUS,bar_code BARCODE,pr_brand BRAND,pr_spec SPEC,pr_detail,nvl(spb_restorecount,0) RESTORECOUNT," +
                 "to_char(SPB_REWARMINGDATE,'yyyy-mm-dd hh24:mi:ss') REWARMDATE,round((sysdate - SPB_REWARMINGDATE)*24,2) REWARMINGTIME, " +
                 "to_char(SPB_OPENDATE,'yyyy-mm-dd hh24:mi:ss') OPENDATE,round(nvl(spb_opentime,0) + round((sysdate - nvl(spb_opendate,sysdate))*24,2),2) OPENTIME," +
                 "to_char(SPB_EMPTYDATE,'yyyy-mm-dd hh24:mi:ss') EMPTYDATE " +
@@ -303,7 +303,7 @@ public  class PdaSpmServiceImpl implements PdaSpmService {
                 "where bar_code = '"+barcode+"' and nvl(bar_status,0) = 1");
         if(rs.next()){
             //3、条码必须是锡膏条码
-            if(!rs.getGeneralString("SPEC").contains("锡膏")){
+            if(!rs.getGeneralString("SPEC").contains("锡膏")&&!rs.getGeneralString("pr_detail").contains("锡膏")){
                 throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+",非锡膏条码!");
             }
 //            //4、条码有效期校验
@@ -327,7 +327,7 @@ public  class PdaSpmServiceImpl implements PdaSpmService {
             throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码不允许为空!");
         }
         SqlRowList rs = baseDao.queryForRowSet("select pr_kind3,nvl(round(months_between(sysdate,bar_validtime),2),-1) validMonth," +
-                "spb_status,spb_status STATUS,bar_code BARCODE,pr_brand BRAND,pr_spec SPEC,nvl(spb_restorecount,0) RESTORECOUNT," +
+                "spb_status,spb_status STATUS,bar_code BARCODE,pr_brand BRAND,pr_spec SPEC,pr_detail,nvl(spb_restorecount,0) RESTORECOUNT," +
                 "to_char(SPB_REWARMINGDATE,'yyyy-mm-dd hh24:mi:ss') REWARMDATE,round((sysdate - SPB_REWARMINGDATE)*24,2) REWARMINGTIME, " +
                 "to_char(SPB_OPENDATE,'yyyy-mm-dd hh24:mi:ss') OPENDATE,round(nvl(spb_opentime,0) + round((sysdate - nvl(spb_opendate,sysdate))*24,2),2) OPENTIME," +
                 "to_char(SPB_EMPTYDATE,'yyyy-mm-dd hh24:mi:ss') EMPTYDATE " +
@@ -335,13 +335,13 @@ public  class PdaSpmServiceImpl implements PdaSpmService {
                 "where bar_code = '"+barcode+"' and nvl(bar_status,0) = 1");
         if(rs.next()){
             //3、条码必须是锡膏条码
-            if(!rs.getGeneralString("SPEC").contains("锡膏")){
+            if(!rs.getGeneralString("SPEC").contains("锡膏")&&!rs.getGeneralString("pr_detail").contains("锡膏")){
                 throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+",非锡膏条码!");
             }
             //4、条码有效期校验
-            if(rs.getGeneralDouble("validMonth") >= 6 && !type.equals("scrap")){
-                throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+",已过有效期:"+rs.getGeneralDouble("validMonth")+"个月!");
-            }
+//            if(rs.getGeneralDouble("validMonth") >= 6 && !type.equals("scrap")){
+//                throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+",已过有效期:"+rs.getGeneralDouble("validMonth")+"个月!");
+//            }
             return rs.getCurrentMap();
         }else {
             throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND,"条码"+barcode+",不存在或非在库状态!");