From 6ebee75513803b1f3f021a476743748dcd8f91bd Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Thu, 3 Dec 2020 09:44:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../guarantee/service/impl/DgApplyAmountInfoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java index 0126ab7d..72e5242d 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java @@ -321,7 +321,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl() .eq("business_id", businessApplication.getBusinessId()).eq("type", 2)); - applyAmountList.setId(dgApplyAmountList.getId()); + applyAmountList.setId(applyAmountList.getId()); applyAmountList.setStatus(StatusCode.SP_IN_REVIEW);//审核中 applyAmountList.setOperatingStatus(StatusCode.CZ_ON_HAND);//待处理 dgApplyAmountListMapper.updateById(applyAmountList); From 55cb58b7cf8bd573392c0df128f99950989d2477 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Thu, 3 Dec 2020 17:15:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=B3=BB=E7=BB=9F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomerWorkbenchController.java | 28 +++ .../model/request/CompanyCustomerRequest.java | 104 +++++++++++ .../crms/service/CustomerService.java | 6 +- .../service/CustomerWorkbenchService.java | 5 + .../service/impl/CustomerServiceImpl.java | 59 +++++- .../impl/CustomerWorkbenchServiceImpl.java | 25 ++- .../mapper/crms/CompanyCustomerDao.xml | 14 +- .../impl/DgApplyAmountInfoServiceImpl.java | 6 +- .../hrms/controller/DeptController.java | 9 + .../financial/hrms/dao/EmployeeDao.java | 2 + .../financial/hrms/service/DeptService.java | 2 + .../hrms/service/impl/DeptServiceImpl.java | 24 +++ .../resources/mapper/hrms/EmployeeDao.xml | 17 ++ .../com/daqing/framework/util/ArraysUtil.java | 169 ++++++++++++++++++ .../domain/crms/CompanyCustomerEntity.java | 44 ++++- .../framework/domain/crms/CustomerEntity.java | 8 +- .../domain/crms/ext/CustomerCompanyDTO.java | 43 +++++ 17 files changed, 544 insertions(+), 21 deletions(-) create mode 100644 dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CompanyCustomerRequest.java create mode 100644 dq-framework-common/src/main/java/com/daqing/framework/util/ArraysUtil.java diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerWorkbenchController.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerWorkbenchController.java index 773a486e..8dab38d6 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerWorkbenchController.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerWorkbenchController.java @@ -1,6 +1,7 @@ package com.daqing.financial.crms.controller; import com.daqing.financial.crms.CustomerWorkbenchControllerApi; +import com.daqing.financial.crms.model.request.CompanyCustomerRequest; import com.daqing.financial.crms.service.CustomerWorkbenchService; import com.daqing.framework.domain.crms.ext.CustomerCompanyTOI; import com.daqing.framework.domain.crms.ext.CustomerCompanyTOU; @@ -12,6 +13,8 @@ import com.daqing.framework.model.response.CommonCode; import com.daqing.framework.model.response.PromptSuccess; import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.utils.PageUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -24,6 +27,7 @@ import java.util.Objects; * @auther River * @date 2020/10/19 10:05 */ +@Api(tags = {"工作台客户资源系统"}) @RestController @RequestMapping("/crms/workbench") public class CustomerWorkbenchController implements CustomerWorkbenchControllerApi { @@ -153,4 +157,28 @@ public class CustomerWorkbenchController implements CustomerWorkbenchControllerA return new ResponseResult>().SUCCESS(customerWorkbenchService.getCustomerManager()); } + + /** + * 新增企业(新) + */ + @ApiOperation(value = "新增企业(新)") + @PostMapping("/insertCompany") + public ResponseResult insertCompany(@RequestBody CompanyCustomerRequest companyCustomerReq) { + + boolean result = customerWorkbenchService.insertCompany(companyCustomerReq); + + return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.SAVE_FAIL); + } + + /** + * 修改企业(新) + */ + @ApiOperation(value = "修改企业(新)") + @PostMapping("/updateCompanyNew") + public ResponseResult updateCompanyNew(@RequestBody CompanyCustomerRequest companyCustomerReq) { + + Boolean result = customerWorkbenchService.updateCompanyNew(companyCustomerReq); + + return result ? ResponseResult.SUCCESS() : new ResponseResult(CommonCode.UPDATE_FAIL); + } } diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CompanyCustomerRequest.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CompanyCustomerRequest.java new file mode 100644 index 00000000..eafbc4be --- /dev/null +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CompanyCustomerRequest.java @@ -0,0 +1,104 @@ +package com.daqing.financial.crms.model.request; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 企业类型客户信息新增 + * @auther + * @date 2020/10/9 10:32 + */ +@Data +@ToString +public class CompanyCustomerRequest implements Serializable { + + @TableId(value = "id", type = IdType.INPUT) + private Long id; + + @Min(value = 0,message = "客户类型格式有误") + @Max(value = 1,message = "客户类型格式有误") + @NotNull(message = "客户类型不能为空") + @ApiModelProperty(value = "客户类型") + private Integer type; + + @NotNull(message = "客户经理人不能为空") + @ApiModelProperty(value = "客户经理人ids") + private String[] manager; + + @NotNull(message = "客户名称不能为空") + @ApiModelProperty(value = "客户名称") + private String name; + + @ApiModelProperty(value = "社会统一代码") + private String socialUnifiedCode; + + @NotNull(message = "联系电话不能为空") + @Pattern(regexp = "^[0-9]*$",message = "联系电话格式错误") + @ApiModelProperty(value = "联系电话") + private String phone; + + @ApiModelProperty(value = "注册时间") + private Date registerTime; + + @Pattern(regexp = "^[0-9]+\\.{0,1}[0-9]{0,2}$",message = "注册资金格式有误") + @NotNull(message = "注册资金不能为空") + @ApiModelProperty(value = "注册资金") + private String registeredCapital; + + @Pattern(regexp = "^[0-9]*$",message = "员工人数格式错误") + @NotNull(message = "员工人数不能为空") + @ApiModelProperty(value = "员工人数") + private String empNum; + + @ApiModelProperty(value = "注册地址") + private String registerAddr; + + @NotNull(message = "联系人不能为空") + @ApiModelProperty(value = "联系人") + private String linkman; + + @ApiModelProperty(value = "联系人的联系电话") + private String linkPhone; + + @ApiModelProperty(value = "经营地址") + private String businessAddr; + + @NotNull(message = "业务来源不能为空") + @ApiModelProperty(value = "业务来源") + private String businessSource; + + @ApiModelProperty(value = "经营范围") + private String businessScope; + + @ApiModelProperty(value = "法人-姓名") + private String legalName; + + @ApiModelProperty(value = "法人-性别 1、男,0、女") + private String legalGender; + + @ApiModelProperty(value = "法人-身份证号") + private String legalIdNumber; + + @ApiModelProperty(value = "法人-户口所在地") + private String legalHukouAddr; + + @ApiModelProperty(value = "法人-联系电话") + private String legalPhone; + + @ApiModelProperty(value = "法人-家庭住址") + private String legalHomeAddr; + + @ApiModelProperty(value = "是否存在关联人 0->否;1->是") + private Integer isExistRelated; +} diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerService.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerService.java index bc9c708a..2e4c702a 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerService.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerService.java @@ -1,7 +1,7 @@ package com.daqing.financial.crms.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.daqing.framework.domain.crms.CompanyCustomerEntity; +import com.daqing.financial.crms.model.request.CompanyCustomerRequest; import com.daqing.framework.domain.crms.ext.CustomerCompanyTOI; import com.daqing.framework.domain.crms.ext.CustomerCompanyTOU; import com.daqing.framework.domain.crms.ext.CustomerPersonalTOI; @@ -48,5 +48,9 @@ public interface CustomerService extends IService { ResponseResult queryCustomerInfoById(DgApplyAmountInfoRequest applyAmountInfo); List queryCompanyCodeAndName(int type); + + boolean insertCompany(CompanyCustomerRequest companyCustomerReq); + + boolean updateCompanyNew(CompanyCustomerRequest companyCustomerReq); } diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerWorkbenchService.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerWorkbenchService.java index e8c07a08..82fca913 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerWorkbenchService.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/CustomerWorkbenchService.java @@ -1,6 +1,7 @@ package com.daqing.financial.crms.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.daqing.financial.crms.model.request.CompanyCustomerRequest; import com.daqing.framework.domain.crms.CustomerEntity; import com.daqing.framework.domain.crms.ext.CustomerCompanyTOI; import com.daqing.framework.domain.crms.ext.CustomerCompanyTOU; @@ -39,4 +40,8 @@ public interface CustomerWorkbenchService extends IService { Boolean noPass(Long id,String cause); List getCustomerManager(); + + Boolean insertCompany(CompanyCustomerRequest companyCustomerReq); + + Boolean updateCompanyNew(CompanyCustomerRequest companyCustomerReq); } diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java index 3edab2ac..af4aa7bc 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java @@ -2,13 +2,13 @@ package com.daqing.financial.crms.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.api.R; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.daqing.financial.crms.dao.CompanyCustomerDao; import com.daqing.financial.crms.dao.CustomerDao; import com.daqing.financial.crms.dao.PersonalCustomerDao; import com.daqing.financial.crms.feign.HrmsFeignService; +import com.daqing.financial.crms.model.request.CompanyCustomerRequest; import com.daqing.financial.crms.service.CustomerService; import com.daqing.framework.domain.crms.CompanyCustomerEntity; import com.daqing.framework.domain.crms.CustomerEntity; @@ -18,13 +18,13 @@ import com.daqing.framework.domain.crms.request.CustomerRequest; import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; import com.daqing.framework.domain.crms.response.CompanyCustomerResponse; import com.daqing.framework.domain.crms.response.CrmsCode; -import com.daqing.framework.domain.hrms.EmployeeEntity; import com.daqing.framework.domain.hrms.ext.EmployeeTO; import com.daqing.framework.domain.hrms.ext.EmployeeVO; import com.daqing.framework.exception.ExceptionCast; import com.daqing.framework.model.response.CommonCode; import com.daqing.framework.model.response.PromptSuccess; import com.daqing.framework.model.response.ResponseResult; +import com.daqing.framework.util.ArraysUtil; import com.daqing.framework.utils.PageUtils; import com.daqing.framework.utils.excel.ExcelUtil; import org.springframework.beans.BeanUtils; @@ -34,7 +34,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; import java.text.SimpleDateFormat; import java.util.*; @@ -120,7 +119,9 @@ public class CustomerServiceImpl extends ServiceImpl().SUCCESS(customerPersonalDTO); } else if (Objects.equals(customer.getType(),CrmsConstant.CustomerType.COMPANY_CUSTOMER.getType())){ - CompanyCustomerEntity companyCustomerEntity = companyCustomerDao.queryCompanyCustomerById(id); + // CompanyCustomerEntity companyCustomerEntity = companyCustomerDao.queryCompanyCustomerById(id); + CompanyCustomerEntity companyCustomerEntity = companyCustomerDao.selectOne(new QueryWrapper() + .eq("customer_id",id)); // 封装企业类型客户信息 CustomerCompanyDTO customerCompanyDTO = this.setCompany(customer, companyCustomerEntity); return new ResponseResult().SUCCESS(customerCompanyDTO); @@ -134,7 +135,7 @@ public class CustomerServiceImpl extends ServiceImpl().SUCCESS(customerCompanyVO); }else { return new ResponseResult(CommonCode.INEXISTENCE); - } + }*/ + return new ResponseResult(CommonCode.INEXISTENCE); } /** @@ -537,4 +539,49 @@ public class CustomerServiceImpl extends ServiceImpllist = customerDao.queryCompanyCodeAndName(type); return list; } + + /** + * 插入企业类型客户信息 + */ + @Transactional + public boolean insertCompany(CompanyCustomerRequest companyCustomerReq) { + CustomerEntity customerEntity = new CustomerEntity(); + CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity(); + BeanUtils.copyProperties(companyCustomerReq,customerEntity); + BeanUtils.copyProperties(companyCustomerReq,companyCustomerEntity); + //TODO 设置客户编号 + customerEntity.setCode(((int)(Math.random()*100+1))+""); + customerEntity.setMotifyTime(new Date()); + customerEntity.setCreateTime(new Date()); + customerEntity.setManager(ArraysUtil.toString(companyCustomerReq.getManager())); + customerEntity.setType(CrmsConstant.CustomerType.COMPANY_CUSTOMER.getType()); + boolean customer = customerDao.saveCustomer(customerEntity); + companyCustomerEntity.setCustomerId(customerEntity.getId()); + int company = companyCustomerDao.insert(companyCustomerEntity); + if(customer==true && company>0){ + return true; + } + return false; + } + + /** + * 更新企业类型客户信息 + */ + @Transactional + public boolean updateCompanyNew(CompanyCustomerRequest companyCustomerReq) { + CustomerEntity customerEntity = new CustomerEntity(); + CompanyCustomerEntity companyCustomerEntity = new CompanyCustomerEntity(); + BeanUtils.copyProperties(companyCustomerReq,customerEntity); + BeanUtils.copyProperties(companyCustomerReq,companyCustomerEntity); + customerEntity.setMotifyTime(new Date()); + customerEntity.setManager(ArraysUtil.toString(companyCustomerReq.getManager())); + boolean customer = customerDao.updateCustomer(customerEntity); + companyCustomerEntity.setCustomerId(customerEntity.getId()); + int company = companyCustomerDao.update(companyCustomerEntity, new QueryWrapper() + .eq("customer_id",companyCustomerEntity.getCustomerId())); + if(customer==true && company>0){ + return true; + } + return false; + } } \ No newline at end of file diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerWorkbenchServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerWorkbenchServiceImpl.java index 2968dd5c..d4bf33fd 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerWorkbenchServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerWorkbenchServiceImpl.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.daqing.financial.crms.dao.CustomerWorkbenchDao; import com.daqing.financial.crms.feign.HrmsFeignService; +import com.daqing.financial.crms.model.request.CompanyCustomerRequest; import com.daqing.financial.crms.service.CustomerService; import com.daqing.financial.crms.service.CustomerWorkbenchService; import com.daqing.framework.domain.crms.CustomerEntity; @@ -14,7 +15,6 @@ import com.daqing.framework.domain.crms.response.CustomerWorkbenchListVO; import com.daqing.framework.domain.hrms.EmployeeEntity; import com.daqing.framework.domain.hrms.ext.EmployeeTO; import com.daqing.framework.exception.ExceptionCast; -import com.daqing.framework.exception.ExceptionCatch; import com.daqing.framework.model.response.CommonCode; import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.util.RedisUtil; @@ -271,4 +271,27 @@ public class CustomerWorkbenchServiceImpl extends ServiceImpl + @@ -14,8 +15,19 @@ + - + + + + + + + + + + + diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java index 72e5242d..3d09f134 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java @@ -18,19 +18,14 @@ import com.daqing.financial.guarantee.util.ArraysUtil; import com.daqing.financial.guarantee.util.AuditProcessUtil; import com.daqing.framework.domain.crms.CrmsCustomerRelated; import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest; -import com.daqing.framework.domain.crms.response.CrmsCode; import com.daqing.framework.domain.guarantee.*; -import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse; -import com.daqing.framework.exception.ExceptionCast; import com.daqing.framework.model.StatusCode; import com.daqing.framework.model.response.PromptSuccess; import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.util.RandomUtil; import com.daqing.framework.util.RedisUtil; import com.daqing.framework.utils.PageUtils; -import com.daqing.framework.utils.excel.ExcelUtil; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.ArrayUtils; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -121,6 +116,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl>().SUCCESS(deptService.listDepartmentAndEmployeeTree(account)); } + /** + *所有部门及员工 + */ + @GetMapping("/empTrees") + public ResponseResult empTrees(@RequestParam(value = "account", required = false) String account) { + return new ResponseResult>().SUCCESS(deptService.listEmployeeTrees(account)); + } + + /** * 该部门下所有子部门及部门下员工 */ diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java index b194f832..5baaac4d 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java @@ -107,4 +107,6 @@ public interface EmployeeDao extends BaseMapper { int saveUserRole(@Param("userId") Long userId, @Param("roleId") Long roleId); List listEmpNameByUserId(@Param("userIds") List userIds); + + List getListEmployeeTrees(@Param("id")Long id, @Param("account")String account); } diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java index 86ef0979..3ccf9063 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java @@ -35,5 +35,7 @@ public interface DeptService extends IService { List listEmployeeById(Long id); List listEmployeeByDeptId(Long deptId); + + List listEmployeeTrees(String account); } diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java index 4b56c64b..eab415d3 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java @@ -245,4 +245,28 @@ public class DeptServiceImpl extends ServiceImpl implements return this.getBaseMapper().listEmployeeByDeptId(deptId); } + + /** + * 获取所有的部门及部门下的员工信息 + * + * @return + */ + public List listEmployeeTrees(String account) { + return this.getListEmployeeTrees(deptDao.listDepartment(), 0L, account); + } + + + private List getListEmployeeTrees(List list, Long parentId, String account) { + return list.stream() + .filter(dept -> parentId.equals(dept.getParentId())) // 过滤出部门id为所选id的部门信息(也为递归的结果条件,找不到所对应的部门id) + .peek(dept -> { + dept.setChildren(getListEmployeeTrees(list, dept.getId(), account)); // 设置该部门的子部门:递归调用 + + List empList = employeeDao.getListEmployeeTrees(dept.getId(),account); + + dept.setUserDept(employeeDao.getListEmployeeTrees(dept.getId(),account)); + }) + .sorted(Comparator.comparingInt(menu -> (menu.getSort() == null ? 0 : menu.getSort()))) // 根据所选排序信息进行排序 + .collect(Collectors.toList()); + } } \ No newline at end of file diff --git a/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml b/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml index 3c71cd9f..ad1896b1 100644 --- a/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml +++ b/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml @@ -608,4 +608,21 @@ + + \ No newline at end of file diff --git a/dq-framework-common/src/main/java/com/daqing/framework/util/ArraysUtil.java b/dq-framework-common/src/main/java/com/daqing/framework/util/ArraysUtil.java new file mode 100644 index 00000000..468b4c77 --- /dev/null +++ b/dq-framework-common/src/main/java/com/daqing/framework/util/ArraysUtil.java @@ -0,0 +1,169 @@ +package com.daqing.framework.util; + + +/** + * @auther River + * @date 2020/11/9 15:53 + */ +public class ArraysUtil { + public static String toString(long[] a) { + if (a == null) + return "null"; + int iMax = a.length - 1; + if (iMax == -1) + return "[]"; + + StringBuilder b = new StringBuilder(); + b.append('['); + for (int i = 0; ; i++) { + b.append(a[i]); + if (i == iMax) + return b.append(']').toString(); + b.append(","); + } + } + + public static String toString(int[] a) { + if (a == null) + return "null"; + int iMax = a.length - 1; + if (iMax == -1) + return "[]"; + + StringBuilder b = new StringBuilder(); + b.append('['); + for (int i = 0; ; i++) { + b.append(a[i]); + if (i == iMax) + return b.append(']').toString(); + b.append(","); + } + } + + public static String toString(short[] a) { + if (a == null) + return "null"; + int iMax = a.length - 1; + if (iMax == -1) + return "[]"; + + StringBuilder b = new StringBuilder(); + b.append('['); + for (int i = 0; ; i++) { + b.append(a[i]); + if (i == iMax) + return b.append(']').toString(); + b.append(","); + } + } + + + public static String toString(char[] a) { + if (a == null) + return "null"; + int iMax = a.length - 1; + if (iMax == -1) + return "[]"; + + StringBuilder b = new StringBuilder(); + b.append('['); + for (int i = 0; ; i++) { + b.append(a[i]); + if (i == iMax) + return b.append(']').toString(); + b.append(","); + } + } + + + public static String toString(byte[] a) { + if (a == null) + return "null"; + int iMax = a.length - 1; + if (iMax == -1) + return "[]"; + + StringBuilder b = new StringBuilder(); + b.append('['); + for (int i = 0; ; i++) { + b.append(a[i]); + if (i == iMax) + return b.append(']').toString(); + b.append(","); + } + } + + + public static String toString(boolean[] a) { + if (a == null) + return "null"; + int iMax = a.length - 1; + if (iMax == -1) + return "[]"; + + StringBuilder b = new StringBuilder(); + b.append('['); + for (int i = 0; ; i++) { + b.append(a[i]); + if (i == iMax) + return b.append(']').toString(); + b.append(","); + } + } + + + public static String toString(float[] a) { + if (a == null) + return "null"; + + int iMax = a.length - 1; + if (iMax == -1) + return "[]"; + + StringBuilder b = new StringBuilder(); + b.append('['); + for (int i = 0; ; i++) { + b.append(a[i]); + if (i == iMax) + return b.append(']').toString(); + b.append(","); + } + } + + public static String toString(double[] a) { + if (a == null) + return "null"; + int iMax = a.length - 1; + if (iMax == -1) + return "[]"; + + StringBuilder b = new StringBuilder(); + b.append('['); + for (int i = 0; ; i++) { + b.append(a[i]); + if (i == iMax) + return b.append(']').toString(); + b.append(","); + } + } + + public static String toString(Object[] a) { + if (a == null) + return "null"; + + int iMax = a.length - 1; + if (iMax == -1) + return "[]"; + + StringBuilder b = new StringBuilder(); + b.append('['); + for (int i = 0; ; i++) { + b.append(String.valueOf(a[i])); + if (i == iMax) + return b.append(']').toString(); + b.append(","); + } + } + +} + diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CompanyCustomerEntity.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CompanyCustomerEntity.java index 6e25b3b5..5c01be4c 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CompanyCustomerEntity.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CompanyCustomerEntity.java @@ -36,6 +36,10 @@ public class CompanyCustomerEntity implements Serializable { */ @ApiModelProperty(value = "注册资金") private String registeredCapital; + + @ApiModelProperty(value = "社会统一代码") + private String socialUnifiedCode; + /** * 所属行业 */ @@ -45,7 +49,7 @@ public class CompanyCustomerEntity implements Serializable { * 成立年限 */ @ApiModelProperty(value = "成立年限") - @Pattern(regexp = "^\\\\d+$",message = "成立年限只能为整形数字") + //@Pattern(regexp = "^\\\\d+$",message = "成立年限只能为整形数字") private Integer years; /** * 所在区域 @@ -65,22 +69,56 @@ public class CompanyCustomerEntity implements Serializable { /** * 员工个数 */ - @ApiModelProperty(value = "员工个数") + @ApiModelProperty(value = "员工人数") private String empNum; /** * 联系人 */ @ApiModelProperty(value = "联系人") private String linkman; + + @ApiModelProperty(value = "联系人的联系电话") + private String linkPhone; + /** * 业务来源 */ @ApiModelProperty(value = "业务来源") private String businessSource; + + @ApiModelProperty(value = "经营范围") + private String businessScope; + + @ApiModelProperty(value = "经营地址") + private String businessAddr; + + @ApiModelProperty(value = "注册时间") + private Date registerTime; + + @ApiModelProperty(value = "注册地址") + private String registerAddr; + + @ApiModelProperty(value = "法人-身份证号") + private Integer legalIdNumber; + + @ApiModelProperty(value = "法人-户口所在地") + private String legalHukouAddr; + + @ApiModelProperty(value = "法人-联系电话") + private String legalPhone; + + @ApiModelProperty(value = "法人-家庭住址") + private String legalHomeAddr; + + @ApiModelProperty(value = "法人-性别 1、男,0、女") + private Integer legalGender; + + @ApiModelProperty(value = "法人-姓名") + private String legalName; + /** * 客户基本信息表id */ - //@Pattern(regexp = "^\\\\d+$",message = "成立年限只能为整形数字") @ApiModelProperty(value = "客户基本信息表id") private Long customerId; diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CustomerEntity.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CustomerEntity.java index c145a93a..b2f49d34 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CustomerEntity.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CustomerEntity.java @@ -1,8 +1,6 @@ package com.daqing.framework.domain.crms; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import java.io.Serializable; import java.util.Date; @@ -48,7 +46,7 @@ public class CustomerEntity implements Serializable { * 客户的经理人id */ @ApiModelProperty(value = "客户经理人id") - private Long manager; + private String manager; /** * 客户名称 */ @@ -88,11 +86,13 @@ public class CustomerEntity implements Serializable { /** * 创建时间 */ + @TableField(fill = FieldFill.INSERT) @ApiModelProperty(value = "创建时间") private Date createTime; /** * 修改时间 */ + @TableField(fill = FieldFill.INSERT_UPDATE) @ApiModelProperty(value = "修改时间") private Date motifyTime; diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyDTO.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyDTO.java index 18281a58..68f593af 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyDTO.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CustomerCompanyDTO.java @@ -4,7 +4,9 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.ToString; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.util.Date; /** * 客户信息详情(企业类型) @@ -90,4 +92,45 @@ public class CustomerCompanyDTO implements Serializable { */ @ApiModelProperty(value = "业务来源") private String businessSource; + + @ApiModelProperty(value = "社会统一代码") + private String socialUnifiedCode; + + @ApiModelProperty(value = "注册时间") + private Date registerTime; + + @ApiModelProperty(value = "注册地址") + private String registerAddr; + + @ApiModelProperty(value = "联系人的联系电话") + private String linkPhone; + + @ApiModelProperty(value = "经营地址") + private String businessAddr; + + @ApiModelProperty(value = "经营范围") + private String businessScope; + + @ApiModelProperty(value = "法人-姓名") + private String legalName; + + @ApiModelProperty(value = "法人-性别 1、男,0、女") + private String legalGender; + + @ApiModelProperty(value = "法人-身份证号") + private String legalIdNumber; + + @ApiModelProperty(value = "法人-户口所在地") + private String legalHukouAddr; + + @ApiModelProperty(value = "法人-联系电话") + private String legalPhone; + + @ApiModelProperty(value = "法人-家庭住址") + private String legalHomeAddr; + + @ApiModelProperty(value = "是否存在关联人 0->否;1->是") + private Integer isExistRelated; + + }