|
|
@@ -927,7 +927,21 @@ public class PdaSMTServiceImpl implements PdaSMTService {
|
|
|
List<String> sqls = new ArrayList<String>();
|
|
|
if(dl_actmadeqty == null || ("").equals(dl_actmadeqty)){
|
|
|
dl_actmadeqty=0;
|
|
|
- }
|
|
|
+ }
|
|
|
+ //执行切换之前,先锁deviceline 表和devicesmtlocation
|
|
|
+ try {
|
|
|
+ baseDao.execute("select dl_id from deviceline where dl_linecode=? for update wait 3", dl_linecode);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"请等待其它操作执行之后再进行切换操作");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ baseDao.execute("select dsl_id from devsmtlocation where dsl_linecode=? for update wait 3", dl_linecode);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"请等待其它操作执行之后再进行切换操作");
|
|
|
+ }
|
|
|
+
|
|
|
//先判断传过来的值dl_madeqty,必须大于0,并且介于dl_madeqty和ma_qty之间
|
|
|
if(dl_actmadeqty<0){
|
|
|
throw new APIErrorException(APIErrorCode.BUSINESS_FAILED,"产出数不允许小于0");
|