修复客户导入、业务统计导出转换器

master
river 4 years ago
parent ceb46ec638
commit 8049304ade
  1. 8
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java
  2. 29
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelRefuseResponse.java
  3. 23
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelResponse.java
  4. 60
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java
  5. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java
  6. 2
      dq-framework-common/src/main/java/com/daqing/framework/util/Md5Util.java
  7. 3
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/GuaranteeCode.java
  8. 84
      dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/ProcessIdConverter.java

@ -377,9 +377,9 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
customerPersonalTOI.setManager(employeeVO.getId());
}
}
if (customerPersonalTOI.getManager() == null) {
/*if (customerPersonalTOI.getManager() == null) {
return new ResponseResult<String>().FAIL("导入数据失败,员工" + manager.getManager() + "不存在");
}
}*/
}
this.saveCustomerPersonal(customerPersonalTOI);
}
@ -398,9 +398,9 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
companyCustomerRequest.setManager(employeeVO.getId());
}
}
if (companyCustomerRequest.getManager() == null) {
/*if (companyCustomerRequest.getManager() == null) {
return new ResponseResult<String>().FAIL("导入数据失败,员工" + manager.getManager() + "不存在");
}
}*/
}
this.insertCompany(companyCustomerRequest);
// this.saveCustomerCompany(customerCompanyTOI);

@ -2,6 +2,7 @@ package com.daqing.financial.guarantee.model.response;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.daqing.framework.utils.excel.ProcessIdConverter;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -18,59 +19,59 @@ import java.util.Date;
*/
@Data
@ToString
public class DgStatisticsExcelRefuseResponse extends BaseRowModel implements Serializable {
public class DgStatisticsExcelRefuseResponse extends BaseRowModel implements Serializable {
@ApiModelProperty("业务编号")
@ExcelProperty(value = "业务编号",index = 0)
@ExcelProperty(value = "业务编号", index = 0)
private String businessCode;
@ApiModelProperty("客户姓名")
@ExcelProperty(value = "客户姓名",index = 1)
@ExcelProperty(value = "客户姓名", index = 1)
private String name;
@ApiModelProperty("客户联系方式")
@ExcelProperty(value = "联系电话",index = 2)
@ExcelProperty(value = "联系电话", index = 2)
private String phone;
@ApiModelProperty("业务类型")
@ExcelProperty(value = "产品类型",index = 3)
@ExcelProperty(value = "产品类型", index = 3)
private String businessType;
@ApiModelProperty("申请额度")
@ExcelProperty(value = "金额",index = 4)
@ExcelProperty(value = "金额", index = 4)
private Double applyAmount;
@ApiModelProperty("申请期限")
@ExcelProperty(value = "期数",index = 5)
@ExcelProperty(value = "期数", index = 5)
private String applyTime;
@ApiModelProperty("申请日期")
@ExcelProperty(value = "申请日期",index = 6)
@ExcelProperty(value = "申请日期", index = 6)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty("拒绝人")
@ExcelProperty(value = "当前审批人",index = 7)
@ExcelProperty(value = "当前审批人", index = 7)
private String refuseName;
@ApiModelProperty("拒绝节点id")
@ExcelProperty(value = "任务节点",index = 8)
@ExcelProperty(value = "任务节点", index = 8, converter = ProcessIdConverter.class)
private Integer processId;
@ApiModelProperty("拒绝时间")
@ExcelProperty(value = "拒绝时间",index = 9)
@ExcelProperty(value = "拒绝时间", index = 9)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date refuseTime;
@ApiModelProperty("拒绝原因")
@ExcelProperty(value = "拒绝原因",index = 10)
@ExcelProperty(value = "拒绝原因", index = 10)
private String refuseOpinion;
@ApiModelProperty("提单人姓名")
@ExcelProperty(value = "提单人",index = 11)
@ExcelProperty(value = "提单人", index = 11)
private String employeeName;
@ApiModelProperty("部门")
@ExcelProperty(value = "所属部门",index = 12)
@ExcelProperty(value = "所属部门", index = 12)
private String department;
}

@ -2,6 +2,7 @@ package com.daqing.financial.guarantee.model.response;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.daqing.framework.utils.excel.ProcessIdConverter;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -21,49 +22,49 @@ import java.util.Date;
public class DgStatisticsExcelResponse extends BaseRowModel implements Serializable {
@ApiModelProperty("业务编号")
@ExcelProperty(value = "业务编号",index = 0)
@ExcelProperty(value = "业务编号", index = 0)
private String businessCode;
@ApiModelProperty("客户姓名")
@ExcelProperty(value = "客户姓名",index = 1)
@ExcelProperty(value = "客户姓名", index = 1)
private String name;
@ApiModelProperty("客户联系方式")
@ExcelProperty(value = "联系电话",index = 2)
@ExcelProperty(value = "联系电话", index = 2)
private String phone;
@ApiModelProperty("业务类型")
@ExcelProperty(value = "产品类型",index = 3)
@ExcelProperty(value = "产品类型", index = 3)
private String businessType;
@ApiModelProperty("申请额度")
@ExcelProperty(value = "金额",index = 4)
@ExcelProperty(value = "金额", index = 4)
private Double applyAmount;
@ApiModelProperty("申请期限")
@ExcelProperty(value = "期数",index = 5)
@ExcelProperty(value = "期数", index = 5)
private String applyTime;
@ApiModelProperty("申请日期")
@ExcelProperty(value = "申请日期",index = 6)
@ExcelProperty(value = "申请日期", index = 6)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createTime;
@ApiModelProperty("完成任务节点id")
@ExcelProperty(value = "完成任务节点id",index = 7)
@ExcelProperty(value = "完成任务节点id", index = 7, converter = ProcessIdConverter.class)
private Integer processId;
@ApiModelProperty("最新操作时间")
@ExcelProperty(value = "任务分配时间",index = 8)
@ExcelProperty(value = "任务分配时间", index = 8)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date operationTime;
@ApiModelProperty("提单人姓名")
@ExcelProperty(value = "提单人",index = 9)
@ExcelProperty(value = "提单人", index = 9)
private String employeeName;
@ApiModelProperty("部门")
@ExcelProperty(value = "所属部门",index = 10)
@ExcelProperty(value = "所属部门", index = 10)
private String department;
}

@ -14,8 +14,10 @@ import com.daqing.financial.guarantee.service.IDgEfficiencyService;
import com.daqing.financial.guarantee.util.DateUtils;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.domain.guarantee.DgAuditProcess;
import com.daqing.framework.domain.guarantee.GuaranteeCode;
import com.daqing.framework.domain.guarantee.po.DgWorkConferencePO;
import com.daqing.framework.domain.guarantee.po.StatusPO;
import com.daqing.framework.exception.ExceptionCast;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.util.RedisUtil;
import com.google.common.collect.Maps;
@ -24,6 +26,7 @@ import org.springframework.stereotype.Service;
import com.daqing.framework.domain.guarantee.po.DgTeamEfficiencyPO;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -118,6 +121,17 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
dgEfficiencyTeamRequest.setEndTime(null);
}
}
// 处理结束时间为当前日期最后一秒
if (dgEfficiencyTeamRequest.getEndTime() != null && dgEfficiencyTeamRequest.getEndTime().length() != 0) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date dateTime = null;
try {
dateTime = dateFormat.parse(dgEfficiencyTeamRequest.getEndTime());
} catch (ParseException e) {
ExceptionCast.cast(GuaranteeCode.EFFICIENCY_TIME_ERROR);
}
dgEfficiencyTeamRequest.setEndTime(dateFormat.format(DateUtils.getDayEndTime(dateTime)));
}
// 查询出所有的数据
List<DgTeamEfficiencyPO> teamEfficiencyList = this.getBaseMapper().queryList(dgEfficiencyTeamRequest);
List<List<DgTeamEfficiencyPO>> list = new ArrayList<>();
@ -276,7 +290,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
//业务申请列表查询
IPage<BusinessApplicationListResponse> positionVO = applyAmountListMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId());
List<BusinessApplicationListResponse> records = positionVO.getRecords();
if (records!=null && records.size()!=0){
if (records != null && records.size() != 0) {
records.forEach(businessApplicationListResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = businessApplicationListResponse.getBusinessId();
@ -298,7 +312,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
// 担保部调查列表
IPage<GuaranteeListResponse> positionVO = guaranteeAssignUserMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId(), null);
List<GuaranteeListResponse> records = positionVO.getRecords();
if (records!=null && records.size()!=0) {
if (records != null && records.size() != 0) {
records.forEach(guaranteeListResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = guaranteeListResponse.getBusinessId();
@ -320,7 +334,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
// 资产部调查列表
IPage<AssetsInvestigationListResponse> positionVO = assetsInvestigationMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId(), null);
List<AssetsInvestigationListResponse> records = positionVO.getRecords();
if (records!=null && records.size()!=0) {
if (records != null && records.size() != 0) {
records.forEach(assetsInvestigationListResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = assetsInvestigationListResponse.getBusinessId();
@ -342,7 +356,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
// 信息部调查列表
IPage<MessageInvestigationListResponse> positionVO = messageInvestigationMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId(), null);
List<MessageInvestigationListResponse> records = positionVO.getRecords();
if (records!=null && records.size()!=0) {
if (records != null && records.size() != 0) {
records.forEach(messageInvestigationListResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = messageInvestigationListResponse.getBusinessId();
@ -360,12 +374,12 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
}
}
//担保部A/B角、法规经理角色、法规部C角、法规部分管领导
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_C_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_LD_ID))) {
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.FG_C_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.FG_LD_ID))) {
// 合规调查列表
DgComplianceInvestigationRequest dgComplianceInvestigationRequest = new DgComplianceInvestigationRequest();
IPage<DgComplianceInvestigationResponse> list = complianceInvestigationMapper.list(new Page(1, size), dgComplianceInvestigationRequest, roleList, currentUser);
List<DgComplianceInvestigationResponse> records = list.getRecords();
if (records!=null && records.size()!=0) {
if (records != null && records.size() != 0) {
records.forEach(dgComplianceInvestigationResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = dgComplianceInvestigationResponse.getBusinessId();
@ -386,7 +400,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
if (roleIdList.contains(String.valueOf(PromptSuccess.GZU_ID))) {
IPage<DgWorkConferencePO> list = workConferenceConsiderMapper.list(new Page(1, size), "", roleList, currentUser);
List<DgWorkConferencePO> records = list.getRecords();
if (records!=null && records.size()!=0) {
if (records != null && records.size() != 0) {
records.forEach(dgWorkConferencePO -> {
StatusPO statusPO = new StatusPO();
Integer businessId = dgWorkConferencePO.getBusinessId();
@ -404,10 +418,10 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
}
}
//担保部A/B角、贷审会
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DSH_ID))) {
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DSH_ID))) {
IPage<DgLoanCommitteeConsiderResponse> list = loanCommitteeConsiderMapper.list(new Page(1, size), "", roleList, currentUser);
List<DgLoanCommitteeConsiderResponse> records = list.getRecords();
if (records!=null && records.size()!=0) {
if (records != null && records.size() != 0) {
records.forEach(dgLoanCommitteeConsiderResponse -> {
StatusPO statusPO = new StatusPO();
Integer businessId = dgLoanCommitteeConsiderResponse.getBusinessId();
@ -425,11 +439,11 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
}
}
//法规经理、担保部A/B角、资产部经理
if (roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID))|roleIdList.contains(String.valueOf(PromptSuccess.ZC_JL_ID)) ) {
if (roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.ZC_JL_ID))) {
//担保函
IPage<GuaranteeLetterListResponse> iPage = guaranteeLetterAssignUserMapper.pageByCondition(new Page(1, size), currentUser, roleIdList, null, null);
List<GuaranteeLetterListResponse> records = iPage.getRecords();
if (records!=null && records.size()!=0) {
if (records != null && records.size() != 0) {
records.forEach(guaranteeLetterListResponse -> {
StatusPO statusPO = new StatusPO();
String name = guaranteeLetterListResponse.getName();
@ -447,11 +461,11 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
}
}
//财务部、法规经理
if (roleIdList.contains(String.valueOf(PromptSuccess.CWB_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))) {
if (roleIdList.contains(String.valueOf(PromptSuccess.CWB_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))) {
//回款确认
IPage<PaymentConfirmationListResponse> iPage = paymentConfirmationConsiderMapper.pageByCondition(new Page(1, size), roleIdList, currentUser, null, null);
List<PaymentConfirmationListResponse> records = iPage.getRecords();
if (records!=null && records.size()!=0) {
if (records != null && records.size() != 0) {
records.forEach(paymentConfirmationListResponse -> {
StatusPO statusPO = new StatusPO();
String name = paymentConfirmationListResponse.getName();
@ -473,7 +487,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
//放款通知
IPage<LoanNoticeListResponse> iPage = loanNoticeMapper.pageByCondition(new Page(1, size), roleIdList, currentUser, null, null);
List<LoanNoticeListResponse> records = iPage.getRecords();
if (records!=null && records.size()!=0) {
if (records != null && records.size() != 0) {
records.forEach(loanNoticeListResponse -> {
StatusPO statusPO = new StatusPO();
String name = loanNoticeListResponse.getName();
@ -495,10 +509,10 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
Integer businessId = personalEfficiencyListResponse.getBusinessId();
Object o = hashMap.get(businessId);
//有数据
if (ObjectUtil.isNotNull(o)){
if (ObjectUtil.isNotNull(o)) {
//强制转换
if (o instanceof StatusPO){
StatusPO statusPO = (StatusPO)o;
if (o instanceof StatusPO) {
StatusPO statusPO = (StatusPO) o;
String name = statusPO.getName();
Integer operatingStatus = statusPO.getOperatingStatus();
Integer processId = statusPO.getProcessId();
@ -527,7 +541,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
wrapper.eq("business_id", businessId).orderByAsc("create_time");
List<DgAuditProcess> auditProcessList = dgAuditProcessMapper.selectList(wrapper);
long countTime = 0L;
if (auditProcessList.size()>1){
if (auditProcessList.size() > 1) {
//遍历业务流程数据,统计该用户的耗时
for (int i = 1; i <= auditProcessList.size() - 1; i++) {
//从第二条数据开始,获取该数据
@ -557,11 +571,11 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
public static String countTime(String totalTime) {
long time = Long.parseLong(totalTime);
long days = time/ (1000 * 60 * 60 * 24);
long hours = (time% (1000 * 60 * 60 * 24)) / (1000 * 60 * 60);
long minutes = (time% (1000 * 60 * 60)) / (1000 * 60);
long seconds = (time% (1000 * 60)) / 1000;
return days + "天" + hours + "小时"+ minutes +"分钟";
long days = time / (1000 * 60 * 60 * 24);
long hours = (time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60);
long minutes = (time % (1000 * 60 * 60)) / (1000 * 60);
long seconds = (time % (1000 * 60)) / 1000;
return days + "天" + hours + "小时" + minutes + "分钟";
}
/**

@ -15,6 +15,7 @@ import com.daqing.framework.domain.hrms.response.RolePermissionResponse;
import com.daqing.framework.model.response.CommonCode;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -283,6 +284,7 @@ public class EmployeeController implements EmployeeControllerApi {
/**
* 根据用户id获取所在部门ids
*/
@ApiOperation(value = "根据用户id获取部门")
@GetMapping("/getDepartmentIds")
public String getDepartmentIds(Integer userId) {
return employeeService.getDeptIds(userId);

@ -29,6 +29,6 @@ public class Md5Util {
//String s = URLEncoder.encode("www.occupationlab.com", "utf-8");
//System.out.println(s);
//System.out.println(md5("1234564"));
System.out.println(md5("Aa12341"));
System.out.println(md5("Aa123420"));
}
}

@ -27,8 +27,9 @@ public enum GuaranteeCode implements ResultCode {
WORK_JUDGE_NOT_NULL(false, 110001, "参会评委不能为空,请重新选择!"),
EXCEL_ID_NOT_NULL(false, 120001, "导出的数据不能为空,请选择要导出的数据!");
EXCEL_ID_NOT_NULL(false, 120001, "导出的数据不能为空,请选择要导出的数据!"),
EFFICIENCY_TIME_ERROR(false, 130001,"时间格式错误!");
/**
* 操作是否成功
*/

@ -0,0 +1,84 @@
package com.daqing.framework.utils.excel;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
/**
* @auther River
* @date 2021/1/6 17:23
*/
public class ProcessIdConverter implements Converter<Integer> {
@Override
public Class supportJavaTypeKey() {
return Integer.class;
}
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
/**
* 这里读的时候会调用
*
* @param cellData
* NotNull
* @param contentProperty
* Nullable
* @param globalConfiguration
* NotNull
* @return
*/
@Override
public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return 0;
}
/**
* 这里是写的时候会调用
*
* @param value
* NotNull
* @param contentProperty
* Nullable
* @param globalConfiguration
* NotNull
* @return
*/
@Override
public CellData convertToExcelData(Integer value, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
switch (value){
case 1:
return new CellData("业务申请");
case 2:
return new CellData("担保部调查");
case 3:
return new CellData("资产部调查");
case 4:
return new CellData("信息部调查");
case 5:
return new CellData("合规调查");
case 6:
return new CellData("工作会");
case 7:
return new CellData("贷审会");
case 8:
return new CellData("担保函");
case 9:
return new CellData("回款确认");
case 10:
return new CellData("放款通知");
default:
return new CellData("");
}
}
}
Loading…
Cancel
Save