|
|
|
|
@ -3,9 +3,13 @@ package com.biutag.supervision.service;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.biutag.supervision.common.UserContextHolder; |
|
|
|
|
import com.biutag.supervision.constants.AppConstants; |
|
|
|
|
import com.biutag.supervision.constants.enums.RoleCodeEnum; |
|
|
|
|
import com.biutag.supervision.mapper.SupRotaMapper; |
|
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
|
import com.biutag.supervision.pojo.entity.SupRota; |
|
|
|
|
import com.biutag.supervision.pojo.model.UserAuth; |
|
|
|
|
import com.biutag.supervision.pojo.param.SupRotaQueryParam; |
|
|
|
|
import com.biutag.supervision.pojo.vo.SupRotaVo; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
@ -19,13 +23,17 @@ import java.util.List;
|
|
|
|
|
@Service |
|
|
|
|
public class SupRotaService extends ServiceImpl<SupRotaMapper, SupRota> { |
|
|
|
|
|
|
|
|
|
private SupDepartService departService; |
|
|
|
|
private final SupDepartService departService; |
|
|
|
|
//展示数据的接口
|
|
|
|
|
public JSONObject getSupRotaTable(SupRotaQueryParam queryParam){ |
|
|
|
|
UserAuth user = UserContextHolder.getCurrentUser(); |
|
|
|
|
|
|
|
|
|
//判断传入的id是市局、还是分局
|
|
|
|
|
SupDepart supDepart = departService.getById(queryParam.getDeptId()); |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject=new JSONObject(); |
|
|
|
|
if(supDepart.getLevel() == 0){ |
|
|
|
|
if (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>().eq(SupRota::getDeptCode,supDepart.getId()).eq(SupRota::getRotaTime,queryParam.getDate())); |
|
|
|
|
@ -43,4 +51,11 @@ public class SupRotaService extends ServiceImpl<SupRotaMapper, SupRota> {
|
|
|
|
|
return jsonObject; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// public JSONObject getSubofficeTable(SupRotaQueryParam queryParam){
|
|
|
|
|
// JSONObject jsonObject =new JSONObject();
|
|
|
|
|
// List<SupRotaVo> supRotaList = baseMapper.getSupRotaList(queryParam.getDate(),queryParam.getDeptId());
|
|
|
|
|
// jsonObject.fluentPut("supRotaList",supRotaList);
|
|
|
|
|
// return jsonObject;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|