|
@@ -1,8 +1,10 @@
|
|
|
package com.bz.smart_city.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.bz.smart_city.commom.exception.ServiceException;
|
|
|
import com.bz.smart_city.commom.model.Pagination;
|
|
|
import com.bz.smart_city.commom.model.ResultStatus;
|
|
|
+import com.bz.smart_city.commom.util.HttpClientUtils;
|
|
|
import com.bz.smart_city.commom.util.TreeUtil;
|
|
|
import com.bz.smart_city.commom.util.UserUtil;
|
|
|
import com.bz.smart_city.dto.CustomerDto;
|
|
@@ -10,13 +12,16 @@ import com.bz.smart_city.dto.LoginUser;
|
|
|
import com.bz.smart_city.entity.ProgramItem;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import com.bz.smart_city.entity.Customer;
|
|
|
import com.bz.smart_city.dao.CustomerMapper;
|
|
@@ -29,6 +34,8 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
|
|
|
@Resource
|
|
|
private CustomerMapper customerMapper;
|
|
|
+ @Value("${sync_customer_no_url}")
|
|
|
+ private String syncCustomerNoUrl;
|
|
|
|
|
|
@Override
|
|
|
public int insert(Customer customer) {
|
|
@@ -197,6 +204,12 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
generateCode(customerId);
|
|
|
return;
|
|
|
}
|
|
|
+ Customer oldCustomer = customerMapper.findById(customerId);
|
|
|
+ Map<String,Object> args=new HashMap<>();
|
|
|
+ args.put("oldNo", oldCustomer.getCustomerNo());
|
|
|
+ args.put("newNo", customerNo);
|
|
|
+ String result = HttpClientUtils.sendApiReQuest(syncCustomerNoUrl, JSONObject.toJSONString(args));
|
|
|
+
|
|
|
log.info("Begin GenerateCode CustomerId " + customerId);
|
|
|
Customer customer = new Customer();
|
|
|
customer.setId(customerId);
|