提交代码

master
chen 4 years ago
parent e32c4e2f5b
commit d0744f7ef3
  1. 66
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java
  2. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PersonalEfficiencyListRequest.java
  3. 22
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/NumResponse.java
  4. 14
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PersonalEfficiencyListResponse.java
  5. 71
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/R.java
  6. 13
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/ResultCode.java
  7. 2
      dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/TaskNodeConverter.java

@ -4,9 +4,11 @@ import com.alibaba.fastjson.JSONObject;
import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest;
import com.daqing.financial.guarantee.model.request.PersonalEfficiencyListRequest;
import com.daqing.financial.guarantee.model.response.NumResponse;
import com.daqing.financial.guarantee.model.response.PersonalEfficiencyListResponse;
import com.daqing.financial.guarantee.service.IDgEfficiencyService;
import com.daqing.financial.guarantee.util.DateUtils;
import com.daqing.financial.guarantee.util.R;
import com.daqing.financial.guarantee.util.TaskNodeUtil;
import com.daqing.framework.model.StatusCode;
import com.daqing.framework.model.response.ResponseResult;
@ -62,7 +64,7 @@ public class DgEfficiencyController {
@ApiOperation(value = "个人效率记录列表")
@PostMapping("/personalEfficiencyList")
public ResponseResult personalEfficiencyList(
public R personalEfficiencyList(
@ApiParam(name = "personalEfficiencyListRequest", value = "个人效率列表查询对象")
@RequestBody PersonalEfficiencyListRequest personalEfficiencyListRequest){
List<PersonalEfficiencyListResponse> responseList = dgEfficiencyService.queryPersonalEfficiencyList();
@ -87,23 +89,54 @@ public class DgEfficiencyController {
}
}
}
NumResponse numResponse = new NumResponse();
//转换任务节点,并统计操作状态个数
responseList.forEach(personalEfficiencyListResponse -> {
String taskNode = personalEfficiencyListResponse.getTaskNode();
if (taskNode!=null){
String converter = TaskNodeUtil.converter(taskNode);
personalEfficiencyListResponse.setTaskNode(converter);
}
if (personalEfficiencyListResponse.getOperatingStatus()!=null){
switch (personalEfficiencyListResponse.getOperatingStatus()){
case 0:
numResponse.setInitiateNum(numResponse.getInitiateNum()+1);
break;
case 1:
numResponse.setPendingNum(numResponse.getPendingNum()+1);
break;
case 2:
numResponse.setProcessedNum(numResponse.getProcessedNum()+1);
break;
default:
numResponse.setInitiateNum(0);
numResponse.setPendingNum(0);
numResponse.setProcessedNum(0);
break;
}
}
});
//根据条件筛选数据
//迭代器进行筛选
if (personalEfficiencyListRequest.getOperatingStatus()!=null){
// 已发起
if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)){
responseList = responseList.stream().filter(p -> p.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)).collect(Collectors.toList());
responseList.removeIf(next -> !next.getOperatingStatus().equals(StatusCode.CZ_LAUNCH));
// responseList = responseList.stream().filter(p -> !p.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)).collect(Collectors.toList());
// 待处理
}else if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)){
responseList = responseList.stream().filter(p -> p.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)).collect(Collectors.toList());
responseList.removeIf(next -> !next.getOperatingStatus().equals(StatusCode.CZ_ON_HAND));
// responseList = responseList.stream().filter(p -> !p.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)).collect(Collectors.toList());
// 已处理
}else if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)){
responseList = responseList.stream().filter(p -> p.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)).collect(Collectors.toList());
responseList.removeIf(next -> !next.getOperatingStatus().equals(StatusCode.CZ_PROCESSED));
// responseList = responseList.stream().filter(p -> !p.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)).collect(Collectors.toList());
}
}
// 时间筛选(固定时间)
if (personalEfficiencyListRequest.getCreateFixedTime() != null && personalEfficiencyListRequest.getStartTime() == null && personalEfficiencyListRequest.getEndTime() == null) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
switch (personalEfficiencyListRequest.getCreateFixedTime()) {
case 0:
personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getDayBegin()));
@ -144,26 +177,7 @@ public class DgEfficiencyController {
}
}
}
//转换任务节点,并统计操作状态个数
responseList.forEach(personalEfficiencyListResponse -> {
String taskNode = personalEfficiencyListResponse.getTaskNode();
if (taskNode!=null){
String converter = TaskNodeUtil.converter(taskNode);
personalEfficiencyListResponse.setTaskNode(converter);
}
if (personalEfficiencyListResponse.getOperatingStatus()!=null){
switch (personalEfficiencyListResponse.getOperatingStatus()){
case 0:
personalEfficiencyListResponse.setInitiateNum(personalEfficiencyListResponse.getInitiateNum()+1);
case 1:
personalEfficiencyListResponse.setPendingNum(personalEfficiencyListResponse.getPendingNum()+1);
case 2:
personalEfficiencyListResponse.setProcessedNum(personalEfficiencyListResponse.getProcessedNum()+1);
}
}
});
return ResponseResult.SUCCESS(responseList);
return R.ok().data("responseList",responseList).data("statistics",numResponse);
}
public static long getLongDate(String stringDate){

@ -25,6 +25,6 @@ public class PersonalEfficiencyListRequest {
@ApiModelProperty("结束时间")
private String endTime;
@ApiModelProperty("操作状态")
@ApiModelProperty("操作状态")
private Integer operatingStatus;
}

@ -0,0 +1,22 @@
package com.daqing.financial.guarantee.model.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author chen
* @DATE 2021/1/5 11:32
* @Version 1.0
*/
@Data
public class NumResponse {
@ApiModelProperty("发起数")
private Integer initiateNum = 0;
@ApiModelProperty("待处理数")
private Integer pendingNum = 0;
@ApiModelProperty("已处理数")
private Integer processedNum = 0;
}

@ -21,18 +21,6 @@ public class PersonalEfficiencyListResponse {
@ApiModelProperty(value = "业务id")
private Integer businessId;
@ExcelIgnore
@ApiModelProperty("发起数")
private Integer initiateNum = 0;
@ExcelIgnore
@ApiModelProperty("待处理数")
private Integer pendingNum = 0;
@ExcelIgnore
@ApiModelProperty("已处理数")
private Integer processedNum = 0;
@ExcelIgnore
@ApiModelProperty(value = "提单人")
private Integer applicantId;
@ -62,7 +50,7 @@ public class PersonalEfficiencyListResponse {
private String taskNode;
@ApiModelProperty("审批状态")
@ExcelProperty(value = "审状态",index = 7,converter = ApprovalStatusConverter.class)
@ExcelProperty(value = "审状态",index = 7,converter = ApprovalStatusConverter.class)
private Integer approveStatus;
@ApiModelProperty("业务状态")

@ -0,0 +1,71 @@
package com.daqing.financial.guarantee.util;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* @Author chen
* @DATE 2021/1/5 11:43
* @Version 1.0
*/
@Data
public class R {
@ApiModelProperty(value = "是否成功")
private Boolean success;
@ApiModelProperty(value = "返回码")
private Integer code;
@ApiModelProperty(value = "返回消息")
private String message;
@ApiModelProperty(value = "返回数据")
private Map<String, Object> data = new HashMap<String, Object>();
private R(){}
public static R ok(){
R r = new R();
r.setSuccess(true);
r.setCode(ResultCode.SUCCESS);
r.setMessage(ResultCode.SUCCESS_MESSAGE);
return r;
}
public static R error(){
R r = new R();
r.setSuccess(false);
r.setCode(ResultCode.FAILURE);
r.setMessage(ResultCode.FAILURE_MESSAGE);
return r;
}
public R success(Boolean success){
this.setSuccess(success);
return this;
}
public R message(String message){
this.setMessage(message);
return this;
}
public R code(Integer code){
this.setCode(code);
return this;
}
public R data(String key, Object value){
this.data.put(key, value);
return this;
}
public R data(Map<String, Object> map){
this.setData(map);
return this;
}
}

@ -0,0 +1,13 @@
package com.daqing.financial.guarantee.util;
/**
* @Author chen
* @DATE 2021/1/5 11:43
* @Version 1.0
*/
public interface ResultCode {
Integer SUCCESS = 10000;//成功
Integer FAILURE = 20000;//失败
String SUCCESS_MESSAGE = "成功";
String FAILURE_MESSAGE = "失败";
}

@ -45,7 +45,7 @@ public class TaskNodeConverter implements Converter<Integer> {
* 这里是写的时候会调用
*
* @param value
* NotNull
* NotNull
* @param contentProperty
* Nullable
* @param globalConfiguration

Loading…
Cancel
Save