Commit d31b269efde2a6b2d67d29a7cdca58b3c99a6624

Authored by 房远帅
1 parent cc82971b

楚江ERP:客户资信-变更记录优化

1 package com.lframework.xingyun.sc.controller.customer; 1 package com.lframework.xingyun.sc.controller.customer;
2 2
3 -import com.lframework.starter.common.utils.StringUtil;  
4 import com.lframework.starter.web.core.annotations.security.HasPermission; 3 import com.lframework.starter.web.core.annotations.security.HasPermission;
5 import com.lframework.starter.web.core.controller.DefaultBaseController; 4 import com.lframework.starter.web.core.controller.DefaultBaseController;
6 import com.lframework.starter.web.core.utils.PageResultUtil; 5 import com.lframework.starter.web.core.utils.PageResultUtil;
7 import com.lframework.starter.web.core.components.resp.PageResult; 6 import com.lframework.starter.web.core.components.resp.PageResult;
8 import com.lframework.starter.web.core.components.resp.InvokeResult; 7 import com.lframework.starter.web.core.components.resp.InvokeResult;
9 -  
10 import javax.annotation.Resource; 8 import javax.annotation.Resource;
11 import javax.validation.constraints.NotBlank; 9 import javax.validation.constraints.NotBlank;
12 -  
13 import com.lframework.xingyun.sc.bo.customer.credit.ChangeData; 10 import com.lframework.xingyun.sc.bo.customer.credit.ChangeData;
14 import com.lframework.xingyun.sc.bo.customer.credit.ChangeItem; 11 import com.lframework.xingyun.sc.bo.customer.credit.ChangeItem;
15 import com.lframework.xingyun.sc.bo.customer.credit.GetCustomerCreditHistoryBo; 12 import com.lframework.xingyun.sc.bo.customer.credit.GetCustomerCreditHistoryBo;
16 -import com.lframework.xingyun.sc.entity.CorePersonnel;  
17 import com.lframework.xingyun.sc.entity.CorePersonnelHistory; 13 import com.lframework.xingyun.sc.entity.CorePersonnelHistory;
18 -import com.lframework.xingyun.sc.entity.CustomerCredit;  
19 import com.lframework.xingyun.sc.entity.CustomerCreditHistory; 14 import com.lframework.xingyun.sc.entity.CustomerCreditHistory;
20 import com.lframework.xingyun.sc.service.customer.CorePersonnelHistoryService; 15 import com.lframework.xingyun.sc.service.customer.CorePersonnelHistoryService;
21 -import com.lframework.xingyun.sc.service.customer.CorePersonnelService;  
22 import com.lframework.xingyun.sc.service.customer.CustomerCreditHistoryService; 16 import com.lframework.xingyun.sc.service.customer.CustomerCreditHistoryService;
23 -import com.lframework.xingyun.sc.service.customer.CustomerCreditService;  
24 import com.lframework.xingyun.sc.vo.customer.credit.CreateCustomerCreditHistoryVo; 17 import com.lframework.xingyun.sc.vo.customer.credit.CreateCustomerCreditHistoryVo;
25 import com.lframework.xingyun.sc.vo.customer.credit.QueryCorePersonnelHistoryVo; 18 import com.lframework.xingyun.sc.vo.customer.credit.QueryCorePersonnelHistoryVo;
26 -import com.lframework.xingyun.sc.vo.customer.credit.QueryCorePersonnelVo;  
27 import com.lframework.xingyun.sc.vo.customer.credit.QueryCustomerCreditHistoryVo; 19 import com.lframework.xingyun.sc.vo.customer.credit.QueryCustomerCreditHistoryVo;
28 import io.swagger.annotations.ApiImplicitParam; 20 import io.swagger.annotations.ApiImplicitParam;
29 import com.lframework.starter.web.core.components.resp.InvokeResultBuilder; 21 import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
@@ -54,11 +46,7 @@ public class CustomerCreditHistoryController extends DefaultBaseController { @@ -54,11 +46,7 @@ public class CustomerCreditHistoryController extends DefaultBaseController {
54 @Resource 46 @Resource
55 private CustomerCreditHistoryService customerCreditHistoryService; 47 private CustomerCreditHistoryService customerCreditHistoryService;
56 @Resource 48 @Resource
57 - private CustomerCreditService customerCreditService;  
58 - @Resource  
59 private CorePersonnelHistoryService corePersonnelHistoryService; 49 private CorePersonnelHistoryService corePersonnelHistoryService;
60 - @Resource  
61 - private CorePersonnelService corePersonnelService;  
62 50
63 /** 51 /**
64 * 查询列表 52 * 查询列表
@@ -87,7 +75,7 @@ public class CustomerCreditHistoryController extends DefaultBaseController { @@ -87,7 +75,7 @@ public class CustomerCreditHistoryController extends DefaultBaseController {
87 @HasPermission({"customerCreditHistory:customercredithistory:query"}) 75 @HasPermission({"customerCreditHistory:customercredithistory:query"})
88 @GetMapping("/customerCreditHistoryList") 76 @GetMapping("/customerCreditHistoryList")
89 public InvokeResult<List<GetCustomerCreditHistoryBo>> customerCreditHistoryList(@Valid QueryCustomerCreditHistoryVo vo) { 77 public InvokeResult<List<GetCustomerCreditHistoryBo>> customerCreditHistoryList(@Valid QueryCustomerCreditHistoryVo vo) {
90 - 78 + vo.setType("PART");
91 List<CustomerCreditHistory> query = customerCreditHistoryService.query(vo); 79 List<CustomerCreditHistory> query = customerCreditHistoryService.query(vo);
92 80
93 List<GetCustomerCreditHistoryBo> results = null; 81 List<GetCustomerCreditHistoryBo> results = null;
@@ -122,22 +110,11 @@ public class CustomerCreditHistoryController extends DefaultBaseController { @@ -122,22 +110,11 @@ public class CustomerCreditHistoryController extends DefaultBaseController {
122 if (data == null) { 110 if (data == null) {
123 throw new DefaultClientException("客户资信历史记录表不存在!"); 111 throw new DefaultClientException("客户资信历史记录表不存在!");
124 } 112 }
125 - //客户资信ID  
126 - String creditId = data.getCreditId();  
127 - QueryCustomerCreditHistoryVo vo = new QueryCustomerCreditHistoryVo();  
128 - vo.setCreditId(creditId);  
129 - List<CustomerCreditHistory> query = customerCreditHistoryService.query(vo);  
130 - Map<String, CustomerCreditHistory> map = query.stream()  
131 - .filter(item -> item.getSort() != null)  
132 - .collect(Collectors.toMap(  
133 - CustomerCreditHistory::getSort,  
134 - item -> item,  
135 - (a, b) -> a // 保留第一个,去重  
136 - ));  
137 - //第几次变更  
138 - int sort = Integer.parseInt(data.getSort());  
139 - //变更次数  
140 - int size = query.size(); 113 + CustomerCreditHistory customerCreditHistory = customerCreditHistoryService.findById(id + "_01");
  114 + if (customerCreditHistory == null) {
  115 + throw new DefaultClientException("客户资信历史记录表不存在!");
  116 + }
  117 +
141 List<ChangeItem> differencesWithIndex; 118 List<ChangeItem> differencesWithIndex;
142 //核心人员变更前 119 //核心人员变更前
143 List<CorePersonnelHistory> personnelBeforeChangeList; 120 List<CorePersonnelHistory> personnelBeforeChangeList;
@@ -145,54 +122,24 @@ public class CustomerCreditHistoryController extends DefaultBaseController { @@ -145,54 +122,24 @@ public class CustomerCreditHistoryController extends DefaultBaseController {
145 List<CorePersonnelHistory> personnelAfterChangeList; 122 List<CorePersonnelHistory> personnelAfterChangeList;
146 123
147 ChangeData result = new ChangeData(); 124 ChangeData result = new ChangeData();
148 - if (sort + 1 <= size) {  
149 - //data与customerCreditHistory的比较,其中data与为变更前,customerCreditHistory为变更后  
150 - CustomerCreditHistory customerCreditHistory = map.get(String.valueOf(sort + 1));  
151 - differencesWithIndex = customerCreditHistoryService.getDifferencesWithIndex(data, customerCreditHistory);  
152 - //核心人员变更前  
153 - String idBefore = data.getId();  
154 - QueryCorePersonnelHistoryVo corePersonnelHistoryVo = new QueryCorePersonnelHistoryVo();  
155 - corePersonnelHistoryVo.setCreditHistoryId(idBefore);  
156 - personnelBeforeChangeList = corePersonnelHistoryService.query(corePersonnelHistoryVo);  
157 -  
158 - //核心人员变更后  
159 - String idAfter = customerCreditHistory.getId();  
160 - QueryCorePersonnelHistoryVo corePersonnelHistoryVo1 = new QueryCorePersonnelHistoryVo();  
161 - corePersonnelHistoryVo1.setCreditHistoryId(idAfter);  
162 - personnelAfterChangeList = corePersonnelHistoryService.query(corePersonnelHistoryVo1);  
163 -  
164 - //添加变更记录  
165 - corePersonnelHistoryService.updateWithChangeInfo(personnelBeforeChangeList, personnelAfterChangeList);  
166 - result.setPersonnelBeforeChangeList(personnelBeforeChangeList);  
167 - result.setPersonnelAfterChangeList(personnelAfterChangeList);  
168 - } else {  
169 - //现在的数据与这data相对比,其中data为变更前,customerCredit为变更后  
170 - CustomerCredit customerCredit = customerCreditService.findById(creditId);  
171 - CustomerCreditHistory customerCreditHistory = customerCreditHistoryService.changeCustomerCredit(customerCredit);  
172 - differencesWithIndex = customerCreditHistoryService.getDifferencesWithIndex(data, customerCreditHistory);  
173 - //核心人员变更前  
174 - String idBefore = data.getId();  
175 - QueryCorePersonnelHistoryVo corePersonnelHistoryVo = new QueryCorePersonnelHistoryVo();  
176 - corePersonnelHistoryVo.setCreditHistoryId(idBefore);  
177 - personnelBeforeChangeList = corePersonnelHistoryService.query(corePersonnelHistoryVo);  
178 -  
179 - //核心人员变更后  
180 - String idAfter = customerCredit.getId();  
181 - QueryCorePersonnelVo queryCorePersonnelVo = new QueryCorePersonnelVo();  
182 - queryCorePersonnelVo.setCreditId(idAfter);  
183 - List<CorePersonnel> query1 = corePersonnelService.query(queryCorePersonnelVo);  
184 - List<CorePersonnelHistory> query2 = new ArrayList<>();  
185 - if (query1 != null) {  
186 - for (CorePersonnel corePersonnel : query1) {  
187 - CorePersonnelHistory corePersonnelHistory = corePersonnelHistoryService.changeCorePersonnel(corePersonnel);  
188 - query2.add(corePersonnelHistory);  
189 - }  
190 - }  
191 - //添加变更记录  
192 - corePersonnelHistoryService.updateWithChangeInfo(personnelBeforeChangeList, query2);  
193 - result.setPersonnelBeforeChangeList(personnelBeforeChangeList);  
194 - result.setPersonnelAfterChangeList(query2);  
195 - } 125 + //data与customerCreditHistory的比较,其中data与为变更前,customerCreditHistory为变更后
  126 + differencesWithIndex = customerCreditHistoryService.getDifferencesWithIndex(data, customerCreditHistory);
  127 + //核心人员变更前
  128 + String idBefore = data.getId();
  129 + QueryCorePersonnelHistoryVo corePersonnelHistoryVo = new QueryCorePersonnelHistoryVo();
  130 + corePersonnelHistoryVo.setCreditHistoryId(idBefore);
  131 + personnelBeforeChangeList = corePersonnelHistoryService.query(corePersonnelHistoryVo);
  132 +
  133 + //核心人员变更后
  134 + String idAfter = customerCreditHistory.getId();
  135 + QueryCorePersonnelHistoryVo corePersonnelHistoryVo1 = new QueryCorePersonnelHistoryVo();
  136 + corePersonnelHistoryVo1.setCreditHistoryId(idAfter);
  137 + personnelAfterChangeList = corePersonnelHistoryService.query(corePersonnelHistoryVo1);
  138 +
  139 + //添加变更记录
  140 + corePersonnelHistoryService.updateWithChangeInfo(personnelBeforeChangeList, personnelAfterChangeList);
  141 + result.setPersonnelBeforeChangeList(personnelBeforeChangeList);
  142 + result.setPersonnelAfterChangeList(personnelAfterChangeList);
196 143
197 result.setOtherChangeList(differencesWithIndex); 144 result.setOtherChangeList(differencesWithIndex);
198 145
@@ -59,6 +59,7 @@ public class CustomerCreditHistoryServiceImpl extends BaseMpServiceImpl<Customer @@ -59,6 +59,7 @@ public class CustomerCreditHistoryServiceImpl extends BaseMpServiceImpl<Customer
59 Assert.greaterThanZero(pageSize); 59 Assert.greaterThanZero(pageSize);
60 60
61 PageHelperUtil.startPage(pageIndex, pageSize); 61 PageHelperUtil.startPage(pageIndex, pageSize);
  62 + vo.setType("PART");
62 List<CustomerCreditHistory> datas = this.query(vo); 63 List<CustomerCreditHistory> datas = this.query(vo);
63 64
64 return PageResultUtil.convert(new PageInfo<>(datas)); 65 return PageResultUtil.convert(new PageInfo<>(datas));
@@ -83,7 +84,11 @@ public class CustomerCreditHistoryServiceImpl extends BaseMpServiceImpl<Customer @@ -83,7 +84,11 @@ public class CustomerCreditHistoryServiceImpl extends BaseMpServiceImpl<Customer
83 public String create(CreateCustomerCreditHistoryVo vo) { 84 public String create(CreateCustomerCreditHistoryVo vo) {
84 85
85 CustomerCreditHistory data = new CustomerCreditHistory(); 86 CustomerCreditHistory data = new CustomerCreditHistory();
86 - data.setId(IdUtil.getId()); 87 + if (StringUtil.isBlank(vo.getId())) {
  88 + data.setId(IdUtil.getId());
  89 + } else {
  90 + data.setId(vo.getId());
  91 + }
87 data.setCreditId(vo.getCreditId()); 92 data.setCreditId(vo.getCreditId());
88 data.setSort(vo.getSort()); 93 data.setSort(vo.getSort());
89 data.setSerialNumber(vo.getSerialNumber()); 94 data.setSerialNumber(vo.getSerialNumber());
@@ -291,18 +291,22 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM @@ -291,18 +291,22 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM
291 QueryCorePersonnelVo queryCorePersonnelVo = new QueryCorePersonnelVo(); 291 QueryCorePersonnelVo queryCorePersonnelVo = new QueryCorePersonnelVo();
292 queryCorePersonnelVo.setCreditId(data.getId()); 292 queryCorePersonnelVo.setCreditId(data.getId());
293 List<CorePersonnel> corePersonnelList = corePersonnelService.query(queryCorePersonnelVo); 293 List<CorePersonnel> corePersonnelList = corePersonnelService.query(queryCorePersonnelVo);
  294 + String historyId = null;
  295 + String sort = "1";
294 if ("CHANGE".equals(type)) { 296 if ("CHANGE".equals(type)) {
295 CreateCustomerCreditHistoryVo historyVo = new CreateCustomerCreditHistoryVo(); 297 CreateCustomerCreditHistoryVo historyVo = new CreateCustomerCreditHistoryVo();
296 historyVo.setCreditId(data.getId()); 298 historyVo.setCreditId(data.getId());
297 //第几次变更序号 299 //第几次变更序号
298 QueryCustomerCreditHistoryVo queryCustomerCreditHistoryVo = new QueryCustomerCreditHistoryVo(); 300 QueryCustomerCreditHistoryVo queryCustomerCreditHistoryVo = new QueryCustomerCreditHistoryVo();
299 queryCustomerCreditHistoryVo.setCreditId(data.getId()); 301 queryCustomerCreditHistoryVo.setCreditId(data.getId());
  302 + queryCustomerCreditHistoryVo.setType("PART");
300 List<CustomerCreditHistory> query = customerCreditHistoryService.query(queryCustomerCreditHistoryVo); 303 List<CustomerCreditHistory> query = customerCreditHistoryService.query(queryCustomerCreditHistoryVo);
301 if (CollectionUtils.isEmpty(query)) { 304 if (CollectionUtils.isEmpty(query)) {
302 historyVo.setSort("1"); 305 historyVo.setSort("1");
303 } else { 306 } else {
304 int i = query.size() + 1; 307 int i = query.size() + 1;
305 historyVo.setSort(String.valueOf(i)); 308 historyVo.setSort(String.valueOf(i));
  309 + sort = String.valueOf(i);
306 } 310 }
307 historyVo.setSerialNumber(data.getSerialNumber()); 311 historyVo.setSerialNumber(data.getSerialNumber());
308 if (!StringUtil.isBlank(data.getRegion())) { 312 if (!StringUtil.isBlank(data.getRegion())) {
@@ -458,7 +462,7 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM @@ -458,7 +462,7 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM
458 if (!StringUtil.isBlank(data.getCertificationCertificate())) { 462 if (!StringUtil.isBlank(data.getCertificationCertificate())) {
459 historyVo.setCertificationCertificate(data.getCertificationCertificate()); 463 historyVo.setCertificationCertificate(data.getCertificationCertificate());
460 } 464 }
461 - String historyId = customerCreditHistoryService.create(historyVo); 465 + historyId = customerCreditHistoryService.create(historyVo);
462 if (CollectionUtils.isNotEmpty(corePersonnelList)) { 466 if (CollectionUtils.isNotEmpty(corePersonnelList)) {
463 for (CorePersonnel corePersonnel : corePersonnelList) { 467 for (CorePersonnel corePersonnel : corePersonnelList) {
464 CreateCorePersonnelHistoryVo personnelHistoryVo = new CreateCorePersonnelHistoryVo(); 468 CreateCorePersonnelHistoryVo personnelHistoryVo = new CreateCorePersonnelHistoryVo();
@@ -633,6 +637,210 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM @@ -633,6 +637,210 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM
633 } 637 }
634 } 638 }
635 } 639 }
  640 + //
  641 + //再保存一次变更后的数据
  642 + if ("CHANGE".equals(type)) {
  643 + CustomerCredit customerCredit = customerCreditMapper.findById(vo.getId());
  644 + CreateCustomerCreditHistoryVo historyVo1 = new CreateCustomerCreditHistoryVo();
  645 + historyVo1.setId(historyId + "_01");
  646 + historyVo1.setCreditId(data.getId());
  647 + historyVo1.setSort(sort);
  648 + historyVo1.setSerialNumber(data.getSerialNumber());
  649 + if (!StringUtil.isBlank(customerCredit.getRegion())) {
  650 + historyVo1.setRegion(customerCredit.getRegion());
  651 + }
  652 + if (customerCredit.getRegisterDate() != null) {
  653 + historyVo1.setRegisterDate(customerCredit.getRegisterDate());
  654 + }
  655 + if (!StringUtil.isBlank(customerCredit.getCustomerShortName())) {
  656 + historyVo1.setCustomerShortName(customerCredit.getCustomerShortName());
  657 + }
  658 + if (!StringUtil.isBlank(customerCredit.getEnterpriseType())) {
  659 + historyVo1.setEnterpriseType(customerCredit.getEnterpriseType());
  660 + }
  661 + if (!StringUtil.isBlank(customerCredit.getCompanyId())) {
  662 + historyVo1.setCompanyId(customerCredit.getCompanyId());
  663 + }
  664 + if (!StringUtil.isBlank(customerCredit.getCompanyNature())) {
  665 + historyVo1.setCompanyNature(customerCredit.getCompanyNature());
  666 + }
  667 + if (!StringUtil.isBlank(customerCredit.getCompanyAddress())) {
  668 + historyVo1.setCompanyAddress(customerCredit.getCompanyAddress());
  669 + }
  670 + if (customerCredit.getRegisteredCapital() != null) {
  671 + historyVo1.setRegisteredCapital(customerCredit.getRegisteredCapital());
  672 + }
  673 + if (!StringUtil.isBlank(customerCredit.getBankAccount())) {
  674 + historyVo1.setBankAccount(customerCredit.getBankAccount());
  675 + }
  676 + if (!StringUtil.isBlank(customerCredit.getBankName())) {
  677 + historyVo1.setBankName(customerCredit.getBankName());
  678 + }
  679 + if (!StringUtil.isBlank(customerCredit.getTaxNumber())) {
  680 + historyVo1.setTaxNumber(customerCredit.getTaxNumber());
  681 + }
  682 + if (customerCredit.getRegistrationTime() != null) {
  683 + historyVo1.setRegistrationTime(customerCredit.getRegistrationTime());
  684 + }
  685 + if (!StringUtil.isBlank(customerCredit.getBusinessYears())) {
  686 + historyVo1.setBusinessYears(customerCredit.getBusinessYears());
  687 + }
  688 + if (!StringUtil.isBlank(customerCredit.getBusinessScope())) {
  689 + historyVo1.setBusinessScope(customerCredit.getBusinessScope());
  690 + }
  691 + if (!StringUtil.isBlank(customerCredit.getBusinessProperty())) {
  692 + historyVo1.setBusinessProperty(customerCredit.getBusinessProperty());
  693 + }
  694 + if (!StringUtil.isBlank(customerCredit.getLandArea())) {
  695 + historyVo1.setLandArea(customerCredit.getLandArea());
  696 + }
  697 + if (!StringUtil.isBlank(customerCredit.getStorageConditions())) {
  698 + historyVo1.setStorageConditions(customerCredit.getStorageConditions());
  699 + }
  700 + if (customerCredit.getEmployeeCount() != null) {
  701 + historyVo1.setEmployeeCount(customerCredit.getEmployeeCount());
  702 + }
  703 + if (!StringUtil.isBlank(customerCredit.getEquipmentAttributes())) {
  704 + historyVo1.setEquipmentAttributes(customerCredit.getEquipmentAttributes());
  705 + }
  706 + if (!StringUtil.isBlank(customerCredit.getAssetEvaluation())) {
  707 + historyVo1.setAssetEvaluation(customerCredit.getAssetEvaluation());
  708 + }
  709 + if (!StringUtil.isBlank(customerCredit.getLastYearSales())) {
  710 + historyVo1.setLastYearSales(customerCredit.getLastYearSales());
  711 + }
  712 + if (!StringUtil.isBlank(customerCredit.getMonthlyAvgSales())) {
  713 + historyVo1.setMonthlyAvgSales(customerCredit.getMonthlyAvgSales());
  714 + }
  715 + if (!StringUtil.isBlank(customerCredit.getInvoiceItemUnit())) {
  716 + historyVo1.setInvoiceItemUnit(customerCredit.getInvoiceItemUnit());
  717 + }
  718 + if (!StringUtil.isBlank(customerCredit.getProductMatch())) {
  719 + historyVo1.setProductMatch(customerCredit.getProductMatch());
  720 + }
  721 + if (!StringUtil.isBlank(customerCredit.getMajorCustomers())) {
  722 + historyVo1.setMajorCustomers(customerCredit.getMajorCustomers());
  723 + }
  724 + if (!StringUtil.isBlank(customerCredit.getMainProjects())) {
  725 + historyVo1.setMainProjects(customerCredit.getMainProjects());
  726 + }
  727 + if (!StringUtil.isBlank(customerCredit.getIndustryInvolved())) {
  728 + historyVo1.setIndustryInvolved(customerCredit.getIndustryInvolved());
  729 + }
  730 + if (!StringUtil.isBlank(customerCredit.getIndustryExperience())) {
  731 + historyVo1.setIndustryExperience(customerCredit.getIndustryExperience());
  732 + }
  733 + if (!StringUtil.isBlank(customerCredit.getHasDispute())) {
  734 + historyVo1.setHasDispute(customerCredit.getHasDispute());
  735 + }
  736 + if (!StringUtil.isBlank(customerCredit.getCooperationStartDate())) {
  737 + historyVo1.setCooperationStartDate(customerCredit.getCooperationStartDate());
  738 + }
  739 + if (!StringUtil.isBlank(customerCredit.getMonthlyAvgVolume())) {
  740 + historyVo1.setMonthlyAvgVolume(customerCredit.getMonthlyAvgVolume());
  741 + }
  742 + if (!StringUtil.isBlank(customerCredit.getIsVerbalAgreement())) {
  743 + historyVo1.setIsVerbalAgreement(customerCredit.getIsVerbalAgreement());
  744 + }
  745 + if (!StringUtil.isBlank(customerCredit.getOtherAgreements())) {
  746 + historyVo1.setOtherAgreements(customerCredit.getOtherAgreements());
  747 + }
  748 + if (!StringUtil.isBlank(customerCredit.getHasLongTermContract())) {
  749 + historyVo1.setHasLongTermContract(customerCredit.getHasLongTermContract());
  750 + }
  751 + if (!StringUtil.isBlank(customerCredit.getContractType())) {
  752 + historyVo1.setContractType(customerCredit.getContractType());
  753 + }
  754 + if (!StringUtil.isBlank(customerCredit.getHasInterruption())) {
  755 + historyVo1.setHasInterruption(customerCredit.getHasInterruption());
  756 + }
  757 + if (!StringUtil.isBlank(customerCredit.getSettlementPeriod())) {
  758 + historyVo1.setSettlementPeriod(customerCredit.getSettlementPeriod());
  759 + }
  760 + if (!StringUtil.isBlank(customerCredit.getMaterialSupplyPlan())) {
  761 + historyVo1.setMaterialSupplyPlan(customerCredit.getMaterialSupplyPlan());
  762 + }
  763 + if (!StringUtil.isBlank(customerCredit.getSuggestedCategory())) {
  764 + historyVo1.setSuggestedCategory(customerCredit.getSuggestedCategory());
  765 + }
  766 + if (!StringUtil.isBlank(customerCredit.getCreditLimit())) {
  767 + historyVo1.setCreditLimit(customerCredit.getCreditLimit());
  768 + }
  769 + if (!StringUtil.isBlank(customerCredit.getInvestigator())) {
  770 + historyVo1.setInvestigator(customerCredit.getInvestigator());
  771 + }
  772 + if (!StringUtil.isBlank(customerCredit.getSupervisorReview())) {
  773 + historyVo1.setSupervisorReview(customerCredit.getSupervisorReview());
  774 + }
  775 + if (!StringUtil.isBlank(customerCredit.getAnnualTotalSales())) {
  776 + historyVo1.setAnnualTotalSales(customerCredit.getAnnualTotalSales());
  777 + }
  778 + if (!StringUtil.isBlank(customerCredit.getMainIndustry())) {
  779 + historyVo1.setMainIndustry(customerCredit.getMainIndustry());
  780 + }
  781 + if (!StringUtil.isBlank(customerCredit.getAnnualMaterialOverview())) {
  782 + historyVo1.setAnnualMaterialOverview(customerCredit.getAnnualMaterialOverview());
  783 + }
  784 + if (!StringUtil.isBlank(customerCredit.getCompanySettlementPeriod())) {
  785 + historyVo1.setCompanySettlementPeriod(customerCredit.getCompanySettlementPeriod());
  786 + }
  787 + if (!StringUtil.isBlank(customerCredit.getCompanyCreditLimit())) {
  788 + historyVo1.setCompanyCreditLimit(customerCredit.getCompanyCreditLimit());
  789 + }
  790 + if (!StringUtil.isBlank(customerCredit.getCompanyMaterialSupplyPlan())) {
  791 + historyVo1.setCompanyMaterialSupplyPlan(customerCredit.getCompanyMaterialSupplyPlan());
  792 + }
  793 + if (!StringUtil.isBlank(customerCredit.getCompanySuggestedCategory())) {
  794 + historyVo1.setCompanySuggestedCategory(customerCredit.getCompanySuggestedCategory());
  795 + }
  796 + if (!StringUtil.isBlank(customerCredit.getStatus())) {
  797 + historyVo1.setStatus(customerCredit.getStatus());
  798 + }
  799 + if (!StringUtil.isBlank(customerCredit.getCertificationCertificate())) {
  800 + historyVo1.setCertificationCertificate(customerCredit.getCertificationCertificate());
  801 + }
  802 + String historyId1 = customerCreditHistoryService.create(historyVo1);
  803 + //变更后的核心人员
  804 + QueryCorePersonnelVo queryCorePersonnelVo1 = new QueryCorePersonnelVo();
  805 + queryCorePersonnelVo1.setCreditId(data.getId());
  806 + List<CorePersonnel> corePersonnelList1 = corePersonnelService.query(queryCorePersonnelVo1);
  807 + if (CollectionUtils.isNotEmpty(corePersonnelList1)) {
  808 + for (CorePersonnel corePersonnel : corePersonnelList1) {
  809 + CreateCorePersonnelHistoryVo personnelHistoryVo = new CreateCorePersonnelHistoryVo();
  810 + personnelHistoryVo.setPersonnelId(corePersonnel.getId());
  811 + personnelHistoryVo.setCreditHistoryId(historyId1);
  812 + personnelHistoryVo.setName(corePersonnel.getName());
  813 + if (!StringUtil.isBlank(corePersonnel.getSex())) {
  814 + personnelHistoryVo.setSex(corePersonnel.getSex());
  815 + }
  816 + if (!StringUtil.isBlank(corePersonnel.getNativePlace())) {
  817 + personnelHistoryVo.setNativePlace(corePersonnel.getNativePlace());
  818 + }
  819 + if (!StringUtil.isBlank(corePersonnel.getAge())) {
  820 + personnelHistoryVo.setAge(corePersonnel.getAge());
  821 + }
  822 + if (!StringUtil.isBlank(corePersonnel.getPosition())) {
  823 + personnelHistoryVo.setPosition(corePersonnel.getPosition());
  824 + }
  825 + if (!StringUtil.isBlank(corePersonnel.getMobile())) {
  826 + personnelHistoryVo.setMobile(corePersonnel.getMobile());
  827 + }
  828 + if (!StringUtil.isBlank(corePersonnel.getPhone())) {
  829 + personnelHistoryVo.setPhone(corePersonnel.getPhone());
  830 + }
  831 + if (!StringUtil.isBlank(corePersonnel.getEmail())) {
  832 + personnelHistoryVo.setEmail(corePersonnel.getEmail());
  833 + }
  834 + if (!StringUtil.isBlank(corePersonnel.getAddress())) {
  835 + personnelHistoryVo.setAddress(corePersonnel.getAddress());
  836 + }
  837 + if (!StringUtil.isBlank(corePersonnel.getPersonId())) {
  838 + personnelHistoryVo.setPersonId(corePersonnel.getPersonId());
  839 + }
  840 + corePersonnelHistoryService.create(personnelHistoryVo);
  841 + }
  842 + }
  843 + }
636 OpLogUtil.setVariable("id", data.getId()); 844 OpLogUtil.setVariable("id", data.getId());
637 OpLogUtil.setExtra(vo); 845 OpLogUtil.setExtra(vo);
638 846
@@ -16,6 +16,13 @@ public class CreateCustomerCreditHistoryVo implements BaseVo, Serializable { @@ -16,6 +16,13 @@ public class CreateCustomerCreditHistoryVo implements BaseVo, Serializable {
16 private static final long serialVersionUID = 1L; 16 private static final long serialVersionUID = 1L;
17 17
18 /** 18 /**
  19 + * ID
  20 + */
  21 + @ApiModelProperty(value = "ID")
  22 + @Length(message = "ID最多允许50个字符!")
  23 + private String Id;
  24 +
  25 + /**
19 * 客户资信ID 26 * 客户资信ID
20 */ 27 */
21 @ApiModelProperty(value = "客户资信ID", required = true) 28 @ApiModelProperty(value = "客户资信ID", required = true)
@@ -29,4 +29,10 @@ public class QueryCustomerCreditHistoryVo extends PageVo implements BaseVo, Seri @@ -29,4 +29,10 @@ public class QueryCustomerCreditHistoryVo extends PageVo implements BaseVo, Seri
29 @ApiModelProperty("编号") 29 @ApiModelProperty("编号")
30 private String serialNumber; 30 private String serialNumber;
31 31
  32 + /**
  33 + * 查询类型 部分(PART)
  34 + */
  35 + @ApiModelProperty("查询类型")
  36 + private String type;
  37 +
32 } 38 }
@@ -144,6 +144,9 @@ @@ -144,6 +144,9 @@
144 <if test="vo.serialNumber != null and vo.serialNumber != ''"> 144 <if test="vo.serialNumber != null and vo.serialNumber != ''">
145 AND tb.serial_number = #{vo.serialNumber} 145 AND tb.serial_number = #{vo.serialNumber}
146 </if> 146 </if>
  147 + <if test="vo.type != null and vo.type != '' and vo.type=='PART'">
  148 + AND tb.id NOT LIKE '%\_01'
  149 + </if>
147 </where> 150 </where>
148 </select> 151 </select>
149 </mapper> 152 </mapper>