|
|
@@ -111,8 +111,20 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
if (code == 0) {
|
|
|
baseDao.updateByCondition("mes_makematerial", "status='D'", "status='W' and id=" + rs.getInt("id"));
|
|
|
} else {
|
|
|
- baseDao.updateByCondition("mes_makematerial", "status='F'", "status='W' and id=" + rs.getInt("id"));
|
|
|
- baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode,mel_djdetno,mel_type) values(MESERRORLOG_SEQ.NEXTVAL,'" + tokenConfig.get("syncMakeBaseDetail") + "','" + StringUtil.nvl(map.get("msg"), "") + "',sysdate,'" + rs.getGeneralString("mm_code") + "'," + rs.getInt("mm_detno") + ",'工单BOM')");
|
|
|
+ baseDao.updateByCondition("mes_makematerial", "action='N',flag=0","status='W' and id=" + rs.getInt("id"));
|
|
|
+ makeMaterial.setFlag(0);
|
|
|
+ Map<String, Object> map1 = syncMES(JSON.toJSONString(makeMaterial,
|
|
|
+ SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncMakeBaseDetail"));
|
|
|
+ if (map1 != null) {
|
|
|
+ int code1 = Integer.parseInt(StringUtil.nvl(map1.get("code"), "-1"));
|
|
|
+ if (code1 == 0) {
|
|
|
+ baseDao.updateByCondition("mes_makematerial", "status='D'", "status='W' and id=" + rs.getInt("id"));
|
|
|
+ }else {
|
|
|
+ baseDao.updateByCondition("mes_makematerial", "status='F'", "status='W' and id=" + rs.getInt("id"));
|
|
|
+ baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode,mel_djdetno,mel_type) values(MESERRORLOG_SEQ.NEXTVAL,'" + tokenConfig.get("syncMakeBaseDetail") + "','" + StringUtil.nvl(map.get("msg"), "") + "',sysdate,'" + rs.getGeneralString("mm_code") + "'," + rs.getInt("mm_detno") + ",'工单BOM')");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -133,13 +145,23 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
Map<String, Object> map = syncMES(JSON.toJSONString(makeMaterial,
|
|
|
SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncMakeBaseDetail"));
|
|
|
if (map != null) {
|
|
|
- int code1 = Integer.parseInt(StringUtil.nvl(map.get("code"), "-1"));
|
|
|
- if (code1 == 0) {
|
|
|
+ int code = Integer.parseInt(StringUtil.nvl(map.get("code"), "-1"));
|
|
|
+ if (code == 0) {
|
|
|
baseDao.updateByCondition("mes_makematerialreplace", "status='D'", "status='W' and id=" + rs.getInt("id"));
|
|
|
-
|
|
|
} else {
|
|
|
- baseDao.updateByCondition("mes_makematerialreplace", "status='F'", "status='W' and id=" + rs.getInt("id"));
|
|
|
- baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode,mel_djdetno,mel_type) values(MESERRORLOG_SEQ.NEXTVAL,'" + tokenConfig.get("syncMakeBaseDetail") + "','" + StringUtil.nvl(map.get("msg"), "") + "',sysdate,'" + rs.getGeneralString("mp_mmcode") + "'," + rs.getInt("mp_mmdetno") + ",'工单BOM替代料')");
|
|
|
+ baseDao.updateByCondition("mes_makematerialreplace", "action='N',flag=0","status='W' and id=" + rs.getInt("id"));
|
|
|
+ makeMaterial.setFlag(0);
|
|
|
+ Map<String, Object> map1 = syncMES(JSON.toJSONString(makeMaterial,
|
|
|
+ SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncMakeBaseDetail"));
|
|
|
+ if (map1 != null) {
|
|
|
+ int code1 = Integer.parseInt(StringUtil.nvl(map1.get("code"), "-1"));
|
|
|
+ if (code1 == 0) {
|
|
|
+ baseDao.updateByCondition("mes_makematerialreplace", "status='D'", "status='W' and id=" + rs.getInt("id"));
|
|
|
+ } else {
|
|
|
+ baseDao.updateByCondition("mes_makematerialreplace", "status='F'", "status='W' and id=" + rs.getInt("id"));
|
|
|
+ baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode,mel_djdetno,mel_type) values(MESERRORLOG_SEQ.NEXTVAL,'" + tokenConfig.get("syncMakeBaseDetail") + "','" + StringUtil.nvl(map.get("msg"), "") + "',sysdate,'" + rs.getGeneralString("mp_mmcode") + "'," + rs.getInt("mp_mmdetno") + ",'工单BOM替代料')");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|