yhluo hai 2 días
pai
achega
f4479b5c18
Modificáronse 1 ficheiros con 33 adicións e 33 borrados
  1. 33 33
      src/main/java/com/uas/eis/serviceImpl/MESHelperServiceImpl.java

+ 33 - 33
src/main/java/com/uas/eis/serviceImpl/MESHelperServiceImpl.java

@@ -550,48 +550,48 @@ public class MESHelperServiceImpl implements MESHelperService {
 				code = 222;
 				returnmessage = returnmessage + "锡膏:"+PasteSN+"未领用,校验失败.\n";
 			}
-			
-			SqlRowList rs=baseDao.queryForRowSet("SELECT st_id FROM stencil WHERE st_kind = '钢网' AND st_code = ?", StencilSN);
-			if(rs.next()){
-				baseDao.execute("insert into stenciluse(su_id, su_useman, su_stcode, su_stid, su_status, su_linecode)" +
-						"values(stenciluse_seq.nextval,'"+MachineSN+"','"+StencilSN+"','"+rs.getString("st_id")+"','上线','"+Line+"')");
 
-				baseDao.updateByCondition("stencil", "st_line = '"+Line+"'", "st_code='" + StencilSN + "'");
-			}
+			if(returnmessage == null || returnmessage.isEmpty()){
+				SqlRowList rs=baseDao.queryForRowSet("SELECT st_id FROM stencil WHERE st_kind = '钢网' AND st_code = ?", StencilSN);
+				if(rs.next()){
+					baseDao.execute("insert into stenciluse(su_id, su_useman, su_stcode, su_stid, su_status, su_linecode)" +
+							"values(stenciluse_seq.nextval,'"+MachineSN+"','"+StencilSN+"','"+rs.getString("st_id")+"','上线','"+Line+"')");
 
-			SqlRowList rs1=baseDao.queryForRowSet("SELECT st_id FROM stencil WHERE st_kind = '刮刀' AND st_code = ?", FrontSqueegeeSN);
-			if(rs1.next()){
-				baseDao.execute("insert into stenciluse(su_id, su_useman, su_stcode, su_stid, su_status, su_linecode)" +
-						"values(stenciluse_seq.nextval,'"+MachineSN+"','"+FrontSqueegeeSN+"','"+rs1.getString("st_id")+"','上线','"+Line+"')");
+					baseDao.updateByCondition("stencil", "st_line = '"+Line+"'", "st_code='" + StencilSN + "'");
+				}
 
-				baseDao.updateByCondition("stencil", "st_line = '"+Line+"'", "st_code='" + StencilSN + "'");
-			}
+				SqlRowList rs1=baseDao.queryForRowSet("SELECT st_id FROM stencil WHERE st_kind = '刮刀' AND st_code = ?", FrontSqueegeeSN);
+				if(rs1.next()){
+					baseDao.execute("insert into stenciluse(su_id, su_useman, su_stcode, su_stid, su_status, su_linecode)" +
+							"values(stenciluse_seq.nextval,'"+MachineSN+"','"+FrontSqueegeeSN+"','"+rs1.getString("st_id")+"','上线','"+Line+"')");
 
-			SqlRowList rs2=baseDao.queryForRowSet("SELECT st_id FROM stencil WHERE st_kind = '刮刀' AND st_code = ?", RearSqueegeeSN);
-			if(rs2.next()){
-				baseDao.execute("insert into stenciluse(su_id, su_useman, su_stcode, su_stid, su_status, su_linecode)" +
-						"values(stenciluse_seq.nextval,'"+MachineSN+"','"+RearSqueegeeSN+"','"+rs2.getString("st_id")+"','上线','"+Line+"')");
+					baseDao.updateByCondition("stencil", "st_line = '"+Line+"'", "st_code='" + StencilSN + "'");
+				}
 
-				baseDao.updateByCondition("stencil", "st_line = '"+Line+"'", "st_code='" + StencilSN + "'");
-			}
+				SqlRowList rs2=baseDao.queryForRowSet("SELECT st_id FROM stencil WHERE st_kind = '刮刀' AND st_code = ?", RearSqueegeeSN);
+				if(rs2.next()){
+					baseDao.execute("insert into stenciluse(su_id, su_useman, su_stcode, su_stid, su_status, su_linecode)" +
+							"values(stenciluse_seq.nextval,'"+MachineSN+"','"+RearSqueegeeSN+"','"+rs2.getString("st_id")+"','上线','"+Line+"')");
 
-			baseDao.updateByCondition("spmbarcode", "spb_status = '上线',spb_update_time = sysdate,spb_use_count = spb_use_count", "spb_barcode='" + PasteSN + "'");
+					baseDao.updateByCondition("stencil", "st_line = '"+Line+"'", "st_code='" + StencilSN + "'");
+				}
 
-			SqlRowList rs3 = baseDao.queryForRowSet("SELECT spmlog_seq.NEXTVAL seq FROM dual");
-			Map<Object, Object> paramsMap = new HashMap<Object, Object>();
-			if (rs.next()) {
-				paramsMap.put("spl_id", rs3.getString("seq"));
-				paramsMap.put("spl_operation", "上线");
-				paramsMap.put("spl_operator", MachineSN);
-				paramsMap.put("spl_barcode", PasteSN);
-				paramsMap.put("spl_user_count", "spl_user_count");
-				paramsMap.put("spl_equipment", MachineType);
-				paramsMap.put("spl_sysname", MachineSN);
-
-				baseDao.execute(SqlUtil.getInsertSqlByMap(paramsMap,"spmlog"));
+				baseDao.updateByCondition("spmbarcode", "spb_status = '上线',spb_update_time = sysdate,spb_use_count = spb_use_count", "spb_barcode='" + PasteSN + "'");
+
+				SqlRowList rs3 = baseDao.queryForRowSet("SELECT spmlog_seq.NEXTVAL seq FROM dual");
+				Map<Object, Object> paramsMap = new HashMap<Object, Object>();
+				if (rs.next()) {
+					paramsMap.put("spl_id", rs3.getString("seq"));
+					paramsMap.put("spl_operation", "上线");
+					paramsMap.put("spl_operator", MachineSN);
+					paramsMap.put("spl_barcode", PasteSN);
+					paramsMap.put("spl_user_count", "spl_user_count");
+					paramsMap.put("spl_equipment", MachineType);
+					paramsMap.put("spl_sysname", MachineSN);
+					baseDao.execute(SqlUtil.getInsertSqlByMap(paramsMap,"spmlog"));
+				}
 			}
 
-
 			Map<Object, Object> rmap1 = new HashMap<Object, Object>();
 			rmap1.put("Command","MaterialVerify");
 			rmap1.put("SessionID",SessionID);