From de23667e4e91fcfb6c22bf9cdcdf55c34c443fc9 Mon Sep 17 00:00:00 2001
From: du <1725534722@qq.com>
Date: Tue, 6 Aug 2024 19:13:28 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E5=A4=A7?=
=?UTF-8?q?=E5=B1=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/JSmartRemindersController.java | 39 ++++++++++++++++---
.../mapper/jjh/ent/JDataScreenMapper.xml | 5 ++-
.../jjh/ent/JHeadQuartersRevenueMapper.xml | 8 ++--
.../mapper/jjh/ent/JServicesListMapper.xml | 27 +++++++++----
4 files changed, 61 insertions(+), 18 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/jjh/ent/controller/JSmartRemindersController.java b/ruoyi-admin/src/main/java/com/ruoyi/jjh/ent/controller/JSmartRemindersController.java
index 44678e1..adad37d 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/jjh/ent/controller/JSmartRemindersController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/jjh/ent/controller/JSmartRemindersController.java
@@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.io.Serializable;
+import java.util.Objects;
/**
* 智能提醒(j_smart_reminders)表控制层
@@ -195,14 +196,42 @@ public class JSmartRemindersController extends BaseController {
* @param dq 实体对象
* @return 修改结果
*/
- @PreAuthorize("@ss.hasAnyRoles('admin,other-gov')")
+ @PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov')")
@ApiOperation(value = "修改定期提醒数据")
@PostMapping("/updateDq")
public AjaxResult updateDq(@RequestBody @Valid JSmartRemindersDq dq) throws SchedulerException, TaskException {
- if (dq.getAlertType() == 1 || dq.getAlertType() == 4) {
- return success(jSmartRemindersService.updateDq(dq));
- } else {
- throw new ServiceException("请选择正确类型!");
+ // 看当前用户是否是admin
+ boolean admin = false;
+ //查看是other-gov还是gov
+ boolean b = false;
+ boolean c = false;
+ Long userId = null;
+ try {
+ admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
+ b = SecurityUtils.hasRole("other-gov");
+ c = SecurityUtils.hasRole("gov");
+ userId=SecurityUtils.getUserId();
+ } catch (Exception ignored) {
+ }
+ if (admin || b) {
+ if (dq.getAlertType() == 1 || dq.getAlertType() == 4) {
+ return success(jSmartRemindersService.updateDq(dq));
+ } else {
+ throw new ServiceException("请选择正确类型!");
+ }
+ }else if(c){
+ JSmartReminders bys = jSmartRemindersService.getById(dq.getId());
+ if(!Objects.equals(bys.getCreateId(), userId)){
+ throw new ServiceException("您暂无权限修改他人的定时提醒!");
+ }else {
+ if (dq.getAlertType() == 1 || dq.getAlertType() == 4) {
+ return success(jSmartRemindersService.updateDq(dq));
+ } else {
+ throw new ServiceException("请选择正确类型!");
+ }
+ }
+ }else {
+ throw new ServiceException("修改失败,请联系管理员!");
}
}
diff --git a/ruoyi-admin/src/main/resources/mapper/jjh/ent/JDataScreenMapper.xml b/ruoyi-admin/src/main/resources/mapper/jjh/ent/JDataScreenMapper.xml
index 6fd9c64..cd1c447 100644
--- a/ruoyi-admin/src/main/resources/mapper/jjh/ent/JDataScreenMapper.xml
+++ b/ruoyi-admin/src/main/resources/mapper/jjh/ent/JDataScreenMapper.xml
@@ -25,6 +25,7 @@
COUNT(DISTINCT credit_code),
COUNT(*)) AS count
FROM j_project
+ where status = 5
GROUP BY project_big_type) AS rs ON a.dict_value = rs.project_big_type
LEFT JOIN (SELECT project_middle_type,
IF
@@ -34,15 +35,17 @@
COUNT(DISTINCT credit_code),
COUNT(*)) AS count
FROM j_project
+ where status = 5
GROUP BY project_middle_type) AS ys ON b.dict_value = ys.project_middle_type
LEFT JOIN (SELECT project_small_type,
IF(project_small_type = 14, COUNT(DISTINCT credit_code), COUNT(*)) AS count
FROM j_project
+ where status = 5
GROUP BY project_small_type) AS us ON c.dict_value = us.project_small_type
LEFT JOIN (SELECT ns.project_small_type,
COUNT(*) AS count
FROM j_project ns
- WHERE YEAR(
+ WHERE status = 5 and YEAR(
NOW()) = ns.project_year
GROUP BY ns.project_small_type) AS ns ON c.dict_value = ns.project_small_type
WHERE a.dict_type = 'project_categories'
diff --git a/ruoyi-admin/src/main/resources/mapper/jjh/ent/JHeadQuartersRevenueMapper.xml b/ruoyi-admin/src/main/resources/mapper/jjh/ent/JHeadQuartersRevenueMapper.xml
index ab830cf..150b388 100644
--- a/ruoyi-admin/src/main/resources/mapper/jjh/ent/JHeadQuartersRevenueMapper.xml
+++ b/ruoyi-admin/src/main/resources/mapper/jjh/ent/JHeadQuartersRevenueMapper.xml
@@ -16,11 +16,11 @@
ELSE '服务业总部'
END as type,
a.hydm,
- IFNULL( ROUND( a.revenue / 10000, 3 ), '-' ) AS revenue,
- IFNULL( ROUND( a.taxation / 10000, 3 ), '-' ) AS taxation,
+ IFNULL( ROUND( a.revenue / 10000, 1 ), '-' ) AS revenue,
+ IFNULL( ROUND( a.taxation / 10000, 1 ), '-' ) AS taxation,
a.years,
- IFNULL( a.output, '-' ) AS output,
- IFNULL( a.sales, '-' ) AS sales
+ IFNULL( ROUND( a.output / 10000, 1 ), '-' ) AS output,
+ IFNULL( ROUND( a.sales / 10000, 1 ), '-' ) AS sales
FROM
(
SELECT
diff --git a/ruoyi-admin/src/main/resources/mapper/jjh/ent/JServicesListMapper.xml b/ruoyi-admin/src/main/resources/mapper/jjh/ent/JServicesListMapper.xml
index 90788a0..325c440 100644
--- a/ruoyi-admin/src/main/resources/mapper/jjh/ent/JServicesListMapper.xml
+++ b/ruoyi-admin/src/main/resources/mapper/jjh/ent/JServicesListMapper.xml
@@ -28,14 +28,25 @@