|
|
|
|
@ -34,10 +34,7 @@ public class SupRotaService extends ServiceImpl<SupRotaMapper, SupRota> {
|
|
|
|
|
//判断传入的id是市局、还是分局
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
if (StrUtil.isBlank(queryParam.getDeptId()) && (user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()) || user.getRoleCodes().contains(RoleCodeEnum.ADMIN.getCode()))) { |
|
|
|
|
|
|
|
|
|
SupDepart supDepart = departService.getById(AppConstants.ROOT_DEPART_ID); |
|
|
|
|
|
|
|
|
|
String dateTime = null; |
|
|
|
|
// 获取当前的本地时间
|
|
|
|
|
LocalTime currentTime = LocalTime.now(); |
|
|
|
|
|
|
|
|
|
@ -47,7 +44,12 @@ public class SupRotaService extends ServiceImpl<SupRotaMapper, SupRota> {
|
|
|
|
|
// 将本地时间格式化为字符串
|
|
|
|
|
String timeString = currentTime.format(formatter); |
|
|
|
|
|
|
|
|
|
String dateTime=queryParam.getDate() + " "+timeString; |
|
|
|
|
dateTime = queryParam.getDate() + " " + timeString; |
|
|
|
|
if (StrUtil.isBlank(queryParam.getDeptId()) && (user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()) || user.getRoleCodes().contains(RoleCodeEnum.ADMIN.getCode()))) { |
|
|
|
|
|
|
|
|
|
SupDepart supDepart = departService.getById(AppConstants.ROOT_DEPART_ID); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//市局的数据进行分类
|
|
|
|
|
//市局本身
|
|
|
|
|
List<SupRota> supRota = baseMapper.selectList(new LambdaQueryWrapper<SupRota>() |
|
|
|
|
@ -56,13 +58,13 @@ public class SupRotaService extends ServiceImpl<SupRotaMapper, SupRota> {
|
|
|
|
|
.le(SupRota::getEndTime, dateTime)); |
|
|
|
|
jsonObject.fluentPut("cityBureau", supRota); |
|
|
|
|
//分局
|
|
|
|
|
List<SupRotaVo> suboffice =baseMapper.getSubofficeData(queryParam.getDate(),"3"); |
|
|
|
|
List<SupRotaVo> suboffice = baseMapper.getSubofficeData(dateTime, "3"); |
|
|
|
|
jsonObject.fluentPut("suboffice", suboffice); |
|
|
|
|
//局属单位
|
|
|
|
|
List<SupRotaVo> departmental =baseMapper.getSubofficeData(queryParam.getDate(),"4"); |
|
|
|
|
List<SupRotaVo> departmental = baseMapper.getSubofficeData(dateTime, "4"); |
|
|
|
|
jsonObject.fluentPut("departmental", departmental); |
|
|
|
|
} else { |
|
|
|
|
List<SupRotaVo> supRotaList = baseMapper.getSupRotaList(queryParam.getDate(),queryParam.getDeptId()); |
|
|
|
|
List<SupRotaVo> supRotaList = baseMapper.getSupRotaList(dateTime, queryParam.getDeptId()); |
|
|
|
|
jsonObject.fluentPut("supRotaList", supRotaList); |
|
|
|
|
} |
|
|
|
|
return jsonObject; |
|
|
|
|
|