提交修改
This commit is contained in:
parent
1c3c7c3d23
commit
023d3afdee
@ -3,8 +3,11 @@ package com.lz.common.utils;
|
|||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@ -653,11 +656,6 @@ public class StringUtil extends StringUtils {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
|
|
||||||
System.out.println(realNameTo2("xxxxx"));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fmai 根据基数产生随机5位数
|
* fmai 根据基数产生随机5位数
|
||||||
*
|
*
|
||||||
@ -726,4 +724,37 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
return longList;
|
return longList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String formateRate(BigDecimal processRate,int multiply) {
|
||||||
|
if(processRate == null){
|
||||||
|
return "0 %";
|
||||||
|
}
|
||||||
|
processRate = processRate.multiply(new BigDecimal(multiply));
|
||||||
|
System.out.println(processRate);
|
||||||
|
DecimalFormat df = new DecimalFormat("0");
|
||||||
|
df.setRoundingMode(RoundingMode.HALF_UP);
|
||||||
|
return df.format(processRate)+" %";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String formateRate(String rate,int multiply) {
|
||||||
|
if(StringUtil.isEmpty(rate)) {
|
||||||
|
return "0 %";
|
||||||
|
}
|
||||||
|
BigDecimal processRate = NumberUtil.objToBigDecimalDefault(rate, BigDecimal.ZERO).multiply(new BigDecimal(multiply));
|
||||||
|
System.out.println(processRate);
|
||||||
|
DecimalFormat df = new DecimalFormat("0");
|
||||||
|
df.setRoundingMode(RoundingMode.HALF_UP);
|
||||||
|
return df.format(processRate) + " %";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(formateRate(new BigDecimal(0.32),100));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,4 +31,13 @@ public class ResultDto {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public ResultDto(@TaskHeader(value = "index", order = 0) String index, @TaskHeader(value = "进度", order = 1) String rate, Long detailId, @TaskHeader(value = "内容", order = 3) String content) {
|
||||||
|
this.index = index;
|
||||||
|
this.rate = rate;
|
||||||
|
this.detailId = detailId;
|
||||||
|
this.taskId = taskId;
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,6 +68,7 @@ public abstract class BaseCommand<T> {
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
taskDto.setOption(tokens[0]);
|
taskDto.setOption(tokens[0]);
|
||||||
|
taskDto.setIndex(tokens[1]);
|
||||||
return new Tuple(true, taskDto);
|
return new Tuple(true, taskDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,8 +19,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component("add")
|
@Component("update")
|
||||||
@Name("add")
|
@Name("update")
|
||||||
@Summary("绩效任务查看 添加 或 更新 ")
|
@Summary("绩效任务查看 添加 或 更新 ")
|
||||||
@Description(Constant.EXAMPLE +
|
@Description(Constant.EXAMPLE +
|
||||||
" update 1 \"短信开发\"\n" +
|
" update 1 \"短信开发\"\n" +
|
||||||
@ -46,9 +46,17 @@ public class UpdateCommand extends BaseCommand<Tuple> implements ICommand<Tuple>
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TaskRespService taskRespService;
|
private TaskRespService taskRespService;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ResultTaskService resultTaskService;
|
private ResultTaskService resultTaskService;
|
||||||
|
|
||||||
|
public Tuple check() throws Exception {
|
||||||
|
if(!tokens[1].contains(".")){
|
||||||
|
return new Tuple(true,"目前绩效不支持更新,只有任务才支持更新");
|
||||||
|
}
|
||||||
|
return new Tuple(true);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R process(Tuple tuple) throws Exception {
|
public R process(Tuple tuple) throws Exception {
|
||||||
tuple = doTaskParse();
|
tuple = doTaskParse();
|
||||||
@ -62,7 +70,7 @@ public class UpdateCommand extends BaseCommand<Tuple> implements ICommand<Tuple>
|
|||||||
TaskDto taskDto = (TaskDto) tuple.getData().getSecond();
|
TaskDto taskDto = (TaskDto) tuple.getData().getSecond();
|
||||||
boolean flag = taskRespService.updateIndex(user, taskDto, "list");
|
boolean flag = taskRespService.updateIndex(user, taskDto, "list");
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
return R.error("请先输入list 或 选择正确的索引 ,如1 or 1.x");
|
return R.error("请先输入list或选择正确的索引,如1 or 1.x,或你输入的x.x不存在");
|
||||||
}
|
}
|
||||||
log.info(" 更新请求数据 :" + JSON.toJSONString(taskDto));
|
log.info(" 更新请求数据 :" + JSON.toJSONString(taskDto));
|
||||||
R r = resultTaskService.addOrUpdateTask(user, taskDto);
|
R r = resultTaskService.addOrUpdateTask(user, taskDto);
|
||||||
|
|||||||
@ -44,4 +44,6 @@ public interface ResultTaskMapper extends BaseMapper<ResultTask> {
|
|||||||
int deleteResultTasksByDetailId(Long detailId);
|
int deleteResultTasksByDetailId(Long detailId);
|
||||||
|
|
||||||
List<ResultDto> listResultTask(@Param("detailIds") List<String> detailIds);
|
List<ResultDto> listResultTask(@Param("detailIds") List<String> detailIds);
|
||||||
|
|
||||||
|
List<ResultTask> listResultTaskByDetailId(@Param("detailIds") List<Long> detailIds);
|
||||||
}
|
}
|
||||||
@ -25,27 +25,21 @@ import com.lz.modules.sys.entity.app.ResultDetail;
|
|||||||
import com.lz.modules.sys.service.app.ResultDetailService;
|
import com.lz.modules.sys.service.app.ResultDetailService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 任务表 服务类
|
* 任务表 服务类
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author quyixiao
|
* @author quyixiao
|
||||||
* @since 2020-12-08
|
* @since 2020-12-08
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@ -53,223 +47,218 @@ public class ResultTaskServiceImpl extends ServiceImpl<ResultTaskMapper, ResultT
|
|||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ResultTaskMapper resultTaskMapper;
|
private ResultTaskMapper resultTaskMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ResultDetailService resultDetailService;;
|
private ResultDetailService resultDetailService;
|
||||||
|
;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaskProcessRecordService taskProcessRecordService;
|
private TaskProcessRecordService taskProcessRecordService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaskProcessRecordMapper taskProcessRecordMapper;
|
private TaskProcessRecordMapper taskProcessRecordMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private StaffService staffService;
|
private StaffService staffService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ResultDetailMapper resultDetailMapper;
|
private ResultDetailMapper resultDetailMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
@Override
|
public ResultTask selectResultTaskById(Long id) {
|
||||||
public ResultTask selectResultTaskById(Long id){
|
return resultTaskMapper.selectResultTaskById(id);
|
||||||
return resultTaskMapper.selectResultTaskById(id);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
@Override
|
public Long insertResultTask(ResultTask resultTask) {
|
||||||
public Long insertResultTask(ResultTask resultTask){
|
return resultTaskMapper.insertResultTask(resultTask);
|
||||||
return resultTaskMapper.insertResultTask(resultTask);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
@Override
|
public int updateResultTaskById(ResultTask resultTask) {
|
||||||
public int updateResultTaskById(ResultTask resultTask){
|
return resultTaskMapper.updateResultTaskById(resultTask);
|
||||||
return resultTaskMapper.updateResultTaskById(resultTask);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
@Override
|
public int updateCoverResultTaskById(ResultTask resultTask) {
|
||||||
public int updateCoverResultTaskById(ResultTask resultTask){
|
return resultTaskMapper.updateCoverResultTaskById(resultTask);
|
||||||
return resultTaskMapper.updateCoverResultTaskById(resultTask);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteResultTaskById(Long id) {
|
||||||
|
return resultTaskMapper.deleteResultTaskById(id);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int deleteResultTaskById(Long id){
|
public ResultTaskDetailRes taskDetail(Long detailId) {
|
||||||
return resultTaskMapper.deleteResultTaskById(id);
|
ResultTaskDetailRes res = new ResultTaskDetailRes();
|
||||||
}
|
StaffEntity staffEntity = null;
|
||||||
|
ResultDetail resultDetail = resultDetailService.selectResultDetailById(detailId);
|
||||||
|
if (resultDetail != null) {
|
||||||
|
res.setProcessRate(resultDetail.getProcessRate());
|
||||||
|
res.setTarget(resultDetail.getTarget());
|
||||||
|
Long staffId = resultDetail.getStaffId();
|
||||||
|
staffEntity = staffService.selectStaffById(staffId);
|
||||||
|
}
|
||||||
|
List<ResultTaskDto> resultTasks = resultTaskMapper.selectResultTaskDtosByDetailId(detailId);
|
||||||
|
|
||||||
@Override
|
//获取最近更新记录
|
||||||
public ResultTaskDetailRes taskDetail(Long detailId) {
|
if (CollectionUtils.isNotEmpty(resultTasks)) {
|
||||||
ResultTaskDetailRes res = new ResultTaskDetailRes();
|
StaffEntity finalStaffEntity = staffEntity;
|
||||||
StaffEntity staffEntity = null;
|
resultTasks.forEach(resultTaskDto -> {
|
||||||
ResultDetail resultDetail = resultDetailService.selectResultDetailById(detailId);
|
|
||||||
if(resultDetail != null){
|
|
||||||
res.setProcessRate(resultDetail.getProcessRate());
|
|
||||||
res.setTarget(resultDetail.getTarget());
|
|
||||||
Long staffId = resultDetail.getStaffId();
|
|
||||||
staffEntity = staffService.selectStaffById(staffId);
|
|
||||||
}
|
|
||||||
List<ResultTaskDto> resultTasks = resultTaskMapper.selectResultTaskDtosByDetailId(detailId);
|
|
||||||
|
|
||||||
//获取最近更新记录
|
|
||||||
if(CollectionUtils.isNotEmpty(resultTasks)){
|
|
||||||
StaffEntity finalStaffEntity = staffEntity;
|
|
||||||
resultTasks.forEach(resultTaskDto -> {
|
|
||||||
TaskProcessRecordDto taskProcessRecordDto = taskProcessRecordMapper.selectTaskProcessRecordLastByTaskId(resultTaskDto.getId());
|
TaskProcessRecordDto taskProcessRecordDto = taskProcessRecordMapper.selectTaskProcessRecordLastByTaskId(resultTaskDto.getId());
|
||||||
if(taskProcessRecordDto != null){
|
if (taskProcessRecordDto != null) {
|
||||||
//resultTaskDto.setLabel(taskProcessRecordDto.getLabel());
|
//resultTaskDto.setLabel(taskProcessRecordDto.getLabel());
|
||||||
if(taskProcessRecordDto.getUseType()==0){
|
if (taskProcessRecordDto.getUseType() == 0) {
|
||||||
ProcessRecordEnum byType = ProcessRecordEnum.findByType(taskProcessRecordDto.getType());
|
ProcessRecordEnum byType = ProcessRecordEnum.findByType(taskProcessRecordDto.getType());
|
||||||
Optional.ofNullable(byType).ifPresent(processRecordEnum -> resultTaskDto.setTypeDesc(byType.getDesc()));
|
Optional.ofNullable(byType).ifPresent(processRecordEnum -> resultTaskDto.setTypeDesc(byType.getDesc()));
|
||||||
if(finalStaffEntity !=null){
|
if (finalStaffEntity != null) {
|
||||||
resultTaskDto.setAvatar(finalStaffEntity.getAvatar());
|
resultTaskDto.setAvatar(finalStaffEntity.getAvatar());
|
||||||
resultTaskDto.setStaffName(finalStaffEntity.getName());
|
resultTaskDto.setStaffName(finalStaffEntity.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(taskProcessRecordDto.getUseType()==1){
|
if (taskProcessRecordDto.getUseType() == 1) {
|
||||||
resultTaskDto.setTypeDesc(taskProcessRecordDto.getLabel());
|
resultTaskDto.setTypeDesc(taskProcessRecordDto.getLabel());
|
||||||
StaffEntity staffEntity1 = staffService.selectStaffById(taskProcessRecordDto.getStaffId());
|
StaffEntity staffEntity1 = staffService.selectStaffById(taskProcessRecordDto.getStaffId());
|
||||||
if(staffEntity1 !=null){
|
if (staffEntity1 != null) {
|
||||||
resultTaskDto.setAvatar(staffEntity1.getAvatar());
|
resultTaskDto.setAvatar(staffEntity1.getAvatar());
|
||||||
resultTaskDto.setStaffName(staffEntity1.getName());
|
resultTaskDto.setStaffName(staffEntity1.getName());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
res.setResultTasks(resultTasks);
|
res.setResultTasks(resultTasks);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R saveOrUpdateResultTask(ResultUpdateTaskReq req, Long userId) {
|
public R saveOrUpdateResultTask(ResultUpdateTaskReq req, Long userId) {
|
||||||
Long tasklId = req.getTaskId();
|
Long tasklId = req.getTaskId();
|
||||||
Long detailId = req.getDetailId();
|
Long detailId = req.getDetailId();
|
||||||
if(tasklId == null && detailId == null){
|
if (tasklId == null && detailId == null) {
|
||||||
log.error("任务保存或更新失败:tasklId, detailId都为空");
|
log.error("任务保存或更新失败:tasklId, detailId都为空");
|
||||||
return R.error();
|
return R.error();
|
||||||
}
|
}
|
||||||
ResultTask resultTask;
|
ResultTask resultTask;
|
||||||
if(tasklId == null){
|
if (tasklId == null) {
|
||||||
log.info("绩效任务新增操作。。。");
|
log.info("绩效任务新增操作。。。");
|
||||||
ResultDetail resultDetail = resultDetailService.selectResultDetailById(req.getDetailId());
|
ResultDetail resultDetail = resultDetailService.selectResultDetailById(req.getDetailId());
|
||||||
if(!userId.equals(resultDetail.getStaffId())){
|
if (!userId.equals(resultDetail.getStaffId())) {
|
||||||
log.info("非本人任务不能添加");
|
log.info("非本人任务不能添加");
|
||||||
return R.error("非本人任务不能添加");
|
return R.error("非本人任务不能添加");
|
||||||
}
|
}
|
||||||
resultTask = new ResultTask();
|
resultTask = new ResultTask();
|
||||||
BeanUtils.copyProperties(req,resultTask);
|
BeanUtils.copyProperties(req, resultTask);
|
||||||
resultTask.setDetailId(detailId);
|
resultTask.setDetailId(detailId);
|
||||||
resultTaskMapper.insertResultTask(resultTask);
|
resultTaskMapper.insertResultTask(resultTask);
|
||||||
//将插入的id传递过去
|
//将插入的id传递过去
|
||||||
req.setTaskId(resultTask.getId());
|
req.setTaskId(resultTask.getId());
|
||||||
changeTaskProcess(null, req,null);
|
changeTaskProcess(null, req, null);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
log.info("绩效任务修改操作。。。");
|
log.info("绩效任务修改操作。。。");
|
||||||
resultTask = resultTaskMapper.selectResultTaskById(tasklId);
|
resultTask = resultTaskMapper.selectResultTaskById(tasklId);
|
||||||
ResultDetail resultDetail = resultDetailService.selectResultDetailById(resultTask.getDetailId());
|
ResultDetail resultDetail = resultDetailService.selectResultDetailById(resultTask.getDetailId());
|
||||||
if(!userId.equals(resultDetail.getStaffId())){
|
if (!userId.equals(resultDetail.getStaffId())) {
|
||||||
log.info("非本人任务不能修改");
|
log.info("非本人任务不能修改");
|
||||||
return R.error("非本人任务不能修改");
|
return R.error("非本人任务不能修改");
|
||||||
}
|
}
|
||||||
TaskProcessRecordDto taskProcessRecordDto = taskProcessRecordMapper.selectTaskProcessRecordLastByTaskId(tasklId);
|
TaskProcessRecordDto taskProcessRecordDto = taskProcessRecordMapper.selectTaskProcessRecordLastByTaskId(tasklId);
|
||||||
int i = changeTaskProcess(resultTask, req,taskProcessRecordDto);
|
int i = changeTaskProcess(resultTask, req, taskProcessRecordDto);
|
||||||
if(i<1){
|
if (i < 1) {
|
||||||
log.info("任务暂无变化,不做修改");
|
log.info("任务暂无变化,不做修改");
|
||||||
}
|
}
|
||||||
resultTask.setOrderBy(req.getOrderBy());
|
resultTask.setOrderBy(req.getOrderBy());
|
||||||
if(StringUtil.isNotBlank(req.getName())){
|
if (StringUtil.isNotBlank(req.getName())) {
|
||||||
resultTask.setName(req.getName());
|
resultTask.setName(req.getName());
|
||||||
}
|
}
|
||||||
if(req.getProcessRate()!=null){
|
if (req.getProcessRate() != null) {
|
||||||
resultTask.setProcessRate(req.getProcessRate());
|
resultTask.setProcessRate(req.getProcessRate());
|
||||||
}
|
}
|
||||||
resultTaskMapper.updateCoverResultTaskById(resultTask);
|
resultTaskMapper.updateCoverResultTaskById(resultTask);
|
||||||
|
|
||||||
}
|
}
|
||||||
//修改总进度
|
//修改总进度
|
||||||
if(detailId == null){
|
if (detailId == null) {
|
||||||
detailId = resultTask.getDetailId();
|
detailId = resultTask.getDetailId();
|
||||||
}
|
}
|
||||||
ResultDetail resultDetail = resultDetailService.selectResultDetailById(detailId);
|
ResultDetail resultDetail = resultDetailService.selectResultDetailById(detailId);
|
||||||
resultDetail.setProcessRate(BigDecimal.valueOf(caclateResultDetailProcess(detailId)));
|
resultDetail.setProcessRate(BigDecimal.valueOf(caclateResultDetailProcess(detailId)));
|
||||||
resultDetailService.updateResultDetailById(resultDetail);
|
resultDetailService.updateResultDetailById(resultDetail);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//计算总进度
|
//计算总进度
|
||||||
private Double caclateResultDetailProcess(Long detailId){
|
private Double caclateResultDetailProcess(Long detailId) {
|
||||||
List<ResultTaskDto> resultTaskDtos = resultTaskMapper.selectResultTaskDtosByDetailId(detailId);
|
List<ResultTaskDto> resultTaskDtos = resultTaskMapper.selectResultTaskDtosByDetailId(detailId);
|
||||||
if(CollectionUtils.isEmpty(resultTaskDtos)){
|
if (CollectionUtils.isEmpty(resultTaskDtos)) {
|
||||||
log.info("未找到该绩效详情下得任务信息");
|
log.info("未找到该绩效详情下得任务信息");
|
||||||
return 0d;
|
return 0d;
|
||||||
}
|
}
|
||||||
int size = resultTaskDtos.size();
|
int size = resultTaskDtos.size();
|
||||||
Double rate = 0d;
|
Double rate = 0d;
|
||||||
for(ResultTaskDto dto:resultTaskDtos){
|
for (ResultTaskDto dto : resultTaskDtos) {
|
||||||
if(dto.getProcessRate()!=null){
|
if (dto.getProcessRate() != null) {
|
||||||
rate = BigDecimalUtil.add(rate,dto.getProcessRate());
|
rate = BigDecimalUtil.add(rate, dto.getProcessRate());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
double result = BigDecimalUtil.div(rate, size, 4);
|
double result = BigDecimalUtil.div(rate, size, 4);
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//记录变更记录
|
//记录变更记录
|
||||||
private int changeTaskProcess(ResultTask beforeResultTask,ResultUpdateTaskReq req,TaskProcessRecordDto beforeTaskProcessRecord){
|
private int changeTaskProcess(ResultTask beforeResultTask, ResultUpdateTaskReq req, TaskProcessRecordDto beforeTaskProcessRecord) {
|
||||||
TaskProcessRecord taskProcessRecord = new TaskProcessRecord();
|
TaskProcessRecord taskProcessRecord = new TaskProcessRecord();
|
||||||
BeanUtils.copyProperties(req,taskProcessRecord);
|
BeanUtils.copyProperties(req, taskProcessRecord);
|
||||||
//新增操作
|
//新增操作
|
||||||
if(beforeResultTask == null){
|
if (beforeResultTask == null) {
|
||||||
taskProcessRecord.setType(ProcessRecordEnum.ADD.getType());
|
taskProcessRecord.setType(ProcessRecordEnum.ADD.getType());
|
||||||
taskProcessRecord.setLabel("新增key Results名称:" + req.getName() + ";进度:" + BigDecimalUtil.mul(req.getProcessRate(),BigDecimal.valueOf(100)).setScale(2) + "%");
|
taskProcessRecord.setLabel("新增key Results名称:" + req.getName() + ";进度:" + BigDecimalUtil.mul(req.getProcessRate(), BigDecimal.valueOf(100)).setScale(2) + "%");
|
||||||
return taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord).intValue();
|
return taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord).intValue();
|
||||||
}
|
}
|
||||||
//判断修改了名称或进度
|
//判断修改了名称或进度
|
||||||
int i = 0;
|
int i = 0;
|
||||||
String lebel = "key Results名称:" + beforeResultTask.getName();
|
String lebel = "key Results名称:" + beforeResultTask.getName();
|
||||||
if(StringUtil.isNotBlank(req.getName()) && !req.getName().equals(beforeResultTask.getName())) {
|
if (StringUtil.isNotBlank(req.getName()) && !req.getName().equals(beforeResultTask.getName())) {
|
||||||
i|= (0x00000001<<0);
|
i |= (0x00000001 << 0);
|
||||||
lebel = lebel + " 改为 " + req.getName() + "\n";
|
lebel = lebel + " 改为 " + req.getName() + "\n";
|
||||||
}
|
}
|
||||||
if(req.getProcessRate()!=null && BigDecimalUtil.compareTo(beforeResultTask.getProcessRate(),req.getProcessRate())!=0){
|
if (req.getProcessRate() != null && BigDecimalUtil.compareTo(beforeResultTask.getProcessRate(), req.getProcessRate()) != 0) {
|
||||||
i|= (0x00000001<<1);
|
i |= (0x00000001 << 1);
|
||||||
lebel = lebel + "将进度:" +BigDecimalUtil.mul(beforeResultTask.getProcessRate(),BigDecimal.valueOf(100)).setScale(2)+ "%" + " 更新为 " + BigDecimalUtil.mul(req.getProcessRate(),BigDecimal.valueOf(100)).setScale(2)+ "%";
|
lebel = lebel + "将进度:" + BigDecimalUtil.mul(beforeResultTask.getProcessRate(), BigDecimal.valueOf(100)).setScale(2) + "%" + " 更新为 " + BigDecimalUtil.mul(req.getProcessRate(), BigDecimal.valueOf(100)).setScale(2) + "%";
|
||||||
}
|
}
|
||||||
|
|
||||||
String remark = StringUtil.EMPTY;
|
String remark = StringUtil.EMPTY;
|
||||||
|
|
||||||
if(req.getRemark() != null){
|
if (req.getRemark() != null) {
|
||||||
if(beforeTaskProcessRecord != null){
|
if (beforeTaskProcessRecord != null) {
|
||||||
remark = beforeTaskProcessRecord.getRemark();
|
remark = beforeTaskProcessRecord.getRemark();
|
||||||
}
|
}
|
||||||
if(beforeTaskProcessRecord == null ||(!req.getRemark().equals(beforeTaskProcessRecord.getRemark()))){
|
if (beforeTaskProcessRecord == null || (!req.getRemark().equals(beforeTaskProcessRecord.getRemark()))) {
|
||||||
i|= (0x00000001<<2);
|
i |= (0x00000001 << 2);
|
||||||
lebel = lebel + "将进度说明更新为: " + req.getRemark();
|
lebel = lebel + "将进度说明更新为: " + req.getRemark();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(i==0){
|
if (i == 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
taskProcessRecord.setTaskId(beforeResultTask.getId());
|
taskProcessRecord.setTaskId(beforeResultTask.getId());
|
||||||
taskProcessRecord.setDetailId(beforeResultTask.getDetailId());
|
taskProcessRecord.setDetailId(beforeResultTask.getDetailId());
|
||||||
taskProcessRecord.setType(i);
|
taskProcessRecord.setType(i);
|
||||||
taskProcessRecord.setLabel(lebel);
|
taskProcessRecord.setLabel(lebel);
|
||||||
return taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord).intValue();
|
return taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord).intValue();
|
||||||
/*if(!beforeResultTask.getName().equals(req.getName())){
|
/*if(!beforeResultTask.getName().equals(req.getName())){
|
||||||
if(BigDecimalUtil.compareTo(beforeResultTask.getProcessRate(),req.getProcessRate())!=0){
|
if(BigDecimalUtil.compareTo(beforeResultTask.getProcessRate(),req.getProcessRate())!=0){
|
||||||
taskProcessRecord.setType(ProcessRecordEnum.ALL.getType());
|
taskProcessRecord.setType(ProcessRecordEnum.ALL.getType());
|
||||||
@ -289,103 +278,131 @@ public class ResultTaskServiceImpl extends ServiceImpl<ResultTaskMapper, ResultT
|
|||||||
return taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord).intValue();
|
return taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord).intValue();
|
||||||
}
|
}
|
||||||
return -1;*/
|
return -1;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ResultTask> selectResultTasksByDetailId(Long detailId) {
|
||||||
|
return resultTaskMapper.selectResultTasksByDetailId(detailId);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ResultTask> selectResultTasksByDetailId(Long detailId){
|
public int deleteResultTasksByDetailId(Long detailId) {
|
||||||
return resultTaskMapper.selectResultTasksByDetailId(detailId);
|
List<ResultTask> tasks = resultTaskMapper.selectResultTasksByDetailId(detailId);
|
||||||
}
|
for (ResultTask task : tasks
|
||||||
|
) {
|
||||||
|
taskProcessRecordService.deleteTaskProcessRecordsByTaskId(task.getId());
|
||||||
|
}
|
||||||
|
return resultTaskMapper.deleteResultTasksByDetailId(detailId);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int deleteResultTasksByDetailId(Long detailId) {
|
public R deleteTask(Long taskId, Long userId) {
|
||||||
List<ResultTask> tasks = resultTaskMapper.selectResultTasksByDetailId(detailId);
|
ResultTask resultTask = resultTaskMapper.selectResultTaskById(taskId);
|
||||||
for (ResultTask task : tasks
|
ResultDetail resultDetail = resultDetailService.selectResultDetailById(resultTask.getDetailId());
|
||||||
) {
|
if (!userId.equals(resultDetail.getStaffId())) {
|
||||||
taskProcessRecordService.deleteTaskProcessRecordsByTaskId(task.getId());
|
log.info("非本人任务不能删除");
|
||||||
}
|
return R.error("非本人任务不能删除");
|
||||||
return resultTaskMapper.deleteResultTasksByDetailId(detailId);
|
}
|
||||||
}
|
resultTaskMapper.deleteResultTaskById(taskId);
|
||||||
|
TaskProcessRecord taskProcessRecord = new TaskProcessRecord();
|
||||||
|
taskProcessRecord.setTaskId(taskId);
|
||||||
|
taskProcessRecord.setType(ProcessRecordEnum.DELETE.getType());
|
||||||
|
taskProcessRecord.setLabel("将" + resultTask.getName() + "任务删除");
|
||||||
|
taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord);
|
||||||
|
//修改总进度
|
||||||
|
resultDetail.setProcessRate(BigDecimal.valueOf(caclateResultDetailProcess(resultTask.getDetailId())));
|
||||||
|
resultDetailService.updateResultDetailById(resultDetail);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R deleteTask(Long taskId,Long userId) {
|
public List<ResultTaskDto> selectResultTaskDtosByDetailId(Long detailId) {
|
||||||
ResultTask resultTask = resultTaskMapper.selectResultTaskById(taskId);
|
return resultTaskMapper.selectResultTaskDtosByDetailId(detailId);
|
||||||
ResultDetail resultDetail = resultDetailService.selectResultDetailById(resultTask.getDetailId());
|
}
|
||||||
if(!userId.equals(resultDetail.getStaffId())){
|
|
||||||
log.info("非本人任务不能删除");
|
|
||||||
return R.error("非本人任务不能删除");
|
|
||||||
}
|
|
||||||
resultTaskMapper.deleteResultTaskById(taskId);
|
|
||||||
TaskProcessRecord taskProcessRecord = new TaskProcessRecord();
|
|
||||||
taskProcessRecord.setTaskId(taskId);
|
|
||||||
taskProcessRecord.setType(ProcessRecordEnum.DELETE.getType());
|
|
||||||
taskProcessRecord.setLabel("将" +resultTask.getName() + "任务删除");
|
|
||||||
taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord);
|
|
||||||
//修改总进度
|
|
||||||
resultDetail.setProcessRate(BigDecimal.valueOf(caclateResultDetailProcess(resultTask.getDetailId())));
|
|
||||||
resultDetailService.updateResultDetailById(resultDetail);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ResultTaskDto> selectResultTaskDtosByDetailId(Long detailId){
|
|
||||||
return resultTaskMapper.selectResultTaskDtosByDetailId(detailId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ResultDto> listResultTask(SysUserEntity user) {
|
public List<ResultDto> listResultTask(SysUserEntity user) {
|
||||||
List<ResultDto> resultDtos = resultDetailMapper.listRecord(user.getUserId());
|
List<ResultDto> list = new ArrayList<>();
|
||||||
if(CollectionUtils.isEmpty(resultDtos)){
|
List<ResultDto> resultDtos = resultDetailMapper.listRecord(user.getUserId());
|
||||||
return Collections.EMPTY_LIST;
|
if (CollectionUtils.isEmpty(resultDtos)) {
|
||||||
}
|
return list;
|
||||||
List<String> detailIds = new ArrayList<>();//resultDtos.stream().map(resultDto -> resultDto.getId() + "").collect(Collectors.toList());
|
}
|
||||||
|
List<Long> detailIds = new ArrayList<>();
|
||||||
List<ResultDto> dtos = resultTaskMapper.listResultTask(detailIds);
|
for (ResultDto resultDto : resultDtos) {
|
||||||
for(ResultDto resultDto:dtos){
|
detailIds.add(resultDto.getDetailId());
|
||||||
String rate = resultDto.getRate();
|
}
|
||||||
BigDecimal bigDecimal = new BigDecimal(rate).setScale(4);
|
List<ResultTask> dtos = resultTaskMapper.listResultTaskByDetailId(detailIds);
|
||||||
resultDto.setRate((bigDecimal.doubleValue() * 100) + "%");
|
Map<Long, List<ResultTask>> map = new HashMap<>();
|
||||||
}
|
for (ResultTask task : dtos) {
|
||||||
return dtos;
|
List<ResultTask> resultTasks = map.get(task.getDetailId());
|
||||||
|
if (resultTasks == null) {
|
||||||
|
resultTasks = new ArrayList<>();
|
||||||
|
}
|
||||||
|
resultTasks.add(task);
|
||||||
|
map.put(task.getDetailId(), resultTasks);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < resultDtos.size(); i++) {
|
||||||
|
ResultDto resultDto = resultDtos.get(i);
|
||||||
|
Integer index1 = i + 1;
|
||||||
|
resultDto.setIndex(index1 + "");
|
||||||
|
resultDto.setRate(StringUtil.formateRate(resultDto.getRate(), 100));
|
||||||
|
list.add(resultDto);
|
||||||
|
List<ResultTask> resultTasks = map.get(resultDto.getDetailId());
|
||||||
|
if (CollectionUtils.isNotEmpty(resultTasks)) {
|
||||||
|
int j = 1;
|
||||||
|
for (ResultTask resultTask : resultTasks) {
|
||||||
|
ResultDto r = new ResultDto();
|
||||||
|
r.setIndex(index1 + "." + j);
|
||||||
|
r.setDetailId(resultDto.getDetailId());
|
||||||
|
r.setContent(resultTask.getName());
|
||||||
|
r.setTaskId(resultTask.getId());
|
||||||
|
r.setRate(StringUtil.formateRate(resultTask.getProcessRate(), 100));
|
||||||
|
j++;
|
||||||
|
list.add(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public R addOrUpdateTask(SysUserEntity user, TaskDto second) {
|
|
||||||
ResultUpdateTaskReq resultUpdateTaskReq = new ResultUpdateTaskReq();
|
|
||||||
resultUpdateTaskReq.setRemark(second.getMark());
|
|
||||||
if("update".equals(second.getOption())){
|
|
||||||
resultUpdateTaskReq.setTaskId(second.getId());
|
|
||||||
}else if("add".equals(second.getOption())){
|
|
||||||
resultUpdateTaskReq.setDetailId(second.getId());
|
|
||||||
if(StringUtil.isBlank(second.getRate())){
|
|
||||||
resultUpdateTaskReq.setProcessRate(BigDecimal.ZERO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
resultUpdateTaskReq.setName(second.getName());
|
|
||||||
ResultTask resultTask = resultTaskMapper.selectResultTaskById(second.getId());
|
|
||||||
if(resultTask!=null){
|
|
||||||
resultUpdateTaskReq.setDetailId(resultTask.getDetailId());
|
|
||||||
}
|
|
||||||
String rate = second.getRate();
|
|
||||||
BigDecimal rateRes;
|
|
||||||
if(StringUtil.isNotBlank(rate)){
|
|
||||||
rate = rate.trim();
|
|
||||||
boolean contains = rate.contains("%");
|
|
||||||
if(contains){
|
|
||||||
rate = rate.replaceAll("%", "");
|
|
||||||
}
|
|
||||||
if(contains || new BigDecimal(rate).compareTo(BigDecimal.ONE)>-1){
|
|
||||||
rateRes = new BigDecimal(rate).multiply(BigDecimal.valueOf(0.01));
|
|
||||||
}else {
|
|
||||||
rateRes = new BigDecimal(rate);
|
|
||||||
}
|
|
||||||
|
|
||||||
resultUpdateTaskReq.setProcessRate(rateRes);
|
@Override
|
||||||
|
public R addOrUpdateTask(SysUserEntity user, TaskDto second) {
|
||||||
|
ResultUpdateTaskReq resultUpdateTaskReq = new ResultUpdateTaskReq();
|
||||||
|
resultUpdateTaskReq.setRemark(second.getMark());
|
||||||
|
if ("update".equals(second.getOption())) {
|
||||||
|
resultUpdateTaskReq.setTaskId(second.getId());
|
||||||
|
} else if ("add".equals(second.getOption())) {
|
||||||
|
resultUpdateTaskReq.setDetailId(second.getId());
|
||||||
|
if (StringUtil.isBlank(second.getRate())) {
|
||||||
|
resultUpdateTaskReq.setProcessRate(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultUpdateTaskReq.setName(second.getName());
|
||||||
|
ResultTask resultTask = resultTaskMapper.selectResultTaskById(second.getId());
|
||||||
|
if (resultTask != null) {
|
||||||
|
resultUpdateTaskReq.setDetailId(resultTask.getDetailId());
|
||||||
|
}
|
||||||
|
String rate = second.getRate();
|
||||||
|
BigDecimal rateRes;
|
||||||
|
if (StringUtil.isNotBlank(rate)) {
|
||||||
|
rate = rate.trim();
|
||||||
|
boolean contains = rate.contains("%");
|
||||||
|
if (contains) {
|
||||||
|
rate = rate.replaceAll("%", "");
|
||||||
|
}
|
||||||
|
if (contains || new BigDecimal(rate).compareTo(BigDecimal.ONE) > -1) {
|
||||||
|
rateRes = new BigDecimal(rate).multiply(BigDecimal.valueOf(0.01));
|
||||||
|
} else {
|
||||||
|
rateRes = new BigDecimal(rate);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
resultUpdateTaskReq.setProcessRate(rateRes);
|
||||||
return this.saveOrUpdateResultTask(resultUpdateTaskReq,user.getUserId());
|
|
||||||
}
|
}
|
||||||
|
return this.saveOrUpdateResultTask(resultUpdateTaskReq, user.getUserId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,5 +80,5 @@ public interface ResultDetailService extends IService<ResultDetail> {
|
|||||||
|
|
||||||
List<ResultDetail> selectNotNoticeResultDetailByRecordId(Long recordId);
|
List<ResultDetail> selectNotNoticeResultDetailByRecordId(Long recordId);
|
||||||
|
|
||||||
List<ResultDto> listRecord(SysUserEntity user);
|
|
||||||
}
|
}
|
||||||
@ -359,14 +359,5 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
|||||||
return resultDetailMapper.selectNotNoticeResultDetailByRecordId(recordId);
|
return resultDetailMapper.selectNotNoticeResultDetailByRecordId(recordId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ResultDto> listRecord(SysUserEntity user) {
|
|
||||||
List<ResultDto> resultDtos = resultDetailMapper.listRecord(user.getUserId());
|
|
||||||
for(ResultDto resultDto:resultDtos){
|
|
||||||
String rate = resultDto.getRate();
|
|
||||||
BigDecimal bigDecimal = new BigDecimal(rate).setScale(4);
|
|
||||||
resultDto.setRate((bigDecimal.doubleValue() * 100) + "%");
|
|
||||||
}
|
|
||||||
return resultDetailMapper.listRecord(user.getUserId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@ public interface TaskRespMapper extends BaseMapper<TaskResp> {
|
|||||||
|
|
||||||
void deleteTaskRespByUserId(@Param("userId") Long userId, @Param("command") String command);
|
void deleteTaskRespByUserId(@Param("userId") Long userId, @Param("command") String command);
|
||||||
|
|
||||||
TaskResp selectTaskRespByUserIdIndex(@Param("userId") Long userId, @Param("index") Long index, @Param("command") String command);
|
TaskResp selectTaskRespByUserIdIndex(@Param("userId") Long userId, @Param("index") String index, @Param("command") String command);
|
||||||
|
|
||||||
void batchInsertTaskRespList(@Param("taskRespList") List<TaskResp> taskRespList);
|
void batchInsertTaskRespList(@Param("taskRespList") List<TaskResp> taskRespList);
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ public interface TaskRespService extends IService<TaskResp> {
|
|||||||
|
|
||||||
void deleteInsertLastResult(SysUserEntity user ,List<ResultDto> list,String command);
|
void deleteInsertLastResult(SysUserEntity user ,List<ResultDto> list,String command);
|
||||||
|
|
||||||
TaskResp selectTaskRespByUserIdIndex(Long userId, Long id,String command);
|
TaskResp selectTaskRespByUserIdIndex(Long userId, String id,String command);
|
||||||
|
|
||||||
boolean updateIndex(SysUserEntity userEntity, TaskDto taskDto,String command);
|
boolean updateIndex(SysUserEntity userEntity, TaskDto taskDto,String command);
|
||||||
}
|
}
|
||||||
@ -85,13 +85,13 @@ public class TaskRespServiceImpl extends ServiceImpl<TaskRespMapper, TaskResp> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TaskResp selectTaskRespByUserIdIndex(Long userId, Long index,String command ) {
|
public TaskResp selectTaskRespByUserIdIndex(Long userId, String index,String command ) {
|
||||||
return taskRespMapper.selectTaskRespByUserIdIndex(userId,index,command);
|
return taskRespMapper.selectTaskRespByUserIdIndex(userId,index,command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean updateIndex(SysUserEntity userEntity, TaskDto taskDto,String command) {
|
public boolean updateIndex(SysUserEntity userEntity, TaskDto taskDto,String command) {
|
||||||
TaskResp taskResp = taskRespService.selectTaskRespByUserIdIndex(userEntity.getUserId(), taskDto.getId(),command);
|
TaskResp taskResp = taskRespService.selectTaskRespByUserIdIndex(userEntity.getUserId(), taskDto.getIndex(),command);
|
||||||
if (taskResp != null) {
|
if (taskResp != null) {
|
||||||
if(BaseCommand.add.equals(taskDto.getOption())){
|
if(BaseCommand.add.equals(taskDto.getOption())){
|
||||||
taskDto.setId(taskResp.getDetailId());
|
taskDto.setId(taskResp.getDetailId());
|
||||||
|
|||||||
@ -118,12 +118,12 @@ public class TaskConvertUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
/* ResultDto resultDto1 = new ResultDto(0, 10l, "哈哈0");
|
ResultDto resultDto1 = new ResultDto("1.0", "30 %",1l, "哈哈0");
|
||||||
ResultDto resultDto2 = new ResultDto(1, 11l, "哈哈1");
|
ResultDto resultDto2 = new ResultDto("1.1", "30 %", 1l,2l,"哈哈1");
|
||||||
ResultDto resultDto3 = new ResultDto(2, 12l, "哈哈2");
|
ResultDto resultDto3 = new ResultDto("1.2", "30 %", 1l,"哈哈2");
|
||||||
ResultDto resultDto4 = new ResultDto(3, 13l, "哈哈3", "30%");
|
ResultDto resultDto4 = new ResultDto("1.3", "30 %",1l, "哈哈3");
|
||||||
ResultDto[] array = new ResultDto[]{resultDto1, resultDto2, resultDto3, resultDto4};*/
|
ResultDto[] array = new ResultDto[]{resultDto1, resultDto2, resultDto3, resultDto4};
|
||||||
List<ResultDto> resultDtos = Arrays.asList();
|
List<ResultDto> resultDtos = Arrays.asList(array);
|
||||||
TwoTuple<List<String>, List<List<String>>> data = convert(resultDtos).getData();
|
TwoTuple<List<String>, List<List<String>>> data = convert(resultDtos).getData();
|
||||||
System.out.println(JSON.toJSONString(data.getFirst()));
|
System.out.println(JSON.toJSONString(data.getFirst()));
|
||||||
System.out.println(JSON.toJSONString(data.getSecond()));
|
System.out.println(JSON.toJSONString(data.getSecond()));
|
||||||
|
|||||||
@ -217,12 +217,10 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="listRecord" resultType="com.lz.modules.app.dto.ResultDto">
|
<select id="listRecord" resultType="com.lz.modules.app.dto.ResultDto">
|
||||||
SELECT @rownum:=@rownum+1 as 'index',b.id,b.target content,b.process_rate rate from (select @rownum:=0) a,(
|
SELECT d.id as detailId ,d.target as content,d.process_rate as rate from lz_result_record r LEFT JOIN lz_result_detail d
|
||||||
SELECT d.id,d.target,process_rate from lz_result_record r LEFT JOIN lz_result_detail d
|
|
||||||
on r.id = d.record_id
|
on r.id = d.record_id
|
||||||
where r.is_delete = 0 and d.is_delete=0 and d.staff_id = #{staffId}
|
where r.is_delete = 0 and d.is_delete=0 and d.staff_id = #{staffId}
|
||||||
and r.flow_process < 4
|
and r.flow_process < 4
|
||||||
) b
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -101,7 +101,6 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="listResultTask" resultType="com.lz.modules.app.dto.ResultDto">
|
<select id="listResultTask" resultType="com.lz.modules.app.dto.ResultDto">
|
||||||
|
|
||||||
select @rownum:=@rownum+1 as 'index',id,name content,process_rate rate from (select @rownum:=0) a, lz_result_task where is_delete=0
|
select @rownum:=@rownum+1 as 'index',id,name content,process_rate rate from (select @rownum:=0) a, lz_result_task where is_delete=0
|
||||||
<if test="detailIds !=null">
|
<if test="detailIds !=null">
|
||||||
and detail_id in
|
and detail_id in
|
||||||
@ -111,5 +110,11 @@
|
|||||||
</if>
|
</if>
|
||||||
order by id
|
order by id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="listResultTaskByDetailId" resultType="com.lz.modules.performance.entity.ResultTask">
|
||||||
|
select * from lz_result_task where detail_id in
|
||||||
|
<foreach item="detailId" collection="detailIds" open="(" separator="," close=")">
|
||||||
|
#{detailId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user