Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
wulin 2020-10-13 17:55:36 +08:00
commit b348106652
15 changed files with 100 additions and 35 deletions

View File

@ -50,4 +50,8 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
List<FlowRecord> selectFlowRecordByResultRecordIdTypeStatus(@Param("recordResultId") Long recordResultId, @Param("type") Integer type, @Param("status") int status);
Long copyFlowRecord(FlowRecord flowRecord);
//查看自己要审批的记录 status为1代表流程走到了这里
List<Long> selectFlowRecordIdsByApprovalStaffId(@Param("approvalStaffId") Long approvalStaffId);
}

View File

@ -52,4 +52,6 @@ public interface FlowRecordService extends IService<FlowRecord> {
List<FlowRecord> selectFlowRecordByResultRecordIdTypeStatus(Long recordResultId, Integer type, int status);
Long copyFlowRecord(FlowRecord flowRecord);
List<Long> selectFlowRecordIdsByApprovalStaffId(Long approvalStaffId);
}

View File

@ -138,5 +138,8 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
return flowRecordMapper.copyFlowRecord(flowRecord);
}
@Override
public List<Long> selectFlowRecordIdsByApprovalStaffId(Long approvalStaffId) {
return flowRecordMapper.selectFlowRecordIdsByApprovalStaffId(approvalStaffId);
}
}

View File

@ -1,26 +0,0 @@
package com.lz.modules.performance;
import com.lz.common.utils.R;
import com.lz.modules.sys.controller.AbstractController;
import com.lz.modules.third.service.ThirdMsgSendRecordService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: djc
* @Desc:
* @Date: 2020/10/13 11:27
*/
@RestController
@RequestMapping("/performance")
public class TaskController extends AbstractController{
private ThirdMsgSendRecordService thirdMsgSendRecordService;
@RequestMapping("task/list")
public R list(){
Long userId = getUserId();
thirdMsgSendRecordService.list();
return R.ok();
}
}

View File

@ -1,4 +1,4 @@
package com.lz.modules.performance;
package com.lz.modules.performance.controller;
import com.alibaba.fastjson.JSONObject;

View File

@ -1,4 +1,4 @@
package com.lz.modules.performance;
package com.lz.modules.performance.controller;
import com.alibaba.fastjson.JSONObject;

View File

@ -1,4 +1,4 @@
package com.lz.modules.performance;
package com.lz.modules.performance.controller;
import com.alibaba.fastjson.JSONObject;

View File

@ -1,4 +1,4 @@
package com.lz.modules.performance;
package com.lz.modules.performance.controller;
import com.alibaba.fastjson.JSONObject;

View File

@ -1,4 +1,4 @@
package com.lz.modules.performance;
package com.lz.modules.performance.controller;
import com.alibaba.fastjson.JSONObject;

View File

@ -1,4 +1,4 @@
package com.lz.modules.performance;
package com.lz.modules.performance.controller;
import com.alibaba.fastjson.JSONObject;

View File

@ -1,4 +1,4 @@
package com.lz.modules.performance;
package com.lz.modules.performance.controller;
import com.alibaba.fastjson.JSONObject;

View File

@ -1,4 +1,4 @@
package com.lz.modules.performance;
package com.lz.modules.performance.controller;
import com.alibaba.fastjson.JSONObject;

View File

@ -0,0 +1,59 @@
package com.lz.modules.performance.controller;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.entity.FlowRecord;
import com.lz.modules.flow.service.FlowChangeService;
import com.lz.modules.flow.service.FlowRecordService;
import com.lz.modules.performance.res.TaskListRes;
import com.lz.modules.sys.controller.AbstractController;
import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultRecordService;
import com.lz.modules.third.service.ThirdMsgSendRecordService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Author: djc
* @Desc:
* @Date: 2020/10/13 11:27
*/
@RestController
@RequestMapping("/performance")
public class TaskController extends AbstractController{
private FlowRecordService flowRecordService;
private ResultRecordService resultRecordService;
private StaffService staffService;
private FlowChangeService flowChangeService;
@RequestMapping("task/list")
public R list(){
List<TaskListRes> list = new ArrayList<>();
Long userId = getUserId();
List<Long> flowRecordIds = flowRecordService.selectFlowRecordIdsByApprovalStaffId(userId);
if(CollectionUtils.isEmpty(flowRecordIds)){
return R.ok();
}
flowRecordIds.stream().forEach(recordId -> {
TaskListRes res = new TaskListRes();
ResultRecord resultRecord = resultRecordService.selectResultRecordById(recordId);
StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
res.setAvatar(Optional.ofNullable(staffEntity.getAvatar()).orElse(StringUtil.EMPTY));
//res.setTitle(); 根据状态拼接文案
//res.setTime();
//res.setUrl();
list.add(res);
});
return R.ok();
}
}

View File

@ -0,0 +1,20 @@
package com.lz.modules.performance.res;
import lombok.Data;
/**
* @Author: djc
* @Desc:
* @Date: 2020/10/13 17:15
*/
@Data
public class TaskListRes {
//头像
private String avatar;
//标题
private String title;
//时间
private String time;
//跳转路径
private String url;
}

View File

@ -200,6 +200,9 @@
select * from lz_flow_record where is_delete = 0 and record_id = #{recordResultId} and type = #{type} and status = #{status}
</select>
<select id="selectFlowRecordIdsByApprovalStaffId" resultType="Long">
select distinct(record_id) from lz_flow_record where is_delete = 0 and approval_staff_id = #{approvalStaffId} and status = 1
</select>
</mapper>