|
@@ -95,8 +95,23 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
if (code == 0) {
|
|
if (code == 0) {
|
|
|
baseDao.updateByCondition("mes_make", "status='D'", "status='W' and id=" + rs.getInt("id"));
|
|
baseDao.updateByCondition("mes_make", "status='D'", "status='W' and id=" + rs.getInt("id"));
|
|
|
} else {
|
|
} else {
|
|
|
- baseDao.updateByCondition("mes_make", "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_type) values (MESERRORLOG_SEQ.NEXTVAL,'" + tokenConfig.get("syncMakeBase") + "','" + StringUtil.nvl(map.get("msg"), "") + "',sysdate,'" + make.getMa_code() + "','工单')");
|
|
|
|
|
|
|
+ int flag = make.getFlag();
|
|
|
|
|
+ if (flag == 1) {
|
|
|
|
|
+ make.setFlag(0);
|
|
|
|
|
+ } else if (flag == 0) {
|
|
|
|
|
+ make.setFlag(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ Map<String, Object> map1 = syncMES(JSON.toJSONString(make,
|
|
|
|
|
+ SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncMakeBase"));
|
|
|
|
|
+ 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_make", "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_type) values (MESERRORLOG_SEQ.NEXTVAL,'" + tokenConfig.get("syncMakeBase") + "','" + StringUtil.nvl(map.get("msg"), "") + "',sysdate,'" + make.getMa_code() + "','工单')");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|