Browse Source

add 交接班、值班报告、首页资源数量统计

459242451@qq.com 3 years ago
parent
commit
530b1279b3
43 changed files with 911 additions and 458 deletions
  1. 0 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java
  2. 0 4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java
  3. 11 17
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
  4. 0 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
  5. 0 7
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
  6. 0 6
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
  7. 0 6
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
  8. 0 7
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
  9. 0 5
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
  10. 13 26
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
  11. 0 6
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
  12. 0 14
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
  13. 0 12
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
  14. 0 5
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ChemicalDataController.java
  15. 23 24
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/DutyEmpController.java
  16. 79 15
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/DutyReportController.java
  17. 70 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/DutyReportRecordController.java
  18. 0 4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/IncidentController.java
  19. 23 23
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/IncidentProcessController.java
  20. 0 5
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/PlanController.java
  21. 22 23
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/PlanTaskController.java
  22. 0 4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ResourceController.java
  23. 0 6
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ResourceDetailController.java
  24. 0 6
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/SingleDeviceController.java
  25. 24 46
      ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
  26. 21 25
      ruoyi-generator/src/main/resources/vm/java/controller.java.vm
  27. 26 51
      ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java
  28. 12 20
      ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java
  29. 15 7
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/DutyReport.java
  30. 82 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/DutyReportRecord.java
  31. 0 2
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/Resource.java
  32. 10 7
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/DutyReportBo.java
  33. 69 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/DutyReportRecordBo.java
  34. 0 2
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/ResourceBo.java
  35. 62 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/vo/DutyReportRecordVo.java
  36. 8 7
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/vo/DutyReportVo.java
  37. 0 2
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/vo/ResourceVo.java
  38. 14 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/mapper/DutyReportRecordMapper.java
  39. 61 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/IDutyReportRecordService.java
  40. 46 38
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/IDutyReportService.java
  41. 93 0
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/DutyReportRecordServiceImpl.java
  42. 109 23
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/DutyReportServiceImpl.java
  43. 18 0
      ruoyi-zhdd/src/main/resources/mapper/zhdd/DutyReportRecordMapper.xml

+ 0 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java

@@ -26,7 +26,6 @@ public class CacheController {
     @Autowired
     private RedisTemplate<String, String> redisTemplate;
 
-    //    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
     @GetMapping()
     public AjaxResult getInfo() throws Exception {
         Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info());

+ 0 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java

@@ -29,28 +29,24 @@ public class SysLogininforController extends BaseController {
     @Autowired
     private ISysLogininforService logininforService;
 
-    //    @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysLogininfor logininfor) {
         return logininforService.selectPageLogininforList(logininfor);
     }
 
     @Log(title = "登录日志", businessType = BusinessType.EXPORT)
-//    @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')")
     @GetMapping("/export")
     public void export(SysLogininfor logininfor, HttpServletResponse response) {
         List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
         ExcelUtil.exportExcel(list, "登录日志", SysLogininfor.class, response);
     }
 
-    //    @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
     @Log(title = "登录日志", businessType = BusinessType.DELETE)
     @DeleteMapping("/{infoIds}")
     public AjaxResult remove(@PathVariable Long[] infoIds) {
         return toAjax(logininforService.deleteLogininforByIds(infoIds));
     }
 
-    //    @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
     @Log(title = "登录日志", businessType = BusinessType.CLEAN)
     @DeleteMapping("/clean")
     public AjaxResult clean() {

+ 11 - 17
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java

@@ -9,8 +9,11 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.system.domain.SysOperLog;
 import com.ruoyi.system.service.ISysOperLogService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.List;
@@ -22,40 +25,31 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/monitor/operlog")
-public class SysOperlogController extends BaseController
-{
+public class SysOperlogController extends BaseController {
     @Autowired
     private ISysOperLogService operLogService;
 
-    @PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
     @GetMapping("/list")
-    public TableDataInfo list(SysOperLog operLog)
-    {
+    public TableDataInfo list(SysOperLog operLog) {
         return operLogService.selectPageOperLogList(operLog);
     }
 
     @Log(title = "操作日志", businessType = BusinessType.EXPORT)
-    @PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
     @GetMapping("/export")
-    public void export(SysOperLog operLog, HttpServletResponse response)
-    {
+    public void export(SysOperLog operLog, HttpServletResponse response) {
         List<SysOperLog> list = operLogService.selectOperLogList(operLog);
-		ExcelUtil.exportExcel(list, "操作日志", SysOperLog.class, response);
+        ExcelUtil.exportExcel(list, "操作日志", SysOperLog.class, response);
     }
 
     @Log(title = "操作日志", businessType = BusinessType.DELETE)
-    @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
     @DeleteMapping("/{operIds}")
-    public AjaxResult remove(@PathVariable Long[] operIds)
-    {
+    public AjaxResult remove(@PathVariable Long[] operIds) {
         return toAjax(operLogService.deleteOperLogByIds(operIds));
     }
 
     @Log(title = "操作日志", businessType = BusinessType.CLEAN)
-    @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
     @DeleteMapping("/clean")
-    public AjaxResult clean()
-    {
+    public AjaxResult clean() {
         operLogService.cleanOperLog();
         return AjaxResult.success();
     }

+ 0 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java

@@ -35,7 +35,6 @@ public class SysUserOnlineController extends BaseController {
     @Autowired
     private ISysUserOnlineService userOnlineService;
 
-    //    @PreAuthorize("@ss.hasPermi('monitor:online:list')")
     @GetMapping("/list")
     public TableDataInfo list(String ipaddr, String userName) {
         Collection<String> keys = RedisUtils.keys(Constants.LOGIN_TOKEN_KEY + "*");
@@ -66,7 +65,6 @@ public class SysUserOnlineController extends BaseController {
     /**
      * 强退用户
      */
-//    @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
     @Log(title = "在线用户", businessType = BusinessType.FORCE)
     @DeleteMapping("/{tokenId}")
     public AjaxResult forceLogout(@PathVariable String tokenId) {

+ 0 - 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java

@@ -38,14 +38,12 @@ public class SysConfigController extends BaseController {
     /**
      * 获取参数配置列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:config:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysConfig config) {
         return configService.selectPageConfigList(config);
     }
 
     @Log(title = "参数管理", businessType = BusinessType.EXPORT)
-//    @PreAuthorize("@ss.hasPermi('system:config:export')")
     @GetMapping("/export")
     public void export(SysConfig config, HttpServletResponse response) {
         List<SysConfig> list = configService.selectConfigList(config);
@@ -55,7 +53,6 @@ public class SysConfigController extends BaseController {
     /**
      * 根据参数编号获取详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('system:config:query')")
     @GetMapping(value = "/{configId}")
     public AjaxResult getInfo(@PathVariable Long configId) {
         return AjaxResult.success(configService.selectConfigById(configId));
@@ -72,7 +69,6 @@ public class SysConfigController extends BaseController {
     /**
      * 新增参数配置
      */
-//    @PreAuthorize("@ss.hasPermi('system:config:add')")
     @Log(title = "参数管理", businessType = BusinessType.INSERT)
     @PostMapping
     @RepeatSubmit
@@ -87,7 +83,6 @@ public class SysConfigController extends BaseController {
     /**
      * 修改参数配置
      */
-//    @PreAuthorize("@ss.hasPermi('system:config:edit')")
     @Log(title = "参数管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@Validated @RequestBody SysConfig config) {
@@ -101,7 +96,6 @@ public class SysConfigController extends BaseController {
     /**
      * 删除参数配置
      */
-//    @PreAuthorize("@ss.hasPermi('system:config:remove')")
     @Log(title = "参数管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{configIds}")
     public AjaxResult remove(@PathVariable Long[] configIds) {
@@ -112,7 +106,6 @@ public class SysConfigController extends BaseController {
     /**
      * 刷新参数缓存
      */
-//    @PreAuthorize("@ss.hasPermi('system:config:remove')")
     @Log(title = "参数管理", businessType = BusinessType.CLEAN)
     @DeleteMapping("/refreshCache")
     public AjaxResult refreshCache() {

+ 0 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java

@@ -42,7 +42,6 @@ public class SysDeptController extends BaseController {
     /**
      * 获取部门列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:dept:list')")
     @GetMapping("/list")
     public AjaxResult list(SysDept dept) {
         List<SysDept> depts = deptService.selectDeptList(dept);
@@ -52,7 +51,6 @@ public class SysDeptController extends BaseController {
     /**
      * 查询部门列表(排除节点)
      */
-//    @PreAuthorize("@ss.hasPermi('system:dept:list')")
     @GetMapping("/list/exclude/{deptId}")
     public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) String deptId) {
         List<SysDept> depts = deptService.selectDeptList(new SysDept());
@@ -64,7 +62,6 @@ public class SysDeptController extends BaseController {
     /**
      * 根据部门编号获取详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('system:dept:query')")
     @GetMapping(value = "/{deptId}")
     public AjaxResult getInfo(@PathVariable String deptId) {
 //        deptService.checkDeptDataScope(deptId);
@@ -95,7 +92,6 @@ public class SysDeptController extends BaseController {
     /**
      * 新增部门
      */
-//    @PreAuthorize("@ss.hasPermi('system:dept:add')")
     @Log(title = "部门管理", businessType = BusinessType.INSERT)
     @PostMapping
     @Security
@@ -110,7 +106,6 @@ public class SysDeptController extends BaseController {
     /**
      * 修改部门
      */
-//    @PreAuthorize("@ss.hasPermi('system:dept:edit')")
     @Log(title = "部门管理", businessType = BusinessType.UPDATE)
     @PutMapping
     @Security
@@ -130,7 +125,6 @@ public class SysDeptController extends BaseController {
     /**
      * 删除部门
      */
-//    @PreAuthorize("@ss.hasPermi('system:dept:remove')")
     @Log(title = "部门管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{deptId}")
     @Security

+ 0 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java

@@ -39,14 +39,12 @@ public class SysDictDataController extends BaseController {
     @Autowired
     private ISysDictTypeService dictTypeService;
 
-    //    @PreAuthorize("@ss.hasPermi('system:dict:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysDictData dictData) {
         return dictDataService.selectPageDictDataList(dictData);
     }
 
     @Log(title = "字典数据", businessType = BusinessType.EXPORT)
-//    @PreAuthorize("@ss.hasPermi('system:dict:export')")
     @GetMapping("/export")
     public void export(SysDictData dictData, HttpServletResponse response) {
         List<SysDictData> list = dictDataService.selectDictDataList(dictData);
@@ -56,7 +54,6 @@ public class SysDictDataController extends BaseController {
     /**
      * 查询字典数据详细
      */
-//    @PreAuthorize("@ss.hasPermi('system:dict:query')")
     @GetMapping(value = "/{dictCode}")
     public AjaxResult getInfo(@PathVariable Long dictCode) {
         return AjaxResult.success(dictDataService.selectDictDataById(dictCode));
@@ -77,7 +74,6 @@ public class SysDictDataController extends BaseController {
     /**
      * 新增字典类型
      */
-//    @PreAuthorize("@ss.hasPermi('system:dict:add')")
     @Log(title = "字典数据", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@Validated @RequestBody SysDictData dict) {
@@ -88,7 +84,6 @@ public class SysDictDataController extends BaseController {
     /**
      * 修改保存字典类型
      */
-//    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
     @Log(title = "字典数据", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@Validated @RequestBody SysDictData dict) {
@@ -99,7 +94,6 @@ public class SysDictDataController extends BaseController {
     /**
      * 删除字典类型
      */
-//    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
     @Log(title = "字典类型", businessType = BusinessType.DELETE)
     @DeleteMapping("/{dictCodes}")
     public AjaxResult remove(@PathVariable Long[] dictCodes) {

+ 0 - 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java

@@ -34,14 +34,12 @@ public class SysDictTypeController extends BaseController {
     @Autowired
     private ISysDictTypeService dictTypeService;
 
-    //    @PreAuthorize("@ss.hasPermi('system:dict:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysDictType dictType) {
         return dictTypeService.selectPageDictTypeList(dictType);
     }
 
     @Log(title = "字典类型", businessType = BusinessType.EXPORT)
-//    @PreAuthorize("@ss.hasPermi('system:dict:export')")
     @GetMapping("/export")
     public void export(SysDictType dictType, HttpServletResponse response) {
         List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
@@ -51,7 +49,6 @@ public class SysDictTypeController extends BaseController {
     /**
      * 查询字典类型详细
      */
-//    @PreAuthorize("@ss.hasPermi('system:dict:query')")
     @GetMapping(value = "/{dictId}")
     public AjaxResult getInfo(@PathVariable Long dictId) {
         return AjaxResult.success(dictTypeService.selectDictTypeById(dictId));
@@ -60,7 +57,6 @@ public class SysDictTypeController extends BaseController {
     /**
      * 新增字典类型
      */
-//    @PreAuthorize("@ss.hasPermi('system:dict:add')")
     @Log(title = "字典类型", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@Validated @RequestBody SysDictType dict) {
@@ -74,7 +70,6 @@ public class SysDictTypeController extends BaseController {
     /**
      * 修改字典类型
      */
-//    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
     @Log(title = "字典类型", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@Validated @RequestBody SysDictType dict) {
@@ -88,7 +83,6 @@ public class SysDictTypeController extends BaseController {
     /**
      * 删除字典类型
      */
-//    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
     @Log(title = "字典类型", businessType = BusinessType.DELETE)
     @DeleteMapping("/{dictIds}")
     public AjaxResult remove(@PathVariable Long[] dictIds) {
@@ -99,7 +93,6 @@ public class SysDictTypeController extends BaseController {
     /**
      * 刷新字典缓存
      */
-//    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
     @Log(title = "字典类型", businessType = BusinessType.CLEAN)
     @DeleteMapping("/refreshCache")
     public AjaxResult refreshCache() {

+ 0 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java

@@ -38,7 +38,6 @@ public class SysMenuController extends BaseController {
     /**
      * 获取菜单列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:menu:list')")
     @GetMapping("/list")
     @Security
     public AjaxResult list(SysMenu menu) {
@@ -49,7 +48,6 @@ public class SysMenuController extends BaseController {
     /**
      * 根据菜单编号获取详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('system:menu:query')")
     @GetMapping(value = "/{menuId}")
     public AjaxResult getInfo(@PathVariable String menuId) {
         return AjaxResult.success(menuService.selectMenuById(menuId));
@@ -81,7 +79,6 @@ public class SysMenuController extends BaseController {
     /**
      * 新增菜单
      */
-//    @PreAuthorize("@ss.hasPermi('system:menu:add')")
     @Log(title = "菜单管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@Validated @RequestBody SysMenu menu) {
@@ -97,7 +94,6 @@ public class SysMenuController extends BaseController {
     /**
      * 修改菜单
      */
-//    @PreAuthorize("@ss.hasPermi('system:menu:edit')")
     @Log(title = "菜单管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@Validated @RequestBody SysMenu menu) {
@@ -115,7 +111,6 @@ public class SysMenuController extends BaseController {
     /**
      * 删除菜单
      */
-//    @PreAuthorize("@ss.hasPermi('system:menu:remove')")
     @Log(title = "菜单管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{menuId}")
     public AjaxResult remove(@PathVariable("menuId") String menuId) {

+ 13 - 26
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java

@@ -1,8 +1,13 @@
 package com.ruoyi.web.controller.system;
 
-import java.util.List;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.SysNotice;
+import com.ruoyi.system.service.ISysNoticeService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -12,13 +17,6 @@ import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
-import com.ruoyi.common.annotation.Log;
-import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.page.TableDataInfo;
-import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.system.domain.SysNotice;
-import com.ruoyi.system.service.ISysNoticeService;
 
 /**
  * 公告 信息操作处理
@@ -27,39 +25,32 @@ import com.ruoyi.system.service.ISysNoticeService;
  */
 @RestController
 @RequestMapping("/system/notice")
-public class SysNoticeController extends BaseController
-{
+public class SysNoticeController extends BaseController {
     @Autowired
     private ISysNoticeService noticeService;
 
     /**
      * 获取通知公告列表
      */
-    @PreAuthorize("@ss.hasPermi('system:notice:list')")
     @GetMapping("/list")
-    public TableDataInfo list(SysNotice notice)
-    {
+    public TableDataInfo list(SysNotice notice) {
         return noticeService.selectPageNoticeList(notice);
     }
 
     /**
      * 根据通知公告编号获取详细信息
      */
-    @PreAuthorize("@ss.hasPermi('system:notice:query')")
     @GetMapping(value = "/{noticeId}")
-    public AjaxResult getInfo(@PathVariable Long noticeId)
-    {
+    public AjaxResult getInfo(@PathVariable Long noticeId) {
         return AjaxResult.success(noticeService.selectNoticeById(noticeId));
     }
 
     /**
      * 新增通知公告
      */
-    @PreAuthorize("@ss.hasPermi('system:notice:add')")
     @Log(title = "通知公告", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@Validated @RequestBody SysNotice notice)
-    {
+    public AjaxResult add(@Validated @RequestBody SysNotice notice) {
         notice.setCreateBy(getUsername());
         return toAjax(noticeService.insertNotice(notice));
     }
@@ -67,11 +58,9 @@ public class SysNoticeController extends BaseController
     /**
      * 修改通知公告
      */
-    @PreAuthorize("@ss.hasPermi('system:notice:edit')")
     @Log(title = "通知公告", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@Validated @RequestBody SysNotice notice)
-    {
+    public AjaxResult edit(@Validated @RequestBody SysNotice notice) {
         notice.setUpdateBy(getUsername());
         return toAjax(noticeService.updateNotice(notice));
     }
@@ -79,11 +68,9 @@ public class SysNoticeController extends BaseController
     /**
      * 删除通知公告
      */
-    @PreAuthorize("@ss.hasPermi('system:notice:remove')")
     @Log(title = "通知公告", businessType = BusinessType.DELETE)
     @DeleteMapping("/{noticeIds}")
-    public AjaxResult remove(@PathVariable Long[] noticeIds)
-    {
+    public AjaxResult remove(@PathVariable Long[] noticeIds) {
         return toAjax(noticeService.deleteNoticeByIds(noticeIds));
     }
 }

+ 0 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java

@@ -37,14 +37,12 @@ public class SysPostController extends BaseController {
     /**
      * 获取岗位列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:post:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysPost post) {
         return postService.selectPagePostList(post);
     }
 
     @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
-//    @PreAuthorize("@ss.hasPermi('system:post:export')")
     @GetMapping("/export")
     public void export(SysPost post, HttpServletResponse response) {
         List<SysPost> list = postService.selectPostList(post);
@@ -54,7 +52,6 @@ public class SysPostController extends BaseController {
     /**
      * 根据岗位编号获取详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('system:post:query')")
     @GetMapping(value = "/{postId}")
     public AjaxResult getInfo(@PathVariable Long postId) {
         return AjaxResult.success(postService.selectPostById(postId));
@@ -63,7 +60,6 @@ public class SysPostController extends BaseController {
     /**
      * 新增岗位
      */
-//    @PreAuthorize("@ss.hasPermi('system:post:add')")
     @Log(title = "岗位管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@Validated @RequestBody SysPost post) {
@@ -79,7 +75,6 @@ public class SysPostController extends BaseController {
     /**
      * 修改岗位
      */
-//    @PreAuthorize("@ss.hasPermi('system:post:edit')")
     @Log(title = "岗位管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@Validated @RequestBody SysPost post) {
@@ -95,7 +90,6 @@ public class SysPostController extends BaseController {
     /**
      * 删除岗位
      */
-//    @PreAuthorize("@ss.hasPermi('system:post:remove')")
     @Log(title = "岗位管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{postIds}")
     public AjaxResult remove(@PathVariable Long[] postIds) {

+ 0 - 14
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java

@@ -50,14 +50,12 @@ public class SysRoleController extends BaseController {
     @Autowired
     private ISysUserService userService;
 
-    //    @PreAuthorize("@ss.hasPermi('system:role:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysRole role) {
         return roleService.selectPageRoleList(role);
     }
 
     @Log(title = "角色管理", businessType = BusinessType.EXPORT)
-//    @PreAuthorize("@ss.hasPermi('system:role:export')")
     @GetMapping("/export")
     public void export(SysRole role, HttpServletResponse response) {
         List<SysRole> list = roleService.selectRoleList(role);
@@ -67,7 +65,6 @@ public class SysRoleController extends BaseController {
     /**
      * 根据角色编号获取详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:query')")
     @GetMapping(value = "/{roleId}")
     public AjaxResult getInfo(@PathVariable String roleId) {
 //        roleService.checkRoleDataScope(roleId);
@@ -77,7 +74,6 @@ public class SysRoleController extends BaseController {
     /**
      * 新增角色
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:add')")
     @Log(title = "角色管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@Validated @RequestBody SysRole role) {
@@ -94,7 +90,6 @@ public class SysRoleController extends BaseController {
     /**
      * 修改保存角色
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@Validated @RequestBody SysRole role) {
@@ -122,7 +117,6 @@ public class SysRoleController extends BaseController {
     /**
      * 修改保存数据权限
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.UPDATE)
     @PutMapping("/dataScope")
     public AjaxResult dataScope(@RequestBody SysRole role) {
@@ -133,7 +127,6 @@ public class SysRoleController extends BaseController {
     /**
      * 状态修改
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.UPDATE)
     @PutMapping("/changeStatus")
     public AjaxResult changeStatus(@RequestBody SysRole role) {
@@ -145,7 +138,6 @@ public class SysRoleController extends BaseController {
     /**
      * 删除角色
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:remove')")
     @Log(title = "角色管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{roleIds}")
     public AjaxResult remove(@PathVariable String[] roleIds) {
@@ -155,7 +147,6 @@ public class SysRoleController extends BaseController {
     /**
      * 获取角色选择框列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:query')")
     @GetMapping("/optionselect")
     public AjaxResult optionselect() {
         return AjaxResult.success(roleService.selectRoleAll());
@@ -164,7 +155,6 @@ public class SysRoleController extends BaseController {
     /**
      * 查询已分配用户角色列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:list')")
     @GetMapping("/authUser/allocatedList")
     public TableDataInfo allocatedList(SysUser user) {
         return userService.selectAllocatedList(user);
@@ -173,7 +163,6 @@ public class SysRoleController extends BaseController {
     /**
      * 查询未分配用户角色列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:list')")
     @GetMapping("/authUser/unallocatedList")
     public TableDataInfo unallocatedList(SysUser user) {
         return userService.selectUnallocatedList(user);
@@ -182,7 +171,6 @@ public class SysRoleController extends BaseController {
     /**
      * 取消授权用户
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.GRANT)
     @PutMapping("/authUser/cancel")
     public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) {
@@ -192,7 +180,6 @@ public class SysRoleController extends BaseController {
     /**
      * 批量取消授权用户
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.GRANT)
     @PutMapping("/authUser/cancelAll")
     public AjaxResult cancelAuthUserAll(String roleId, String[] userIds) {
@@ -202,7 +189,6 @@ public class SysRoleController extends BaseController {
     /**
      * 批量选择用户授权
      */
-//    @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.GRANT)
     @PutMapping("/authUser/selectAll")
     public AjaxResult selectAuthUserAll(String roleId, String[] userIds) {

+ 0 - 12
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -39,7 +39,6 @@ import com.ruoyi.zhdd.service.IResourceService;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -78,14 +77,12 @@ public class SysUserController extends BaseController {
     /**
      * 获取用户列表
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/list")
     public TableDataInfo list(SysUser user) {
         return userService.selectPageUserList(user);
     }
 
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
-    @PreAuthorize("@ss.hasPermi('system:user:export')")
     @GetMapping("/export")
     public void export(SysUser user, HttpServletResponse response) {
         List<SysUser> list = userService.selectUserList(user);
@@ -102,7 +99,6 @@ public class SysUserController extends BaseController {
     }
 
     @Log(title = "用户管理", businessType = BusinessType.IMPORT)
-    @PreAuthorize("@ss.hasPermi('system:user:import')")
     @PostMapping("/importData")
     public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
         List<SysUserImportVo> userListVo = ExcelUtil.importExcel(file.getInputStream(), SysUserImportVo.class);
@@ -120,7 +116,6 @@ public class SysUserController extends BaseController {
     /**
      * 根据用户编号获取详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:query')")
     @GetMapping(value = {"/", "/{userId}"})
     public AjaxResult getInfo(@PathVariable(value = "userId", required = false) String userId) {
 //        userService.checkUserDataScope(userId);
@@ -141,7 +136,6 @@ public class SysUserController extends BaseController {
     /**
      * 新增用户
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:add')")
 //    @Log(title = "用户管理", businessType = BusinessType.INSERT)
 //    @PostMapping
 //    public AjaxResult add(@Validated @RequestBody SysUser user) {
@@ -162,7 +156,6 @@ public class SysUserController extends BaseController {
     /**
      * 修改用户
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping
     @Security
@@ -182,7 +175,6 @@ public class SysUserController extends BaseController {
     /**
      * 删除用户
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @Log(title = "用户管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{userIds}")
     @Security
@@ -196,7 +188,6 @@ public class SysUserController extends BaseController {
     /**
      * 重置密码
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping("/resetPwd")
     public AjaxResult resetPwd(@RequestBody SysUser user) {
@@ -209,7 +200,6 @@ public class SysUserController extends BaseController {
     /**
      * 状态修改
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping("/changeStatus")
     public AjaxResult changeStatus(@RequestBody SysUser user) {
@@ -221,7 +211,6 @@ public class SysUserController extends BaseController {
     /**
      * 根据用户编号获取授权角色
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:query')")
     @GetMapping("/authRole/{userId}")
     public AjaxResult authRole(@PathVariable("userId") String userId) {
         SysUser user = userService.selectUserById(userId);
@@ -235,7 +224,6 @@ public class SysUserController extends BaseController {
     /**
      * 用户授权角色
      */
-//    @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.GRANT)
     @PutMapping("/authRole")
     @Security

+ 0 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ChemicalDataController.java

@@ -17,7 +17,6 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -68,7 +67,6 @@ public class ChemicalDataController extends BaseController {
      * 导出危化品信息列表
      */
     @ApiOperation("导出危化品信息列表")
-    @PreAuthorize("@ss.hasPermi('zhdd:chemicalData:export')")
     @Log(title = "危化品信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public void export(@Validated ChemicalDataBo bo, HttpServletResponse response) {
@@ -90,7 +88,6 @@ public class ChemicalDataController extends BaseController {
      * 新增危化品信息
      */
     @ApiOperation("新增危化品信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:chemicalData:add')")
     @Log(title = "危化品信息", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
@@ -102,7 +99,6 @@ public class ChemicalDataController extends BaseController {
      * 修改危化品信息
      */
     @ApiOperation("修改危化品信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:chemicalData:edit')")
     @Log(title = "危化品信息", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
@@ -114,7 +110,6 @@ public class ChemicalDataController extends BaseController {
      * 删除危化品信息
      */
     @ApiOperation("删除危化品信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:chemicalData:remove')")
     @Log(title = "危化品信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")

+ 23 - 24
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/DutyEmpController.java

@@ -1,20 +1,8 @@
 package com.ruoyi.web.controller.zhdd;
 
-import java.util.List;
-import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
-
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.ruoyi.zhdd.domain.DutyEmp;
-import lombok.RequiredArgsConstructor;
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.constraints.*;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.validation.annotation.Validated;
-import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.validate.AddGroup;
@@ -22,12 +10,29 @@ import com.ruoyi.common.core.validate.EditGroup;
 import com.ruoyi.common.core.validate.QueryGroup;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.zhdd.domain.vo.DutyEmpVo;
+import com.ruoyi.zhdd.domain.DutyEmp;
 import com.ruoyi.zhdd.domain.bo.DutyEmpBo;
+import com.ruoyi.zhdd.domain.vo.DutyEmpVo;
 import com.ruoyi.zhdd.service.IDutyEmpService;
-import com.ruoyi.common.core.page.TableDataInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * 值班排班信息Controller
@@ -48,7 +53,6 @@ public class DutyEmpController extends BaseController {
      * 查询值班排班信息列表
      */
     @ApiOperation("查询值班排班信息列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyEmp:list')")
     @GetMapping("/list")
     public AjaxResult<List<DutyEmpVo>> list(@Validated(QueryGroup.class) DutyEmpBo bo) {
         return AjaxResult.success(iDutyEmpService.listVo(Wrappers.<DutyEmp>lambdaQuery().orderByAsc(DutyEmp::getPeriod)));
@@ -58,7 +62,6 @@ public class DutyEmpController extends BaseController {
      * 导出值班排班信息列表
      */
     @ApiOperation("导出值班排班信息列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyEmp:export')")
     @Log(title = "值班排班信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public void export(@Validated DutyEmpBo bo, HttpServletResponse response) {
@@ -70,10 +73,9 @@ public class DutyEmpController extends BaseController {
      * 获取值班排班信息详细信息
      */
     @ApiOperation("获取值班排班信息详细信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyEmp:query')")
     @GetMapping("/{id}")
     public AjaxResult<DutyEmpVo> getInfo(@NotNull(message = "主键不能为空")
-                                                  @PathVariable("id") String id) {
+                                         @PathVariable("id") String id) {
         return AjaxResult.success(iDutyEmpService.queryById(id));
     }
 
@@ -81,7 +83,6 @@ public class DutyEmpController extends BaseController {
      * 新增值班排班信息
      */
     @ApiOperation("新增值班排班信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyEmp:add')")
     @Log(title = "值班排班信息", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
@@ -93,7 +94,6 @@ public class DutyEmpController extends BaseController {
      * 修改值班排班信息
      */
     @ApiOperation("修改值班排班信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyEmp:edit')")
     @Log(title = "值班排班信息", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
@@ -105,11 +105,10 @@ public class DutyEmpController extends BaseController {
      * 删除值班排班信息
      */
     @ApiOperation("删除值班排班信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyEmp:remove')")
-    @Log(title = "值班排班信息" , businessType = BusinessType.DELETE)
+    @Log(title = "值班排班信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
-                                       @PathVariable String[] ids) {
+                                   @PathVariable String[] ids) {
         return toAjax(iDutyEmpService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
     }
 }

+ 79 - 15
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/DutyReportController.java

@@ -1,18 +1,27 @@
 package com.ruoyi.web.controller.zhdd;
 
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
+import com.ruoyi.common.annotation.Security;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.domain.GatewayUser;
+import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.core.validate.AddGroup;
 import com.ruoyi.common.core.validate.EditGroup;
 import com.ruoyi.common.core.validate.QueryGroup;
 import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.UserUtil;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.zhdd.domain.DutyReport;
+import com.ruoyi.zhdd.domain.DutyReportRecord;
 import com.ruoyi.zhdd.domain.bo.DutyReportBo;
+import com.ruoyi.zhdd.domain.vo.DutyReportRecordVo;
 import com.ruoyi.zhdd.domain.vo.DutyReportVo;
+import com.ruoyi.zhdd.service.IDutyReportRecordService;
 import com.ruoyi.zhdd.service.IDutyReportService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -32,7 +41,9 @@ import javax.servlet.http.HttpServletResponse;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
+import java.util.Set;
 
 /**
  * 值班报告信息Controller
@@ -48,22 +59,59 @@ import java.util.List;
 public class DutyReportController extends BaseController {
 
     private final IDutyReportService iDutyReportService;
+    private final IDutyReportRecordService dutyReportRecordService;
 
-    /**
-     * 查询值班报告信息列表
-     */
     @ApiOperation("查询值班报告信息列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyReport:list')")
     @GetMapping("/list")
+    @Security
     public TableDataInfo<DutyReportVo> list(@Validated(QueryGroup.class) DutyReportBo bo) {
+        // 根据当前用户的角色
+        LoginUser cacheLoginUser = UserUtil.getCacheLoginUser();
+        // 查询角色如果包含admin的,直接查询全部
+        Set<String> userRole = cacheLoginUser.getUserRole();
+        boolean admin = CollUtil.containsAny(userRole, CollUtil.newHashSet("admin"));
+        if (!admin) {
+            bo.setCreateBy(cacheLoginUser.getUsername());
+        }
         return iDutyReportService.queryPageList(bo);
     }
 
+    @ApiOperation("查询当前登录人员是否有未交班的报告")
+    @GetMapping("/queryUnSubmitReport")
+    @Security
+    public AjaxResult queryUnSubmitReport() {
+        LoginUser cacheLoginUser = UserUtil.getCacheLoginUser();
+        return AjaxResult.success(iDutyReportService.getVoOne(Wrappers.<DutyReport>lambdaQuery()
+            .eq(DutyReport::getCreateBy, cacheLoginUser.getUsername())
+            .eq(DutyReport::getStatus, 1)));
+    }
+
+    @ApiOperation("查询当前登录人员是否有需要接班的报告")
+    @GetMapping("/queryreceiveReport")
+    @Security
+    public AjaxResult queryreceiveReport() {
+        // 先更新掉已过期的
+        dutyReportRecordService.update(Wrappers.<DutyReportRecord>lambdaUpdate()
+            .eq(DutyReportRecord::getStatus, 2)
+            .le(DutyReportRecord::getDeadline, new Date())
+            .set(DutyReportRecord::getStatus, 4));
+        iDutyReportService.update(Wrappers.<DutyReport>lambdaUpdate()
+            .eq(DutyReport::getStatus, 2)
+            .le(DutyReport::getDeadline, new Date())
+            .set(DutyReport::getStatus, 4));
+
+        LoginUser cacheLoginUser = UserUtil.getCacheLoginUser();
+        List<DutyReportRecordVo> dutyReportRecordVos = dutyReportRecordService.listVo(Wrappers.<DutyReportRecord>lambdaQuery()
+            .eq(DutyReportRecord::getReceiveUser, cacheLoginUser.getUsername())
+            .eq(DutyReportRecord::getStatus, 2)
+            .ge(DutyReportRecord::getDeadline, new Date()));
+        return AjaxResult.success(dutyReportRecordVos);
+    }
+
     /**
      * 导出值班报告信息列表
      */
     @ApiOperation("导出值班报告信息列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyReport:export')")
     @Log(title = "值班报告信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public void export(@Validated DutyReportBo bo, HttpServletResponse response) {
@@ -75,7 +123,6 @@ public class DutyReportController extends BaseController {
      * 获取值班报告信息详细信息
      */
     @ApiOperation("获取值班报告信息详细信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyReport:query')")
     @GetMapping("/{id}")
     public AjaxResult<DutyReportVo> getInfo(@NotNull(message = "主键不能为空")
                                             @PathVariable("id") String id) {
@@ -86,26 +133,44 @@ public class DutyReportController extends BaseController {
      * 新增值班报告信息
      */
     @ApiOperation("新增值班报告信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyReport:add')")
-    @Log(title = "值班报告信息", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
+    @Security
     public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody DutyReportBo bo) {
-        GatewayUser user = getGateWayUser();
-        if (user != null) {
-            bo.setCreateBy(user.getUsername());
+        LoginUser cacheLoginUser = UserUtil.getCacheLoginUser();
+        if (cacheLoginUser != null) {
+            bo.setCreateBy(cacheLoginUser.getUsername());
+            bo.setCreateByName(cacheLoginUser.getUser().getNickName());
         }
         return toAjax(iDutyReportService.insertByBo(bo) ? 1 : 0);
     }
 
+    @ApiOperation("交班")
+    @RepeatSubmit()
+    @PostMapping("/passwork")
+    @Security
+    public AjaxResult<Void> passwork(@RequestBody DutyReportBo bo) {
+        return toAjax(iDutyReportService.passwork(bo) ? 1 : 0);
+    }
+
+    @ApiOperation("接班")
+    @RepeatSubmit()
+    @PostMapping("/receivework")
+    @Security
+    public AjaxResult<Void> receivework(@RequestBody DutyReportRecordVo bo) {
+        if (StrUtil.isBlank(bo.getId())) {
+            return AjaxResult.error();
+        }
+        return toAjax(iDutyReportService.receivework(bo.getId()) ? 1 : 0);
+    }
+
     /**
      * 修改值班报告信息
      */
     @ApiOperation("修改值班报告信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyReport:edit')")
-    @Log(title = "值班报告信息", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
+    @Security
     public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody DutyReportBo bo) {
         return toAjax(iDutyReportService.updateByBo(bo) ? 1 : 0);
     }
@@ -114,7 +179,6 @@ public class DutyReportController extends BaseController {
      * 删除值班报告信息
      */
     @ApiOperation("删除值班报告信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:dutyReport:remove')")
     @Log(title = "值班报告信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")

+ 70 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/DutyReportRecordController.java

@@ -0,0 +1,70 @@
+package com.ruoyi.web.controller.zhdd;
+
+import cn.hutool.core.collection.CollUtil;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.annotation.Security;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.core.validate.QueryGroup;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.UserUtil;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.zhdd.domain.bo.DutyReportRecordBo;
+import com.ruoyi.zhdd.domain.vo.DutyReportRecordVo;
+import com.ruoyi.zhdd.service.IDutyReportRecordService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * 值班报告信息Controller
+ *
+ * @author xintong
+ * @date 2021-10-11
+ */
+@Validated
+@Api(value = "值班报告日志信息控制器", tags = {"值班报告日志信息管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/zhdd/dutyReportRecord")
+public class DutyReportRecordController extends BaseController {
+
+    private final IDutyReportRecordService iDutyReportRecordService;
+
+    @ApiOperation("查询值班报告日志信息列表")
+    @GetMapping("/list")
+    @Security
+    public TableDataInfo<DutyReportRecordVo> list(@Validated(QueryGroup.class) DutyReportRecordBo bo) {
+        // 根据当前用户的角色
+        LoginUser cacheLoginUser = UserUtil.getCacheLoginUser();
+        // 查询角色如果包含admin的,直接查询全部
+        Set<String> userRole = cacheLoginUser.getUserRole();
+        boolean admin = CollUtil.containsAny(userRole, CollUtil.newHashSet("admin"));
+        if (!admin) {
+            bo.setCreateBy(cacheLoginUser.getUsername());
+            bo.setReceiveUser(cacheLoginUser.getUsername());
+        }
+        return iDutyReportRecordService.queryPageList(bo);
+    }
+
+    /**
+     * 导出值班报告信息列表
+     */
+    @ApiOperation("导出值班报告信息列表")
+    @Log(title = "值班报告信息", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public void export(@Validated DutyReportRecordBo bo, HttpServletResponse response) {
+        List<DutyReportRecordVo> list = iDutyReportRecordService.queryList(bo);
+        ExcelUtil.exportExcel(list, "交接日志", DutyReportRecordVo.class, response);
+    }
+}

+ 0 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/IncidentController.java

@@ -113,7 +113,6 @@ public class IncidentController extends BaseController {
      * 查询事件基础列表
      */
     @ApiOperation("查询事件基础列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:incident:list')")
     @GetMapping("/list")
     @Security
     public TableDataInfo<IncidentVo> list(@Validated(QueryGroup.class) IncidentBo bo) {
@@ -339,8 +338,6 @@ public class IncidentController extends BaseController {
      * 修改事件基础
      */
     @ApiOperation("修改事件基础")
-//    @PreAuthorize("@ss.hasPermi('zhdd:incident:edit')")
-//    @Log(title = "事件基础", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
     @Security
@@ -352,7 +349,6 @@ public class IncidentController extends BaseController {
      * 删除事件基础
      */
     @ApiOperation("删除事件基础")
-//    @PreAuthorize("@ss.hasPermi('zhdd:incident:remove')")
     @Log(title = "事件基础", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")

+ 23 - 23
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/IncidentProcessController.java

@@ -1,31 +1,37 @@
 package com.ruoyi.web.controller.zhdd;
 
-import java.util.List;
-import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
-
-import lombok.RequiredArgsConstructor;
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.constraints.*;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.validation.annotation.Validated;
-import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.core.validate.AddGroup;
 import com.ruoyi.common.core.validate.EditGroup;
 import com.ruoyi.common.core.validate.QueryGroup;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.zhdd.domain.vo.IncidentProcessVo;
 import com.ruoyi.zhdd.domain.bo.IncidentProcessBo;
+import com.ruoyi.zhdd.domain.vo.IncidentProcessVo;
 import com.ruoyi.zhdd.service.IIncidentProcessService;
-import com.ruoyi.common.core.page.TableDataInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * 事件处置流程Controller
@@ -46,7 +52,6 @@ public class IncidentProcessController extends BaseController {
      * 查询事件处置流程列表
      */
     @ApiOperation("查询事件处置流程列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:incidentProcess:list')")
     @GetMapping("/list")
     public TableDataInfo<IncidentProcessVo> list(@Validated(QueryGroup.class) IncidentProcessBo bo) {
         return iIncidentProcessService.queryPageList(bo);
@@ -56,7 +61,6 @@ public class IncidentProcessController extends BaseController {
      * 导出事件处置流程列表
      */
     @ApiOperation("导出事件处置流程列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:incidentProcess:export')")
     @Log(title = "事件处置流程", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public void export(@Validated IncidentProcessBo bo, HttpServletResponse response) {
@@ -68,10 +72,9 @@ public class IncidentProcessController extends BaseController {
      * 获取事件处置流程详细信息
      */
     @ApiOperation("获取事件处置流程详细信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:incidentProcess:query')")
     @GetMapping("/{id}")
     public AjaxResult<IncidentProcessVo> getInfo(@NotNull(message = "主键不能为空")
-                                                  @PathVariable("id") String id) {
+                                                 @PathVariable("id") String id) {
         return AjaxResult.success(iIncidentProcessService.queryById(id));
     }
 
@@ -79,7 +82,6 @@ public class IncidentProcessController extends BaseController {
      * 新增事件处置流程
      */
     @ApiOperation("新增事件处置流程")
-//    @PreAuthorize("@ss.hasPermi('zhdd:incidentProcess:add')")
     @Log(title = "事件处置流程", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
@@ -92,7 +94,6 @@ public class IncidentProcessController extends BaseController {
      * 修改事件处置流程
      */
     @ApiOperation("修改事件处置流程")
-//    @PreAuthorize("@ss.hasPermi('zhdd:incidentProcess:edit')")
     @Log(title = "事件处置流程", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
@@ -104,11 +105,10 @@ public class IncidentProcessController extends BaseController {
      * 删除事件处置流程
      */
     @ApiOperation("删除事件处置流程")
-//    @PreAuthorize("@ss.hasPermi('zhdd:incidentProcess:remove')")
-    @Log(title = "事件处置流程" , businessType = BusinessType.DELETE)
+    @Log(title = "事件处置流程", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
-                                       @PathVariable String[] ids) {
+                                   @PathVariable String[] ids) {
         return toAjax(iIncidentProcessService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
     }
 }

+ 0 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/PlanController.java

@@ -62,7 +62,6 @@ public class PlanController extends BaseController {
      * 查询预案管理列表
      */
     @ApiOperation("查询预案管理列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:plan:list')")
     @GetMapping("/list")
     public TableDataInfo<PlanVo> list(@Validated(QueryGroup.class) PlanBo bo) {
         return iPlanService.queryPageList(bo);
@@ -72,7 +71,6 @@ public class PlanController extends BaseController {
      * 获取预案管理详细信息
      */
     @ApiOperation("获取预案管理详细信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:plan:query')")
     @GetMapping("/{id}")
     public AjaxResult<PlanVo> getInfo(@NotNull(message = "主键不能为空")
                                       @PathVariable("id") String id) {
@@ -83,7 +81,6 @@ public class PlanController extends BaseController {
      * 新增预案管理
      */
     @ApiOperation("新增预案管理")
-//    @PreAuthorize("@ss.hasPermi('zhdd:plan:add')")
     @Log(title = "预案管理", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
@@ -95,7 +92,6 @@ public class PlanController extends BaseController {
      * 修改预案管理
      */
     @ApiOperation("修改预案管理")
-//    @PreAuthorize("@ss.hasPermi('zhdd:plan:edit')")
     @Log(title = "预案管理", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
@@ -107,7 +103,6 @@ public class PlanController extends BaseController {
      * 删除预案管理
      */
     @ApiOperation("删除预案管理")
-//    @PreAuthorize("@ss.hasPermi('zhdd:plan:remove')")
     @Log(title = "预案管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")

+ 22 - 23
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/PlanTaskController.java

@@ -1,18 +1,7 @@
 package com.ruoyi.web.controller.zhdd;
 
-import java.util.List;
-import java.util.Arrays;
-import java.util.concurrent.TimeUnit;
-
-import lombok.RequiredArgsConstructor;
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.constraints.*;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.validation.annotation.Validated;
-import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.annotation.RepeatSubmit;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.validate.AddGroup;
@@ -20,12 +9,28 @@ import com.ruoyi.common.core.validate.EditGroup;
 import com.ruoyi.common.core.validate.QueryGroup;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.zhdd.domain.vo.PlanTaskVo;
 import com.ruoyi.zhdd.domain.bo.PlanTaskBo;
+import com.ruoyi.zhdd.domain.vo.PlanTaskVo;
 import com.ruoyi.zhdd.service.IPlanTaskService;
-import com.ruoyi.common.core.page.TableDataInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * 预案任务管理Controller
@@ -46,7 +51,6 @@ public class PlanTaskController extends BaseController {
      * 查询预案任务管理列表
      */
     @ApiOperation("查询预案任务管理列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:planTask:list')")
     @GetMapping("/list")
     public AjaxResult<List<PlanTaskVo>> list(@Validated(QueryGroup.class) PlanTaskBo bo) {
         return AjaxResult.success(iPlanTaskService.queryList(bo));
@@ -56,7 +60,6 @@ public class PlanTaskController extends BaseController {
      * 导出预案任务管理列表
      */
     @ApiOperation("导出预案任务管理列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:planTask:export')")
     @Log(title = "预案任务管理", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public void export(@Validated PlanTaskBo bo, HttpServletResponse response) {
@@ -68,10 +71,9 @@ public class PlanTaskController extends BaseController {
      * 获取预案任务管理详细信息
      */
     @ApiOperation("获取预案任务管理详细信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:planTask:query')")
     @GetMapping("/{id}")
     public AjaxResult<PlanTaskVo> getInfo(@NotNull(message = "主键不能为空")
-                                                  @PathVariable("id") String id) {
+                                          @PathVariable("id") String id) {
         return AjaxResult.success(iPlanTaskService.queryById(id));
     }
 
@@ -79,7 +81,6 @@ public class PlanTaskController extends BaseController {
      * 新增预案任务管理
      */
     @ApiOperation("新增预案任务管理")
-//    @PreAuthorize("@ss.hasPermi('zhdd:planTask:add')")
     @Log(title = "预案任务管理", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
@@ -91,7 +92,6 @@ public class PlanTaskController extends BaseController {
      * 修改预案任务管理
      */
     @ApiOperation("修改预案任务管理")
-//    @PreAuthorize("@ss.hasPermi('zhdd:planTask:edit')")
     @Log(title = "预案任务管理", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
@@ -103,11 +103,10 @@ public class PlanTaskController extends BaseController {
      * 删除预案任务管理
      */
     @ApiOperation("删除预案任务管理")
-//    @PreAuthorize("@ss.hasPermi('zhdd:planTask:remove')")
-    @Log(title = "预案任务管理" , businessType = BusinessType.DELETE)
+    @Log(title = "预案任务管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
-                                       @PathVariable String[] ids) {
+                                   @PathVariable String[] ids) {
         return toAjax(iPlanTaskService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
     }
 }

+ 0 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ResourceController.java

@@ -165,7 +165,6 @@ public class ResourceController extends BaseController {
      * 获取应急资源详细信息
      */
     @ApiOperation("获取应急资源详细信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:resource:query')")
     @GetMapping("/{id}")
     public AjaxResult<ResourceVo> getInfo(@NotNull(message = "主键不能为空")
                                           @PathVariable("id") String id) {
@@ -176,7 +175,6 @@ public class ResourceController extends BaseController {
      * 新增应急资源
      */
     @ApiOperation("新增应急资源")
-//    @PreAuthorize("@ss.hasPermi('zhdd:resource:add')")
     @Log(title = "应急资源", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
@@ -199,7 +197,6 @@ public class ResourceController extends BaseController {
      * 修改应急资源
      */
     @ApiOperation("修改应急资源")
-//    @PreAuthorize("@ss.hasPermi('zhdd:resource:edit')")
     @Log(title = "应急资源", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
@@ -220,7 +217,6 @@ public class ResourceController extends BaseController {
      * 删除应急资源
      */
     @ApiOperation("删除应急资源")
-//    @PreAuthorize("@ss.hasPermi('zhdd:resource:remove')")
     @Log(title = "应急资源", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     @Security

+ 0 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/ResourceDetailController.java

@@ -71,7 +71,6 @@ public class ResourceDetailController extends BaseController {
      * 查询应急资源明细列表
      */
     @ApiOperation("查询应急资源明细列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:resourceDetail:list')")
     @GetMapping("/list")
     public TableDataInfo<ResourceDetailVo> list(@Validated(QueryGroup.class) ResourceDetailBo bo) {
         return iResourceDetailService.queryPageList(bo);
@@ -81,7 +80,6 @@ public class ResourceDetailController extends BaseController {
      * 导出应急资源明细列表
      */
     @ApiOperation("导出应急资源明细列表")
-//    @PreAuthorize("@ss.hasPermi('zhdd:resourceDetail:export')")
     @Log(title = "应急资源明细", businessType = BusinessType.EXPORT)
     @GetMapping("/export/{ids}")
     public void export(@PathVariable String[] ids, HttpServletResponse response, HttpServletRequest request, ModelMap modelMap) {
@@ -123,7 +121,6 @@ public class ResourceDetailController extends BaseController {
      * 获取应急资源明细详细信息
      */
     @ApiOperation("获取应急资源明细详细信息")
-//    @PreAuthorize("@ss.hasPermi('zhdd:resourceDetail:query')")
     @GetMapping("/{id}")
     public AjaxResult<ResourceDetailVo> getInfo(@NotNull(message = "主键不能为空")
                                                 @PathVariable("id") String id) {
@@ -134,7 +131,6 @@ public class ResourceDetailController extends BaseController {
      * 新增应急资源明细
      */
     @ApiOperation("新增应急资源明细")
-//    @PreAuthorize("@ss.hasPermi('zhdd:resourceDetail:add')")
     @Log(title = "应急资源明细", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
@@ -146,7 +142,6 @@ public class ResourceDetailController extends BaseController {
      * 修改应急资源明细
      */
     @ApiOperation("修改应急资源明细")
-//    @PreAuthorize("@ss.hasPermi('zhdd:resourceDetail:edit')")
     @Log(title = "应急资源明细", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
@@ -158,7 +153,6 @@ public class ResourceDetailController extends BaseController {
      * 删除应急资源明细
      */
     @ApiOperation("删除应急资源明细")
-//    @PreAuthorize("@ss.hasPermi('zhdd:resourceDetail:remove')")
     @Log(title = "应急资源明细", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")

+ 0 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhdd/SingleDeviceController.java

@@ -19,7 +19,6 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -86,7 +85,6 @@ public class SingleDeviceController extends BaseController {
      * 导出单兵数据信息列表
      */
     @ApiOperation("导出单兵数据信息列表")
-    @PreAuthorize("@ss.hasPermi('zhdd:singleDevice:export')")
     @Log(title = "单兵数据信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public void export(@Validated SingleDeviceBo bo, HttpServletResponse response) {
@@ -98,7 +96,6 @@ public class SingleDeviceController extends BaseController {
      * 获取单兵数据信息详细信息
      */
     @ApiOperation("获取单兵数据信息详细信息")
-    @PreAuthorize("@ss.hasPermi('zhdd:singleDevice:query')")
     @GetMapping("/{userId}")
     public AjaxResult<SingleDeviceVo> getInfo(@NotNull(message = "主键不能为空")
                                               @PathVariable("userId") String userId) {
@@ -109,7 +106,6 @@ public class SingleDeviceController extends BaseController {
      * 新增单兵数据信息
      */
     @ApiOperation("新增单兵数据信息")
-    @PreAuthorize("@ss.hasPermi('zhdd:singleDevice:add')")
     @Log(title = "单兵数据信息", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
@@ -121,7 +117,6 @@ public class SingleDeviceController extends BaseController {
      * 修改单兵数据信息
      */
     @ApiOperation("修改单兵数据信息")
-    @PreAuthorize("@ss.hasPermi('zhdd:singleDevice:edit')")
     @Log(title = "单兵数据信息", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
@@ -133,7 +128,6 @@ public class SingleDeviceController extends BaseController {
      * 删除单兵数据信息
      */
     @ApiOperation("删除单兵数据信息")
-    @PreAuthorize("@ss.hasPermi('zhdd:singleDevice:remove')")
     @Log(title = "单兵数据信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{userIds}")
     public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")

+ 24 - 46
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java

@@ -10,14 +10,18 @@ import com.ruoyi.generator.domain.GenTable;
 import com.ruoyi.generator.domain.GenTableColumn;
 import com.ruoyi.generator.service.IGenTableColumnService;
 import com.ruoyi.generator.service.IGenTableService;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.io.IOUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -27,13 +31,12 @@ import java.util.Map;
 
 /**
  * 代码生成 操作处理
- * 
+ *
  * @author ruoyi
  */
 @RestController
 @RequestMapping("/tool/gen")
-public class GenController extends BaseController
-{
+public class GenController extends BaseController {
     @Autowired
     private IGenTableService genTableService;
 
@@ -43,20 +46,16 @@ public class GenController extends BaseController
     /**
      * 查询代码生成列表
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:list')")
     @GetMapping("/list")
-    public TableDataInfo genList(GenTable genTable)
-    {
+    public TableDataInfo genList(GenTable genTable) {
         return genTableService.selectPageGenTableList(genTable);
     }
 
     /**
      * 修改代码生成业务
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:query')")
     @GetMapping(value = "/{talbleId}")
-    public AjaxResult getInfo(@PathVariable Long talbleId)
-    {
+    public AjaxResult getInfo(@PathVariable Long talbleId) {
         GenTable table = genTableService.selectGenTableById(talbleId);
         List<GenTable> tables = genTableService.selectGenTableAll();
         List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(talbleId);
@@ -70,20 +69,16 @@ public class GenController extends BaseController
     /**
      * 查询数据库列表
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:list')")
     @GetMapping("/db/list")
-    public TableDataInfo dataList(GenTable genTable)
-    {
+    public TableDataInfo dataList(GenTable genTable) {
         return genTableService.selectPageDbTableList(genTable);
     }
 
     /**
      * 查询数据表字段列表
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:list')")
     @GetMapping(value = "/column/{talbleId}")
-    public TableDataInfo columnList(Long tableId)
-    {
+    public TableDataInfo columnList(Long tableId) {
         TableDataInfo dataInfo = new TableDataInfo();
         List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
         dataInfo.setRows(list);
@@ -94,12 +89,10 @@ public class GenController extends BaseController
     /**
      * 导入表结构(保存)
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:import')")
     @Log(title = "代码生成", businessType = BusinessType.IMPORT)
     @PostMapping("/importTable")
     @ApiOperation("导入表结构(保存)")
-    public AjaxResult importTableSave(String tables)
-    {
+    public AjaxResult importTableSave(String tables) {
         String[] tableNames = Convert.toStrArray(tables);
         // 查询表信息
         List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames);
@@ -110,12 +103,10 @@ public class GenController extends BaseController
     /**
      * 修改保存代码生成业务
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:edit')")
     @Log(title = "代码生成", businessType = BusinessType.UPDATE)
     @PutMapping
     @ApiOperation("修改保存代码生成业务")
-    public AjaxResult editSave(@Validated @RequestBody GenTable genTable)
-    {
+    public AjaxResult editSave(@Validated @RequestBody GenTable genTable) {
         genTableService.validateEdit(genTable);
         genTableService.updateGenTable(genTable);
         return AjaxResult.success();
@@ -124,12 +115,10 @@ public class GenController extends BaseController
     /**
      * 删除代码生成
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:remove')")
     @Log(title = "代码生成", businessType = BusinessType.DELETE)
     @DeleteMapping("/{tableIds}")
     @ApiOperation("删除代码生成")
-    public AjaxResult remove(@PathVariable Long[] tableIds)
-    {
+    public AjaxResult remove(@PathVariable Long[] tableIds) {
         genTableService.deleteGenTableByIds(tableIds);
         return AjaxResult.success();
     }
@@ -137,10 +126,8 @@ public class GenController extends BaseController
     /**
      * 预览代码
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:preview')")
     @GetMapping("/preview/{tableId}")
-    public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException
-    {
+    public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException {
         Map<String, String> dataMap = genTableService.previewCode(tableId);
         return AjaxResult.success(dataMap);
     }
@@ -148,11 +135,9 @@ public class GenController extends BaseController
     /**
      * 生成代码(下载方式)
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:code')")
     @Log(title = "代码生成", businessType = BusinessType.GENCODE)
     @GetMapping("/download/{tableName}")
-    public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
-    {
+    public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException {
         byte[] data = genTableService.downloadCode(tableName);
         genCode(response, data);
     }
@@ -160,11 +145,9 @@ public class GenController extends BaseController
     /**
      * 生成代码(自定义路径)
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:code')")
     @Log(title = "代码生成", businessType = BusinessType.GENCODE)
     @GetMapping("/genCode/{tableName}")
-    public AjaxResult genCode(@PathVariable("tableName") String tableName)
-    {
+    public AjaxResult genCode(@PathVariable("tableName") String tableName) {
         genTableService.generatorCode(tableName);
         return AjaxResult.success();
     }
@@ -172,11 +155,9 @@ public class GenController extends BaseController
     /**
      * 同步数据库
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:edit')")
     @Log(title = "代码生成", businessType = BusinessType.UPDATE)
     @GetMapping("/synchDb/{tableName}")
-    public AjaxResult synchDb(@PathVariable("tableName") String tableName)
-    {
+    public AjaxResult synchDb(@PathVariable("tableName") String tableName) {
         genTableService.synchDb(tableName);
         return AjaxResult.success();
     }
@@ -184,11 +165,9 @@ public class GenController extends BaseController
     /**
      * 批量生成代码
      */
-    @PreAuthorize("@ss.hasPermi('tool:gen:code')")
     @Log(title = "代码生成", businessType = BusinessType.GENCODE)
     @GetMapping("/batchGenCode")
-    public void batchGenCode(HttpServletResponse response, String tables) throws IOException
-    {
+    public void batchGenCode(HttpServletResponse response, String tables) throws IOException {
         String[] tableNames = Convert.toStrArray(tables);
         byte[] data = genTableService.downloadCode(tableNames);
         genCode(response, data);
@@ -197,8 +176,7 @@ public class GenController extends BaseController
     /**
      * 生成zip文件
      */
-    private void genCode(HttpServletResponse response, byte[] data) throws IOException
-    {
+    private void genCode(HttpServletResponse response, byte[] data) throws IOException {
         response.reset();
         response.addHeader("Access-Control-Allow-Origin", "*");
         response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
@@ -207,4 +185,4 @@ public class GenController extends BaseController
         response.setContentType("application/octet-stream; charset=UTF-8");
         IOUtils.write(data, response.getOutputStream());
     }
-}
+}

+ 21 - 25
ruoyi-generator/src/main/resources/vm/java/controller.java.vm

@@ -5,8 +5,10 @@ import java.util.Arrays;
 import java.util.concurrent.TimeUnit;
 
 import lombok.RequiredArgsConstructor;
+
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.constraints.*;
+
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -23,10 +25,10 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import ${packageName}.domain.vo.${ClassName}Vo;
 import ${packageName}.domain.bo.${ClassName}Bo;
 import ${packageName}.service.I${ClassName}Service;
-#if($table.crud || $table.sub)
-import com.ruoyi.common.core.page.TableDataInfo;
-#elseif($table.tree)
-#end
+    #if($table.crud || $table.sub)
+    import com.ruoyi.common.core.page.TableDataInfo;
+    #elseif($table.tree)
+    #end
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -45,28 +47,26 @@ public class ${ClassName}Controller extends BaseController {
 
     private final I${ClassName}Service i${ClassName}Service;
 
-    /**
-     * 查询${functionName}列表
-     */
-    @ApiOperation("查询${functionName}列表")
-    @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')")
-    @GetMapping("/list")
-#if($table.crud || $table.sub)
+/**
+ * 查询${functionName}列表
+ */
+@ApiOperation("查询${functionName}列表")
+@GetMapping("/list")
+    #if($table.crud || $table.sub)
     public TableDataInfo<${ClassName}Vo> list(@Validated(QueryGroup.class) ${ClassName}Bo bo) {
         return i${ClassName}Service.queryPageList(bo);
     }
-#elseif($table.tree)
-    public AjaxResult<List<${ClassName}Vo>> list(@Validated(QueryGroup.class) ${ClassName}Bo bo) {
-        List<${ClassName}Vo> list = i${ClassName}Service.queryList(bo);
-        return AjaxResult.success(list);
-    }
-#end
+    #elseif($table.tree)
+        public AjaxResult<List<${ClassName}Vo>> list(@Validated(QueryGroup.class) ${ClassName}Bo bo) {
+            List<${ClassName}Vo> list = i${ClassName}Service.queryList(bo);
+            return AjaxResult.success(list);
+        }
+    #end
 
     /**
      * 导出${functionName}列表
      */
     @ApiOperation("导出${functionName}列表")
-    @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')")
     @Log(title = "${functionName}", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public void export(@Validated ${ClassName}Bo bo, HttpServletResponse response) {
@@ -78,10 +78,9 @@ public class ${ClassName}Controller extends BaseController {
      * 获取${functionName}详细信息
      */
     @ApiOperation("获取${functionName}详细信息")
-    @PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')")
     @GetMapping("/{${pkColumn.javaField}}")
     public AjaxResult<${ClassName}Vo> getInfo(@NotNull(message = "主键不能为空")
-                                                  @PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) {
+                                              @PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) {
         return AjaxResult.success(i${ClassName}Service.queryById(${pkColumn.javaField}));
     }
 
@@ -89,7 +88,6 @@ public class ${ClassName}Controller extends BaseController {
      * 新增${functionName}
      */
     @ApiOperation("新增${functionName}")
-    @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')")
     @Log(title = "${functionName}", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
@@ -101,7 +99,6 @@ public class ${ClassName}Controller extends BaseController {
      * 修改${functionName}
      */
     @ApiOperation("修改${functionName}")
-    @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')")
     @Log(title = "${functionName}", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
@@ -113,11 +110,10 @@ public class ${ClassName}Controller extends BaseController {
      * 删除${functionName}
      */
     @ApiOperation("删除${functionName}")
-    @PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')")
-    @Log(title = "${functionName}" , businessType = BusinessType.DELETE)
+    @Log(title = "${functionName}", businessType = BusinessType.DELETE)
     @DeleteMapping("/{${pkColumn.javaField}s}")
     public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
-                                       @PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) {
+                                   @PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) {
         return toAjax(i${ClassName}Service.deleteWithValidByIds(Arrays.asList(${pkColumn.javaField}s), true) ? 1 : 0);
     }
 }

+ 26 - 51
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java

@@ -14,8 +14,14 @@ import com.ruoyi.quartz.service.ISysJobService;
 import com.ruoyi.quartz.util.CronUtils;
 import org.quartz.SchedulerException;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.List;
@@ -27,65 +33,49 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/monitor/job")
-public class SysJobController extends BaseController
-{
+public class SysJobController extends BaseController {
     @Autowired
     private ISysJobService jobService;
 
     /**
      * 查询定时任务列表
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:list')")
     @GetMapping("/list")
-    public TableDataInfo list(SysJob sysJob)
-    {
+    public TableDataInfo list(SysJob sysJob) {
         return jobService.selectPageJobList(sysJob);
     }
 
     /**
      * 导出定时任务列表
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:export')")
     @Log(title = "定时任务", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public void export(SysJob sysJob, HttpServletResponse response)
-    {
+    public void export(SysJob sysJob, HttpServletResponse response) {
         List<SysJob> list = jobService.selectJobList(sysJob);
-		ExcelUtil.exportExcel(list, "定时任务", SysJob.class, response);
+        ExcelUtil.exportExcel(list, "定时任务", SysJob.class, response);
     }
 
     /**
      * 获取定时任务详细信息
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:query')")
     @GetMapping(value = "/{jobId}")
-    public AjaxResult getInfo(@PathVariable("jobId") Long jobId)
-    {
+    public AjaxResult getInfo(@PathVariable("jobId") Long jobId) {
         return AjaxResult.success(jobService.selectJobById(jobId));
     }
 
     /**
      * 新增定时任务
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:add')")
     @Log(title = "定时任务", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody SysJob job) throws SchedulerException, TaskException
-    {
-        if (!CronUtils.isValid(job.getCronExpression()))
-        {
+    public AjaxResult add(@RequestBody SysJob job) throws SchedulerException, TaskException {
+        if (!CronUtils.isValid(job.getCronExpression())) {
             return error("新增任务'" + job.getJobName() + "'失败,Cron表达式不正确");
-        }
-        else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI))
-        {
+        } else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) {
             return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi://'调用");
-        }
-        else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_LDAP))
-        {
+        } else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_LDAP)) {
             return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap://'调用");
-        }
-        else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS }))
-        {
+        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.HTTP, Constants.HTTPS})) {
             return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)//'调用");
         }
         job.setCreateBy(getUsername());
@@ -95,25 +85,16 @@ public class SysJobController extends BaseController
     /**
      * 修改定时任务
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:edit')")
     @Log(title = "定时任务", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody SysJob job) throws SchedulerException, TaskException
-    {
-        if (!CronUtils.isValid(job.getCronExpression()))
-        {
+    public AjaxResult edit(@RequestBody SysJob job) throws SchedulerException, TaskException {
+        if (!CronUtils.isValid(job.getCronExpression())) {
             return error("修改任务'" + job.getJobName() + "'失败,Cron表达式不正确");
-        }
-        else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI))
-        {
+        } else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) {
             return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi://'调用");
-        }
-        else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_LDAP))
-        {
+        } else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_LDAP)) {
             return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap://'调用");
-        }
-        else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS }))
-        {
+        } else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[]{Constants.HTTP, Constants.HTTPS})) {
             return error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'http(s)//'调用");
         }
         job.setUpdateBy(getUsername());
@@ -123,11 +104,9 @@ public class SysJobController extends BaseController
     /**
      * 定时任务状态修改
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
     @Log(title = "定时任务", businessType = BusinessType.UPDATE)
     @PutMapping("/changeStatus")
-    public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException
-    {
+    public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException {
         SysJob newJob = jobService.selectJobById(job.getJobId());
         newJob.setStatus(job.getStatus());
         return toAjax(jobService.changeStatus(newJob));
@@ -136,11 +115,9 @@ public class SysJobController extends BaseController
     /**
      * 定时任务立即执行一次
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')")
     @Log(title = "定时任务", businessType = BusinessType.UPDATE)
     @PutMapping("/run")
-    public AjaxResult run(@RequestBody SysJob job) throws SchedulerException
-    {
+    public AjaxResult run(@RequestBody SysJob job) throws SchedulerException {
         jobService.run(job);
         return AjaxResult.success();
     }
@@ -148,11 +125,9 @@ public class SysJobController extends BaseController
     /**
      * 删除定时任务
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:remove')")
     @Log(title = "定时任务", businessType = BusinessType.DELETE)
     @DeleteMapping("/{jobIds}")
-    public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException
-    {
+    public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException {
         jobService.deleteJobByIds(jobIds);
         return AjaxResult.success();
     }

+ 12 - 20
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java

@@ -9,8 +9,11 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.quartz.domain.SysJobLog;
 import com.ruoyi.quartz.service.ISysJobLogService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.List;
@@ -22,40 +25,33 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/monitor/jobLog")
-public class SysJobLogController extends BaseController
-{
+public class SysJobLogController extends BaseController {
     @Autowired
     private ISysJobLogService jobLogService;
 
     /**
      * 查询定时任务调度日志列表
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:list')")
     @GetMapping("/list")
-    public TableDataInfo list(SysJobLog sysJobLog)
-    {
+    public TableDataInfo list(SysJobLog sysJobLog) {
         return jobLogService.selectPageJobLogList(sysJobLog);
     }
 
     /**
      * 导出定时任务调度日志列表
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:export')")
     @Log(title = "任务调度日志", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public void export(SysJobLog sysJobLog, HttpServletResponse response)
-    {
+    public void export(SysJobLog sysJobLog, HttpServletResponse response) {
         List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
-		ExcelUtil.exportExcel(list, "调度日志", SysJobLog.class, response);
+        ExcelUtil.exportExcel(list, "调度日志", SysJobLog.class, response);
     }
 
     /**
      * 根据调度编号获取详细信息
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:query')")
     @GetMapping(value = "/{configId}")
-    public AjaxResult getInfo(@PathVariable Long jobLogId)
-    {
+    public AjaxResult getInfo(@PathVariable Long jobLogId) {
         return AjaxResult.success(jobLogService.selectJobLogById(jobLogId));
     }
 
@@ -63,22 +59,18 @@ public class SysJobLogController extends BaseController
     /**
      * 删除定时任务调度日志
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:remove')")
     @Log(title = "定时任务调度日志", businessType = BusinessType.DELETE)
     @DeleteMapping("/{jobLogIds}")
-    public AjaxResult remove(@PathVariable Long[] jobLogIds)
-    {
+    public AjaxResult remove(@PathVariable Long[] jobLogIds) {
         return toAjax(jobLogService.deleteJobLogByIds(jobLogIds));
     }
 
     /**
      * 清空定时任务调度日志
      */
-    @PreAuthorize("@ss.hasPermi('monitor:job:remove')")
     @Log(title = "调度日志", businessType = BusinessType.CLEAN)
     @DeleteMapping("/clean")
-    public AjaxResult clean()
-    {
+    public AjaxResult clean() {
         jobLogService.cleanJobLog();
         return AjaxResult.success();
     }

+ 15 - 7
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/DutyReport.java

@@ -1,12 +1,17 @@
 package com.ruoyi.zhdd.domain;
 
-import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
+
 import java.io.Serializable;
 import java.util.Date;
-import java.math.BigDecimal;
 
 /**
  * 值班报告信息对象 b_duty_report
@@ -20,7 +25,7 @@ import java.math.BigDecimal;
 @TableName("b_duty_report")
 public class DutyReport implements Serializable {
 
-    private static final long serialVersionUID=1L;
+    private static final long serialVersionUID = 1L;
 
 
     /**
@@ -39,10 +44,13 @@ public class DutyReport implements Serializable {
      */
     private Integer status;
 
-    /**
-     * 值班日期
-     */
-    private Date dutyDate;
+    // 值班人名
+    private String createByName;
+    // 接班人员
+    private String receiveUser;
+    // 交班时间
+    private Date passDateTime;
+    private Date deadline;
 
     /**
      * $column.columnComment

+ 82 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/DutyReportRecord.java

@@ -0,0 +1,82 @@
+package com.ruoyi.zhdd.domain;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 值班报告信息对象 b_duty_report
+ *
+ * @author xintong
+ * @date 2021-10-11
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("b_duty_report_record")
+public class DutyReportRecord implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * $column.columnComment
+     */
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private String id;
+
+    private String reportId;
+
+    /**
+     * 报告内容
+     */
+    private String reportContent;
+
+    /**
+     * 报告状态
+     */
+    private Integer status;
+
+    // 值班人名
+    private String createByName;
+    // 接班人员
+    private String receiveUser;
+    // 交班时间
+    private Date passDateTime;
+    private String receiveUserName;
+    private Date deadline;
+    private Date receiveDateTime;
+
+    /**
+     * $column.columnComment
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    /**
+     * $column.columnComment
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    /**
+     * $column.columnComment
+     */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateBy;
+
+    /**
+     * $column.columnComment
+     */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+}

+ 0 - 2
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/Resource.java

@@ -84,8 +84,6 @@ public class Resource implements Serializable {
      */
     private String contactPhone;
 
-    private String carType;
-
     /**
      * $column.columnComment
      */

+ 10 - 7
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/DutyReportBo.java

@@ -1,19 +1,16 @@
 package com.ruoyi.zhdd.domain.bo;
 
+import com.ruoyi.common.core.domain.BaseEntity;
 import com.ruoyi.common.core.validate.AddGroup;
 import com.ruoyi.common.core.validate.EditGroup;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import javax.validation.constraints.*;
 
+import javax.validation.constraints.NotBlank;
 import java.util.Date;
 
-import java.util.Date;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.ruoyi.common.core.domain.BaseEntity;
-
 /**
  * 值班报告信息业务对象 b_duty_report
  *
@@ -36,13 +33,13 @@ public class DutyReportBo extends BaseEntity {
      * 报告内容
      */
     @ApiModelProperty(value = "报告内容")
-    @NotBlank(message = "报告内容不能为空", groups = { AddGroup.class, EditGroup.class })
+    @NotBlank(message = "报告内容不能为空", groups = {AddGroup.class, EditGroup.class})
     private String reportContent;
 
     /**
      * 报告状态
      */
-    @ApiModelProperty(value = "报告状态.1-暂存。2-提交")
+    @ApiModelProperty(value = "报告状态.1-未交班。2-已交班。3-已完成。4-已取消")
     private Integer status;
 
     /**
@@ -51,6 +48,12 @@ public class DutyReportBo extends BaseEntity {
     @ApiModelProperty(value = "值班日期")
     private Date dutyDate;
 
+    // 值班人名
+    private String createByName;
+    // 接班人员
+    private String receiveUser;
+    private Date deadline;
+
     /**
      * $column.columnComment
      */

+ 69 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/DutyReportRecordBo.java

@@ -0,0 +1,69 @@
+package com.ruoyi.zhdd.domain.bo;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 值班报告信息业务对象 b_duty_report
+ *
+ * @author xintong
+ * @date 2021-10-11
+ */
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel("值班报告日志信息业务对象")
+public class DutyReportRecordBo extends BaseEntity {
+
+    /**
+     * $column.columnComment
+     */
+    private String id;
+
+    private String reportId;
+
+    @ApiModelProperty(value = "报告内容")
+    private String reportContent;
+
+    @ApiModelProperty(value = "报告状态.2-已交班。3-已完成。4-已取消")
+    private Integer status;
+
+    // 值班人名
+    private String createByName;
+    // 接班人员
+    private String receiveUser;
+    private String receiveUserName;
+    private Date deadline;
+    private Date passDateTime;
+    private Date receiveDateTime;
+
+    /**
+     * 分页大小
+     */
+    @ApiModelProperty("分页大小")
+    private Integer pageSize;
+
+    /**
+     * 当前页数
+     */
+    @ApiModelProperty("当前页数")
+    private Integer pageNum;
+
+    /**
+     * 排序列
+     */
+    @ApiModelProperty("排序列")
+    private String orderByColumn;
+
+    /**
+     * 排序的方向desc或者asc
+     */
+    @ApiModelProperty(value = "排序的方向", example = "asc,desc")
+    private String isAsc;
+
+}

+ 0 - 2
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/bo/ResourceBo.java

@@ -92,8 +92,6 @@ public class ResourceBo extends BaseEntity {
     @NotBlank(message = "contactName不能为空", groups = {AddGroup.class, EditGroup.class})
     private String contactName;
 
-    private String carType;
-
     /**
      * 联系电话
      */

+ 62 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/vo/DutyReportRecordVo.java

@@ -0,0 +1,62 @@
+package com.ruoyi.zhdd.domain.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+
+/**
+ * 值班报告信息视图对象 b_duty_report
+ *
+ * @author xintong
+ * @date 2021-10-11
+ */
+@Data
+@ApiModel("值班报告日志信息视图对象")
+public class DutyReportRecordVo {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $pkColumn.columnComment
+     */
+    private String id;
+
+    private String reportId;
+
+    /**
+     * 报告内容
+     */
+    @Excel(name = "报告内容")
+    @ApiModelProperty("报告内容")
+    private String reportContent;
+
+    /**
+     * 报告状态
+     */
+    @Excel(name = "报告状态")
+    @ApiModelProperty("报告状态")
+    private Integer status;
+
+    @Excel(name = "报告人")
+    private String createBy;
+
+    @Excel(name = "更新时间")
+    private Date updateTime;
+
+    private Date createTime;
+
+    // 值班人名
+    private String createByName;
+    // 接班人员
+    private String receiveUser;
+    // 交班时间
+    private Date passDateTime;
+    private String receiveUserName;
+    private Date deadline;
+    private Date receiveDateTime;
+
+}

+ 8 - 7
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/vo/DutyReportVo.java

@@ -40,13 +40,6 @@ public class DutyReportVo {
     @ApiModelProperty("报告状态")
     private Integer status;
 
-    /**
-     * 值班日期
-     */
-    @Excel(name = "值班日期")
-    @ApiModelProperty("值班日期")
-    private Date dutyDate;
-
     @Excel(name = "报告人")
     private String createBy;
 
@@ -55,4 +48,12 @@ public class DutyReportVo {
 
     private Date createTime;
 
+    // 值班人名
+    private String createByName;
+    // 接班人员
+    private String receiveUser;
+    // 交班时间
+    private Date passDateTime;
+    private Date deadline;
+
 }

+ 0 - 2
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/domain/vo/ResourceVo.java

@@ -79,8 +79,6 @@ public class ResourceVo {
 
     private String deptId;
 
-    private String carType;
-
     /**
      * 人数
      */

+ 14 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/mapper/DutyReportRecordMapper.java

@@ -0,0 +1,14 @@
+package com.ruoyi.zhdd.mapper;
+
+import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
+import com.ruoyi.zhdd.domain.DutyReportRecord;
+
+/**
+ * 值班报告信息Mapper接口
+ *
+ * @author xintong
+ * @date 2021-10-11
+ */
+public interface DutyReportRecordMapper extends BaseMapperPlus<DutyReportRecord> {
+
+}

+ 61 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/IDutyReportRecordService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.zhdd.service;
+
+import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.zhdd.domain.DutyReportRecord;
+import com.ruoyi.zhdd.domain.bo.DutyReportRecordBo;
+import com.ruoyi.zhdd.domain.vo.DutyReportRecordVo;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 值班报告信息Service接口
+ *
+ * @author xintong
+ * @date 2021-10-11
+ */
+public interface IDutyReportRecordService extends IServicePlus<DutyReportRecord, DutyReportRecordVo> {
+    /**
+     * 查询单个
+     *
+     * @return
+     */
+    DutyReportRecordVo queryById(String id);
+
+    /**
+     * 查询列表
+     */
+    TableDataInfo<DutyReportRecordVo> queryPageList(DutyReportRecordBo bo);
+
+    /**
+     * 查询列表
+     */
+    List<DutyReportRecordVo> queryList(DutyReportRecordBo bo);
+
+    /**
+     * 根据新增业务对象插入值班报告信息
+     *
+     * @param bo 值班报告信息新增业务对象
+     * @return
+     */
+    Boolean insertByBo(DutyReportRecordBo bo);
+
+    /**
+     * 根据编辑业务对象修改值班报告信息
+     *
+     * @param bo 值班报告信息编辑业务对象
+     * @return
+     */
+    Boolean updateByBo(DutyReportRecordBo bo);
+
+    /**
+     * 校验并删除数据
+     *
+     * @param ids     主键集合
+     * @param isValid 是否校验,true-删除前校验,false-不校验
+     * @return
+     */
+    Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
+
+}

+ 46 - 38
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/IDutyReportService.java

@@ -1,10 +1,10 @@
 package com.ruoyi.zhdd.service;
 
-import com.ruoyi.zhdd.domain.DutyReport;
-import com.ruoyi.zhdd.domain.vo.DutyReportVo;
-import com.ruoyi.zhdd.domain.bo.DutyReportBo;
 import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.zhdd.domain.DutyReport;
+import com.ruoyi.zhdd.domain.bo.DutyReportBo;
+import com.ruoyi.zhdd.domain.vo.DutyReportVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -16,41 +16,49 @@ import java.util.List;
  * @date 2021-10-11
  */
 public interface IDutyReportService extends IServicePlus<DutyReport, DutyReportVo> {
-	/**
-	 * 查询单个
-	 * @return
-	 */
-	DutyReportVo queryById(String id);
-
-	/**
-	 * 查询列表
-	 */
+    /**
+     * 查询单个
+     *
+     * @return
+     */
+    DutyReportVo queryById(String id);
+
+    /**
+     * 查询列表
+     */
     TableDataInfo<DutyReportVo> queryPageList(DutyReportBo bo);
 
-	/**
-	 * 查询列表
-	 */
-	List<DutyReportVo> queryList(DutyReportBo bo);
-
-	/**
-	 * 根据新增业务对象插入值班报告信息
-	 * @param bo 值班报告信息新增业务对象
-	 * @return
-	 */
-	Boolean insertByBo(DutyReportBo bo);
-
-	/**
-	 * 根据编辑业务对象修改值班报告信息
-	 * @param bo 值班报告信息编辑业务对象
-	 * @return
-	 */
-	Boolean updateByBo(DutyReportBo bo);
-
-	/**
-	 * 校验并删除数据
-	 * @param ids 主键集合
-	 * @param isValid 是否校验,true-删除前校验,false-不校验
-	 * @return
-	 */
-	Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
+    /**
+     * 查询列表
+     */
+    List<DutyReportVo> queryList(DutyReportBo bo);
+
+    /**
+     * 根据新增业务对象插入值班报告信息
+     *
+     * @param bo 值班报告信息新增业务对象
+     * @return
+     */
+    Boolean insertByBo(DutyReportBo bo);
+
+    /**
+     * 根据编辑业务对象修改值班报告信息
+     *
+     * @param bo 值班报告信息编辑业务对象
+     * @return
+     */
+    Boolean updateByBo(DutyReportBo bo);
+
+    /**
+     * 校验并删除数据
+     *
+     * @param ids     主键集合
+     * @param isValid 是否校验,true-删除前校验,false-不校验
+     * @return
+     */
+    Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
+
+    boolean passwork(DutyReportBo bo);
+
+    boolean receivework(String id);
 }

+ 93 - 0
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/DutyReportRecordServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.zhdd.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.convert.Convert;
+import cn.hutool.http.HttpStatus;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
+import com.ruoyi.common.core.page.PagePlus;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.PageUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.UserUtil;
+import com.ruoyi.zhdd.domain.DutyReportRecord;
+import com.ruoyi.zhdd.domain.bo.DutyReportRecordBo;
+import com.ruoyi.zhdd.domain.vo.DutyReportRecordVo;
+import com.ruoyi.zhdd.mapper.DutyReportRecordMapper;
+import com.ruoyi.zhdd.service.IDutyReportRecordService;
+import org.springframework.stereotype.Service;
+
+import java.sql.Timestamp;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 值班报告信息Service业务层处理
+ *
+ * @author xintong
+ * @date 2021-10-11
+ */
+@Service
+public class DutyReportRecordServiceImpl extends ServicePlusImpl<DutyReportRecordMapper, DutyReportRecord, DutyReportRecordVo> implements IDutyReportRecordService {
+
+    @Override
+    public DutyReportRecordVo queryById(String id) {
+        return getVoById(id);
+    }
+
+    @Override
+    public TableDataInfo<DutyReportRecordVo> queryPageList(DutyReportRecordBo bo) {
+        PagePlus<DutyReportRecord, DutyReportRecordVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo));
+        TableDataInfo<DutyReportRecordVo> rspData = new TableDataInfo<>();
+        rspData.setCode(HttpStatus.HTTP_OK);
+        rspData.setMsg("查询成功");
+        rspData.setRows(result.getRecordsVo());
+        rspData.setTotal(result.getTotal());
+        rspData.setPageNum(result.getCurrent());
+        rspData.setPageSize(result.getSize());
+        LoginUser cacheLoginUser = UserUtil.getCacheLoginUser();
+        rspData.setCurrentUser(cacheLoginUser.getUsername());
+        return rspData;
+    }
+
+    @Override
+    public List<DutyReportRecordVo> queryList(DutyReportRecordBo bo) {
+        return listVo(buildQueryWrapper(bo));
+    }
+
+    private LambdaQueryWrapper<DutyReportRecord> buildQueryWrapper(DutyReportRecordBo bo) {
+        Map<String, Object> params = bo.getParams();
+        LambdaQueryWrapper<DutyReportRecord> lqw = Wrappers.lambdaQuery();
+        lqw.and(a -> a.eq(DutyReportRecord::getCreateBy, bo.getCreateBy()).or().eq(DutyReportRecord::getReceiveUser, bo.getReceiveUser()));
+        lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), DutyReportRecord::getCreateBy, bo.getCreateBy());
+        if (params.get("beginTime") != null && params.get("endTime") != null) {
+            lqw.between(DutyReportRecord::getCreateTime, Timestamp.valueOf(Convert.toStr(params.get("beginTime")) + " 00:00:00"), Timestamp.valueOf(Convert.toStr(params.get("endTime")) + " 23:59:59"));
+        }
+        lqw.orderByDesc(DutyReportRecord::getCreateTime);
+        return lqw;
+    }
+
+    @Override
+    public Boolean insertByBo(DutyReportRecordBo bo) {
+        DutyReportRecord add = BeanUtil.toBean(bo, DutyReportRecord.class);
+        return save(add);
+    }
+
+    @Override
+    public Boolean updateByBo(DutyReportRecordBo bo) {
+        DutyReportRecord update = BeanUtil.toBean(bo, DutyReportRecord.class);
+        return updateById(update);
+    }
+
+    @Override
+    public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
+        if (isValid) {
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return removeByIds(ids);
+    }
+
+}

+ 109 - 23
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/DutyReportServiceImpl.java

@@ -3,9 +3,12 @@ package com.ruoyi.zhdd.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpStatus;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
 import com.ruoyi.common.core.page.PagePlus;
@@ -14,14 +17,21 @@ import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.PageUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.UserUtil;
+import com.ruoyi.system.service.ISysConfigService;
 import com.ruoyi.zhdd.domain.DutyReport;
+import com.ruoyi.zhdd.domain.DutyReportRecord;
 import com.ruoyi.zhdd.domain.bo.DutyReportBo;
+import com.ruoyi.zhdd.domain.vo.DutyReportRecordVo;
 import com.ruoyi.zhdd.domain.vo.DutyReportVo;
 import com.ruoyi.zhdd.mapper.DutyReportMapper;
+import com.ruoyi.zhdd.service.IDutyReportRecordService;
 import com.ruoyi.zhdd.service.IDutyReportService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.sql.Timestamp;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.List;
@@ -36,6 +46,11 @@ import java.util.Map;
 @Service
 public class DutyReportServiceImpl extends ServicePlusImpl<DutyReportMapper, DutyReport, DutyReportVo> implements IDutyReportService {
 
+    @Autowired
+    private ISysConfigService sysConfigService;
+    @Autowired
+    private IDutyReportRecordService dutyReportRecordService;
+
     @Override
     public DutyReportVo queryById(String id) {
         return getVoById(id);
@@ -64,21 +79,29 @@ public class DutyReportServiceImpl extends ServicePlusImpl<DutyReportMapper, Dut
     private LambdaQueryWrapper<DutyReport> buildQueryWrapper(DutyReportBo bo) {
         Map<String, Object> params = bo.getParams();
         LambdaQueryWrapper<DutyReport> lqw = Wrappers.lambdaQuery();
-        lqw.like(StringUtils.isNotBlank(bo.getCreateBy()), DutyReport::getCreateBy, bo.getCreateBy());
-        lqw.eq(StringUtils.isNotBlank(bo.getReportContent()), DutyReport::getReportContent, bo.getReportContent());
+        lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), DutyReport::getCreateBy, bo.getCreateBy());
+        lqw.like(StringUtils.isNotBlank(bo.getReportContent()), DutyReport::getReportContent, bo.getReportContent());
+        lqw.like(StringUtils.isNotBlank(bo.getCreateByName()), DutyReport::getCreateByName, bo.getCreateByName());
         lqw.eq(bo.getStatus() != null, DutyReport::getStatus, bo.getStatus());
         if (params.get("beginTime") != null && params.get("endTime") != null) {
-            lqw.between(DutyReport::getDutyDate, Timestamp.valueOf(Convert.toStr(params.get("beginTime")) + " 00:00:00"), Timestamp.valueOf(Convert.toStr(params.get("endTime")) + " 23:59:59"));
+            lqw.between(DutyReport::getCreateTime, Timestamp.valueOf(Convert.toStr(params.get("beginTime")) + " 00:00:00"), Timestamp.valueOf(Convert.toStr(params.get("endTime")) + " 23:59:59"));
         }
-        lqw.orderByDesc(DutyReport::getUpdateTime);
+        lqw.orderByDesc(DutyReport::getCreateTime);
         return lqw;
     }
 
     @Override
     public Boolean insertByBo(DutyReportBo bo) {
+        // 查询是否存在未交班的报告
+        LoginUser cacheLoginUser = UserUtil.getCacheLoginUser();
+        DutyReportVo voOne = this.getVoOne(Wrappers.<DutyReport>lambdaQuery()
+            .eq(DutyReport::getCreateBy, cacheLoginUser.getUsername())
+            .eq(DutyReport::getStatus, 1));
+        if (voOne != null) {
+            throw new ServiceException("存在未交班的报告,请先交班后再提交新的报告!");
+        }
         DutyReport add = BeanUtil.toBean(bo, DutyReport.class);
-        validEntityBeforeSave(add);
-        add.setDutyDate(new Date());
+        add.setStatus(1);
         return save(add);
     }
 
@@ -89,37 +112,100 @@ public class DutyReportServiceImpl extends ServicePlusImpl<DutyReportMapper, Dut
         // 只能修改自己的
         LoginUser cacheLoginUser = UserUtil.getCacheLoginUser();
         if (!dutyReportVo.getCreateBy().equals(cacheLoginUser.getUsername())) {
-            throw new ServiceException("只能编辑自己的报告!");
+            throw new ServiceException("只能编辑自己的值班报告!");
         }
-        /*if (dutyReportVo.getStatus() == 2) {
-            throw new ServiceException("报告已提交不能修改");
-        }*/
-        long l = DateUtil.betweenDay(dutyReportVo.getCreateTime(), DateUtil.date(), false);
+        if (dutyReportVo.getStatus() != 1) {
+            throw new ServiceException("当前报告不能修改");
+        }
+        /*long l = DateUtil.betweenDay(dutyReportVo.getCreateTime(), DateUtil.date(), false);
         if (l > 7) {
             throw new ServiceException("只能对7天内的报告做修改!");
-        }
+        }*/
         DutyReport update = BeanUtil.toBean(bo, DutyReport.class);
-        validEntityBeforeSave(update);
         return updateById(update);
     }
 
+    @Override
+    public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
+        if (isValid) {
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return removeByIds(ids);
+    }
+
     /**
-     * 保存前的数据校验
+     * 交班
      *
-     * @param entity 实体类数据
+     * @param bo
+     * @return
      */
-    private void validEntityBeforeSave(DutyReport entity) {
-        //TODO 做一些数据校验,如唯一约束
-        if (entity.getStatus() != 1 && entity.getStatus() != 2) {
-            throw new ServiceException("状态值非法-" + entity.getStatus());
+    @Override
+    @Transactional
+    public boolean passwork(DutyReportBo bo) {
+        if (StrUtil.hasBlank(bo.getId(), bo.getReportContent())) {
+            throw new ServiceException("存在空值,不能交班!");
         }
+        if ("[]".equals(bo.getReceiveUser())) {
+            throw new ServiceException("接班人员不能为空!");
+        }
+        DutyReportVo dutyReportVo = this.queryById(bo.getId());
+        if (dutyReportVo == null || dutyReportVo.getStatus() != 1) {
+            throw new ServiceException("当前已交班,不能再次交班!");
+        }
+        String days = sysConfigService.selectConfigByKey("report.deadline");
+        Date date = DateUtil.date();
+        Date deadline = DateUtil.offsetDay(date, Convert.toInt(days));
+        // 更新报告数据
+        boolean update = this.update(Wrappers.<DutyReport>lambdaUpdate()
+            .eq(DutyReport::getId, bo.getId())
+            .set(DutyReport::getReportContent, bo.getReportContent())
+            .set(DutyReport::getStatus, 2)
+            .set(DutyReport::getReceiveUser, bo.getReceiveUser())
+            .set(DutyReport::getPassDateTime, date)
+            .set(DutyReport::getDeadline, deadline));
+        // 新增交班记录
+        List<SysUser> sysUsers = JSONUtil.toList(bo.getReceiveUser(), SysUser.class);
+        List<DutyReportRecord> saveList = new ArrayList<>();
+        for (SysUser sysUser : sysUsers) {
+            DutyReportRecord dutyReportRecord = new DutyReportRecord();
+            dutyReportRecord.setReportId(bo.getId());
+            dutyReportRecord.setReportContent(bo.getReportContent());
+            dutyReportRecord.setStatus(2);
+            dutyReportRecord.setCreateBy(bo.getCreateBy());
+            dutyReportRecord.setCreateByName(dutyReportVo.getCreateByName());
+            dutyReportRecord.setReceiveUser(sysUser.getUserName());
+            dutyReportRecord.setReceiveUserName(sysUser.getNickName());
+            dutyReportRecord.setDeadline(deadline);
+            dutyReportRecord.setPassDateTime(date);
+            saveList.add(dutyReportRecord);
+        }
+        dutyReportRecordService.saveAll(saveList);
+        return update;
     }
 
+    /**
+     * 接班
+     *
+     * @param id
+     * @return
+     */
     @Override
-    public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
-        if (isValid) {
-            //TODO 做一些业务上的校验,判断是否需要校验
+    public boolean receivework(String id) {
+        DutyReportRecordVo dutyReportRecordVo = dutyReportRecordService.queryById(id);
+        if (dutyReportRecordVo == null) {
+            return false;
         }
-        return removeByIds(ids);
+        boolean update = dutyReportRecordService.update(Wrappers.<DutyReportRecord>lambdaUpdate()
+            .eq(DutyReportRecord::getId, id)
+            .set(DutyReportRecord::getStatus, 3)
+            .set(DutyReportRecord::getReceiveDateTime, new Date()));
+        if (update) {
+            // 更新报告记录中状态
+            this.update(Wrappers.<DutyReport>lambdaUpdate()
+                .eq(DutyReport::getId, dutyReportRecordVo.getReportId())
+                .eq(DutyReport::getStatus, 2)
+                .set(DutyReport::getStatus, 3));
+        }
+        return update;
     }
 }

+ 18 - 0
ruoyi-zhdd/src/main/resources/mapper/zhdd/DutyReportRecordMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.zhdd.mapper.DutyReportRecordMapper">
+
+    <!--    <resultMap type="com.ruoyi.zhdd.domain.DutyReportRecord" id="DutyReportRecordResult">-->
+    <!--        <result property="id" column="id"/>-->
+    <!--        <result property="reportContent" column="report_content"/>-->
+    <!--        <result property="status" column="status"/>-->
+    <!--        <result property="createBy" column="create_by"/>-->
+    <!--        <result property="createTime" column="create_time"/>-->
+    <!--        <result property="updateBy" column="update_by"/>-->
+    <!--        <result property="updateTime" column="update_time"/>-->
+    <!--    </resultMap>-->
+
+
+</mapper>