|
|
@@ -129,7 +129,7 @@ public class YITCustomerTask {
|
|
|
@Scheduled(cron = "0 0 23 * * ?")
|
|
|
public void syncUpdateCustomers() {
|
|
|
String Master ="YIT.";
|
|
|
- SqlRowList rs = baseDao.queryForRowSet("select * from (select distinct cui_code from "+Master+"customerUpdInfo where CUI_UPDATEDATE is null and trunc(cui_date)=trunc(sysdate)) left join "+Master+"customer on cui_code=cu_code where nvl(cu_name,' ')<>' ' order by cu_id");
|
|
|
+ SqlRowList rs = baseDao.queryForRowSet("select * from (select distinct cui_code from "+Master+"customerUpdInfo where CUI_UPDATEDATE is null and nvl(cui_type,' ')='普通变更' and trunc(cui_date)=trunc(sysdate)) left join "+Master+"customer on cui_code=cu_code where nvl(cu_name,' ')<>' ' order by cu_id");
|
|
|
while (rs.next()){
|
|
|
try {
|
|
|
Customer customer = new Customer();
|
|
|
@@ -142,13 +142,13 @@ public class YITCustomerTask {
|
|
|
BaseResult baseResult = customerManager.updateCustomer(customer);
|
|
|
int errorCode = baseResult.getErrorCode();
|
|
|
if(errorCode == 0){
|
|
|
- baseDao.execute("update "+Master+"customerUpdInfo set cui_updatestatus='已更新',cui_updatedate=sysdate where cui_code='"+rs.getGeneralString("cui_code")+"' and trunc(cui_date)=trunc(sysdate)");
|
|
|
+ baseDao.execute("update "+Master+"customerUpdInfo set cui_updatestatus='已更新',cui_updatedate=sysdate where nvl(cui_type,' ')='普通变更' and cui_code='"+rs.getGeneralString("cui_code")+"' and trunc(cui_date)=trunc(sysdate)");
|
|
|
}else{
|
|
|
- baseDao.execute("update "+Master+"customerUpdInfo set cui_error='"+baseResult.getErrorMessage()+"' where cui_code='"+rs.getGeneralString("cui_code")+"' and trunc(cui_date)=trunc(sysdate)");
|
|
|
+ baseDao.execute("update "+Master+"customerUpdInfo set cui_error='"+baseResult.getErrorMessage()+"' where nvl(cui_type,' ')='普通变更' and cui_code='"+rs.getGeneralString("cui_code")+"' and trunc(cui_date)=trunc(sysdate)");
|
|
|
logger.info("异常信息:"+baseResult.getErrorMessage());
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
- baseDao.execute("update "+Master+"customerUpdInfo set cui_error='"+e.getMessage()+"' where cui_code='"+rs.getGeneralString("cui_code")+"' and trunc(cui_date)=trunc(sysdate)");
|
|
|
+ baseDao.execute("update "+Master+"customerUpdInfo set cui_error='"+e.getMessage()+"' where nvl(cui_type,' ')='普通变更' and cui_code='"+rs.getGeneralString("cui_code")+"' and trunc(cui_date)=trunc(sysdate)");
|
|
|
logger.info("异常信息:"+e.getMessage());
|
|
|
e.printStackTrace();
|
|
|
}
|