|
@@ -61,6 +61,27 @@ public class PdaSpmServiceImpl implements PdaSpmService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Map<String, Object> checkOpen(String barcode) {
|
|
public Map<String, Object> checkOpen(String barcode) {
|
|
|
|
|
+ //锡膏条码通用校验
|
|
|
|
|
+ double data=Double.parseDouble(baseDao.getFieldDataByCondition("configs","data","code='warmtime' and caller='sys'").toString());
|
|
|
|
|
+ Map<String, Object> spmBarcode = validSpmBarcode(barcode);
|
|
|
|
|
+ //3、检测条码存在SPMBARCODE表且状态非”开封回存”或”‘回温回存”则提示”条码XXX,状态为:XXX,不允许出库回温。”
|
|
|
|
|
+ Object spb_status = spmBarcode.get("SPB_STATUS");
|
|
|
|
|
+ Double rewarmingTime = (NumberUtil.isEmpty(spmBarcode.get("REWARMINGTIME")) ? 0.0 : Double.valueOf(spmBarcode.get("REWARMINGTIME").toString()));
|
|
|
|
|
+ if(StringUtil.hasText(spb_status)){
|
|
|
|
|
+ if(!spb_status.equals("出库回温")&&!spb_status.equals("已搅拌")){
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+"状态为:"+spb_status+",不允许开盖!");
|
|
|
|
|
+ }else if (rewarmingTime < data){
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+",当前已回温: "+rewarmingTime+" 小时,回温时长不足"+data+"小时,不允许开盖!");
|
|
|
|
|
+ }else if (rewarmingTime >= 24.0){
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+",当前已回温: "+rewarmingTime+" 小时,回温时长超过24小时,不允许开盖!");
|
|
|
|
|
+ }
|
|
|
|
|
+ return spmBarcode;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+",尚未出库回温,不允许开盖!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Map<String, Object> checkOpen1(String barcode) {
|
|
|
//锡膏条码通用校验
|
|
//锡膏条码通用校验
|
|
|
double data=Double.parseDouble(baseDao.getFieldDataByCondition("configs","data","code='warmtime' and caller='sys'").toString());
|
|
double data=Double.parseDouble(baseDao.getFieldDataByCondition("configs","data","code='warmtime' and caller='sys'").toString());
|
|
|
Map<String, Object> spmBarcode = validSpmBarcode(barcode);
|
|
Map<String, Object> spmBarcode = validSpmBarcode(barcode);
|
|
@@ -81,6 +102,7 @@ public class PdaSpmServiceImpl implements PdaSpmService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void open(String barcode) {
|
|
public void open(String barcode) {
|
|
|
String[] barcodeArr = barcode.split(",");
|
|
String[] barcodeArr = barcode.split(",");
|
|
@@ -371,7 +393,7 @@ public class PdaSpmServiceImpl implements PdaSpmService {
|
|
|
String barcodeStr = "'"+barcode.replace(",","','")+"'";
|
|
String barcodeStr = "'"+barcode.replace(",","','")+"'";
|
|
|
for (String barcodeItem:barcodeArr) {
|
|
for (String barcodeItem:barcodeArr) {
|
|
|
//1、空瓶退回校验(调用方法checkRecovery)。
|
|
//1、空瓶退回校验(调用方法checkRecovery)。
|
|
|
- checkOpen(barcodeItem);
|
|
|
|
|
|
|
+ checkOpen1(barcodeItem);
|
|
|
}
|
|
}
|
|
|
//2、批量更新条码状态为”空瓶”
|
|
//2、批量更新条码状态为”空瓶”
|
|
|
baseDao.execute("update spmbarcode set spb_status = '已搅拌' where spb_barcode in ("+barcodeStr+")");
|
|
baseDao.execute("update spmbarcode set spb_status = '已搅拌' where spb_barcode in ("+barcodeStr+")");
|