|  |  | 
 |  |  |     @Scheduled(cron = "${erp.refreshtime}") | 
 |  |  |     public void obtainPedt() { | 
 |  |  |         if (!enabledErpPrdt) return; | 
 |  |  |         String sqlSelectPrdt = "select prd_no as prdNo,name,ut,spc,status,type from ERP_PRDT where 1=1"; | 
 |  |  |         String sqlSelectPrdt = "select prd_no as prdNo,name,ut,spc,status,type,temp1 from ERP_PRDT where 1=1 and temp1 is null"; | 
 |  |  |         String sqlUpDatePrdtOne = "update ERP_PRDT set status=1 where prd_no="; | 
 |  |  |         String sqlUpDatePrdtTwo = "update ERP_PRDT set status=2 "; | 
 |  |  |         try { | 
 |  |  | 
 |  |  |                                     erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); | 
 |  |  |                                     callApiLogSave(prdt, "ERP_PRDT", "接收ERP下发商品信息成功!添加商品信息成功!", true); | 
 |  |  |                                 } else { | 
 |  |  |                                     erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='添加ERP下发商品信息失败!!!状态异常!!!'" | 
 |  |  |                                             + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); | 
 |  |  |                                     callApiLogSave(prdt, "ERP_PRDT", "添加ERP下发商品信息失败!!!状态异常!!!", false); | 
 |  |  |                                     if (Cools.isEmpty(prdt.getTemp1())){ | 
 |  |  |                                         erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='添加ERP下发商品信息失败!!!状态异常!!!'" | 
 |  |  |                                                 + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); | 
 |  |  |                                         callApiLogSave(prdt, "ERP_PRDT", "添加ERP下发商品信息失败!!!状态异常!!!", false); | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             } else { | 
 |  |  |                                 erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='接收ERP下发商品信息失败!!!商品已存在!!!'" | 
 |  |  |                                         + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); | 
 |  |  |                                 callApiLogSave(prdt, "ERP_PRDT", "接收ERP下发商品信息失败!!!商品已存在!!!", false); | 
 |  |  |                                 if (Cools.isEmpty(prdt.getTemp1())){ | 
 |  |  |                                     erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='接收ERP下发商品信息失败!!!商品已存在!!!'" | 
 |  |  |                                             + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); | 
 |  |  |                                     callApiLogSave(prdt, "ERP_PRDT", "接收ERP下发商品信息失败!!!商品已存在!!!", false); | 
 |  |  |                                 } | 
 |  |  |                             } | 
 |  |  |                         } else if (type == 2) { | 
 |  |  |                             Mat mat = matService.selectByMatnr(prdt.getPrdNo()); | 
 |  |  | 
 |  |  |                                     erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); | 
 |  |  |                                     callApiLogSave(prdt, "ERP_PRDT", "接收ERP下发商品信息成功!修改商品信息成功!", true); | 
 |  |  |                                 } else { | 
 |  |  |                                     erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='接收ERP下发商品信息失败!!!修改商品信息失败!!!'" | 
 |  |  |                                             + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); | 
 |  |  |                                     callApiLogSave(prdt, "ERP_PRDT", "接收ERP下发商品信息失败!!!修改商品信息失败!!!", false); | 
 |  |  |                                     if (Cools.isEmpty(prdt.getTemp1())){ | 
 |  |  |                                         erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='接收ERP下发商品信息失败!!!修改商品信息失败!!!'" | 
 |  |  |                                                 + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); | 
 |  |  |                                         callApiLogSave(prdt, "ERP_PRDT", "接收ERP下发商品信息失败!!!修改商品信息失败!!!", false); | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             } | 
 |  |  |                         } else if (type == 3) { | 
 |  |  | 
 |  |  |                                     erpSqlServer.update(sqlUpDatePrdtOne + "'" + prdt.getPrdNo() + "'"); | 
 |  |  |                                     callApiLogSave(prdt, "ERP_PRDT", "接收ERP下发商品信息成功!删除商品信息成功!", true); | 
 |  |  |                                 } else { | 
 |  |  |                                     erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='接收ERP下发商品信息成功!删除商品信息失败!'" | 
 |  |  |                                             + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); | 
 |  |  |                                     callApiLogSave(prdt, "ERP_PRDT", "接收ERP下发商品信息成功!删除商品信息失败!", false); | 
 |  |  |                                     if (Cools.isEmpty(prdt.getTemp1())){ | 
 |  |  |                                         erpSqlServer.update(sqlUpDatePrdtTwo +",Temp1='接收ERP下发商品信息成功!删除商品信息失败!'" | 
 |  |  |                                                 + "where 1=1 " +" and PRD_NO=" + "'" + prdt.getPrdNo() + "'"); | 
 |  |  |                                         callApiLogSave(prdt, "ERP_PRDT", "接收ERP下发商品信息成功!删除商品信息失败!", false); | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             } | 
 |  |  |                         } else { |