|
@@ -2,6 +2,7 @@ package com.bz.smart_city.service.impl.pay;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
+import com.bz.smart_city.commom.exception.ServiceException;
|
|
|
import com.bz.smart_city.commom.model.AjaxMessage;
|
|
|
import com.bz.smart_city.commom.model.ResultStatus;
|
|
|
import com.bz.smart_city.commom.util.HttpRequest;
|
|
@@ -11,10 +12,7 @@ import com.bz.smart_city.commom.util.UserUtil;
|
|
|
import com.bz.smart_city.dao.CustomerMapper;
|
|
|
import com.bz.smart_city.dao.DeviceMapper;
|
|
|
import com.bz.smart_city.dao.WaterMeterReplaceLogMapper;
|
|
|
-import com.bz.smart_city.dto.AreaDto;
|
|
|
-import com.bz.smart_city.dto.CommunityDto;
|
|
|
-import com.bz.smart_city.dto.DeviceTypeDto;
|
|
|
-import com.bz.smart_city.dto.LoginUser;
|
|
|
+import com.bz.smart_city.dto.*;
|
|
|
import com.bz.smart_city.dto.pay.InstallPlanDataDTO;
|
|
|
import com.bz.smart_city.dto.pay.InstallPlanInputDTO;
|
|
|
import com.bz.smart_city.dto.pay.PayBaseAccountDto;
|
|
@@ -326,4 +324,31 @@ public class PaySyncDataServiceImpl implements PaySyncDataService {
|
|
|
}
|
|
|
return new AjaxMessage(ResultStatus.ERROR);
|
|
|
}
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ public AjaxMessage synCustomer(String oldNo,String newNo){
|
|
|
+ try {
|
|
|
+ if(StringUtils.isBlank(oldNo)){
|
|
|
+ return new AjaxMessage(ResultStatus.ERROR,"旧客户编号不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(newNo)){
|
|
|
+ return new AjaxMessage(ResultStatus.ERROR,"新客户编号不能为空");
|
|
|
+ }
|
|
|
+ //校验旧客户编号是否存在
|
|
|
+ CustomerDto oldCustomer = customerMapper.getCustomerByCustomerno(oldNo);
|
|
|
+ if(oldCustomer == null){
|
|
|
+ return new AjaxMessage(ResultStatus.ERROR,"旧客户编号不存在");
|
|
|
+ }
|
|
|
+ //校验新客户编号是否已经存在
|
|
|
+ CustomerDto newCustomer = customerMapper.getCustomerByCustomerno(newNo);
|
|
|
+ if(newCustomer != null && newCustomer.getId() != null){
|
|
|
+ return new AjaxMessage(ResultStatus.ERROR,"新客户编号已存在,不能重复修改");
|
|
|
+ }
|
|
|
+ customerMapper.updateCustomer(oldNo,newNo);
|
|
|
+ }catch (Exception ex){
|
|
|
+ ex.printStackTrace();
|
|
|
+ return new AjaxMessage(ResultStatus.ERROR);
|
|
|
+ }
|
|
|
+ return new AjaxMessage(ResultStatus.OK);
|
|
|
+ }
|
|
|
}
|