|
|
@@ -55,8 +55,21 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
syncMES(JSON.toJSONString(product, SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncProduct"));
|
|
|
if (map1!=null) {
|
|
|
int code1 = Integer.parseInt(StringUtil.nvl(map1.get("code"), "100"));
|
|
|
- if (code1>0){
|
|
|
- baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode,mel_type) values (MESERRORLOG_SEQ.NEXTVAL,'"+tokenConfig.get("syncProduct")+"','"+StringUtil.nvl(map.get("msg"),"")+"',sysdate,'"+product.getPr_code()+"','物料资料')");
|
|
|
+ if (code1>0) {
|
|
|
+ int flag = product.getFlag();
|
|
|
+ if (flag == 1) {
|
|
|
+ product.setFlag(0);
|
|
|
+ } else if (flag == 0) {
|
|
|
+ product.setFlag(1);
|
|
|
+ }
|
|
|
+ Map<String, Object> map2 =
|
|
|
+ syncMES(JSON.toJSONString(product, SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncProduct"));
|
|
|
+ if (map2 != null) {
|
|
|
+ int code2 = Integer.parseInt(StringUtil.nvl(map1.get("code"), "100"));
|
|
|
+ if (code2 > 0) {
|
|
|
+ baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode,mel_type) values (MESERRORLOG_SEQ.NEXTVAL,'" + tokenConfig.get("syncProduct") + "','" + StringUtil.nvl(map.get("msg"), "") + "',sysdate,'" + product.getPr_code() + "','物料资料')");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -65,8 +78,22 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
if (code==0){
|
|
|
baseDao.updateByCondition("mes_product","status='D'","status='W' and id="+rs.getInt("id"));
|
|
|
}else {
|
|
|
- baseDao.updateByCondition("mes_product","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("syncProduct")+"','"+StringUtil.nvl(map.get("msg"),"")+"',sysdate,'"+product.getPr_code()+"','物料资料')");
|
|
|
+ int flag = product.getFlag();
|
|
|
+ if (flag == 1) {
|
|
|
+ product.setFlag(0);
|
|
|
+ } else if (flag == 0) {
|
|
|
+ product.setFlag(1);
|
|
|
+ }
|
|
|
+ Map<String, Object> map1 = syncMES(JSON.toJSONString(product, SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncProduct"));
|
|
|
+ if (map1!=null){
|
|
|
+ int code1 = Integer.parseInt(StringUtil.nvl(map.get("code"), "-1"));
|
|
|
+ if (code1==0){
|
|
|
+ baseDao.updateByCondition("mes_product","status='D'","status='W' and id="+rs.getInt("id"));
|
|
|
+ }else {
|
|
|
+ baseDao.updateByCondition("mes_product","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("syncProduct")+"','"+StringUtil.nvl(map.get("msg"),"")+"',sysdate,'"+product.getPr_code()+"','物料资料')");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|