修复团队效率时间筛选、客户导入问题

master
river 4 years ago
parent ded4548f26
commit 994d506543
  1. 2
      dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/CompanyCustomerRequest.java
  2. 24
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java
  3. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelResponse.java
  4. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java
  5. 2
      dq-framework-common/src/main/java/com/daqing/framework/model/response/ResponseResult.java
  6. 16
      dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java
  7. 44
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/CompanyTemplate.java
  8. 44
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/ext/PersonalTemplate.java

@ -32,7 +32,7 @@ public class CompanyCustomerRequest implements Serializable {
@ApiModelProperty(value = "客户类型") @ApiModelProperty(value = "客户类型")
private Integer type; private Integer type;
@ApiModelProperty(value = "客户经理人ids") @ApiModelProperty(value = "客户经理人id")
private Long manager; private Long manager;
@NotNull(message = "客户名称不能为空") @NotNull(message = "客户名称不能为空")

@ -361,15 +361,15 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
try { try {
List<Object> personalList = ExcelUtil.readExcel(excel, new PersonalTemplate(), 1); List<Object> personalList = ExcelUtil.readExcel(excel, new PersonalTemplate(), 1);
List<Object> companyList = ExcelUtil.readExcel(excel, new CompanyTemplate(), 2); List<Object> companyList = ExcelUtil.readExcel(excel, new CompanyTemplate(), 2);
List<EmployeeVO> nameList = hrmsFeignService.listEmployeeName().getData(); /*List<EmployeeVO> nameList = hrmsFeignService.listEmployeeName().getData();*/
CustomerPersonalTOI customerPersonalTOI; CustomerPersonalTOI customerPersonalTOI;
ManagerName manager; // 客户名称 /*ManagerName manager; // 客户名称*/
// 个人类型 // 个人类型
for (Object personal : personalList) { for (Object personal : personalList) {
customerPersonalTOI = new CustomerPersonalTOI(); customerPersonalTOI = new CustomerPersonalTOI();
customerPersonalTOI.setType(0); customerPersonalTOI.setType(0);
BeanUtils.copyProperties(personal, customerPersonalTOI); BeanUtils.copyProperties(personal, customerPersonalTOI);
manager = new ManagerName(); /*manager = new ManagerName();
BeanUtils.copyProperties(personal, manager); BeanUtils.copyProperties(personal, manager);
// 根据客户经理名称找到对应的员工id // 根据客户经理名称找到对应的员工id
if (nameList != null && manager.getManager() != null) { if (nameList != null && manager.getManager() != null) {
@ -378,20 +378,20 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
customerPersonalTOI.setManager(employeeVO.getId()); customerPersonalTOI.setManager(employeeVO.getId());
} }
} }
/*if (customerPersonalTOI.getManager() == null) { if (customerPersonalTOI.getManager() == null) {
return new ResponseResult<String>().FAIL("导入数据失败,员工" + manager.getManager() + "不存在"); return new ResponseResult<String>().FAIL("导入数据失败,员工" + manager.getManager() + "不存在");
}*/ }
} }*/
this.saveCustomerPersonal(customerPersonalTOI); this.saveCustomerPersonal(customerPersonalTOI);
} }
// 企业类型 // 企业类型
for (Object company : companyList) { for (Object company : companyList) {
CompanyCustomerRequest companyCustomerRequest = new CompanyCustomerRequest(); CompanyCustomerRequest companyCustomerRequest = new CompanyCustomerRequest();
manager = new ManagerName(); /*manager = new ManagerName();*/
companyCustomerRequest.setType(1); companyCustomerRequest.setType(1);
companyCustomerRequest.setIsExistRelated(0); companyCustomerRequest.setIsExistRelated(0);
BeanUtils.copyProperties(company, companyCustomerRequest); BeanUtils.copyProperties(company, companyCustomerRequest);
BeanUtils.copyProperties(company, manager); /*BeanUtils.copyProperties(company, manager);
// 根据客户经理名称找到对应的员工id // 根据客户经理名称找到对应的员工id
if (nameList != null && manager.getManager() != null) { if (nameList != null && manager.getManager() != null) {
for (EmployeeVO employeeVO : nameList) { for (EmployeeVO employeeVO : nameList) {
@ -399,16 +399,16 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
companyCustomerRequest.setManager(employeeVO.getId()); companyCustomerRequest.setManager(employeeVO.getId());
} }
} }
/*if (companyCustomerRequest.getManager() == null) { if (companyCustomerRequest.getManager() == null) {
return new ResponseResult<String>().FAIL("导入数据失败,员工" + manager.getManager() + "不存在"); return new ResponseResult<String>().FAIL("导入数据失败,员工" + manager.getManager() + "不存在");
}*/ }
} }*/
this.insertCompany(companyCustomerRequest); this.insertCompany(companyCustomerRequest);
// this.saveCustomerCompany(customerCompanyTOI); // this.saveCustomerCompany(customerCompanyTOI);
} }
return ResponseResult.SUCCESS(); return ResponseResult.SUCCESS();
} catch (Exception e) { } catch (Exception e) {
return new ResponseResult<String>().FAIL("导入数据失败,请检查文件和数据格式或稍后再试"); return ResponseResult.FAIL("EXPORT FAIL");
} }
} }

@ -51,7 +51,7 @@ public class DgStatisticsExcelResponse extends BaseRowModel implements Serializa
private Date createTime; private Date createTime;
@ApiModelProperty("完成任务节点id") @ApiModelProperty("完成任务节点id")
@ExcelProperty(value = "完成任务节点id", index = 7, converter = ProcessIdConverter.class) @ExcelProperty(value = "完成任务节点", index = 7, converter = ProcessIdConverter.class)
private Integer processId; private Integer processId;
@ApiModelProperty("最新操作时间") @ApiModelProperty("最新操作时间")

@ -141,9 +141,10 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
// 处理结束时间为当前日期最后一秒 // 处理结束时间为当前日期最后一秒
if (dgEfficiencyTeamRequest.getEndTime() != null && dgEfficiencyTeamRequest.getEndTime().length() != 0) { if (dgEfficiencyTeamRequest.getEndTime() != null && dgEfficiencyTeamRequest.getEndTime().length() != 0) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date dateTime = null; Date dateTime = null;
try { try {
dateTime = dateFormat.parse(dgEfficiencyTeamRequest.getEndTime()); dateTime = simpleDateFormat.parse(dgEfficiencyTeamRequest.getEndTime());
} catch (ParseException e) { } catch (ParseException e) {
ExceptionCast.cast(GuaranteeCode.EFFICIENCY_TIME_ERROR); ExceptionCast.cast(GuaranteeCode.EFFICIENCY_TIME_ERROR);
} }
@ -164,7 +165,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
} }
list.add(efficiencyList); list.add(efficiencyList);
} }
// 返回数据格式 // 返回数据格式<部门,<节点,时间>>
HashMap<Integer, HashMap<Integer, String>> hashMap = new HashMap<>(); HashMap<Integer, HashMap<Integer, String>> hashMap = new HashMap<>();
String time; // 时间差 String time; // 时间差
Integer processId; // 业务节点id Integer processId; // 业务节点id

@ -57,7 +57,7 @@ public class ResponseResult<T> {
} }
public static ResponseResult FAIL(Object t) { public static ResponseResult FAIL(Object t) {
return new ResponseResult<>(false, 99999, t, "操作失败,请检查客户经理是否为公司已存在员工或者文件和数据格式!"); return new ResponseResult<>(false, 99999, t, "操作失败,请检查文件或者数据格式是否正确!");
} }
public ResponseResult SUCCESS_DATA(T t){ public ResponseResult SUCCESS_DATA(T t){

@ -5,6 +5,10 @@ import org.springframework.util.DigestUtils;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/** /**
* @author zcw * @author zcw
@ -30,5 +34,17 @@ public class Md5Util {
//System.out.println(s); //System.out.println(s);
//System.out.println(md5("1234564")); //System.out.println(md5("1234564"));
System.out.println(md5("Aa123420")); System.out.println(md5("Aa123420"));
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
try {
date = simpleDateFormat.parse("2021-01-06");
} catch (ParseException e) {
e.printStackTrace();
}
Timestamp time = DateUtils.getDayEndTime(date);
System.out.println(time);
System.out.println(simpleDateFormat.format(time));
} }
} }

@ -20,67 +20,65 @@ import java.util.Date;
@Data @Data
@ToString @ToString
public class CompanyTemplate extends BaseRowModel implements Serializable { public class CompanyTemplate extends BaseRowModel implements Serializable {
/**
* 客户经理 /*@ExcelProperty(value = "客户经理(请填写本公司存在的员工姓名)", index = 0)
*/ private String manager;*/
@ExcelProperty(value = "客户经理(请填写本公司存在的员工姓名)", index = 0)
private String manager;
/** /**
* 客户名称 * 客户名称
*/ */
@ExcelProperty(value = "客户名称", index = 1) @ExcelProperty(value = "客户名称", index = 0)
private String name; private String name;
@ExcelProperty(value = "社会统一代码", index = 2) @ExcelProperty(value = "社会统一代码", index = 1)
private String socialUnifiedCode; private String socialUnifiedCode;
@ExcelProperty(value = "联系电话", index = 3) @ExcelProperty(value = "联系电话", index = 2)
private String phone; private String phone;
@ExcelProperty(value = "注册时间(eg:2020-02-20)", index = 4) @ExcelProperty(value = "注册时间(eg:2020-02-20)", index = 3)
private Date registerTime; private Date registerTime;
@ExcelProperty(value = "注册资金", index = 5) @ExcelProperty(value = "注册资金", index = 4)
private String registeredCapital; private String registeredCapital;
@ExcelProperty(value = "员工人数", index = 6) @ExcelProperty(value = "员工人数", index = 5)
private String empNum; private String empNum;
@ExcelProperty(value = "注册地址", index = 7) @ExcelProperty(value = "注册地址", index = 6)
private String registerAddr; private String registerAddr;
@ExcelProperty(value = "联系人", index = 8) @ExcelProperty(value = "联系人", index = 7)
private String linkman; private String linkman;
@ExcelProperty(value = "联系人的联系电话", index = 9) @ExcelProperty(value = "联系人的联系电话", index = 8)
private String linkPhone; private String linkPhone;
@ExcelProperty(value = "经营地址", index = 10) @ExcelProperty(value = "经营地址", index = 9)
private String businessAddr; private String businessAddr;
@ExcelProperty(value = "业务来源", index = 11) @ExcelProperty(value = "业务来源", index = 10)
private String businessSource; private String businessSource;
@ExcelProperty(value = "经营范围", index = 12) @ExcelProperty(value = "经营范围", index = 11)
private String businessScope; private String businessScope;
/** /**
* 法人-姓名 * 法人-姓名
*/ */
@ExcelProperty(value = "法人-姓名", index = 13) @ExcelProperty(value = "法人-姓名", index = 12)
private String legalName; private String legalName;
@ExcelProperty(value = "法人-性别 1、男,0、女", index = 14) @ExcelProperty(value = "法人-性别 1、男,0、女", index = 13)
private Integer legalGender; private Integer legalGender;
@ExcelProperty(value = "法人-身份证号", index = 15) @ExcelProperty(value = "法人-身份证号", index = 14)
private String legalIdNumber; private String legalIdNumber;
@ExcelProperty(value = "法人-户口所在地", index = 16) @ExcelProperty(value = "法人-户口所在地", index = 15)
private String legalHukouAddr; private String legalHukouAddr;
@ExcelProperty(value = "法人-联系电话", index = 17) @ExcelProperty(value = "法人-联系电话", index = 16)
private String legalPhone; private String legalPhone;
@ExcelProperty(value = "法人-家庭住址", index = 18) @ExcelProperty(value = "法人-家庭住址", index = 17)
private String legalHomeAddr; private String legalHomeAddr;
} }

@ -16,118 +16,116 @@ import java.io.Serializable;
@Data @Data
@ToString @ToString
public class PersonalTemplate extends BaseRowModel implements Serializable { public class PersonalTemplate extends BaseRowModel implements Serializable {
/**
* 客户经理 /*@NotNull(message = "客户经理不能为空")
*/
@NotNull(message = "客户经理不能为空")
@ExcelProperty(value = "客户经理(请填写本公司存在的员工姓名)",index = 0) @ExcelProperty(value = "客户经理(请填写本公司存在的员工姓名)",index = 0)
private String manager; private String manager;*/
/** /**
* 客户名称 * 客户名称
*/ */
@NotNull(message = "客户名称不能为空") @NotNull(message = "客户名称不能为空")
@ExcelProperty(value = "姓名",index = 1) @ExcelProperty(value = "姓名",index = 0)
private String name; private String name;
/** /**
* 联系地址 * 联系地址
*/ */
@NotNull(message = "联系地址不能为空") @NotNull(message = "联系地址不能为空")
@ExcelProperty(value = "地址",index = 2) @ExcelProperty(value = "地址",index = 1)
private String addr; private String addr;
/** /**
* 联系电话 * 联系电话
*/ */
@NotNull(message = "联系电话不能为空") @NotNull(message = "联系电话不能为空")
@ExcelProperty(value = "电话",index = 3) @ExcelProperty(value = "电话",index = 2)
private String phone; private String phone;
/** /**
* 身份证号 * 身份证号
*/ */
@NotNull(message = "身份证号不能为空") @NotNull(message = "身份证号不能为空")
@ExcelProperty(value = "身份证号",index = 4) @ExcelProperty(value = "身份证号",index = 3)
private String idCard; private String idCard;
/** /**
* 年龄 * 年龄
*/ */
@NotNull(message = "年龄不能为空") @NotNull(message = "年龄不能为空")
@ExcelProperty(value = "年龄",index = 5) @ExcelProperty(value = "年龄",index = 4)
private Integer age; private Integer age;
/** /**
* 性别10 * 性别10
*/ */
@NotNull(message = "性别不能为空") @NotNull(message = "性别不能为空")
@ExcelProperty(value = "性别(1:男,0:女)",index = 6) @ExcelProperty(value = "性别(1:男,0:女)",index = 5)
private Integer gender; private Integer gender;
/** /**
* 婚姻状况1已婚0未婚 * 婚姻状况1已婚0未婚
*/ */
@NotNull(message = "婚姻状况不能为空") @NotNull(message = "婚姻状况不能为空")
@ExcelProperty(value = "婚姻状况(0:未婚,1:已婚,2:离异,3:再婚)",index = 7) @ExcelProperty(value = "婚姻状况(0:未婚,1:已婚,2:离异,3:再婚)",index = 6)
private Integer maritalStatus; private Integer maritalStatus;
/** /**
* 学历 * 学历
*/ */
@NotNull(message = "学历不能为空") @NotNull(message = "学历不能为空")
@ExcelProperty(value = "学历(0:本科,1:大专,2:高职,3:中专,4:其他)",index = 8) @ExcelProperty(value = "学历(0:本科,1:大专,2:高职,3:中专,4:其他)",index = 7)
private Integer education; private Integer education;
/** /**
* 工作单位 * 工作单位
*/ */
@NotNull(message = "工作单位不能为空") @NotNull(message = "工作单位不能为空")
@ExcelProperty(value = "工作单位",index = 9) @ExcelProperty(value = "工作单位",index = 8)
private String employer; private String employer;
/** /**
* 职务 * 职务
*/ */
@NotNull(message = "职务不能为空") @NotNull(message = "职务不能为空")
@ExcelProperty(value = "职务",index = 10) @ExcelProperty(value = "职务",index = 9)
private String position; private String position;
/** /**
* 工作年限 * 工作年限
*/ */
@NotNull(message = "工作年限不能为空") @NotNull(message = "工作年限不能为空")
@ExcelProperty(value = "工作年限",index = 11) @ExcelProperty(value = "工作年限",index = 10)
private Integer workingYears; private Integer workingYears;
/** /**
* 社保账号 * 社保账号
*/ */
@NotNull(message = "社保账号不能为空") @NotNull(message = "社保账号不能为空")
@ExcelProperty(value = "社保账号",index = 12) @ExcelProperty(value = "社保账号",index = 11)
private String socialSecurityNum; private String socialSecurityNum;
/** /**
* 居住情况 * 居住情况
*/ */
@NotNull(message = "居住情况不能为空") @NotNull(message = "居住情况不能为空")
@ExcelProperty(value = "居住情况",index = 13) @ExcelProperty(value = "居住情况",index = 12)
private String livingSituation; private String livingSituation;
/** /**
* 户籍地址 * 户籍地址
*/ */
@NotNull(message = "户籍地址不能为空") @NotNull(message = "户籍地址不能为空")
@ExcelProperty(value = "户籍地址",index = 14) @ExcelProperty(value = "户籍地址",index = 13)
private String residenceAddr; private String residenceAddr;
/** /**
* 业务来源 * 业务来源
*/ */
@NotNull(message = "业务来源不能为空") @NotNull(message = "业务来源不能为空")
@ExcelProperty(value = "业务来源",index = 15) @ExcelProperty(value = "业务来源",index = 14)
private String businessSource; private String businessSource;
/** /**
* 紧急联系人 * 紧急联系人
*/ */
@NotNull(message = "紧急联系人不能为空") @NotNull(message = "紧急联系人不能为空")
@ExcelProperty(value = "紧急联系人",index = 16) @ExcelProperty(value = "紧急联系人",index = 15)
private String emergencyLinkman; private String emergencyLinkman;
/** /**
* 紧急联系人关系 * 紧急联系人关系
*/ */
@NotNull(message = "紧急联系人关系不能为空") @NotNull(message = "紧急联系人关系不能为空")
@ExcelProperty(value = "紧急联系人关系",index = 17) @ExcelProperty(value = "紧急联系人关系",index = 16)
private String emergencyLinkmanRelationship; private String emergencyLinkmanRelationship;
/** /**
* 紧急联系人电话 * 紧急联系人电话
*/ */
@NotNull(message = "紧急联系人电话不能为空") @NotNull(message = "紧急联系人电话不能为空")
@ExcelProperty(value = "紧急联系人电话",index = 18) @ExcelProperty(value = "紧急联系人电话",index = 17)
private String emergencyLinkmanPhone; private String emergencyLinkmanPhone;
} }

Loading…
Cancel
Save