From 44f2a0a32c096bdb05d4cc0ac162cdc1eb14c3ed Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期四, 10 八月 2023 13:14:29 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java | 119 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 96 insertions(+), 23 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
index 1cc805a..5dd4f92 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
@@ -1,16 +1,28 @@
package com.ruoyi.app.patrolplan.controller;
+import java.text.ParseException;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
+import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
+import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
+import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService;
import com.ruoyi.app.patrolplan.domain.ArdAppPatrolpoint;
+import com.ruoyi.app.patrolplan.domain.ArdAppPatrolpointRecord;
+import com.ruoyi.app.patrolplan.domain.param.ArdAppPatrolpointRecordParam;
+import com.ruoyi.app.patrolplan.service.IArdAppPatrolpointRecordService;
import com.ruoyi.app.patrolplan.service.IArdAppPatrolpointService;
import com.ruoyi.app.patrolplan.service.IArdAppPatroluserService;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.system.service.ISysDeptService;
+import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.utils.result.Results;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -54,6 +66,18 @@
@Resource
IArdAppPatroluserService ardAppPatroluserService;
+ @Resource
+ ISysUserService sysUserService;
+
+ @Resource
+ ISysDeptService sysDeptService;
+
+ @Resource
+ IArdAlarmpointsWellService wellService;
+
+ @Resource
+ IArdAppPatrolpointRecordService recordService;
+
/**
* 鏌ヨapp宸℃璁″垝鍒楄〃
*/
@@ -62,6 +86,14 @@
@ApiOperation("鏌ヨ鍏ㄩ儴宸℃鍒楄〃鍙婃悳绱㈢瓫閫�")
public Results list(ArdAppPatrolplan ardAppPatrolplan)
{
+ String userId = SecurityUtils.getUserId();
+ ardAppPatrolplan.setUserId(userId);
+ if(ardAppPatrolplan.getPageNum()==null || ardAppPatrolplan.getPageNum() == 0){
+ ardAppPatrolplan.setPageNum(1);
+ }
+ if(ardAppPatrolplan.getPageSize()==null || ardAppPatrolplan.getPageSize() == 0){
+ ardAppPatrolplan.setPageSize(10);
+ }
PageHelper.startPage(ardAppPatrolplan.getPageNum(),ardAppPatrolplan.getPageSize());
List<ArdAppPatrolplan> list = ardAppPatrolplanService.selectArdAppPatrolplanList(ardAppPatrolplan);
return Results.succeed(new PageInfo<>(list));
@@ -95,13 +127,13 @@
/**
* 鏍规嵁宸℃ID鏌ヨ宸℃浜�
*/
- /*@PreAuthorize("@ss.hasPermi('app:appPatrolplan:userByPlanId')")
+ @PreAuthorize("@ss.hasPermi('app:appPatrolplan:userByPlanId')")
@GetMapping(value = "userByPlanId/{id}")
- @ApiOperation("鏍规嵁宸℃ID鏌ヨ宸℃浜�")
+ @ApiOperation("鏍规嵁宸℃ID鏌ヨ宸℃浜哄憳")
public Results userByPlanId(@PathVariable String id)
{
return ardAppPatroluserService.userByPlanId(id);
- }*/
+ }
/**
* 鍒犻櫎app宸℃璁″垝
@@ -117,27 +149,24 @@
return toAjax(ardAppPatrolplanService.deleteArdApp(id));
}
-
- /**
- * 鏂板app宸℃璁″垝
- */
- @PreAuthorize("@ss.hasPermi('app:appPatrolplan:add')")
- @Log(title = "app宸℃璁″垝", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody ArdAppPatrolplan ardAppPatrolplan)
+ @PreAuthorize("@ss.hasPermi('app:appPatrolplan:allPlanUser')")
+ @PostMapping("allPlanUser")
+ @ApiOperation("鏌ヨ鏉冮檺涓嬪叏閮ㄤ汉鍛樺拰鍏磋叮鐐�")
+ public Results allPlanUser()
{
- return toAjax(ardAppPatrolplanService.insertArdAppPatrolplan(ardAppPatrolplan));
- }
-
- /**
- * 淇敼app宸℃璁″垝
- */
- @PreAuthorize("@ss.hasPermi('app:appPatrolplan:edit')")
- @Log(title = "app宸℃璁″垝", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody ArdAppPatrolplan ardAppPatrolplan)
- {
- return toAjax(ardAppPatrolplanService.updateArdAppPatrolplan(ardAppPatrolplan));
+ JSONObject jsonObject = new JSONObject();
+ String userId = SecurityUtils.getUserId();
+ //鏍规嵁userId鏌ヨ閮ㄩ棬Id
+ SysUser sysUser = sysUserService.selectUserById(userId);
+ //鏍规嵁褰撳墠deptId鎴栬�呭綋鍓嶅強鎵�灞炰笅绾х殑鎵�鏈塪eptId
+ List<Long> deptList = sysDeptService.deptIdBySub(sysUser.getDeptId());
+ //鏍规嵁deptId鍒楄〃鑾峰彇鍒版墍鏈夌敤鎴�
+ List<SysUser> sysUserList = sysUserService.userByDeptList(deptList);
+ jsonObject.put("user",sysUserList);
+ //鏍规嵁deptId鍒楄〃鑾峰彇鍒版墍鏈夊叴瓒g偣
+ List<ArdAlarmpointsWell> wellList = wellService.wellByDeptList(deptList);
+ jsonObject.put("well",wellList);
+ return Results.succeed(jsonObject);
}
/**
@@ -151,4 +180,48 @@
{
return toAjax(ardAppPatrolplanService.insertArdAppPatrolplan(para));
}
+
+ /**
+ * 鏌ヨ鍗曟潯鏁版嵁
+ */
+ @PreAuthorize("@ss.hasPermi('app:appPatrolplan:oneById')")
+ @PostMapping("/oneById/{id}")
+ @ApiOperation("鏌ヨ鍗曟潯鏁版嵁")
+ public Results oneById(@PathVariable String id)
+ {
+ return ardAppPatrolplanService.oneById(id);
+ }
+
+ /**
+ * 淇敼app宸℃璁″垝
+ */
+ @PreAuthorize("@ss.hasPermi('app:appPatrolplan:edit')")
+ @Log(title = "app宸℃璁″垝", businessType = BusinessType.UPDATE)
+ @ApiOperation("淇敼鍗曟潯鏁版嵁")
+ @PutMapping("upd")
+ public Results edit(@RequestBody Map<String,Object> para)
+ {
+ return ardAppPatrolplanService.updateArdAppPatrolplan(para);
+ }
+
+ /**
+ * 宸℃鎵撳崱
+ */
+ @PreAuthorize("@ss.hasPermi('app:appPatrolplan:record')")
+ @ApiOperation("宸℃鎵撳崱")
+ @PostMapping("record")
+ public Results edit(@RequestBody ArdAppPatrolpointRecord ardAppPatrolpointRecord) {
+ return recordService.record(ardAppPatrolpointRecord);
+ }
+
+ /**
+ * 宸℃鏃ュ巻
+ */
+ @PreAuthorize("@ss.hasPermi('app:appPatrolplan:recordMonth')")
+ @ApiOperation("宸℃鏃ュ巻")
+ @PostMapping("recordMonth")
+ public Results recordMonth(@RequestBody ArdAppPatrolpointRecordParam ardAppPatrolpointRecordParam) throws ParseException {
+ return recordService.recordMonth(ardAppPatrolpointRecordParam);
+ }
+
}
--
Gitblit v1.9.3