parent
2a143a4bd3
commit
0c4dd630fb
65 changed files with 2481 additions and 188 deletions
@ -0,0 +1,23 @@ |
||||
package com.daqing.financial.crms; |
||||
|
||||
import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest; |
||||
import com.daqing.framework.domain.crms.response.CustomerWorkbenchListVO; |
||||
import com.daqing.framework.model.response.ResponseResult; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
|
||||
/** |
||||
* 工作台客户资源接口定义 |
||||
* |
||||
* @auther River |
||||
* @date 2020/10/19 10:24 |
||||
*/ |
||||
@Api(value = "工作台客户资源", tags = "提供工作台客户信息增删改查等相关方法") |
||||
public interface CustomerWorkbenchControllerApi { |
||||
|
||||
/** |
||||
* 列表展示 |
||||
*/ |
||||
@ApiOperation(value = "客户信息列表展示", notes = "客户信息列表展示",response = CustomerWorkbenchListVO.class) |
||||
ResponseResult List(Integer page, Integer size, CustomerWorkbenchRequest customerWorkbenchRequest); |
||||
} |
@ -0,0 +1,29 @@ |
||||
package com.daqing.financial.hrms; |
||||
|
||||
import com.daqing.framework.domain.hrms.ext.EmployeeAndUserVO; |
||||
import com.daqing.framework.model.response.ResponseResult; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
|
||||
/** |
||||
* @auther River |
||||
* @date 2020/10/15 9:44 |
||||
*/ |
||||
@Api(value = "用户相关操作", tags = "提供工作台人力资源等相关方法") |
||||
public interface UserControllerApi { |
||||
|
||||
@ApiOperation(value = "用户详情",notes = "用户详情",response = EmployeeAndUserVO.class) |
||||
ResponseResult info(); |
||||
|
||||
@ApiOperation(value = "修改用户信息",notes = "修改用户信息") |
||||
ResponseResult update(EmployeeAndUserVO employeeAndUserVO); |
||||
|
||||
@ApiOperation(value = "获取验证码",notes = "获取验证码") |
||||
ResponseResult code(String phone); |
||||
|
||||
@ApiOperation(value = "修改密码",notes = "修改密码") |
||||
ResponseResult updatePassword(Long id, String primaryPassword, String newPassword, String affirmNewPassword); |
||||
|
||||
@ApiOperation(value = "绑定手机号",notes = "绑定手机号") |
||||
ResponseResult binding(Long id,String phone,String code); |
||||
} |
@ -0,0 +1,38 @@ |
||||
package com.daqing.financial.crms.controller; |
||||
|
||||
import com.daqing.financial.crms.CustomerWorkbenchControllerApi; |
||||
import com.daqing.financial.crms.service.CustomerWorkbenchService; |
||||
import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest; |
||||
import com.daqing.framework.model.response.ResponseResult; |
||||
import com.daqing.framework.utils.PageUtils; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* 工作台客户资源系统 |
||||
* |
||||
* @auther River |
||||
* @date 2020/10/19 10:05 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/crms/workbench") |
||||
public class CustomerWorkbenchController implements CustomerWorkbenchControllerApi { |
||||
|
||||
@Autowired |
||||
private CustomerWorkbenchService customerWorkbenchService; |
||||
|
||||
/** |
||||
* 列表 |
||||
*/ |
||||
@Override |
||||
@GetMapping("/list") |
||||
public ResponseResult List(@RequestParam("page") Integer page, @RequestParam("size") Integer size, CustomerWorkbenchRequest customerWorkbenchRequest) { |
||||
|
||||
PageUtils list = customerWorkbenchService.list(page, size, customerWorkbenchRequest); |
||||
|
||||
return new ResponseResult<PageUtils>().SUCCESS(list); |
||||
} |
||||
} |
@ -0,0 +1,19 @@ |
||||
package com.daqing.financial.crms.dao; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.daqing.framework.domain.crms.CustomerEntity; |
||||
import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
/** |
||||
* @auther River |
||||
* @date 2020/10/19 10:45 |
||||
*/ |
||||
@Mapper |
||||
public interface CustomerWorkbenchDao extends BaseMapper<CustomerEntity> { |
||||
|
||||
IPage<CustomerEntity> queryList(Page page, @Param("cr")CustomerWorkbenchRequest customerWorkbenchRequest); |
||||
} |
@ -0,0 +1,16 @@ |
||||
package com.daqing.financial.crms.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.daqing.framework.domain.crms.CustomerEntity; |
||||
import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest; |
||||
import com.daqing.framework.utils.PageUtils; |
||||
|
||||
|
||||
/** |
||||
* @auther River |
||||
* @date 2020/10/19 10:39 |
||||
*/ |
||||
public interface CustomerWorkbenchService extends IService<CustomerEntity> { |
||||
|
||||
PageUtils list(Integer page, Integer size, CustomerWorkbenchRequest customerWorkbenchRequest); |
||||
} |
@ -0,0 +1,133 @@ |
||||
package com.daqing.financial.crms.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
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.service.CustomerWorkbenchService; |
||||
import com.daqing.framework.domain.crms.CustomerEntity; |
||||
import com.daqing.framework.domain.crms.ext.CustomerTO; |
||||
import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest; |
||||
import com.daqing.framework.domain.crms.response.CustomerWorkbenchListVO; |
||||
import com.daqing.framework.domain.hrms.ext.EmployeeTO; |
||||
import com.daqing.framework.model.response.ResponseResult; |
||||
import com.daqing.framework.utils.PageUtils; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.text.SimpleDateFormat; |
||||
import java.util.*; |
||||
|
||||
/** |
||||
* @auther River |
||||
* @date 2020/10/19 10:44 |
||||
*/ |
||||
@Service |
||||
public class CustomerWorkbenchServiceImpl extends ServiceImpl<CustomerWorkbenchDao, CustomerEntity> |
||||
implements CustomerWorkbenchService { |
||||
|
||||
@Autowired |
||||
private HrmsFeignService hrmsFeignService; |
||||
|
||||
/** |
||||
* 列表 |
||||
*/ |
||||
@Override |
||||
public PageUtils list(Integer page, Integer size, CustomerWorkbenchRequest cwr) { |
||||
|
||||
if (page == null || size == null){ |
||||
page = 1; |
||||
size = 10; |
||||
} |
||||
// 校验时间参数
|
||||
this.timeCheckout(cwr.getCreateTime(),cwr.getStartTime(),cwr.getEndTime(),cwr); |
||||
IPage<CustomerEntity> customerEntityIPage = this.getBaseMapper().queryList(new Page(page, size), cwr); |
||||
List<CustomerEntity> customers = customerEntityIPage.getRecords(); |
||||
// 获取所有的客户经理id
|
||||
Long[] managerIds = customers.stream().map(CustomerEntity::getManager).toArray(Long[]::new); |
||||
// 获取所有的客户id
|
||||
Long[] customerIds = customers.stream().map(CustomerEntity::getId).toArray(Long[]::new); |
||||
// 返回列表实体类集合
|
||||
List<CustomerWorkbenchListVO> customerWorkbenchListVOS = new ArrayList<>(); |
||||
BeanUtils.copyProperties(customers,customerWorkbenchListVOS); |
||||
if (managerIds.length != 0){ |
||||
// 远程调用查询客户对应的客户经理信息
|
||||
ResponseResult responseResult = hrmsFeignService.getEmployeeAndDeptById(managerIds); |
||||
List<EmployeeTO> employeeTOs = (List<EmployeeTO>) responseResult.getData(); |
||||
if (employeeTOs != null){ |
||||
customerWorkbenchListVOS = this.jointCustomerEmployee(customers, employeeTOs); |
||||
} |
||||
} |
||||
if (customerIds.length != 0){ |
||||
// TODO:调用担保服务查询每个客户的审批状态
|
||||
for (CustomerWorkbenchListVO customerWorkbenchListVO : customerWorkbenchListVOS) { |
||||
customerWorkbenchListVO.setStatus(2); |
||||
} |
||||
} |
||||
// 属性拷贝,将泛型为CustomerEntity类型的IPage的属性拷贝给泛型为CustomerTO类型的IPage,才能赋值给PageUtils
|
||||
IPage<CustomerWorkbenchListVO> iPage = new Page<>(); |
||||
BeanUtils.copyProperties(customerEntityIPage,iPage); |
||||
iPage.setRecords(customerWorkbenchListVOS); |
||||
|
||||
return new PageUtils(iPage); |
||||
} |
||||
|
||||
/** |
||||
* 选择某段时间内客户信息的时间参数校验 |
||||
*/ |
||||
private void timeCheckout(Integer createTime, String startTime, String endTime, CustomerWorkbenchRequest customerWorkbenchRequest) { |
||||
// 没有选择自定义时间且选择了固定的"3个月内、6个月内、9个月内...."时间
|
||||
if ((startTime == null || startTime.length() == 0) && (endTime == null || endTime.length() == 0) && createTime != null) { |
||||
if (createTime == 3 || createTime == 6 || createTime == 9 || createTime == 12) { |
||||
String pastTime = this.pastTime(createTime); |
||||
customerWorkbenchRequest.setStartTime(pastTime); |
||||
} else { |
||||
customerWorkbenchRequest.setStartTime(null); |
||||
} |
||||
} |
||||
// 选择了自定义时间且选择了固定时间则固定时间无效
|
||||
if (createTime != null && ((startTime != null && startTime.length() != 0) || (endTime != null && endTime.length() != 0))) { |
||||
customerWorkbenchRequest.setCreateTime(null); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 得到过去number月内的时间 |
||||
*/ |
||||
private String pastTime(Integer number) { |
||||
Date date = new Date(); |
||||
Calendar calendar = Calendar.getInstance(); |
||||
calendar.setTime(date); |
||||
calendar.add(Calendar.MONTH, -number); |
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:ss:mm"); |
||||
return sdf.format(calendar.getTime()); |
||||
} |
||||
|
||||
/** |
||||
* 拼接客户及其对应的客户经理及部门信息 |
||||
*/ |
||||
private List<CustomerWorkbenchListVO> jointCustomerEmployee(List<CustomerEntity> customers, List<EmployeeTO> employeeTO) { |
||||
List<CustomerWorkbenchListVO> customerWorkbenchListVOS = new ArrayList<>();// 用于拼装客户信息和员工及部门信息的集合
|
||||
CustomerWorkbenchListVO customerWorkbenchListVO; |
||||
// 将客户信息和客户经理及部门信息拼装起来
|
||||
for (CustomerEntity customer : customers) { |
||||
// 每一个客户对应一个不同的对象
|
||||
customerWorkbenchListVO = new CustomerWorkbenchListVO(); |
||||
for (EmployeeTO anEmployeeTO : employeeTO) { |
||||
if (Objects.equals(customer.getManager(), anEmployeeTO.getId())) { |
||||
BeanUtils.copyProperties(customer,customerWorkbenchListVO); |
||||
customerWorkbenchListVO.setManager(anEmployeeTO.getEmpName()); |
||||
customerWorkbenchListVO.setDepartments(anEmployeeTO.getDeptNames()); |
||||
customerWorkbenchListVOS.add(customerWorkbenchListVO); |
||||
} |
||||
} |
||||
if (!Objects.equals(customerWorkbenchListVO.getId(), customer.getId())) { |
||||
BeanUtils.copyProperties(customer,customerWorkbenchListVO); |
||||
customerWorkbenchListVOS.add(customerWorkbenchListVO); |
||||
} |
||||
} |
||||
return customerWorkbenchListVOS; |
||||
} |
||||
} |
@ -0,0 +1,43 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
||||
<mapper namespace="com.daqing.financial.crms.dao.CustomerWorkbenchDao"> |
||||
|
||||
<!-- 可根据自己的需求,是否要使用 --> |
||||
<resultMap type="com.daqing.framework.domain.crms.CustomerEntity" id="customerMap"> |
||||
<result property="id" column="id"/> |
||||
<result property="code" column="code"/> |
||||
<result property="type" column="type"/> |
||||
<result property="manager" column="manager"/> |
||||
<result property="name" column="name"/> |
||||
<result property="addr" column="addr"/> |
||||
<result property="phone" column="phone"/> |
||||
<result property="password" column="password"/> |
||||
<result property="wechatId" column="wechat_id"/> |
||||
<result property="delOrNot" column="del_or_not"/> |
||||
<result property="status" column="status"/> |
||||
<result property="createTime" column="create_time"/> |
||||
<result property="motifyTime" column="motify_time"/> |
||||
</resultMap> |
||||
|
||||
<!-- 查询客户列表(所有)、根据创建时间筛选、根据客户类型筛选、根据客户编号或者名称搜索 --> |
||||
<select id="queryList" parameterType="com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest" resultType="com.daqing.framework.domain.crms.CustomerEntity"> |
||||
SELECT id,code,type,name,phone,manager |
||||
FROM crms_customer |
||||
WHERE del_or_not = 0 |
||||
<if test="cr.codeOrName != null and cr.codeOrName != '' "> |
||||
AND (name LIKE CONCAT('%',#{cr.codeOrName},'%') OR code LIKE CONCAT('%',#{cr.codeOrName},'%')) |
||||
</if> |
||||
<if test="cr.customerType != null"> |
||||
AND type = #{cr.customerType} |
||||
</if> |
||||
<if test="cr.startTime != null and cr.startTime != '' "> |
||||
AND create_time >= #{cr.startTime} |
||||
</if> |
||||
<if test="cr.endTime != null and cr.endTime != '' "> |
||||
AND create_time <= #{cr.endTime} |
||||
</if> |
||||
ORDER BY create_time DESC |
||||
</select> |
||||
|
||||
</mapper> |
@ -1,33 +1,34 @@ |
||||
//package com.daqing.financial.hrms.config;
|
||||
//
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.web.cors.CorsConfiguration;
|
||||
//import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
//import org.springframework.web.filter.CorsFilter;
|
||||
//
|
||||
///**
|
||||
// * 实现基本的跨域请求
|
||||
// *
|
||||
// * @auther River
|
||||
// * @date 2020/9/25 15:09
|
||||
// */
|
||||
//@Configuration
|
||||
//public class CorsConfig {
|
||||
//
|
||||
// @Bean
|
||||
// public CorsFilter corsFilter() {
|
||||
// final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
|
||||
// final CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
// /*是否允许请求带有验证信息*/
|
||||
// corsConfiguration.setAllowCredentials(true);
|
||||
// /*允许访问的客户端域名*/
|
||||
// corsConfiguration.addAllowedOrigin("*");
|
||||
// /*允许服务端访问的客户端请求头*/
|
||||
// corsConfiguration.addAllowedHeader("*");
|
||||
// /*允许访问的方法名,GET POST等*/
|
||||
// corsConfiguration.addAllowedMethod("*");
|
||||
// urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
|
||||
// return new CorsFilter(urlBasedCorsConfigurationSource);
|
||||
// }
|
||||
//}
|
||||
package com.daqing.financial.hrms.config; |
||||
|
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.web.cors.CorsConfiguration; |
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource; |
||||
import org.springframework.web.filter.CorsFilter; |
||||
|
||||
/** |
||||
* 实现基本的跨域请求 |
||||
* |
||||
* @auther River |
||||
* @date 2020/9/25 15:09 |
||||
*/ |
||||
@Configuration |
||||
public class CorsConfig { |
||||
|
||||
@Bean |
||||
public CorsFilter corsFilter() { |
||||
final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource(); |
||||
final CorsConfiguration corsConfiguration = new CorsConfiguration(); |
||||
/*是否允许请求带有验证信息*/ |
||||
corsConfiguration.setAllowCredentials(true); |
||||
/*允许访问的客户端域名*/ |
||||
corsConfiguration.addAllowedOrigin("*"); |
||||
/*允许服务端访问的客户端请求头*/ |
||||
corsConfiguration.addAllowedHeader("*"); |
||||
/*允许访问的方法名,GET POST等*/ |
||||
corsConfiguration.addAllowedMethod("*"); |
||||
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration); |
||||
return new CorsFilter(urlBasedCorsConfigurationSource); |
||||
} |
||||
} |
||||
//TODO:跨域注解,上线时注解掉,网关已经统一处理了
|
||||
|
@ -0,0 +1,14 @@ |
||||
package com.daqing.financial.hrms.feign; |
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
||||
/** |
||||
* 声明这是一个远程调用 |
||||
* @auther River |
||||
* @date 2020/10/12 17:58 |
||||
*/ |
||||
@FeignClient("dq-financial-hrms-auht") |
||||
public interface HrmsAuthFeignService { |
||||
|
||||
|
||||
} |
@ -0,0 +1,25 @@ |
||||
package com.daqing.financial.hrms.task; |
||||
|
||||
import com.daqing.financial.hrms.service.EmployeeService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.scheduling.annotation.Scheduled; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
/** |
||||
* 定时禁用检测类 |
||||
* @auther River |
||||
* @date 2020/10/14 16:04 |
||||
*/ |
||||
@Component |
||||
public class DisableDetectionTask { |
||||
|
||||
@Autowired |
||||
private EmployeeService employeeService; |
||||
|
||||
//格式 :秒 分 时 日 月 年
|
||||
@Scheduled(cron = "0 0 0 * * ?") |
||||
public void disableDetection(){ |
||||
|
||||
employeeService.disableDetection(); |
||||
} |
||||
} |
@ -0,0 +1,34 @@ |
||||
package com.daqing.framework.domain.crms.request; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* @auther River |
||||
* @date 2020/10/19 10:32 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class CustomerWorkbenchRequest implements Serializable { |
||||
|
||||
@ApiModelProperty(value = "客户编号或者名称") |
||||
private String codeOrName; |
||||
|
||||
@ApiModelProperty(value = "客户类型") |
||||
private Integer customerType; |
||||
|
||||
@ApiModelProperty(value = "创建时间") |
||||
private Integer createTime; |
||||
|
||||
@ApiModelProperty(value = "起始时间") |
||||
private String startTime; |
||||
|
||||
@ApiModelProperty(value = "结束时间") |
||||
private String endTime; |
||||
|
||||
@ApiModelProperty(value = "审批状态(0:通过,1:不通过,2:待审核)") |
||||
private Integer status; |
||||
} |
@ -0,0 +1,37 @@ |
||||
package com.daqing.framework.domain.crms.request; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import javax.validation.constraints.NotNull; |
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @auther River |
||||
* @date 2020/10/19 11:52 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class EmployeeDisableRequest implements Serializable { |
||||
|
||||
@NotNull(message = "员工id不能为空") |
||||
@ApiModelProperty("员工id") |
||||
private Long employeeId; |
||||
|
||||
@NotNull(message = "禁用开始时间不能为空") |
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
||||
@ApiModelProperty("禁用开始时间") |
||||
private Date disableStartTime; |
||||
|
||||
@NotNull(message = "禁用结束时间不能为空") |
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
||||
@ApiModelProperty("禁用结束时间") |
||||
private Date disableEndTime; |
||||
|
||||
@NotNull(message = "禁用原因不能为空") |
||||
@ApiModelProperty("禁用原因") |
||||
private String disableCause; |
||||
} |
@ -0,0 +1,43 @@ |
||||
package com.daqing.framework.domain.crms.response; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 工作台客户资源列表展示类 |
||||
* |
||||
* @auther River |
||||
* @date 2020/10/19 14:19 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class CustomerWorkbenchListVO implements Serializable { |
||||
|
||||
@ApiModelProperty(value = "id") |
||||
private Long id; |
||||
|
||||
@ApiModelProperty(value = "客户编号") |
||||
private String code; |
||||
|
||||
@ApiModelProperty(value = "客户名称") |
||||
private String name; |
||||
|
||||
@ApiModelProperty(value = "联系电话") |
||||
private String phone; |
||||
|
||||
@ApiModelProperty(value = "客户类型(0:个人类型,1:企业类型)") |
||||
private Integer type; |
||||
|
||||
@ApiModelProperty(value = "客户经理") |
||||
private String manager; |
||||
|
||||
@ApiModelProperty(value = "所属部门") |
||||
private List<String> departments; |
||||
|
||||
@ApiModelProperty(value = "审批状态(0:,1:,2:)") |
||||
private Integer status; |
||||
} |
@ -0,0 +1,122 @@ |
||||
package com.daqing.framework.domain.hrms.ext; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.daqing.framework.domain.hrms.DeptEntity; |
||||
import com.daqing.framework.domain.hrms.PositionEntity; |
||||
import com.daqing.framework.domain.hrms.RoleEntity; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import javax.validation.constraints.NotNull; |
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 员工+用户详情展示类 |
||||
* |
||||
* @auther River |
||||
* @date 2020/10/15 10:01 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class EmployeeAndUserVO implements Serializable { |
||||
|
||||
@ApiModelProperty("id") |
||||
@NotNull(message = "员工id不能为空") |
||||
@TableId(value = "id", type = IdType.INPUT) |
||||
private Long id; |
||||
|
||||
@ApiModelProperty("员工姓名") |
||||
private String name; |
||||
|
||||
@NotNull(message = "性别不能为空") |
||||
@ApiModelProperty("性别") |
||||
private Integer gender; |
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
||||
@ApiModelProperty("生日") |
||||
private Date birthday; |
||||
|
||||
@NotNull(message = "办公电话不能为空") |
||||
@ApiModelProperty("办公电话") |
||||
private String officePhone; |
||||
|
||||
@NotNull(message = "手机号码不能为空") |
||||
@ApiModelProperty("手机号码") |
||||
private String phone; |
||||
|
||||
@NotNull(message = "公司邮箱不能为空") |
||||
@ApiModelProperty("公司邮箱") |
||||
private String companyMail; |
||||
|
||||
@NotNull(message = "备用邮箱不能为空") |
||||
@ApiModelProperty("备用邮箱") |
||||
private String spareMail; |
||||
|
||||
@ApiModelProperty("职位描述") |
||||
private String positionDescription; |
||||
|
||||
@ApiModelProperty("工号") |
||||
private String jobNumber; |
||||
|
||||
@ApiModelProperty("图像地址") |
||||
private String headPortaritUrl; |
||||
|
||||
@NotNull(message = "用户id不能为空") |
||||
@ApiModelProperty("用户id") |
||||
private Long userId; |
||||
|
||||
@ApiModelProperty("部门") |
||||
private List<String> departments; |
||||
|
||||
@ApiModelProperty("职位") |
||||
private List<String> positions; |
||||
|
||||
/** |
||||
* 用户 |
||||
*/ |
||||
@ApiModelProperty("账号") |
||||
private String account; |
||||
|
||||
@ApiModelProperty("密码") |
||||
private String password; |
||||
|
||||
@ApiModelProperty("登录次数") |
||||
private Integer loginNum; |
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
@ApiModelProperty("上次登录时间") |
||||
private Date lasttime; |
||||
|
||||
@ApiModelProperty("手机账号") |
||||
private String phoneAccount; |
||||
|
||||
@ApiModelProperty("微信账号") |
||||
private String wechatId; |
||||
|
||||
@ApiModelProperty("角色") |
||||
private List<String> roles; |
||||
|
||||
/** |
||||
* 修改信息字段 |
||||
*/ |
||||
@ApiModelProperty("接收图像文件") |
||||
private MultipartFile file; |
||||
|
||||
@ApiModelProperty("旧手机号") |
||||
private String primaryPhone; |
||||
|
||||
@ApiModelProperty("旧验证码") |
||||
private String primaryCode; |
||||
|
||||
@ApiModelProperty("新手机号") |
||||
private String newPhone; |
||||
|
||||
@ApiModelProperty("新验证码") |
||||
private String newCode; |
||||
} |
@ -0,0 +1,35 @@ |
||||
package com.daqing.framework.domain.hrms.ext; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.metadata.BaseRowModel; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
import java.io.Serializable; |
||||
|
||||
|
||||
/** |
||||
* @auther River |
||||
* @date 2020/10/14 11:48 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class EmployeeExcelImport extends BaseRowModel implements Serializable { |
||||
|
||||
@ExcelProperty(value = "姓名",index = 0) |
||||
private String name; |
||||
|
||||
@ExcelProperty(value = "账号",index = 1) |
||||
private String account; |
||||
|
||||
@ExcelProperty(value = "工号",index = 2) |
||||
private String jobNumber; |
||||
|
||||
@ExcelProperty(value = "部门",index = 3) |
||||
private String departmentNameList; |
||||
|
||||
@ExcelProperty(value = "职位",index = 4) |
||||
private String positionNameList; |
||||
|
||||
@ExcelProperty(value = "角色",index = 5) |
||||
private String roleNameList; |
||||
} |
@ -0,0 +1,84 @@ |
||||
package com.daqing.framework.domain.hrms.ext; |
||||
|
||||
import com.daqing.framework.domain.hrms.DeptEntity; |
||||
import com.daqing.framework.domain.hrms.PositionEntity; |
||||
import com.daqing.framework.domain.hrms.RoleEntity; |
||||
import com.daqing.framework.domain.hrms.response.RolePermissionResponse; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import javax.validation.constraints.NotNull; |
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 员工详细信息展示类 |
||||
* @auther River |
||||
* @date 2020/10/12 16:23 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class EmployeeInfoVO implements Serializable { |
||||
|
||||
@ApiModelProperty("id") |
||||
private Long id; |
||||
|
||||
@NotNull(message = "姓名不能为空") |
||||
@ApiModelProperty("姓名") |
||||
private String name; |
||||
|
||||
@NotNull(message = "工号不能为空") |
||||
@ApiModelProperty("工号") |
||||
private String jobNumber; |
||||
|
||||
@NotNull(message = "性别不能为空") |
||||
@ApiModelProperty("性别") |
||||
private Integer gender; |
||||
|
||||
@NotNull(message = "生日不能为空") |
||||
@ApiModelProperty("生日") |
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
||||
private Date birthday; |
||||
|
||||
@NotNull(message = "手机号码不能为空") |
||||
@ApiModelProperty("手机号码") |
||||
private String phone; |
||||
|
||||
@NotNull(message = "公司邮箱不能为空") |
||||
@ApiModelProperty("公司邮箱") |
||||
private String companyMail; |
||||
|
||||
@NotNull(message = "账号不能为空") |
||||
@ApiModelProperty("账号") |
||||
private String account; |
||||
|
||||
@ApiModelProperty("状态") |
||||
private Integer status; |
||||
|
||||
@ApiModelProperty("部门") |
||||
private List<DeptEntity> departments; |
||||
|
||||
@ApiModelProperty("职位") |
||||
private List<PositionEntity> positions; |
||||
|
||||
@ApiModelProperty("角色") |
||||
private List<RoleEntity> roles; |
||||
|
||||
@ApiModelProperty("权限") |
||||
private List<RolePermissionResponse> permissions; |
||||
|
||||
/** |
||||
* 接收部门、职位、角色 |
||||
*/ |
||||
@ApiModelProperty("部门id集合") |
||||
private List<Long> departmentIds; |
||||
|
||||
@ApiModelProperty("职位id集合") |
||||
private List<Long> positionIds; |
||||
|
||||
@ApiModelProperty("角色id集合") |
||||
private List<Long> roleIds; |
||||
} |
@ -0,0 +1,63 @@ |
||||
package com.daqing.framework.domain.hrms.ext; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.metadata.BaseRowModel; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.ToString; |
||||
import org.springframework.data.annotation.Transient; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 员工列表展示pojo类 |
||||
* @auther River |
||||
* @date 2020/10/10 15:44 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
@NoArgsConstructor |
||||
@AllArgsConstructor |
||||
public class EmployeeListVO extends BaseRowModel implements Serializable { |
||||
|
||||
@ApiModelProperty("id") |
||||
private Long id; |
||||
|
||||
@ApiModelProperty("姓名") |
||||
@ExcelProperty(value = "姓名",index = 0) |
||||
private String name; |
||||
|
||||
@ExcelProperty(value = "账号",index = 1) |
||||
@ApiModelProperty("账号") |
||||
private String account; |
||||
|
||||
@ExcelProperty(value = "工号",index = 2) |
||||
@ApiModelProperty("工号") |
||||
private String jobNumber; |
||||
|
||||
@ExcelProperty(value = "部门",index = 3) |
||||
@ApiModelProperty("部门") |
||||
@Transient |
||||
private List<String> departmentNameList; |
||||
|
||||
@ExcelProperty(value = "职位",index = 4) |
||||
@ApiModelProperty("职位") |
||||
private List<String> positionNameList; |
||||
|
||||
@ExcelProperty(value = "角色",index = 5) |
||||
@ApiModelProperty("角色") |
||||
private List<String> roleNameList; |
||||
|
||||
@ExcelProperty(value = "创建时间",index = 6) |
||||
@ApiModelProperty("创建时间") |
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
||||
private Date createTime; |
||||
|
||||
@ApiModelProperty("状态(0:启用,1:禁用,2:即将禁用(展示的时候属于启用))") |
||||
private Integer status; |
||||
} |
@ -0,0 +1,38 @@ |
||||
package com.daqing.framework.domain.hrms.ext; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.metadata.BaseRowModel; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 导出员工信息模板 |
||||
* @auther River |
||||
* @date 2020/10/13 16:08 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class EmployeeTemplate extends BaseRowModel implements Serializable { |
||||
|
||||
@ExcelProperty(value = "姓名",index = 0) |
||||
private String name; |
||||
|
||||
@ExcelProperty(value = "账号",index = 1) |
||||
private String account; |
||||
|
||||
@ExcelProperty(value = "工号",index = 2) |
||||
private String jobNumber; |
||||
|
||||
@ExcelProperty(value = "部门(eg:安全部门,技术部门,请按照格式填写正常且已存在的部门名称)",index = 3) |
||||
private List<String> departmentNameList; |
||||
|
||||
@ExcelProperty(value = "职位(eg:总经理,产品经理,请按照格式填写正常且已存在的职位名称)",index = 4) |
||||
private List<String> positionNameList; |
||||
|
||||
@ExcelProperty(value = "角色(eg:管理员,员工,请按照格式填写正常且已存在的角色名称)",index = 5) |
||||
private List<String> roleNameList; |
||||
|
||||
} |
@ -0,0 +1,22 @@ |
||||
package com.daqing.framework.domain.hrms.ext; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* @auther River |
||||
* @date 2020/10/13 17:15 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class RoleVO implements Serializable { |
||||
|
||||
@ApiModelProperty("id") |
||||
private Long id; |
||||
|
||||
@ApiModelProperty("名称") |
||||
private String name; |
||||
} |
@ -0,0 +1,22 @@ |
||||
package com.daqing.framework.domain.hrms.request; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
/** |
||||
* 员工列表请求参数类 |
||||
* @auther River |
||||
* @date 2020/10/10 15:29 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class EmployeeRequest { |
||||
|
||||
@ApiModelProperty("部门id") |
||||
private Long id; |
||||
|
||||
@ApiModelProperty("姓名、账号、工号") |
||||
private String codeOrName; |
||||
|
||||
} |
@ -0,0 +1,27 @@ |
||||
package com.daqing.framework.domain.hrms.response; |
||||
|
||||
import com.daqing.framework.model.response.ResultCode; |
||||
|
||||
/** |
||||
* @auther River |
||||
* @date 2020/10/14 10:05 |
||||
*/ |
||||
public class TestResult implements ResultCode |
||||
{ |
||||
public static String message1 = null; |
||||
public boolean success() { |
||||
return false; |
||||
} |
||||
|
||||
public int code() { |
||||
return 88888; |
||||
} |
||||
|
||||
public String message() { |
||||
return message1; |
||||
} |
||||
|
||||
public String test(String message){ |
||||
return message1 = message; |
||||
} |
||||
} |
Loading…
Reference in new issue