|
@@ -622,54 +622,62 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
}*/
|
|
}*/
|
|
|
|
|
|
|
|
if(returnmessage == null || returnmessage.isEmpty()){
|
|
if(returnmessage == null || returnmessage.isEmpty()){
|
|
|
- SqlRowList startLine=baseDao.queryForRowSet("SELECT su_linecode, su_usemacode, su_useprodcode FROM( SELECT * FROM stenciluse WHERE su_stcode = ? AND su_status = '领用' ORDER BY su_usedate DESC) WHERE ROWNUM = 1", StencilSN);
|
|
|
|
|
- String wo = "";
|
|
|
|
|
- String partNo = "";
|
|
|
|
|
- String suLine = "";
|
|
|
|
|
- if(startLine.next()){
|
|
|
|
|
- wo = startLine.getString("su_usemacode");
|
|
|
|
|
- partNo = startLine.getString("su_useprodcode");
|
|
|
|
|
- suLine = startLine.getString("su_linecode");
|
|
|
|
|
-
|
|
|
|
|
- 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, su_usemacode,su_useprodcode)" +
|
|
|
|
|
- "values(stenciluse_seq.nextval,'"+MachineSN+"','"+StencilSN+"','"+rs.getString("st_id")+"','上线','"+suLine+"','"+wo+"','"+partNo+"')");
|
|
|
|
|
-
|
|
|
|
|
- baseDao.updateByCondition("stencil", "st_line = '"+suLine+"'", "st_code='" + StencilSN + "'");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ String stWo = "",stLine = "",partNo = "";
|
|
|
|
|
+ SqlRowList rs=baseDao.queryForRowSet("SELECT st_id,st_line,st_macode,st_useofproduct FROM stencil WHERE st_kind = '钢网' AND st_code = ?", StencilSN);
|
|
|
|
|
+ if(rs.next()){
|
|
|
|
|
+ stWo = rs.getString("st_macode");
|
|
|
|
|
+ stLine = rs.getString("st_line");
|
|
|
|
|
+ partNo = rs.getString("st_useofproduct");
|
|
|
|
|
+ baseDao.execute("insert into stenciluse(su_id, su_useman, su_stcode, su_stid, su_status, su_linecode, su_usemacode,su_useprodcode,su_usedate)" +
|
|
|
|
|
+ "values(stenciluse_seq.nextval,'"+MachineSN+"','"+StencilSN+"','"+rs.getString("st_id")+"','上线','"+stLine+"','"+stWo+"','"+partNo+"',sysdate)");
|
|
|
|
|
+
|
|
|
|
|
+// baseDao.updateByCondition("stencil", "st_line = '"+stLine+"',st_macode='"+stWo+"'", "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,su_usemacode,su_useprodcode)" +
|
|
|
|
|
- "values(stenciluse_seq.nextval,'"+MachineSN+"','"+FrontSqueegeeSN+"','"+rs1.getString("st_id")+"','上线','"+suLine+"','"+wo+"','"+partNo+"')");
|
|
|
|
|
|
|
+ SqlRowList rs1=baseDao.queryForRowSet("SELECT st_id,st_line,st_macode FROM stencil WHERE st_kind = '刮刀' AND st_code = ?", FrontSqueegeeSN);
|
|
|
|
|
+ if(rs1.next()){
|
|
|
|
|
+ stWo = rs1.getString("st_macode");
|
|
|
|
|
+ stLine = rs1.getString("st_line");
|
|
|
|
|
+ partNo = rs1.getString("st_useofproduct");
|
|
|
|
|
+ baseDao.execute("insert into stenciluse(su_id, su_useman, su_stcode, su_stid, su_status, su_linecode,su_usemacode,su_useprodcode,su_usedate)" +
|
|
|
|
|
+ "values(stenciluse_seq.nextval,'"+MachineSN+"','"+FrontSqueegeeSN+"','"+rs1.getString("st_id")+"','上线','"+stLine+"','"+stWo+"','"+partNo+"',sysdate)");
|
|
|
|
|
|
|
|
- baseDao.updateByCondition("stencil", "st_line = '"+suLine+"'", "st_code='" + StencilSN + "'");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// baseDao.updateByCondition("stencil", "st_line = '"+stLine+"',ST_MACODE='"+stWo+"'", "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,su_usemacode,su_useprodcode)" +
|
|
|
|
|
- "values(stenciluse_seq.nextval,'"+MachineSN+"','"+RearSqueegeeSN+"','"+rs2.getString("st_id")+"','上线','"+suLine+"','"+wo+"','"+partNo+"')");
|
|
|
|
|
|
|
+ SqlRowList rs2=baseDao.queryForRowSet("SELECT st_id FROM stencil WHERE st_kind = '刮刀' AND st_code = ?", RearSqueegeeSN);
|
|
|
|
|
+ if(rs2.next()){
|
|
|
|
|
+ stWo = rs2.getString("st_macode");
|
|
|
|
|
+ stLine = rs2.getString("st_line");
|
|
|
|
|
+ partNo = rs2.getString("st_useofproduct");
|
|
|
|
|
|
|
|
- baseDao.updateByCondition("stencil", "st_line = '"+suLine+"'", "st_code='" + StencilSN + "'");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ baseDao.execute("insert into stenciluse(su_id, su_useman, su_stcode, su_stid, su_status, su_linecode,su_usemacode,su_useprodcode,su_usedate)" +
|
|
|
|
|
+ "values(stenciluse_seq.nextval,'"+MachineSN+"','"+RearSqueegeeSN+"','"+rs2.getString("st_id")+"','上线','"+stLine+"','"+stWo+"','"+partNo+"',sysdate)");
|
|
|
|
|
|
|
|
- baseDao.updateByCondition("spmbarcode", "spb_status = '上线',spb_update_time = sysdate,spb_use_count = spb_use_count,SPB_LINECODE = '"+suLine+"'", "spb_barcode='" + PasteSN + "'");
|
|
|
|
|
- SqlRowList rs3 = baseDao.queryForRowSet("SELECT spmlog_seq.NEXTVAL seq FROM dual");
|
|
|
|
|
- Map<Object, Object> paramsMap = new HashMap<Object, Object>();
|
|
|
|
|
- if (rs3.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_linecode", suLine);
|
|
|
|
|
- paramsMap.put("spl_equipment", MachineType);
|
|
|
|
|
- paramsMap.put("spl_sysname", MachineSN);
|
|
|
|
|
- paramsMap.put("spl_makecode", wo);
|
|
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(paramsMap,"spmlog"));
|
|
|
|
|
|
|
+// baseDao.updateByCondition("stencil", "st_line = '"+stLine+"',ST_MACODE='"+stWo+"'", "st_code='" + StencilSN + "'");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ baseDao.updateByCondition("spmbarcode", "spb_status = '上线',spb_update_time = sysdate,spb_use_count = spb_use_count,SPB_LINECODE = '"+Line+"'", "spb_barcode='" + PasteSN + "'");
|
|
|
|
|
+ SqlRowList rs3 = baseDao.queryForRowSet("SELECT spmlog_seq.NEXTVAL seq FROM dual");
|
|
|
|
|
+ Map<Object, Object> paramsMap = new HashMap<Object, Object>();
|
|
|
|
|
+ if (rs3.next()) {
|
|
|
|
|
+ String newStWo = "";
|
|
|
|
|
+ SqlRowList rs4 = baseDao.queryForRowSet("SELECT dl_macode FROM deviceline WHERE dl_linecode = '"+Line+"'");
|
|
|
|
|
+ if(rs4.next()){
|
|
|
|
|
+ newStWo = rs4.getString("dl_macode");
|
|
|
}
|
|
}
|
|
|
|
|
+ newStWo = newStWo.isEmpty() ? stWo : newStWo;
|
|
|
|
|
+
|
|
|
|
|
+ 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_linecode", Line);
|
|
|
|
|
+ paramsMap.put("spl_equipment", MachineType);
|
|
|
|
|
+ paramsMap.put("spl_sysname", MachineSN);
|
|
|
|
|
+ paramsMap.put("spl_makecode", newStWo);
|
|
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(paramsMap,"spmlog"));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1346,6 +1354,12 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
rmap.put("Meassage","钢网/刮刀编号不能为空");
|
|
rmap.put("Meassage","钢网/刮刀编号不能为空");
|
|
|
return rmap;
|
|
return rmap;
|
|
|
}
|
|
}
|
|
|
|
|
+ String useofproduct = "";
|
|
|
|
|
+ SqlRowList rs2=baseDao.queryForRowSet("select ma_prodcode from make where ma_code = ?",wo);
|
|
|
|
|
+ if(rs2.next()){
|
|
|
|
|
+ useofproduct = rs2.getString("ma_prodcode");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
Map<Object, Object> paramsMap = new HashMap<Object, Object>();
|
|
Map<Object, Object> paramsMap = new HashMap<Object, Object>();
|
|
|
Map<Object, Object> paramsMap1 = new HashMap<Object, Object>();
|
|
Map<Object, Object> paramsMap1 = new HashMap<Object, Object>();
|
|
|
try{
|
|
try{
|
|
@@ -1359,11 +1373,10 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
paramsMap.put("su_id",rs1.getString("seq"));
|
|
paramsMap.put("su_id",rs1.getString("seq"));
|
|
|
paramsMap.put("su_stid",rs.getString("st_id"));
|
|
paramsMap.put("su_stid",rs.getString("st_id"));
|
|
|
paramsMap.put("su_stcode",MeshCode);
|
|
paramsMap.put("su_stcode",MeshCode);
|
|
|
- paramsMap.put("su_linecode",rs.getString("st_line"));
|
|
|
|
|
paramsMap.put("su_usemacode",wo);
|
|
paramsMap.put("su_usemacode",wo);
|
|
|
|
|
+ paramsMap.put("su_useprodcode",useofproduct);
|
|
|
paramsMap.put("su_usedate",InspectTime.replace("/", "-"));
|
|
paramsMap.put("su_usedate",InspectTime.replace("/", "-"));
|
|
|
if(usestatus.contains("在库")){
|
|
if(usestatus.contains("在库")){
|
|
|
- paramsMap.put("su_status","领用");
|
|
|
|
|
if(jsonObj.optString("InspectResult", "").contains("NG")){
|
|
if(jsonObj.optString("InspectResult", "").contains("NG")){
|
|
|
rmap.put("Result", "NG");
|
|
rmap.put("Result", "NG");
|
|
|
rmap.put("Meassage", stKind+"状态: 检测结果" + jsonObj.optString("InspectResult", "") + "不可领用");
|
|
rmap.put("Meassage", stKind+"状态: 检测结果" + jsonObj.optString("InspectResult", "") + "不可领用");
|
|
@@ -1375,16 +1388,16 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
return rmap;
|
|
return rmap;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(line == null && line.isEmpty()){
|
|
|
|
|
|
|
+ if(line == null || line.isEmpty()){
|
|
|
rmap.put("Result", "NG");
|
|
rmap.put("Result", "NG");
|
|
|
rmap.put("Meassage", "领用操作须在工单后加线体名称,如XXX/SMTA");
|
|
rmap.put("Meassage", "领用操作须在工单后加线体名称,如XXX/SMTA");
|
|
|
return rmap;
|
|
return rmap;
|
|
|
}
|
|
}
|
|
|
|
|
+ paramsMap.put("su_status","领用");
|
|
|
paramsMap.put("su_linecode", line);
|
|
paramsMap.put("su_linecode", line);
|
|
|
- baseDao.updateByCondition("stencil", "st_line = '"+line+"'", "st_code='" + MeshCode + "'");
|
|
|
|
|
}else if(usestatus.contains("出库")){
|
|
}else if(usestatus.contains("出库")){
|
|
|
paramsMap.put("su_status","归还");
|
|
paramsMap.put("su_status","归还");
|
|
|
- baseDao.updateByCondition("stencil", "st_line = ''", "st_code='" + MeshCode + "'");
|
|
|
|
|
|
|
+ paramsMap.put("su_linecode",rs.getString("st_line"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
paramsMap1.put("std_class",InspectMode);
|
|
paramsMap1.put("std_class",InspectMode);
|
|
@@ -1447,9 +1460,9 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
baseDao.execute(SqlUtil.getInsertSqlByMap(paramsMap,"stenciluse"));
|
|
baseDao.execute(SqlUtil.getInsertSqlByMap(paramsMap,"stenciluse"));
|
|
|
}
|
|
}
|
|
|
if(usestatus.contains("在库") ){
|
|
if(usestatus.contains("在库") ){
|
|
|
- baseDao.updateByCondition("stencil", "st_usestatus = '出库'", "st_code='" + MeshCode + "'");
|
|
|
|
|
|
|
+ baseDao.updateByCondition("stencil", "st_usestatus = '出库',st_line='"+line+"',st_macode='"+wo+"',st_useofproduct = '"+useofproduct+"'", "st_code='" + MeshCode + "'");
|
|
|
}else if(usestatus.contains("出库")){
|
|
}else if(usestatus.contains("出库")){
|
|
|
- baseDao.updateByCondition("stencil", "st_usestatus = '在库'", "st_code='" + MeshCode + "'");
|
|
|
|
|
|
|
+ baseDao.updateByCondition("stencil", "st_usestatus = '在库',st_line='',st_macode='',st_useofproduct=''", "st_code='" + MeshCode + "'");
|
|
|
}
|
|
}
|
|
|
baseDao.execute(SqlUtil.getInsertSqlByMap(paramsMap1,"steptestdetail"));
|
|
baseDao.execute(SqlUtil.getInsertSqlByMap(paramsMap1,"steptestdetail"));
|
|
|
rmap.put("Result","OK");
|
|
rmap.put("Result","OK");
|