Forráskód Böngészése

修复黄主任提出bug

lsw 2 hónapja
szülő
commit
ec9f425c56

+ 6 - 2
admin-ui/src/views/system/user/edit.vue

@@ -2,11 +2,14 @@
   <div class="cmain">
     <el-form ref="form" :model="form" :rules="rules" label-width="100px">
       <el-form-item label="所属角色">
-        <el-select v-model="form.roleIds" multiple placeholder="请选择角色">
+        <el-select v-model="form.roleIds" multiple placeholder="请选择角色" v-if="user.roleName == '科室主任'">
+          <el-option label="医生" :value="4"></el-option>
+        </el-select>
+        <el-select v-model="form.roleIds" multiple placeholder="请选择角色" v-else>
           <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="证件照" prop="avatar" v-if="form.roleIds.includes(4)"><cropper v-model="form.avatar" :fixed_number="[1, 1.4]"></cropper></el-form-item>
+      <el-form-item label="证件照" prop="avatar"><cropper v-model="form.avatar" :fixed_number="[1, 1.4]"></cropper></el-form-item>
       <el-row>
         <el-col :span="12">
           <el-form-item v-if="form.userId == undefined" label="登录账号" prop="userName">
@@ -64,6 +67,7 @@ export default {
   components: { Treeselect },
   data() {
     return {
+      user: this.$store.state.user,
       form: { roleIds: [], vShow: 0 },
       // 岗位选项
       postOptions: [],

+ 7 - 1
admin-ui/src/views/work/follow/record/index.vue

@@ -23,7 +23,7 @@
     </el-row>
 
     <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
-      <el-table-column type="selection" width="55" align="center" v-if="user.roleName == '超级管理员' || user.roleName == '管理员'"/>
+      <el-table-column type="selection" width="55" align="center" v-if="user.roleName == '超级管理员' || user.roleName == '管理员'" />
       <el-table-column label="模板名称" align="left" prop="templateName" />
       <el-table-column label="患者姓名" align="center" prop="patientName" width="100" />
       <el-table-column label="住院号" align="center" prop="blh" width="120" />
@@ -67,6 +67,7 @@ export default {
   data() {
     return {
       user: this.$store.state.user,
+      dateRange: [],
       queryParams: {
         pageNum: 1,
         pageSize: 10,
@@ -85,6 +86,10 @@ export default {
   },
   methods: {
     getList() {
+      if (this.dateRange) {
+        this.queryParams.dateBegin = this.dateRange[0];
+        this.queryParams.dateEnd = this.dateRange[1];
+      }
       this.ajax({ url: '/work/record/list', data: this.queryParams }).then((response) => {
         this.response = response;
       });
@@ -95,6 +100,7 @@ export default {
     },
     resetQuery() {
       this.resetForm('queryForm');
+      this.dateRange = [];
       this.handleQuery();
     },
     selects(rows) {

+ 17 - 11
app/pages/user/bind/add.vue

@@ -69,18 +69,24 @@ export default {
 				uni.showModal({ content: this.verify.error, showCancel: false });
 				return false;
 			}
-			this.http.request({
-				url: '/app/user/bind',
-				method: 'POST',
-				data: this.item,
-				success: (res) => {
-					uni.showModal({
-						title: '提示',
-						content: '绑定成功',
-						showCancel: false,
+			//通知模板订阅消息
+			uni.requestSubscribeMessage({
+				tmplIds: ['1Jvx8F22na-tG2Q6HFX_3vRtbiv7zZko6NwX8ICIFXc', 'S6JARkInVBjID8QMpgZdSHNyxeMDZQq7lur8YrNK0oY'],
+				complete: (c) => {
+					this.http.request({
+						url: '/app/user/bind',
+						method: 'POST',
+						data: this.item,
 						success: (res) => {
-							uni.$emit('bind');
-							uni.navigateBack();
+							uni.showModal({
+								title: '提示',
+								content: '绑定成功',
+								showCancel: false,
+								success: (res) => {
+									uni.$emit('bind');
+									uni.navigateBack();
+								}
+							});
 						}
 					});
 				}

+ 31 - 27
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/FollowRecordServiceImpl.java

@@ -123,34 +123,38 @@ public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, Fol
 
     @Override
     public void sendMessage(FollowRecord record) {
-        JSONObject jsonObject = JSONUtil.parseObj(HttpUtil.get("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + env.getProperty("wx.appid") + "&secret=" + env.getProperty("wx.appSecret")));
-        JSONObject body = new JSONObject();
-        body.set("appid", env.getProperty("wx.appid"));
-        JSONObject content = new JSONObject();
-        User user = userService.selectUserByPatientId(record.getPatientId());
-        if (user == null) {
-            return;
+        try {
+            JSONObject jsonObject = JSONUtil.parseObj(HttpUtil.get("https://api.weixin.qq.com:4430/cgi-bin/token?grant_type=client_credential&appid=" + env.getProperty("wx.appid") + "&secret=" + env.getProperty("wx.appSecret")));
+            JSONObject body = new JSONObject();
+            body.set("appid", env.getProperty("wx.appid"));
+            JSONObject content = new JSONObject();
+            User user = userService.selectUserByPatientId(record.getPatientId());
+            if (user == null) {
+                return;
+            }
+            body.set("touser", user.getOpenId());
+            body.set("page", "pages/user/index?patientId=" + record.getPatientId());
+            //复查提醒
+            if (record.getType() == 0) {
+                body.set("template_id", "S6JARkInVBjID8QMpgZdSHNyxeMDZQq7lur8YrNK0oY");
+                content.set("thing1", new JSONObject().set("value", record.getTemplateName()));//复查提醒名称
+                content.set("thing3", new JSONObject().set("value", "岑溪人民医院"));//复查机构
+                content.set("thing6", new JSONObject().set("value", StringUtils.truncateTo12Chars(record.getOp())));//备注
+            }
+            //随访提醒
+            if (record.getType() == 1) {
+                body.set("template_id", "1Jvx8F22na-tG2Q6HFX_3vRtbiv7zZko6NwX8ICIFXc");
+                content.set("thing11", new JSONObject().set("value", record.getTemplateName()));//随访名称
+                content.set("thing2", new JSONObject().set("value", "岑溪人民医院"));//随访机构
+                content.set("phrase3", new JSONObject().set("value", record.getPatientName()));//就诊人
+            }
+            body.set("data", content);
+            String result = HttpUtil.post("https://api.weixin.qq.com:4430/cgi-bin/message/subscribe/send?access_token=" + jsonObject.getStr("access_token"), body.toString());
+            System.out.println("body:" + body);
+            System.out.println("小程序订阅消息:" + result);
+        } catch (Exception e) {
+            System.out.println("小程序订阅消息发送失败");
         }
-        body.set("touser", user.getOpenId());
-        body.set("page", "pages/user/index?patientId=" + record.getPatientId());
-        //复查提醒
-        if (record.getType() == 0) {
-            body.set("template_id", "S6JARkInVBjID8QMpgZdSHNyxeMDZQq7lur8YrNK0oY");
-            content.set("thing1", new JSONObject().set("value", record.getTemplateName()));//复查提醒名称
-            content.set("thing3", new JSONObject().set("value", "岑溪人民医院"));//复查机构
-            content.set("thing6", new JSONObject().set("value", StringUtils.truncateTo12Chars(record.getOp())));//备注
-        }
-        //随访提醒
-        if (record.getType() == 1) {
-            body.set("template_id", "1Jvx8F22na-tG2Q6HFX_3vRtbiv7zZko6NwX8ICIFXc");
-            content.set("thing11", new JSONObject().set("value", record.getTemplateName()));//随访名称
-            content.set("thing2", new JSONObject().set("value", "岑溪人民医院"));//随访机构
-            content.set("phrase3", new JSONObject().set("value", record.getPatientName()));//就诊人
-        }
-        body.set("data", content);
-        String result = HttpUtil.post("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + jsonObject.getStr("access_token"), body.toString());
-        System.out.println("body:" + body);
-        System.out.println("小程序订阅消息:" + result);
     }
 
     @Override

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/UserServiceImpl.java

@@ -57,7 +57,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
 
     @Override
     public AjaxResult login(LoginDto dto) throws ServerException {
-        JSONObject res = JSON.parseObject(HttpUtils.sendGet("https://api.weixin.qq.com/sns/jscode2session?appid=" + env.getProperty("wx.appid") + "&secret=" + env.getProperty("wx.appSecret") + "&js_code=" + dto.getCode() + "&grant_type=authorization_code", null));
+        JSONObject res = JSON.parseObject(HttpUtils.sendGet("https://api.weixin.qq.com:4430/sns/jscode2session?appid=" + env.getProperty("wx.appid") + "&secret=" + env.getProperty("wx.appSecret") + "&js_code=" + dto.getCode() + "&grant_type=authorization_code", null));
         if (StringUtils.isNotEmpty(res.getString("errmsg"))) {
             return AjaxResult.error("获取openid失败");
         }

+ 2 - 0
ruoyi-admin/src/main/resources/mapper/work/FollowRecordMapper.xml

@@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN tb_patient p ON p.id=k.patient_id
         LEFT JOIN tb_visit v ON v.pat_id=k.patient_id
         WHERE 1=1
+            AND k.dept_id=v.dept_id
             <if test="type != null "> and k.type = #{type}</if>
             <if test="delFlag != null "> and k.del_flag = #{delFlag}</if>
             <if test="patientName != null  and patientName != ''"> AND k.patient_name like concat('%', #{patientName}, '%')</if>
@@ -31,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userId != null "> and k.user_id = #{userId}</if>
             <if test="state != null "> and k.state = #{state}</if>
             <if test="deptId != null "> and k.dept_id = #{deptId}</if>
+            <if test="dateBegin != null  and dateBegin != ''"> AND k.create_time BETWEEN #{dateBegin} AND #{dateEnd} + INTERVAL 1 DAY</if>
             <if test="deptId != null and deptId != 0">AND (k.dept_id = #{deptId} OR k.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))</if>
             <!-- 数据范围过滤 -->
             ${params.dataScope}