Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0
This commit is contained in:
commit
de8fc4852e
@ -13,10 +13,12 @@ import com.lz.modules.app.entity.DepartmentsEntity;
|
|||||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
import com.lz.modules.app.enums.ResultRecordStatusEnum;
|
import com.lz.modules.app.enums.ResultRecordStatusEnum;
|
||||||
|
import com.lz.modules.app.enums.RoleEnums;
|
||||||
import com.lz.modules.app.resp.Step;
|
import com.lz.modules.app.resp.Step;
|
||||||
import com.lz.modules.app.service.DepartmentsService;
|
import com.lz.modules.app.service.DepartmentsService;
|
||||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
|
import com.lz.modules.flow.dao.StaffRoleMapper;
|
||||||
import com.lz.modules.flow.entity.RecordAuth;
|
import com.lz.modules.flow.entity.RecordAuth;
|
||||||
import com.lz.modules.flow.entity.StaffRole;
|
import com.lz.modules.flow.entity.StaffRole;
|
||||||
import com.lz.modules.flow.model.FlowModel;
|
import com.lz.modules.flow.model.FlowModel;
|
||||||
@ -39,10 +41,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -274,6 +273,18 @@ public class TestController {
|
|||||||
return R.ok().put("data",map);
|
return R.ok().put("data",map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StaffRoleMapper staffRoleMapper;
|
||||||
|
|
||||||
|
// http://localhost:8080/lz_management/test/testmaster
|
||||||
|
@RequestMapping("/test/testmaster")
|
||||||
|
public R testmaster(Long userId) throws Exception{
|
||||||
|
List<StaffRole> masterPMs = staffRoleMapper.selectStaffRolesByDepartmentLevelList(Arrays.asList(new String[]{RoleEnums.MASTER_PM.getName()}));
|
||||||
|
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String a = "{\"313\":[17,20,13]}";
|
String a = "{\"313\":[17,20,13]}";
|
||||||
|
|||||||
@ -68,4 +68,6 @@ public interface StaffRoleMapper extends BaseMapper<StaffRole> {
|
|||||||
|
|
||||||
|
|
||||||
List<StaffMenu> selectMenusByParentId(@Param("parentId") long parentId);
|
List<StaffMenu> selectMenusByParentId(@Param("parentId") long parentId);
|
||||||
|
|
||||||
|
List<StaffRole> selectStaffRolesByDepartmentLevelList(@Param("departmentLevels") List<String> departmentLevels);
|
||||||
}
|
}
|
||||||
@ -424,16 +424,17 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
staffRole = new StaffRole();
|
staffRole = new StaffRole();
|
||||||
com.lz.modules.app.utils.BeanUtils.copyProperty(staffRole, roleModel);
|
com.lz.modules.app.utils.BeanUtils.copyProperty(staffRole, roleModel);
|
||||||
staffRole.setStaffName(staffEntity.getName());
|
staffRole.setStaffName(staffEntity.getName());
|
||||||
|
|
||||||
|
List<StaffRole> masterPMs = staffRoleMapper.selectStaffRolesByDepartmentLevelList(Arrays.asList(new String[]{RoleEnums.MASTER_PM.getName()}));
|
||||||
|
if(CollectionUtils.isNotEmpty(masterPMs)){
|
||||||
|
return R.error("主管理员只能设置一个,如果想添加,只能更改管理员。");
|
||||||
|
}
|
||||||
staffRoleMapper.insertStaffRole(staffRole);
|
staffRoleMapper.insertStaffRole(staffRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RoleEnums.BOSS.getName().equals(staffRole.getDepartmentLevel())) {
|
if (RoleEnums.BOSS.getName().equals(staffRole.getDepartmentLevel())) {
|
||||||
insertPM(staffRole, RoleMenuEnums.BOSS.getType(), staffEntity);
|
insertPM(staffRole, RoleMenuEnums.BOSS.getType(), staffEntity);
|
||||||
} else if (RoleEnums.MASTER_PM.getName().equals(staffRole.getDepartmentLevel())) {
|
} else if (RoleEnums.MASTER_PM.getName().equals(staffRole.getDepartmentLevel())) {
|
||||||
StaffRole masterPM = staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevelList(roleModel.getStaffId(), Arrays.asList(new String[]{RoleEnums.MASTER_PM.getName()}));
|
|
||||||
if(masterPM !=null){
|
|
||||||
return R.error("主管理员只能设置一个,请更改主管理员。");
|
|
||||||
}
|
|
||||||
insertPM(staffRole, RoleMenuEnums.MASTER_PM.getType(), staffEntity);
|
insertPM(staffRole, RoleMenuEnums.MASTER_PM.getType(), staffEntity);
|
||||||
} else if (RoleEnums.CHILD_PM.getName().equals(staffRole.getDepartmentLevel())) { //如果是子管理员
|
} else if (RoleEnums.CHILD_PM.getName().equals(staffRole.getDepartmentLevel())) { //如果是子管理员
|
||||||
if(new Long(0).equals(roleModel.getEvaluationGroupId())){//全部考评组
|
if(new Long(0).equals(roleModel.getEvaluationGroupId())){//全部考评组
|
||||||
|
|||||||
@ -271,6 +271,14 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
|||||||
//删除本次考核任务
|
//删除本次考核任务
|
||||||
resultRecordMapper.batchDeleteByStartIdAndStaffId(req.getStartId(),change);
|
resultRecordMapper.batchDeleteByStartIdAndStaffId(req.getStartId(),change);
|
||||||
evaluationStartStaffMapper.deleteEvaluationStartStaffChangeAssess(req.getStartId(),change);
|
evaluationStartStaffMapper.deleteEvaluationStartStaffChangeAssess(req.getStartId(),change);
|
||||||
|
//删除钉钉任务
|
||||||
|
try {
|
||||||
|
List<Long> recordIds = resultRecordMapper.selectIdsByStartId(req.getStartId());
|
||||||
|
String s = dingtalkBusiness.delWorkMSGWithStart(recordIds);
|
||||||
|
log.info("清除钉钉任务响应,res: " +s);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("调用钉钉清除任务异常,e:" ,e);
|
||||||
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|||||||
@ -197,5 +197,13 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectStaffRolesByDepartmentLevelList" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||||
|
select * from lz_staff_role where is_delete = 0 and department_level in
|
||||||
|
<foreach collection="departmentLevels" item="item" index="index" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user