Merge branch 'version_report' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_report
This commit is contained in:
commit
ea287c6ae3
@ -264,13 +264,16 @@ public class ResultRecordController extends AbstractController {
|
|||||||
}
|
}
|
||||||
String superStaff = recordAuthService.selectByStaffId(resultRecord.getStaffId());
|
String superStaff = recordAuthService.selectByStaffId(resultRecord.getStaffId());
|
||||||
int fileCount = recordFileService.selectRecordFileCountByRecordId(resultRecord.getId());
|
int fileCount = recordFileService.selectRecordFileCountByRecordId(resultRecord.getId());
|
||||||
|
//表示是自己查看详情
|
||||||
if(resultRecord.getStaffId().equals(getUserId())){
|
if(resultRecord.getStaffId().equals(getUserId())){
|
||||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdTypeStatus(req.getRecordResultId(),resultRecord.getType(),0);
|
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdTypeStatus(req.getRecordResultId(), resultRecord.getType(), 0);
|
||||||
if(flowRecords!=null && flowRecords.size() == 2) { // 表示可以撤回
|
if (flowRecords != null && flowRecords.size() == 2) { // 表示可以撤回
|
||||||
auth.setCancel(1);
|
auth.setCancel(1);
|
||||||
}
|
}
|
||||||
if(flowRecords!=null && flowRecords.size() >= 2){
|
// 审批人是自己,不提供催办按钮,流程结束不显示
|
||||||
|
if (flowRecords != null && flowRecords.size() >= 2 &&
|
||||||
|
!getUserId().equals(resultRecord.getCurrentApprovalStaffId()) &&
|
||||||
|
resultRecord.getCurrentApprovalStaffId() != null) {
|
||||||
auth.setSubmited(1);
|
auth.setSubmited(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -601,6 +604,22 @@ public class ResultRecordController extends AbstractController {
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@RequestMapping("/addRecordAjudex")
|
||||||
|
public R addRecordAjudex(String type) {
|
||||||
|
ResultRecord resultRecord = resultRecordService.selectCurrentMonthResultRecordByStaffIdType(getUserId(),NumberUtil.objToIntDefault(type,2));
|
||||||
|
if(resultRecord !=null){
|
||||||
|
return R.error("当月己经存在绩效,请编辑。");
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -40,4 +40,6 @@ public interface StaffRoleDepartmentMapper extends BaseMapper<StaffRoleDepartmen
|
|||||||
StaffRoleDepartment selectStaffRoleDepartmentByDepartmentIdRoleIds(@Param("departmentId") Long departmentId, @Param("ids") List<Long> ids);
|
StaffRoleDepartment selectStaffRoleDepartmentByDepartmentIdRoleIds(@Param("departmentId") Long departmentId, @Param("ids") List<Long> ids);
|
||||||
|
|
||||||
void deleteStaffRoleDepartment(@Param("id") Long id);
|
void deleteStaffRoleDepartment(@Param("id") Long id);
|
||||||
|
|
||||||
|
List<StaffRoleDepartment> selectStaffRoleDepartmentByStaffRoleIdDepartments(@Param("staffRoleId") Long staffRoleId, @Param("departments") List<String> departments);
|
||||||
}
|
}
|
||||||
@ -11,6 +11,7 @@ import com.lz.modules.app.dto.StaffRoleResp;
|
|||||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
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.service.DepartmentsService;
|
||||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||||
import com.lz.modules.flow.dao.RecordRoleMapper;
|
import com.lz.modules.flow.dao.RecordRoleMapper;
|
||||||
import com.lz.modules.flow.dao.StaffRoleDepartmentMapper;
|
import com.lz.modules.flow.dao.StaffRoleDepartmentMapper;
|
||||||
@ -69,6 +70,9 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RecordRoleService recordRoleService;
|
private RecordRoleService recordRoleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DepartmentsService departmentsService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
||||||
|
|
||||||
@ -176,12 +180,15 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
Map<String,List<DepartmentsEntity>> map= resultRecordService.getStringListMap(departmentsEntities);
|
Map<String,List<DepartmentsEntity>> map= resultRecordService.getStringListMap(departmentsEntities);
|
||||||
role.setRoleId(staffRole.getId());
|
role.setRoleId(staffRole.getId());
|
||||||
role.setRoleName(staffRole.getDepartmentLevel());
|
role.setRoleName(staffRole.getDepartmentLevel());
|
||||||
|
|
||||||
for(StaffRoleDepartment staffRoleDepartment: staffRoleDepartments){
|
for(StaffRoleDepartment staffRoleDepartment: staffRoleDepartments){
|
||||||
List<DepartmentsEntity> list = map.get(staffRoleDepartment.getDepartmentId());
|
List<DepartmentsEntity> list = map.get(staffRoleDepartment.getDepartmentId());
|
||||||
if(list == null || list.size() == 0){
|
List<String> departments = departmentsService.selectAllChildDepartmentIds(staffRoleDepartment.getDepartmentId());
|
||||||
menuIdList.add(NumberUtil.objToLongDefault(staffRoleDepartment.getDepartmentId(),0l));
|
List<StaffRoleDepartment> departments1 = staffRoleDepartmentMapper.selectStaffRoleDepartmentByStaffRoleIdDepartments(staffRole.getId(), departments);
|
||||||
}else{
|
if (list == null || list.size() == 0 || departments1.size() <= 1) {
|
||||||
menuIdList1.add(NumberUtil.objToLongDefault(staffRoleDepartment.getDepartmentId(),0l));
|
menuIdList.add(NumberUtil.objToLongDefault(staffRoleDepartment.getDepartmentId(), 0l));
|
||||||
|
} else {
|
||||||
|
menuIdList1.add(NumberUtil.objToLongDefault(staffRoleDepartment.getDepartmentId(), 0l));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -200,7 +207,9 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<DepartmentsStaffRelateEntity> departmentsStaffRelateEntities = departmentsStaffRelateService.selectAll();
|
List<DepartmentsStaffRelateEntity> departmentsStaffRelateEntities = departmentsStaffRelateService.selectAll();
|
||||||
Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap = new HashMap<>();
|
Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap = new HashMap<>();
|
||||||
|
Map<String,DepartmentsStaffRelateEntity> singleDepartmentsStaffRelate = new HashMap<>();
|
||||||
for(DepartmentsStaffRelateEntity d : departmentsStaffRelateEntities){
|
for(DepartmentsStaffRelateEntity d : departmentsStaffRelateEntities){
|
||||||
|
singleDepartmentsStaffRelate.put(d.getDepartmentId(),d);
|
||||||
if(new Integer(1).equals(d.getIsLeader())){
|
if(new Integer(1).equals(d.getIsLeader())){
|
||||||
departmentsStaffRelateEntityMap.put(d.getDepartmentId(),d);
|
departmentsStaffRelateEntityMap.put(d.getDepartmentId(),d);
|
||||||
}
|
}
|
||||||
@ -212,34 +221,44 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
}
|
}
|
||||||
List<SysMenuEntity> list = new ArrayList<>();
|
List<SysMenuEntity> list = new ArrayList<>();
|
||||||
for (DepartmentsEntity d : parentDepartments) {
|
for (DepartmentsEntity d : parentDepartments) {
|
||||||
String departmentName = d.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,d.getDepartmentId());
|
String departmentName = d.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,d.getDepartmentId(),singleDepartmentsStaffRelate);
|
||||||
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(d.getDepartmentId(), 0l),departmentName , 0l, "");
|
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(d.getDepartmentId(), 0l),departmentName , 0l, "");
|
||||||
getMenuList(tDepartments, entity, list,departmentsStaffRelateEntityMap,staffMap);
|
getMenuList(tDepartments, entity, list,departmentsStaffRelateEntityMap,staffMap,singleDepartmentsStaffRelate);
|
||||||
list.add(entity);
|
list.add(entity);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSuffix(Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long ,StaffEntity> staffMap,String departmentId){
|
public String getSuffix(Map<String, DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long, StaffEntity> staffMap, String departmentId,
|
||||||
String suffix = "";
|
Map<String, DepartmentsStaffRelateEntity> singleDepartmentsStaffRelate) {
|
||||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateEntityMap.get(departmentId);
|
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateEntityMap.get(departmentId);
|
||||||
if(departmentsStaffRelateEntity !=null){
|
if (departmentsStaffRelateEntity != null) {
|
||||||
StaffEntity staffEntity = staffMap.get(departmentsStaffRelateEntity.getStaffId());
|
return doGetStaff(departmentsStaffRelateEntity, staffMap);
|
||||||
if(staffEntity !=null ){
|
} else {
|
||||||
suffix = " , "+staffEntity.getName();
|
return doGetStaff(singleDepartmentsStaffRelate.get(departmentId), staffMap);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return suffix;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String doGetStaff(DepartmentsStaffRelateEntity departmentsStaffRelateEntity, Map<Long, StaffEntity> staffMap) {
|
||||||
|
if (departmentsStaffRelateEntity != null) {
|
||||||
|
StaffEntity staffEntity = staffMap.get(departmentsStaffRelateEntity.getStaffId());
|
||||||
|
if (staffEntity != null) {
|
||||||
|
return " , " + staffEntity.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void getMenuList(List<DepartmentsEntity> tDepartments,SysMenuEntity sysMenuEntity,List<SysMenuEntity> list,
|
public void getMenuList(List<DepartmentsEntity> tDepartments,SysMenuEntity sysMenuEntity,List<SysMenuEntity> list,
|
||||||
Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long ,StaffEntity> staffMap) {
|
Map<String,DepartmentsStaffRelateEntity> departmentsStaffRelateEntityMap, Map<Long ,StaffEntity> staffMap,
|
||||||
|
Map<String,DepartmentsStaffRelateEntity> singleDepartmentsStaffRelate) {
|
||||||
for(DepartmentsEntity child : tDepartments) {
|
for(DepartmentsEntity child : tDepartments) {
|
||||||
if(NumberUtil.objToLongDefault(child.getDepartmentParentId(),0l).equals(sysMenuEntity.getMenuId())){
|
if(NumberUtil.objToLongDefault(child.getDepartmentParentId(),0l).equals(sysMenuEntity.getMenuId())){
|
||||||
String departmentName = child.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,child.getDepartmentId());
|
String departmentName = child.getDepartmentName() + getSuffix(departmentsStaffRelateEntityMap,staffMap,child.getDepartmentId(),singleDepartmentsStaffRelate);
|
||||||
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(child.getDepartmentId(),0l),
|
SysMenuEntity entity = recordRoleService.buildMenuEntity(NumberUtil.objToLongDefault(child.getDepartmentId(),0l),
|
||||||
departmentName,sysMenuEntity.getMenuId(),sysMenuEntity.getName());
|
departmentName,sysMenuEntity.getMenuId(),sysMenuEntity.getName());
|
||||||
getMenuList(tDepartments,entity,list,departmentsStaffRelateEntityMap,staffMap);
|
getMenuList(tDepartments,entity,list,departmentsStaffRelateEntityMap,staffMap,singleDepartmentsStaffRelate);
|
||||||
list.add(entity);
|
list.add(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,4 +65,6 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
|
|||||||
List<ReportProgressListDto> targetReportList(@Param("req")ReportListReq req, @Param("staffIds") List<String> staffIds,@Param("page") IPage page);
|
List<ReportProgressListDto> targetReportList(@Param("req")ReportListReq req, @Param("staffIds") List<String> staffIds,@Param("page") IPage page);
|
||||||
|
|
||||||
ResultRecord selectLastResultRecordByStaffIdType(@Param("staffId") Long staffId, @Param("type") int type);
|
ResultRecord selectLastResultRecordByStaffIdType(@Param("staffId") Long staffId, @Param("type") int type);
|
||||||
|
|
||||||
|
ResultRecord selectCurrentMonthResultRecordByStaffIdType(@Param("staffId") Long staffId, @Param("type") int type);
|
||||||
}
|
}
|
||||||
@ -96,4 +96,6 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
|||||||
DepartmentsStaffRelateEntity getLeaderDepartmentsStaffRelateEntity(Long staffId);
|
DepartmentsStaffRelateEntity getLeaderDepartmentsStaffRelateEntity(Long staffId);
|
||||||
|
|
||||||
ResultRecord selectLastResultRecordByStaffIdType(Long staffId, int type);
|
ResultRecord selectLastResultRecordByStaffIdType(Long staffId, int type);
|
||||||
|
|
||||||
|
ResultRecord selectCurrentMonthResultRecordByStaffIdType(Long staffId, int type);
|
||||||
}
|
}
|
||||||
@ -329,6 +329,11 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
return resultRecordMapper.selectLastResultRecordByStaffIdType(staffId,type);
|
return resultRecordMapper.selectLastResultRecordByStaffIdType(staffId,type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultRecord selectCurrentMonthResultRecordByStaffIdType(Long staffId, int type) {
|
||||||
|
return resultRecordMapper.selectCurrentMonthResultRecordByStaffIdType(staffId,type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultRecord createResultRecord(Long staffId, int type, Long roleId) {
|
public ResultRecord createResultRecord(Long staffId, int type, Long roleId) {
|
||||||
|
|||||||
@ -331,6 +331,10 @@
|
|||||||
select * from lz_result_record where is_delete = 0 and staff_id = #{staffId} and type = #{type} order by id desc limit 1
|
select * from lz_result_record where is_delete = 0 and staff_id = #{staffId} and type = #{type} order by id desc limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCurrentMonthResultRecordByStaffIdType" resultType="com.lz.modules.sys.entity.app.ResultRecord">
|
||||||
|
select * from lz_result_record where is_delete = 0 and staff_id = #{staffId} and type = #{type} and DATE_FORMAT(month_time,'%Y-%m') = DATE_FORMAT(now(),'%Y-%m') order by id desc limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -79,6 +79,9 @@
|
|||||||
<select id="selectStaffRoleDepartmentByStaffRoleId" resultType="com.lz.modules.flow.entity.StaffRoleDepartment">
|
<select id="selectStaffRoleDepartmentByStaffRoleId" resultType="com.lz.modules.flow.entity.StaffRoleDepartment">
|
||||||
select * from lz_staff_role_department where staff_role_id=#{staffRoleId} and is_delete = 0
|
select * from lz_staff_role_department where staff_role_id=#{staffRoleId} and is_delete = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectStaffRoleDepartmentByDepartmentId"
|
<select id="selectStaffRoleDepartmentByDepartmentId"
|
||||||
resultType="com.lz.modules.flow.entity.StaffRoleDepartment">
|
resultType="com.lz.modules.flow.entity.StaffRoleDepartment">
|
||||||
select * from lz_staff_role_department where department_id=#{departmentId} and is_delete = 0
|
select * from lz_staff_role_department where department_id=#{departmentId} and is_delete = 0
|
||||||
@ -93,9 +96,20 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<delete id="deleteStaffRoleDepartment">
|
<delete id="deleteStaffRoleDepartment">
|
||||||
delete from lz_staff_role_department where id = #{id}
|
delete from lz_staff_role_department where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectStaffRoleDepartmentByStaffRoleIdDepartments"
|
||||||
|
resultType="com.lz.modules.flow.entity.StaffRoleDepartment">
|
||||||
|
select * from lz_staff_role_department where staff_role_id=#{staffRoleId} and is_delete = 0
|
||||||
|
and department_id in
|
||||||
|
<foreach collection="departments" item="item" index="index" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user