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

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. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelRefuseResponse.java
  3. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelResponse.java
  4. 14
      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;
@ -54,7 +55,7 @@ public class DgStatisticsExcelRefuseResponse extends BaseRowModel implements Se
private String refuseName;
@ApiModelProperty("拒绝节点id")
@ExcelProperty(value = "任务节点",index = 8)
@ExcelProperty(value = "任务节点", index = 8, converter = ProcessIdConverter.class)
private Integer processId;
@ApiModelProperty("拒绝时间")

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

@ -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<>();

@ -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