fix
This commit is contained in:
parent
cd8fe0105b
commit
8ff78938fa
@ -8,6 +8,7 @@ package com.lz.modules.flow.dao;
|
|||||||
* @since 2020-08-18
|
* @since 2020-08-18
|
||||||
*/
|
*/
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.lz.modules.flow.entity.FlowRecord;
|
import com.lz.modules.flow.entity.FlowRecord;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@ -52,6 +53,6 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
|||||||
Long copyFlowRecord(FlowRecord flowRecord);
|
Long copyFlowRecord(FlowRecord flowRecord);
|
||||||
|
|
||||||
//查看自己要审批的记录 status为1代表流程走到了这里
|
//查看自己要审批的记录 status为1代表流程走到了这里
|
||||||
List<Long> selectFlowRecordIdsByApprovalStaffId(@Param("approvalStaffId") Long approvalStaffId);
|
List<Long> selectFlowRecordIdsByApprovalStaffId(@Param("status") int status,@Param("approvalStaffId") Long approvalStaffId, @Param("page") IPage page);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,7 +1,10 @@
|
|||||||
package com.lz.modules.flow.service;
|
package com.lz.modules.flow.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.lz.common.utils.PageUtils;
|
||||||
|
import com.lz.modules.equipment.entity.model.BasePage;
|
||||||
import com.lz.modules.flow.entity.FlowRecord;
|
import com.lz.modules.flow.entity.FlowRecord;
|
||||||
|
import com.lz.modules.performance.req.AssessTaskReq;
|
||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -53,5 +56,5 @@ public interface FlowRecordService extends IService<FlowRecord> {
|
|||||||
|
|
||||||
Long copyFlowRecord(FlowRecord flowRecord);
|
Long copyFlowRecord(FlowRecord flowRecord);
|
||||||
|
|
||||||
List<Long> selectFlowRecordIdsByApprovalStaffId(Long approvalStaffId);
|
PageUtils selectFlowRecordIdsByApprovalStaffId(AssessTaskReq req, Long approvalStaffId);
|
||||||
}
|
}
|
||||||
@ -1,15 +1,19 @@
|
|||||||
package com.lz.modules.flow.service.impl;
|
package com.lz.modules.flow.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.lz.common.utils.Constant;
|
import com.lz.common.utils.Constant;
|
||||||
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.app.utils.t.OneTuple;
|
import com.lz.modules.app.utils.t.OneTuple;
|
||||||
|
import com.lz.modules.equipment.entity.model.BasePage;
|
||||||
import com.lz.modules.flow.dao.FlowRecordMapper;
|
import com.lz.modules.flow.dao.FlowRecordMapper;
|
||||||
import com.lz.modules.flow.entity.FlowRecord;
|
import com.lz.modules.flow.entity.FlowRecord;
|
||||||
import com.lz.modules.flow.enums.FlowRecordEnum;
|
import com.lz.modules.flow.enums.FlowRecordEnum;
|
||||||
import com.lz.modules.flow.model.StaffRoleDto;
|
import com.lz.modules.flow.model.StaffRoleDto;
|
||||||
import com.lz.modules.flow.service.FlowRecordService;
|
import com.lz.modules.flow.service.FlowRecordService;
|
||||||
|
import com.lz.modules.performance.req.AssessTaskReq;
|
||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -139,7 +143,10 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Long> selectFlowRecordIdsByApprovalStaffId(Long approvalStaffId) {
|
public PageUtils selectFlowRecordIdsByApprovalStaffId(AssessTaskReq req, Long approvalStaffId) {
|
||||||
return flowRecordMapper.selectFlowRecordIdsByApprovalStaffId(approvalStaffId);
|
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect(
|
||||||
|
page -> flowRecordMapper.selectFlowRecordIdsByApprovalStaffId(req.getStatus(),approvalStaffId,page)
|
||||||
|
);
|
||||||
|
return pageUtils;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,23 @@
|
|||||||
package com.lz.modules.performance.controller;
|
package com.lz.modules.performance.controller;
|
||||||
|
|
||||||
|
import com.lz.common.utils.DateUtils;
|
||||||
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
import com.lz.common.utils.StringUtil;
|
import com.lz.common.utils.StringUtil;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
|
import com.lz.modules.equipment.entity.model.BasePage;
|
||||||
import com.lz.modules.flow.service.FlowChangeService;
|
import com.lz.modules.flow.service.FlowChangeService;
|
||||||
import com.lz.modules.flow.service.FlowRecordService;
|
import com.lz.modules.flow.service.FlowRecordService;
|
||||||
import com.lz.modules.performance.req.AssessDetailReq;
|
import com.lz.modules.performance.req.AssessDetailReq;
|
||||||
import com.lz.modules.performance.req.AssessListReq;
|
import com.lz.modules.performance.req.AssessListReq;
|
||||||
|
import com.lz.modules.performance.req.AssessTaskReq;
|
||||||
|
import com.lz.modules.performance.res.ChartStatisticalRes;
|
||||||
import com.lz.modules.performance.res.TaskListRes;
|
import com.lz.modules.performance.res.TaskListRes;
|
||||||
import com.lz.modules.sys.controller.AbstractController;
|
import com.lz.modules.sys.controller.AbstractController;
|
||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@ -28,41 +34,61 @@ import java.util.Optional;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/performance")
|
@RequestMapping("/performance")
|
||||||
|
@Api(value="任务事项", tags={"任务相关接口"})
|
||||||
public class TaskController extends AbstractController{
|
public class TaskController extends AbstractController{
|
||||||
|
|
||||||
private FlowRecordService flowRecordService;
|
private FlowRecordService flowRecordService;
|
||||||
|
|
||||||
private ResultRecordService resultRecordService;
|
private ResultRecordService resultRecordService;
|
||||||
|
|
||||||
private StaffService staffService;
|
private StaffService staffService;
|
||||||
|
|
||||||
private FlowChangeService flowChangeService;
|
private FlowChangeService flowChangeService;
|
||||||
|
|
||||||
@RequestMapping("task/list")
|
@RequestMapping("task/list")
|
||||||
public R list(int status){
|
public R list(AssessTaskReq req){
|
||||||
List<TaskListRes> list = new ArrayList<>();
|
List<TaskListRes> list = new ArrayList<>();
|
||||||
Long userId = getUserId();
|
Long userId = getUserId();
|
||||||
List<Long> flowRecordIds = flowRecordService.selectFlowRecordIdsByApprovalStaffId(userId);
|
PageUtils pageUtils = flowRecordService.selectFlowRecordIdsByApprovalStaffId(req,userId);
|
||||||
if(CollectionUtils.isEmpty(flowRecordIds)){
|
if(pageUtils.getTotalCount() == 0){
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
List<Long> flowRecordIds = pageUtils.getList();
|
||||||
flowRecordIds.stream().forEach(recordId -> {
|
flowRecordIds.stream().forEach(recordId -> {
|
||||||
TaskListRes res = new TaskListRes();
|
TaskListRes res = new TaskListRes();
|
||||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(recordId);
|
ResultRecord resultRecord = resultRecordService.selectResultRecordById(recordId);
|
||||||
StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
|
StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
|
||||||
res.setAvatar(Optional.ofNullable(staffEntity.getAvatar()).orElse(StringUtil.EMPTY));
|
res.setAvatar(Optional.ofNullable(staffEntity.getAvatar()).orElse(StringUtil.EMPTY));
|
||||||
//res.setTitle(); 根据状态拼接文案
|
String name = staffEntity.getName();
|
||||||
//res.setTime();
|
if(resultRecord.getStaffId().equals(resultRecord.getCurrentApprovalStaffId())){
|
||||||
//res.setUrl();
|
name = "您";
|
||||||
|
}
|
||||||
|
//根据状态拼接文案
|
||||||
|
res.setTitle(name + "的" + resultRecord.getMonthTime() + "");
|
||||||
|
res.setTime(DateUtils.format(resultRecord.getGmtModified(),DateUtils.DATE_TIME_PATTERN));
|
||||||
|
//跳转绩效详情页
|
||||||
|
res.setUrl("?" + recordId);
|
||||||
list.add(res);
|
list.add(res);
|
||||||
});
|
});
|
||||||
return R.ok();
|
PageUtils data = new PageUtils();
|
||||||
|
data.setList(list);
|
||||||
|
data.setPageSize(req.getPageSize());
|
||||||
|
data.setCurrPage(req.getCurrPage());
|
||||||
|
data.setTotalCount(pageUtils.getTotalCount());
|
||||||
|
data.setTotalPage(pageUtils.getTotalPage());
|
||||||
|
return R.ok().put("page",data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("assess/group/list")
|
@RequestMapping("assess/group/list")
|
||||||
public R groupList(@RequestBody AssessListReq req){
|
public R groupList(@RequestBody AssessListReq req){
|
||||||
|
ChartStatisticalRes res = new ChartStatisticalRes();
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("assess/group/detail")
|
@RequestMapping("assess/group/detail")
|
||||||
public R groupDetail(@RequestBody AssessDetailReq req){
|
public R groupDetail(@RequestBody AssessDetailReq req){
|
||||||
|
ChartStatisticalRes res = new ChartStatisticalRes();
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
package com.lz.modules.performance.req;
|
||||||
|
|
||||||
|
import com.lz.modules.equipment.entity.model.BasePage;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: djc
|
||||||
|
* @Desc:
|
||||||
|
* @Date: 2020/10/14 11:38
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AssessTaskReq extends BasePage{
|
||||||
|
private int status;
|
||||||
|
}
|
||||||
@ -8,7 +8,7 @@ import lombok.Data;
|
|||||||
* @Date: 2020/10/13 18:25
|
* @Date: 2020/10/13 18:25
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class chartStatisticalRes {
|
public class ChartStatisticalRes {
|
||||||
|
|
||||||
private String desc;
|
private String desc;
|
||||||
//人数
|
//人数
|
||||||
Loading…
x
Reference in New Issue
Block a user