病案申请小程序后台

master
lixin 4 years ago
parent 4a58de4841
commit 29014d0891

@ -208,6 +208,14 @@
<version>${ruoyi.version}</version>
</dependency>
<!-- 病案申请模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>wx-record-order</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
@ -225,6 +233,7 @@
<module>ruoyi-quartz</module>
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
<module>wx-record-order</module>
</modules>
<packaging>pom</packaging>

@ -80,6 +80,25 @@
</dependency>
</dependencies>
<profiles>
<!-- 开发环境 -->
<profile>
<id>local</id>
<properties>
<active.env>local</active.env>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-- 生产环境 -->
<profile>
<id>prod</id>
<properties>
<active.env>prod</active.env>
</properties>
</profile>
</profiles>
<build>
<plugins>
@ -98,17 +117,48 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
<filters>
<filter>src/main/resources/application.yml</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>application-*.*</exclude>
<exclude>META-INF/**</exclude>
<exclude>static/**</exclude>
<exclude>template/**</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>application-druid.yml</include>
<include>META-INF/**</include>
<include>static/**</include>
<include>template/**</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>application-${active.env}.*</include>
</includes>
</resource>
</resources>
</build>
</project>

@ -4,11 +4,6 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: password
# 从库数据源
slave:
# 从数据源开关/默认关闭

@ -0,0 +1,14 @@
# 项目相关配置
ruoyi:
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath
spring:
datasource:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: docus702

@ -0,0 +1,15 @@
# 项目相关配置
ruoyi:
# 实例演示开关
demoEnabled: false
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: C:/wwwroot/wx.docus.cn/uploadPath
spring:
datasource:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/wx_docus_cn?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: wx_docus_cn
password: Bj87yZBAxECG5kTG

@ -1,13 +1,11 @@
# 项目相关配置
ruoyi:
# 名称
name: RuoYi
name: Docus
# 版本
version: 4.6.0
# 版权年份
copyrightYear: 2021
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath
# 获取ip地址开关
@ -16,10 +14,11 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口默认为80
port: 80
port: 8080
servlet:
# 应用的访问路径
context-path: /
domain: https://wx.docus.cn
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
@ -40,6 +39,16 @@ user:
# 密码错误{maxRetryCount}次锁定10分钟
maxRetryCount: 5
wx:
appid: wxa35fbc494f55cdd1
appsecret: 81c02b2758b9e9b7c0b41aa01f336353
aliyun:
accesskey-id: LTAIANCnxPby45Y8
accesskey-secret: tMmutQW2J1TkNmmEMXeltepnmr47jh
sms:
sign-name: 嘉时软件
# Spring配置
spring:
# 模板引擎
@ -56,14 +65,14 @@ spring:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
profiles:
active: druid
active: druid,@active.env@
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
max-file-size: 1GB
# 设置总上传的文件大小
max-request-size: 20MB
max-request-size: 20GB
# 服务模块
devtools:
restart:
@ -127,11 +136,11 @@ xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice/*
excludes: /system/notice/*,/wx/api/*
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
# Swagger配置
swagger:
# 是否开启swagger
enabled: true
enabled: false

@ -86,6 +86,19 @@
timeToLiveSeconds="0"
timeToIdleSeconds="0"
statistics="false"/>
<!-- 微信用户缓存 -->
<cache name="wx-userCache"
maxEntriesLocalHeap="2000"
eternal="false"
timeToIdleSeconds="600"
timeToLiveSeconds="0"
overflowToDisk="false"
statistics="false">
</cache>
<!-- 微信token缓存 -->
<cache name="wx-accessCache"
maxEntriesLocalHeap="10"
eternal="true">
</cache>
</ehcache>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 88 KiB

@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<title>若依系统首页</title>
<title>系统首页</title>
<!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link th:href="@{favicon.ico}" rel="shortcut icon"/>
@ -26,7 +26,7 @@
</div>
<a th:href="@{/index}">
<li class="logo hidden-xs">
<span class="logo-lg">RuoYi</span>
<span class="logo-lg">Docus</span>
</li>
</a>
<div class="sidebar-collapse">
@ -188,7 +188,6 @@
</a>
</div>
<ul class="nav navbar-top-links navbar-right welcome-message">
<li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="开发文档" href="http://doc.ruoyi.vip/ruoyi" target="_blank"><i class="fa fa-question-circle"></i> 文档</a></li>
<li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="锁定屏幕" href="#" id="lockScreen"><i class="fa fa-lock"></i> 锁屏</a></li>
<li><a data-toggle="tooltip" data-trigger="hover" data-placement="bottom" title="全屏显示" href="#" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏</a></li>
<li class="dropdown user-menu">
@ -246,7 +245,7 @@
</div>
<div th:if="${ignoreFooter}" class="footer">
<div class="pull-right">© [[${copyrightYear}]] RuoYi Copyright </div>
<div class="pull-right">© [[${copyrightYear}]] Docus Copyright </div>
</div>
</div>
<!--右侧部分结束-->

@ -3,8 +3,8 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>登录若依系统</title>
<meta name="description" content="若依后台管理框架">
<title>登录系统</title>
<meta name="description" content="后台管理">
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link href="../static/css/style.css" th:href="@{/css/style.css}" rel="stylesheet"/>
@ -23,20 +23,9 @@
<body class="signin">
<div class="signinpanel">
<div class="row">
<div class="col-sm-7">
<div class="col-sm-4">
<div class="signin-info">
<div class="logopanel m-b">
<h1><img alt="[ 若依 ]" src="../static/ruoyi.png" th:src="@{/ruoyi.png}"></h1>
</div>
<div class="m-b"></div>
<h4>欢迎使用 <strong>若依 后台管理系统</strong></h4>
<ul class="m-b">
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> SpringBoot</li>
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Mybatis</li>
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Shiro</li>
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Thymeleaf</li>
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Bootstrap</li>
</ul>
<strong th:if="${@config.getKey('sys.account.registerUser')}">还没有账号? <a th:href="@{/register}">立即注册&raquo;</a></strong>
</div>
</div>
@ -65,7 +54,7 @@
</div>
<div class="signup-footer">
<div class="pull-left">
Copyright © 2018-2021 ruoyi.vip All Rights Reserved. <br>
Copyright © 2018-2021 docus.com All Rights Reserved. <br>
</div>
</div>
</div>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,336 +0,0 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>统计</title>
<link rel="shortcut icon" href="favicon.ico">
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link href="../static/css/main/animate.min.css" th:href="@{/css/main/animate.min.css}" rel="stylesheet"/>
<link href="../static/css/main/style.min862f.css" th:href="@{/css/main/style.min862f.css}" rel="stylesheet"/>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-sm-3">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-success pull-right"></span>
<h5>收入</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">40 886,200</h1>
<div class="stat-percent font-bold text-success">98% <i class="fa fa-bolt"></i>
</div>
<small>总收入</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-info pull-right">全年</span>
<h5>订单</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">275,800</h1>
<div class="stat-percent font-bold text-info">20% <i class="fa fa-level-up"></i>
</div>
<small>新订单</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-primary pull-right">今天</span>
<h5>访客</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">106,120</h1>
<div class="stat-percent font-bold text-navy">44% <i class="fa fa-level-up"></i>
</div>
<small>新访客</small>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="ibox float-e-margins">
<div class="ibox-title">
<span class="label label-danger pull-right">最近一个月</span>
<h5>活跃用户</h5>
</div>
<div class="ibox-content">
<h1 class="no-margins">80,600</h1>
<div class="stat-percent font-bold text-danger">38% <i class="fa fa-level-down"></i>
</div>
<small>12月</small>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>订单</h5>
<div class="pull-right">
<div class="btn-group">
<button type="button" class="btn btn-xs btn-white active"></button>
<button type="button" class="btn btn-xs btn-white"></button>
<button type="button" class="btn btn-xs btn-white"></button>
</div>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-sm-9">
<div class="flot-chart">
<div class="flot-chart-content" id="flot-dashboard-chart"></div>
</div>
</div>
<div class="col-sm-3">
<ul class="stat-list">
<li>
<h2 class="no-margins">2,346</h2>
<small>订单总数</small>
<div class="stat-percent">48% <i class="fa fa-level-up text-navy"></i>
</div>
<div class="progress progress-mini">
<div style="width: 48%;" class="progress-bar"></div>
</div>
</li>
<li>
<h2 class="no-margins ">4,422</h2>
<small>最近一个月订单</small>
<div class="stat-percent">60% <i class="fa fa-level-down text-navy"></i>
</div>
<div class="progress progress-mini">
<div style="width: 60%;" class="progress-bar"></div>
</div>
</li>
<li>
<h2 class="no-margins ">9,180</h2>
<small>最近一个月销售额</small>
<div class="stat-percent">22% <i class="fa fa-bolt text-navy"></i>
</div>
<div class="progress progress-mini">
<div style="width: 22%;" class="progress-bar"></div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>用户项目列表</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content">
<table class="table table-hover no-margins">
<thead>
<tr>
<th>状态</th>
<th>日期</th>
<th>用户</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><small>进行中...</small>
</td>
<td><i class="fa fa-clock-o"></i> 11:20</td>
<td>青衣5858</td>
<td class="text-navy"> <i class="fa fa-level-up"></i> 24%</td>
</tr>
<tr>
<td><span class="label label-warning">已取消</span>
</td>
<td><i class="fa fa-clock-o"></i> 10:40</td>
<td>徐子崴</td>
<td class="text-navy"> <i class="fa fa-level-up"></i> 66%</td>
</tr>
<tr>
<td><small>进行中...</small>
</td>
<td><i class="fa fa-clock-o"></i> 01:30</td>
<td>姜岚昕</td>
<td class="text-navy"> <i class="fa fa-level-up"></i> 54%</td>
</tr>
<tr>
<td><small>进行中...</small>
</td>
<td><i class="fa fa-clock-o"></i> 02:20</td>
<td>武汉大兵哥</td>
<td class="text-navy"> <i class="fa fa-level-up"></i> 12%</td>
</tr>
<tr>
<td><small>进行中...</small>
</td>
<td><i class="fa fa-clock-o"></i> 09:40</td>
<td>荆莹儿</td>
<td class="text-navy"> <i class="fa fa-level-up"></i> 22%</td>
</tr>
<tr>
<td><span class="label label-primary">已完成</span>
</td>
<td><i class="fa fa-clock-o"></i> 04:10</td>
<td>栾某某</td>
<td class="text-navy"> <i class="fa fa-level-up"></i> 66%</td>
</tr>
<tr>
<td><small>进行中...</small>
</td>
<td><i class="fa fa-clock-o"></i> 12:08</td>
<td>范范范二妮</td>
<td class="text-navy"> <i class="fa fa-level-up"></i> 23%</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/ajax/libs/flot/jquery.flot.js}"></script>
<th:block th:include="include :: sparkline-js" />
<script type="text/javascript">
$(document).ready(function () {
var data2 = [
[gd(2012, 1, 1), 7], [gd(2012, 1, 2), 6], [gd(2012, 1, 3), 4], [gd(2012, 1, 4), 8],
[gd(2012, 1, 5), 9], [gd(2012, 1, 6), 7], [gd(2012, 1, 7), 5], [gd(2012, 1, 8), 4],
[gd(2012, 1, 9), 7], [gd(2012, 1, 10), 8], [gd(2012, 1, 11), 9], [gd(2012, 1, 12), 6],
[gd(2012, 1, 13), 4], [gd(2012, 1, 14), 5], [gd(2012, 1, 15), 11], [gd(2012, 1, 16), 8],
[gd(2012, 1, 17), 8], [gd(2012, 1, 18), 11], [gd(2012, 1, 19), 11], [gd(2012, 1, 20), 6],
[gd(2012, 1, 21), 6], [gd(2012, 1, 22), 8], [gd(2012, 1, 23), 11], [gd(2012, 1, 24), 13],
[gd(2012, 1, 25), 7], [gd(2012, 1, 26), 9], [gd(2012, 1, 27), 9], [gd(2012, 1, 28), 8],
[gd(2012, 1, 29), 5], [gd(2012, 1, 30), 8], [gd(2012, 1, 31), 25]
];
var data3 = [
[gd(2012, 1, 1), 800], [gd(2012, 1, 2), 500], [gd(2012, 1, 3), 600], [gd(2012, 1, 4), 700],
[gd(2012, 1, 5), 500], [gd(2012, 1, 6), 456], [gd(2012, 1, 7), 800], [gd(2012, 1, 8), 589],
[gd(2012, 1, 9), 467], [gd(2012, 1, 10), 876], [gd(2012, 1, 11), 689], [gd(2012, 1, 12), 700],
[gd(2012, 1, 13), 500], [gd(2012, 1, 14), 600], [gd(2012, 1, 15), 700], [gd(2012, 1, 16), 786],
[gd(2012, 1, 17), 345], [gd(2012, 1, 18), 888], [gd(2012, 1, 19), 888], [gd(2012, 1, 20), 888],
[gd(2012, 1, 21), 987], [gd(2012, 1, 22), 444], [gd(2012, 1, 23), 999], [gd(2012, 1, 24), 567],
[gd(2012, 1, 25), 786], [gd(2012, 1, 26), 666], [gd(2012, 1, 27), 888], [gd(2012, 1, 28), 900],
[gd(2012, 1, 29), 178], [gd(2012, 1, 30), 555], [gd(2012, 1, 31), 993]
];
var dataset = [
{
label: "订单数",
data: data3,
color: "#1ab394",
bars: {
show: true,
align: "center",
barWidth: 24 * 60 * 60 * 600,
lineWidth: 0
}
}, {
label: "付款数",
data: data2,
yaxis: 2,
color: "#464f88",
lines: {
lineWidth: 1,
show: true,
fill: true,
fillColor: {
colors: [{
opacity: 0.2
}, {
opacity: 0.2
}]
}
},
splines: {
show: false,
tension: 0.6,
lineWidth: 1,
fill: 0.1
},
}
];
var options = {
xaxis: {
mode: "time",
tickSize: [3, "day"],
tickLength: 0,
axisLabel: "Date",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Arial',
axisLabelPadding: 10,
color: "#838383"
},
yaxes: [{
position: "left",
max: 1070,
color: "#838383",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Arial',
axisLabelPadding: 3
}, {
position: "right",
clolor: "#838383",
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12,
axisLabelFontFamily: ' Arial',
axisLabelPadding: 67
}
],
legend: {
noColumns: 1,
labelBoxBorderColor: "#000000",
position: "nw"
},
grid: {
hoverable: false,
borderWidth: 0,
color: '#838383'
}
};
function gd(year, month, day) {
return new Date(year, month - 1, day).getTime();
}
var previousPoint = null,
previousLabel = null;
$.plot($("#flot-dashboard-chart"), dataset, options);
});
</script>
</body>
</html>

@ -34,7 +34,7 @@
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
</dependency>
<!-- Shiro使用EhCache缓存框架 -->
<dependency>
<groupId>org.apache.shiro</groupId>
@ -101,6 +101,13 @@
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-json</artifactId>
<version>5.4.0</version>
</dependency>
</dependencies>
</project>

@ -30,6 +30,8 @@ public class AjaxResult extends HashMap<String, Object>
SUCCESS(0),
/** 警告 */
WARN(301),
/** 未登录或无权限 */
FORBIDDEN(403),
/** 错误 */
ERROR(500);
private final int value;
@ -193,4 +195,8 @@ public class AjaxResult extends HashMap<String, Object>
{
return new AjaxResult(Type.ERROR, msg, data);
}
public static AjaxResult notLogin(){
return new AjaxResult(Type.FORBIDDEN, "未登录或权限不足");
}
}

@ -0,0 +1,8 @@
package com.ruoyi.common.exception.wx;
/**
*
*/
public class NotLoginException extends RuntimeException{
}

@ -0,0 +1,9 @@
package com.ruoyi.common.exception.wx;
import com.ruoyi.common.exception.base.BaseException;
public class WxBusinessException extends BaseException {
public WxBusinessException(String defaultMessage) {
super(defaultMessage);
}
}

@ -77,6 +77,12 @@
<artifactId>ruoyi-system</artifactId>
</dependency>
<!-- 病案申请模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>wx-record-order</artifactId>
</dependency>
</dependencies>
</project>

@ -3,10 +3,7 @@ package com.ruoyi.framework.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.*;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor;
@ -56,4 +53,13 @@ public class ResourcesConfig implements WebMvcConfigurer
{
registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/wx/api/**")
.allowedOrigins("*")
.allowedMethods("OPTIONS", "POST", "GET", "DELETE")
.allowedHeaders("Origin", "Content-Type", "Accept", "token")
.allowCredentials(true)
.maxAge(3600);
}
}

@ -279,6 +279,10 @@ public class ShiroConfig
filterChainDefinitionMap.put("/js/**", "anon");
filterChainDefinitionMap.put("/ruoyi/**", "anon");
filterChainDefinitionMap.put("/captcha/captchaImage**", "anon");
filterChainDefinitionMap.put("/wx/api/**", "anon");
filterChainDefinitionMap.put("/s/**", "anon");
// 退出 logout地址shiro去清除session
filterChainDefinitionMap.put("/logout", "logout");
// 不需要拦截的访问

@ -1,6 +1,12 @@
package com.ruoyi.framework.web.exception;
import javax.servlet.http.HttpServletRequest;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.exception.DemoModeException;
import com.ruoyi.common.exception.wx.NotLoginException;
import com.ruoyi.common.exception.wx.WxBusinessException;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.security.PermissionUtils;
import org.apache.shiro.authz.AuthorizationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -9,35 +15,27 @@ import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.ModelAndView;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.exception.DemoModeException;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.security.PermissionUtils;
import javax.servlet.http.HttpServletRequest;
/**
*
*
*
* @author ruoyi
*/
@RestControllerAdvice
public class GlobalExceptionHandler
{
public class GlobalExceptionHandler {
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
/**
* ajaxjson
*/
@ExceptionHandler(AuthorizationException.class)
public Object handleAuthorizationException(HttpServletRequest request, AuthorizationException e)
{
public Object handleAuthorizationException(HttpServletRequest request, AuthorizationException e) {
log.error(e.getMessage(), e);
if (ServletUtils.isAjaxRequest(request))
{
if (ServletUtils.isAjaxRequest(request)) {
return AjaxResult.error(PermissionUtils.getMsg(e.getMessage()));
}
else
{
} else {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("error/unauth");
return modelAndView;
@ -47,9 +45,8 @@ public class GlobalExceptionHandler
/**
*
*/
@ExceptionHandler({ HttpRequestMethodNotSupportedException.class })
public AjaxResult handleException(HttpRequestMethodNotSupportedException e)
{
@ExceptionHandler({HttpRequestMethodNotSupportedException.class})
public AjaxResult handleException(HttpRequestMethodNotSupportedException e) {
log.error(e.getMessage(), e);
return AjaxResult.error("不支持' " + e.getMethod() + "'请求");
}
@ -58,8 +55,7 @@ public class GlobalExceptionHandler
*
*/
@ExceptionHandler(RuntimeException.class)
public AjaxResult notFount(RuntimeException e)
{
public AjaxResult notFount(RuntimeException e) {
log.error("运行时异常:", e);
return AjaxResult.error("运行时异常:" + e.getMessage());
}
@ -68,8 +64,7 @@ public class GlobalExceptionHandler
*
*/
@ExceptionHandler(Exception.class)
public AjaxResult handleException(Exception e)
{
public AjaxResult handleException(Exception e) {
log.error(e.getMessage(), e);
return AjaxResult.error("服务器错误,请联系管理员");
}
@ -78,15 +73,11 @@ public class GlobalExceptionHandler
*
*/
@ExceptionHandler(BusinessException.class)
public Object businessException(HttpServletRequest request, BusinessException e)
{
public Object businessException(HttpServletRequest request, BusinessException e) {
log.error(e.getMessage(), e);
if (ServletUtils.isAjaxRequest(request))
{
if (ServletUtils.isAjaxRequest(request)) {
return AjaxResult.error(e.getMessage());
}
else
{
} else {
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("errorMessage", e.getMessage());
modelAndView.setViewName("error/business");
@ -98,8 +89,7 @@ public class GlobalExceptionHandler
*
*/
@ExceptionHandler(BindException.class)
public AjaxResult validatedBindException(BindException e)
{
public AjaxResult validatedBindException(BindException e) {
log.error(e.getMessage(), e);
String message = e.getAllErrors().get(0).getDefaultMessage();
return AjaxResult.error(message);
@ -109,8 +99,20 @@ public class GlobalExceptionHandler
*
*/
@ExceptionHandler(DemoModeException.class)
public AjaxResult demoModeException(DemoModeException e)
{
public AjaxResult demoModeException(DemoModeException e) {
return AjaxResult.error("演示模式,不允许操作");
}
/**
*
*/
@ExceptionHandler(NotLoginException.class)
public AjaxResult notLoginException() {
return AjaxResult.notLogin();
}
@ExceptionHandler(WxBusinessException.class)
public AjaxResult wxBusinessException(WxBusinessException e) {
return AjaxResult.error(e.getMessage());
}
}

@ -0,0 +1,6 @@
SMS_212471722
老师您好,您需要的电子扫描资料已上传,小程序中可查看下载地址,解压密码${pwd}。请您及时查收,如有问题,随时联系。
SMS_212476711
老师您好,您需要的原件资料已顺丰帮您发出,顺丰单号${nu},请您及时关注物流信息。

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>4.6.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wx-record-order</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<!-- 小程序sdk -->
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-miniapp</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>dysmsapi20170525</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>tea</artifactId>
<version>1.1.8</version>
</dependency>
</dependencies>
</project>

@ -0,0 +1,63 @@
package com.ruoyi.wx.controller;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.wx.domain.MrRecordOrder;
import com.ruoyi.wx.dto.req.OrderListReqDTO;
import com.ruoyi.wx.dto.req.UserSignInfo;
import com.ruoyi.wx.service.IMrRecordOrderService;
import com.ruoyi.wx.service.IWxUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("wx/api/")
public class ApiRestController {
@Autowired
private IWxUserService wxUserService;
@Autowired
private IMrRecordOrderService mrRecordOrderService;
/**
*
*/
@PostMapping("autoLogin")
public AjaxResult autoLogin(String wxCode) {
return AjaxResult.success(wxUserService.login(wxCode));
}
/**
*
*
*/
@PostMapping("signIn")
public AjaxResult signIn(@RequestBody UserSignInfo userSignInfo) {
wxUserService.signIn(userSignInfo);
return AjaxResult.success();
}
/**
*
*/
@PostMapping("info")
public AjaxResult info(@RequestBody UserSignInfo userSignInfo) {
return AjaxResult.success(wxUserService.info(userSignInfo));
}
/**
*
*/
@PostMapping("order")
public AjaxResult order(@RequestBody MrRecordOrder order) {
mrRecordOrderService.createOrder(order);
return AjaxResult.success();
}
/**
*
*/
@PostMapping("orderList")
public AjaxResult orderList(@RequestBody OrderListReqDTO orderListReqDTO) {
return AjaxResult.success(mrRecordOrderService.list(orderListReqDTO));
}
}

@ -0,0 +1,151 @@
package com.ruoyi.wx.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.config.RuoYiConfig;
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.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.wx.domain.MrRecordOrder;
import com.ruoyi.wx.service.IMrRecordOrderService;
import com.ruoyi.wx.util.ShortUrlUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List;
/**
* Controller
*
* @author ruoyi
* @date 2021-02-24
*/
@Controller
@RequestMapping("/wx/order")
public class MrRecordOrderController extends BaseController {
private String prefix = "wx/order";
@Value("${server.servlet.domain}")
private String domain;
@Autowired
private IMrRecordOrderService mrRecordOrderService;
@RequiresPermissions("wx:order:view")
@GetMapping()
public String order() {
return prefix + "/order";
}
/**
*
*/
@RequiresPermissions("wx:order:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(MrRecordOrder mrRecordOrder) {
startPage();
List<MrRecordOrder> list = mrRecordOrderService.selectMrRecordOrderList(mrRecordOrder);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("wx:order:export")
@Log(title = "病案申请", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(MrRecordOrder mrRecordOrder) {
List<MrRecordOrder> list = mrRecordOrderService.selectMrRecordOrderList(mrRecordOrder);
ExcelUtil<MrRecordOrder> util = new ExcelUtil<MrRecordOrder>(MrRecordOrder.class);
return util.exportExcel(list, "order");
}
/**
*
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("wx:order:add")
@Log(title = "病案申请", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(MrRecordOrder mrRecordOrder) {
return toAjax(mrRecordOrderService.insertMrRecordOrder(mrRecordOrder));
}
/**
*
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
MrRecordOrder mrRecordOrder = mrRecordOrderService.selectMrRecordOrderById(id);
mmap.put("mrRecordOrder", mrRecordOrder);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("wx:order:edit")
@Log(title = "病案申请", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(MrRecordOrder mrRecordOrder) {
return toAjax(mrRecordOrderService.updateMrRecordOrder(mrRecordOrder));
}
/**
*
*/
@RequiresPermissions("wx:order:remove")
@Log(title = "病案申请", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(mrRecordOrderService.deleteMrRecordOrderByIds(ids));
}
@GetMapping("/sendView/{id}")
public String sendView(@PathVariable("id") Long id, ModelMap mmap) {
MrRecordOrder mrRecordOrder = mrRecordOrderService.selectMrRecordOrderById(id);
mmap.put("mrRecordOrder", mrRecordOrder);
mmap.put("randomCode", RandomStringUtils.random(8,true,true));
return prefix + "/sendView";
}
@Log(title = "发送病案处理短信", businessType = BusinessType.UPDATE)
@PostMapping("/sendSms")
@ResponseBody
public AjaxResult sendSms(MrRecordOrder mrRecordOrder) {
return toAjax(mrRecordOrderService.sendSms(mrRecordOrder));
}
@PostMapping("/upload")
@ResponseBody
public AjaxResult upload(@RequestParam("file_data") MultipartFile file) throws IOException {
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
// 保存短网址对应关系
String code=mrRecordOrderService.randomCode(fileName,file.getOriginalFilename());
return AjaxResult.success("上传成功", domain+"/s/"+code);
}
}

@ -0,0 +1,30 @@
package com.ruoyi.wx.controller;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ruoyi.wx.service.IMrRecordOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
@Controller
@RequestMapping("s")
public class ShortUrlController {
@Autowired
private IMrRecordOrderService mrRecordOrderService;
@RequestMapping("{code}")
public String redirectTo(@PathVariable String code, HttpServletResponse response) {
Map<String, String> urlHeaders = mrRecordOrderService.getUrlHeaders(code);
String headers = urlHeaders.get("headers");
JSONObject jsonObject = JSONUtil.parseObj(headers);
jsonObject.forEach((k, v) -> {
response.setHeader(k, (String) v);
});
return "forward:" + urlHeaders.get("url");
}
}

@ -0,0 +1,141 @@
package com.ruoyi.wx.controller;
import java.util.List;
import com.ruoyi.wx.domain.WxUser;
import com.ruoyi.wx.service.IWxUserService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
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.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2021-02-24
*/
@Controller
@RequestMapping("/wx/user")
public class WxUserController extends BaseController
{
private String prefix = "wx/user";
@Autowired
private IWxUserService wxUserService;
@RequiresPermissions("wx:user:view")
@GetMapping()
public String user()
{
return prefix + "/user";
}
/**
*
*/
@RequiresPermissions("wx:user:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(WxUser wxUser)
{
startPage();
List<WxUser> list = wxUserService.selectWxUserList(wxUser);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("wx:user:export")
@Log(title = "微信小程序用户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(WxUser wxUser)
{
List<WxUser> list = wxUserService.selectWxUserList(wxUser);
ExcelUtil<WxUser> util = new ExcelUtil<WxUser>(WxUser.class);
return util.exportExcel(list, "user");
}
/**
*
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("wx:user:add")
@Log(title = "微信小程序用户", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(WxUser wxUser)
{
return toAjax(wxUserService.insertWxUser(wxUser));
}
/**
*
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
WxUser wxUser = wxUserService.selectWxUserById(id);
mmap.put("wxUser", wxUser);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("wx:user:edit")
@Log(title = "微信小程序用户", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(WxUser wxUser)
{
return toAjax(wxUserService.updateWxUser(wxUser));
}
/**
*
*/
@RequiresPermissions("wx:user:remove")
@Log(title = "微信小程序用户", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(wxUserService.deleteWxUserByIds(ids));
}
@Log(title = "审核微信小程序用户", businessType = BusinessType.UPDATE)
@PostMapping( "/checkUser")
@ResponseBody
public AjaxResult checkUser(Long id){
return toAjax(wxUserService.checkUser(id));
}
@Log(title = "修改微信小程序用户状态", businessType = BusinessType.UPDATE)
@PostMapping( "/triggerStatus")
@ResponseBody
public AjaxResult triggerStatus(Long id){
return toAjax(wxUserService.triggerStatus(id));
}
}

@ -0,0 +1,216 @@
package com.ruoyi.wx.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* mr_record_order
*
* @author ruoyi
* @date 2021-02-24
*/
public class MrRecordOrder extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 申请类型0原件寄回1电子扫描件 */
@Excel(name = "申请类型:")
private Integer type;
/** 病案号 */
@Excel(name = "病案号")
private String mrNumber;
/** 患者姓名 */
@Excel(name = "患者姓名")
private String patientName;
/** 出院日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出院日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date dischargeDate;
/** 住院次数 */
@Excel(name = "住院次数")
private Long times;
/** 申请人申请人 对应wx_user表id */
@Excel(name = "申请人")
private Long applicantId;
/** 医院名称 */
@Excel(name = "医院名称")
private String hospital;
/** 寄送地址 */
@Excel(name = "寄送地址")
private String address;
@Excel(name = "快递公司")
private String delivery;
@Excel(name = "运单号")
private String trackingNumber;
/** 下载地址 */
@Excel(name = "下载地址")
private String downloadUrl;
/** 解压密码 */
@Excel(name = "解压密码")
private String unzipPwd;
/** 申请状态 0 申请中 1 已完成 */
@Excel(name = "申请状态")
private Integer status;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setType(Integer type)
{
this.type = type;
}
public Integer getType()
{
return type;
}
public void setMrNumber(String mrNumber)
{
this.mrNumber = mrNumber;
}
public String getMrNumber()
{
return mrNumber;
}
public void setPatientName(String patientName)
{
this.patientName = patientName;
}
public String getPatientName()
{
return patientName;
}
public void setDischargeDate(Date dischargeDate)
{
this.dischargeDate = dischargeDate;
}
public Date getDischargeDate()
{
return dischargeDate;
}
public void setTimes(Long times)
{
this.times = times;
}
public Long getTimes()
{
return times;
}
public void setApplicantId(Long applicantId)
{
this.applicantId = applicantId;
}
public Long getApplicantId()
{
return applicantId;
}
public void setHospital(String hospital)
{
this.hospital = hospital;
}
public String getHospital()
{
return hospital;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setDownloadUrl(String downloadUrl)
{
this.downloadUrl = downloadUrl;
}
public String getDownloadUrl()
{
return downloadUrl;
}
public void setUnzipPwd(String unzipPwd)
{
this.unzipPwd = unzipPwd;
}
public String getUnzipPwd()
{
return unzipPwd;
}
public void setStatus(Integer status)
{
this.status = status;
}
public Integer getStatus()
{
return status;
}
public String getDelivery() {
return delivery;
}
public void setDelivery(String delivery) {
this.delivery = delivery;
}
public String getTrackingNumber() {
return trackingNumber;
}
public void setTrackingNumber(String trackingNumber) {
this.trackingNumber = trackingNumber;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("type", getType())
.append("mrNumber", getMrNumber())
.append("patientName", getPatientName())
.append("dischargeDate", getDischargeDate())
.append("times", getTimes())
.append("applicantId", getApplicantId())
.append("hospital", getHospital())
.append("address", getAddress())
.append("downloadUrl", getDownloadUrl())
.append("unzipPwd", getUnzipPwd())
.append("status", getStatus())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,196 @@
package com.ruoyi.wx.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* wx_user
*
* @author ruoyi
* @date 2021-02-24
*/
public class WxUser extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long id;
/**
*
*/
@Excel(name = "用户姓名")
private String name;
/**
*
*/
@Excel(name = "手机号码")
private String phone;
private String openid;
/**
* 0 1
*/
@Excel(name = "用户状态")
private Integer status;
/**
* 0 1
*/
@Excel(name = "审核状态")
private Integer flag;
/**
*
*/
@Excel(name = "医院名称")
private String hospital;
/**
*
*/
@Excel(name = "收货地址")
private String address;
/**
*
*/
@Excel(name = "微信昵称")
private String nickname;
/**
*
*/
@Excel(name = "微信头像")
private String avatar;
/**
*
*/
private String gender;
/**
* token
*/
private String token;
public void setId(Long id) {
this.id = id;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public Long getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setOpenid(String openid) {
this.openid = openid;
}
public String getOpenid() {
return openid;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getStatus() {
return status;
}
public void setFlag(Integer flag) {
this.flag = flag;
}
public Integer getFlag() {
return flag;
}
public void setHospital(String hospital) {
this.hospital = hospital;
}
public String getHospital() {
return hospital;
}
public void setAddress(String address) {
this.address = address;
}
public String getAddress() {
return address;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getNickname() {
return nickname;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getAvatar() {
return avatar;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("openid", getOpenid())
.append("status", getStatus())
.append("flag", getFlag())
.append("hospital", getHospital())
.append("address", getAddress())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("nickname", getNickname())
.append("avatar", getAvatar())
.append("phone", getPhone())
.append("token", getToken())
.append("gender", getGender())
.toString();
}
}

@ -0,0 +1,129 @@
package com.ruoyi.wx.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
public class RecordOrderDTO {
/**
*
*/
private Long id;
private String type;
/**
*
*/
private String mrNumber;
/**
*
*/
private String patientName;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date dischargeDate;
/**
*
*/
private Long times;
/**
*
*/
private String hospital;
/**
*
*/
private String address;
private String status;
private String downUrl;
public String getDownUrl() {
return downUrl;
}
public void setDownUrl(String downUrl) {
this.downUrl = downUrl;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getMrNumber() {
return mrNumber;
}
public void setMrNumber(String mrNumber) {
this.mrNumber = mrNumber;
}
public String getPatientName() {
return patientName;
}
public void setPatientName(String patientName) {
this.patientName = patientName;
}
public Date getDischargeDate() {
return dischargeDate;
}
public void setDischargeDate(Date dischargeDate) {
this.dischargeDate = dischargeDate;
}
public Long getTimes() {
return times;
}
public void setTimes(Long times) {
this.times = times;
}
public String getHospital() {
return hospital;
}
public void setHospital(String hospital) {
this.hospital = hospital;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}

@ -0,0 +1,112 @@
package com.ruoyi.wx.dto;
import com.ruoyi.common.annotation.Excel;
/**
*
*/
public class WxUserDTO {
/**
*
*/
private Long id;
/**
*
*/
@Excel(name = "用户姓名")
private String name;
/**
*
*/
@Excel(name = "手机号码")
private String phone;
/**
* 0 1
*/
@Excel(name = "用户状态")
private Integer status;
/**
* 0 1
*/
@Excel(name = "审核状态")
private Integer flag;
/**
*
*/
@Excel(name = "医院名称")
private String hospital;
/**
*
*/
@Excel(name = "收货地址")
private String address;
private String token;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getFlag() {
return flag;
}
public void setFlag(Integer flag) {
this.flag = flag;
}
public String getHospital() {
return hospital;
}
public void setHospital(String hospital) {
this.hospital = hospital;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
}

@ -0,0 +1,31 @@
package com.ruoyi.wx.dto.req;
public class OrderListReqDTO {
private String keyword;
private Integer page;
private Integer status;
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}

@ -0,0 +1,58 @@
package com.ruoyi.wx.dto.req;
public class UserSignInfo {
private String nickName;
private String gender;
private String avatar;
private String name;
private String phone;
private String hospital;
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getHospital() {
return hospital;
}
public void setHospital(String hospital) {
this.hospital = hospital;
}
}

@ -0,0 +1,71 @@
package com.ruoyi.wx.mapper;
import java.util.List;
import java.util.Map;
import com.ruoyi.wx.domain.MrRecordOrder;
import com.ruoyi.wx.dto.RecordOrderDTO;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
*
* @author ruoyi
* @date 2021-02-24
*/
public interface MrRecordOrderMapper
{
/**
*
*
* @param id ID
* @return
*/
public MrRecordOrder selectMrRecordOrderById(Long id);
/**
*
*
* @param mrRecordOrder
* @return
*/
public List<MrRecordOrder> selectMrRecordOrderList(MrRecordOrder mrRecordOrder);
/**
*
*
* @param mrRecordOrder
* @return
*/
public int insertMrRecordOrder(MrRecordOrder mrRecordOrder);
/**
*
*
* @param mrRecordOrder
* @return
*/
public int updateMrRecordOrder(MrRecordOrder mrRecordOrder);
/**
*
*
* @param id ID
* @return
*/
public int deleteMrRecordOrderById(Long id);
/**
*
*
* @param ids ID
* @return
*/
public int deleteMrRecordOrderByIds(String[] ids);
List<RecordOrderDTO> searchList(@Param("userId")Long userId,@Param("keyword") String keyword,@Param("status") Integer status,@Param("startRow") Integer startRow,@Param("endRow") Integer endRow);
Map<String,String> getUrlHeaders(String code);
boolean saveCodeUrl(@Param("code") String code, @Param("url") String url, @Param("headers") String headers);
}

@ -0,0 +1,70 @@
package com.ruoyi.wx.mapper;
import java.util.List;
import com.ruoyi.wx.domain.WxUser;
/**
* Mapper
*
* @author ruoyi
* @date 2021-02-24
*/
public interface WxUserMapper
{
/**
*
*
* @param id ID
* @return
*/
public WxUser selectWxUserById(Long id);
/**
*
*
* @param wxUser
* @return
*/
public List<WxUser> selectWxUserList(WxUser wxUser);
/**
*
*
* @param wxUser
* @return
*/
public int insertWxUser(WxUser wxUser);
/**
*
*
* @param wxUser
* @return
*/
public int updateWxUser(WxUser wxUser);
/**
*
*
* @param id ID
* @return
*/
public int deleteWxUserById(Long id);
/**
*
*
* @param ids ID
* @return
*/
public int deleteWxUserByIds(String[] ids);
/**
* token
* @param token
* @return
*/
WxUser selectWxUserByToken(String token);
WxUser selectWxUserByOpenid(String openid);
}

@ -0,0 +1,75 @@
package com.ruoyi.wx.service;
import java.util.List;
import java.util.Map;
import com.ruoyi.wx.domain.MrRecordOrder;
import com.ruoyi.wx.dto.RecordOrderDTO;
import com.ruoyi.wx.dto.req.OrderListReqDTO;
/**
* Service
*
* @author ruoyi
* @date 2021-02-24
*/
public interface IMrRecordOrderService
{
/**
*
*
* @param id ID
* @return
*/
public MrRecordOrder selectMrRecordOrderById(Long id);
/**
*
*
* @param mrRecordOrder
* @return
*/
public List<MrRecordOrder> selectMrRecordOrderList(MrRecordOrder mrRecordOrder);
/**
*
*
* @param mrRecordOrder
* @return
*/
public int insertMrRecordOrder(MrRecordOrder mrRecordOrder);
/**
*
*
* @param mrRecordOrder
* @return
*/
public int updateMrRecordOrder(MrRecordOrder mrRecordOrder);
/**
*
*
* @param ids ID
* @return
*/
public int deleteMrRecordOrderByIds(String ids);
/**
*
*
* @param id ID
* @return
*/
public int deleteMrRecordOrderById(Long id);
void createOrder(MrRecordOrder order);
List<RecordOrderDTO> list(OrderListReqDTO orderListReqDTO);
boolean sendSms(MrRecordOrder mrRecordOrder);
Map<String,String> getUrlHeaders(String code);
String randomCode(String url, String filename);
}

@ -0,0 +1,82 @@
package com.ruoyi.wx.service;
import java.util.List;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import com.ruoyi.wx.domain.WxUser;
import com.ruoyi.wx.dto.WxUserDTO;
import com.ruoyi.wx.dto.req.UserSignInfo;
/**
* Service
*
* @author ruoyi
* @date 2021-02-24
*/
public interface IWxUserService
{
/**
*
*
* @param id ID
* @return
*/
public WxUser selectWxUserById(Long id);
/**
*
*
* @param wxUser
* @return
*/
public List<WxUser> selectWxUserList(WxUser wxUser);
/**
*
*
* @param wxUser
* @return
*/
public int insertWxUser(WxUser wxUser);
/**
*
*
* @param wxUser
* @return
*/
public int updateWxUser(WxUser wxUser);
/**
*
*
* @param ids ID
* @return
*/
public int deleteWxUserByIds(String ids);
/**
*
*
* @param id ID
* @return
*/
public int deleteWxUserById(Long id);
/**
* token
* @param token
* @return
*/
WxUser selectWxUserByToken(String token);
WxUserDTO login(String wxCode);
void signIn(UserSignInfo userSignInfo);
WxUserDTO info(UserSignInfo userSignInfo);
boolean checkUser(Long id);
boolean triggerStatus(Long id);
}

@ -0,0 +1,218 @@
package com.ruoyi.wx.service.impl;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.exception.wx.WxBusinessException;
import com.ruoyi.common.json.JSONObject;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.html.EscapeUtil;
import com.ruoyi.wx.domain.MrRecordOrder;
import com.ruoyi.wx.domain.WxUser;
import com.ruoyi.wx.dto.RecordOrderDTO;
import com.ruoyi.wx.dto.WxUserDTO;
import com.ruoyi.wx.dto.req.OrderListReqDTO;
import com.ruoyi.wx.mapper.MrRecordOrderMapper;
import com.ruoyi.wx.mapper.WxUserMapper;
import com.ruoyi.wx.service.IMrRecordOrderService;
import com.ruoyi.wx.util.SmsUtils;
import com.ruoyi.wx.util.WxServiceUtils;
import com.ruoyi.wx.util.WxUserUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* Service
*
* @author ruoyi
* @date 2021-02-24
*/
@Service
public class MrRecordOrderServiceImpl implements IMrRecordOrderService {
@Autowired
private MrRecordOrderMapper mrRecordOrderMapper;
/**
*
*
* @param id ID
* @return
*/
@Override
public MrRecordOrder selectMrRecordOrderById(Long id) {
return mrRecordOrderMapper.selectMrRecordOrderById(id);
}
/**
*
*
* @param mrRecordOrder
* @return
*/
@Override
public List<MrRecordOrder> selectMrRecordOrderList(MrRecordOrder mrRecordOrder) {
return mrRecordOrderMapper.selectMrRecordOrderList(mrRecordOrder);
}
/**
*
*
* @param mrRecordOrder
* @return
*/
@Override
public int insertMrRecordOrder(MrRecordOrder mrRecordOrder) {
mrRecordOrder.setCreateTime(DateUtils.getNowDate());
return mrRecordOrderMapper.insertMrRecordOrder(mrRecordOrder);
}
/**
*
*
* @param mrRecordOrder
* @return
*/
@Override
public int updateMrRecordOrder(MrRecordOrder mrRecordOrder) {
mrRecordOrder.setUpdateTime(DateUtils.getNowDate());
return mrRecordOrderMapper.updateMrRecordOrder(mrRecordOrder);
}
/**
*
*
* @param ids ID
* @return
*/
@Override
public int deleteMrRecordOrderByIds(String ids) {
return mrRecordOrderMapper.deleteMrRecordOrderByIds(Convert.toStrArray(ids));
}
/**
*
*
* @param id ID
* @return
*/
@Override
public int deleteMrRecordOrderById(Long id) {
return mrRecordOrderMapper.deleteMrRecordOrderById(id);
}
@Autowired
private WxUserUtils wxUserUtils;
@Autowired
private WxUserMapper wxUserMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public void createOrder(MrRecordOrder order) {
// 判断参数是否遗漏
if (StringUtils.isBlank(order.getMrNumber())) {
throw new WxBusinessException("病案号必填");
}
if (StringUtils.isBlank(order.getPatientName())) {
throw new WxBusinessException("患者姓名必填");
}
if (Objects.isNull(order.getDischargeDate())) {
throw new WxBusinessException("出院时间必填");
}
if (Objects.isNull(order.getTimes())) {
throw new WxBusinessException("就诊次数必填");
}
if (order.getType() == 0) {
if (Objects.isNull(order.getAddress())) {
throw new WxBusinessException("配送地址必填");
}
}
// 判断是否已有相同订单
MrRecordOrder searchOrder = new MrRecordOrder();
searchOrder.setMrNumber(order.getMrNumber());
searchOrder.setType(order.getType());
searchOrder.setStatus(0);
List<MrRecordOrder> mrRecordOrders = mrRecordOrderMapper.selectMrRecordOrderList(searchOrder);
if (mrRecordOrders != null && !mrRecordOrders.isEmpty()) {
throw new WxBusinessException("已有相同申请!");
}
WxUserDTO userInfo = wxUserUtils.getUserInfo();
order.setApplicantId(userInfo.getId());
order.setHospital(userInfo.getHospital());
if (StringUtils.isNotBlank(order.getAddress())) {
WxUser wxUser = new WxUser();
wxUser.setId(userInfo.getId());
wxUser.setAddress(order.getAddress());
wxUserMapper.updateWxUser(wxUser);
}
order.setCreateTime(new Date());
order.setUpdateTime(new Date());
order.setStatus(0);
mrRecordOrderMapper.insertMrRecordOrder(order);
}
@Override
public List<RecordOrderDTO> list(OrderListReqDTO orderListReqDTO) {
int rowCount = 10;
int startRow = rowCount * (orderListReqDTO.getPage() - 1);
int endRow = rowCount * orderListReqDTO.getPage();
return mrRecordOrderMapper.searchList(wxUserUtils.getUserInfo().getId(), orderListReqDTO.getKeyword(), orderListReqDTO.getStatus(), startRow, endRow);
}
@Override
public boolean sendSms(MrRecordOrder mrRecordOrder) {
MrRecordOrder mrRecordOrder1 = mrRecordOrderMapper.selectMrRecordOrderById(mrRecordOrder.getId());
if (Objects.nonNull(mrRecordOrder1)) {
WxUser wxUser = wxUserMapper.selectWxUserById(mrRecordOrder1.getApplicantId());
// 发送短信
if (mrRecordOrder.getType() == 1) {
SmsUtils.sendSms(SmsUtils.TemplateType.DOWN, wxUser.getPhone(), mrRecordOrder.getUnzipPwd());
} else if (mrRecordOrder.getType() == 0) {
SmsUtils.sendSms(SmsUtils.TemplateType.Express, wxUser.getPhone(), mrRecordOrder.getTrackingNumber());
}
// 更新订单
mrRecordOrder.setStatus(1);
mrRecordOrder.setUpdateTime(new Date());
mrRecordOrderMapper.updateMrRecordOrder(mrRecordOrder);
}
return true;
}
@Override
public Map<String, String> getUrlHeaders(String code) {
return mrRecordOrderMapper.getUrlHeaders(code);
}
@Override
public String randomCode(String url, String filename) {
return saveUrl(url, filename, 1);
}
private String saveUrl(String url, String filename, int times) {
try {
String code = RandomStringUtils.random(4, true, true);
JSONObject jsonObject = new JSONObject();
jsonObject.set("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, Charset.defaultCharset().displayName()));
mrRecordOrderMapper.saveCodeUrl(code, url, jsonObject.toCompactString());
return code;
} catch (Exception e) {
// code为唯一建失败了就重试,最多重试5次
if (times > 5) {
throw new BusinessException("创建短网址失败");
}
return saveUrl(url, filename, ++times);
}
}
}

@ -0,0 +1,207 @@
package com.ruoyi.wx.service.impl;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.wx.domain.WxUser;
import com.ruoyi.wx.dto.WxUserDTO;
import com.ruoyi.wx.dto.req.UserSignInfo;
import com.ruoyi.wx.mapper.WxUserMapper;
import com.ruoyi.wx.service.IWxUserService;
import com.ruoyi.wx.util.WxServiceUtils;
import com.ruoyi.wx.util.WxUserUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* Service
*
* @author ruoyi
* @date 2021-02-24
*/
@Service
public class WxUserServiceImpl implements IWxUserService {
@Autowired
private WxUserMapper wxUserMapper;
@Autowired
private WxServiceUtils wxServiceUtils;
@Autowired
private WxUserUtils wxUserUtils;
/**
*
*
* @param id ID
* @return
*/
@Override
public WxUser selectWxUserById(Long id) {
return wxUserMapper.selectWxUserById(id);
}
/**
*
*
* @param wxUser
* @return
*/
@Override
public List<WxUser> selectWxUserList(WxUser wxUser) {
return wxUserMapper.selectWxUserList(wxUser);
}
/**
*
*
* @param wxUser
* @return
*/
@Override
public int insertWxUser(WxUser wxUser) {
wxUser.setCreateTime(DateUtils.getNowDate());
return wxUserMapper.insertWxUser(wxUser);
}
/**
*
*
* @param wxUser
* @return
*/
@Override
public int updateWxUser(WxUser wxUser) {
wxUser.setUpdateTime(DateUtils.getNowDate());
return wxUserMapper.updateWxUser(wxUser);
}
/**
*
*
* @param ids ID
* @return
*/
@Override
public int deleteWxUserByIds(String ids) {
return wxUserMapper.deleteWxUserByIds(Convert.toStrArray(ids));
}
/**
*
*
* @param id ID
* @return
*/
@Override
public int deleteWxUserById(Long id) {
return wxUserMapper.deleteWxUserById(id);
}
@Override
public WxUser selectWxUserByToken(String token) {
return wxUserMapper.selectWxUserByToken(token);
}
@Override
public WxUserDTO login(String wxCode) {
WxUserDTO wxUserDTO = new WxUserDTO();
WxMaJscode2SessionResult login = wxServiceUtils.login(wxCode);
// 根据openid查询用户
WxUser wxUser = wxUserMapper.selectWxUserByOpenid(login.getOpenid());
if (Objects.nonNull(wxUser)) {
wxUser.setToken(login.getSessionKey());
wxUser.setUpdateTime(new Date());
wxUserMapper.updateWxUser(wxUser);
} else {
wxUser = new WxUser();
wxUser.setToken(login.getSessionKey());
wxUser.setOpenid(login.getOpenid());
wxUser.setStatus(2);
wxUser.setFlag(0);
wxUser.setCreateTime(new Date());
wxUserMapper.insertWxUser(wxUser);
}
BeanUtils.copyProperties(wxUser, wxUserDTO);
return wxUserDTO;
}
@Override
public void signIn(UserSignInfo userSignInfo) {
WxUserDTO userInfo = wxUserUtils.getUserInfo();
WxUser wxUser = wxUserMapper.selectWxUserById(userInfo.getId());
wxUser.setUpdateTime(new Date());
wxUser.setAvatar(userSignInfo.getAvatar());
wxUser.setNickname(userSignInfo.getNickName());
String gender = "未知";
if (StringUtils.equals("1", userSignInfo.getGender())) {
gender = "男";
} else if (StringUtils.equals("2", userSignInfo.getGender())) {
gender = "女";
}
wxUser.setGender(gender);
wxUser.setHospital(userSignInfo.getHospital());
wxUser.setName(userSignInfo.getName());
wxUser.setPhone(userSignInfo.getPhone());
wxUser.setStatus(0);
wxUserMapper.updateWxUser(wxUser);
wxUserUtils.clearCache();
}
@Override
public WxUserDTO info(UserSignInfo userSignInfo) {
WxUserDTO userInfo = wxUserUtils.getUserInfo();
WxUser wxUser = wxUserMapper.selectWxUserById(userInfo.getId());
if (!wxUser.getStatus().equals(userInfo.getStatus()) || !wxUser.getFlag().equals(userInfo.getFlag())) {// 状态变更时更新用户信息
wxUser.setUpdateTime(new Date());
wxUser.setAvatar(userSignInfo.getAvatar());
wxUser.setNickname(userSignInfo.getNickName());
String gender = "未知";
if (StringUtils.equals("1", userSignInfo.getGender())) {
gender = "男";
} else if (StringUtils.equals("2", userSignInfo.getGender())) {
gender = "女";
}
wxUser.setGender(gender);
wxUserMapper.updateWxUser(wxUser);
wxUserUtils.clearCache();
BeanUtils.copyProperties(wxUser, userInfo);
}
return userInfo;
}
@Override
public boolean checkUser(Long id) {
WxUser wxUser=new WxUser();
wxUser.setId(id);
wxUser.setFlag(1);
updateWxUser(wxUser);
return true;
}
@Override
public boolean triggerStatus(Long id) {
WxUser wxUser=selectWxUserById(id);
if(wxUser.getStatus()==1){
wxUser.setStatus(0);
updateWxUser(wxUser);
}else if(wxUser.getStatus()==0){
wxUser.setStatus(1);
updateWxUser(wxUser);
}
return true;
}
}

@ -0,0 +1,22 @@
package com.ruoyi.wx.util;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.utils.http.HttpUtils;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.Charset;
public class ShortUrlUtils {
private static final String API_PATH = "http://www.uc4.cn/ajax.php";
public static String getShortUrl(String url) throws UnsupportedEncodingException {
String resp = HttpUtils.sendGet(API_PATH, "act=creat1&url=" + URLEncoder.encode(url, Charset.defaultCharset().displayName()) + "&pattern=1&type=c4icn");
JSONObject obj = JSONObject.parseObject(resp);
return obj.getString("dwz");
}
public static void main(String[] args) throws UnsupportedEncodingException {
System.out.println(getShortUrl("https://wx.docus.cn/profile/upload/2021/03/01/dad2a531-b3bf-4ede-8f41-26d611053c73.zip"));
}
}

@ -0,0 +1,119 @@
package com.ruoyi.wx.util;
import com.aliyun.dysmsapi20170525.Client;
import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
import com.aliyun.teaopenapi.models.Config;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@Component
public class SmsUtils {
private static final Logger log = LoggerFactory.getLogger(SmsUtils.class);
private static String accessKeyId;
private static String accessKeySecret;
private static String signName;
@Value("${aliyun.accesskey-id}")
String aliAccessKeyId;
@Value("${aliyun.accesskey-secret}")
String aliAccessKeySecret;
@Value("${aliyun.sms.sign-name}")
String pSignName;
@PostConstruct
private void initialization() {
accessKeyId = aliAccessKeyId;
accessKeySecret = aliAccessKeySecret;
signName = pSignName;
}
/**
* 使AK&SKClient
*
* @return Client
* @throws Exception
*/
public static Client getClient() throws Exception {
Config config = new Config()
// 您的AccessKey ID
.setAccessKeyId(accessKeyId)
// 您的AccessKey Secret
.setAccessKeySecret(accessKeySecret);
// 访问的域名
config.endpoint = "dysmsapi.aliyuncs.com";
return new Client(config);
}
/**
*
*
* @param type
* @param telephone
* @param objs
*/
public static void sendSms(TemplateType type, String telephone, Object... objs) {
// 组装请求对象-具体描述见控制台-文档部分内容
SendSmsRequest request = new SendSmsRequest();
// 必填:待发送手机号
request.setPhoneNumbers(telephone);
//必填:短信签名-可在短信控制台中找到
request.setSignName(signName);
// 必填:短信模板-可在短信控制台中找到
request.setTemplateCode(type.code);
if (type.args != null && type.args.length > 0) {
JSONObject jsonObject = new JSONObject();
for (int i = 0; i < type.args.length; i++) {
jsonObject.put(type.args[i], objs[i]);
}
request.setTemplateParam(jsonObject.toCompactString());
}
//请求失败这里会抛ClientException异常
SendSmsResponse sendSmsResponse = null;
try {
sendSmsResponse = getClient().sendSms(request);
} catch (Exception e) {
e.printStackTrace();
}
if (sendSmsResponse != null && "OK".equals(sendSmsResponse.getBody().getCode())) {
log.debug("send Message to [{}] successful", telephone);
} else {
if (null != sendSmsResponse) {
throw new BusinessException("发送短信失败," + sendSmsResponse.getBody().getMessage());
} else {
throw new BusinessException("发送短信失败");
}
}
}
public enum TemplateType {
/**
*
*/
DOWN("SMS_212471722", "pwd"),
/**
*
*/
Express("SMS_212476711", "nu");
/**
*
*/
private final String[] args;
/**
* id
*/
private final String code;
TemplateType(String code, String... args) {
this.args = args;
this.code = code;
}
}
}

@ -0,0 +1,76 @@
package com.ruoyi.wx.util;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.WxMaUserService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaKefuMessage;
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.CacheUtils;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Objects;
@Component
public class WxServiceUtils {
@Value("${wx.appid}")
private String appid;
@Value("${wx.appsecret}")
private String appsecret;
private static WxMaService wxMaService;
private static final String CACHE_NAME ="wx-accessCache";
@PostConstruct
private void init() {
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
config.setAppid(appid);
config.setSecret(appsecret);
wxMaService = new WxMaServiceImpl();
wxMaService.setWxMaConfig(config);
// config.setAccessToken(getAccessToken());
}
// private String getAccessToken(){
// Object accessToken = CacheUtils.get(CACHE_NAME, "access_token");
// if(Objects.isNull(accessToken)){
// try {
// accessToken=wxMaService.getAccessToken();
// } catch (WxErrorException e) {
// return null;
// }
// CacheUtils.put(CACHE_NAME,"access_token",accessToken);
// }
// return (String)accessToken;
// }
public WxMaJscode2SessionResult login(String code) {
try {
return wxMaService.getUserService().getSessionInfo(code);
} catch (WxErrorException e) {
throw new BaseException("小程序登录失败!" + e.getMessage());
}
}
public WxMaUserService getUserService() {
return wxMaService.getUserService();
}
// public static void sendKefuMsg(String content,String openid){
// WxMaKefuMessage wxMaKefuMessage=new WxMaKefuMessage();
// wxMaKefuMessage.setToUser(openid);
// wxMaKefuMessage.setMsgType("text");
// WxMaKefuMessage.KfText text=new WxMaKefuMessage.KfText(content);
// wxMaKefuMessage.setText(text);
// try {
// wxMaService.getMsgService().sendKefuMsg(wxMaKefuMessage);
// } catch (WxErrorException e) {
// e.printStackTrace();
// }
// }
}

@ -0,0 +1,48 @@
package com.ruoyi.wx.util;
import com.ruoyi.common.exception.wx.NotLoginException;
import com.ruoyi.common.utils.CacheUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.wx.domain.WxUser;
import com.ruoyi.wx.dto.WxUserDTO;
import com.ruoyi.wx.service.IWxUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.util.Objects;
@Component
public class WxUserUtils {
@Autowired
private HttpServletRequest request;
@Autowired
private IWxUserService wxUserService;
private final String cacheName = "wx-userCache";
private String getToken() {
return request.getHeader("token");
}
public WxUserDTO getUserInfo() {
String token = getToken();
Object userCache = CacheUtils.get(cacheName, "wx-token:" + token);
if (Objects.nonNull(userCache)) {
return (WxUserDTO) userCache;
} else {
WxUser wxUser = wxUserService.selectWxUserByToken(getToken());
if (Objects.nonNull(wxUser)) {
WxUserDTO wxUserDTO = new WxUserDTO();
BeanUtils.copyProperties(wxUser, wxUserDTO);
CacheUtils.put(cacheName, "wx-token:" + token, wxUserDTO);
return wxUserDTO;
} else {
throw new NotLoginException();
}
}
}
public void clearCache() {
CacheUtils.remove(cacheName, "wx-token:" + getToken());
}
}

@ -0,0 +1,149 @@
<?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.wx.mapper.MrRecordOrderMapper">
<resultMap type="MrRecordOrder" id="MrRecordOrderResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="mrNumber" column="mr_number" />
<result property="patientName" column="patient_name" />
<result property="dischargeDate" column="discharge_date" />
<result property="times" column="times" />
<result property="applicantId" column="applicant_id" />
<result property="hospital" column="hospital" />
<result property="address" column="address" />
<result property="downloadUrl" column="download_url" />
<result property="unzipPwd" column="unzip_pwd" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="delivery" column="delivery"/>
<result property="trackingNumber" column="tracking_number"/>
</resultMap>
<sql id="selectMrRecordOrderVo">
select id, type, mr_number, patient_name, delivery, tracking_number, discharge_date, times, applicant_id, hospital, address, download_url, unzip_pwd, status, create_time, update_time from mr_record_order
</sql>
<select id="selectMrRecordOrderList" parameterType="MrRecordOrder" resultMap="MrRecordOrderResult">
<include refid="selectMrRecordOrderVo"/>
<where>
<if test="type != null "> and type = #{type}</if>
<if test="mrNumber != null and mrNumber != ''"> and mr_number = #{mrNumber}</if>
<if test="patientName != null and patientName != ''"> and patient_name like concat('%', #{patientName}, '%')</if>
<if test="dischargeDate != null "> and discharge_date = #{dischargeDate}</if>
<if test="times != null "> and times = #{times}</if>
<if test="applicantId != null "> and applicant_id = #{applicantId}</if>
<if test="hospital != null and hospital != ''"> and hospital = #{hospital}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="downloadUrl != null and downloadUrl != ''"> and download_url = #{downloadUrl}</if>
<if test="unzipPwd != null and unzipPwd != ''"> and unzip_pwd = #{unzipPwd}</if>
<if test="status != null "> and status = #{status}</if>
<if test="delivery!=null and delivery != ''">and delivery like concat('%',#{delivery},'%')</if>
<if test="trackingNumber!=null and trackingNumber != ''">and tracking_number like concat('%',#{trackingNumber},'%')</if>
</where>
order by `status`,create_time DESC
</select>
<select id="searchList" resultType="com.ruoyi.wx.dto.RecordOrderDTO">
select o.id,if(o.type=0,'原件寄回','电子扫描件') type,o.mr_number mrNumber,o.patient_name patientName,o.discharge_date dischargeDate,o.times,o.hospital,o.address,if(o.`status`=0,'申请中','已完成') status,o.download_url downUrl
from mr_record_order o
where o.applicant_id = #{userId}
<if test="keyword!=null and keyword!=''">
and (o.mr_number like CONCAT('%',#{keyword},'%') or o.patient_name like CONCAT('%',#{keyword},'%'))
</if>
<if test="status !=null">
and o.status = #{status}
</if>
order by o.`status`,o.create_time DESC
limit ${startRow},${endRow}
</select>
<select id="selectMrRecordOrderById" parameterType="Long" resultMap="MrRecordOrderResult">
<include refid="selectMrRecordOrderVo"/>
where id = #{id}
</select>
<insert id="insertMrRecordOrder" parameterType="MrRecordOrder" useGeneratedKeys="true" keyProperty="id">
insert into mr_record_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">type,</if>
<if test="mrNumber != null and mrNumber != ''">mr_number,</if>
<if test="patientName != null and patientName != ''">patient_name,</if>
<if test="dischargeDate != null">discharge_date,</if>
<if test="times != null">times,</if>
<if test="applicantId != null">applicant_id,</if>
<if test="hospital != null and hospital != ''">hospital,</if>
<if test="address != null">address,</if>
<if test="downloadUrl != null">download_url,</if>
<if test="unzipPwd != null">unzip_pwd,</if>
<if test="status != null">status,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="delivery!=null and delivery != ''">delivery,</if>
<if test="trackingNumber!=null and trackingNumber != ''">tracking_number,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">#{type},</if>
<if test="mrNumber != null and mrNumber != ''">#{mrNumber},</if>
<if test="patientName != null and patientName != ''">#{patientName},</if>
<if test="dischargeDate != null">#{dischargeDate},</if>
<if test="times != null">#{times},</if>
<if test="applicantId != null">#{applicantId},</if>
<if test="hospital != null and hospital != ''">#{hospital},</if>
<if test="address != null">#{address},</if>
<if test="downloadUrl != null">#{downloadUrl},</if>
<if test="unzipPwd != null">#{unzipPwd},</if>
<if test="status != null">#{status},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delivery!=null and delivery != ''">#{delivery},</if>
<if test="trackingNumber!=null and trackingNumber != ''">#{trackingNumber}</if>
</trim>
</insert>
<update id="updateMrRecordOrder" parameterType="MrRecordOrder">
update mr_record_order
<trim prefix="SET" suffixOverrides=",">
<if test="type != null">type = #{type},</if>
<if test="mrNumber != null and mrNumber != ''">mr_number = #{mrNumber},</if>
<if test="patientName != null and patientName != ''">patient_name = #{patientName},</if>
<if test="dischargeDate != null">discharge_date = #{dischargeDate},</if>
<if test="times != null">times = #{times},</if>
<if test="applicantId != null">applicant_id = #{applicantId},</if>
<if test="hospital != null and hospital != ''">hospital = #{hospital},</if>
<if test="address != null">address = #{address},</if>
<if test="downloadUrl != null">download_url = #{downloadUrl},</if>
<if test="unzipPwd != null">unzip_pwd = #{unzipPwd},</if>
<if test="status != null">status = #{status},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delivery!=null and delivery != ''">delivery = #{delivery},</if>
<if test="trackingNumber!=null and trackingNumber != ''">tracking_number = #{trackingNumber},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMrRecordOrderById" parameterType="Long">
delete from mr_record_order where id = #{id}
</delete>
<delete id="deleteMrRecordOrderByIds" parameterType="String">
delete from mr_record_order where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getUrlHeaders" resultType="map">
select url,headers from code_url where code=#{code}
</select>
<insert id="saveCodeUrl">
insert into code_url (code,url,headers)values(#{code},#{url},#{headers})
</insert>
</mapper>

@ -0,0 +1,124 @@
<?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.wx.mapper.WxUserMapper">
<resultMap type="WxUser" id="WxUserResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="phone" column="phone" />
<result property="openid" column="openid" />
<result property="status" column="status" />
<result property="flag" column="flag" />
<result property="hospital" column="hospital" />
<result property="address" column="address" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="nickname" column="nickname" />
<result property="avatar" column="avatar" />
<result property="token" column="token" />
</resultMap>
<sql id="selectWxUserVo">
select id, name, phone, openid, status, flag, hospital, address, create_time, update_time, nickname, avatar, token from wx_user
</sql>
<select id="selectWxUserList" parameterType="WxUser" resultMap="WxUserResult">
<include refid="selectWxUserVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="phone != null and phone != ''"> and phone like concat(#{phone}, '%')</if>
<if test="openid != null "> and openid = #{openid}</if>
<if test="status != null"> and status = #{status}</if>
<if test="flag != null"> and flag = #{flag}</if>
<if test="hospital != null and hospital != ''"> and hospital = #{hospital}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="nickname != null and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if>
<if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
<if test="token != null and token != ''"> and token = #{token}</if>
</where>
order by id desc
</select>
<select id="selectWxUserById" parameterType="Long" resultMap="WxUserResult">
<include refid="selectWxUserVo"/>
where id = #{id}
</select>
<select id="selectWxUserByToken" parameterType="String" resultMap="WxUserResult">
<include refid="selectWxUserVo"/>
where token = #{token}
</select>
<select id="selectWxUserByOpenid" parameterType="String" resultMap="WxUserResult">
<include refid="selectWxUserVo"/>
where openid = #{openid}
</select>
<insert id="insertWxUser" parameterType="WxUser" useGeneratedKeys="true" keyProperty="id">
insert into wx_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="phone != null">phone,</if>
<if test="openid != null">openid,</if>
<if test="status != null">status,</if>
<if test="flag != null">flag,</if>
<if test="hospital != null">hospital,</if>
<if test="address != null">address,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="nickname != null">nickname,</if>
<if test="avatar != null">avatar,</if>
<if test="token != null">token,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="phone != null">#{phone},</if>
<if test="openid != null">#{openid},</if>
<if test="status != null">#{status},</if>
<if test="flag != null">#{flag},</if>
<if test="hospital != null">#{hospital},</if>
<if test="address != null">#{address},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="nickname != null">#{nickname},</if>
<if test="avatar != null">#{avatar},</if>
<if test="token != null">#{token},</if>
</trim>
</insert>
<update id="updateWxUser" parameterType="WxUser">
update wx_user
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="openid != null">openid = #{openid},</if>
<if test="status != null">status = #{status},</if>
<if test="flag != null">flag = #{flag},</if>
<if test="hospital != null">hospital = #{hospital},</if>
<if test="address != null">address = #{address},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="nickname != null">nickname = #{nickname},</if>
<if test="avatar != null">avatar = #{avatar},</if>
<if test="token != null">token = #{token},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxUserById" parameterType="Long">
delete from wx_user where id = #{id}
</delete>
<delete id="deleteWxUserByIds" parameterType="String">
delete from wx_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增病案申请')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-order-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">申请类型:</label>
<div class="col-sm-8">
<select name="type" class="form-control m-b" th:with="type=${@dict.getType('mr_record_order_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">病案号:</label>
<div class="col-sm-8">
<input name="mrNumber" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">患者姓名:</label>
<div class="col-sm-8">
<input name="patientName" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">出院日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="dischargeDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">住院次数:</label>
<div class="col-sm-8">
<input name="times" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">申请人:</label>
<div class="col-sm-8">
<div class="input-group">
<input type="text" class="form-control" name="applicantId" id="baidu">
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
</ul>
</div>
<!-- /btn-group -->
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">医院名称:</label>
<div class="col-sm-8">
<input name="hospital" class="form-control" type="text" required>
</div>
</div>
<div class="form-group order-type1">
<label class="col-sm-3 control-label">寄送地址:</label>
<div class="col-sm-8">
<input name="address" class="form-control" type="text">
</div>
</div>
<div class="form-group order-type2">
<label class="col-sm-3 control-label">下载地址:</label>
<div class="col-sm-8">
<input name="downloadUrl" class="form-control" type="text">
</div>
</div>
<div class="form-group order-type2">
<label class="col-sm-3 control-label">解压密码:</label>
<div class="col-sm-8">
<input name="unzipPwd" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">申请状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('mr_record_order_status')}">
<input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
<label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-suggest-js" />
<script th:inline="javascript">
var prefix = ctx + "wx/order"
$("#form-order-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-order-add').serialize());
}
}
$("input[name='dischargeDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
//百度搜索测试
var testBsSuggest = $("#baidu").bsSuggest({
url: ctx + "demo/form/userModel?t="+(new Date()).getTime()+"&keyword=",
allowNoKeyword: false, //是否允许无关键字时请求数据
getDataMethod: "url", //获取数据的方式,总是从 URL 获取
showBtn: false,
idField: "userId",
keyField: "userName"
}).on('onDataRequestSuccess', function (e, result) {
console.log('onDataRequestSuccess: ', result);
}).on('onSetSelectValue', function (e, keyword) {
console.log('onSetSelectValue: ', keyword);
}).on('onUnsetSelectValue', function (e) {
console.log("onUnsetSelectValue");
});
</script>
</body>
</html>

@ -0,0 +1,81 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改病案申请')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-order-edit" th:object="${mrRecordOrder}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">申请类型:</label>
<div class="col-sm-8">
<select name="type" class="form-control m-b" th:with="type=${@dict.getType('mr_record_order_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{type}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">病案号:</label>
<div class="col-sm-8">
<input name="mrNumber" th:field="*{mrNumber}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">患者姓名:</label>
<div class="col-sm-8">
<input name="patientName" th:field="*{patientName}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">出院日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="dischargeDate" th:value="${#dates.format(mrRecordOrder.dischargeDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">住院次数:</label>
<div class="col-sm-8">
<input name="times" th:field="*{times}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">医院名称:</label>
<div class="col-sm-8">
<input name="hospital" th:field="*{hospital}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">寄送地址:</label>
<div class="col-sm-8">
<input name="address" th:field="*{address}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "wx/order";
$("#form-order-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-order-edit').serialize());
}
}
$("input[name='dischargeDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

@ -0,0 +1,171 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('病案申请列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>医院名称:</label>
<input type="text" name="hospital"/>
</li>
<li>
<label>病案号:</label>
<input type="text" name="mrNumber"/>
</li>
<li>
<label>患者姓名:</label>
<input type="text" name="patientName"/>
</li>
<li>
<label>出院日期:</label>
<input type="text" class="time-input" placeholder="请选择出院日期" name="dischargeDate"/>
</li>
<li>
<label>申请类型:</label>
<select name="type" th:with="type=${@dict.getType('mr_record_order_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>申请状态:</label>
<select name="status" th:with="type=${@dict.getType('mr_record_order_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="wx:order:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="wx:order:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="wx:order:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('wx:order:edit')}]];
var removeFlag = [[${@permission.hasPermi('wx:order:remove')}]];
var typeDatas = [[${@dict.getType('mr_record_order_type')}]];
var statusDatas = [[${@dict.getType('mr_record_order_status')}]];
var prefix = ctx + "wx/order";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "病案申请",
columns: [{
checkbox: true
},
{
field: 'id',
title: '主键',
visible: false
},
{
field: 'mrNumber',
title: '病案号'
},
{
field: 'patientName',
title: '患者姓名'
},
{
field: 'dischargeDate',
title: '出院日期'
},
{
field: 'times',
title: '住院次数'
},
{
field: 'applicantId',
title: '申请人'
},
{
field: 'hospital',
title: '医院名称'
},
{
field: 'type',
title: '申请类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(typeDatas, value);
}
},
{
field: 'address',
title: '寄送地址'
},
{
field: 'delivery',
title: '快递公司'
},
{
field: 'trackingNumber',
title: '运单号'
},
{
field: 'downloadUrl',
title: '下载地址'
},
{
field: 'unzipPwd',
title: '解压密码'
},
{
field: 'status',
title: '申请状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(statusDatas, value);
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
if(row.status===0){
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="sendView(\'' + row.id + '\',\'' + row.mrNumber + '\')"><i class="fa fa-paper-plane"></i>处理</a> ');
}
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
function sendView(id,mrNumber){
$.modal.open("处理病案【" + mrNumber+"】", prefix+"/sendView/"+id);
}
</script>
</body>
</html>

@ -0,0 +1,69 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('处理申请')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-order-edit" th:object="${mrRecordOrder}">
<input name="id" th:field="*{id}" type="hidden">
<input name="type" th:field="*{type}" type="hidden">
<div class="form-group" th:if="*{type} eq 1">
<label class="col-sm-3 control-label is-required">下载地址:</label>
<div class="col-sm-8">
<input name="downloadUrl" th:field="*{downloadUrl}" class="form-control" type="text" readonly id="downloadUrl">
</div>
</div>
<div class="form-group" th:if="*{type} eq 1">
<label class="col-sm-3 font-noraml control-label is-required">上传文件:</label>
<div class="col-sm-8">
<input class="file col-sm-8" type="file" id="fileinput" accept=".rar,.zip">
</div>
</div>
<div class="form-group" th:if="*{type} eq 1">
<label class="col-sm-3 control-label">解压密码:</label>
<div class="col-sm-8">
<input name="unzipPwd" class="form-control" type="text" th:value="${randomCode}" readonly>
</div>
</div>
<div class="form-group" th:if="*{type} eq 0">
<label class="col-sm-3 control-label is-required">快递公司:</label>
<div class="col-sm-8">
<input name="delivery" th:field="*{delivery}" class="form-control" type="text" required value="顺丰">
</div>
</div>
<div class="form-group" th:if="*{type} eq 0">
<label class="col-sm-3 control-label is-required">运单号:</label>
<div class="col-sm-8">
<input name="trackingNumber" th:field="*{trackingNumber}" class="form-control" type="text" required>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<script th:inline="javascript">
var prefix = ctx + "wx/order";
$("#form-order-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/sendSms", $('#form-order-edit').serialize());
}
}
$("#fileinput").fileinput({
'theme': 'explorer-fas',
'uploadUrl': prefix+'/upload',
'showPreview': false
});
$("#fileinput").on("fileuploaded", function(event, data, proviewId, index) {
$("#downloadUrl").val(data.response.data)
});
</script>
</body>
</html>

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增微信小程序用户')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-user-add">
<div class="form-group">
<label class="col-sm-3 control-label">用户姓名:</label>
<div class="col-sm-8">
<input name="name" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">小程序openid</label>
<div class="col-sm-8">
<input name="openid" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户状态 0正常 1停用</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('wx_user')}">
<input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">审核状态 0审核中 1审核成功</label>
<div class="col-sm-8">
<input name="flag" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">医院名称:</label>
<div class="col-sm-8">
<input name="hospital" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货地址:</label>
<div class="col-sm-8">
<input name="address" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">微信昵称:</label>
<div class="col-sm-8">
<input name="nickname" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">微信头像:</label>
<div class="col-sm-8">
<input name="avatar" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/user"
$("#form-user-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-user-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改微信小程序用户')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-user-edit" th:object="${wxUser}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">用户姓名:</label>
<div class="col-sm-8">
<input name="name" th:field="*{name}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">手机号码:</label>
<div class="col-sm-8">
<input name="phone" th:field="*{phone}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">医院名称:</label>
<div class="col-sm-8">
<input name="hospital" th:field="*{hospital}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "wx/user";
$("#form-user-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-user-edit').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,159 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('微信小程序用户列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>医院名称:</label>
<input type="text" name="hospital"/>
</li>
<li>
<label>用户姓名:</label>
<input type="text" name="name"/>
</li>
<li>
<label>手机号码:</label>
<input type="text" name="phone"/>
</li>
<li>
<label>用户状态:</label>
<select name="status" th:with="type=${@dict.getType('wx_user_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>审核状态:</label>
<select name="flag" th:with="type=${@dict.getType('wx_user_flag')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="wx:user:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('wx:user:edit')}]];
var statusDatas = [[${@dict.getType('wx_user_status')}]];
var flagDatas = [[${@dict.getType('wx_user_flag')}]];
var prefix = ctx + "wx/user";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "微信小程序用户",
columns: [{
checkbox: true
},
{
field: 'id',
title: '主键',
visible: false
},
{
field: 'name',
title: '用户姓名'
},
{
field: 'phone',
title: '手机号码'
},
{
field: 'nickname',
title: '微信昵称'
},
{
field: 'avatar',
title: '微信头像',
formatter: function(value, row, index) {
return value?'<img src='+value+' style="max-width:25px">':'-';
}
},
{
field: 'hospital',
title: '医院名称'
},
{
field: 'status',
title: '用户状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(statusDatas, value);
}
},
{
field: 'flag',
title: '审核状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(flagDatas, value);
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
if(row.status===0&&row.flag===0){
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="singIn(\'' + row.id + '\')"><i class="fa fa-check-square-o"></i>审核</a> ');
}
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
let disBtn='停用',disCls='btn-danger';
if(row.status===1){
disBtn='启用';
disCls='btn-primary';
}
actions.push('<a class="btn '+disCls+' btn-xs" href="javascript:void(0)" onclick="triggerDis(\'' + row.id + '\','+row.status+')"><i class="fa fa-smile-o"></i>'+disBtn+'</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
function singIn(userId){
$.modal.confirm('是否审核通过',function(){
$.operate.post(prefix+'/checkUser',{id:userId},function(){
$.table.refresh();
});
})
}
function triggerDis(userId,userStatus){
let tips='确认停用用户吗';
if(userStatus === 1){
tips='确认启用用户吗';
}
$.modal.confirm(tips,function(){
$.operate.post(prefix+'/triggerStatus',{id:userId},function(){
$.table.refresh();
});
})
}
</script>
</body>
</html>
Loading…
Cancel
Save