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

This commit is contained in:
杜建超 2020-12-10 10:05:35 +08:00
commit 3c1607e1ec
15 changed files with 250 additions and 62 deletions

View File

@ -562,7 +562,8 @@ public class ResultRecordController extends AbstractController {
) {
//下面设置计算公式
dto.setCalculate(setCalculateValue(calculateModels1, dto)) ;
List<ResultTask> resultTasks = resultTaskService.selectResultTasksByDetailId(dto.getId());
List<ResultTaskDto> resultTaskDtos = resultTaskService.selectResultTaskDtosByDetailId(dto.getId());
dto.setTaskDtos(resultTaskDtos);
weight = weight.add(dto.getCheckWeight());
if(scoreDtos.size() > 0){
//获取评分详细
@ -1454,4 +1455,12 @@ public class ResultRecordController extends AbstractController {
return R.ok();
}
}

View File

@ -10,6 +10,7 @@ import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.enums.RoleEnums;
import com.lz.modules.app.model.RoleModel;
import com.lz.modules.app.model.TaskModel;
import com.lz.modules.app.resp.StaffRoleModel;
import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
@ -23,6 +24,7 @@ import com.lz.modules.flow.service.RecordRoleService;
import com.lz.modules.flow.service.StaffRoleDepartmentService;
import com.lz.modules.flow.service.StaffRoleEvaluationGroupService;
import com.lz.modules.flow.service.StaffRoleService;
import com.lz.modules.sys.controller.AbstractController;
import com.lz.modules.sys.entity.SysMenuEntity;
import com.lz.modules.sys.entity.SysRoleEntity;
import io.swagger.annotations.Api;
@ -48,7 +50,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("user/lzstaffrole")
@Api(tags = "考评组管理员管理")
public class StaffRoleController {
public class StaffRoleController extends AbstractController {
@Autowired
private StaffRoleService staffRoleService;
@ -252,4 +254,25 @@ public class StaffRoleController {
return staffRoleService.delete(roleModel);
}
// http://localhost:8080/lz_management/user/lzstaffrole/task/comment?taskId=1&content=xxx&staffId=294
@RequestMapping("/task/comment")
public R taskComment(TaskModel taskModel) {
if(taskModel.getStaffId() == null && getUser()!=null && getUserId() !=null){
taskModel.setStaffId(getUserId());
}
return staffRoleService.taskComment(taskModel);
}
//http://localhost:8080/lz_management/user/lzstaffrole/comment/list?detailId=4917&pageSize=2
@RequestMapping("/comment/list")
public R commentList(TaskModel taskModel) {
if(taskModel.getStaffId() == null && getUser()!=null && getUserId() !=null){
taskModel.setStaffId(getUserId());
}
return staffRoleService.commentList(taskModel);
}
}

View File

@ -15,6 +15,7 @@ import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.enums.ResultRecordStatusEnum;
import com.lz.modules.app.enums.RoleEnums;
import com.lz.modules.app.model.TaskModel;
import com.lz.modules.app.resp.Step;
import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
@ -306,7 +307,7 @@ public class TestController {
}
// 重置http://localhost:8080/lz_management/test/approval?resultRecordId=3682&status=9&menuName=cccc&flowRecordId=33919&resetFlag=0
// 重置http://localhost:8080/lz_management/test/approval?resultRecordId=3702&status=9&menuName=cccc&flowRecordId=33987&resetFlag=0
@RequestMapping("/test/approval")
public R approval(ApprovalDto approvalDto) {
try {
@ -315,4 +316,19 @@ public class TestController {
return R.error(e.getMessage());
}
}
// http://localhost:8080/lz_management/test/task/comment?taskId=1&content=xxx&staffId=294
@RequestMapping("/test/task/comment")
public R taskComment(TaskModel taskModel) {
return staffRoleService.taskComment(taskModel);
}
//http://localhost:8080/lz_management/test/comment/list?detailId=4917&pageSize=2
@RequestMapping("/test/comment/list")
public R commentList(TaskModel taskModel) {
return staffRoleService.commentList(taskModel);
}
}

View File

@ -0,0 +1,9 @@
package com.lz.modules.app.dto;
import com.lz.modules.performance.entity.TaskComment;
import lombok.Data;
@Data
public class TaskCommentDto extends TaskComment {
private int isSelf;
}

View File

@ -0,0 +1,14 @@
package com.lz.modules.app.model;
import lombok.Data;
@Data
public class TaskModel {
private int currPage = 1;
private int pageSize = 10;
private Long taskId;
private Long detailId;
private String content;
private Long staffId;
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.modules.app.model.RoleModel;
import com.lz.modules.app.model.TaskModel;
import com.lz.modules.flow.entity.StaffRole;
import com.lz.modules.sys.entity.SysMenuEntity;
import com.lz.modules.sys.entity.SysRoleEntity;
@ -76,4 +77,7 @@ public interface StaffRoleService extends IService<StaffRole> {
StaffRole selectStaffRolesByStaffIdDepartmentLevelList(Long loginUserId, List<String> asList);
R taskComment(TaskModel roleModel);
R commentList(TaskModel taskModel);
}

View File

@ -9,10 +9,7 @@ import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.app.dao.DepartmentsDao;
import com.lz.modules.app.dao.StaffDao;
import com.lz.modules.app.dto.EvaluationGroupInfo;
import com.lz.modules.app.dto.StaffRoleDetailInfo;
import com.lz.modules.app.dto.StaffRoleInfo;
import com.lz.modules.app.dto.StaffRoleResp;
import com.lz.modules.app.dto.*;
import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity;
@ -21,6 +18,7 @@ import com.lz.modules.app.enums.EvaluationGroupEnums;
import com.lz.modules.app.enums.RoleEnums;
import com.lz.modules.app.enums.RoleMenuEnums;
import com.lz.modules.app.model.RoleModel;
import com.lz.modules.app.model.TaskModel;
import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.flow.dao.RecordRoleMapper;
@ -28,8 +26,16 @@ import com.lz.modules.flow.dao.StaffRoleDepartmentMapper;
import com.lz.modules.flow.dao.StaffRoleMapper;
import com.lz.modules.flow.entity.*;
import com.lz.modules.flow.service.*;
import com.lz.modules.job.business.DingtalkBusiness;
import com.lz.modules.performance.dao.TaskCommentMapper;
import com.lz.modules.performance.entity.ResultTask;
import com.lz.modules.performance.entity.TaskComment;
import com.lz.modules.performance.service.ResultTaskService;
import com.lz.modules.performance.service.TaskCommentService;
import com.lz.modules.sys.entity.SysMenuEntity;
import com.lz.modules.sys.entity.SysRoleEntity;
import com.lz.modules.sys.entity.app.ResultDetail;
import com.lz.modules.sys.service.app.ResultDetailService;
import com.lz.modules.sys.service.app.ResultRecordService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
@ -98,6 +104,21 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
private RecordAuthService recordAuthService;
@Autowired
private ResultTaskService resultTaskService;
@Autowired
private ResultDetailService resultDetailService;
@Autowired
private TaskCommentService taskCommentService;
@Autowired
private DingtalkBusiness dingtalkBusiness;
@Autowired
private TaskCommentMapper taskCommentMapper;
@Override
public StaffRole selectStaffRoleById(Long id) {
return staffRoleMapper.selectStaffRoleById(id);
@ -403,10 +424,10 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
staffRole.setStaffName(staffEntity.getName());
//如果当前子管理员修改成主管理员
if (RoleEnums.MASTER_PM.getName().equals(roleModel.getDepartmentLevel())) {
StaffRole data = staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevelList(roleModel.getStaffId(), Arrays.asList(new String[]{RoleEnums.CHILD_PM.getName()}));
if(data !=null){
staffRoleMapper.deleteStaffRoleById(data.getId()); //删除子管理员
}
StaffRole data = staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevelList(roleModel.getStaffId(), Arrays.asList(new String[]{RoleEnums.CHILD_PM.getName()}));
if (data != null) {
staffRoleMapper.deleteStaffRoleById(data.getId()); //删除子管理员
}
}
staffRoleMapper.updateStaffRoleById(staffRole);
if (RoleEnums.BOSS.getName().equals(staffRole.getDepartmentLevel()) ||
@ -414,11 +435,11 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
return R.ok("更新成功");
}
} else if (roleModel.getStaffId() != null) { // 员工不为空,表示是新增数据
StaffRole data = null;
if(RoleEnums.CHILD_PM.getName().equals(roleModel.getDepartmentLevel()) //如果是主管理员或者是子管理员主管理员和子管理员不能同时存在
|| RoleEnums.MASTER_PM.getName().equals(roleModel.getDepartmentLevel())){
StaffRole data = null;
if (RoleEnums.CHILD_PM.getName().equals(roleModel.getDepartmentLevel()) //如果是主管理员或者是子管理员主管理员和子管理员不能同时存在
|| RoleEnums.MASTER_PM.getName().equals(roleModel.getDepartmentLevel())) {
data = staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevelList(roleModel.getStaffId(),
Arrays.asList(new String[]{RoleEnums.CHILD_PM.getName(),RoleEnums.MASTER_PM.getName()}));
Arrays.asList(new String[]{RoleEnums.CHILD_PM.getName(), RoleEnums.MASTER_PM.getName()}));
} else {
data = staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevel(roleModel.getStaffId(), roleModel.getDepartmentLevel());
}
@ -443,11 +464,11 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
} else if (RoleEnums.MASTER_PM.getName().equals(staffRole.getDepartmentLevel())) {
insertPM(staffRole, RoleMenuEnums.MASTER_PM.getType(), staffEntity);
} else if (RoleEnums.CHILD_PM.getName().equals(staffRole.getDepartmentLevel())) { //如果是子管理员
if(new Long(0).equals(roleModel.getEvaluationGroupId())){//全部考评组
insertStaffRoleEvaluationGroup(staffRole.getId(),0l);
}else{///部分考评组
if (new Long(0).equals(roleModel.getEvaluationGroupId())) {//全部考评组
insertStaffRoleEvaluationGroup(staffRole.getId(), 0l);
} else {///部分考评组
for (Long evaluationGroupId : evaluationGroupInfoIds) {
insertStaffRoleEvaluationGroup(staffRole.getId(),evaluationGroupId);
insertStaffRoleEvaluationGroup(staffRole.getId(), evaluationGroupId);
}
}
if (roleModel.getDepartmentId().equals(DepartmentPMEnums.SELF_DEPARTMENT.getType().toString())) {//如果是自己所在部门
@ -488,44 +509,44 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
@Override
public Map<String, Integer> getRoleByUserId(Long userId) {
Map<String ,Integer> map = new HashMap<>();
Map<String, Integer> map = new HashMap<>();
List<StaffRole> staffRoleList = staffRoleMapper.selectAllByStaffId(userId);
List<StaffMenu> staffMenus = new ArrayList<>();
List<StaffMenu> commonStaffList= staffMenuService.selectByParentId( RoleMenuEnums.COMMON_STAFF.getType());
if(CollectionUtils.isNotEmpty(commonStaffList)){
List<StaffMenu> commonStaffList = staffMenuService.selectByParentId(RoleMenuEnums.COMMON_STAFF.getType());
if (CollectionUtils.isNotEmpty(commonStaffList)) {
staffMenus.addAll(commonStaffList);
}
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(userId);
if(departmentsStaffRelateEntity !=null && new Integer(1).equals(departmentsStaffRelateEntity.getIsLeader())){
List<StaffMenu> staffMenuDepartmentList= staffMenuService.selectByParentId( RoleMenuEnums.DEPARTMENT_PM.getType());
if(CollectionUtils.isNotEmpty(staffMenuDepartmentList)){
if (departmentsStaffRelateEntity != null && new Integer(1).equals(departmentsStaffRelateEntity.getIsLeader())) {
List<StaffMenu> staffMenuDepartmentList = staffMenuService.selectByParentId(RoleMenuEnums.DEPARTMENT_PM.getType());
if (CollectionUtils.isNotEmpty(staffMenuDepartmentList)) {
staffMenus.addAll(staffMenuDepartmentList);
}
}
if(CollectionUtils.isNotEmpty(staffRoleList)){
for(StaffRole staffRole: staffRoleList){
if(staffRole.getDepartmentLevel().equals(RoleEnums.MASTER_PM.getName())){ //如果是主管理员
List<StaffMenu> staffMenuList= staffMenuService.selectByParentId( RoleMenuEnums.MASTER_PM.getType());
if(CollectionUtils.isNotEmpty(staffMenuList)){
staffMenus.addAll(staffMenuList);
}
}else{
List<StaffMenu> staffMenuList = staffRoleMapper.selectAllMenus(staffRole.getStaffId());
if(CollectionUtils.isNotEmpty(staffMenuList)){
staffMenus.addAll(staffMenuList);
}
}
}
if (CollectionUtils.isNotEmpty(staffRoleList)) {
for (StaffRole staffRole : staffRoleList) {
if (staffRole.getDepartmentLevel().equals(RoleEnums.MASTER_PM.getName())) { //如果是主管理员
List<StaffMenu> staffMenuList = staffMenuService.selectByParentId(RoleMenuEnums.MASTER_PM.getType());
if (CollectionUtils.isNotEmpty(staffMenuList)) {
staffMenus.addAll(staffMenuList);
}
} else {
List<StaffMenu> staffMenuList = staffRoleMapper.selectAllMenus(staffRole.getStaffId());
if (CollectionUtils.isNotEmpty(staffMenuList)) {
staffMenus.addAll(staffMenuList);
}
}
}
}
if(CollectionUtils.isNotEmpty(staffMenus) && staffMenus.size() > 0 ){
if (CollectionUtils.isNotEmpty(staffMenus) && staffMenus.size() > 0) {
List<Long> authIds = new ArrayList<>();
for(StaffMenu staffMenu:staffMenus){
List<Long> ids = StringUtil.splitToLongList(staffMenu.getAuthIds(),",");
for (StaffMenu staffMenu : staffMenus) {
List<Long> ids = StringUtil.splitToLongList(staffMenu.getAuthIds(), ",");
authIds.addAll(ids);
}
if(authIds.size() > 0){
if (authIds.size() > 0) {
map = recordAuthService.selectAuthByIds(authIds);
}
}
@ -550,11 +571,11 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
staffRoleMenuService.insertStaffRoleMenu(staffRoleMenu);
}
if (parentId.equals(RoleMenuEnums.MASTER_PM.getType())) { //如果是绩效管理员
insertStaffRoleEvaluationGroup(staffRole.getId(),0l);
insertStaffRoleEvaluationGroup(staffRole.getId(), 0l);
}
}
public void insertStaffRoleEvaluationGroup(Long roleId,Long evaluationGroupId){
public void insertStaffRoleEvaluationGroup(Long roleId, Long evaluationGroupId) {
StaffRoleEvaluationGroup staffRoleEvaluationGroup = new StaffRoleEvaluationGroup();
staffRoleEvaluationGroup.setRoleId(roleId);
staffRoleEvaluationGroup.setEvaluationGroupId(evaluationGroupId);
@ -575,24 +596,72 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
}
@Override
public List<StaffRole> selectMastRoles(){
public List<StaffRole> selectMastRoles() {
return staffRoleMapper.selectMastRoles();
}
@Override
public List<StaffRole> selectAllGroupManageRoles(){
public List<StaffRole> selectAllGroupManageRoles() {
return staffRoleMapper.selectAllGroupManageRoles();
}
@Override
public List<StaffRole> selectByEvaluationGroupId(Long groupId){
public List<StaffRole> selectByEvaluationGroupId(Long groupId) {
return staffRoleMapper.selectByEvaluationGroupId(groupId);
}
@Override
public StaffRole selectStaffRolesByStaffIdDepartmentLevelList(Long staffId, List<String> departmentLevels) {
public StaffRole selectStaffRolesByStaffIdDepartmentLevelList(Long staffId, List<String> departmentLevels) {
return staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevelList(staffId, departmentLevels);
}
@Override
public R taskComment(TaskModel roleModel) {
if (roleModel.getDetailId() == null && roleModel.getTaskId() == null) {
return R.error("detailId和taskId不能同时为空");
}
TaskComment taskComment = new TaskComment();
taskComment.setContent(roleModel.getContent());
taskComment.setTaskId(roleModel.getTaskId());
if (roleModel.getTaskId() != null) {
ResultTask resultTask = resultTaskService.selectResultTaskById(roleModel.getTaskId());
taskComment.setDetailId(resultTask.getDetailId());
taskComment.setType(1);
} else {
taskComment.setDetailId(roleModel.getDetailId());
taskComment.setType(0);//
}
ResultDetail resultDetail = resultDetailService.selectResultDetailById(taskComment.getDetailId());
taskComment.setResultRecordId(resultDetail.getRecordId());
StaffEntity staffEntity = staffDao.selectStaffById(roleModel.getStaffId());
if (staffEntity != null) {
taskComment.setStaffId(staffEntity.getId());
taskComment.setStaffName(staffEntity.getName());
}
taskCommentService.insertTaskComment(taskComment);
dingtalkBusiness.sendTaskNoticeMsg(taskComment.getDetailId(), taskComment.getTaskId());
return R.ok();
}
@Override
public R commentList(TaskModel taskModel) {
PageUtils pageUtils = PageUtils.startPage(taskModel.getCurrPage(), taskModel.getPageSize()).doSelect(
page -> taskCommentMapper.selectByCondition(page, taskModel)
);
List<TaskComment> taskComments = pageUtils.getList();
List<TaskCommentDto> taskCommentDtoList = new ArrayList<>();
for (TaskComment taskComment : taskComments) {
TaskCommentDto taskCommentDto = new TaskCommentDto();
BeanUtils.copyProperties(taskComment, taskCommentDto);
if(taskComment.getStaffId().equals(taskModel.getStaffId())){
taskCommentDto.setIsSelf(1);
}
taskCommentDtoList.add(taskCommentDto);
}
pageUtils.setList(taskCommentDtoList);
return R.ok().put("data", pageUtils);
return staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevelList(staffId,departmentLevels);
}
}

View File

@ -646,6 +646,7 @@ public class DingtalkBusiness {
}
public String sendTaskNoticeMsg(Long detailId, Long taskId) {
return "OK";
}
public String sendNoticeMsg(ResultRecord lzResultRecord, List<StaffEntity> staffs) {

View File

@ -8,9 +8,14 @@ package com.lz.modules.performance.dao;
* @since 2020-12-08
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lz.modules.app.model.TaskModel;
import com.lz.modules.performance.entity.TaskComment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface TaskCommentMapper extends BaseMapper<TaskComment> {
@ -31,4 +36,6 @@ public interface TaskCommentMapper extends BaseMapper<TaskComment> {
int deleteTaskCommensByTaskId(@Param("taskId") Long taskId);
List<TaskComment> selectByCondition(@Param("page") IPage page, @Param("taskModel") TaskModel taskModel);
}

View File

@ -44,4 +44,5 @@ public interface ResultTaskService extends IService<ResultTask> {
List<ResultTask> selectResultTasksByDetailId(Long detailId);
void deleteTask(Long taskId);
List<ResultTaskDto> selectResultTaskDtosByDetailId(Long detailId);
}

View File

@ -227,4 +227,9 @@ public class ResultTaskServiceImpl extends ServiceImpl<ResultTaskMapper, ResultT
taskProcessRecord.setLabel("" +resultTask.getName() + "任务删除");
taskProcessRecordService.insertTaskProcessRecord(taskProcessRecord);
}
@Override
public List<ResultTaskDto> selectResultTaskDtosByDetailId(Long detailId){
return resultTaskMapper.selectResultTaskDtosByDetailId(detailId);
}
}

View File

@ -942,16 +942,19 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
private R resetNode(ApprovalDto approvalDto) {
FlowRecord f = flowRecordService.selectFlowRecordById(approvalDto.getFlowRecordId());
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdGeFlowIndex(f.getRecordId(),f.getFlowIndex());
boolean flag = false ;
for(FlowRecord flowRecord:flowRecords){
// 如果结果录入己经走了
if (new Integer(2).equals(flowRecord.getFlowProcess()) && (flowRecord.getStatus() == 1 || flowRecord.getStatus() == 4) ) {
flowRecord.setStatus(4); //表示流程己经被重置
flag = true;
}else{
flowRecord.setStatus(0); //表示流程己经被重置
}
flowRecordService.updateFlowRecordById(flowRecord);
}
FlowRecord preFlowRecord = flowRecordService.selectPreFlowRecordByRecordIdMinIdStatusList(f.getRecordId(), f.getFlowIndex() - 1, Arrays.asList(1, 2));
FlowRecord preFlowRecord = flowRecordService.selectPreFlowRecordByRecordIdMinIdStatusList(f.getRecordId(), f.getFlowIndex(), Arrays.asList(1, 2,4));
List<FlowRecord> runing = new ArrayList<>();
if (preFlowRecord != null) {
runing = flowRecordService.selectFlowRecordByRecordIdFlowIndex(f.getRecordId(), preFlowRecord.getFlowIndex());
@ -962,13 +965,28 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
r.setStatus(2);
flowRecordService.updateFlowRecordById(r);
}
if(flag) { //如果录入己经走了设置新的数据结果录入己走
List<FlowRecord> newflowRecords = flowRecordService.selectFlowRecordByRecordId(f.getRecordId());
for(int i = 0 ;i < newflowRecords.size() ; i ++){
FlowRecord newFlowRecord = newflowRecords.get(i) ;
if (new Integer(2).equals(newFlowRecord.getFlowProcess()) ) {
newFlowRecord.setStatus(4);
flowRecordService.updateFlowRecordById(newFlowRecord);
}
}
}
return R.ok();
}
private R resetAll(ApprovalDto approvalDto) {
FlowRecord flowRecord = flowRecordService.selectFlowRecordById(approvalDto.getFlowRecordId());
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordId(flowRecord.getRecordId());
Long flowRecordId = approvalDto.getResultRecordId();
if(flowRecord != null ){
flowRecordId = flowRecord.getRecordId();
}
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordId(flowRecordId);
List<Long> flowRecordIds =new ArrayList<>();
boolean flag = false ;
for(FlowRecord f: flowRecords){
@ -978,9 +996,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
flag = true;
}
}
flowRecordService.deleteFlowRecordByRecordId(flowRecord.getRecordId());
initFlowRecord(flowRecord.getRecordId());
List<FlowRecord> newflowRecords = flowRecordService.selectFlowRecordByRecordId(flowRecord.getRecordId());
flowRecordService.deleteFlowRecordByRecordId(flowRecordId);
initFlowRecord(flowRecordId);
List<FlowRecord> newflowRecords = flowRecordService.selectFlowRecordByRecordId(flowRecordId);
for(int i = 0 ;i < newflowRecords.size() ; i ++){
flowRecordService.updateFlowRecordIdById(newflowRecords.get(i).getId(),flowRecordIds.get(i));
if(flag ){ //如果录入己经走了设置新的数据结果录入己走
@ -991,7 +1009,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
}
}
resultRecordService.resetData(flowRecord.getRecordId(),approvalDto.getClearFlag());
resultRecordService.resetData(flowRecordId,approvalDto.getClearFlag());
return R.ok();
}
@ -1440,6 +1458,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
int flowIndex = 0;
List<ResetDataResp> resetDataResps = new ArrayList<>();
for (FlowRecord flowRecord : flowRecords) {
if(new Integer(2).equals(flowRecord.getFlowProcess())){ //过虑掉flowProcess
continue;
}
if (flowRecord.getFlowIndex().equals(flowIndex - 1)) { //表示有重复数据
ResetDataResp resetDataResp = resetDataResps.get(flowIndex - 1);
resetDataResp.getStaffNames().add(flowRecord.getApprovalStaffName());
@ -1463,7 +1484,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
log.info("需要删除指标个数{}", resultDetails.size());
if(resultDetails.size() > 0){
if(clearFlag == 1){
if(clearFlag == 0){
log.info("全部清空,删除所有指标即可");
resultDetailService.deleteResultDetailByRecordId(recordId);
for(ResultDetail detail : resultDetails){

View File

@ -327,7 +327,7 @@
</select>
<select id="selectFlowRecordByRecordIdGeFlowIndex" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and record_id = #{recordId} and flow_index >= #{flowIndex}
select * from lz_flow_record where is_delete = 0 and record_id = #{recordId} and flow_index > #{flowIndex}
</select>
@ -335,9 +335,10 @@
select * from lz_flow_record where is_delete = 0 and record_id = #{recordId} and flow_index <![CDATA[<=]]> #{flowIndex}
</select>
<select id="selectPreFlowRecordByRecordIdMinIdStatusList" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and flow_index <![CDATA[<=]]> #{flowIndex}
and record_id = #{recordId}
and record_id = #{recordId} and flow_process !=2
and status in
<foreach item="item" collection="statusList" open="(" separator="," close=")">
#{item}

View File

@ -93,7 +93,7 @@
</update>
<select id="selectResultTaskDtosByDetailId" resultType="com.lz.modules.performance.dto.ResultTaskDto" >
select name,process_rate from lz_result_task where detail_id=#{detailId} and is_delete = 0 order by order_by asc
select id, is_delete, name,process_rate from lz_result_task where detail_id=#{detailId} and is_delete = 0 order by order_by asc
</select>
</mapper>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lz.modules.performance.daor.TaskCommentMapper">
<mapper namespace="com.lz.modules.performance.dao.TaskCommentMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.lz.modules.performance.entity.TaskComment">
@ -95,11 +95,19 @@
</update>
<select id="selectByCondition" resultType="com.lz.modules.performance.entity.TaskComment">
select * from lz_task_comment where is_delete = 0
and (detail_id = #{taskModel.detailId} or task_id=#{taskModel.taskId} )
order by id desc
</select>
<update id="deleteTaskCommentById" parameterType="java.lang.Long">
update lz_task_comment set is_delete = 1 where id=#{id} limit 1
</update>
<update id="deleteTaskCommentById" parameterType="java.lang.Long">
<update id="deleteTaskCommensByTaskId" parameterType="java.lang.Long">
update lz_task_comment set is_delete = 1 where task_id=#{taskId}
</update>