|
|
|
|
@ -2,13 +2,17 @@ package com.biutag.lan.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONArray; |
|
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Assert; |
|
|
|
|
import com.biutag.constants.AppConstants; |
|
|
|
|
import com.biutag.entity.setting.DictData; |
|
|
|
|
import com.biutag.entity.system.Duty; |
|
|
|
|
import com.biutag.enums.DeptTypeEnum; |
|
|
|
|
import com.biutag.enums.RoleEnum; |
|
|
|
|
import com.biutag.lan.config.AdminThreadLocal; |
|
|
|
|
import com.biutag.lan.mapper.DataScreenMapper; |
|
|
|
|
import com.biutag.lan.service.IDeptService; |
|
|
|
|
import com.biutag.lan.validate.system.DeptCreateValidate; |
|
|
|
|
import com.biutag.lan.validate.system.DeptSearchValidate; |
|
|
|
|
@ -19,6 +23,7 @@ import com.biutag.entity.system.Dept;
|
|
|
|
|
import com.biutag.mapper.setting.DictDataMapper; |
|
|
|
|
import com.biutag.lan.mapper.PoliceUserMapper; |
|
|
|
|
import com.biutag.mapper.system.DeptMapper; |
|
|
|
|
import com.biutag.mapper.system.DutyMapper; |
|
|
|
|
import com.biutag.util.ListUtils; |
|
|
|
|
import com.biutag.util.StringUtils; |
|
|
|
|
import com.biutag.util.TimeUtils; |
|
|
|
|
@ -44,6 +49,11 @@ class DeptServiceImpl implements IDeptService {
|
|
|
|
|
@Resource |
|
|
|
|
DictDataMapper dictDataMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
DataScreenMapper dataScreenMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
DutyMapper dutyMapper; |
|
|
|
|
/** |
|
|
|
|
* 岗位所有 |
|
|
|
|
* |
|
|
|
|
@ -350,4 +360,80 @@ class DeptServiceImpl implements IDeptService {
|
|
|
|
|
deptMapper.updateById(model); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Map<String, Object> getToIndexDuty() { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
String deptId = AdminThreadLocal.getDeptId().toString(); |
|
|
|
|
Dept dept = deptMapper.selectById(deptId); |
|
|
|
|
List<Duty> dutyFjList = null; |
|
|
|
|
List<Duty> dutySjList = null; |
|
|
|
|
List<Duty> dutyPcsList = null; |
|
|
|
|
List<Duty> dutyDdList = null; |
|
|
|
|
|
|
|
|
|
if (dept.getLevel()==2){ |
|
|
|
|
Duty duty = dutyMapper.selectOne(new QueryWrapper<Duty>().eq("depart_id",deptId).last("limit 1")); |
|
|
|
|
System.out.println("ddddddddddddddddd"+duty); |
|
|
|
|
if(duty==null){ |
|
|
|
|
} else if (duty.getDeptType().equals(DeptTypeEnum.FJ_TYPE.getType())){ |
|
|
|
|
dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.FJ_TYPE.getType(), deptId); |
|
|
|
|
}else if (duty.getDeptType().equals(DeptTypeEnum.ZD_TYPE.getType())){ |
|
|
|
|
dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.ZD_TYPE.getType(), deptId); |
|
|
|
|
}else if (duty.getDeptType().equals(DeptTypeEnum.BW_TYPE.getType())){ |
|
|
|
|
dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.BW_TYPE.getType(), deptId); |
|
|
|
|
} |
|
|
|
|
map.put("dutyFjList", dutyFjList); |
|
|
|
|
dutySjList = dataScreenMapper.getToDayDuty(DeptTypeEnum.SJ_TYPE.getType(), null); |
|
|
|
|
dutyPcsList = dataScreenMapper.getToDayDuty(DeptTypeEnum.PCS_TYPE.getType(), deptId); |
|
|
|
|
dutyDdList = dataScreenMapper.getToDayDuty(DeptTypeEnum.DD_TYPE.getType(), deptId); |
|
|
|
|
map.put("dutySjList", dutySjList); |
|
|
|
|
map.put("dutyPcsList", dutyPcsList); |
|
|
|
|
map.put("dutyDdList", dutyDdList); |
|
|
|
|
|
|
|
|
|
}else if (dept.getLevel()==3){ |
|
|
|
|
Duty duty = dutyMapper.selectOne(new QueryWrapper<Duty>().eq("depart_id",dept.getPid()).last("limit 1")); |
|
|
|
|
if (duty == null){ |
|
|
|
|
}else if (duty.getDeptType().equals(DeptTypeEnum.FJ_TYPE.getType())){ |
|
|
|
|
dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.FJ_TYPE.getType(), dept.getPid().toString()); |
|
|
|
|
}else if (duty.getDeptType().equals(DeptTypeEnum.ZD_TYPE.getType())){ |
|
|
|
|
dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.ZD_TYPE.getType(), dept.getPid().toString()); |
|
|
|
|
}else if (duty.getDeptType().equals(DeptTypeEnum.BW_TYPE.getType())){ |
|
|
|
|
dutyFjList = dataScreenMapper.getToFjDuty(DeptTypeEnum.BW_TYPE.getType(), dept.getPid().toString()); |
|
|
|
|
} |
|
|
|
|
map.put("dutyFjList", dutyFjList); |
|
|
|
|
dutySjList = dataScreenMapper.getToDayDuty(DeptTypeEnum.SJ_TYPE.getType(), null); |
|
|
|
|
map.put("dutySjList", dutySjList); |
|
|
|
|
Duty dutyByDeptid = dutyMapper.selectOne(new QueryWrapper<Duty>().eq("depart_id",dept.getId()).last("limit 1")); |
|
|
|
|
if (dutyByDeptid == null){ |
|
|
|
|
|
|
|
|
|
} else if (dutyByDeptid.getDeptType().equals(DeptTypeEnum.PCS_TYPE.getType())){ |
|
|
|
|
dutyPcsList = dataScreenMapper.getToFjDuty(DeptTypeEnum.PCS_TYPE.getType(), deptId); |
|
|
|
|
}else if (dutyByDeptid.getDeptType().equals(DeptTypeEnum.DD_TYPE.getType())){ |
|
|
|
|
dutyPcsList = dataScreenMapper.getToFjDuty(DeptTypeEnum.DD_TYPE.getType(), deptId); |
|
|
|
|
} |
|
|
|
|
map.put("dutyPcsList", dutyPcsList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Dept getLevel() { |
|
|
|
|
String deptId = AdminThreadLocal.getDeptId().toString(); |
|
|
|
|
Dept dept = deptMapper.selectById(deptId); |
|
|
|
|
return dept; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Map<String, Object> getDuty() { |
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
String deptId = AdminThreadLocal.getDeptId().toString(); |
|
|
|
|
Dept dept = deptMapper.selectById(deptId); |
|
|
|
|
Dept fdept = deptMapper.selectById(dept.getPid()); |
|
|
|
|
map.put("FDepartName", fdept.getName()); |
|
|
|
|
map.put("DepartName", dept.getName()); |
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |