Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0
This commit is contained in:
commit
be0fc013a1
@ -1,7 +1,10 @@
|
|||||||
package com.lz.modules.performance.controller;
|
package com.lz.modules.performance.controller;
|
||||||
|
|
||||||
|
import com.lz.common.utils.BigDecimalUtil;
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
|
import com.lz.modules.performance.dao.ResultTaskMapper;
|
||||||
|
import com.lz.modules.performance.dto.ResultTaskDto;
|
||||||
import com.lz.modules.performance.dto.TaskProcessRecordDto;
|
import com.lz.modules.performance.dto.TaskProcessRecordDto;
|
||||||
import com.lz.modules.performance.entity.TaskProcessRecord;
|
import com.lz.modules.performance.entity.TaskProcessRecord;
|
||||||
import com.lz.modules.performance.req.ChangeTaskListReq;
|
import com.lz.modules.performance.req.ChangeTaskListReq;
|
||||||
@ -15,9 +18,12 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import io.swagger.annotations.ApiResponse;
|
import io.swagger.annotations.ApiResponse;
|
||||||
import io.swagger.annotations.ApiResponses;
|
import io.swagger.annotations.ApiResponses;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: djc
|
* @Author: djc
|
||||||
* @Desc:
|
* @Desc:
|
||||||
@ -34,6 +40,8 @@ public class ResultTaskController extends AbstractController{
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaskProcessRecordService taskProcessRecordService;
|
private TaskProcessRecordService taskProcessRecordService;
|
||||||
|
@Autowired
|
||||||
|
private ResultTaskMapper resultTaskMapper;
|
||||||
|
|
||||||
@GetMapping("/result/taskDetail")
|
@GetMapping("/result/taskDetail")
|
||||||
@ApiOperation("获取绩效任务详情")
|
@ApiOperation("获取绩效任务详情")
|
||||||
@ -71,4 +79,5 @@ public class ResultTaskController extends AbstractController{
|
|||||||
Long userId = getUserId();
|
Long userId = getUserId();
|
||||||
return resultTaskService.deleteTask(taskId,userId);
|
return resultTaskService.deleteTask(taskId,userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -202,9 +202,18 @@ public class ResultTaskServiceImpl extends ServiceImpl<ResultTaskMapper, ResultT
|
|||||||
}
|
}
|
||||||
int size = resultTaskDtos.size();
|
int size = resultTaskDtos.size();
|
||||||
Double rate = 0d;
|
Double rate = 0d;
|
||||||
|
int cout = 0;
|
||||||
for(ResultTaskDto dto:resultTaskDtos){
|
for(ResultTaskDto dto:resultTaskDtos){
|
||||||
|
if(1 == dto.getProcessRate()){
|
||||||
|
cout++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
rate = BigDecimalUtil.add(rate,dto.getProcessRate());
|
rate = BigDecimalUtil.add(rate,dto.getProcessRate());
|
||||||
}
|
}
|
||||||
|
size = size - cout;
|
||||||
|
if(size < 1){
|
||||||
|
return 1d;
|
||||||
|
}
|
||||||
double result = BigDecimalUtil.div(rate, size, 4);
|
double result = BigDecimalUtil.div(rate, size, 4);
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user