|
|
@@ -14,6 +14,7 @@ import com.uas.mes.core.util.StringUtil;
|
|
|
import com.uas.mes.pda.service.PdaSpmService;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -146,8 +147,8 @@ public class PdaSpmServiceImpl implements PdaSpmService {
|
|
|
if(!spb_status.equals("已开封") && !spb_status.equals("出库回温")){
|
|
|
throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+"状态为:"+spb_status+",不允许回存!");
|
|
|
}
|
|
|
- if(restoreCount > 0){
|
|
|
- throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+",只允许回存一次,不允许多次回存!");
|
|
|
+ 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小时,不允许回存!");
|
|
|
@@ -173,7 +174,7 @@ public class PdaSpmServiceImpl implements PdaSpmService {
|
|
|
sqls.add("update spmbarcode set spb_status = '"+spb_status+"'," +
|
|
|
"spb_opentime = round(nvl(spb_opentime,0) + round((sysdate - nvl(spb_opendate,sysdate))*24,2),2)," +
|
|
|
"spb_opendate = null," +
|
|
|
- "spb_restorecount = 1 ," +
|
|
|
+ "spb_restorecount = nvl(spb_restorecount,0)+1 ," +
|
|
|
"spb_rewarmingdate = null " +
|
|
|
"where spb_barcode = '"+barcodeItem+"'");
|
|
|
//3、插入日志到SPMLOG记录条码出库回温
|
|
|
@@ -365,7 +366,7 @@ public class PdaSpmServiceImpl implements PdaSpmService {
|
|
|
String barcodeStr = "'"+barcode.replace(",","','")+"'";
|
|
|
for (String barcodeItem:barcodeArr) {
|
|
|
//1、空瓶退回校验(调用方法checkRecovery)。
|
|
|
- checkRecovery(barcodeItem);
|
|
|
+ checkOpen(barcodeItem);
|
|
|
}
|
|
|
//2、批量更新条码状态为”空瓶”
|
|
|
baseDao.execute("update spmbarcode set spb_status = '已搅拌' where spb_barcode in ("+barcodeStr+")");
|
|
|
@@ -377,22 +378,18 @@ public class PdaSpmServiceImpl implements PdaSpmService {
|
|
|
public Map<String, Object> checkmixing(String barcode) {
|
|
|
//锡膏条码通用校验
|
|
|
Map<String, Object> spmBarcode = validSpmBarcode(barcode);
|
|
|
- Object spb_status = spmBarcode.get("SPB_STATUS");
|
|
|
- // PDA扫码空瓶回收,限制状态必须为‘已用尽’
|
|
|
- if(StringUtil.hasText(spb_status)){
|
|
|
- if(!spb_status.equals("已用尽")){
|
|
|
- throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+"状态为:"+spb_status+",不允许回收!");
|
|
|
- }
|
|
|
- return spmBarcode;
|
|
|
- }else{
|
|
|
- throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"条码"+barcode+",尚未出库回温,不允许空瓶回收!");
|
|
|
- }
|
|
|
+ checkOpen(barcode);
|
|
|
+ return spmBarcode;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> getLine() {
|
|
|
+ public List<Map<String, Object>> getLine() {
|
|
|
//锡膏条码通用校验
|
|
|
SqlRowList rs = baseDao.queryForRowSet("select li_code,li_name from line where li_wccode='SMT'");
|
|
|
- return rs.getCurrentMap();
|
|
|
+ List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
|
|
+ for (Map<String, Object> map :rs.getResultList()){
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
}
|
|
|
}
|