|
|
@@ -59,6 +59,29 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
product.setMesUser(tokenConfig.get("mesUser"));
|
|
|
product.setMesPwd(MD5Util.encodeByMD5(tokenConfig.get("mesPwd")));
|
|
|
Map<String, Object> map = syncMES(JSON.toJSONString(product, SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncProduct"));
|
|
|
+ if (map!=null){
|
|
|
+ int code = Integer.parseInt(StringUtil.nvl(map.get("code"), "-1"));
|
|
|
+ if (code==0){
|
|
|
+ baseDao.updateByCondition("mes_product","status='D'","status='W' and id="+rs.getInt("id"));
|
|
|
+ }else {
|
|
|
+ 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()+"','物料资料')");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if ("ZG".equals(StringUtil.nvl(product.getPr_kh_user(),""))){
|
|
|
product.setPr_kh_user("ZGSDC");
|
|
|
Map<String, Object> map1 =
|
|
|
@@ -83,29 +106,6 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (map!=null){
|
|
|
- int code = Integer.parseInt(StringUtil.nvl(map.get("code"), "-1"));
|
|
|
- if (code==0){
|
|
|
- baseDao.updateByCondition("mes_product","status='D'","status='W' and id="+rs.getInt("id"));
|
|
|
- }else {
|
|
|
- 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()+"','物料资料')");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
logger.info("物料资料异常信息:"+e.getMessage());
|