fix
This commit is contained in:
parent
9920612d0d
commit
4b4d549640
@ -35,12 +35,16 @@ public class TaskProcessRecordDto {
|
|||||||
@ApiModelProperty(value = "类型", name = "描述")
|
@ApiModelProperty(value = "类型", name = "描述")
|
||||||
private String typeDesc;
|
private String typeDesc;
|
||||||
//操作标签
|
//操作标签
|
||||||
@ApiModelProperty(value = "任务名称", name = "name")
|
@ApiModelProperty(value = "任务名称", name = "taskName")
|
||||||
private String name;
|
private String taskName;
|
||||||
//1,修改名称,2修改进度 ,3名称和进度都修改
|
//1,修改名称,2修改进度 ,3名称和进度都修改
|
||||||
@ApiModelProperty(value = "0表示记录,不传全部", name = "useType")
|
@ApiModelProperty(value = "0表示记录,不传全部", name = "useType")
|
||||||
private Integer useType;
|
private Integer useType;
|
||||||
//1,修改名称,2修改进度 ,3名称和进度都修改
|
//1,修改名称,2修改进度 ,3名称和进度都修改
|
||||||
@ApiModelProperty(value = "职位", name = "position")
|
@ApiModelProperty(value = "职位", name = "position")
|
||||||
private String position;
|
private String position;
|
||||||
|
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
private Long detailId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -136,6 +136,8 @@ public class ResultTaskServiceImpl extends ServiceImpl<ResultTaskMapper, ResultT
|
|||||||
BeanUtils.copyProperties(req,resultTask);
|
BeanUtils.copyProperties(req,resultTask);
|
||||||
resultTask.setDetailId(detailId);
|
resultTask.setDetailId(detailId);
|
||||||
resultTaskMapper.insertResultTask(resultTask);
|
resultTaskMapper.insertResultTask(resultTask);
|
||||||
|
//将插入的id传递过去
|
||||||
|
req.setTaskId(resultTask.getId());
|
||||||
int i = changeTaskProcess(null, req);
|
int i = changeTaskProcess(null, req);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -194,7 +196,7 @@ public class ResultTaskServiceImpl extends ServiceImpl<ResultTaskMapper, ResultT
|
|||||||
taskProcessRecord.setDetailId(before.getDetailId());
|
taskProcessRecord.setDetailId(before.getDetailId());
|
||||||
//判断修改了名称或进度
|
//判断修改了名称或进度
|
||||||
if(!before.getName().equals(after.getName())){
|
if(!before.getName().equals(after.getName())){
|
||||||
if(!before.getProcessRate().equals(after.getProcessRate())){
|
if(BigDecimalUtil.compareTo(before.getProcessRate(),after.getProcessRate())!=0){
|
||||||
taskProcessRecord.setType(ProcessRecordEnum.ALL.getType());
|
taskProcessRecord.setType(ProcessRecordEnum.ALL.getType());
|
||||||
taskProcessRecord.setLabel("将key Results名称:" + before.getName() + "改为" + after.getName() + "\n"
|
taskProcessRecord.setLabel("将key Results名称:" + before.getName() + "改为" + after.getName() + "\n"
|
||||||
+ "进度:" + BigDecimalUtil.mul(before.getProcessRate(),BigDecimal.valueOf(100)).setScale(2) + "%" + "改为" + BigDecimalUtil.mul(after.getProcessRate(),BigDecimal.valueOf(100)).setScale(2) + "%");
|
+ "进度:" + BigDecimalUtil.mul(before.getProcessRate(),BigDecimal.valueOf(100)).setScale(2) + "%" + "改为" + BigDecimalUtil.mul(after.getProcessRate(),BigDecimal.valueOf(100)).setScale(2) + "%");
|
||||||
@ -206,7 +208,7 @@ public class ResultTaskServiceImpl extends ServiceImpl<ResultTaskMapper, ResultT
|
|||||||
return taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord).intValue();
|
return taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord).intValue();
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!before.getProcessRate().equals(after.getProcessRate())){
|
if(BigDecimalUtil.compareTo(before.getProcessRate(),after.getProcessRate())!=0){
|
||||||
taskProcessRecord.setType(ProcessRecordEnum.PROCESS.getType());
|
taskProcessRecord.setType(ProcessRecordEnum.PROCESS.getType());
|
||||||
taskProcessRecord.setLabel("将" +before.getName() + "得进度由" + BigDecimalUtil.mul(before.getProcessRate(),BigDecimal.valueOf(100)).setScale(2) + "%" + "更新为:" + BigDecimalUtil.mul(after.getProcessRate(),BigDecimal.valueOf(100)).setScale(2) + "%");
|
taskProcessRecord.setLabel("将" +before.getName() + "得进度由" + BigDecimalUtil.mul(before.getProcessRate(),BigDecimal.valueOf(100)).setScale(2) + "%" + "更新为:" + BigDecimalUtil.mul(after.getProcessRate(),BigDecimal.valueOf(100)).setScale(2) + "%");
|
||||||
return taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord).intValue();
|
return taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord).intValue();
|
||||||
|
|||||||
@ -99,7 +99,7 @@ public class TaskProcessRecordServiceImpl extends ServiceImpl<TaskProcessRecordM
|
|||||||
Long detailId = req.getDetailId();
|
Long detailId = req.getDetailId();
|
||||||
PageUtils pageUtils = new PageUtils();
|
PageUtils pageUtils = new PageUtils();
|
||||||
if(detailId!=null){
|
if(detailId!=null){
|
||||||
List<ResultTaskDto> resultTaskDtos = resultTaskService.selectResultTaskDtosByDetailId(req.getDetailId());
|
List<ResultTaskDto> resultTaskDtos = resultTaskService.selectResultTaskDtosByDetailId(detailId);
|
||||||
if(CollectionUtils.isNotEmpty(resultTaskDtos)){
|
if(CollectionUtils.isNotEmpty(resultTaskDtos)){
|
||||||
List<Long> collect = resultTaskDtos.stream().map(resultTaskDto -> resultTaskDto.getId()).collect(Collectors.toList());
|
List<Long> collect = resultTaskDtos.stream().map(resultTaskDto -> resultTaskDto.getId()).collect(Collectors.toList());
|
||||||
pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect(
|
pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect(
|
||||||
@ -110,22 +110,24 @@ public class TaskProcessRecordServiceImpl extends ServiceImpl<TaskProcessRecordM
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect(
|
pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect(
|
||||||
page -> taskProcessRecordMapper.selectTaskProcessRecordsByTaskId(page, req.getTaskId(),req.getUseType())
|
page -> taskProcessRecordMapper.selectTaskProcessRecordsByTaskId(page, taskId,req.getUseType())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
List list = pageUtils.getList();
|
List list = pageUtils.getList();
|
||||||
if(CollectionUtils.isNotEmpty(list)){
|
if(CollectionUtils.isNotEmpty(list)){
|
||||||
|
List<TaskProcessRecordDto> dtos = list;
|
||||||
if(detailId == null){
|
if(detailId == null){
|
||||||
ResultTask resultTask = resultTaskService.selectResultTaskById(taskId);
|
detailId = dtos.get(0).getDetailId();
|
||||||
detailId = resultTask.getDetailId();
|
|
||||||
}
|
}
|
||||||
ResultDetail resultDetail = resultDetailService.selectResultDetailById(detailId);
|
ResultDetail resultDetail = resultDetailService.selectResultDetailById(detailId);
|
||||||
StaffEntity staffEntity = staffService.selectStaffById(resultDetail.getStaffId());
|
StaffEntity staffEntity = staffService.selectStaffById(resultDetail.getStaffId());
|
||||||
StaffOccupationEntity staffOccupationByStaffId = staffOccupationService.getStaffOccupationByStaffId(resultDetail.getStaffId());
|
StaffOccupationEntity staffOccupationByStaffId = staffOccupationService.getStaffOccupationByStaffId(resultDetail.getStaffId());
|
||||||
|
|
||||||
List<TaskProcessRecordDto> dtos = list;
|
|
||||||
for(TaskProcessRecordDto dto:dtos){
|
for(TaskProcessRecordDto dto:dtos){
|
||||||
|
ResultTask resultTask = resultTaskService.selectResultTaskById(dto.getTaskId());
|
||||||
|
Optional.ofNullable(resultTask).ifPresent(resultTask1 -> dto.setTaskName(resultTask1.getName()));
|
||||||
dto.setTypeDesc(ProcessRecordEnum.findByType(dto.getType()).getDesc());
|
dto.setTypeDesc(ProcessRecordEnum.findByType(dto.getType()).getDesc());
|
||||||
Optional.ofNullable(staffEntity).ifPresent(staffEntity1 -> {
|
Optional.ofNullable(staffEntity).ifPresent(staffEntity1 -> {
|
||||||
dto.setAvatar(staffEntity1.getAvatar());
|
dto.setAvatar(staffEntity1.getAvatar());
|
||||||
|
|||||||
@ -131,7 +131,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectTaskProcessRecordsByTaskId" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
<select id="selectTaskProcessRecordsByTaskId" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
||||||
select gmt_create,remark,label,type,name,use_type from lz_task_process_record where task_id=#{taskId}
|
select gmt_create,remark,label,type,name,use_type,detail_id from lz_task_process_record where task_id=#{taskId}
|
||||||
<if test="useType !=null">
|
<if test="useType !=null">
|
||||||
and use_type = #{useType}
|
and use_type = #{useType}
|
||||||
</if>
|
</if>
|
||||||
@ -149,7 +149,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectTaskProcessRecordsByTaskIdsAndType" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
<select id="selectTaskProcessRecordsByTaskIdsAndType" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
||||||
select gmt_create,remark,label,type,use_type from lz_task_process_record where is_delete = 0
|
select gmt_create,remark,label,type,use_type,task_id,detail_id from lz_task_process_record where is_delete = 0
|
||||||
<if test="useType !=null">
|
<if test="useType !=null">
|
||||||
and use_type = #{useType}
|
and use_type = #{useType}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user