Commit b982a247ff05eab7282d48c4d593da467e2f2eef

Authored by 房远帅
1 parent 8d49ee90

楚江ERP:客户资信基础方法构建

Showing 21 changed files with 3284 additions and 0 deletions
... ... @@ -22,5 +22,10 @@
22 22 <groupId>com.lframework</groupId>
23 23 <artifactId>xingyun-basedata</artifactId>
24 24 </dependency>
  25 + <dependency>
  26 + <groupId>com.belerweb</groupId>
  27 + <artifactId>pinyin4j</artifactId>
  28 + <version>2.5.1</version>
  29 + </dependency>
25 30 </dependencies>
26 31 </project>
... ...
  1 +package com.lframework.xingyun.sc.bo.customer.credit;
  2 +
  3 +import com.lframework.starter.web.core.bo.BaseBo;
  4 +import com.lframework.xingyun.sc.entity.CorePersonnel;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +
  7 +import lombok.Data;
  8 +
  9 +/**
  10 + * <p>
  11 + * 核心人员表 GetBo
  12 + * </p>
  13 + *
  14 + */
  15 +@Data
  16 +public class GetCorePersonnelBo extends BaseBo<CorePersonnel> {
  17 +
  18 + /**
  19 + * ID
  20 + */
  21 + @ApiModelProperty("ID")
  22 + private String id;
  23 +
  24 + /**
  25 + * 姓名
  26 + */
  27 + @ApiModelProperty("姓名")
  28 + private String name;
  29 +
  30 + /**
  31 + * 性别
  32 + */
  33 + @ApiModelProperty("性别")
  34 + private String sex;
  35 +
  36 + /**
  37 + * 籍贯
  38 + */
  39 + @ApiModelProperty("籍贯")
  40 + private String nativePlace;
  41 +
  42 + /**
  43 + * 年龄
  44 + */
  45 + @ApiModelProperty("年龄")
  46 + private String age;
  47 +
  48 + /**
  49 + * 职务
  50 + */
  51 + @ApiModelProperty("职务")
  52 + private String position;
  53 +
  54 + /**
  55 + * 手机
  56 + */
  57 + @ApiModelProperty("手机")
  58 + private String mobile;
  59 +
  60 + /**
  61 + * 固定电话
  62 + */
  63 + @ApiModelProperty("固定电话")
  64 + private String phone;
  65 +
  66 + /**
  67 + * 邮箱地址
  68 + */
  69 + @ApiModelProperty("邮箱地址")
  70 + private String email;
  71 +
  72 + /**
  73 + * 现住址
  74 + */
  75 + @ApiModelProperty("现住址")
  76 + private String address;
  77 +
  78 + public GetCorePersonnelBo() {
  79 +
  80 + }
  81 +
  82 + public GetCorePersonnelBo(CorePersonnel dto) {
  83 +
  84 + super(dto);
  85 + }
  86 +
  87 + @Override
  88 + public BaseBo<CorePersonnel> convert(CorePersonnel dto) {
  89 + return super.convert(dto);
  90 + }
  91 +
  92 + @Override
  93 + protected void afterInit(CorePersonnel dto) {
  94 +
  95 + }
  96 +}
... ...
  1 +package com.lframework.xingyun.sc.bo.customer.credit;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.lframework.xingyun.basedata.entity.Customer;
  5 +import com.lframework.xingyun.sc.entity.CorePersonnel;
  6 +import com.lframework.xingyun.sc.entity.CustomerCredit;
  7 +import java.math.BigDecimal;
  8 +import com.lframework.starter.common.constants.StringPool;
  9 +import com.lframework.starter.web.core.bo.BaseBo;
  10 +import java.time.LocalDateTime;
  11 +import java.util.List;
  12 +
  13 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  14 +import io.swagger.annotations.ApiModelProperty;
  15 +
  16 +import lombok.Data;
  17 +
  18 +/**
  19 + * <p>
  20 + * 客户资信表 GetBo
  21 + * </p>
  22 + *
  23 + */
  24 +@Data
  25 +public class GetCustomerCreditBo extends BaseBo<CustomerCredit> {
  26 +
  27 + /**
  28 + * ID
  29 + */
  30 + @ApiModelProperty("ID")
  31 + private String id;
  32 +
  33 + /**
  34 + * 编号
  35 + */
  36 + @ApiModelProperty("编号")
  37 + private String serialNumber;
  38 +
  39 + /**
  40 + * 区域
  41 + */
  42 + @ApiModelProperty("区域")
  43 + private String region;
  44 +
  45 + /**
  46 + * 登记日期
  47 + */
  48 + @ApiModelProperty("登记日期")
  49 + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
  50 + private LocalDateTime registerDate;
  51 +
  52 + /**
  53 + * 客户简称
  54 + */
  55 + @ApiModelProperty("客户简称")
  56 + private String customerShortName;
  57 +
  58 + /**
  59 + * 企业类型:经销商(distributor)、终端(terminal)
  60 + */
  61 + @ApiModelProperty("企业类型:经销商(distributor)、终端(terminal)")
  62 + private String enterpriseType;
  63 +
  64 + /**
  65 + * 单位ID
  66 + */
  67 + @ApiModelProperty("单位ID")
  68 + private String companyId;
  69 +
  70 + /**
  71 + * 单位名称(非持久化字段)
  72 + */
  73 + @ApiModelProperty("单位名称")
  74 + private String companyName;
  75 +
  76 + /**
  77 + * 企业性质
  78 + */
  79 + @ApiModelProperty("企业性质")
  80 + private String companyNature;
  81 +
  82 + /**
  83 + * 单位地址
  84 + */
  85 + @ApiModelProperty("单位地址")
  86 + private String companyAddress;
  87 +
  88 + /**
  89 + * 注册资本(单位:万元)
  90 + */
  91 + @ApiModelProperty("注册资本(单位:万元)")
  92 + private BigDecimal registeredCapital;
  93 +
  94 + /**
  95 + * 账号
  96 + */
  97 + @ApiModelProperty("账号")
  98 + private String bankAccount;
  99 +
  100 + /**
  101 + * 开户行
  102 + */
  103 + @ApiModelProperty("开户行")
  104 + private String bankName;
  105 +
  106 + /**
  107 + * 税号
  108 + */
  109 + @ApiModelProperty("税号")
  110 + private String taxNumber;
  111 +
  112 + /**
  113 + * 注册时间
  114 + */
  115 + @ApiModelProperty("注册时间")
  116 + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
  117 + private LocalDateTime registrationTime;
  118 +
  119 + /**
  120 + * 经营年限(年)
  121 + */
  122 + @ApiModelProperty("经营年限(年)")
  123 + private String businessYears;
  124 +
  125 + /**
  126 + * 经营范围
  127 + */
  128 + @ApiModelProperty("经营范围")
  129 + private String businessScope;
  130 +
  131 + /**
  132 + * 经营场地属性
  133 + */
  134 + @ApiModelProperty("经营场地属性")
  135 + private String businessProperty;
  136 +
  137 + /**
  138 + * 占地面积(平方米)
  139 + */
  140 + @ApiModelProperty("占地面积(平方米)")
  141 + private String landArea;
  142 +
  143 + /**
  144 + * 仓储条件
  145 + */
  146 + @ApiModelProperty("仓储条件")
  147 + private String storageConditions;
  148 +
  149 + /**
  150 + * 员工人数
  151 + */
  152 + @ApiModelProperty("员工人数")
  153 + private Integer employeeCount;
  154 +
  155 + /**
  156 + * 设备属性
  157 + */
  158 + @ApiModelProperty("设备属性")
  159 + private String equipmentAttributes;
  160 +
  161 + /**
  162 + * 资产评估
  163 + */
  164 + @ApiModelProperty("资产评估")
  165 + private String assetEvaluation;
  166 +
  167 + /**
  168 + * 上年度销售额(万元)
  169 + */
  170 + @ApiModelProperty("上年度销售额(万元)")
  171 + private String lastYearSales;
  172 +
  173 + /**
  174 + * 月均销量(万元)
  175 + */
  176 + @ApiModelProperty("月均销量(万元)")
  177 + private String monthlyAvgSales;
  178 +
  179 + /**
  180 + * 销项发票所开品名与计量单位
  181 + */
  182 + @ApiModelProperty("销项发票所开品名与计量单位")
  183 + private String invoiceItemUnit;
  184 +
  185 + /**
  186 + * 认证证书
  187 + */
  188 + @ApiModelProperty("认证证书")
  189 + private String certificationCertificate;
  190 +
  191 + /**
  192 + * 我司售于产品与经营范围是否匹配
  193 + */
  194 + @ApiModelProperty("我司售于产品与经营范围是否匹配")
  195 + private String productMatch;
  196 +
  197 + /**
  198 + * 主要客户
  199 + */
  200 + @ApiModelProperty("主要客户")
  201 + private String majorCustomers;
  202 +
  203 + /**
  204 + * 主营项目
  205 + */
  206 + @ApiModelProperty("主营项目")
  207 + private String mainProjects;
  208 +
  209 + /**
  210 + * 从事行业
  211 + */
  212 + @ApiModelProperty("从事行业")
  213 + private String industryInvolved;
  214 +
  215 + /**
  216 + * 在该行业中的经验
  217 + */
  218 + @ApiModelProperty("在该行业中的经验")
  219 + private String industryExperience;
  220 +
  221 + /**
  222 + * 是否与其他企业有经济纠纷 违规信息 拖欠员工薪资等
  223 + */
  224 + @ApiModelProperty("是否与其他企业有经济纠纷 违规信息 拖欠员工薪资等")
  225 + private String hasDispute;
  226 +
  227 + /**
  228 + * 与我司合作时间
  229 + */
  230 + @ApiModelProperty("与我司合作时间")
  231 + private String cooperationStartDate;
  232 +
  233 + /**
  234 + * 月均操作量
  235 + */
  236 + @ApiModelProperty("月均操作量")
  237 + private String monthlyAvgVolume;
  238 +
  239 + /**
  240 + * 是否口头协议操作
  241 + */
  242 + @ApiModelProperty("是否口头协议操作")
  243 + private String isVerbalAgreement;
  244 +
  245 + /**
  246 + * 是否签订其他协议(列举)
  247 + */
  248 + @ApiModelProperty("是否签订其他协议(列举)")
  249 + private String otherAgreements;
  250 +
  251 + /**
  252 + * 与我司操作是否签订长年合同
  253 + */
  254 + @ApiModelProperty("与我司操作是否签订长年合同")
  255 + private String hasLongTermContract;
  256 +
  257 + /**
  258 + * 合同类型
  259 + */
  260 + @ApiModelProperty("合同类型")
  261 + private String contractType;
  262 +
  263 + /**
  264 + * 是否有过中断及中断原因
  265 + */
  266 + @ApiModelProperty("是否有过中断及中断原因")
  267 + private String hasInterruption;
  268 +
  269 + /**
  270 + * 结算期限
  271 + */
  272 + @ApiModelProperty("结算期限")
  273 + private String settlementPeriod;
  274 +
  275 + /**
  276 + * 加工操作方案
  277 + */
  278 + @ApiModelProperty("加工操作方案")
  279 + private String materialSupplyPlan;
  280 +
  281 + /**
  282 + * 建议客户分类:AAA、AA、A、BBB、BB、B、C、D
  283 + */
  284 + @ApiModelProperty("建议客户分类:AAA、AA、A、BBB、BB、B、C、D")
  285 + private String suggestedCategory;
  286 +
  287 + /**
  288 + * 授信额度(万元)
  289 + */
  290 + @ApiModelProperty("授信额度(万元)")
  291 + private String creditLimit;
  292 +
  293 + /**
  294 + * 调查人
  295 + */
  296 + @ApiModelProperty("调查人")
  297 + private String investigator;
  298 +
  299 + /**
  300 + * 主管审核
  301 + */
  302 + @ApiModelProperty("主管审核")
  303 + private String supervisorReview;
  304 +
  305 + /**
  306 + * 年度总销量(万元)
  307 + */
  308 + @ApiModelProperty("年度总销量(万元)")
  309 + private String annualTotalSales;
  310 +
  311 + /**
  312 + * 主要行业
  313 + */
  314 + @ApiModelProperty("主要行业")
  315 + private String mainIndustry;
  316 +
  317 + /**
  318 + * 年度款料概况
  319 + */
  320 + @ApiModelProperty("年度款料概况")
  321 + private String annualMaterialOverview;
  322 +
  323 + /**
  324 + * 结算期限
  325 + */
  326 + @ApiModelProperty("结算期限")
  327 + private String companySettlementPeriod;
  328 +
  329 + /**
  330 + * 授信额度(万元)
  331 + */
  332 + @ApiModelProperty("授信额度(万元)")
  333 + private String companyCreditLimit;
  334 +
  335 + /**
  336 + * 加工操作方案
  337 + */
  338 + @ApiModelProperty("加工操作方案")
  339 + private String companyMaterialSupplyPlan;
  340 +
  341 + /**
  342 + * 客户分类:AAA、AA、A、BBB、BB、B、C、D
  343 + */
  344 + @ApiModelProperty("客户分类:AAA、AA、A、BBB、BB、B、C、D")
  345 + private String companySuggestedCategory;
  346 +
  347 + /**
  348 + * 创建人
  349 + */
  350 + @ApiModelProperty("创建人")
  351 + private String createBy;
  352 +
  353 + /**
  354 + * 更新人
  355 + */
  356 + @ApiModelProperty("更新人")
  357 + private String updateBy;
  358 +
  359 + /**
  360 + * 审核状态
  361 + */
  362 + @ApiModelProperty("审核状态")
  363 + private String status;
  364 +
  365 + /**
  366 + * 核心人员
  367 + */
  368 + @ApiModelProperty("核心人员")
  369 + private List<CorePersonnel> corePersonnelList;
  370 +
  371 + /**
  372 + * 创建时间
  373 + */
  374 + @ApiModelProperty("创建时间")
  375 + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
  376 + private LocalDateTime createTime;
  377 +
  378 + /**
  379 + * 更新时间
  380 + */
  381 + @ApiModelProperty("更新时间")
  382 + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
  383 + private LocalDateTime updateTime;
  384 +
  385 + public GetCustomerCreditBo() {
  386 +
  387 + }
  388 +
  389 + public GetCustomerCreditBo(CustomerCredit dto) {
  390 +
  391 + super(dto);
  392 + }
  393 +
  394 + @Override
  395 + public BaseBo<CustomerCredit> convert(CustomerCredit dto) {
  396 + return super.convert(dto);
  397 + }
  398 +
  399 + @Override
  400 + protected void afterInit(CustomerCredit dto) {
  401 +
  402 + }
  403 +}
... ...
  1 +package com.lframework.xingyun.sc.controller.customer;
  2 +
  3 +import com.lframework.starter.web.core.annotations.security.HasPermission;
  4 +import com.lframework.starter.web.core.components.resp.PageResult;
  5 +import com.lframework.starter.web.core.controller.DefaultBaseController;
  6 +import com.lframework.starter.web.core.utils.PageResultUtil;
  7 +import com.lframework.starter.web.core.components.resp.InvokeResult;
  8 +import javax.validation.constraints.NotBlank;
  9 +
  10 +import com.lframework.xingyun.sc.bo.customer.credit.GetCorePersonnelBo;
  11 +import com.lframework.xingyun.sc.entity.CorePersonnel;
  12 +import com.lframework.xingyun.sc.service.customer.CorePersonnelService;
  13 +import com.lframework.xingyun.sc.vo.customer.credit.CreateCorePersonnelVo;
  14 +import com.lframework.xingyun.sc.vo.customer.credit.QueryCorePersonnelVo;
  15 +import com.lframework.xingyun.sc.vo.customer.credit.UpdateCorePersonnelVo;
  16 +import io.swagger.annotations.ApiImplicitParam;
  17 +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
  18 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  19 +import io.swagger.annotations.ApiOperation;
  20 +import com.lframework.starter.common.utils.CollectionUtil;
  21 +import io.swagger.annotations.Api;
  22 +import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.validation.annotation.Validated;
  24 +import org.springframework.web.bind.annotation.*;
  25 +
  26 +import javax.validation.Valid;
  27 +import java.util.List;
  28 +import java.util.stream.Collectors;
  29 +
  30 +/**
  31 + * 核心人员表 Controller
  32 + *
  33 + */
  34 +@Api(tags = "核心人员表")
  35 +@Validated
  36 +@RestController
  37 +@RequestMapping("/corePersonnel")
  38 +public class CorePersonnelController extends DefaultBaseController {
  39 +
  40 + @Autowired
  41 + private CorePersonnelService corePersonnelService;
  42 +
  43 + /**
  44 + * 查询列表
  45 + */
  46 + @ApiOperation("查询列表")
  47 + @HasPermission({"corePersonnel:corePersonnel:query"})
  48 + @GetMapping("/query")
  49 + public InvokeResult<PageResult<GetCorePersonnelBo>> query(@Valid QueryCorePersonnelVo vo) {
  50 +
  51 + PageResult<CorePersonnel> pageResult = corePersonnelService.query(getPageIndex(vo), getPageSize(vo), vo);
  52 +
  53 + List<CorePersonnel> datas = pageResult.getDatas();
  54 + List<GetCorePersonnelBo> results = null;
  55 +
  56 + if (!CollectionUtil.isEmpty(datas)) {
  57 + results = datas.stream().map(GetCorePersonnelBo::new).collect(Collectors.toList());
  58 + }
  59 +
  60 + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
  61 + }
  62 +
  63 + /**
  64 + * 根据ID查询
  65 + */
  66 + @ApiOperation("根据ID查询")
  67 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  68 + @HasPermission({"corePersonnel:corePersonnel:query"})
  69 + @GetMapping
  70 + public InvokeResult<GetCorePersonnelBo> get(@NotBlank(message = "id不能为空!") String id) {
  71 +
  72 + CorePersonnel data = corePersonnelService.findById(id);
  73 + if (data == null) {
  74 + throw new DefaultClientException("核心人员表不存在!");
  75 + }
  76 +
  77 + GetCorePersonnelBo result = new GetCorePersonnelBo(data);
  78 +
  79 + return InvokeResultBuilder.success(result);
  80 + }
  81 +
  82 + /**
  83 + * 新增
  84 + */
  85 + @ApiOperation("新增")
  86 + @HasPermission({"corePersonnel:corePersonnel:add"})
  87 + @PostMapping
  88 + public InvokeResult<Void> create(@Valid CreateCorePersonnelVo vo) {
  89 +
  90 + corePersonnelService.create(vo);
  91 +
  92 + return InvokeResultBuilder.success();
  93 + }
  94 +
  95 + /**
  96 + * 修改
  97 + */
  98 + @ApiOperation("修改")
  99 + @HasPermission({"corePersonnel:corePersonnel:modify"})
  100 + @PutMapping
  101 + public InvokeResult<Void> update(@Valid UpdateCorePersonnelVo vo) {
  102 +
  103 + corePersonnelService.update(vo);
  104 +
  105 + corePersonnelService.cleanCacheByKey(vo.getId());
  106 +
  107 + return InvokeResultBuilder.success();
  108 + }
  109 +}
... ...
  1 +package com.lframework.xingyun.sc.controller.customer;
  2 +
  3 +import com.lframework.starter.web.core.annotations.security.HasPermission;
  4 +import com.lframework.starter.web.core.components.security.AbstractUserDetails;
  5 +import com.lframework.starter.web.core.components.security.SecurityUtil;
  6 +import com.lframework.starter.web.core.controller.DefaultBaseController;
  7 +import com.lframework.xingyun.basedata.service.customer.CustomerService;
  8 +import com.lframework.xingyun.sc.bo.customer.credit.GetCustomerCreditBo;
  9 +import com.lframework.xingyun.sc.entity.CorePersonnel;
  10 +import com.lframework.xingyun.sc.entity.CustomerCredit;
  11 +import com.lframework.starter.web.core.utils.PageResultUtil;
  12 +import com.lframework.starter.web.core.components.resp.PageResult;
  13 +import com.lframework.starter.web.core.components.resp.InvokeResult;
  14 +import javax.annotation.Resource;
  15 +import javax.validation.constraints.NotBlank;
  16 +import com.lframework.xingyun.sc.service.customer.CorePersonnelService;
  17 +import com.lframework.xingyun.sc.service.customer.CustomerCreditService;
  18 +import com.lframework.xingyun.sc.vo.customer.credit.CreateCustomerCreditVo;
  19 +import com.lframework.xingyun.sc.vo.customer.credit.QueryCorePersonnelVo;
  20 +import com.lframework.xingyun.sc.vo.customer.credit.QueryCustomerCreditVo;
  21 +import com.lframework.xingyun.sc.vo.customer.credit.UpdateCustomerCreditVo;
  22 +import io.swagger.annotations.ApiImplicitParam;
  23 +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
  24 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  25 +import io.swagger.annotations.ApiOperation;
  26 +import com.lframework.starter.common.utils.CollectionUtil;
  27 +import io.swagger.annotations.Api;
  28 +import org.springframework.beans.factory.annotation.Autowired;
  29 +import org.springframework.validation.annotation.Validated;
  30 +import org.springframework.web.bind.annotation.*;
  31 +
  32 +import javax.validation.Valid;
  33 +import java.util.List;
  34 +import java.util.stream.Collectors;
  35 +
  36 +/**
  37 + * 客户资信表 Controller
  38 + *
  39 + */
  40 +@Api(tags = "客户资信表")
  41 +@Validated
  42 +@RestController
  43 +@RequestMapping("/customerCredit")
  44 +public class CustomerCreditController extends DefaultBaseController {
  45 +
  46 + @Autowired
  47 + private CustomerCreditService customerCreditService;
  48 + @Resource
  49 + private CustomerService customerService;
  50 + @Resource
  51 + private CorePersonnelService corePersonnelService;
  52 +
  53 + /**
  54 + * 查询列表
  55 + */
  56 + @ApiOperation("查询列表")
  57 + @HasPermission({"customerCredit:customercredit:query"})
  58 + @GetMapping("/query")
  59 + public InvokeResult<PageResult<GetCustomerCreditBo>> query(@Valid QueryCustomerCreditVo vo) {
  60 +
  61 + PageResult<CustomerCredit> pageResult = customerCreditService.query(getPageIndex(vo), getPageSize(vo), vo);
  62 +
  63 + List<CustomerCredit> datas = pageResult.getDatas();
  64 + List<GetCustomerCreditBo> results = null;
  65 +
  66 + if (!CollectionUtil.isEmpty(datas)) {
  67 + results = datas.stream().map(GetCustomerCreditBo::new).collect(Collectors.toList());
  68 + }
  69 +
  70 + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
  71 + }
  72 +
  73 + /**
  74 + * 根据ID查询
  75 + */
  76 + @ApiOperation("根据ID查询")
  77 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  78 + @HasPermission({"customerCredit:customercredit:query"})
  79 + @GetMapping("/getById")
  80 + public InvokeResult<GetCustomerCreditBo> get(@NotBlank(message = "id不能为空!") String id) {
  81 +
  82 + CustomerCredit data = customerCreditService.findById(id);
  83 + if (data == null) {
  84 + throw new DefaultClientException("客户资信表不存在!");
  85 + }
  86 +
  87 + GetCustomerCreditBo result = packCustomerCreditData(data);
  88 +
  89 + return InvokeResultBuilder.success(result);
  90 + }
  91 +
  92 + /**
  93 + * 新增
  94 + */
  95 + @ApiOperation("新增")
  96 + @HasPermission({"customerCredit:customercredit:add"})
  97 + @PostMapping("/add")
  98 + public InvokeResult<Void> create(@Valid CreateCustomerCreditVo vo) {
  99 +
  100 + customerCreditService.create(vo);
  101 +
  102 + return InvokeResultBuilder.success();
  103 + }
  104 +
  105 + /**
  106 + * 修改
  107 + */
  108 + @ApiOperation("修改")
  109 + @HasPermission({"customerCredit:customercredit:modify"})
  110 + @PutMapping("/update")
  111 + public InvokeResult<Void> update(@Valid UpdateCustomerCreditVo vo) {
  112 +
  113 + customerCreditService.update(vo);
  114 +
  115 + customerCreditService.cleanCacheByKey(vo.getId());
  116 +
  117 + return InvokeResultBuilder.success();
  118 + }
  119 +
  120 + /**
  121 + * 根据ID删除
  122 + */
  123 + @ApiOperation("根据ID删除")
  124 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  125 + @HasPermission({"customerCredit:customercredit:delete"})
  126 + @DeleteMapping("/deleteById")
  127 + public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) {
  128 +
  129 + customerCreditService.deleteById(id);
  130 +
  131 + customerCreditService.cleanCacheByKey(id);
  132 +
  133 + return InvokeResultBuilder.success();
  134 + }
  135 +
  136 + /**
  137 + * 生成资信编号
  138 + */
  139 + @ApiOperation("生成资信编号")
  140 + @GetMapping("/generateCode")
  141 + public InvokeResult<String> generateCode() {
  142 +
  143 + String code = customerCreditService.generateCode();
  144 + return InvokeResultBuilder.success(code);
  145 + }
  146 +
  147 + /**
  148 + * 封装客户资信数据
  149 + *
  150 + * @param credit 数据实体
  151 + * @return GetCustomerCreditBo
  152 + */
  153 + private GetCustomerCreditBo packCustomerCreditData(CustomerCredit credit) {
  154 + // 处理关联数据
  155 + GetCustomerCreditBo data = new GetCustomerCreditBo(credit);
  156 + //获取核心人员信息
  157 + QueryCorePersonnelVo vo = new QueryCorePersonnelVo();
  158 + vo.setCreditId(credit.getId());
  159 + List<CorePersonnel> corePersonnel = corePersonnelService.query(vo);
  160 + data.setCorePersonnelList(corePersonnel);
  161 + return data;
  162 + }
  163 +}
... ...
  1 +package com.lframework.xingyun.sc.entity;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableName;
  4 +import com.lframework.starter.web.core.dto.BaseDto;
  5 +import java.time.LocalDateTime;
  6 +import com.baomidou.mybatisplus.annotation.FieldFill;
  7 +import com.lframework.starter.web.core.entity.BaseEntity;
  8 +import com.baomidou.mybatisplus.annotation.TableField;
  9 +import lombok.Data;
  10 +
  11 +/**
  12 + * <p>
  13 + * 核心人员表
  14 + * </p>
  15 + *
  16 + */
  17 +@Data
  18 +@TableName("core_personnel")
  19 +public class CorePersonnel extends BaseEntity implements BaseDto {
  20 +
  21 + private static final long serialVersionUID = 1L;
  22 +
  23 + public static final String CACHE_NAME = "CorePersonnel";
  24 +
  25 + /**
  26 + * ID
  27 + */
  28 + private String id;
  29 +
  30 + /**
  31 + * 客户资信
  32 + */
  33 + private String creditId;
  34 +
  35 + /**
  36 + * 姓名
  37 + */
  38 + private String name;
  39 +
  40 + /**
  41 + * 性别
  42 + */
  43 + private String sex;
  44 +
  45 + /**
  46 + * 籍贯
  47 + */
  48 + private String nativePlace;
  49 +
  50 + /**
  51 + * 年龄
  52 + */
  53 + private String age;
  54 +
  55 + /**
  56 + * 职务
  57 + */
  58 + private String position;
  59 +
  60 + /**
  61 + * 手机
  62 + */
  63 + private String mobile;
  64 +
  65 + /**
  66 + * 固定电话
  67 + */
  68 + private String phone;
  69 +
  70 + /**
  71 + * 邮箱地址
  72 + */
  73 + private String email;
  74 +
  75 + /**
  76 + * 现住址
  77 + */
  78 + private String address;
  79 +
  80 + /**
  81 + * 创建人ID
  82 + */
  83 + @TableField(fill = FieldFill.INSERT)
  84 + private String createById;
  85 +
  86 + /**
  87 + * 创建人
  88 + */
  89 + @TableField(fill = FieldFill.INSERT)
  90 + private String createBy;
  91 +
  92 + /**
  93 + * 更新人ID
  94 + */
  95 + @TableField(fill = FieldFill.INSERT_UPDATE)
  96 + private String updateById;
  97 +
  98 + /**
  99 + * 更新人
  100 + */
  101 + @TableField(fill = FieldFill.INSERT_UPDATE)
  102 + private String updateBy;
  103 +
  104 + /**
  105 + * 创建时间
  106 + */
  107 + @TableField(fill = FieldFill.INSERT)
  108 + private LocalDateTime createTime;
  109 +
  110 + /**
  111 + * 更新时间
  112 + */
  113 + @TableField(fill = FieldFill.INSERT_UPDATE)
  114 + private LocalDateTime updateTime;
  115 +
  116 +}
... ...
  1 +package com.lframework.xingyun.sc.entity;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableName;
  4 +import java.math.BigDecimal;
  5 +import com.lframework.starter.web.core.dto.BaseDto;
  6 +import java.time.LocalDateTime;
  7 +import com.baomidou.mybatisplus.annotation.FieldFill;
  8 +import com.lframework.starter.web.core.entity.BaseEntity;
  9 +import com.baomidou.mybatisplus.annotation.TableField;
  10 +import lombok.Data;
  11 +
  12 +/**
  13 + * <p>
  14 + * 客户资信表
  15 + * </p>
  16 + *
  17 + */
  18 +@Data
  19 +@TableName("customer_credit")
  20 +public class CustomerCredit extends BaseEntity implements BaseDto {
  21 +
  22 + private static final long serialVersionUID = 1L;
  23 +
  24 + public static final String CACHE_NAME = "CustomerCredit";
  25 +
  26 + /**
  27 + * ID
  28 + */
  29 + private String id;
  30 +
  31 + /**
  32 + * 编号
  33 + */
  34 + private String serialNumber;
  35 +
  36 + /**
  37 + * 区域
  38 + */
  39 + private String region;
  40 +
  41 + /**
  42 + * 登记日期
  43 + */
  44 + private LocalDateTime registerDate;
  45 +
  46 + /**
  47 + * 客户简称
  48 + */
  49 + private String customerShortName;
  50 +
  51 + /**
  52 + * 企业类型:经销商(distributor)、终端(terminal)
  53 + */
  54 + private String enterpriseType;
  55 +
  56 + /**
  57 + * 单位ID
  58 + */
  59 + private String companyId;
  60 +
  61 + /**
  62 + * 单位名称(非持久化字段)
  63 + */
  64 + private String companyName;
  65 +
  66 + /**
  67 + * 企业性质
  68 + */
  69 + private String companyNature;
  70 +
  71 + /**
  72 + * 单位地址
  73 + */
  74 + private String companyAddress;
  75 +
  76 + /**
  77 + * 注册资本(单位:万元)
  78 + */
  79 + private BigDecimal registeredCapital;
  80 +
  81 + /**
  82 + * 账号
  83 + */
  84 + private String bankAccount;
  85 +
  86 + /**
  87 + * 开户行
  88 + */
  89 + private String bankName;
  90 +
  91 + /**
  92 + * 税号
  93 + */
  94 + private String taxNumber;
  95 +
  96 + /**
  97 + * 注册时间
  98 + */
  99 + private LocalDateTime registrationTime;
  100 +
  101 + /**
  102 + * 经营年限(年)
  103 + */
  104 + private String businessYears;
  105 +
  106 + /**
  107 + * 经营范围
  108 + */
  109 + private String businessScope;
  110 +
  111 + /**
  112 + * 经营场地属性
  113 + */
  114 + private String businessProperty;
  115 +
  116 + /**
  117 + * 占地面积(平方米)
  118 + */
  119 + private String landArea;
  120 +
  121 + /**
  122 + * 仓储条件
  123 + */
  124 + private String storageConditions;
  125 +
  126 + /**
  127 + * 员工人数
  128 + */
  129 + private Integer employeeCount;
  130 +
  131 + /**
  132 + * 设备属性
  133 + */
  134 + private String equipmentAttributes;
  135 +
  136 + /**
  137 + * 资产评估
  138 + */
  139 + private String assetEvaluation;
  140 +
  141 + /**
  142 + * 上年度销售额(万元)
  143 + */
  144 + private String lastYearSales;
  145 +
  146 + /**
  147 + * 月均销量(万元)
  148 + */
  149 + private String monthlyAvgSales;
  150 +
  151 + /**
  152 + * 销项发票所开品名与计量单位
  153 + */
  154 + private String invoiceItemUnit;
  155 +
  156 + /**
  157 + * 认证证书
  158 + */
  159 + private String certificationCertificate;
  160 +
  161 + /**
  162 + * 我司售于产品与经营范围是否匹配
  163 + */
  164 + private String productMatch;
  165 +
  166 + /**
  167 + * 主要客户
  168 + */
  169 + private String majorCustomers;
  170 +
  171 + /**
  172 + * 主营项目
  173 + */
  174 + private String mainProjects;
  175 +
  176 + /**
  177 + * 从事行业
  178 + */
  179 + private String industryInvolved;
  180 +
  181 + /**
  182 + * 在该行业中的经验
  183 + */
  184 + private String industryExperience;
  185 +
  186 + /**
  187 + * 是否与其他企业有经济纠纷 违规信息 拖欠员工薪资等
  188 + */
  189 + private String hasDispute;
  190 +
  191 + /**
  192 + * 与我司合作时间
  193 + */
  194 + private String cooperationStartDate;
  195 +
  196 + /**
  197 + * 月均操作量
  198 + */
  199 + private String monthlyAvgVolume;
  200 +
  201 + /**
  202 + * 是否口头协议操作
  203 + */
  204 + private String isVerbalAgreement;
  205 +
  206 + /**
  207 + * 是否签订其他协议(列举)
  208 + */
  209 + private String otherAgreements;
  210 +
  211 + /**
  212 + * 与我司操作是否签订长年合同
  213 + */
  214 + private String hasLongTermContract;
  215 +
  216 + /**
  217 + * 合同类型
  218 + */
  219 + private String contractType;
  220 +
  221 + /**
  222 + * 是否有过中断及中断原因
  223 + */
  224 + private String hasInterruption;
  225 +
  226 + /**
  227 + * 结算期限
  228 + */
  229 + private String settlementPeriod;
  230 +
  231 + /**
  232 + * 加工操作方案
  233 + */
  234 + private String materialSupplyPlan;
  235 +
  236 + /**
  237 + * 建议客户分类:AAA、AA、A、BBB、BB、B、C、D
  238 + */
  239 + private String suggestedCategory;
  240 +
  241 + /**
  242 + * 授信额度(万元)
  243 + */
  244 + private String creditLimit;
  245 +
  246 + /**
  247 + * 调查人
  248 + */
  249 + private String investigator;
  250 +
  251 + /**
  252 + * 主管审核
  253 + */
  254 + private String supervisorReview;
  255 +
  256 + /**
  257 + * 年度总销量(万元)
  258 + */
  259 + private String annualTotalSales;
  260 +
  261 + /**
  262 + * 主要行业
  263 + */
  264 + private String mainIndustry;
  265 +
  266 + /**
  267 + * 年度款料概况
  268 + */
  269 + private String annualMaterialOverview;
  270 +
  271 + /**
  272 + * 结算期限
  273 + */
  274 + private String companySettlementPeriod;
  275 +
  276 + /**
  277 + * 授信额度(万元)
  278 + */
  279 + private String companyCreditLimit;
  280 +
  281 + /**
  282 + * 加工操作方案
  283 + */
  284 + private String companyMaterialSupplyPlan;
  285 +
  286 + /**
  287 + * 客户分类:AAA、AA、A、BBB、BB、B、C、D
  288 + */
  289 + private String companySuggestedCategory;
  290 +
  291 + /**
  292 + * 审核状态
  293 + */
  294 + private String status;
  295 +
  296 + /**
  297 + * 创建人ID
  298 + */
  299 + @TableField(fill = FieldFill.INSERT)
  300 + private String createById;
  301 +
  302 + /**
  303 + * 创建人
  304 + */
  305 + @TableField(fill = FieldFill.INSERT)
  306 + private String createBy;
  307 +
  308 + /**
  309 + * 更新人ID
  310 + */
  311 + @TableField(fill = FieldFill.INSERT_UPDATE)
  312 + private String updateById;
  313 +
  314 + /**
  315 + * 更新人
  316 + */
  317 + @TableField(fill = FieldFill.INSERT_UPDATE)
  318 + private String updateBy;
  319 +
  320 + /**
  321 + * 创建时间
  322 + */
  323 + @TableField(fill = FieldFill.INSERT)
  324 + private LocalDateTime createTime;
  325 +
  326 + /**
  327 + * 更新时间
  328 + */
  329 + @TableField(fill = FieldFill.INSERT_UPDATE)
  330 + private LocalDateTime updateTime;
  331 +
  332 +}
... ...
  1 +package com.lframework.xingyun.sc.impl.customer;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.github.pagehelper.PageInfo;
  6 +import com.lframework.starter.web.core.components.resp.PageResult;
  7 +import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
  8 +import com.lframework.starter.web.core.utils.PageResultUtil;
  9 +import com.lframework.starter.web.core.utils.OpLogUtil;
  10 +import com.lframework.starter.common.utils.StringUtil;
  11 +import java.io.Serializable;
  12 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  13 +import com.lframework.starter.web.core.utils.IdUtil;
  14 +import com.lframework.starter.common.utils.ObjectUtil;
  15 +import com.lframework.starter.web.core.annotations.oplog.OpLog;
  16 +import com.lframework.starter.web.core.utils.PageHelperUtil;
  17 +import com.lframework.starter.common.utils.Assert;
  18 +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  19 +import com.lframework.xingyun.sc.entity.CorePersonnel;
  20 +import com.lframework.xingyun.sc.mappers.CorePersonnelMapper;
  21 +import com.lframework.xingyun.sc.service.customer.CorePersonnelService;
  22 +import com.lframework.xingyun.sc.vo.customer.credit.CreateCorePersonnelVo;
  23 +import com.lframework.xingyun.sc.vo.customer.credit.QueryCorePersonnelVo;
  24 +import com.lframework.xingyun.sc.vo.customer.credit.UpdateCorePersonnelVo;
  25 +import org.springframework.cache.annotation.CacheEvict;
  26 +import org.springframework.cache.annotation.Cacheable;
  27 +import org.springframework.stereotype.Service;
  28 +import org.springframework.transaction.annotation.Transactional;
  29 +
  30 +import java.util.List;
  31 +
  32 +@Service
  33 +public class CorePersonnelServiceImpl extends BaseMpServiceImpl<CorePersonnelMapper, CorePersonnel> implements CorePersonnelService {
  34 +
  35 + @Override
  36 + public PageResult<CorePersonnel> query(Integer pageIndex, Integer pageSize, QueryCorePersonnelVo vo) {
  37 +
  38 + Assert.greaterThanZero(pageIndex);
  39 + Assert.greaterThanZero(pageSize);
  40 +
  41 + PageHelperUtil.startPage(pageIndex, pageSize);
  42 + List<CorePersonnel> datas = this.query(vo);
  43 +
  44 + return PageResultUtil.convert(new PageInfo<>(datas));
  45 + }
  46 +
  47 + @Override
  48 + public List<CorePersonnel> query(QueryCorePersonnelVo vo) {
  49 +
  50 + return getBaseMapper().query(vo);
  51 + }
  52 +
  53 + @Cacheable(value = CorePersonnel.CACHE_NAME, key = "@cacheVariables.tenantId() + #id", unless = "#result == null")
  54 + @Override
  55 + public CorePersonnel findById(String id) {
  56 +
  57 + return getBaseMapper().selectById(id);
  58 + }
  59 +
  60 + @OpLog(type = OtherOpLogType.class, name = "新增核心人员表,ID:{}", params = {"#id"})
  61 + @Transactional(rollbackFor = Exception.class)
  62 + @Override
  63 + public String create(CreateCorePersonnelVo vo) {
  64 +
  65 + CorePersonnel data = new CorePersonnel();
  66 + data.setId(IdUtil.getId());
  67 + data.setCreditId(vo.getCreditId());
  68 + if (!StringUtil.isBlank(vo.getName())) {
  69 + data.setName(vo.getName());
  70 + }
  71 + if (!StringUtil.isBlank(vo.getSex())) {
  72 + data.setSex(vo.getSex());
  73 + }
  74 + if (!StringUtil.isBlank(vo.getNativePlace())) {
  75 + data.setNativePlace(vo.getNativePlace());
  76 + }
  77 + if (!StringUtil.isBlank(vo.getAge())) {
  78 + data.setAge(vo.getAge());
  79 + }
  80 + if (!StringUtil.isBlank(vo.getPosition())) {
  81 + data.setPosition(vo.getPosition());
  82 + }
  83 + if (!StringUtil.isBlank(vo.getMobile())) {
  84 + data.setMobile(vo.getMobile());
  85 + }
  86 + if (!StringUtil.isBlank(vo.getPhone())) {
  87 + data.setPhone(vo.getPhone());
  88 + }
  89 + if (!StringUtil.isBlank(vo.getEmail())) {
  90 + data.setEmail(vo.getEmail());
  91 + }
  92 + if (!StringUtil.isBlank(vo.getAddress())) {
  93 + data.setAddress(vo.getAddress());
  94 + }
  95 +
  96 + getBaseMapper().insert(data);
  97 +
  98 + OpLogUtil.setVariable("id", data.getId());
  99 + OpLogUtil.setExtra(vo);
  100 +
  101 + return data.getId();
  102 + }
  103 +
  104 + @OpLog(type = OtherOpLogType.class, name = "修改核心人员表,ID:{}", params = {"#id"})
  105 + @Transactional(rollbackFor = Exception.class)
  106 + @Override
  107 + public void update(UpdateCorePersonnelVo vo) {
  108 +
  109 + CorePersonnel data = getBaseMapper().selectById(vo.getId());
  110 + if (ObjectUtil.isNull(data)) {
  111 + throw new DefaultClientException("核心人员表不存在!");
  112 + }
  113 +
  114 + LambdaUpdateWrapper<CorePersonnel> updateWrapper = Wrappers.lambdaUpdate(CorePersonnel.class)
  115 + .set(CorePersonnel::getCreditId, vo.getCreditId())
  116 + .set(CorePersonnel::getName, StringUtil.isBlank(vo.getName()) ? null : vo.getName())
  117 + .set(CorePersonnel::getSex, StringUtil.isBlank(vo.getSex()) ? null : vo.getSex())
  118 + .set(CorePersonnel::getNativePlace, StringUtil.isBlank(vo.getNativePlace()) ? null : vo.getNativePlace())
  119 + .set(CorePersonnel::getAge, StringUtil.isBlank(vo.getAge()) ? null : vo.getAge())
  120 + .set(CorePersonnel::getPosition, StringUtil.isBlank(vo.getPosition()) ? null : vo.getPosition())
  121 + .set(CorePersonnel::getMobile, StringUtil.isBlank(vo.getMobile()) ? null : vo.getMobile())
  122 + .set(CorePersonnel::getPhone, StringUtil.isBlank(vo.getPhone()) ? null : vo.getPhone())
  123 + .set(CorePersonnel::getEmail, StringUtil.isBlank(vo.getEmail()) ? null : vo.getEmail())
  124 + .set(CorePersonnel::getAddress, StringUtil.isBlank(vo.getAddress()) ? null : vo.getAddress())
  125 + .eq(CorePersonnel::getId, vo.getId());
  126 +
  127 + getBaseMapper().update(updateWrapper);
  128 +
  129 + OpLogUtil.setVariable("id", data.getId());
  130 + OpLogUtil.setExtra(vo);
  131 + }
  132 +
  133 + @CacheEvict(value = CorePersonnel.CACHE_NAME, key = "@cacheVariables.tenantId() + #key")
  134 + @Override
  135 + public void cleanCacheByKey(Serializable key) {
  136 +
  137 + }
  138 +}
... ...
  1 +package com.lframework.xingyun.sc.impl.customer;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.github.pagehelper.PageInfo;
  6 +import com.lframework.starter.web.core.components.security.SecurityUtil;
  7 +import com.lframework.starter.web.inner.bo.system.user.GetSysUserBo;
  8 +import com.lframework.starter.web.inner.entity.SysUser;
  9 +import com.lframework.starter.web.inner.service.system.SysUserService;
  10 +import com.lframework.xingyun.sc.entity.CustomerCredit;
  11 +import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
  12 +import com.lframework.starter.web.core.utils.PageResultUtil;
  13 +import com.lframework.starter.web.core.components.resp.PageResult;
  14 +import com.lframework.starter.web.core.utils.OpLogUtil;
  15 +import com.lframework.starter.common.utils.StringUtil;
  16 +import java.io.Serializable;
  17 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  18 +import com.lframework.starter.web.core.utils.IdUtil;
  19 +import com.lframework.starter.common.utils.ObjectUtil;
  20 +import com.lframework.starter.web.core.annotations.oplog.OpLog;
  21 +import com.lframework.starter.web.core.utils.PageHelperUtil;
  22 +import com.lframework.starter.common.utils.Assert;
  23 +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  24 +import com.lframework.xingyun.sc.mappers.CustomerCreditMapper;
  25 +import com.lframework.xingyun.sc.service.customer.CorePersonnelService;
  26 +import com.lframework.xingyun.sc.service.customer.CustomerCreditService;
  27 +import com.lframework.xingyun.sc.vo.customer.credit.CreateCorePersonnelVo;
  28 +import com.lframework.xingyun.sc.vo.customer.credit.CreateCustomerCreditVo;
  29 +import com.lframework.xingyun.sc.vo.customer.credit.QueryCustomerCreditVo;
  30 +import com.lframework.xingyun.sc.vo.customer.credit.UpdateCustomerCreditVo;
  31 +import org.apache.commons.collections.CollectionUtils;
  32 +import org.springframework.cache.annotation.CacheEvict;
  33 +import org.springframework.cache.annotation.Cacheable;
  34 +import org.springframework.stereotype.Service;
  35 +import org.springframework.transaction.annotation.Transactional;
  36 +import net.sourceforge.pinyin4j.PinyinHelper;
  37 +
  38 +import javax.annotation.Resource;
  39 +import java.util.HashSet;
  40 +import java.util.List;
  41 +import java.util.Set;
  42 +import java.util.stream.IntStream;
  43 +
  44 +@Service
  45 +public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditMapper, CustomerCredit> implements CustomerCreditService {
  46 +
  47 + @Resource
  48 + private CorePersonnelService corePersonnelService;
  49 + @Resource
  50 + private SysUserService sysUserService;
  51 + @Resource
  52 + private CustomerCreditMapper customerCreditMapper;
  53 +
  54 + @Override
  55 + public PageResult<CustomerCredit> query(Integer pageIndex, Integer pageSize, QueryCustomerCreditVo vo) {
  56 +
  57 + Assert.greaterThanZero(pageIndex);
  58 + Assert.greaterThanZero(pageSize);
  59 +
  60 + PageHelperUtil.startPage(pageIndex, pageSize);
  61 + List<CustomerCredit> datas = this.query(vo);
  62 +
  63 + return PageResultUtil.convert(new PageInfo<>(datas));
  64 + }
  65 +
  66 + @Override
  67 + public List<CustomerCredit> query(QueryCustomerCreditVo vo) {
  68 +
  69 + return getBaseMapper().query(vo);
  70 + }
  71 +
  72 + @Cacheable(value = CustomerCredit.CACHE_NAME, key = "@cacheVariables.tenantId() + #id", unless = "#result == null")
  73 + @Override
  74 + public CustomerCredit findById(String id) {
  75 +
  76 + return getBaseMapper().findById(id);
  77 + }
  78 +
  79 + @OpLog(type = OtherOpLogType.class, name = "新增客户资信表,ID:{}", params = {"#id"})
  80 + @Transactional(rollbackFor = Exception.class)
  81 + @Override
  82 + public String create(CreateCustomerCreditVo vo) {
  83 +
  84 + CustomerCredit data = new CustomerCredit();
  85 + data.setId(IdUtil.getId());
  86 + if (!StringUtil.isBlank(vo.getSerialNumber())) {
  87 + data.setSerialNumber(vo.getSerialNumber());
  88 + }
  89 + if (!StringUtil.isBlank(vo.getRegion())) {
  90 + data.setRegion(vo.getRegion());
  91 + }
  92 + if (vo.getRegisterDate() != null) {
  93 + data.setRegisterDate(vo.getRegisterDate());
  94 + }
  95 + if (!StringUtil.isBlank(vo.getCustomerShortName())) {
  96 + data.setCustomerShortName(vo.getCustomerShortName());
  97 + }
  98 + data.setEnterpriseType(vo.getEnterpriseType());
  99 + data.setCompanyId(vo.getCompanyId());
  100 + if (!StringUtil.isBlank(vo.getCompanyNature())) {
  101 + data.setCompanyNature(vo.getCompanyNature());
  102 + }
  103 + if (!StringUtil.isBlank(vo.getCompanyAddress())) {
  104 + data.setCompanyAddress(vo.getCompanyAddress());
  105 + }
  106 + if (vo.getRegisteredCapital() != null) {
  107 + data.setRegisteredCapital(vo.getRegisteredCapital());
  108 + }
  109 + if (!StringUtil.isBlank(vo.getBankAccount())) {
  110 + data.setBankAccount(vo.getBankAccount());
  111 + }
  112 + if (!StringUtil.isBlank(vo.getBankName())) {
  113 + data.setBankName(vo.getBankName());
  114 + }
  115 + if (!StringUtil.isBlank(vo.getTaxNumber())) {
  116 + data.setTaxNumber(vo.getTaxNumber());
  117 + }
  118 + if (vo.getRegistrationTime() != null) {
  119 + data.setRegistrationTime(vo.getRegistrationTime());
  120 + }
  121 + if (!StringUtil.isBlank(vo.getBusinessYears())) {
  122 + data.setBusinessYears(vo.getBusinessYears());
  123 + }
  124 + if (!StringUtil.isBlank(vo.getBusinessScope())) {
  125 + data.setBusinessScope(vo.getBusinessScope());
  126 + }
  127 + if (!StringUtil.isBlank(vo.getBusinessProperty())) {
  128 + data.setBusinessProperty(vo.getBusinessProperty());
  129 + }
  130 + if (vo.getLandArea() != null) {
  131 + data.setLandArea(vo.getLandArea());
  132 + }
  133 + if (!StringUtil.isBlank(vo.getStorageConditions())) {
  134 + data.setStorageConditions(vo.getStorageConditions());
  135 + }
  136 + if (vo.getEmployeeCount() != null) {
  137 + data.setEmployeeCount(vo.getEmployeeCount());
  138 + }
  139 + if (!StringUtil.isBlank(vo.getEquipmentAttributes())) {
  140 + data.setEquipmentAttributes(vo.getEquipmentAttributes());
  141 + }
  142 + if (!StringUtil.isBlank(vo.getAssetEvaluation())) {
  143 + data.setAssetEvaluation(vo.getAssetEvaluation());
  144 + }
  145 + if (!StringUtil.isBlank(vo.getLastYearSales())) {
  146 + data.setLastYearSales(vo.getLastYearSales());
  147 + }
  148 + if (!StringUtil.isBlank(vo.getMonthlyAvgSales())) {
  149 + data.setMonthlyAvgSales(vo.getMonthlyAvgSales());
  150 + }
  151 + if (!StringUtil.isBlank(vo.getInvoiceItemUnit())) {
  152 + data.setInvoiceItemUnit(vo.getInvoiceItemUnit());
  153 + }
  154 + if (!StringUtil.isBlank(vo.getCertificationCertificate())) {
  155 + data.setCertificationCertificate(vo.getCertificationCertificate());
  156 + }
  157 + if (!StringUtil.isBlank(vo.getProductMatch())) {
  158 + data.setProductMatch(vo.getProductMatch());
  159 + }
  160 + if (!StringUtil.isBlank(vo.getMajorCustomers())) {
  161 + data.setMajorCustomers(vo.getMajorCustomers());
  162 + }
  163 + if (!StringUtil.isBlank(vo.getMainProjects())) {
  164 + data.setMainProjects(vo.getMainProjects());
  165 + }
  166 + if (!StringUtil.isBlank(vo.getIndustryInvolved())) {
  167 + data.setIndustryInvolved(vo.getIndustryInvolved());
  168 + }
  169 + if (!StringUtil.isBlank(vo.getIndustryExperience())) {
  170 + data.setIndustryExperience(vo.getIndustryExperience());
  171 + }
  172 + if (!StringUtil.isBlank(vo.getHasDispute())) {
  173 + data.setHasDispute(vo.getHasDispute());
  174 + }
  175 + if (!StringUtil.isBlank(vo.getCooperationStartDate())) {
  176 + data.setCooperationStartDate(vo.getCooperationStartDate());
  177 + }
  178 + if (!StringUtil.isBlank(vo.getMonthlyAvgVolume())) {
  179 + data.setMonthlyAvgVolume(vo.getMonthlyAvgVolume());
  180 + }
  181 + if (!StringUtil.isBlank(vo.getIsVerbalAgreement())) {
  182 + data.setIsVerbalAgreement(vo.getIsVerbalAgreement());
  183 + }
  184 + if (!StringUtil.isBlank(vo.getOtherAgreements())) {
  185 + data.setOtherAgreements(vo.getOtherAgreements());
  186 + }
  187 + if (!StringUtil.isBlank(vo.getHasLongTermContract())) {
  188 + data.setHasLongTermContract(vo.getHasLongTermContract());
  189 + }
  190 + if (!StringUtil.isBlank(vo.getContractType())) {
  191 + data.setContractType(vo.getContractType());
  192 + }
  193 + if (!StringUtil.isBlank(vo.getHasInterruption())) {
  194 + data.setHasInterruption(vo.getHasInterruption());
  195 + }
  196 + if (!StringUtil.isBlank(vo.getSettlementPeriod())) {
  197 + data.setSettlementPeriod(vo.getSettlementPeriod());
  198 + }
  199 + if (!StringUtil.isBlank(vo.getMaterialSupplyPlan())) {
  200 + data.setMaterialSupplyPlan(vo.getMaterialSupplyPlan());
  201 + }
  202 + data.setSuggestedCategory(vo.getSuggestedCategory());
  203 + if (!StringUtil.isBlank(vo.getCreditLimit())) {
  204 + data.setCreditLimit(vo.getCreditLimit());
  205 + }
  206 + if (!StringUtil.isBlank(vo.getInvestigator())) {
  207 + data.setInvestigator(vo.getInvestigator());
  208 + }
  209 + if (!StringUtil.isBlank(vo.getSupervisorReview())) {
  210 + data.setSupervisorReview(vo.getSupervisorReview());
  211 + }
  212 + if (!StringUtil.isBlank(vo.getAnnualTotalSales())) {
  213 + data.setAnnualTotalSales(vo.getAnnualTotalSales());
  214 + }
  215 + if (!StringUtil.isBlank(vo.getMainIndustry())) {
  216 + data.setMainIndustry(vo.getMainIndustry());
  217 + }
  218 + if (!StringUtil.isBlank(vo.getAnnualMaterialOverview())) {
  219 + data.setAnnualMaterialOverview(vo.getAnnualMaterialOverview());
  220 + }
  221 + if (!StringUtil.isBlank(vo.getCompanySettlementPeriod())) {
  222 + data.setCompanySettlementPeriod(vo.getCompanySettlementPeriod());
  223 + }
  224 + if (!StringUtil.isBlank(vo.getCompanyCreditLimit())) {
  225 + data.setCompanyCreditLimit(vo.getCompanyCreditLimit());
  226 + }
  227 + if (!StringUtil.isBlank(vo.getCompanyMaterialSupplyPlan())) {
  228 + data.setCompanyMaterialSupplyPlan(vo.getCompanyMaterialSupplyPlan());
  229 + }
  230 + data.setCompanySuggestedCategory(vo.getCompanySuggestedCategory());
  231 + data.setStatus(vo.getStatus());
  232 +
  233 + getBaseMapper().insert(data);
  234 +
  235 + OpLogUtil.setVariable("id", data.getId());
  236 + OpLogUtil.setExtra(vo);
  237 + //新增核心人员
  238 + List<CreateCorePersonnelVo> corePersonnelList = vo.getCorePersonnelList();
  239 + if (CollectionUtils.isNotEmpty(corePersonnelList)) {
  240 + for (CreateCorePersonnelVo corePersonnelVo : corePersonnelList) {
  241 + corePersonnelVo.setCreditId(data.getId());
  242 + corePersonnelService.create(corePersonnelVo);
  243 + }
  244 + }
  245 +
  246 + return data.getId();
  247 + }
  248 +
  249 + @OpLog(type = OtherOpLogType.class, name = "修改客户资信表,ID:{}", params = {"#id"})
  250 + @Transactional(rollbackFor = Exception.class)
  251 + @Override
  252 + public void update(UpdateCustomerCreditVo vo) {
  253 +
  254 + CustomerCredit data = getBaseMapper().selectById(vo.getId());
  255 + if (ObjectUtil.isNull(data)) {
  256 + throw new DefaultClientException("客户资信表不存在!");
  257 + }
  258 +
  259 + LambdaUpdateWrapper<CustomerCredit> updateWrapper = Wrappers.lambdaUpdate(CustomerCredit.class)
  260 + .set(CustomerCredit::getRegion, StringUtil.isBlank(vo.getRegion()) ? null : vo.getRegion())
  261 + .set(CustomerCredit::getRegisterDate, vo.getRegisterDate() == null ? null : vo.getRegisterDate())
  262 + .set(CustomerCredit::getCustomerShortName, StringUtil.isBlank(vo.getCustomerShortName()) ? null : vo.getCustomerShortName())
  263 + .set(CustomerCredit::getEnterpriseType, vo.getEnterpriseType())
  264 + .set(CustomerCredit::getCompanyId, vo.getCompanyId())
  265 + .set(CustomerCredit::getCompanyNature, StringUtil.isBlank(vo.getCompanyNature()) ? null : vo.getCompanyNature())
  266 + .set(CustomerCredit::getCompanyAddress, StringUtil.isBlank(vo.getCompanyAddress()) ? null : vo.getCompanyAddress())
  267 + .set(CustomerCredit::getRegisteredCapital, vo.getRegisteredCapital() == null ? null : vo.getRegisteredCapital())
  268 + .set(CustomerCredit::getBankAccount, StringUtil.isBlank(vo.getBankAccount()) ? null : vo.getBankAccount())
  269 + .set(CustomerCredit::getBankName, StringUtil.isBlank(vo.getBankName()) ? null : vo.getBankName())
  270 + .set(CustomerCredit::getTaxNumber, StringUtil.isBlank(vo.getTaxNumber()) ? null : vo.getTaxNumber())
  271 + .set(CustomerCredit::getRegistrationTime, vo.getRegistrationTime() == null ? null : vo.getRegistrationTime())
  272 + .set(CustomerCredit::getBusinessYears, StringUtil.isBlank(vo.getBusinessYears()) ? null : vo.getBusinessYears())
  273 + .set(CustomerCredit::getBusinessScope, StringUtil.isBlank(vo.getBusinessScope()) ? null : vo.getBusinessScope())
  274 + .set(CustomerCredit::getBusinessProperty, StringUtil.isBlank(vo.getBusinessProperty()) ? null : vo.getBusinessProperty())
  275 + .set(CustomerCredit::getLandArea, vo.getLandArea() == null ? null : vo.getLandArea())
  276 + .set(CustomerCredit::getStorageConditions, StringUtil.isBlank(vo.getStorageConditions()) ? null : vo.getStorageConditions())
  277 + .set(CustomerCredit::getEmployeeCount, vo.getEmployeeCount() == null ? null : vo.getEmployeeCount())
  278 + .set(CustomerCredit::getEquipmentAttributes, StringUtil.isBlank(vo.getEquipmentAttributes()) ? null : vo.getEquipmentAttributes())
  279 + .set(CustomerCredit::getAssetEvaluation, StringUtil.isBlank(vo.getAssetEvaluation()) ? null : vo.getAssetEvaluation())
  280 + .set(CustomerCredit::getLastYearSales, StringUtil.isBlank(vo.getLastYearSales()) ? null : vo.getLastYearSales())
  281 + .set(CustomerCredit::getMonthlyAvgSales, StringUtil.isBlank(vo.getMonthlyAvgSales()) ? null : vo.getMonthlyAvgSales())
  282 + .set(CustomerCredit::getInvoiceItemUnit, StringUtil.isBlank(vo.getInvoiceItemUnit()) ? null : vo.getInvoiceItemUnit())
  283 + .set(CustomerCredit::getCertificationCertificate, StringUtil.isBlank(vo.getCertificationCertificate()) ? null : vo.getCertificationCertificate())
  284 + .set(CustomerCredit::getProductMatch, StringUtil.isBlank(vo.getProductMatch()) ? null : vo.getProductMatch())
  285 + .set(CustomerCredit::getMajorCustomers, StringUtil.isBlank(vo.getMajorCustomers()) ? null : vo.getMajorCustomers())
  286 + .set(CustomerCredit::getMainProjects, StringUtil.isBlank(vo.getMainProjects()) ? null : vo.getMainProjects())
  287 + .set(CustomerCredit::getIndustryInvolved, StringUtil.isBlank(vo.getIndustryInvolved()) ? null : vo.getIndustryInvolved())
  288 + .set(CustomerCredit::getIndustryExperience, StringUtil.isBlank(vo.getIndustryExperience()) ? null : vo.getIndustryExperience())
  289 + .set(CustomerCredit::getHasDispute, StringUtil.isBlank(vo.getHasDispute()) ? null : vo.getHasDispute())
  290 + .set(CustomerCredit::getCooperationStartDate, StringUtil.isBlank(vo.getCooperationStartDate()) ? null : vo.getCooperationStartDate())
  291 + .set(CustomerCredit::getMonthlyAvgVolume, StringUtil.isBlank(vo.getMonthlyAvgVolume()) ? null : vo.getMonthlyAvgVolume())
  292 + .set(CustomerCredit::getIsVerbalAgreement, StringUtil.isBlank(vo.getIsVerbalAgreement()) ? null : vo.getIsVerbalAgreement())
  293 + .set(CustomerCredit::getOtherAgreements, StringUtil.isBlank(vo.getOtherAgreements()) ? null : vo.getOtherAgreements())
  294 + .set(CustomerCredit::getHasLongTermContract, StringUtil.isBlank(vo.getHasLongTermContract()) ? null : vo.getHasLongTermContract())
  295 + .set(CustomerCredit::getContractType, StringUtil.isBlank(vo.getContractType()) ? null : vo.getContractType())
  296 + .set(CustomerCredit::getHasInterruption, StringUtil.isBlank(vo.getHasInterruption()) ? null : vo.getHasInterruption())
  297 + .set(CustomerCredit::getSettlementPeriod, StringUtil.isBlank(vo.getSettlementPeriod()) ? null : vo.getSettlementPeriod())
  298 + .set(CustomerCredit::getMaterialSupplyPlan, StringUtil.isBlank(vo.getMaterialSupplyPlan()) ? null : vo.getMaterialSupplyPlan())
  299 + .set(CustomerCredit::getSuggestedCategory, vo.getSuggestedCategory())
  300 + .set(CustomerCredit::getCreditLimit, StringUtil.isBlank(vo.getCreditLimit()) ? null : vo.getCreditLimit())
  301 + .set(CustomerCredit::getInvestigator, StringUtil.isBlank(vo.getInvestigator()) ? null : vo.getInvestigator())
  302 + .set(CustomerCredit::getSupervisorReview, StringUtil.isBlank(vo.getSupervisorReview()) ? null : vo.getSupervisorReview())
  303 + .set(CustomerCredit::getAnnualTotalSales, StringUtil.isBlank(vo.getAnnualTotalSales()) ? null : vo.getAnnualTotalSales())
  304 + .set(CustomerCredit::getMainIndustry, StringUtil.isBlank(vo.getMainIndustry()) ? null : vo.getMainIndustry())
  305 + .set(CustomerCredit::getAnnualMaterialOverview, StringUtil.isBlank(vo.getAnnualMaterialOverview()) ? null : vo.getAnnualMaterialOverview())
  306 + .set(CustomerCredit::getCompanySettlementPeriod, StringUtil.isBlank(vo.getCompanySettlementPeriod()) ? null : vo.getCompanySettlementPeriod())
  307 + .set(CustomerCredit::getCompanyCreditLimit, StringUtil.isBlank(vo.getCompanyCreditLimit()) ? null : vo.getCompanyCreditLimit())
  308 + .set(CustomerCredit::getCompanyMaterialSupplyPlan, StringUtil.isBlank(vo.getCompanyMaterialSupplyPlan()) ? null : vo.getCompanyMaterialSupplyPlan())
  309 + .set(CustomerCredit::getCompanySuggestedCategory, vo.getCompanySuggestedCategory())
  310 + .set(CustomerCredit::getStatus, vo.getStatus())
  311 + .eq(CustomerCredit::getId, vo.getId());
  312 +
  313 + getBaseMapper().update(updateWrapper);
  314 + //更新核心人员
  315 + //todo fys 考虑删除怎么做
  316 + List<CreateCorePersonnelVo> corePersonnelList = vo.getCorePersonnelList();
  317 + if (CollectionUtils.isNotEmpty(corePersonnelList)) {
  318 + for (CreateCorePersonnelVo corePersonnelVo : corePersonnelList) {
  319 + corePersonnelVo.setCreditId(data.getId());
  320 + corePersonnelService.update();
  321 + }
  322 + }
  323 + OpLogUtil.setVariable("id", data.getId());
  324 + OpLogUtil.setExtra(vo);
  325 + }
  326 +
  327 + @OpLog(type = OtherOpLogType.class, name = "删除客户资信表,ID:{}", params = {"#id"})
  328 + @Transactional(rollbackFor = Exception.class)
  329 + @Override
  330 + public void deleteById(String id) {
  331 +
  332 + getBaseMapper().deleteById(id);
  333 + }
  334 +
  335 + /**
  336 + * 自动生成资信编码
  337 + *
  338 + * @return 资信编码
  339 + */
  340 + @Override
  341 + public String generateCode() {
  342 + //获取当前人员ID
  343 + String currentUserId = SecurityUtil.getCurrentUser().getId();
  344 + SysUser sysUser = sysUserService.findById(currentUserId);
  345 + if (sysUser != null) {
  346 + GetSysUserBo getSysUserBo = new GetSysUserBo(sysUser);
  347 + //部门名称
  348 + String deptName = getSysUserBo.getDeptName();
  349 + if (StringUtil.isNotEmpty(deptName)) {
  350 + //获取办事处首字母
  351 + String prefixPinyin = getPrefixPinyin(deptName);
  352 + //已使用编号
  353 + Set<String> existingNumbers = customerCreditMapper.getGenerateCode(prefixPinyin);
  354 +
  355 + return generateNextAvailableNumber(prefixPinyin, existingNumbers);
  356 + } else {
  357 + throw new IllegalArgumentException("部门名称为空");
  358 + }
  359 + } else {
  360 + throw new IllegalArgumentException("人员不存在");
  361 + }
  362 + }
  363 +
  364 + /**
  365 + * 从“XXX办事处”格式的名称中提取前缀拼音首字母,例如:
  366 + * “东莞办事处” → “东莞” → DG
  367 + */
  368 + public static String getPrefixPinyin(String officeName) {
  369 + if (officeName == null || officeName.isEmpty()) {
  370 + return "";
  371 + }
  372 +
  373 + // 按“办事处”切割,取前面部分
  374 + String[] parts = officeName.split("办事处", 2); // 最多切一次
  375 + if (parts.length == 0) {
  376 + return "";
  377 + }
  378 +
  379 + String prefix = parts[0].trim(); // 如“东莞”
  380 + if (prefix.isEmpty()) {
  381 + return "";
  382 + }
  383 +
  384 + // 提取拼音首字母
  385 + StringBuilder initials = new StringBuilder();
  386 + for (char c : prefix.toCharArray()) {
  387 + if (c >= '\u4e00' && c <= '\u9fa5') { // 判断是否为汉字
  388 + String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c);
  389 + if (pinyinArray != null && pinyinArray.length > 0) {
  390 + char initial = pinyinArray[0].charAt(0); // 取首音
  391 + initials.append(Character.toUpperCase(initial));
  392 + }
  393 + }
  394 + // 如果包含英文字母,也可以选择保留(可选)
  395 + else if (Character.isLetter(c)) {
  396 + initials.append(Character.toUpperCase(c));
  397 + }
  398 + }
  399 +
  400 + return initials.toString();
  401 + }
  402 +
  403 + /**
  404 + * 根据办事处前缀和已使用的编号集合,生成下一个可用的最小编号
  405 + *
  406 + * @param prefix 办事处前缀,如 "DG"
  407 + * @param existingNumbers 所有已使用的编号集合,如 ["DG001", "DG003", "BJ001"]
  408 + * @return 下一个未使用的编号,如 "DG002",如果传入前缀无使用记录则返回 "DG001"
  409 + */
  410 + public static String generateNextAvailableNumber(String prefix, Set<String> existingNumbers) {
  411 + // 参数校验
  412 + if (prefix == null || prefix.isEmpty()) {
  413 + throw new IllegalArgumentException("办事处前缀不能为空");
  414 + }
  415 + if (existingNumbers == null) {
  416 + existingNumbers = new HashSet<>();
  417 + }
  418 +
  419 + // 提取当前前缀下的所有已使用编号的数字部分
  420 + Set<Integer> usedNumbers = new HashSet<>();
  421 + for (String num : existingNumbers) {
  422 + if (num != null && num.toUpperCase().startsWith(prefix.toUpperCase())) {
  423 + try {
  424 + // 提取后三位数字
  425 + String suffix = num.substring(prefix.length());
  426 + if (suffix.length() == 3 && suffix.matches("\\d{3}")) {
  427 + int n = Integer.parseInt(suffix);
  428 + if (n >= 1 && n <= 999) {
  429 + usedNumbers.add(n);
  430 + }
  431 + }
  432 + } catch (Exception e) {
  433 + // 忽略格式错误的编号
  434 + continue;
  435 + }
  436 + }
  437 + }
  438 +
  439 + // 从 1 到 999 顺序查找第一个未使用的编号
  440 + return IntStream.rangeClosed(1, 999)
  441 + .filter(n -> !usedNumbers.contains(n))
  442 + .boxed()
  443 + .findFirst()
  444 + .map(n -> String.format("%s%03d", prefix.toUpperCase(), n))
  445 + .orElseThrow(() -> new RuntimeException("办事处 " + prefix + " 的编号已用尽 (001-999)"));
  446 + }
  447 +
  448 + @CacheEvict(value = CustomerCredit.CACHE_NAME, key = "@cacheVariables.tenantId() + #key")
  449 + @Override
  450 + public void cleanCacheByKey(Serializable key) {
  451 +
  452 + }
  453 +}
... ...
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.starter.web.core.vo.PageVo;
  4 +import com.lframework.starter.web.core.mapper.BaseMapper;
  5 +import com.lframework.starter.web.core.vo.BaseVo;
  6 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  7 +import com.lframework.xingyun.sc.entity.CorePersonnel;
  8 +import com.lframework.xingyun.sc.vo.customer.credit.QueryCorePersonnelVo;
  9 +import io.swagger.annotations.ApiModelProperty;
  10 +import org.apache.ibatis.annotations.Param;
  11 +
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * <p>
  16 + * 核心人员表 Mapper 接口
  17 + * </p>
  18 + *
  19 + */
  20 +public interface CorePersonnelMapper extends BaseMapper<CorePersonnel> {
  21 +
  22 + /**
  23 + * 查询列表
  24 + * @param vo
  25 + * @return
  26 + */
  27 + List<CorePersonnel> query(@Param("vo") QueryCorePersonnelVo vo);
  28 +}
... ...
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.xingyun.sc.entity.CustomerCredit;
  4 +import com.lframework.starter.web.core.mapper.BaseMapper;
  5 +import com.lframework.xingyun.sc.vo.customer.credit.QueryCustomerCreditVo;
  6 +import org.apache.ibatis.annotations.Param;
  7 +
  8 +import java.util.List;
  9 +import java.util.Set;
  10 +
  11 +/**
  12 + * <p>
  13 + * 客户资信表 Mapper 接口
  14 + * </p>
  15 + *
  16 + */
  17 +public interface CustomerCreditMapper extends BaseMapper<CustomerCredit> {
  18 +
  19 + /**
  20 + * 查询列表
  21 + * @param vo
  22 + * @return
  23 + */
  24 + List<CustomerCredit> query(@Param("vo") QueryCustomerCreditVo vo);
  25 +
  26 + /**
  27 + * 查询单个
  28 + *
  29 + * @param id
  30 + * @return
  31 + */
  32 + CustomerCredit findById(@Param("id") String id);
  33 +
  34 + /**
  35 + * 查询已使用编码
  36 + *
  37 + * @param code 办事处首字母
  38 + * @return 已使用编码
  39 + */
  40 + Set<String> getGenerateCode(@Param("code") String code);
  41 +}
... ...
  1 +package com.lframework.xingyun.sc.service.customer;
  2 +
  3 +import com.lframework.starter.web.core.service.BaseMpService;
  4 +import com.lframework.starter.web.core.components.resp.PageResult;
  5 +import com.lframework.xingyun.sc.entity.CorePersonnel;
  6 +import com.lframework.xingyun.sc.vo.customer.credit.CreateCorePersonnelVo;
  7 +import com.lframework.xingyun.sc.vo.customer.credit.QueryCorePersonnelVo;
  8 +import com.lframework.xingyun.sc.vo.customer.credit.UpdateCorePersonnelVo;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 核心人员表 Service
  13 + */
  14 +public interface CorePersonnelService extends BaseMpService<CorePersonnel> {
  15 +
  16 + /**
  17 + * 查询列表
  18 + * @return
  19 + */
  20 + PageResult<CorePersonnel> query(Integer pageIndex, Integer pageSize, QueryCorePersonnelVo vo);
  21 +
  22 + /**
  23 + * 查询列表
  24 + * @param vo
  25 + * @return
  26 + */
  27 + List<CorePersonnel> query(QueryCorePersonnelVo vo);
  28 +
  29 + /**
  30 + * 根据ID查询
  31 + * @param id
  32 + * @return
  33 + */
  34 + CorePersonnel findById(String id);
  35 +
  36 + /**
  37 + * 创建
  38 + * @param vo
  39 + * @return
  40 + */
  41 + String create(CreateCorePersonnelVo vo);
  42 +
  43 + /**
  44 + * 修改
  45 + * @param vo
  46 + */
  47 + void update(UpdateCorePersonnelVo vo);
  48 +
  49 +}
... ...
  1 +package com.lframework.xingyun.sc.service.customer;
  2 +
  3 +import com.lframework.xingyun.sc.entity.CustomerCredit;
  4 +import com.lframework.starter.web.core.service.BaseMpService;
  5 +import com.lframework.starter.web.core.components.resp.PageResult;
  6 +import com.lframework.xingyun.sc.vo.customer.credit.CreateCustomerCreditVo;
  7 +import com.lframework.xingyun.sc.vo.customer.credit.QueryCustomerCreditVo;
  8 +import com.lframework.xingyun.sc.vo.customer.credit.UpdateCustomerCreditVo;
  9 +
  10 +import java.util.List;
  11 +
  12 +/**
  13 + * 客户资信表 Service
  14 + */
  15 +public interface CustomerCreditService extends BaseMpService<CustomerCredit> {
  16 +
  17 + /**
  18 + * 查询列表
  19 + * @return
  20 + */
  21 + PageResult<CustomerCredit> query(Integer pageIndex, Integer pageSize, QueryCustomerCreditVo vo);
  22 +
  23 + /**
  24 + * 查询列表
  25 + * @param vo
  26 + * @return
  27 + */
  28 + List<CustomerCredit> query(QueryCustomerCreditVo vo);
  29 +
  30 + /**
  31 + * 根据ID查询
  32 + * @param id
  33 + * @return
  34 + */
  35 + CustomerCredit findById(String id);
  36 +
  37 + /**
  38 + * 创建
  39 + * @param vo
  40 + * @return
  41 + */
  42 + String create(CreateCustomerCreditVo vo);
  43 +
  44 + /**
  45 + * 修改
  46 + * @param vo
  47 + */
  48 + void update(UpdateCustomerCreditVo vo);
  49 +
  50 + /**
  51 + * 根据ID删除
  52 + * @param id
  53 + * @return
  54 + */
  55 + void deleteById(String id);
  56 +
  57 + /**
  58 + * 自动生成资信编码
  59 + *
  60 + * @return 资信编码
  61 + */
  62 + String generateCode();
  63 +
  64 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.customer.credit;
  2 +
  3 +import javax.validation.constraints.NotBlank;
  4 +import com.lframework.starter.web.core.vo.BaseVo;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import org.hibernate.validator.constraints.Length;
  7 +import java.io.Serializable;
  8 +import lombok.Data;
  9 +
  10 +@Data
  11 +public class CreateCorePersonnelVo implements BaseVo, Serializable {
  12 +
  13 + private static final long serialVersionUID = 1L;
  14 +
  15 + /**
  16 + * 客户资信
  17 + */
  18 + @ApiModelProperty(value = "客户资信", required = true)
  19 + @NotBlank(message = "请输入客户资信!")
  20 + @Length(message = "客户资信最多允许32个字符!")
  21 + private String creditId;
  22 +
  23 + /**
  24 + * 姓名
  25 + */
  26 + @ApiModelProperty("姓名")
  27 + @Length(message = "姓名最多允许50个字符!")
  28 + private String name;
  29 +
  30 + /**
  31 + * 性别
  32 + */
  33 + @ApiModelProperty("性别")
  34 + @Length(message = "性别最多允许20个字符!")
  35 + private String sex;
  36 +
  37 + /**
  38 + * 籍贯
  39 + */
  40 + @ApiModelProperty("籍贯")
  41 + @Length(message = "籍贯最多允许100个字符!")
  42 + private String nativePlace;
  43 +
  44 + /**
  45 + * 年龄
  46 + */
  47 + @ApiModelProperty("年龄")
  48 + @Length(message = "年龄最多允许10个字符!")
  49 + private String age;
  50 +
  51 + /**
  52 + * 职务
  53 + */
  54 + @ApiModelProperty("职务")
  55 + @Length(message = "职务最多允许50个字符!")
  56 + private String position;
  57 +
  58 + /**
  59 + * 手机
  60 + */
  61 + @ApiModelProperty("手机")
  62 + @Length(message = "手机最多允许11个字符!")
  63 + private String mobile;
  64 +
  65 + /**
  66 + * 固定电话
  67 + */
  68 + @ApiModelProperty("固定电话")
  69 + @Length(message = "固定电话最多允许20个字符!")
  70 + private String phone;
  71 +
  72 + /**
  73 + * 邮箱地址
  74 + */
  75 + @ApiModelProperty("邮箱地址")
  76 + @Length(message = "邮箱地址最多允许50个字符!")
  77 + private String email;
  78 +
  79 + /**
  80 + * 现住址
  81 + */
  82 + @ApiModelProperty("现住址")
  83 + @Length(message = "现住址最多允许100个字符!")
  84 + private String address;
  85 +
  86 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.customer.credit;
  2 +
  3 +import java.math.BigDecimal;
  4 +import javax.validation.constraints.NotBlank;
  5 +import java.time.LocalDateTime;
  6 +import com.lframework.starter.web.core.vo.BaseVo;
  7 +import com.lframework.xingyun.sc.entity.CorePersonnel;
  8 +import io.swagger.annotations.ApiModelProperty;
  9 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  10 +import org.hibernate.validator.constraints.Length;
  11 +import java.io.Serializable;
  12 +import java.util.List;
  13 +
  14 +import lombok.Data;
  15 +
  16 +@Data
  17 +public class CreateCustomerCreditVo implements BaseVo, Serializable {
  18 +
  19 + private static final long serialVersionUID = 1L;
  20 +
  21 + /**
  22 + * 编号
  23 + */
  24 + @ApiModelProperty("编号")
  25 + @Length(message = "编号最多允许20个字符!")
  26 + private String serialNumber;
  27 +
  28 + /**
  29 + * 区域
  30 + */
  31 + @ApiModelProperty("区域")
  32 + @Length(message = "区域最多允许100个字符!")
  33 + private String region;
  34 +
  35 + /**
  36 + * 登记日期
  37 + */
  38 + @ApiModelProperty("登记日期")
  39 + @TypeMismatch(message = "登记日期格式有误!")
  40 + private LocalDateTime registerDate;
  41 +
  42 + /**
  43 + * 客户简称
  44 + */
  45 + @ApiModelProperty("客户简称")
  46 + @Length(message = "客户简称最多允许100个字符!")
  47 + private String customerShortName;
  48 +
  49 + /**
  50 + * 企业类型:经销商(distributor)、终端(terminal)
  51 + */
  52 + @ApiModelProperty(value = "企业类型:经销商(distributor)、终端(terminal)", required = true)
  53 + @NotBlank(message = "请输入企业类型:经销商(distributor)、终端(terminal)!")
  54 + @Length(message = "企业类型:经销商(distributor)、终端(terminal)最多允许100个字符!")
  55 + private String enterpriseType;
  56 +
  57 + /**
  58 + * 单位名称
  59 + */
  60 + @ApiModelProperty(value = "单位名称", required = true)
  61 + @NotBlank(message = "请输入单位名称!")
  62 + @Length(message = "单位名称最多允许32个字符!")
  63 + private String companyId;
  64 +
  65 + /**
  66 + * 企业性质
  67 + */
  68 + @ApiModelProperty("企业性质")
  69 + @Length(message = "企业性质最多允许100个字符!")
  70 + private String companyNature;
  71 +
  72 + /**
  73 + * 单位地址
  74 + */
  75 + @ApiModelProperty("单位地址")
  76 + @Length(message = "单位地址最多允许100个字符!")
  77 + private String companyAddress;
  78 +
  79 + /**
  80 + * 注册资本(单位:万元)
  81 + */
  82 + @ApiModelProperty("注册资本(单位:万元)")
  83 + @TypeMismatch(message = "注册资本(单位:万元)格式有误!")
  84 + private BigDecimal registeredCapital;
  85 +
  86 + /**
  87 + * 账号
  88 + */
  89 + @ApiModelProperty("账号")
  90 + @Length(message = "账号最多允许50个字符!")
  91 + private String bankAccount;
  92 +
  93 + /**
  94 + * 开户行
  95 + */
  96 + @ApiModelProperty("开户行")
  97 + @Length(message = "开户行最多允许100个字符!")
  98 + private String bankName;
  99 +
  100 + /**
  101 + * 税号
  102 + */
  103 + @ApiModelProperty("税号")
  104 + @Length(message = "税号最多允许50个字符!")
  105 + private String taxNumber;
  106 +
  107 + /**
  108 + * 注册时间
  109 + */
  110 + @ApiModelProperty("注册时间")
  111 + @TypeMismatch(message = "注册时间格式有误!")
  112 + private LocalDateTime registrationTime;
  113 +
  114 + /**
  115 + * 经营年限(年)
  116 + */
  117 + @ApiModelProperty("经营年限(年)")
  118 + @Length(message = "经营年限(年)最多允许10个字符!")
  119 + private String businessYears;
  120 +
  121 + /**
  122 + * 经营范围
  123 + */
  124 + @ApiModelProperty("经营范围")
  125 + @Length(message = "经营范围最多允许65,535个字符!")
  126 + private String businessScope;
  127 +
  128 + /**
  129 + * 经营场地属性
  130 + */
  131 + @ApiModelProperty("经营场地属性")
  132 + @Length(message = "经营场地属性最多允许50个字符!")
  133 + private String businessProperty;
  134 +
  135 + /**
  136 + * 占地面积(平方米)
  137 + */
  138 + @ApiModelProperty("占地面积(平方米)")
  139 + @TypeMismatch(message = "占地面积(平方米)格式有误!")
  140 + private String landArea;
  141 +
  142 + /**
  143 + * 仓储条件
  144 + */
  145 + @ApiModelProperty("仓储条件")
  146 + @Length(message = "仓储条件最多允许100个字符!")
  147 + private String storageConditions;
  148 +
  149 + /**
  150 + * 员工人数
  151 + */
  152 + @ApiModelProperty("员工人数")
  153 + @TypeMismatch(message = "员工人数格式有误!")
  154 + private Integer employeeCount;
  155 +
  156 + /**
  157 + * 设备属性
  158 + */
  159 + @ApiModelProperty("设备属性")
  160 + @Length(message = "设备属性最多允许100个字符!")
  161 + private String equipmentAttributes;
  162 +
  163 + /**
  164 + * 资产评估
  165 + */
  166 + @ApiModelProperty("资产评估")
  167 + @Length(message = "资产评估最多允许200个字符!")
  168 + private String assetEvaluation;
  169 +
  170 + /**
  171 + * 上年度销售额(万元)
  172 + */
  173 + @ApiModelProperty("上年度销售额(万元)")
  174 + @Length(message = "上年度销售额(万元)最多允许50个字符!")
  175 + private String lastYearSales;
  176 +
  177 + /**
  178 + * 月均销量(万元)
  179 + */
  180 + @ApiModelProperty("月均销量(万元)")
  181 + @Length(message = "月均销量(万元)最多允许50个字符!")
  182 + private String monthlyAvgSales;
  183 +
  184 + /**
  185 + * 销项发票所开品名与计量单位
  186 + */
  187 + @ApiModelProperty("销项发票所开品名与计量单位")
  188 + @Length(message = "销项发票所开品名与计量单位最多允许50个字符!")
  189 + private String invoiceItemUnit;
  190 +
  191 + /**
  192 + * 认证证书
  193 + */
  194 + @ApiModelProperty("认证证书")
  195 + @Length(message = "认证证书最多允许100个字符!")
  196 + private String certificationCertificate;
  197 +
  198 + /**
  199 + * 我司售于产品与经营范围是否匹配
  200 + */
  201 + @ApiModelProperty("我司售于产品与经营范围是否匹配")
  202 + @Length(message = "我司售于产品与经营范围是否匹配最多允许50个字符!")
  203 + private String productMatch;
  204 +
  205 + /**
  206 + * 主要客户
  207 + */
  208 + @ApiModelProperty("主要客户")
  209 + @Length(message = "主要客户最多允许200个字符!")
  210 + private String majorCustomers;
  211 +
  212 + /**
  213 + * 主营项目
  214 + */
  215 + @ApiModelProperty("主营项目")
  216 + @Length(message = "主营项目最多允许65,535个字符!")
  217 + private String mainProjects;
  218 +
  219 + /**
  220 + * 从事行业
  221 + */
  222 + @ApiModelProperty("从事行业")
  223 + @Length(message = "从事行业最多允许50个字符!")
  224 + private String industryInvolved;
  225 +
  226 + /**
  227 + * 在该行业中的经验
  228 + */
  229 + @ApiModelProperty("在该行业中的经验")
  230 + @Length(message = "在该行业中的经验最多允许200个字符!")
  231 + private String industryExperience;
  232 +
  233 + /**
  234 + * 是否与其他企业有经济纠纷 违规信息 拖欠员工薪资等
  235 + */
  236 + @ApiModelProperty("是否与其他企业有经济纠纷 违规信息 拖欠员工薪资等")
  237 + @Length(message = "是否与其他企业有经济纠纷 违规信息 拖欠员工薪资等最多允许200个字符!")
  238 + private String hasDispute;
  239 +
  240 + /**
  241 + * 与我司合作时间
  242 + */
  243 + @ApiModelProperty("与我司合作时间")
  244 + @Length(message = "与我司合作时间最多允许50个字符!")
  245 + private String cooperationStartDate;
  246 +
  247 + /**
  248 + * 月均操作量
  249 + */
  250 + @ApiModelProperty("月均操作量")
  251 + @Length(message = "月均操作量最多允许50个字符!")
  252 + private String monthlyAvgVolume;
  253 +
  254 + /**
  255 + * 是否口头协议操作
  256 + */
  257 + @ApiModelProperty("是否口头协议操作")
  258 + @Length(message = "是否口头协议操作最多允许100个字符!")
  259 + private String isVerbalAgreement;
  260 +
  261 + /**
  262 + * 是否签订其他协议(列举)
  263 + */
  264 + @ApiModelProperty("是否签订其他协议(列举)")
  265 + @Length(message = "是否签订其他协议(列举)最多允许65,535个字符!")
  266 + private String otherAgreements;
  267 +
  268 + /**
  269 + * 与我司操作是否签订长年合同
  270 + */
  271 + @ApiModelProperty("与我司操作是否签订长年合同")
  272 + @Length(message = "与我司操作是否签订长年合同最多允许100个字符!")
  273 + private String hasLongTermContract;
  274 +
  275 + /**
  276 + * 合同类型
  277 + */
  278 + @ApiModelProperty("合同类型")
  279 + @Length(message = "合同类型最多允许100个字符!")
  280 + private String contractType;
  281 +
  282 + /**
  283 + * 是否有过中断及中断原因
  284 + */
  285 + @ApiModelProperty("是否有过中断及中断原因")
  286 + @Length(message = "是否有过中断及中断原因最多允许65,535个字符!")
  287 + private String hasInterruption;
  288 +
  289 + /**
  290 + * 结算期限
  291 + */
  292 + @ApiModelProperty("结算期限")
  293 + @Length(message = "结算期限最多允许100个字符!")
  294 + private String settlementPeriod;
  295 +
  296 + /**
  297 + * 加工操作方案
  298 + */
  299 + @ApiModelProperty("加工操作方案")
  300 + @Length(message = "加工操作方案最多允许100个字符!")
  301 + private String materialSupplyPlan;
  302 +
  303 + /**
  304 + * 建议客户分类:AAA、AA、A、BBB、BB、B、C、D
  305 + */
  306 + @ApiModelProperty(value = "建议客户分类:AAA、AA、A、BBB、BB、B、C、D", required = true)
  307 + @NotBlank(message = "请输入建议客户分类:AAA、AA、A、BBB、BB、B、C、D!")
  308 + @Length(message = "建议客户分类:AAA、AA、A、BBB、BB、B、C、D最多允许50个字符!")
  309 + private String suggestedCategory;
  310 +
  311 + /**
  312 + * 授信额度(万元)
  313 + */
  314 + @ApiModelProperty("授信额度(万元)")
  315 + @Length(message = "授信额度(万元)最多允许20个字符!")
  316 + private String creditLimit;
  317 +
  318 + /**
  319 + * 调查人
  320 + */
  321 + @ApiModelProperty("调查人")
  322 + @Length(message = "调查人最多允许50个字符!")
  323 + private String investigator;
  324 +
  325 + /**
  326 + * 主管审核
  327 + */
  328 + @ApiModelProperty("主管审核")
  329 + @Length(message = "主管审核最多允许50个字符!")
  330 + private String supervisorReview;
  331 +
  332 + /**
  333 + * 年度总销量(万元)
  334 + */
  335 + @ApiModelProperty("年度总销量(万元)")
  336 + @Length(message = "年度总销量(万元)最多允许20个字符!")
  337 + private String annualTotalSales;
  338 +
  339 + /**
  340 + * 主要行业
  341 + */
  342 + @ApiModelProperty("主要行业")
  343 + @Length(message = "主要行业最多允许100个字符!")
  344 + private String mainIndustry;
  345 +
  346 + /**
  347 + * 年度款料概况
  348 + */
  349 + @ApiModelProperty("年度款料概况")
  350 + @Length(message = "年度款料概况最多允许65,535个字符!")
  351 + private String annualMaterialOverview;
  352 +
  353 + /**
  354 + * 结算期限
  355 + */
  356 + @ApiModelProperty("结算期限")
  357 + @Length(message = "结算期限最多允许100个字符!")
  358 + private String companySettlementPeriod;
  359 +
  360 + /**
  361 + * 授信额度(万元)
  362 + */
  363 + @ApiModelProperty("授信额度(万元)")
  364 + @Length(message = "授信额度(万元)最多允许20个字符!")
  365 + private String companyCreditLimit;
  366 +
  367 + /**
  368 + * 加工操作方案
  369 + */
  370 + @ApiModelProperty("加工操作方案")
  371 + @Length(message = "加工操作方案最多允许100个字符!")
  372 + private String companyMaterialSupplyPlan;
  373 +
  374 + /**
  375 + * 客户分类:AAA、AA、A、BBB、BB、B、C、D
  376 + */
  377 + @ApiModelProperty(value = "客户分类:AAA、AA、A、BBB、BB、B、C、D", required = true)
  378 + @NotBlank(message = "请输入客户分类:AAA、AA、A、BBB、BB、B、C、D!")
  379 + @Length(message = "客户分类:AAA、AA、A、BBB、BB、B、C、D最多允许50个字符!")
  380 + private String companySuggestedCategory;
  381 +
  382 + /**
  383 + * 审核状态
  384 + */
  385 + @ApiModelProperty(value = "审核状态", required = true)
  386 + @NotBlank(message = "请输入审核状态!")
  387 + private String status;
  388 +
  389 + /**
  390 + * 核心人员
  391 + */
  392 + @ApiModelProperty("核心人员")
  393 + private List<CreateCorePersonnelVo> corePersonnelList;
  394 +
  395 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.customer.credit;
  2 +
  3 +import lombok.Data;
  4 +import com.lframework.starter.web.core.vo.PageVo;
  5 +import com.lframework.starter.web.core.vo.BaseVo;
  6 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  7 +import io.swagger.annotations.ApiModelProperty;
  8 +import java.io.Serializable;
  9 +
  10 +@Data
  11 +public class QueryCorePersonnelVo extends PageVo implements BaseVo, Serializable {
  12 +
  13 + private static final long serialVersionUID = 1L;
  14 +
  15 + /**
  16 + * 客户资信
  17 + */
  18 + @ApiModelProperty("客户资信")
  19 + private String creditId;
  20 +
  21 + /**
  22 + * 姓名
  23 + */
  24 + @ApiModelProperty("姓名")
  25 + private String name;
  26 +
  27 + /**
  28 + * 性别
  29 + */
  30 + @ApiModelProperty("性别")
  31 + private String sex;
  32 +
  33 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.customer.credit;
  2 +
  3 +import lombok.Data;
  4 +import com.lframework.starter.web.core.vo.PageVo;
  5 +import java.time.LocalDateTime;
  6 +import com.lframework.starter.web.core.vo.BaseVo;
  7 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  8 +import io.swagger.annotations.ApiModelProperty;
  9 +import java.io.Serializable;
  10 +
  11 +@Data
  12 +public class QueryCustomerCreditVo extends PageVo implements BaseVo, Serializable {
  13 +
  14 + private static final long serialVersionUID = 1L;
  15 +
  16 + /**
  17 + * 登记开始日期
  18 + */
  19 + @ApiModelProperty("登记开始日期")
  20 + private String registerDateStart;
  21 +
  22 + /**
  23 + * 登记结束日期
  24 + */
  25 + @ApiModelProperty("登记结束日期")
  26 + private String registerDateEnd;
  27 +
  28 + /**
  29 + * 客户简称
  30 + */
  31 + @ApiModelProperty("客户简称")
  32 + private String customerShortName;
  33 +
  34 + /**
  35 + * 企业类型:经销商(distributor)、终端(terminal)
  36 + */
  37 + @ApiModelProperty("企业类型:经销商(distributor)、终端(terminal)")
  38 + private String enterpriseType;
  39 +
  40 + /**
  41 + * 审核状态
  42 + */
  43 + @ApiModelProperty("审核状态")
  44 + private String status;
  45 +
  46 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.customer.credit;
  2 +
  3 +import lombok.Data;
  4 +import javax.validation.constraints.NotBlank;
  5 +import java.time.LocalDateTime;
  6 +import com.lframework.starter.web.core.vo.BaseVo;
  7 +import javax.validation.constraints.NotNull;
  8 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  9 +import io.swagger.annotations.ApiModelProperty;
  10 +import org.hibernate.validator.constraints.Length;
  11 +import java.io.Serializable;
  12 +
  13 +@Data
  14 +public class UpdateCorePersonnelVo implements BaseVo, Serializable {
  15 +
  16 + private static final long serialVersionUID = 1L;
  17 +
  18 + /**
  19 + * ID
  20 + */
  21 + @ApiModelProperty(value = "ID", required = true)
  22 + @NotBlank(message = "id不能为空!")
  23 + private String id;
  24 +
  25 + /**
  26 + * 客户资信
  27 + */
  28 + @ApiModelProperty(value = "客户资信", required = true)
  29 + @NotBlank(message = "请输入客户资信!")
  30 + @Length(message = "客户资信最多允许32个字符!")
  31 + private String creditId;
  32 +
  33 + /**
  34 + * 姓名
  35 + */
  36 + @ApiModelProperty("姓名")
  37 + @Length(message = "姓名最多允许50个字符!")
  38 + private String name;
  39 +
  40 + /**
  41 + * 性别
  42 + */
  43 + @ApiModelProperty("性别")
  44 + @Length(message = "性别最多允许20个字符!")
  45 + private String sex;
  46 +
  47 + /**
  48 + * 籍贯
  49 + */
  50 + @ApiModelProperty("籍贯")
  51 + @Length(message = "籍贯最多允许100个字符!")
  52 + private String nativePlace;
  53 +
  54 + /**
  55 + * 年龄
  56 + */
  57 + @ApiModelProperty("年龄")
  58 + @Length(message = "年龄最多允许10个字符!")
  59 + private String age;
  60 +
  61 + /**
  62 + * 职务
  63 + */
  64 + @ApiModelProperty("职务")
  65 + @Length(message = "职务最多允许50个字符!")
  66 + private String position;
  67 +
  68 + /**
  69 + * 手机
  70 + */
  71 + @ApiModelProperty("手机")
  72 + @Length(message = "手机最多允许11个字符!")
  73 + private String mobile;
  74 +
  75 + /**
  76 + * 固定电话
  77 + */
  78 + @ApiModelProperty("固定电话")
  79 + @Length(message = "固定电话最多允许20个字符!")
  80 + private String phone;
  81 +
  82 + /**
  83 + * 邮箱地址
  84 + */
  85 + @ApiModelProperty("邮箱地址")
  86 + @Length(message = "邮箱地址最多允许50个字符!")
  87 + private String email;
  88 +
  89 + /**
  90 + * 现住址
  91 + */
  92 + @ApiModelProperty("现住址")
  93 + @Length(message = "现住址最多允许100个字符!")
  94 + private String address;
  95 +
  96 +
  97 +}
... ...
  1 +package com.lframework.xingyun.sc.vo.customer.credit;
  2 +
  3 +import lombok.Data;
  4 +import java.math.BigDecimal;
  5 +import javax.validation.constraints.NotBlank;
  6 +import java.time.LocalDateTime;
  7 +import com.lframework.starter.web.core.vo.BaseVo;
  8 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  9 +import io.swagger.annotations.ApiModelProperty;
  10 +import org.hibernate.validator.constraints.Length;
  11 +import java.io.Serializable;
  12 +import java.util.List;
  13 +
  14 +@Data
  15 +public class UpdateCustomerCreditVo implements BaseVo, Serializable {
  16 +
  17 + private static final long serialVersionUID = 1L;
  18 +
  19 + /**
  20 + * ID
  21 + */
  22 + @ApiModelProperty(value = "ID", required = true)
  23 + @NotBlank(message = "id不能为空!")
  24 + private String id;
  25 +
  26 + /**
  27 + * 区域
  28 + */
  29 + @ApiModelProperty("区域")
  30 + @Length(message = "区域最多允许100个字符!")
  31 + private String region;
  32 +
  33 + /**
  34 + * 登记日期
  35 + */
  36 + @ApiModelProperty("登记日期")
  37 + @TypeMismatch(message = "登记日期格式有误!")
  38 + private LocalDateTime registerDate;
  39 +
  40 + /**
  41 + * 客户简称
  42 + */
  43 + @ApiModelProperty("客户简称")
  44 + @Length(message = "客户简称最多允许100个字符!")
  45 + private String customerShortName;
  46 +
  47 + /**
  48 + * 企业类型:经销商(distributor)、终端(terminal)
  49 + */
  50 + @ApiModelProperty(value = "企业类型:经销商(distributor)、终端(terminal)", required = true)
  51 + @NotBlank(message = "请输入企业类型:经销商(distributor)、终端(terminal)!")
  52 + @Length(message = "企业类型:经销商(distributor)、终端(terminal)最多允许100个字符!")
  53 + private String enterpriseType;
  54 +
  55 + /**
  56 + * 单位名称
  57 + */
  58 + @ApiModelProperty(value = "单位名称", required = true)
  59 + @NotBlank(message = "请输入单位名称!")
  60 + @Length(message = "单位名称最多允许32个字符!")
  61 + private String companyId;
  62 +
  63 + /**
  64 + * 企业性质
  65 + */
  66 + @ApiModelProperty("企业性质")
  67 + @Length(message = "企业性质最多允许100个字符!")
  68 + private String companyNature;
  69 +
  70 + /**
  71 + * 单位地址
  72 + */
  73 + @ApiModelProperty("单位地址")
  74 + @Length(message = "单位地址最多允许100个字符!")
  75 + private String companyAddress;
  76 +
  77 + /**
  78 + * 注册资本(单位:万元)
  79 + */
  80 + @ApiModelProperty("注册资本(单位:万元)")
  81 + @TypeMismatch(message = "注册资本(单位:万元)格式有误!")
  82 + private BigDecimal registeredCapital;
  83 +
  84 + /**
  85 + * 账号
  86 + */
  87 + @ApiModelProperty("账号")
  88 + @Length(message = "账号最多允许50个字符!")
  89 + private String bankAccount;
  90 +
  91 + /**
  92 + * 开户行
  93 + */
  94 + @ApiModelProperty("开户行")
  95 + @Length(message = "开户行最多允许100个字符!")
  96 + private String bankName;
  97 +
  98 + /**
  99 + * 税号
  100 + */
  101 + @ApiModelProperty("税号")
  102 + @Length(message = "税号最多允许50个字符!")
  103 + private String taxNumber;
  104 +
  105 + /**
  106 + * 注册时间
  107 + */
  108 + @ApiModelProperty("注册时间")
  109 + @TypeMismatch(message = "注册时间格式有误!")
  110 + private LocalDateTime registrationTime;
  111 +
  112 + /**
  113 + * 经营年限(年)
  114 + */
  115 + @ApiModelProperty("经营年限(年)")
  116 + @Length(message = "经营年限(年)最多允许10个字符!")
  117 + private String businessYears;
  118 +
  119 + /**
  120 + * 经营范围
  121 + */
  122 + @ApiModelProperty("经营范围")
  123 + @Length(message = "经营范围最多允许65,535个字符!")
  124 + private String businessScope;
  125 +
  126 + /**
  127 + * 经营场地属性
  128 + */
  129 + @ApiModelProperty("经营场地属性")
  130 + @Length(message = "经营场地属性最多允许50个字符!")
  131 + private String businessProperty;
  132 +
  133 + /**
  134 + * 占地面积(平方米)
  135 + */
  136 + @ApiModelProperty("占地面积(平方米)")
  137 + @TypeMismatch(message = "占地面积(平方米)格式有误!")
  138 + private String landArea;
  139 +
  140 + /**
  141 + * 仓储条件
  142 + */
  143 + @ApiModelProperty("仓储条件")
  144 + @Length(message = "仓储条件最多允许100个字符!")
  145 + private String storageConditions;
  146 +
  147 + /**
  148 + * 员工人数
  149 + */
  150 + @ApiModelProperty("员工人数")
  151 + @TypeMismatch(message = "员工人数格式有误!")
  152 + private Integer employeeCount;
  153 +
  154 + /**
  155 + * 设备属性
  156 + */
  157 + @ApiModelProperty("设备属性")
  158 + @Length(message = "设备属性最多允许100个字符!")
  159 + private String equipmentAttributes;
  160 +
  161 + /**
  162 + * 资产评估
  163 + */
  164 + @ApiModelProperty("资产评估")
  165 + @Length(message = "资产评估最多允许200个字符!")
  166 + private String assetEvaluation;
  167 +
  168 + /**
  169 + * 上年度销售额(万元)
  170 + */
  171 + @ApiModelProperty("上年度销售额(万元)")
  172 + @Length(message = "上年度销售额(万元)最多允许50个字符!")
  173 + private String lastYearSales;
  174 +
  175 + /**
  176 + * 月均销量(万元)
  177 + */
  178 + @ApiModelProperty("月均销量(万元)")
  179 + @Length(message = "月均销量(万元)最多允许50个字符!")
  180 + private String monthlyAvgSales;
  181 +
  182 + /**
  183 + * 销项发票所开品名与计量单位
  184 + */
  185 + @ApiModelProperty("销项发票所开品名与计量单位")
  186 + @Length(message = "销项发票所开品名与计量单位最多允许50个字符!")
  187 + private String invoiceItemUnit;
  188 +
  189 + /**
  190 + * 认证证书
  191 + */
  192 + @ApiModelProperty("认证证书")
  193 + @Length(message = "认证证书最多允许100个字符!")
  194 + private String certificationCertificate;
  195 +
  196 + /**
  197 + * 我司售于产品与经营范围是否匹配
  198 + */
  199 + @ApiModelProperty("我司售于产品与经营范围是否匹配")
  200 + @Length(message = "我司售于产品与经营范围是否匹配最多允许50个字符!")
  201 + private String productMatch;
  202 +
  203 + /**
  204 + * 主要客户
  205 + */
  206 + @ApiModelProperty("主要客户")
  207 + @Length(message = "主要客户最多允许200个字符!")
  208 + private String majorCustomers;
  209 +
  210 + /**
  211 + * 主营项目
  212 + */
  213 + @ApiModelProperty("主营项目")
  214 + @Length(message = "主营项目最多允许65,535个字符!")
  215 + private String mainProjects;
  216 +
  217 + /**
  218 + * 从事行业
  219 + */
  220 + @ApiModelProperty("从事行业")
  221 + @Length(message = "从事行业最多允许50个字符!")
  222 + private String industryInvolved;
  223 +
  224 + /**
  225 + * 在该行业中的经验
  226 + */
  227 + @ApiModelProperty("在该行业中的经验")
  228 + @Length(message = "在该行业中的经验最多允许200个字符!")
  229 + private String industryExperience;
  230 +
  231 + /**
  232 + * 是否与其他企业有经济纠纷 违规信息 拖欠员工薪资等
  233 + */
  234 + @ApiModelProperty("是否与其他企业有经济纠纷 违规信息 拖欠员工薪资等")
  235 + @Length(message = "是否与其他企业有经济纠纷 违规信息 拖欠员工薪资等最多允许200个字符!")
  236 + private String hasDispute;
  237 +
  238 + /**
  239 + * 与我司合作时间
  240 + */
  241 + @ApiModelProperty("与我司合作时间")
  242 + @Length(message = "与我司合作时间最多允许50个字符!")
  243 + private String cooperationStartDate;
  244 +
  245 + /**
  246 + * 月均操作量
  247 + */
  248 + @ApiModelProperty("月均操作量")
  249 + @Length(message = "月均操作量最多允许50个字符!")
  250 + private String monthlyAvgVolume;
  251 +
  252 + /**
  253 + * 是否口头协议操作
  254 + */
  255 + @ApiModelProperty("是否口头协议操作")
  256 + @Length(message = "是否口头协议操作最多允许100个字符!")
  257 + private String isVerbalAgreement;
  258 +
  259 + /**
  260 + * 是否签订其他协议(列举)
  261 + */
  262 + @ApiModelProperty("是否签订其他协议(列举)")
  263 + @Length(message = "是否签订其他协议(列举)最多允许65,535个字符!")
  264 + private String otherAgreements;
  265 +
  266 + /**
  267 + * 与我司操作是否签订长年合同
  268 + */
  269 + @ApiModelProperty("与我司操作是否签订长年合同")
  270 + @Length(message = "与我司操作是否签订长年合同最多允许100个字符!")
  271 + private String hasLongTermContract;
  272 +
  273 + /**
  274 + * 合同类型
  275 + */
  276 + @ApiModelProperty("合同类型")
  277 + @Length(message = "合同类型最多允许100个字符!")
  278 + private String contractType;
  279 +
  280 + /**
  281 + * 是否有过中断及中断原因
  282 + */
  283 + @ApiModelProperty("是否有过中断及中断原因")
  284 + @Length(message = "是否有过中断及中断原因最多允许65,535个字符!")
  285 + private String hasInterruption;
  286 +
  287 + /**
  288 + * 结算期限
  289 + */
  290 + @ApiModelProperty("结算期限")
  291 + @Length(message = "结算期限最多允许100个字符!")
  292 + private String settlementPeriod;
  293 +
  294 + /**
  295 + * 加工操作方案
  296 + */
  297 + @ApiModelProperty("加工操作方案")
  298 + @Length(message = "加工操作方案最多允许100个字符!")
  299 + private String materialSupplyPlan;
  300 +
  301 + /**
  302 + * 建议客户分类:AAA、AA、A、BBB、BB、B、C、D
  303 + */
  304 + @ApiModelProperty(value = "建议客户分类:AAA、AA、A、BBB、BB、B、C、D", required = true)
  305 + @NotBlank(message = "请输入建议客户分类:AAA、AA、A、BBB、BB、B、C、D!")
  306 + @Length(message = "建议客户分类:AAA、AA、A、BBB、BB、B、C、D最多允许50个字符!")
  307 + private String suggestedCategory;
  308 +
  309 + /**
  310 + * 授信额度(万元)
  311 + */
  312 + @ApiModelProperty("授信额度(万元)")
  313 + @Length(message = "授信额度(万元)最多允许20个字符!")
  314 + private String creditLimit;
  315 +
  316 + /**
  317 + * 调查人
  318 + */
  319 + @ApiModelProperty("调查人")
  320 + @Length(message = "调查人最多允许50个字符!")
  321 + private String investigator;
  322 +
  323 + /**
  324 + * 主管审核
  325 + */
  326 + @ApiModelProperty("主管审核")
  327 + @Length(message = "主管审核最多允许50个字符!")
  328 + private String supervisorReview;
  329 +
  330 + /**
  331 + * 年度总销量(万元)
  332 + */
  333 + @ApiModelProperty("年度总销量(万元)")
  334 + @Length(message = "年度总销量(万元)最多允许20个字符!")
  335 + private String annualTotalSales;
  336 +
  337 + /**
  338 + * 主要行业
  339 + */
  340 + @ApiModelProperty("主要行业")
  341 + @Length(message = "主要行业最多允许100个字符!")
  342 + private String mainIndustry;
  343 +
  344 + /**
  345 + * 年度款料概况
  346 + */
  347 + @ApiModelProperty("年度款料概况")
  348 + @Length(message = "年度款料概况最多允许65,535个字符!")
  349 + private String annualMaterialOverview;
  350 +
  351 + /**
  352 + * 结算期限
  353 + */
  354 + @ApiModelProperty("结算期限")
  355 + @Length(message = "结算期限最多允许100个字符!")
  356 + private String companySettlementPeriod;
  357 +
  358 + /**
  359 + * 授信额度(万元)
  360 + */
  361 + @ApiModelProperty("授信额度(万元)")
  362 + @Length(message = "授信额度(万元)最多允许20个字符!")
  363 + private String companyCreditLimit;
  364 +
  365 + /**
  366 + * 加工操作方案
  367 + */
  368 + @ApiModelProperty("加工操作方案")
  369 + @Length(message = "加工操作方案最多允许100个字符!")
  370 + private String companyMaterialSupplyPlan;
  371 +
  372 + /**
  373 + * 客户分类:AAA、AA、A、BBB、BB、B、C、D
  374 + */
  375 + @ApiModelProperty(value = "客户分类:AAA、AA、A、BBB、BB、B、C、D", required = true)
  376 + @NotBlank(message = "请输入客户分类:AAA、AA、A、BBB、BB、B、C、D!")
  377 + @Length(message = "客户分类:AAA、AA、A、BBB、BB、B、C、D最多允许50个字符!")
  378 + private String companySuggestedCategory;
  379 +
  380 + /**
  381 + * 审核状态
  382 + */
  383 + @ApiModelProperty(value = "审核状态", required = true)
  384 + @NotBlank(message = "请输入审核状态!")
  385 + private String status;
  386 +
  387 + /**
  388 + * 核心人员
  389 + */
  390 + @ApiModelProperty("核心人员")
  391 + private List<CreateCorePersonnelVo> corePersonnelList;
  392 +
  393 +}
... ...
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.lframework.xingyun.sc.mappers.CorePersonnelMapper">
  4 +
  5 + <resultMap id="CorePersonnel" type="com.lframework.xingyun.sc.entity.CorePersonnel">
  6 + <id column="id" property="id"/>
  7 + <result column="credit_id" property="creditId"/>
  8 + <result column="name" property="name"/>
  9 + <result column="sex" property="sex"/>
  10 + <result column="native_place" property="nativePlace"/>
  11 + <result column="age" property="age"/>
  12 + <result column="position" property="position"/>
  13 + <result column="mobile" property="mobile"/>
  14 + <result column="phone" property="phone"/>
  15 + <result column="email" property="email"/>
  16 + <result column="address" property="address"/>
  17 + <result column="create_by_id" property="createById"/>
  18 + <result column="create_by" property="createBy"/>
  19 + <result column="update_by_id" property="updateById"/>
  20 + <result column="update_by" property="updateBy"/>
  21 + <result column="create_time" property="createTime"/>
  22 + <result column="update_time" property="updateTime"/>
  23 + </resultMap>
  24 +
  25 + <sql id="CorePersonnel_sql">
  26 + SELECT
  27 + tb.id,
  28 + tb.credit_id,
  29 + tb.name,
  30 + tb.sex,
  31 + tb.native_place,
  32 + tb.age,
  33 + tb.position,
  34 + tb.mobile,
  35 + tb.phone,
  36 + tb.email,
  37 + tb.address,
  38 + tb.create_by_id,
  39 + tb.create_by,
  40 + tb.update_by_id,
  41 + tb.update_by,
  42 + tb.create_time,
  43 + tb.update_time
  44 + FROM core_personnel AS tb
  45 + </sql>
  46 +
  47 + <select id="query" resultMap="CorePersonnel">
  48 + <include refid="CorePersonnel_sql"/>
  49 + <where>
  50 + <if test="vo.creditId != null and vo.creditId != ''">
  51 + AND tb.credit_id = #{vo.creditId}
  52 + </if>
  53 + <if test="vo.name != null and vo.name != ''">
  54 + AND tb.name LIKE CONCAT('%', #{vo.name})
  55 + </if>
  56 + <if test="vo.sex != null and vo.sex != ''">
  57 + AND tb.sex = #{vo.sex}
  58 + </if>
  59 + </where>
  60 + </select>
  61 +</mapper>
... ...
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.lframework.xingyun.sc.mappers.CustomerCreditMapper">
  4 +
  5 + <resultMap id="CustomerCredit" type="com.lframework.xingyun.sc.entity.CustomerCredit">
  6 + <id column="id" property="id"/>
  7 + <result column="serial_number" property="serialNumber"/>
  8 + <result column="region" property="region"/>
  9 + <result column="register_date" property="registerDate"/>
  10 + <result column="customer_short_name" property="customerShortName"/>
  11 + <result column="enterprise_type" property="enterpriseType"/>
  12 + <result column="company_id" property="companyId"/>
  13 + <result column="company_name" property="companyName"/>
  14 + <result column="company_nature" property="companyNature"/>
  15 + <result column="company_address" property="companyAddress"/>
  16 + <result column="registered_capital" property="registeredCapital"/>
  17 + <result column="bank_account" property="bankAccount"/>
  18 + <result column="bank_name" property="bankName"/>
  19 + <result column="tax_number" property="taxNumber"/>
  20 + <result column="registration_time" property="registrationTime"/>
  21 + <result column="business_years" property="businessYears"/>
  22 + <result column="business_scope" property="businessScope"/>
  23 + <result column="business_property" property="businessProperty"/>
  24 + <result column="land_area" property="landArea"/>
  25 + <result column="storage_conditions" property="storageConditions"/>
  26 + <result column="employee_count" property="employeeCount"/>
  27 + <result column="equipment_attributes" property="equipmentAttributes"/>
  28 + <result column="asset_evaluation" property="assetEvaluation"/>
  29 + <result column="last_year_sales" property="lastYearSales"/>
  30 + <result column="monthly_avg_sales" property="monthlyAvgSales"/>
  31 + <result column="invoice_item_unit" property="invoiceItemUnit"/>
  32 + <result column="certification_certificate" property="certificationCertificate"/>
  33 + <result column="product_match" property="productMatch"/>
  34 + <result column="major_customers" property="majorCustomers"/>
  35 + <result column="main_projects" property="mainProjects"/>
  36 + <result column="industry_involved" property="industryInvolved"/>
  37 + <result column="industry_experience" property="industryExperience"/>
  38 + <result column="has_dispute" property="hasDispute"/>
  39 + <result column="cooperation_start_date" property="cooperationStartDate"/>
  40 + <result column="monthly_avg_volume" property="monthlyAvgVolume"/>
  41 + <result column="is_verbal_agreement" property="isVerbalAgreement"/>
  42 + <result column="other_agreements" property="otherAgreements"/>
  43 + <result column="has_long_term_contract" property="hasLongTermContract"/>
  44 + <result column="contract_type" property="contractType"/>
  45 + <result column="has_interruption" property="hasInterruption"/>
  46 + <result column="settlement_period" property="settlementPeriod"/>
  47 + <result column="material_supply_plan" property="materialSupplyPlan"/>
  48 + <result column="suggested_category" property="suggestedCategory"/>
  49 + <result column="credit_limit" property="creditLimit"/>
  50 + <result column="investigator" property="investigator"/>
  51 + <result column="supervisor_review" property="supervisorReview"/>
  52 + <result column="annual_total_sales" property="annualTotalSales"/>
  53 + <result column="main_industry" property="mainIndustry"/>
  54 + <result column="annual_material_overview" property="annualMaterialOverview"/>
  55 + <result column="company_settlement_period" property="companySettlementPeriod"/>
  56 + <result column="company_credit_limit" property="companyCreditLimit"/>
  57 + <result column="company_material_supply_plan" property="companyMaterialSupplyPlan"/>
  58 + <result column="company_suggested_category" property="companySuggestedCategory"/>
  59 + <result column="status" property="status"/>
  60 + <result column="create_by_id" property="createById"/>
  61 + <result column="create_by" property="createBy"/>
  62 + <result column="update_by_id" property="updateById"/>
  63 + <result column="update_by" property="updateBy"/>
  64 + <result column="create_time" property="createTime"/>
  65 + <result column="update_time" property="updateTime"/>
  66 + </resultMap>
  67 +
  68 + <sql id="CustomerCredit_sql">
  69 + SELECT
  70 + tb.id,
  71 + tb.serial_number,
  72 + tb.region,
  73 + tb.register_date,
  74 + tb.customer_short_name,
  75 + tb.enterprise_type,
  76 + tb.company_id,
  77 + cu.name AS company_name,
  78 + tb.company_nature,
  79 + tb.company_address,
  80 + tb.registered_capital,
  81 + tb.bank_account,
  82 + tb.bank_name,
  83 + tb.tax_number,
  84 + tb.registration_time,
  85 + tb.business_years,
  86 + tb.business_scope,
  87 + tb.business_property,
  88 + tb.land_area,
  89 + tb.storage_conditions,
  90 + tb.employee_count,
  91 + tb.equipment_attributes,
  92 + tb.asset_evaluation,
  93 + tb.last_year_sales,
  94 + tb.monthly_avg_sales,
  95 + tb.invoice_item_unit,
  96 + tb.certification_certificate,
  97 + tb.product_match,
  98 + tb.major_customers,
  99 + tb.main_projects,
  100 + tb.industry_involved,
  101 + tb.industry_experience,
  102 + tb.has_dispute,
  103 + tb.cooperation_start_date,
  104 + tb.monthly_avg_volume,
  105 + tb.is_verbal_agreement,
  106 + tb.other_agreements,
  107 + tb.has_long_term_contract,
  108 + tb.contract_type,
  109 + tb.has_interruption,
  110 + tb.settlement_period,
  111 + tb.material_supply_plan,
  112 + tb.suggested_category,
  113 + tb.credit_limit,
  114 + tb.investigator,
  115 + tb.supervisor_review,
  116 + tb.annual_total_sales,
  117 + tb.main_industry,
  118 + tb.annual_material_overview,
  119 + tb.company_settlement_period,
  120 + tb.company_credit_limit,
  121 + tb.company_material_supply_plan,
  122 + tb.company_suggested_category,
  123 + tb.status,
  124 + tb.create_by_id,
  125 + tb.create_by,
  126 + tb.update_by_id,
  127 + tb.update_by,
  128 + tb.create_time,
  129 + tb.update_time
  130 + FROM customer_credit AS tb
  131 + left join base_data_customer as cu on cu.id = tb.company_id
  132 + </sql>
  133 +
  134 + <select id="query" resultMap="CustomerCredit">
  135 + <include refid="CustomerCredit_sql"/>
  136 + <where>
  137 + <if test="vo.registerDateStart != null">
  138 + AND tb.register_date >= #{vo.registerDateStart}
  139 + </if>
  140 + <if test="vo.registerDateEnd != null">
  141 + <![CDATA[
  142 + AND tb.register_date <= #{vo.registerDateEnd}
  143 + ]]>
  144 + </if>
  145 + <if test="vo.customerShortName != null and vo.customerShortName != ''">
  146 + AND tb.customer_short_name LIKE CONCAT('%', #{vo.customerShortName})
  147 + </if>
  148 + <if test="vo.enterpriseType != null and vo.enterpriseType != ''">
  149 + AND tb.enterprise_type = #{vo.enterpriseType}
  150 + </if>
  151 + <if test="vo.status != null and vo.status != ''">
  152 + AND tb.status = #{vo.status}
  153 + </if>
  154 + </where>
  155 + </select>
  156 +
  157 + <select id="findById" resultType="com.lframework.xingyun.sc.entity.CustomerCredit">
  158 + <include refid="CustomerCredit_sql"/>
  159 + <where>
  160 + <if test="id != null">
  161 + AND tb.id = #{id}
  162 + </if>
  163 + </where>
  164 + </select>
  165 +
  166 + <select id="getGenerateCode" resultType="String">
  167 + SELECT DISTINCT
  168 + tb.serial_number
  169 + FROM customer_credit AS tb
  170 + <where>
  171 + <if test="code != null">
  172 + AND tb.serial_number LIKE CONCAT('%', #{code}, '%')
  173 + </if>
  174 + </where>
  175 + </select>
  176 +</mapper>
... ...