|
|
|
@ -28,42 +28,44 @@ public class SupRotaService extends ServiceImpl<SupRotaMapper, SupRota> { |
|
|
|
|
|
|
|
|
|
|
|
private final SupDepartService departService; |
|
|
|
private final SupDepartService departService; |
|
|
|
//展示数据的接口
|
|
|
|
//展示数据的接口
|
|
|
|
public JSONObject getSupRotaTable(SupRotaQueryParam queryParam){ |
|
|
|
public JSONObject getSupRotaTable(SupRotaQueryParam queryParam) { |
|
|
|
UserAuth user = UserContextHolder.getCurrentUser(); |
|
|
|
UserAuth user = UserContextHolder.getCurrentUser(); |
|
|
|
|
|
|
|
|
|
|
|
//判断传入的id是市局、还是分局
|
|
|
|
//判断传入的id是市局、还是分局
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject=new JSONObject(); |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
if (StrUtil.isBlank(queryParam.getDeptId()) && (user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()) || user.getRoleCodes().contains(RoleCodeEnum.ADMIN.getCode()))) { |
|
|
|
String dateTime = null; |
|
|
|
|
|
|
|
// 获取当前的本地时间
|
|
|
|
|
|
|
|
LocalTime currentTime = LocalTime.now(); |
|
|
|
|
|
|
|
|
|
|
|
SupDepart supDepart = departService.getById(AppConstants.ROOT_DEPART_ID); |
|
|
|
// 定义时间格式化为字符串的格式
|
|
|
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss"); |
|
|
|
|
|
|
|
|
|
|
|
// 获取当前的本地时间
|
|
|
|
// 将本地时间格式化为字符串
|
|
|
|
LocalTime currentTime = LocalTime.now(); |
|
|
|
String timeString = currentTime.format(formatter); |
|
|
|
|
|
|
|
|
|
|
|
// 定义时间格式化为字符串的格式
|
|
|
|
dateTime = queryParam.getDate() + " " + timeString; |
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss"); |
|
|
|
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 timeString = currentTime.format(formatter); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String dateTime=queryParam.getDate() + " "+timeString; |
|
|
|
|
|
|
|
//市局的数据进行分类
|
|
|
|
//市局的数据进行分类
|
|
|
|
//市局本身
|
|
|
|
//市局本身
|
|
|
|
List<SupRota> supRota = baseMapper.selectList(new LambdaQueryWrapper<SupRota>() |
|
|
|
List<SupRota> supRota = baseMapper.selectList(new LambdaQueryWrapper<SupRota>() |
|
|
|
.eq(SupRota::getDeptCode,supDepart.getId()) |
|
|
|
.eq(SupRota::getDeptCode, supDepart.getId()) |
|
|
|
.ge(SupRota::getStartTime,dateTime) |
|
|
|
.ge(SupRota::getStartTime, dateTime) |
|
|
|
.le(SupRota::getEndTime,dateTime)); |
|
|
|
.le(SupRota::getEndTime, dateTime)); |
|
|
|
jsonObject.fluentPut("cityBureau",supRota); |
|
|
|
jsonObject.fluentPut("cityBureau", supRota); |
|
|
|
//分局
|
|
|
|
//分局
|
|
|
|
List<SupRotaVo> suboffice =baseMapper.getSubofficeData(queryParam.getDate(),"3"); |
|
|
|
List<SupRotaVo> suboffice = baseMapper.getSubofficeData(dateTime, "3"); |
|
|
|
jsonObject.fluentPut("suboffice",suboffice); |
|
|
|
jsonObject.fluentPut("suboffice", suboffice); |
|
|
|
//局属单位
|
|
|
|
//局属单位
|
|
|
|
List<SupRotaVo> departmental =baseMapper.getSubofficeData(queryParam.getDate(),"4"); |
|
|
|
List<SupRotaVo> departmental = baseMapper.getSubofficeData(dateTime, "4"); |
|
|
|
jsonObject.fluentPut("departmental",departmental); |
|
|
|
jsonObject.fluentPut("departmental", departmental); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
List<SupRotaVo> supRotaList = baseMapper.getSupRotaList(queryParam.getDate(),queryParam.getDeptId()); |
|
|
|
List<SupRotaVo> supRotaList = baseMapper.getSupRotaList(dateTime, queryParam.getDeptId()); |
|
|
|
jsonObject.fluentPut("supRotaList",supRotaList); |
|
|
|
jsonObject.fluentPut("supRotaList", supRotaList); |
|
|
|
} |
|
|
|
} |
|
|
|
return jsonObject; |
|
|
|
return jsonObject; |
|
|
|
} |
|
|
|
} |
|
|
|
|