From 78680b74f228987a672b8c647a2a36e064bffe5a Mon Sep 17 00:00:00 2001 From: laishajiang <12977614+laishajiang@user.noreply.gitee.com> Date: Fri, 22 Mar 2024 17:42:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=80=BC=E7=8F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datascreen/DataScreenController.java | 7 ++ .../lan/controller/system/DeptController.java | 23 +++++ .../biutag/lan/mapper/DataScreenMapper.java | 2 + .../biutag/lan/service/DataScreenService.java | 14 +++ .../com/biutag/lan/service/IDeptService.java | 8 ++ .../lan/service/impl/DeptServiceImpl.java | 86 +++++++++++++++++++ .../resources/mapper/DataScreenMapper.xml | 18 ++++ 7 files changed, 158 insertions(+) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java index f269969..9f1cc90 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java +++ b/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)); } + @NotLogin + @GetMapping("/dutyIndex") + @ApiOperation(value="今日值班") + public AjaxResult> dutyIndex() { + return AjaxResult.success(dataScreenService.getToIndexDuty()); + } + @NotLogin @GetMapping("/threeRate") @ApiOperation(value="分县市局三率") diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java index eb66b8e..4846a08 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java +++ b/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.core.AjaxResult; import com.biutag.entity.system.Dept; +import com.biutag.entity.system.Duty; import com.biutag.lan.service.IDeptService; import com.biutag.lan.validate.commons.IdValidate; import com.biutag.lan.validate.system.DeptCreateValidate; @@ -18,6 +19,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Map; @RestController @RequestMapping("api/system/dept") @@ -106,4 +108,25 @@ public class DeptController { return AjaxResult.success(iDeptService.listCountersign()); } + @NotPower + @GetMapping("/dutyIndex") + @ApiOperation(value="今日值班") + public AjaxResult> dutyIndex() { + return AjaxResult.success(iDeptService.getToIndexDuty()); + } + + @NotPower + @GetMapping("/getLevel") + @ApiOperation(value="今日值班") + public AjaxResult getLevel() { + return AjaxResult.success(iDeptService.getLevel()); + } + + @NotPower + @GetMapping("/getDuty") + @ApiOperation(value="今日值班") + public AjaxResult> getDuty() { + return AjaxResult.success(iDeptService.getDuty()); + } + } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java b/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java index ae73967..f64eb47 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java @@ -157,4 +157,6 @@ public interface DataScreenMapper extends BaseMapper { List> getOtherSatisfiedRate(); List> getOtherResolvedRate(); + + List getToFjDuty(@Param("depatType") String depatType,@Param("deptId") String deptId); } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java index f246613..496f1e1 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java +++ b/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.entity.system.Duty; import com.biutag.enums.DeptTypeEnum; +import com.biutag.lan.config.AdminThreadLocal; import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.MailMark; import com.biutag.lan.domain.vo.MailDetail; @@ -277,6 +278,19 @@ public class DataScreenService extends ServiceImpl { return map; } + public Map getToIndexDuty() { + Map map = new HashMap<>(); + String deptId = AdminThreadLocal.getDeptId().toString(); + List dutySjList = baseMapper.getToDayDuty(DeptTypeEnum.SJ_TYPE.getType(), null); + List dutyFjList = baseMapper.getToDayDuty(DeptTypeEnum.FJ_TYPE.getType(), deptId); + List dutyPcsList = baseMapper.getToDayDuty(DeptTypeEnum.PCS_TYPE.getType(), deptId); + List 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 params) { MailDetail mailDetail = baseMapper.getMailDetail(params); diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/IDeptService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/IDeptService.java index 49d27d9..c3aa8f2 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/IDeptService.java +++ b/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.biutag.entity.system.Dept; +import com.biutag.entity.system.Duty; import com.biutag.lan.validate.system.DeptCreateValidate; import com.biutag.lan.validate.system.DeptSearchValidate; 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.List; +import java.util.Map; /** * 系统部门服务接口类 @@ -81,4 +83,10 @@ public interface IDeptService { */ void del(Integer id); + Map getToIndexDuty(); + + + Dept getLevel(); + + Map getDuty(); } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java index 9280bf3..27ee0f5 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DeptServiceImpl.java +++ b/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.JSONObject; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Assert; import com.biutag.constants.AppConstants; 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.lan.config.AdminThreadLocal; +import com.biutag.lan.mapper.DataScreenMapper; import com.biutag.lan.service.IDeptService; import com.biutag.lan.validate.system.DeptCreateValidate; 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.lan.mapper.PoliceUserMapper; import com.biutag.mapper.system.DeptMapper; +import com.biutag.mapper.system.DutyMapper; import com.biutag.util.ListUtils; import com.biutag.util.StringUtils; import com.biutag.util.TimeUtils; @@ -44,6 +49,11 @@ class DeptServiceImpl implements IDeptService { @Resource DictDataMapper dictDataMapper; + @Resource + DataScreenMapper dataScreenMapper; + + @Resource + DutyMapper dutyMapper; /** * 岗位所有 * @@ -350,4 +360,80 @@ class DeptServiceImpl implements IDeptService { deptMapper.updateById(model); } + @Override + public Map getToIndexDuty() { + Map map = new HashMap<>(); + String deptId = AdminThreadLocal.getDeptId().toString(); + Dept dept = deptMapper.selectById(deptId); + List dutyFjList = null; + List dutySjList = null; + List dutyPcsList = null; + List dutyDdList = null; + + if (dept.getLevel()==2){ + Duty duty = dutyMapper.selectOne(new QueryWrapper().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().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().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 getDuty() { + Map 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; + } + + } \ No newline at end of file diff --git a/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml b/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml index 75976a5..b180641 100644 --- a/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml +++ b/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml @@ -226,6 +226,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by b.sort asc + + + + + + +