Browse Source

首页值班

master
laishajiang 2 years ago
parent
commit
78680b74f2
  1. 7
      mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java
  2. 23
      mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java
  3. 2
      mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java
  4. 14
      mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java
  5. 8
      mailbox-lan/src/main/java/com/biutag/lan/service/IDeptService.java
  6. 86
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java
  7. 18
      mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml

7
mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java

@ -73,6 +73,13 @@ public class DataScreenController {
return AjaxResult.success(dataScreenService.getToDayDuty(params)); return AjaxResult.success(dataScreenService.getToDayDuty(params));
} }
@NotLogin
@GetMapping("/dutyIndex")
@ApiOperation(value="今日值班")
public AjaxResult<Map<String, Object>> dutyIndex() {
return AjaxResult.success(dataScreenService.getToIndexDuty());
}
@NotLogin @NotLogin
@GetMapping("/threeRate") @GetMapping("/threeRate")
@ApiOperation(value="分县市局三率") @ApiOperation(value="分县市局三率")

23
mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONArray;
import com.biutag.aop.NotPower; import com.biutag.aop.NotPower;
import com.biutag.core.AjaxResult; import com.biutag.core.AjaxResult;
import com.biutag.entity.system.Dept; import com.biutag.entity.system.Dept;
import com.biutag.entity.system.Duty;
import com.biutag.lan.service.IDeptService; import com.biutag.lan.service.IDeptService;
import com.biutag.lan.validate.commons.IdValidate; import com.biutag.lan.validate.commons.IdValidate;
import com.biutag.lan.validate.system.DeptCreateValidate; import com.biutag.lan.validate.system.DeptCreateValidate;
@ -18,6 +19,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("api/system/dept") @RequestMapping("api/system/dept")
@ -106,4 +108,25 @@ public class DeptController {
return AjaxResult.success(iDeptService.listCountersign()); return AjaxResult.success(iDeptService.listCountersign());
} }
@NotPower
@GetMapping("/dutyIndex")
@ApiOperation(value="今日值班")
public AjaxResult<Map<String, Object>> dutyIndex() {
return AjaxResult.success(iDeptService.getToIndexDuty());
}
@NotPower
@GetMapping("/getLevel")
@ApiOperation(value="今日值班")
public AjaxResult<Dept> getLevel() {
return AjaxResult.success(iDeptService.getLevel());
}
@NotPower
@GetMapping("/getDuty")
@ApiOperation(value="今日值班")
public AjaxResult<Map<String, Object>> getDuty() {
return AjaxResult.success(iDeptService.getDuty());
}
} }

2
mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java

@ -157,4 +157,6 @@ public interface DataScreenMapper extends BaseMapper<Mail> {
List<Map<String, String>> getOtherSatisfiedRate(); List<Map<String, String>> getOtherSatisfiedRate();
List<Map<String, String>> getOtherResolvedRate(); List<Map<String, String>> getOtherResolvedRate();
List<Duty> getToFjDuty(@Param("depatType") String depatType,@Param("deptId") String deptId);
} }

14
mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java

@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.constants.AppConstants; import com.biutag.constants.AppConstants;
import com.biutag.entity.system.Duty; import com.biutag.entity.system.Duty;
import com.biutag.enums.DeptTypeEnum; import com.biutag.enums.DeptTypeEnum;
import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailMark; import com.biutag.lan.domain.MailMark;
import com.biutag.lan.domain.vo.MailDetail; import com.biutag.lan.domain.vo.MailDetail;
@ -277,6 +278,19 @@ public class DataScreenService extends ServiceImpl<DataScreenMapper, Mail> {
return map; return map;
} }
public Map<String, Object> getToIndexDuty() {
Map<String, Object> map = new HashMap<>();
String deptId = AdminThreadLocal.getDeptId().toString();
List<Duty> dutySjList = baseMapper.getToDayDuty(DeptTypeEnum.SJ_TYPE.getType(), null);
List<Duty> dutyFjList = baseMapper.getToDayDuty(DeptTypeEnum.FJ_TYPE.getType(), deptId);
List<Duty> dutyPcsList = baseMapper.getToDayDuty(DeptTypeEnum.PCS_TYPE.getType(), deptId);
List<Duty> dutyDdList = baseMapper.getToDayDuty(DeptTypeEnum.DD_TYPE.getType(), deptId);
map.put("dutySjList", dutySjList);
map.put("dutyFjList", dutyFjList);
map.put("dutyPcsList", dutyPcsList);
map.put("dutyDdList", dutyDdList);
return map;
}
public MailDetail getMailDetail(Map<String, Object> params) { public MailDetail getMailDetail(Map<String, Object> params) {
MailDetail mailDetail = baseMapper.getMailDetail(params); MailDetail mailDetail = baseMapper.getMailDetail(params);

8
mailbox-lan/src/main/java/com/biutag/lan/service/IDeptService.java

@ -2,6 +2,7 @@ package com.biutag.lan.service;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.biutag.entity.system.Dept; import com.biutag.entity.system.Dept;
import com.biutag.entity.system.Duty;
import com.biutag.lan.validate.system.DeptCreateValidate; import com.biutag.lan.validate.system.DeptCreateValidate;
import com.biutag.lan.validate.system.DeptSearchValidate; import com.biutag.lan.validate.system.DeptSearchValidate;
import com.biutag.lan.validate.system.DeptUpdateValidate; import com.biutag.lan.validate.system.DeptUpdateValidate;
@ -9,6 +10,7 @@ import com.biutag.lan.vo.system.DeptVo;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 系统部门服务接口类 * 系统部门服务接口类
@ -81,4 +83,10 @@ public interface IDeptService {
*/ */
void del(Integer id); void del(Integer id);
Map<String, Object> getToIndexDuty();
Dept getLevel();
Map<String, Object> getDuty();
} }

86
mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java

@ -2,13 +2,17 @@ package com.biutag.lan.service.impl;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; 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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Assert; import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.biutag.constants.AppConstants; import com.biutag.constants.AppConstants;
import com.biutag.entity.setting.DictData; 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.enums.RoleEnum;
import com.biutag.lan.config.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.mapper.DataScreenMapper;
import com.biutag.lan.service.IDeptService; import com.biutag.lan.service.IDeptService;
import com.biutag.lan.validate.system.DeptCreateValidate; import com.biutag.lan.validate.system.DeptCreateValidate;
import com.biutag.lan.validate.system.DeptSearchValidate; 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.mapper.setting.DictDataMapper;
import com.biutag.lan.mapper.PoliceUserMapper; import com.biutag.lan.mapper.PoliceUserMapper;
import com.biutag.mapper.system.DeptMapper; import com.biutag.mapper.system.DeptMapper;
import com.biutag.mapper.system.DutyMapper;
import com.biutag.util.ListUtils; import com.biutag.util.ListUtils;
import com.biutag.util.StringUtils; import com.biutag.util.StringUtils;
import com.biutag.util.TimeUtils; import com.biutag.util.TimeUtils;
@ -44,6 +49,11 @@ class DeptServiceImpl implements IDeptService {
@Resource @Resource
DictDataMapper dictDataMapper; DictDataMapper dictDataMapper;
@Resource
DataScreenMapper dataScreenMapper;
@Resource
DutyMapper dutyMapper;
/** /**
* 岗位所有 * 岗位所有
* *
@ -350,4 +360,80 @@ class DeptServiceImpl implements IDeptService {
deptMapper.updateById(model); 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;
}
} }

18
mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml

@ -226,6 +226,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
order by b.sort asc order by b.sort asc
</select> </select>
<select id="getToFjDuty" resultType="com.biutag.entity.system.Duty">
select distinct on (a.depart_id, a.emp_no,b.sort) a.* from duty a
inner join dept b on a.depart_id=b.id where
now() BETWEEN a.start_time and (to_date(a.end_time) + interval '1 D')
<if test="depatType!=null and depatType!=''">
and a.dept_type=#{depatType}
</if>
<if test="deptId!=null and deptId!=''">
and b.id=#{deptId}
</if>
order by b.sort asc
</select>
<select id="mapCountyData" resultType="java.util.Map" parameterType="java.lang.String"> <select id="mapCountyData" resultType="java.util.Map" parameterType="java.lang.String">
select d.name, a.id, select d.name, a.id,
(select count(1) mailCount from mail c where c.create_time>=CURRENT_DATE and c.three_dept_id=a.id) todaysum , (select count(1) mailCount from mail c where c.create_time>=CURRENT_DATE and c.three_dept_id=a.id) todaysum ,

Loading…
Cancel
Save