From 56e6e579618a13221e56cd49e72c9ac0904da95c Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 06 十一月 2025 14:01:56 +0800
Subject: [PATCH] 代码提交
---
smartor/src/main/java/com/smartor/service/ISchemeAutofinshruleService.java | 2
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml | 73 ++----------------------
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SchemeAutofinshruleController.java | 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java | 69 ++++++++++++++++++++--
ruoyi-admin/src/main/resources/application-local.yml | 2
smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml | 2
ruoyi-admin/src/main/resources/application-druid.yml | 2
smartor/src/main/java/com/smartor/service/impl/SchemeAutofinshruleServiceImpl.java | 2
8 files changed, 74 insertions(+), 80 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SchemeAutofinshruleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SchemeAutofinshruleController.java
index 435d84f..feaed4b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SchemeAutofinshruleController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SchemeAutofinshruleController.java
@@ -17,7 +17,7 @@
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.smartor.domain.SchemeAutofinshrule;
+import com.smartor.domain.SchemeAutofinshrule;
import com.smartor.service.ISchemeAutofinshruleService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
index dbd1ccd..0f9e91a 100644
--- a/ruoyi-admin/src/main/resources/application-druid.yml
+++ b/ruoyi-admin/src/main/resources/application-druid.yml
@@ -24,7 +24,7 @@
# password: Ls@123456
# driver-class-name: org.postgresql.Driver
# 楂樻柉鏁版嵁搴撻摼鎺�
- url: jdbc:postgresql://172.20.32.115:15400/smartorwx?prepareThreshold=0
+ url: jdbc:postgresql://127.0.0.1:15400/smartorwx?prepareThreshold=0
username: shuifang
password: Shuifang@51868
driver-class-name: org.postgresql.Driver
diff --git a/ruoyi-admin/src/main/resources/application-local.yml b/ruoyi-admin/src/main/resources/application-local.yml
index 02158fe..fb8579c 100644
--- a/ruoyi-admin/src/main/resources/application-local.yml
+++ b/ruoyi-admin/src/main/resources/application-local.yml
@@ -19,7 +19,7 @@
# password: csbsbxt@123
# driver-class-name: org.postgresql.Driver
# 鏈湴楂樻柉
- url: jdbc:postgresql://192.168.100.126:5432/postgres
+ url: jdbc:postgresql://127.0.0.1:5432/postgres
username: gaussdb
password: Ls@123456
driver-class-name: org.postgresql.Driver
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
index 07b4dde..bb0465a 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -307,16 +307,63 @@
user.setCreateTime(new Date());
int rows = userMapper.insertUser(user);
//鏂板鐢ㄦ埛涓庨儴闂ㄥ叧鑱�
- if (!CollectionUtils.isEmpty(user.getDepts())) {
- for (Long deptId : user.getDepts()) {
- SysUserDept sysUserDep = new SysUserDept();
- sysUserDep.setUserId(user.getUserId());
- sysUserDep.setDeptId(deptId);
- sysUserDep.setCreateTime(new Date());
- sysUserDep.setUpdateTime(new Date());
- sysUserDeptMapper.insertSysUserDept(sysUserDep);
+// if (!CollectionUtils.isEmpty(user.getDepts())) {
+// for (Long deptId : user.getDepts()) {
+// SysUserDept sysUserDep = new SysUserDept();
+// sysUserDep.setUserId(user.getUserId());
+// sysUserDep.setDeptId(deptId);
+// sysUserDep.setCreateTime(new Date());
+// sysUserDep.setUpdateTime(new Date());
+// sysUserDeptMapper.insertSysUserDept(sysUserDep);
+// }
+// }
+ if (!CollectionUtils.isEmpty(user.getDeptCodes())) {
+ for (String deptCode : user.getDeptCodes()) {
+ SysDept sysDept = sysDeptMapper.selectDeptByCode(deptCode);
+ if (Objects.isNull(sysDept)) {
+ log.error("閮ㄩ棬缂栫爜涓嶅瓨鍦�");
+ continue;
+ }
+
+ SysUserDept sysUserDept = new SysUserDept();
+ sysUserDept.setUserId(user.getUserId());
+ sysUserDept.setDeptCode(deptCode);
+ sysUserDept.setDeptId(sysDept.getDeptId());
+ List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
+ sysUserDept.setDelFlag(0L);
+ sysUserDept.setDeptType("1");
+ sysUserDept.setDeptName(sysDept.getDeptName());
+ sysUserDept.setUpdateTime(new Date());
+ if (!CollectionUtils.isEmpty(sysUserDepts)) {
+ sysUserDeptMapper.updateSysUserDept(sysUserDept);
+ continue;
+ }
+ sysUserDept.setCreateTime(new Date());
+ sysUserDeptMapper.insertSysUserDept(sysUserDept);
}
}
+ if (!CollectionUtils.isEmpty(user.getWardCodes())) {
+ for (String wardCode : user.getWardCodes()) {
+ SysDept sysDept = sysDeptMapper.selectDeptByCode(wardCode);
+
+ SysUserDept sysUserDept = new SysUserDept();
+ sysUserDept.setUserId(user.getUserId());
+ sysUserDept.setDeptCode(wardCode);
+ List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
+ sysUserDept.setDelFlag(0L);
+ sysUserDept.setDeptType("2");
+ sysUserDept.setDeptName(sysDept.getDeptName());
+ sysUserDept.setUpdateTime(new Date());
+ if (!CollectionUtils.isEmpty(sysUserDepts)) {
+ sysUserDeptMapper.updateSysUserDept(sysUserDept);
+ continue;
+ }
+ sysUserDept.setCreateTime(new Date());
+ sysUserDeptMapper.insertSysUserDept(sysUserDept);
+ }
+ }
+
+
// 鏂板鐢ㄦ埛宀椾綅鍏宠仈
insertUserPost(user);
// 鏂板鐢ㄦ埛涓庤鑹茬鐞�
@@ -380,10 +427,15 @@
if (!CollectionUtils.isEmpty(user.getDeptCodes())) {
for (String deptCode : user.getDeptCodes()) {
SysDept sysDept = sysDeptMapper.selectDeptByCode(deptCode);
+ if (Objects.isNull(sysDept)) {
+ log.error("閮ㄩ棬缂栫爜涓嶅瓨鍦�");
+ continue;
+ }
SysUserDept sysUserDept = new SysUserDept();
sysUserDept.setUserId(user.getUserId());
sysUserDept.setDeptCode(deptCode);
+ sysUserDept.setDeptId(sysDept.getDeptId());
List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
sysUserDept.setDelFlag(0L);
sysUserDept.setDeptType("1");
@@ -405,6 +457,7 @@
sysUserDept.setUserId(user.getUserId());
sysUserDept.setDeptCode(wardCode);
List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
+ sysUserDept.setDeptId(sysDept.getDeptId());
sysUserDept.setDelFlag(0L);
sysUserDept.setDeptType("2");
sysUserDept.setDeptName(sysDept.getDeptName());
diff --git a/smartor/src/main/java/com/smartor/service/ISchemeAutofinshruleService.java b/smartor/src/main/java/com/smartor/service/ISchemeAutofinshruleService.java
index eeb78d6..4a54189 100644
--- a/smartor/src/main/java/com/smartor/service/ISchemeAutofinshruleService.java
+++ b/smartor/src/main/java/com/smartor/service/ISchemeAutofinshruleService.java
@@ -1,7 +1,7 @@
package com.smartor.service;
import java.util.List;
-import com.ruoyi.smartor.domain.SchemeAutofinshrule;
+import com.smartor.domain.SchemeAutofinshrule;
/**
* 鏂规缁撴瑙勫垯Service鎺ュ彛
diff --git a/smartor/src/main/java/com/smartor/service/impl/SchemeAutofinshruleServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SchemeAutofinshruleServiceImpl.java
index aa9e0d1..edbfa30 100644
--- a/smartor/src/main/java/com/smartor/service/impl/SchemeAutofinshruleServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/SchemeAutofinshruleServiceImpl.java
@@ -1,7 +1,7 @@
package com.smartor.service.impl;
import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.smartor.domain.SchemeAutofinshrule;
+import com.smartor.domain.SchemeAutofinshrule;
import com.smartor.mapper.SchemeAutofinshruleMapper;
import com.smartor.service.ISchemeAutofinshruleService;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
index 3409748..894cd2e 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -674,72 +674,13 @@
</delete>
<select id="getDeptRanking" parameterType="com.smartor.domain.PatMedReq" resultType="com.smartor.domain.PatMedRes">
- SELECT deptname, COUNT(1) AS rc
- FROM (
- <if test="mz != null">
- SELECT deptname
- FROM pat_med_outhosp
- <where>
- del_flag=0
- <if test="deptcodeList != null">
- and deptcode in
- <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
- #{deptcode}
- </foreach>
- </if>
- </where>
- </if>
- <if test="mz != null and zy != null">
- UNION ALL
- </if>
- <if test="zy != null">
- SELECT deptname
- FROM pat_med_inhosp
- <where>
- del_flag=0
- and inhospstate=0
- <if test="deptcodeList != null">
- and deptcode in
- <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
- #{deptcode}
- </foreach>
- </if>
- </where>
- </if>
- <if test="cy != null and zy != null">
- UNION ALL
- SELECT deptname
- FROM pat_med_inhosp
- <where>
- del_flag=0
- and inhospstate=1
- <if test="deptcodeList != null">
- and deptcode in
- <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
- #{deptcode}
- </foreach>
- </if>
- </where>
- </if>
- <if test="mz != null and zy != null and cy==null">
- UNION ALL
- SELECT deptname
- FROM pat_med_inhosp
- <where>
- del_flag=0
- and inhospstate=1
- <if test="deptcodeList != null">
- and deptcode in
- <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
- #{deptcode}
- </foreach>
- </if>
- </where>
- </if>
- ) AS combined
- GROUP BY deptname;
-
-
+ SELECT deptname,
+ count(1) AS rc
+ FROM service_subtask
+ WHERE finishtime >= #{startDate}
+ AND finishtime <= #{endDate}
+ AND deptname is not null
+ GROUP BY deptname
</select>
<select id="selectPatMedInhospCount" parameterType="com.smartor.domain.PatMedReq"
resultType="com.smartor.domain.PatMedRes">
diff --git a/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml b/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml
index e47860c..c402e2a 100644
--- a/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml
@@ -176,7 +176,7 @@
d.leader,
d.status as dept_status
from sys_dept d
- left join sys_user_dept ud on d.dept_id = ud.dept_id
+ left join sys_user_dept ud on d.dept_code = ud.dept_code
where ud.user_id = #{userId}
and ud.del_flag = 0
and d.del_flag = 0
--
Gitblit v1.9.3