Commit 666c0a96826533ae7147d649e7a21740667dfaf6

Authored by 房远帅
1 parent 009a3b86

楚江ERP:客户资信关联字段完善

... ... @@ -299,12 +299,24 @@ public class GetCustomerCreditBo extends BaseBo<CustomerCredit> {
299 299 private String investigator;
300 300
301 301 /**
  302 + * 调查人名称(非持久化字段)
  303 + */
  304 + @ApiModelProperty("调查人名称")
  305 + private String investigatorName;
  306 +
  307 + /**
302 308 * 主管审核
303 309 */
304 310 @ApiModelProperty("主管审核")
305 311 private String supervisorReview;
306 312
307 313 /**
  314 + * 主管审核名称(非持久化字段)
  315 + */
  316 + @ApiModelProperty("主管审核名称")
  317 + private String supervisorReviewName;
  318 +
  319 + /**
308 320 * 年度总销量(万元)
309 321 */
310 322 @ApiModelProperty("年度总销量(万元)")
... ...
1 1 package com.lframework.xingyun.sc.controller.customer;
2 2
  3 +import com.lframework.starter.common.utils.StringUtil;
3 4 import com.lframework.starter.web.core.annotations.security.HasPermission;
4 5 import com.lframework.starter.web.core.controller.DefaultBaseController;
5 6 import com.lframework.starter.web.inner.bo.system.user.QuerySysUserBo;
6 7 import com.lframework.starter.web.inner.entity.SysUser;
  8 +import com.lframework.starter.web.inner.service.system.SysUserService;
7 9 import com.lframework.xingyun.basedata.service.customer.CustomerService;
8 10 import com.lframework.xingyun.sc.bo.customer.credit.GetCustomerCreditBo;
9 11 import com.lframework.xingyun.sc.entity.CorePersonnel;
... ... @@ -49,6 +51,8 @@ public class CustomerCreditController extends DefaultBaseController {
49 51 private CustomerService customerService;
50 52 @Resource
51 53 private CorePersonnelService corePersonnelService;
  54 + @Resource
  55 + private SysUserService sysUserService;
52 56
53 57 /**
54 58 * 查询列表
... ... @@ -179,6 +183,16 @@ public class CustomerCreditController extends DefaultBaseController {
179 183 vo.setCreditId(credit.getId());
180 184 List<CorePersonnel> corePersonnel = corePersonnelService.query(vo);
181 185 data.setCorePersonnelList(corePersonnel);
  186 + //调查人
  187 + if (StringUtil.isNotEmpty(credit.getInvestigator())) {
  188 + SysUser sysUser = sysUserService.findById(credit.getInvestigator());
  189 + data.setInvestigatorName(sysUser.getName());
  190 + }
  191 + //主管审核
  192 + if (StringUtil.isNotEmpty(credit.getSupervisorReview())) {
  193 + SysUser sysUser = sysUserService.findById(credit.getSupervisorReview());
  194 + data.setSupervisorReviewName(sysUser.getName());
  195 + }
182 196 return data;
183 197 }
184 198 }
... ...
... ... @@ -12,6 +12,8 @@ import com.lframework.starter.web.core.components.resp.PageResult;
12 12 import com.lframework.starter.common.utils.StringUtil;
13 13 import java.io.Serializable;
14 14 import com.lframework.starter.common.utils.Assert;
  15 +import com.lframework.starter.web.inner.entity.SysUser;
  16 +import com.lframework.starter.web.inner.service.system.SysUserService;
15 17 import com.lframework.xingyun.basedata.entity.Customer;
16 18 import com.lframework.xingyun.basedata.service.customer.CustomerService;
17 19 import com.lframework.xingyun.sc.Label;
... ... @@ -39,6 +41,8 @@ public class CustomerCreditHistoryServiceImpl extends BaseMpServiceImpl<Customer
39 41
40 42 @Resource
41 43 private CustomerService customerService;
  44 + @Resource
  45 + private SysUserService sysUserService;
42 46 // 定义不需要比较的字段
43 47 private static final Set<String> EXCLUDED_FIELDS = new HashSet<>(Arrays.asList(
44 48 "id", "sort", "createById", "createBy", "updateById",
... ... @@ -287,6 +291,39 @@ public class CustomerCreditHistoryServiceImpl extends BaseMpServiceImpl<Customer
287 291 Object value2 = field.get(customerCreditHistory);
288 292
289 293 if (!Objects.equals(value1, value2)) {
  294 + //单位名称
  295 + if ("companyId".equals(fieldName)) {
  296 + if (StringUtil.isNotEmpty(data.getCompanyId())) {
  297 + Customer customer1 = customerService.findById(data.getCompanyId());
  298 + value1 = customer1.getName();
  299 + }
  300 + if (StringUtil.isNotEmpty(customerCreditHistory.getCompanyId())) {
  301 + Customer customer2 = customerService.findById(customerCreditHistory.getCompanyId());
  302 + value2 = customer2.getName();
  303 + }
  304 + }
  305 + //调查人
  306 + if ("investigator".equals(fieldName)) {
  307 + if (StringUtil.isNotEmpty(data.getInvestigator())) {
  308 + SysUser sysUser1 = sysUserService.findById(data.getInvestigator());
  309 + value1 = sysUser1.getName();
  310 + }
  311 + if (StringUtil.isNotEmpty(customerCreditHistory.getInvestigator())) {
  312 + SysUser sysUser2 = sysUserService.findById(customerCreditHistory.getInvestigator());
  313 + value2 = sysUser2.getName();
  314 + }
  315 + }
  316 + //主管审核
  317 + if ("supervisorReview".equals(fieldName)) {
  318 + if (StringUtil.isNotEmpty(data.getSupervisorReview())) {
  319 + SysUser sysUser1 = sysUserService.findById(data.getSupervisorReview());
  320 + value1 = sysUser1.getName();
  321 + }
  322 + if (StringUtil.isNotEmpty(customerCreditHistory.getSupervisorReview())) {
  323 + SysUser sysUser2 = sysUserService.findById(customerCreditHistory.getSupervisorReview());
  324 + value2 = sysUser2.getName();
  325 + }
  326 + }
290 327 // 获取中文标签,优先使用 @Label,否则用字段名
291 328 String label = getLabel(field);
292 329
... ...