|
|
@@ -251,8 +251,7 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
@Override
|
|
|
public void syncCustomer() {
|
|
|
try {
|
|
|
- SqlRowList rs = baseDao.queryForRowSet("select id from mes_customer where status='W' order by id");
|
|
|
- List<Customer> customers = baseDao.query("select cu_id,nvl(cu_mescode,cu_code) cu_oldcode,nvl(cu_mescode,cu_code) cu_code,cu_name,cu_shortname,nvl(cu_cop,'BYT') cu_cop,flag from mes_customer where status='W' order by id", Customer.class);
|
|
|
+ List<Customer> customers = baseDao.query("select cu_id,nvl(cu_mescode,cu_code) cu_oldcode,nvl(cu_mescode,cu_code) cu_code,cu_name,cu_shortname,nvl(cu_cop,'BYT') cu_cop,flag from mes_customer where status='W' order by cu_id", Customer.class);
|
|
|
if (customers!=null&&customers.size()>0){
|
|
|
for (Customer customer:customers) {
|
|
|
customer.setMesUser(tokenConfig.get("mesUser"));
|
|
|
@@ -261,7 +260,7 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
if (map!=null){
|
|
|
int code = Integer.parseInt(StringUtil.nvl(map.get("msgId"), "-1"));
|
|
|
if (code==0){
|
|
|
- baseDao.updateByCondition("mes_customer","status='D'","status='W' and id="+rs.getInt("id"));
|
|
|
+ baseDao.updateByCondition("mes_customer","status='D'","status='W' and cu_id="+customer.getCu_id());
|
|
|
}else {
|
|
|
int flag = customer.getFlag();
|
|
|
if (flag == 1) {
|
|
|
@@ -273,9 +272,9 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
|
|
|
if (map1!=null){
|
|
|
int code1 = Integer.parseInt(StringUtil.nvl(map.get("msgId"), "-1"));
|
|
|
if (code1==0){
|
|
|
- baseDao.updateByCondition("mes_customer","status='D'","status='W' and id="+rs.getInt("id"));
|
|
|
+ baseDao.updateByCondition("mes_customer","status='D'","status='W' and cu_id="+customer.getCu_id());
|
|
|
}else {
|
|
|
- baseDao.updateByCondition("mes_customer","status='F'","status='W' and id="+rs.getInt("id"));
|
|
|
+ baseDao.updateByCondition("mes_customer","status='F'","status='W' and cu_id="+customer.getCu_id());
|
|
|
baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode,mel_type) values (MESERRORLOG_SEQ.NEXTVAL,'"+tokenConfig.get("syncCustomer")+"','"+StringUtil.nvl(map.get("msgStr"),"")+"',sysdate,'"+customer.getCu_code()+"','客户资料')");
|
|
|
}
|
|
|
}
|