Browse Source

fit:值班接口

master
pengwei 7 months ago
parent
commit
d635fb4e5a
  1. 1
      src/main/java/com/biutag/supervision/controller/supRota/SupRotaController.java
  2. 2
      src/main/java/com/biutag/supervision/mapper/ZhkshDutyScheduleDcMapper.java
  3. 4
      src/main/java/com/biutag/supervision/pojo/entity/SupRota.java
  4. 21
      src/main/java/com/biutag/supervision/service/SupRotaService.java
  5. 10
      src/main/java/com/biutag/supervision/service/TaskManagementService.java

1
src/main/java/com/biutag/supervision/controller/supRota/SupRotaController.java

@ -22,4 +22,5 @@ public class SupRotaController {
return Result.success(jsonObject); return Result.success(jsonObject);
} }
} }

2
src/main/java/com/biutag/supervision/mapper/ZhkshDutyScheduleDcMapper.java

@ -12,6 +12,6 @@ import java.util.List;
public interface ZhkshDutyScheduleDcMapper extends BaseMapper<ZhkshDutyScheduleDc> { public interface ZhkshDutyScheduleDcMapper extends BaseMapper<ZhkshDutyScheduleDc> {
@Select(" SELECT * FROM V_ZHKSH_DUTY_SCHEDULE_DC " + @Select(" SELECT * FROM V_ZHKSH_DUTY_SCHEDULE_DC " +
" where start_time between #{startTime} and #{endTime} " + " where start_time between #{startTime} and #{endTime} " +
" and PARENT_POST_CODE = 'zb' ") " and PARENT_POST_CODE = 'ZB' ")
List<ZhkshDutyScheduleDc> selectList(LocalDate startTime,LocalDate endTime); List<ZhkshDutyScheduleDc> selectList(LocalDate startTime,LocalDate endTime);
} }

4
src/main/java/com/biutag/supervision/pojo/entity/SupRota.java

@ -46,6 +46,6 @@ public class SupRota {
@TableField("phone") @TableField("phone")
private String phone; private String phone;
@TableField("schedule_id") // @TableField("schedule_id")
private String scheduleId; // private String scheduleId;
} }

21
src/main/java/com/biutag/supervision/service/SupRotaService.java

@ -3,9 +3,13 @@ package com.biutag.supervision.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.mapper.SupRotaMapper;
import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.entity.SupRota; 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.param.SupRotaQueryParam;
import com.biutag.supervision.pojo.vo.SupRotaVo; import com.biutag.supervision.pojo.vo.SupRotaVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -19,13 +23,17 @@ import java.util.List;
@Service @Service
public class SupRotaService extends ServiceImpl<SupRotaMapper, SupRota> { public class SupRotaService extends ServiceImpl<SupRotaMapper, SupRota> {
private SupDepartService departService; private final SupDepartService departService;
//展示数据的接口 //展示数据的接口
public JSONObject getSupRotaTable(SupRotaQueryParam queryParam){ public JSONObject getSupRotaTable(SupRotaQueryParam queryParam){
UserAuth user = UserContextHolder.getCurrentUser();
//判断传入的id是市局、还是分局 //判断传入的id是市局、还是分局
SupDepart supDepart = departService.getById(queryParam.getDeptId());
JSONObject jsonObject=new JSONObject(); 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())); 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; 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;
// }
} }

10
src/main/java/com/biutag/supervision/service/TaskManagementService.java

@ -79,15 +79,14 @@ public class TaskManagementService {
task.setTaskType("testing_alcohol"); task.setTaskType("testing_alcohol");
if (CollectionUtil.isNotEmpty(dto.getUserList())) { if (CollectionUtil.isNotEmpty(dto.getUserList())) {
Set<String> departIds = dto.getUserList().stream().map(SupTaskTestingAlcoholPeople::getDepartId).collect(Collectors.toSet()); Set<String> departIds = dto.getUserList().stream().map(SupTaskTestingAlcoholPeople::getDepartId).collect(Collectors.toSet());
if(CollectionUtil.isNotEmpty(departIds)){
log.info("departIds:" + String.join(",", departIds)); log.info("departIds:" + String.join(",", departIds));
List<SupDepart> departs = departService.listByIds(departIds); List<SupDepart> departs = departService.listByIds(departIds);
if(CollectionUtil.isNotEmpty(departs)){ if(CollectionUtil.isNotEmpty(departs)){
log.info("departs的长度:" + departs.size()); log.info(departs.stream().map(SupDepart::getShortName).collect(Collectors.joining("、")));
task.setSupDepartName(departs.stream().map(SupDepart::getShortName).collect(Collectors.joining("、"))); task.setSupDepartName(departs.stream().map(SupDepart::getShortName).collect(Collectors.joining("、")));
} }
}else{
}
if(CollectionUtil.isNotEmpty(dto.getUserList())){
Set<String> departList = dto.getUserList().stream().map(SupTaskTestingAlcoholPeople::getDepartName).collect(Collectors.toSet()); Set<String> departList = dto.getUserList().stream().map(SupTaskTestingAlcoholPeople::getDepartName).collect(Collectors.toSet());
if(CollectionUtil.isNotEmpty(departList)){ if(CollectionUtil.isNotEmpty(departList)){
task.setSupDepartName(departList.stream().collect(Collectors.joining("、"))); task.setSupDepartName(departList.stream().collect(Collectors.joining("、")));
@ -95,6 +94,9 @@ public class TaskManagementService {
} }
} }
}
if("重点人员管控".equals(dto.getSpecialType())){ if("重点人员管控".equals(dto.getSpecialType())){
task.setTaskType("risk_personal"); task.setTaskType("risk_personal");
} }

Loading…
Cancel
Save