|
@@ -31,13 +31,14 @@ public class PdaSpmServiceImpl implements PdaSpmService {
|
|
|
if (StringUtil.hasText(spb_status) && ((!spb_status.equals("开封回存")) && (!spb_status.equals("回温回存")))) {
|
|
|
throw new APIErrorException(APIErrorCode.BUSINESS_FAILED, "条码" + barcode + ",状态为:" + spb_status + ",不允许出库回温!");
|
|
|
}
|
|
|
- String prcode = baseDao.getFieldDataByCondition("barcode","bar_prodcode","bar_code = '"+barcode+"'").toString();
|
|
|
- String minbarcode = baseDao.getFieldDataByCondition("barcode","min(bar_code)","bar_prodcode = '"+prcode+"' and not exists (select * from SPMBARCODE where spb_barcode = bar_code) and bar_pdaget <>1").toString();
|
|
|
- if (!(barcode.contains(minbarcode)))
|
|
|
- {
|
|
|
- throw new APIErrorException(APIErrorCode.BUSINESS_FAILED, "条码" + barcode + "对应物料编号"+prcode+"最小未采集条码为"+minbarcode+",不相符不允许采集!");
|
|
|
+ if(!baseDao.checkIf("SPMBARCODE","spb_barcode = '"+barcode+"'")&& baseDao.getFieldDataByCondition("configs","data","code='spm' and caller='sys'").toString().contains("1")) {
|
|
|
+ String prcode = baseDao.getFieldDataByCondition("barcode", "bar_prodcode", "bar_code = '" + barcode + "'").toString();
|
|
|
+ String minbarcode = baseDao.getFieldDataByCondition("barcode", "min(bar_code)", "bar_prodcode = '" + prcode + "' and not exists (select * from SPMBARCODE where spb_barcode = bar_code) and bar_pdaget <>1").toString();
|
|
|
+ if (!(barcode.contains(minbarcode))) {
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED, "条码" + barcode + "对应物料编号" + prcode + "最小未采集条码为" + minbarcode + ",不相符不允许采集!");
|
|
|
+ }
|
|
|
+ baseDao.execute("update barcode set bar_pdaget = 1 where bar_code = '" + barcode + "'");
|
|
|
}
|
|
|
- baseDao.execute("update barcode set bar_pdaget = 1 where bar_code = '"+barcode+"'");
|
|
|
return spmBarcode;
|
|
|
}
|
|
|
|
|
@@ -158,9 +159,9 @@ public class PdaSpmServiceImpl implements PdaSpmService {
|
|
|
if(!spb_status.equals("已开封") && !spb_status.equals("出库回温")){
|
|
|
throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+"状态为:"+spb_status+",不允许回存!");
|
|
|
}
|
|
|
- if(restoreCount > 2){
|
|
|
- throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+",回存不允许超过三次,不允许多次回存!");
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (spb_status.equals("已开封") && rewarmingTime >= 24){
|
|
|
throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+",当前已回温: "+rewarmingTime+" 小时,开封状态下回温时长超过24小时,不允许回存!");
|
|
|
}
|