Pre Merge pull request !5 from Admin/dev

This commit is contained in:
Admin 2021-02-10 15:30:05 +08:00 committed by Gitee
commit aee23629ea
271 changed files with 27486 additions and 706 deletions

2
.gitignore vendored
View File

@ -42,3 +42,5 @@ nbdist/
!*/build/*.java !*/build/*.java
!*/build/*.html !*/build/*.html
!*/build/*.xml !*/build/*.xml
ruoyi/uploadPath/

161
doc/development.md Normal file
View File

@ -0,0 +1,161 @@
# 配餐功能说明
- 功能说明:
记录病患营养配餐会诊结果,并通过配餐页面设置在病患每日报餐的依据
- 数据结构
独立单表,记录病患营养配餐情况
* 数据说明
病患id、正餐类型早午晚夜间加餐、配餐号、配餐频次、用法、
是否替代正餐、作废标志、更新日期、更新人
* 对应创建营养配餐日志表,用于记录修改的历史情况
- 界面设计
1. 搜索栏:住院号、姓名、科室、床号、作废标志
2. 功能栏: 添加、删除、作废、每日简报、记录表、拷贝并新增、拷贝、粘贴
3. 数据栏:科室、姓名、床号、餐号、频次、用法、时间、更新人、早午晚、描述
- 功能设计
1. 新增会诊记录
- 选择科室、找到病人
- 选择餐号、用法
- 多选早午晚加,自动生成频次,频次可以手动修改
2. 拷贝并新增
- 选择列表中某个记录
- 选择“拷贝并新增”按钮
- 选择列的数据填充到新增弹出层表格中
- 操作员选择科室、病人,确认后,产生新营养配餐记录
3. 拷贝功能
- 选择列表中任意一个记录
- 点击“拷贝”按钮后,按钮文字变成“批量粘贴”
- 选择多个除拷贝的数据列病患记录外的其他病患记录
- 点击“批量粘贴”,其他被选择的病患记录更新为拷贝列一样的营养配餐数据
3. 作废按钮
- 可以多选,多个病患营养配餐数据设置为作废状态,有需要的时候,可以恢复
4. 签领单下载
- 导出签领单格式的excel
- 数据格式以病患为单位的单日统计表,列出空项目,用于签名
- 统计项:餐数、单项汇总早午晚加的数据
- 合计汇总; 总人数、餐数、科室分类统计
- 可选择一周内多日导出
# 收费结算功能
1. 开票挂账
- 列表所有已结算病患结算单
- 列表后方设置快捷开票按钮,只针对当前结算单开票
- 选择按钮“开票”,选择病人,列出该病患所有可开票结算单
- 选择可多选对应的结算单,列出待开发票汇总金额
点击“开票”
- 输入单位信息、发票信息
- 选择开票,记录开票信息
- 选择挂账, 记录挂账信息
2. 对应数据结构
- id、发票单位、发票id、日期、开票人、收款方式、应收、实收、凭证列表
3. 收费窗口日常收费
- 选择病患信息
- 输入结算日期、实收金额
- 确认后,提示现金收款、在线支付
3. 开票挂账逻辑
- 功能说明;记录开票后收款的信息,并记录汇款情况和总体情况
- 先开票后收款:单位、病患姓名、金额、对应的结算记录、应收、实收
- 查看未收款情况
- 记录回款情况回款日期、金额、余额、凭证list
- 确认后,更新发票收款状态、结算单状态
4. 集体多人挂账方式
- 功能说明:记录合作机构长期滚动结算的信息
- 先新增合作单位
- 为合作单位绑定结算相关的病患信息
- 可以生成结算单(按月结算)
- 结算挂账记录
- 回款历史清单
- 统计
- 记录方式:用报餐表记录流水,结算单记录个人或多人的汇总
- 数据格式:添加字段:个人/多人标志 多人list、收款方式现金、在线支付、银行转账
5. 操作
- 选择合作单位
- 列出该单位所有对象未结算金额
- 可以对任意对象生成月结单或出院结算单
- 汇总金额后,输入开票信息
- 相关统计:历史发票、历史回款流水
# 前端:员工报餐
## 功能说明:
- 配置多种模式,适应不同的场景
- 记账模式
- 说明:
针对公司包餐的形式,或者是,先记录后结算的模式,员工只需要报餐和用餐登记即可
- 补贴模式
- 说明:
公司承担部分餐费,餐费以补贴形式发到员工账上,用于用餐消费
- 销售模式
- 说明:
员工用餐完全自费,可在价格上优惠的模式,食堂独立经营
- 记账模式设计
- 以仁爱为例
- 界面设计
- tabbar首页、订单、个人、login
- 首页
- 第一栏:姓名、现在正在用餐、用餐时间、余额
- 第二栏;当前订单
- 第三栏;当前菜品
- 第四栏;一周菜谱
- 第五栏:订餐区
- 一周日历
- 早午晚复选框
- 根据报餐模式显示:
- 自动模式;停餐
- 手动模式:报餐
- 订单
- 显示所有有效订单
- 点击订单显示详情和二维码,下方有取消订单按钮
- 个人
- 显示个人信息
- 余额信息
- 当前订餐模式配置
- 退出登录按钮
- 前端接口api清单
- 获取用餐时间getDinnerTimeSetting
- 获取当天订单详情getOrderOfToday
- 获取每周菜谱getWeekMenu
- 获取有效订单列表getAvailableOrder
- 发送订餐订单信息PostOrder
- 获取二维码getQrcode
- 获取当前订餐模式配置信息getConfiguration
- 更新当前配置postConfiguration
- 登录/登出login / logout
- 获取工作日/节假日信息getWorkday / getHoliday
- 获取菜品信息getProduct
- 获取其他商品信息getOtherProduct
- 生成购物订单postProductOrder
- 取消当前订单; postCurrentOrder
- 请求停餐/恢复postStopOrder / postRestoreOrder
- 后端:定时任务生成员工订餐逻辑
- 系统配置表:
- 数据库格式id、企业id、config_key, config_value, flag
- 记账模式有效
- 取所有自动报餐并且当天没有停餐记录的员工,生成当天报餐订单记录
- 分别生成早午晚
# 前端:护工报餐功能
## 功能说明
- 优化:在数据表中增加订单详情描述,减少前端计算
## UI设计
- tabbar科室、报餐、个人
- 科室:显示科室清单,首选本人负责的科室
- 报餐:列表方式显示:床号、姓名、订餐描述、营养配餐
- 显示个人:早午晚加餐的明细
- 快捷按钮:全天停餐、变更
- 个人:姓名、公司、报餐科室、退出登录
- 报餐操作
- 选择正餐类型,复选框,可以考虑增加早午晚类型的过滤,减少显示类型
- 选择加餐开关
- 选择加蛋数量
- 功能按钮
- 更新
- 停餐
- 记住修改
## 问题记录
1. 营养配餐每小时频次怎么回事
2. 了解残联这种长期合作的结算方式怎样
3. 营养配餐记录表的要求
4. 营养配餐替代正餐逻辑,如果替代的话, 护工是应该无权修改正餐报餐

10
pom.xml
View File

@ -10,7 +10,7 @@
<name>ruoyi</name> <name>ruoyi</name>
<url>http://www.ruoyi.vip</url> <url>http://www.ruoyi.vip</url>
<description>若依管理系统</description> <description>食堂管理系统</description>
<properties> <properties>
<ruoyi.version>3.3.0</ruoyi.version> <ruoyi.version>3.3.0</ruoyi.version>
@ -119,7 +119,13 @@
<artifactId>springfox-swagger-ui</artifactId> <artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version> <version>${swagger.version}</version>
</dependency> </dependency>
<!-- 增加热部署依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!-- optional=true,依赖不会传递该项目依赖devtools之后依赖该项目的项目如果想要使用devtools需要重新引入 -->
<optional>true</optional>
</dependency>
<!--io常用工具类 --> <!--io常用工具类 -->
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>

View File

@ -8,7 +8,7 @@
<version>3.3.0</version> <version>3.3.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging> <packaging>war</packaging>
<artifactId>ruoyi-admin</artifactId> <artifactId>ruoyi-admin</artifactId>
<description> <description>
@ -17,11 +17,10 @@
<dependencies> <dependencies>
<!-- spring-boot-devtools -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId> <artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 --> <optional>true</optional>
</dependency> </dependency>
<!-- swagger2--> <!-- swagger2-->

View File

@ -18,6 +18,6 @@ public class RuoYiApplication
{ {
System.setProperty("spring.devtools.restart.enabled", "false"); System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args); SpringApplication.run(RuoYiApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙"); System.out.println("(♥◠‿◠)ノ゙ 食堂管理启动成功 ლ(´ڡ`ლ)゙");
} }
} }

View File

@ -113,7 +113,7 @@ public class SwaggerConfig
// 用ApiInfoBuilder进行定制 // 用ApiInfoBuilder进行定制
return new ApiInfoBuilder() return new ApiInfoBuilder()
// 设置标题 // 设置标题
.title("标题:若依管理系统_接口文档") .title("标题:食堂管理系统_接口文档")
// 描述 // 描述
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...") .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
// 作者信息 // 作者信息

View File

@ -0,0 +1,14 @@
{
"properties": [
{
"name": "fantang.templatePath",
"type": "java.lang.String",
"description": "Description for spring.fantang.templatePath."
},
{
"name": "fantang.fileWebUrl",
"type": "java.lang.String",
"description": "Description for spring.fantang.fileWebUrl."
}
]
}

View File

@ -1,79 +1,83 @@
# 数据源配置 # 数据源配置
spring: spring:
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://192.168.0.222:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true url: jdbc:mysql://192.168.3.95:3306/fantang_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
username: root username: root
password: root password: 123456
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: false enabled: true
url: url: jdbc:mysql://8.129.41.210:3306/kaiping?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
username: username: kaiping
password: password: awLjrADFYLzt2f3D
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5
# 最小连接池数量 # 最小连接池数量
minIdle: 10 minIdle: 10
# 最大连接池数量 # 最大连接池数量
maxActive: 20 maxActive: 20
# 配置获取连接等待超时的时间 # 配置获取连接等待超时的时间
maxWait: 60000 maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000 timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒 # 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000 minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒 # 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000 maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效 # 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true testWhileIdle: true
testOnBorrow: false testOnBorrow: false
testOnReturn: false testOnReturn: false
webStatFilter: webStatFilter:
enabled: true enabled: true
statViewServlet: statViewServlet:
enabled: true enabled: true
# 设置白名单,不填则允许所有访问 # 设置白名单,不填则允许所有访问
allow: allow:
url-pattern: /druid/* url-pattern: /druid/*
# 控制台管理用户名和密码 # 控制台管理用户名和密码
login-username: login-username:
login-password: login-password:
filter: filter:
stat: stat:
enabled: true enabled: true
# 慢SQL记录 # 慢SQL记录
log-slow-sql: true log-slow-sql: true
slow-sql-millis: 1000 slow-sql-millis: 1000
merge-sql: true merge-sql: true
wall: wall:
config: config:
multi-statement-allow: true multi-statement-allow: true
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: 192.168.0.222 host: 127.0.0.1
# 端口默认为6379 # 端口默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
database: 0 database: 2
# 密码 # 密码
password: password:
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
pool: pool:
# 连接池中的最小空闲连接 # 连接池中的最小空闲连接
min-idle: 0 min-idle: 0
# 连接池中的最大空闲连接 # 连接池中的最大空闲连接
max-idle: 8 max-idle: 8
# 连接池的最大数据库连接数 # 连接池的最大数据库连接数
max-active: 8 max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制) # #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms max-wait: -1ms
fantang:
templatePath: Z:\\程序开发\\项目测试\\三院饭堂\\饭堂收费票据模板.pdf
fileWebUrl: http://127.0.0.1:9001/dev-api/

View File

@ -1,79 +1,84 @@
# 数据源配置 # 数据源配置
spring: spring:
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true url: jdbc:mysql:///sanyuan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
username: root username: sanyuan
password: root password: ZbAky8PJEksDSz42
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: false enabled: true
url: url: jdbc:mysql://8.129.41.210:3306/kaiping?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
username: username: kaiping
password: password: awLjrADFYLzt2f3D
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5
# 最小连接池数量 # 最小连接池数量
minIdle: 10 minIdle: 10
# 最大连接池数量 # 最大连接池数量
maxActive: 20 maxActive: 20
# 配置获取连接等待超时的时间 # 配置获取连接等待超时的时间
maxWait: 60000 maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000 timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒 # 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000 minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒 # 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000 maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效 # 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true testWhileIdle: true
testOnBorrow: false testOnBorrow: false
testOnReturn: false testOnReturn: false
webStatFilter: webStatFilter:
enabled: true enabled: true
statViewServlet: statViewServlet:
enabled: true enabled: true
# 设置白名单,不填则允许所有访问 # 设置白名单,不填则允许所有访问
allow: allow:
url-pattern: /druid/* url-pattern: /druid/*
# 控制台管理用户名和密码 # 控制台管理用户名和密码
login-username: login-username:
login-password: login-password:
filter: filter:
stat: stat:
enabled: true enabled: true
# 慢SQL记录 # 慢SQL记录
log-slow-sql: true log-slow-sql: true
slow-sql-millis: 1000 slow-sql-millis: 1000
merge-sql: true merge-sql: true
wall: wall:
config: config:
multi-statement-allow: true multi-statement-allow: true
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: 192.168.0.222 host: 127.0.0.1
# 端口默认为6379 # 端口默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
database: 0 database: 2
# 密码 # 密码
password: password:
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
pool: pool:
# 连接池中的最小空闲连接 # 连接池中的最小空闲连接
min-idle: 0 min-idle: 0
# 连接池中的最大空闲连接 # 连接池中的最大空闲连接
max-idle: 8 max-idle: 8
# 连接池的最大数据库连接数 # 连接池的最大数据库连接数
max-active: 8 max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制) # #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms max-wait: -1ms
# 饭堂配置参数
fantang:
templatePath: /root/sanyuan/template/饭堂收费票据模板.pdf
fileWebUrl: http://8.135.81.183:8080/prod-api/

View File

@ -3,7 +3,7 @@ ruoyi:
# 名称 # 名称
name: RuoYi name: RuoYi
# 版本 # 版本
version: 3.3.0 version: 3.2.1
# 版权年份 # 版权年份
copyrightYear: 2021 copyrightYear: 2021
# 实例演示开关 # 实例演示开关
@ -18,11 +18,10 @@ ruoyi:
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口默认为8080 # 服务器的HTTP端口默认为8080
port: 8080 port: 9000
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /
# undertow 配置
undertow: undertow:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的 # HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1 max-http-post-size: -1
@ -35,19 +34,11 @@ server:
worker-threads: 256 worker-threads: 256
# 是否分配的直接内存 # 是否分配的直接内存
direct-buffers: true direct-buffers: true
# # tomcat 配置
# tomcat:
# # tomcat的URI编码
# uri-encoding: UTF-8
# # tomcat最大线程数默认为200
# max-threads: 500
# # Tomcat启动初始化的线程数默认值25
# min-spare-threads: 30
# 日志配置 # 日志配置
logging: logging:
level: level:
com.ruoyi: @logging.level@ com.ruoyi: debug
org.springframework: warn org.springframework: warn
# Spring配置 # Spring配置
@ -57,14 +48,14 @@ spring:
# 国际化资源文件路径 # 国际化资源文件路径
basename: i18n/messages basename: i18n/messages
profiles: profiles:
active: @profiles.active@ active: dev
# 文件上传 # 文件上传
servlet: servlet:
multipart: multipart:
# 单个文件大小 # 单个文件大小
max-file-size: 10MB max-file-size: 10MB
# 设置总上传的文件大小 # 设置总上传的文件大小
max-request-size: 20MB max-request-size: 20MB
# 服务模块 # 服务模块
devtools: devtools:
restart: restart:
@ -73,12 +64,12 @@ spring:
# token配置 # token配置
token: token:
# 令牌自定义标识 # 令牌自定义标识
header: Authorization header: Authorization
# 令牌密钥 # 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟 # 令牌有效期默认30分钟
expireTime: 30 expireTime: 30
# MyBatis配置 # MyBatis配置
# https://baomidou.com/config/ # https://baomidou.com/config/

View File

@ -97,7 +97,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求 // 过滤请求
.authorizeRequests() .authorizeRequests()
// 对于登录login 验证码captchaImage 允许匿名访问 // 对于登录login 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/captchaImage").anonymous() .antMatchers("/login", "/captchaImage","/client_api/**","/huiyuan/**").anonymous()
.antMatchers( .antMatchers(
HttpMethod.GET, HttpMethod.GET,
"/*.html", "/*.html",

View File

@ -216,7 +216,7 @@ public class GenUtils
*/ */
public static String replaceText(String text) public static String replaceText(String text)
{ {
return RegExUtils.replaceAll(text, "(?:表|若依)", ""); return RegExUtils.replaceAll(text, "(?:表|食堂)", "");
} }
/** /**

View File

@ -34,6 +34,14 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId> <artifactId>ruoyi-common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
</dependencies> </dependencies>

View File

@ -0,0 +1,64 @@
package com.ruoyi.quartz.task;
import com.ruoyi.system.fantang.mapper.FtReportMealVoMapper;
import com.ruoyi.system.fantang.service.impl.FtFoodDemandDaoServiceImpl;
import com.ruoyi.system.fantang.service.impl.FtOrderDaoServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 定时任务调度测试
*
* @author ruoyi
*/
@Slf4j
@Component("OrderingTask")
public class FtGenerateOrderTask {
@Autowired
private FtFoodDemandDaoServiceImpl foodDemandDaoService;
@Autowired
private FtReportMealVoMapper reportMealVoMapper;
@Autowired
private FtOrderDaoServiceImpl orderDaoService;
public void GenerateOrderTask() {
System.out.println("执行生成一条病患默认订餐配置记录");
log.info("执行生成一条病患默认订餐配置记录");
foodDemandDaoService.GenerateOrderForNewPatient();
}
public void GeneratePatientTomorrowReportMeal() {
System.out.println("生成次日病患报餐记录");
log.info("生成次日病患报餐记录");
reportMealVoMapper.insertTomorrowReportMeal();
}
// 生成次日员工订餐记录
public void GenerateStaffTomorrowOrder() {
log.info("生成次日员工订餐记录");
orderDaoService.GenerateStaffTomorrowOrder();
}
// 更新用餐状态为用餐状态用餐前提前2小时关闭报餐数据修改
public void updateBreakfastDinnerFlag() {
log.info("更新早餐数:{}", reportMealVoMapper.updateBreakfastDinnerFlag());
}
// 更新用餐状态为用餐状态用餐前提前2小时关闭报餐数据修改
public void updateLunchDinnerFlag() {
log.info("更新午餐数:{}", reportMealVoMapper.updateLunchDinnerFlag());
}
// 更新用餐状态为用餐状态用餐前提前2小时关闭报餐数据修改
public void updateDinnerDinnerFlag() {
log.info("更新晚餐数:{}", reportMealVoMapper.updateDinnerDinnerFlag());
log.info("更新加餐数:{}", reportMealVoMapper.updateAdditionDinnerFlag());
}
}

View File

@ -0,0 +1,34 @@
package com.ruoyi.quartz.task;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.system.fantang.domain.FtRemotePatientDao;
import com.ruoyi.system.fantang.mapper.FtFoodDaoMapper;
import com.ruoyi.system.fantang.mapper.FtRemotePatientDaoMapper;
import com.ruoyi.system.service.impl.SyncPatientServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 定时任务调度测试
*
* @author ruoyi
*/
@DataSource(value = DataSourceType.SLAVE)
@Component("SyncPatient")
public class ftSyncPatientTask {
@Autowired
private FtRemotePatientDaoMapper ftRemotePatientDaoMapper;
@Autowired
private SyncPatientServiceImpl syncPatientService;
public void ftGetRemotePatient() {
System.out.println("执行同步远程病患数据");
// List<FtRemotePatientDao> list = ftRemotePatientDaoMapper.selectList(null);
// System.out.println(list);
syncPatientService.insertToLocalSync(ftRemotePatientDaoMapper.selectList(null));
}
}

View File

@ -23,6 +23,20 @@
<artifactId>ruoyi-common</artifactId> <artifactId>ruoyi-common</artifactId>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.itextpdf/itextpdf -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.itextpdf/itext-asian -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>5.2.0</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -0,0 +1,39 @@
package com.ruoyi.system.fantang.common;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
public enum DinnerType {
breakfast, lunch, dinner, notMatch;
/**
* 根据当前时间判断现在的就餐类型
* @return 返回就餐类型的枚举类
*/
public static DinnerType GetDinnerType() {
String today = DateUtil.today();
Date breakfastStart = DateUtil.parse(today + " 07:30");
Date breakfastEnd = DateUtil.parse(today + " 08:30");
Date lunchStart = DateUtil.parse(today + " 11:30");
Date lunchEnd = DateUtil.parse(today + " 12:30");
Date dinnerStart = DateUtil.parse(today + " 17:00");
Date dinnerEnd = DateUtil.parse(today + " 18:00");
DateTime now = new DateTime(DateTime.now());
if (now.isIn(breakfastStart, breakfastEnd) == true) {
return DinnerType.breakfast;
} else if (now.isIn(lunchStart, lunchEnd) == true) {
return DinnerType.lunch;
} else if (now.isIn(dinnerStart, dinnerEnd) == true){
return DinnerType.dinner;
}else {
return DinnerType.notMatch;
}
}
}

View File

@ -0,0 +1,92 @@
package com.ruoyi.system.fantang.common;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
import com.ruoyi.system.fantang.service.impl.FtConfigDaoServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
import java.util.Map;
public class DinnerTypeUtils {
public enum DinnerType {
breakfast, lunch, dinner, notMatch;
}
public static DinnerTypeUtils instance;
public static DinnerTypeUtils getInstance(IFtConfigDaoService configDaoService ) {
if (instance == null) {
instance = new DinnerTypeUtils(configDaoService );
}
return instance;
}
public void updateDinnerTypeUtils(String settings){
String[] setting = settings.split(",");
if (setting.length != 6) {
return;
}
String today = DateUtil.today();
this.breakfastStart = DateUtil.parse(today + " " + setting[0]);
this.breakfastEnd = DateUtil.parse(today + " " + setting[1]);
this.lunchStart = DateUtil.parse(today + " " + setting[2]);
this.lunchEnd = DateUtil.parse(today + " " + setting[3]);
this.dinnerStart = DateUtil.parse(today + " " + setting[4]);
this.dinnerEnd = DateUtil.parse(today + " " + setting[5]);
}
private Date breakfastStart;
private Date breakfastEnd;
private Date lunchStart;
private Date lunchEnd;
private Date dinnerStart;
private Date dinnerEnd;
/**
* 初始化用餐类型判断基础类加载用餐时间参数
* @param configDaoService
*/
private DinnerTypeUtils(IFtConfigDaoService configDaoService) {
Map<String, String> setting = configDaoService.getDinnerTimeSetting();
String today = DateUtil.today();
this.breakfastStart = DateUtil.parse(today + " " + setting.get("breakfastStart"));
this.breakfastEnd = DateUtil.parse(today + " " + setting.get("breakfastEnd"));
this.lunchStart = DateUtil.parse(today + " " + setting.get("lunchStart"));
this.lunchEnd = DateUtil.parse(today + " " + setting.get("lunchEnd"));
this.dinnerStart = DateUtil.parse(today + " " + setting.get("dinnerStart"));
this.dinnerEnd = DateUtil.parse(today + " " + setting.get("dinnerEnd"));
}
/**
* 根据当前时间判断现在的就餐类型
*
* @return 返回就餐类型的枚举类
*/
public DinnerType getDinnerType() {
DateTime now = new DateTime(DateTime.now());
if (now.isIn(this.breakfastStart, this.breakfastEnd)) {
return DinnerType.breakfast;
} else if (now.isIn(this.lunchStart, this.lunchEnd)) {
return DinnerType.lunch;
} else if (now.isIn(this.dinnerStart, this.dinnerEnd)) {
return DinnerType.dinner;
} else {
return DinnerType.notMatch;
}
}
}

View File

@ -0,0 +1,173 @@
package com.ruoyi.system.fantang.common;
import java.util.*;
import static org.apache.commons.lang3.StringUtils.split;
public class NumberToList {
public static Map<String, String> convertTo(float number, String level) {
String[] str = {"fen","jiao","yuan", "shi", "bai", "qian", "wan", "shiwan", "baiwan", "qianwan"};
Map<String, String> map = new HashMap<>();
// 最大转换20W以内的数值
if (number >= 100000000 || number <= 0 ){
return null;
}
long ret = (long) (number*100);
boolean flag = false;
boolean clear = false;
for (String s : str) {
switch (s) {
case "fen":
map.put(s + level, String.valueOf(ret%10));
if (ret < 10) {
flag = true;
}
break;
case "jiao":
if (flag){
if (clear) {
map.put(s + level, " ");
} else {
map.put(s + level, "¥");
clear = true;
}
} else {
if (ret < 100) {
flag = true;
}
map.put(s + level, String.valueOf((ret / 10) % 10));
}
break;
case "yuan":
if (flag){
if (clear) {
map.put(s + level, " ");
} else {
map.put(s + level, "¥");
clear = true;
}
} else {
if (ret < 1000) {
flag = true;
}
map.put(s + level, String.valueOf((ret / 100) % 10));
}
break;
case "shi":
if (flag){
if (clear) {
map.put(s + level, " ");
} else {
map.put(s + level, "¥");
clear = true;
}
} else {
if (ret < 10000) {
flag = true;
}
map.put(s + level, String.valueOf((ret / 1000) % 10));
}
break;
case "bai":
if (flag){
if (clear) {
map.put(s + level, " ");
} else {
map.put(s + level, "¥");
clear = true;
}
} else {
if (ret < 100000) {
flag = true;
}
map.put(s + level, String.valueOf((ret / 10000) % 10));
}
break;
case "qian":
if (flag){
if (clear) {
map.put(s + level, " ");
} else {
map.put(s + level, "¥");
clear = true;
}
} else {
if (ret < 1000000) {
flag = true;
}
map.put(s + level, String.valueOf((ret / 100000) % 10));
}
break;
case "wan":
if (flag){
if (clear) {
map.put(s + level, " ");
} else {
map.put(s + level, "¥");
clear = true;
}
} else {
if (ret < 10000000) {
flag = true;
}
map.put(s + level, String.valueOf((ret / 1000000) % 10));
}
break;
case "shiwan":
if (flag){
if (clear) {
map.put(s + level, " ");
} else {
map.put(s + level, "¥");
clear = true;
}
} else {
if (ret < 100000000) {
flag = true;
}
map.put(s + level, String.valueOf((ret / 10000000) % 10));
}
break;
case "baiwan":
if (flag){
if (clear) {
map.put(s + level, " ");
} else {
map.put(s + level, "¥");
clear = true;
}
} else {
if (ret < 1000000000) {
flag = true;
}
map.put(s + level, String.valueOf((ret / 100000000) % 10));
}
break;
default:
break;
}
}
return map;
}
public static String convertToHan(float number) {
String[] hanNumber = { "", "", "", "", "", "", "", "", "", "" };
String[] han = { "", "", "", "", "", "", "", "", ""};
StringBuilder builder = new StringBuilder();
String[] str = String.valueOf((long) (number * 100)).split("");
int i = han.length - 1;
for (int j = str.length - 1; j >= 0 ; j--) {
builder
.append(han[i])
.append(hanNumber[Integer.parseInt(str[j])])
.append(" ");
i--;
}
return builder.reverse().toString();
}
}

View File

@ -0,0 +1,663 @@
package com.ruoyi.system.fantang.controller;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.fantang.common.DinnerTypeUtils;
import com.ruoyi.system.fantang.domain.*;
import com.ruoyi.system.fantang.service.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@Slf4j
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/client_api/staff")
public class ClientController extends BaseController {
@Autowired
private IFtConfigDaoService iFtConfigDaoService;
@Autowired
private IFtStaffInfoDaoService staffInfoDaoService;
@Autowired
private IFtStaffDemandDaoService staffDemandDaoService;
@Autowired
private IFtOrderDaoService orderDaoService;
@Autowired
private IFtWeekMenuDaoService weekMenuDaoService;
@Autowired
private IFtFaceinfoDaoService faceinfoDaoService;
@Autowired
private IFtStaffSubsidyDaoService staffSubsidyDaoService;
@Autowired
private IFtFoodDaoService foodDaoService;
@Autowired
private IFtOrderDaoService iFtOrderDaoService;
@Autowired
private IFtFoodDefaultDaoService foodDefaultDaoService;
@Autowired
private IFtStaffStopMealsDaoService staffStopMealsDaoService;
/**
* 获取用餐时间信息
* 日期2020年12月11日
* 作者陈智兴
* type订餐类型
*
* @return
*/
@GetMapping("/getDinnerTimeSetting")
public AjaxResult getDinnerTimeSetting() {
return AjaxResult.success(iFtConfigDaoService.getDinnerTimeSetting());
}
/**
* 获取员工当天订单信息
* 日期2020年12月11日
* 作者陈智兴
*
* @return AjaxResult
*/
@GetMapping("/getOrderOfToday/{staffId}")
public AjaxResult getOrderOfToday(@PathVariable("staffId") Long staffId) {
return AjaxResult.success(orderDaoService.getOrderOfToday(staffId));
}
/**
* 获取员工某一天的订单信息
* 日期2020年12月11日
* 作者陈智兴
* <p>
* return
*/
@GetMapping("/getOrderOfDay")
public AjaxResult getOrderOfDate(@RequestParam("staffId") Long staffId, @RequestParam("orderDate") Date orderDate) {
return AjaxResult.success(orderDaoService.getOrderOfDay(staffId, orderDate));
}
@GetMapping("/getWeekMenu")
public AjaxResult getWeekMenu() {
return AjaxResult.success("调用每周菜谱成功");
}
@GetMapping("/getAvailableOrder/{staffId}")
public AjaxResult getAvailableOrder(@PathVariable("staffId") Integer staffId) {
return AjaxResult.success(orderDaoService.getAvailableOrder(staffId));
}
/**
* 获取员工停餐信息
* 日期2020年12月21日
* 作者陈智兴
* <p>
* param JSONObject staffId: 员工id
* return
*/
@PostMapping("/getAvailableStopOrder")
public AjaxResult getAvailableStopOrder(@RequestBody JSONObject params) {
return AjaxResult.success(orderDaoService.getAvailableStopOrder(params.getLong("staffId")));
}
/**
* 推送订单信息
* 日期2020年12月11日
* 作者陈智兴
* <p>
* param JSONObject staffId: 员工id
* orderType订餐类型
* demandDate 订餐用餐日期
* return
*/
@PostMapping("/PostOrder")
public AjaxResult postOrder(@RequestBody JSONObject params) {
return AjaxResult.success(orderDaoService.insertOrder(params.getLong("staffId"), params.getInteger("orderType"), params.getDate("demandDate")));
}
/**
* 推送停餐信息
* 日期2020年12月21日
* 作者陈智兴
* <p>
* param staffId: 员工id
* type订餐类型
* demandDate 订餐用餐日期
* return -1: 已报停餐信息 1 停餐成功
*/
@PostMapping("/postStopOrder")
public AjaxResult postStopOrder(@RequestBody JSONObject params) {
return AjaxResult.success(orderDaoService.stopOrder(params.getLong("staffId"), params.getInteger("orderType"), params.getDate("demandDate")));
}
/**
* 员工取消订餐信息
* 日期2020年12月21日
* 作者陈智兴
* <p>
* param staffId: 员工id
* type订餐类型
* demandDate 订餐用餐日期
* return -1: 已报停餐信息 1 停餐成功
*/
@PostMapping("/postCancelOrder")
public AjaxResult postCancelOrder(@RequestBody JSONObject params) {
return orderDaoService.cancelOrder(params.getLong("orderId"));
}
/**
* 推送取消停餐信息
* 日期2020年12月21日
* 作者陈智兴
* <p>
* param staffId: 员工id
* type订餐类型
* demandDate 订餐用餐日期
* return -1: 已报停餐信息 1 停餐成功
*/
@PostMapping("/postCancelStopOrder")
public AjaxResult postCancelStopOrder(@RequestBody JSONObject params) {
return AjaxResult.success(orderDaoService.cancelStopOrder(params.getLong("orderId")));
}
// 获取配置信息
@GetMapping("/getConfiguration/{staffId}")
public AjaxResult getConfiguration(@PathVariable("staffId") Long staffId) {
return AjaxResult.success(staffDemandDaoService.getConfiguration(staffId));
}
/**
* 员工登录
* 日期2020年12月10日
* 作者 陈智兴
* 修改首次创建
* <p>
* param { tel: 手机号码;
* password 密码
* }
* return 返回员工信息
*/
@GetMapping("/login")
public AjaxResult login(String tel, String password) {
return staffInfoDaoService.login(tel, password);
}
@PostMapping("/logout")
public AjaxResult logout(@RequestBody JSONObject params) {
return AjaxResult.success(staffInfoDaoService.logout(params.getLong("staffId")));
}
@GetMapping("/getWorkday")
public AjaxResult getWorkday() {
return null;
}
@GetMapping("/getProduct")
public AjaxResult getProduct() {
return null;
}
@GetMapping("/getOtherProduct")
public AjaxResult getOtherProduct() {
return null;
}
@PostMapping("/postProductOrder")
public AjaxResult postProductOrder() {
return null;
}
@PostMapping("/postCurrentOrder")
public AjaxResult postCurrentOrder() {
return null;
}
@PostMapping("/postRestoreOrder")
public AjaxResult postRestoreOrder() {
return null;
}
/**
* 初始化员工订餐配置文件并返回初始化后的记录给前端
* params: staffId
* return
*/
@PostMapping("/initDemandMode")
public AjaxResult initDemandMode(@RequestBody JSONObject params) {
return staffDemandDaoService.initDemandMode(params.getLong("staffId"));
}
/**
* 设置订餐模式
* 日期2020年12月11日
* 作者 陈智兴
* 修改首次创建
*
* @param { config_id: id;
* demandMode: true:自动模式false:手动模式
* }
* @return
*/
@PostMapping("/setDemandMode")
public AjaxResult setDemandMode(@RequestBody JSONObject params) {
Long id = params.getLong("id");
Integer type = params.getInteger("type");
Boolean demandMode = params.getBoolean("demandModeFlag");
return staffDemandDaoService.setDemandMode(id, type, demandMode);
}
/**
* 返回某天的菜单
* param today
* return
*/
@PostMapping("/getMenuOfDay")
public AjaxResult getMenuOfDay(@RequestBody JSONObject params) {
String[] weekDays = {"周日", "周一", "周二", "周三", "周四", "周五", "周六"};
Calendar cal = Calendar.getInstance();
cal.setTime(params.getDate("date"));
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0) {
w = 0;
}
return weekMenuDaoService.getMenuOfDay(weekDays[w]);
}
@GetMapping("/StatisGetOrderOfDate")
public AjaxResult statisGetOrderOfDate(@RequestParam Date date) {
return AjaxResult.success(orderDaoService.statisGetOrderOfDate(date,1 ,50));
}
/**
* 获取指定日期的订单明细
* 类型日期
* 类型 = 0 所有
* type = 123
*/
@PostMapping("/getOrderDetailedByDate")
public AjaxResult getOrderDetailedByDate(@RequestBody JSONObject params) {
String createAt = params.getString("createAt");
Integer orderType = params.getInteger("orderType");
String start = createAt + " 00:00:00";
String end = createAt + " 23:59:59";
// QueryWrapper<FtOrderDao> wrapper = new QueryWrapper<>();
// if (orderType != 0) {
// wrapper.eq("order_type", orderType);
// }
// wrapper.between("create_at", start, end);
// orderDaoService.list(wrapper);
List<FtOrderDao> orderList;
if (orderType != 0) {
orderList = orderDaoService.listDetailedByDate(orderType, start, end);
} else {
orderList = orderDaoService.listAllDetailedByDate(start, end);
}
return AjaxResult.success(orderList);
}
/**
* 查看补贴记录
*/
@GetMapping("/getStaffSubsidy/{staffId}")
public AjaxResult getStaffSubsidy(@PathVariable Long staffId) {
QueryWrapper<FtStaffSubsidyDao> wrapper = new QueryWrapper<>();
wrapper.eq("staff_id", staffId);
return AjaxResult.success(staffSubsidyDaoService.list(wrapper));
}
/**
* 查看补贴余额
*/
@GetMapping("/getStaffSubsidyBalance/{staffId}")
public AjaxResult getStaffSubsidyBalance(@PathVariable Long staffId) {
FtStaffInfoDao staffInfoDao = staffInfoDaoService.getById(staffId);
return AjaxResult.success(staffInfoDao.getBalance());
}
/**
* 查看商品清单
*/
@GetMapping("/getGoodsList")
public AjaxResult getGoodsList() {
QueryWrapper<FtFoodDao> wrapper = new QueryWrapper<>();
wrapper.eq("type", 2);
List<FtFoodDao> list = foodDaoService.list(wrapper);
return AjaxResult.success(list);
}
/**
* 用餐流水订单查看
*/
@GetMapping("/getStaffOrder/{staffId}")
public AjaxResult getStaffOrder(@PathVariable Long staffId) {
QueryWrapper<FtOrderDao> wrapper = new QueryWrapper<>();
wrapper.eq("staff_id", staffId);
return AjaxResult.success(iFtOrderDaoService.list(wrapper));
}
/**
* 获取截止订餐参数
*/
@GetMapping("/getStopDinnerTime")
public AjaxResult getStopDinnerTime() {
QueryWrapper<FtConfigDao> wrapper = new QueryWrapper<>();
wrapper.eq("config_key", "stop_dinner");
FtConfigDao ftConfigDao = iFtConfigDaoService.getOne(wrapper);
return AjaxResult.success(ftConfigDao.getConfigValue());
}
/**
* 获取菜品清单
*/
@GetMapping("/getFoodList")
public AjaxResult getFoodList() {
QueryWrapper<FtFoodDao> wrapper = new QueryWrapper<>();
wrapper.eq("type", 1)
.or()
.eq("type", 4);
List<FtFoodDao> list = foodDaoService.list(wrapper);
return AjaxResult.success(list);
}
/**
* 获取各餐品的价格清单
*
* @param
* @author : 陈智兴
*/
@GetMapping("/getDinnerPriceList")
public AjaxResult getDinnerPriceList() {
List<FtFoodDefaultDao> list = foodDefaultDaoService.list(null);
return AjaxResult.success(list);
}
/**
* 获取订餐优惠比例
*/
@GetMapping("/getOrderDiscount/{orderId}")
public AjaxResult getOrderDiscount(@PathVariable Long orderId) {
FtOrderDao ftOrderDao = orderDaoService.getById(orderId);
return AjaxResult.success(ftOrderDao.getDiscount());
}
/**
* 补贴订单收款
*/
@Transactional
@PostMapping("/orderCollection")
public AjaxResult orderCollection(@RequestBody JSONObject params) {
// 员工 id
Long staffId = params.getLong("staffId");
// 订餐类型
Integer type = params.getInteger("type");
// 总价
BigDecimal totalPrice = params.getBigDecimal("receipts");
// 生成新订单
FtOrderDao orderDao = new FtOrderDao();
orderDao.setOrderType(type);
orderDao.setStaffId(staffId);
orderDao.setTotalPrice(totalPrice);
Date today = new Date();
orderDao.setCreateAt(today);
orderDao.setOrderSrc("在线订单");
// 余额支付
orderDao.setPayType(3);
// 已支付
orderDao.setPayFlag(1);
// 未过期
orderDao.setExpiredFlag(0);
// 未核销
orderDao.setWriteOffFlag(0);
DateTime tomorrow = DateUtil.offsetDay(today, 1);
orderDao.setOrderDate(tomorrow);
// 当前订单员工信息
FtStaffInfoDao staffInfoDao = staffInfoDaoService.getById(orderDao.getStaffId());
// 员工账户补贴余额
BigDecimal balance = staffInfoDao.getBalance();
// 余额是否大于实收
if (balance.compareTo(totalPrice) < 0) {
return AjaxResult.error("补贴余额不足");
} else {
// 更新员工账户补贴余额
BigDecimal nowBalance = balance.subtract(totalPrice);
staffInfoDao.setBalance(nowBalance);
staffInfoDaoService.updateById(staffInfoDao);
orderDaoService.save(orderDao);
// 添加补贴流水记录
FtStaffSubsidyDao staffSubsidyDao = new FtStaffSubsidyDao();
staffSubsidyDao.setStaffId(orderDao.getStaffId());
staffSubsidyDao.setSubsidyType("餐费补贴");
staffSubsidyDao.setIncomeType(2);
staffSubsidyDao.setPrice(totalPrice);
staffSubsidyDao.setConsumAt(today);
staffSubsidyDao.setOrderId(orderDao.getOrderId());
staffSubsidyDaoService.save(staffSubsidyDao);
}
return AjaxResult.success(orderDao);
}
/**
* 补贴订单退款
*/
@Transactional
@PostMapping("/orderRefund")
public AjaxResult orderRefund(@RequestBody JSONObject params) {
// 订单 id
Integer orderId = params.getInteger("orderId");
// 当前订单信息
FtOrderDao orderDao = orderDaoService.getById(orderId);
if (orderDao == null) {
AjaxResult.error("无效订单");
}
// 更新订单信息
orderDao.setPayFlag(2);
orderDaoService.save(orderDao);
// 总价
BigDecimal totalPrice = orderDao.getTotalPrice();
// 当前订单员工信息
FtStaffInfoDao staffInfoDao = staffInfoDaoService.getById(orderDao.getStaffId());
// 员工账户补贴余额
BigDecimal balance = staffInfoDao.getBalance();
// 更新员工账户补贴余额
staffInfoDao.setBalance(balance.add(totalPrice));
staffInfoDaoService.updateById(staffInfoDao);
// 添加补贴流水记录
FtStaffSubsidyDao staffSubsidyDao = new FtStaffSubsidyDao();
staffSubsidyDao.setStaffId(orderDao.getStaffId());
// 退款
staffSubsidyDao.setIncomeType(4);
staffSubsidyDao.setPrice(totalPrice);
staffSubsidyDao.setConsumAt(new Date());
staffSubsidyDao.setOrderId(orderDao.getOrderId());
staffSubsidyDaoService.save(staffSubsidyDao);
return AjaxResult.success("已退款");
}
/**
* 今日员工报餐统计
*/
@GetMapping("/getStatisticsOrderOfToday")
public AjaxResult getStatisticsOrderOfToday() {
Date today = new Date();
return AjaxResult.success(orderDaoService.statisGetOrderOfDate(today, 1, 100));
}
/**
* 明日员工报餐统计
*/
@GetMapping("/getStatisticsOrderOfTomorrow")
public AjaxResult getStatisticsReportMealsOfTomorrow() {
AjaxResult result = new AjaxResult();
result.success();
result.put("reports", orderDaoService.getStatisticsReportMealsOfTomorrow());
result.put("staffs", orderDaoService.getStatisticsStaffOfTomorrow());
result.put("stops", orderDaoService.getStopOrderOfTomorrow());
result.put("order",orderDaoService.statisGetOrderOfDate(DateUtil.offsetDay(new Date(), 1), 1, 100) );
return result;
}
/**
* 人脸识别设备心跳信号
*
* @param request
* @return
*/
@PostMapping("/heartbeat")
public String faceDeviceHeartbeatEvent(@RequestBody JSONObject request) {
System.out.println("face device heartbeat.....");
System.out.println(request);
return "ok";
}
@PostMapping("/verify")
public String faceDeviceVerifyEvent(@RequestBody JSONObject request) {
// 判断是否在用餐时间否则只写日志不处理事件
DinnerTypeUtils.DinnerType dinnerType = DinnerTypeUtils.getInstance(iFtConfigDaoService).getDinnerType();
System.out.println(request);
if (dinnerType == DinnerTypeUtils.DinnerType.notMatch) {
log.info("未到用餐时间人脸记录 : {} ", request);
return request.toJSONString();
}
// 从数据中获取人脸id
JSONObject info = request.getJSONObject("info");
Integer personId = info.getInteger("PersonID");
Long deviceId = info.getLong("DeviceID");
// 判断该设备是否有效
Boolean isEffective = iFtConfigDaoService.isDeviceEffective(deviceId);
if (!isEffective) {
log.info("设备有效性 : {} ", "该人脸识别设备已失效");
return "该人脸识别设备已失效";
}
log.info("用餐时人脸记录 : {} ", info);
// 是否有该员工
FtStaffInfoDao staffInfoDao = staffInfoDaoService.inStaff(personId);
if (staffInfoDao != null) {
// 获取员工 id
Long staffId = staffInfoDao.getStaffId();
String message;
// 进行核销如果该员工没有订餐则自动生成一个订餐记录并核销
switch (dinnerType) {
case breakfast:
message = orderDaoService.setWriteOff(staffId, 1, deviceId);
break;
case lunch:
message = orderDaoService.setWriteOff(staffId, 2, deviceId);
break;
case dinner:
message = orderDaoService.setWriteOff(staffId, 3, deviceId);
break;
default:
throw new IllegalStateException("Unexpected value: " + dinnerType);
}
log.info("人脸核销结果 : {}", message);
return message;
} else {
// 如果该人脸id没有对应的员工则记录找日志中
log.info("员工查询 : {}", "没有找到该员工");
return "没有找到该员工";
}
}
/**
* 自动切换手动报餐时清空停餐记录
*/
@DeleteMapping("deleteStopMeals/{staffId}")
public AjaxResult deleteStopMeals(@PathVariable Long staffId) {
QueryWrapper<FtStaffStopMealsDao> wrapper = new QueryWrapper<>();
wrapper.eq("staff_id", staffId);
staffStopMealsDaoService.remove(wrapper);
return AjaxResult.success("已删除");
}
@PostMapping("qrcode")
public AjaxResult qrcode(@RequestBody JSONObject params) {
String data = params.getString("data");
JSONObject jsonData = JSONObject.parseObject(Base64.decodeStr(data));
Long staffId = jsonData.getLong("staffId");
Long orderId = jsonData.getLong("orderId");
String tel = jsonData.getString("tel");
log.info("二维码:原始字串-{}员工id{}; 订单id{}", jsonData, staffId, orderId);
return AjaxResult.success(String.format("二维码:原始字串-%s员工id%d; 订单id%d, 电话:%s", jsonData, staffId, orderId, tel));
}
}

View File

@ -0,0 +1,239 @@
package com.ruoyi.system.fantang.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.fantang.domain.*;
import com.ruoyi.system.fantang.service.*;
import com.ruoyi.system.fantang.vo.FtPatientVo;
import com.ruoyi.system.fantang.vo.FtReportMealVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping("/client_api/patient")
public class ClientPatientController extends BaseController {
@Autowired
private IFtPatientDaoService iFtPatientDaoService;
@Autowired
private IFtStaffInfoDaoService iFtStaffInfoDaoService;
@Autowired
private IFtDepartDaoService iFtDepartDaoService;
@Autowired
private IFtReportMealsDaoService reportMealsDaoService;
@Autowired
private IFtFoodDemandDaoService iFtFoodDemandDaoService;
@Autowired
private IFtNutritionFoodDaoService iFftNutritionFoodDaoService;
@Autowired
private IFtFoodDaoService iftFoodDaoService;
/**
* 根据病人获取今日报餐信息
*/
@GetMapping("/getReportMealsToday/{patientId}")
public AjaxResult getReportMealsToday(@PathVariable("patientId") Long patientId) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String createAt = sdf.format(new Date());
return AjaxResult.success(iFtPatientDaoService.getReportMealsToday(createAt, patientId));
}
/**
* 根据病人获取次日报餐信息
*/
@GetMapping("/getReportMealsTomorrow/{patientId}")
public AjaxResult getReportMealsTomorrow(@PathVariable("patientId") Long patientId) {
DateTime tomorrow = DateUtil.tomorrow();
String formatDate = DateUtil.formatDate(tomorrow);
return AjaxResult.success(iFtPatientDaoService.getReportMealsToday(formatDate, patientId));
}
/**
* 根据科室获取次日报餐信息
*/
@GetMapping("/getReportMealsByDepart/{departId}")
public AjaxResult getReportMealsByDepart(@PathVariable("departId") Long departId) {
DateTime tomorrow = DateUtil.tomorrow();
String formatDate = DateUtil.formatDate(tomorrow);
List<FtPatientVo> patientVos = iFtPatientDaoService.getReportMealsByDepart(departId, formatDate);
return AjaxResult.success(patientVos);
}
/**
* 获取护工默认部门信息
*/
@GetMapping("/getDepartInfo/{staffId}")
public AjaxResult getDepartInfo(@PathVariable("staffId") Long staffId) {
FtStaffInfoDao departInfo = iFtStaffInfoDaoService.getDepartInfo(staffId);
return AjaxResult.success(departInfo);
}
/**
* 获取部门列表
*/
@GetMapping("/getAllDepart")
public AjaxResult getAllDepart() {
return AjaxResult.success(iFtDepartDaoService.list());
}
/**
* 更改默认报餐部门
*/
@PutMapping("/updateDepart")
public AjaxResult updateDepart(@RequestBody JSONObject params) {
Long staffId = params.getLong("staffId");
String departId = params.getString("departId");
UpdateWrapper<FtStaffInfoDao> wrapper = new UpdateWrapper<>();
wrapper.eq("staff_id", staffId);
FtStaffInfoDao staffInfoDao = new FtStaffInfoDao();
staffInfoDao.setDeptList(departId);
return AjaxResult.success(iFtStaffInfoDaoService.update(staffInfoDao, wrapper));
}
/**
* 批量更新报餐记录
*/
@PutMapping("/batchUpdateReportMeals")
public AjaxResult batchUpdateReportMeals(@RequestBody List<FtReportMealsDao> reportMealsDaoList) {
return AjaxResult.success(reportMealsDaoService.updateBatchById(reportMealsDaoList));
}
/**
* 更新指定病患的报餐记录
*/
@PutMapping("/updateReportMeals")
public AjaxResult updateReportMeals(@RequestBody FtReportMealsDao ftReportMealsDao) {
return AjaxResult.success(reportMealsDaoService.updateById(ftReportMealsDao));
}
/**
* 更新指定病患默认报餐数据
*/
@PutMapping("/updateFoodDemand")
public AjaxResult updateFoodDemand(@RequestBody FtFoodDemandDao ftFoodDemandDao) {
return AjaxResult.success(iFtFoodDemandDaoService.updateById(ftFoodDemandDao));
}
/**
* 获取营养配餐配置信息
*/
@GetMapping("getNutritionFood")
public AjaxResult getNutritionFood() {
return AjaxResult.success(iFftNutritionFoodDaoService.list());
}
/**
* 获取菜品清单
*/
@GetMapping("/getFoodPrice")
public AjaxResult getFoodPrice() {
QueryWrapper<FtFoodDao> wrapper = new QueryWrapper<>();
wrapper.in("type", 1,4)
.gt("dinner_type", 0);
return AjaxResult.success(iftFoodDaoService.list(wrapper));
}
/**
* 病患报餐日统计
*/
@GetMapping("/getStatisticsReportMealsOfDay")
public AjaxResult getStatisticsReportMealsOfDay(@RequestParam("date") Date day) {
List<FtOrderDao> list = iFtFoodDemandDaoService.getStatisticsOfDay(day);
return AjaxResult.success(list);
}
/**
* 明日未报病患报餐统计
*/
@GetMapping("/getStatisticsReportMealsOfTomorrow")
public AjaxResult getStatisticsReportMealsOfTomorrow() {
List<FtReportMealsDao> list = iFtFoodDemandDaoService.getStatisticsFoodDemand();
return AjaxResult.success(list);
}
/**
* 病患报餐周统计
*/
@GetMapping("/getStatisticsReportMealsOfWeek")
public AjaxResult getStatisticsReportMealsOfWeek(@RequestParam("date") Date day) {
List<FtOrderDao> list = iFtFoodDemandDaoService.getStatisticsOfWeek(day);
return AjaxResult.success(list);
}
/**
* 病患报餐月统计
*/
@GetMapping("/getStatisticsReportMealsOfMonth")
public AjaxResult getStatisticsReportMealsOfMonth(@RequestParam("date") Date day) {
List<FtOrderDao> list = iFtFoodDemandDaoService.getStatisticsOfMonth(day);
return AjaxResult.success(list);
}
/**
* 按照用餐类型统计指定日期的各菜品数量
* @author 陈智兴
* @param day:查询日期
* @return
*/
@GetMapping("/getStatisticsFoods")
public AjaxResult getStatisticsFoods(@RequestParam("departId") Integer departId, @RequestParam("date") Date day) {
List<FtReportMealVo> list = reportMealsDaoService.getStatisticsFoods(departId, day);
return AjaxResult.success(list);
}
/**
* 接收病患报餐数据更新生成报餐日志表
* @param list
* @return
*/
@PostMapping("/tomorrowReport")
public AjaxResult tomorrowReport(@RequestBody JSONArray list){
List<JSONObject> objects = list.toJavaList(JSONObject.class);
logger.info("送餐员报餐总数:{}", objects.size());
for (JSONObject object : objects) {
FtReportMealsDao dao = JSONObject.toJavaObject(object, FtReportMealsDao.class);
reportMealsDaoService.updateById(dao);
}
AjaxResult result = AjaxResult.success();
return result;
}
}

View File

@ -0,0 +1,203 @@
package com.ruoyi.system.fantang.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.annotation.Log;
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.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtCateringDao;
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
import com.ruoyi.system.fantang.service.IFtCateringDaoService;
import com.ruoyi.system.fantang.service.IFtFoodDemandDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.*;
/**
* 配餐功能Controller
*
* @author ft
* @date 2020-12-07
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/catering")
public class FtCateringDaoController extends BaseController {
private final IFtCateringDaoService iFtCateringDaoService;
private final IFtFoodDemandDaoService iFtFoodDemandDaoService;
/**
* 查询配餐功能列表
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:list')")
@GetMapping("/list")
public TableDataInfo list(FtCateringDao ftCateringDao) {
startPage();
List<FtCateringDao> list = iFtCateringDaoService.listNewFormatter(ftCateringDao);
return getDataTable(list);
}
/**
* 导出配餐功能列表
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:export')")
@Log(title = "配餐功能", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtCateringDao ftCateringDao) {
LambdaQueryWrapper<FtCateringDao> lqw = new LambdaQueryWrapper<FtCateringDao>(ftCateringDao);
List<FtCateringDao> list = iFtCateringDaoService.list(lqw);
ExcelUtil<FtCateringDao> util = new ExcelUtil<FtCateringDao>(FtCateringDao.class);
return util.exportExcel(list, "catering");
}
/**
* 获取配餐功能详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
FtCateringDao ftCateringDao = iFtCateringDaoService.getByIdNewFormatter(id);
return AjaxResult.success(ftCateringDao);
}
/**
* 新增配餐功能
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:add')")
@Log(title = "配餐功能", businessType = BusinessType.INSERT)
@PostMapping
@Transactional
public AjaxResult add(@RequestBody FtCateringDao ftCateringDao) {
// 添加一个病人新增 4 条营养配餐记录
List<FtCateringDao> ftCateringList = iFtCateringDaoService.addNutritionCatering(ftCateringDao);
// 更新病人报餐配置表
iFtFoodDemandDaoService.updateDayFoodDemand(ftCateringList);
return AjaxResult.success("新增成功");
}
/**
* 修改配餐功能
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:edit')")
@Log(title = "配餐功能", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtCateringDao ftCateringDao) {
Long patientId = ftCateringDao.getPatientId();
Integer type = ftCateringDao.getType();
Long number = ftCateringDao.getNumber();
Boolean flag = ftCateringDao.getFlag();
QueryWrapper<FtFoodDemandDao> wrapper = new QueryWrapper<>();
wrapper.eq("patient_id", patientId);
wrapper.eq("type", type);
FtFoodDemandDao foodDemandDao = iFtFoodDemandDaoService.getOne(wrapper);
foodDemandDao.setNutritionFoodId(number);
foodDemandDao.setUpdateAt(new Date());
foodDemandDao.setNutritionFoodFlag(flag);
iFtFoodDemandDaoService.updateById(foodDemandDao);
return toAjax(iFtCateringDaoService.updateById(ftCateringDao) ? 1 : 0);
}
/**
* 删除配餐功能
*/
@PreAuthorize("@ss.hasPermi('fantang:catering:remove')")
@Log(title = "配餐功能", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return AjaxResult.success(iFtCateringDaoService.deleteByPatientId(ids));
}
/**
* 暂停多个病患营养配餐配置并更新默认报餐配置
*/
@PutMapping("/cancel/{ids}")
@Transactional
public AjaxResult cancel(@PathVariable Long[] ids) {
System.out.println(Arrays.toString(ids));
// 根据病人 id 修改 营养配餐 启用标志
iFtCateringDaoService.cancelByPatientId(ids);
return AjaxResult.success("已暂停");
}
/**
* 恢复多个病患营养配餐配置并更新默认报餐配置
*/
@PutMapping("/restoreCatering/{ids}")
@Transactional
public AjaxResult restoreCatering(@PathVariable Long[] ids) {
System.out.println(Arrays.toString(ids));
// 根据病人 id 修改营养配餐启用标志
iFtCateringDaoService.restoreByPatientId(ids);
return AjaxResult.success("已恢复");
}
/**
* 根据病人 id 查找营养配餐数据
*/
@GetMapping("/getByPatient/{patientId}")
public AjaxResult getByPatient(@PathVariable Long patientId) {
QueryWrapper<FtCateringDao> wrapper = new QueryWrapper<>();
wrapper.eq("patient_id", patientId);
wrapper.eq("type", 1);
return AjaxResult.success(iFtCateringDaoService.getOne(wrapper));
}
/**
* 根据病人 id 查找营养配餐数据
*/
@GetMapping("/getAllByPatient/{patientId}")
public AjaxResult getAllByPatient(@PathVariable Long patientId) {
QueryWrapper<FtCateringDao> wrapper = new QueryWrapper<>();
wrapper.eq("patient_id", patientId);
return AjaxResult.success(iFtCateringDaoService.list(wrapper));
}
/**
* 拷贝并新增
*/
@PostMapping("/copyAndAdd")
public AjaxResult copyAndAdd(@RequestBody JSONObject params) {
List<Long> patientIds = params.getJSONArray("patientIds").toJavaList(Long.class);
List<FtCateringDao> data = params.getJSONArray("data").toJavaList(FtCateringDao.class);
for (Long patientId : patientIds) {
Integer ftCateringDaoList = iFtCateringDaoService.copyAndAdd(patientId, data);
}
return AjaxResult.success();
}
@PutMapping("/paste")
public AjaxResult paste(@RequestBody JSONObject params) {
List<Long> ids = params.getJSONArray("ids").toJavaList(Long.class);
List<FtCateringDao> ftCateringDaoList = params.getJSONArray("copyItem").toJavaList(FtCateringDao.class);
for (Long id : ids) {
iFtCateringDaoService.paste(id,ftCateringDaoList);
}
return AjaxResult.success("已修改");
}
}

View File

@ -0,0 +1,172 @@
package com.ruoyi.system.fantang.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.common.DinnerTypeUtils;
import com.ruoyi.system.fantang.domain.FtConfigDao;
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 饭堂参数Controller
*
* @author ft
* @date 2020-12-07
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/fantangConfig")
public class FtConfigDaoController extends BaseController {
private final IFtConfigDaoService iFtConfigDaoService;
/**
* 查询饭堂参数列表
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:list')")
@GetMapping("/list")
public TableDataInfo list(FtConfigDao ftConfigDao) {
startPage();
LambdaQueryWrapper<FtConfigDao> lqw = Wrappers.lambdaQuery(ftConfigDao);
if (ftConfigDao.getCorpId() != null) {
lqw.eq(FtConfigDao::getCorpId, ftConfigDao.getCorpId());
}
if (StringUtils.isNotBlank(ftConfigDao.getConfigKey())) {
lqw.eq(FtConfigDao::getConfigKey, ftConfigDao.getConfigKey());
}
if (StringUtils.isNotBlank(ftConfigDao.getConfigValue())) {
lqw.eq(FtConfigDao::getConfigValue, ftConfigDao.getConfigValue());
}
if (ftConfigDao.getFlag() != null) {
lqw.eq(FtConfigDao::getFlag, ftConfigDao.getFlag());
}
List<FtConfigDao> list = iFtConfigDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出饭堂参数列表
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:export')")
@Log(title = "饭堂参数", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtConfigDao ftConfigDao) {
LambdaQueryWrapper<FtConfigDao> lqw = new LambdaQueryWrapper<FtConfigDao>(ftConfigDao);
List<FtConfigDao> list = iFtConfigDaoService.list(lqw);
ExcelUtil<FtConfigDao> util = new ExcelUtil<FtConfigDao>(FtConfigDao.class);
return util.exportExcel(list, "fantangConfig");
}
/**
* 获取饭堂参数详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(iFtConfigDaoService.getById(id));
}
/**
* 新增饭堂参数
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:add')")
@Log(title = "饭堂参数", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtConfigDao ftConfigDao) {
return toAjax(iFtConfigDaoService.save(ftConfigDao) ? 1 : 0);
}
/**
* 修改饭堂参数
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:edit')")
@Log(title = "饭堂参数", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtConfigDao ftConfigDao) {
return toAjax(iFtConfigDaoService.updateById(ftConfigDao) ? 1 : 0);
}
/**
* 删除饭堂参数
*/
@PreAuthorize("@ss.hasPermi('fantang:fantangConfig:remove')")
@Log(title = "饭堂参数", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtConfigDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
@PostMapping("/updateDinnerTime")
public AjaxResult updateDinnerTime(@RequestBody JSONObject params) {
StringBuilder configValue = new StringBuilder();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
JSONArray breakfastJson = params.getJSONArray("breakfast");
JSONArray lunchJson = params.getJSONArray("lunch");
JSONArray dinnerJson = params.getJSONArray("dinner");
List<Date> breakfastTime = breakfastJson.toJavaList(Date.class);
for (Date date : breakfastTime) {
String time = sdf.format(date);
System.out.println(time);
configValue.append(time).append(",");
}
List<Date> lunchTime = lunchJson.toJavaList(Date.class);
for (Date date : lunchTime) {
String time = sdf.format(date);
System.out.println(time);
configValue.append(time).append(",");
}
List<Date> dinnerTime = dinnerJson.toJavaList(Date.class);
for (int i = 0; i < dinnerTime.size(); i++) {
String time = sdf.format(dinnerTime.get(i));
configValue.append(time);
if (i != dinnerTime.size() - 1) {
configValue.append(",");
}
}
iFtConfigDaoService.updateConfigValue(params.getLong("id"),configValue.toString());
DinnerTypeUtils.getInstance(iFtConfigDaoService).updateDinnerTypeUtils(configValue.toString());
return AjaxResult.success("已修改");
}
/**
* 修改人脸识别设备信息
*/
@PostMapping("/updateFaceDevice")
public AjaxResult updateFaceDevice(@RequestBody JSONObject params) {
String deviceId = params.getString("deviceId");
Long deviceConfigId = params.getLong("deviceConfigId");
iFtConfigDaoService.updateConfigValue(deviceConfigId, deviceId);
String deviceFlag = params.getString("deviceFlag");
Long flagConfigId = params.getLong("flagConfigId");
iFtConfigDaoService.updateConfigValue(flagConfigId, deviceFlag);
return AjaxResult.success("已修改");
}
}

View File

@ -0,0 +1,113 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.List;
import java.util.Arrays;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.fantang.domain.FtDepartDao;
import com.ruoyi.system.fantang.service.IFtDepartDaoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 科室管理Controller
*
* @author ft
* @date 2020-11-24
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/depart" )
public class FtDepartDaoController extends BaseController {
private final IFtDepartDaoService iFtDepartDaoService;
/**
* 查询科室管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:depart:list')")
@GetMapping("/list")
public TableDataInfo list(FtDepartDao ftDepartDao)
{
startPage();
LambdaQueryWrapper<FtDepartDao> lqw = Wrappers.lambdaQuery(ftDepartDao);
if (StringUtils.isNotBlank(ftDepartDao.getDepartName())){
lqw.like(FtDepartDao::getDepartName ,ftDepartDao.getDepartName());
}
if (StringUtils.isNotBlank(ftDepartDao.getDepartCode())){
lqw.eq(FtDepartDao::getDepartCode ,ftDepartDao.getDepartCode());
}
List<FtDepartDao> list = iFtDepartDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出科室管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:depart:export')" )
@Log(title = "科室管理" , businessType = BusinessType.EXPORT)
@GetMapping("/export" )
public AjaxResult export(FtDepartDao ftDepartDao) {
LambdaQueryWrapper<FtDepartDao> lqw = new LambdaQueryWrapper<FtDepartDao>(ftDepartDao);
List<FtDepartDao> list = iFtDepartDaoService.list(lqw);
ExcelUtil<FtDepartDao> util = new ExcelUtil<FtDepartDao>(FtDepartDao. class);
return util.exportExcel(list, "depart" );
}
/**
* 获取科室管理详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:depart:query')" )
@GetMapping(value = "/{departId}" )
public AjaxResult getInfo(@PathVariable("departId" ) Long departId) {
return AjaxResult.success(iFtDepartDaoService.getById(departId));
}
/**
* 新增科室管理
*/
@PreAuthorize("@ss.hasPermi('fantang:depart:add')" )
@Log(title = "科室管理" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtDepartDao ftDepartDao) {
return toAjax(iFtDepartDaoService.save(ftDepartDao) ? 1 : 0);
}
/**
* 修改科室管理
*/
@PreAuthorize("@ss.hasPermi('fantang:depart:edit')" )
@Log(title = "科室管理" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtDepartDao ftDepartDao) {
return toAjax(iFtDepartDaoService.updateById(ftDepartDao) ? 1 : 0);
}
/**
* 删除科室管理
*/
@PreAuthorize("@ss.hasPermi('fantang:depart:remove')" )
@Log(title = "科室管理" , businessType = BusinessType.DELETE)
@DeleteMapping("/{departIds}" )
public AjaxResult remove(@PathVariable Long[] departIds) {
return toAjax(iFtDepartDaoService.removeByIds(Arrays.asList(departIds)) ? 1 : 0);
}
}

View File

@ -0,0 +1,100 @@
package com.ruoyi.system.fantang.controller;
import java.util.List;
import java.util.Arrays;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.fantang.domain.FtFaceinfoDao;
import com.ruoyi.system.fantang.service.IFtFaceinfoDaoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 人脸信息Controller
*
* @author ryo
* @date 2021-01-11
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/faceInfo" )
public class FtFaceinfoDaoController extends BaseController {
private final IFtFaceinfoDaoService iFtFaceinfoDaoService;
/**
* 查询人脸信息列表
*/
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:list')")
@GetMapping("/list")
public TableDataInfo list(FtFaceinfoDao ftFaceinfoDao) {
startPage();
List<FtFaceinfoDao> list = iFtFaceinfoDaoService.queryList(ftFaceinfoDao);
return getDataTable(list);
}
/**
* 导出人脸信息列表
*/
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:export')" )
@Log(title = "人脸信息" , businessType = BusinessType.EXPORT)
@GetMapping("/export" )
public AjaxResult export(FtFaceinfoDao ftFaceinfoDao) {
List<FtFaceinfoDao> list = iFtFaceinfoDaoService.queryList(ftFaceinfoDao);
ExcelUtil<FtFaceinfoDao> util = new ExcelUtil<FtFaceinfoDao>(FtFaceinfoDao.class);
return util.exportExcel(list, "faceInfo" );
}
/**
* 获取人脸信息详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:query')" )
@GetMapping(value = "/{id}" )
public AjaxResult getInfo(@PathVariable("id" ) Long id) {
return AjaxResult.success(iFtFaceinfoDaoService.getById(id));
}
/**
* 新增人脸信息
*/
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:add')" )
@Log(title = "人脸信息" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtFaceinfoDao ftFaceinfoDao) {
return toAjax(iFtFaceinfoDaoService.save(ftFaceinfoDao) ? 1 : 0);
}
/**
* 修改人脸信息
*/
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:edit')" )
@Log(title = "人脸信息" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtFaceinfoDao ftFaceinfoDao) {
return toAjax(iFtFaceinfoDaoService.updateById(ftFaceinfoDao) ? 1 : 0);
}
/**
* 删除人脸信息
*/
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:remove')" )
@Log(title = "人脸信息" , businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}" )
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtFaceinfoDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
}

View File

@ -0,0 +1,107 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtFoodDao;
import com.ruoyi.system.fantang.service.IFtFoodDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
/**
* 食品管理Controller
*
* @author ft
* @date 2020-11-24
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/food")
public class FtFoodDaoController extends BaseController {
private final IFtFoodDaoService iFtFoodDaoService;
/**
* 查询食品管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:food:list')")
@GetMapping("/list")
public TableDataInfo list(FtFoodDao ftFoodDao) {
startPage();
LambdaQueryWrapper<FtFoodDao> lqw = Wrappers.lambdaQuery(ftFoodDao);
if (StringUtils.isNotBlank(ftFoodDao.getName())) {
lqw.like(FtFoodDao::getName, ftFoodDao.getName());
}
if (ftFoodDao.getPrice() != null) {
lqw.eq(FtFoodDao::getPrice, ftFoodDao.getPrice());
}
if (ftFoodDao.getType() != null) {
lqw.eq(FtFoodDao::getType, ftFoodDao.getType());
}
List<FtFoodDao> list = iFtFoodDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出食品管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:food:export')")
@Log(title = "食品管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtFoodDao ftFoodDao) {
LambdaQueryWrapper<FtFoodDao> lqw = new LambdaQueryWrapper<FtFoodDao>(ftFoodDao);
List<FtFoodDao> list = iFtFoodDaoService.list(lqw);
ExcelUtil<FtFoodDao> util = new ExcelUtil<FtFoodDao>(FtFoodDao.class);
return util.exportExcel(list, "food");
}
/**
* 获取食品管理详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:food:query')")
@GetMapping(value = "/{foodId}")
public AjaxResult getInfo(@PathVariable("foodId") Long foodId) {
return AjaxResult.success(iFtFoodDaoService.getById(foodId));
}
/**
* 新增食品管理
*/
@PreAuthorize("@ss.hasPermi('fantang:food:add')")
@Log(title = "食品管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtFoodDao ftFoodDao) {
return toAjax(iFtFoodDaoService.save(ftFoodDao) ? 1 : 0);
}
/**
* 修改食品管理
*/
@PreAuthorize("@ss.hasPermi('fantang:food:edit')")
@Log(title = "食品管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtFoodDao ftFoodDao) {
return toAjax(iFtFoodDaoService.updateById(ftFoodDao) ? 1 : 0);
}
/**
* 删除食品管理
*/
@PreAuthorize("@ss.hasPermi('fantang:food:remove')")
@Log(title = "食品管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{foodIds}")
public AjaxResult remove(@PathVariable Long[] foodIds) {
return toAjax(iFtFoodDaoService.removeByIds(Arrays.asList(foodIds)) ? 1 : 0);
}
}

View File

@ -0,0 +1,116 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtFoodDefaultDao;
import com.ruoyi.system.fantang.service.IFtFoodDaoService;
import com.ruoyi.system.fantang.service.IFtFoodDefaultDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 默认报餐管理Controller
*
* @author ft
* @date 2020-11-25
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/foodDefault")
public class FtFoodDefaultDaoController extends BaseController {
private final IFtFoodDefaultDaoService iFtFoodDefaultDaoService;
private final IFtFoodDaoService iFtFoodDaoService;
/**
* 查询默认报餐管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:list')")
@GetMapping("/list")
public TableDataInfo list(FtFoodDefaultDao ftFoodDefaultDao) {
startPage();
LambdaQueryWrapper<FtFoodDefaultDao> lqw = Wrappers.lambdaQuery(ftFoodDefaultDao);
if (ftFoodDefaultDao.getType() != null) {
lqw.eq(FtFoodDefaultDao::getType, ftFoodDefaultDao.getType());
}
List<FtFoodDefaultDao> list = iFtFoodDefaultDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出默认报餐管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:export')")
@Log(title = "默认报餐管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtFoodDefaultDao ftFoodDefaultDao) {
LambdaQueryWrapper<FtFoodDefaultDao> lqw = new LambdaQueryWrapper<FtFoodDefaultDao>(ftFoodDefaultDao);
List<FtFoodDefaultDao> list = iFtFoodDefaultDaoService.list(lqw);
ExcelUtil<FtFoodDefaultDao> util = new ExcelUtil<FtFoodDefaultDao>(FtFoodDefaultDao.class);
return util.exportExcel(list, "foodDefault");
}
/**
* 获取默认报餐管理详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(iFtFoodDefaultDaoService.getById(id));
}
/**
* 新增默认报餐管理
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:add')")
@Log(title = "默认报餐管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtFoodDefaultDao ftFoodDefaultDao) {
ftFoodDefaultDao.setCreatedAt(new Date());
return toAjax(iFtFoodDefaultDaoService.save(ftFoodDefaultDao) ? 1 : 0);
}
/**
* 修改默认报餐管理
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:edit')")
@Log(title = "默认报餐管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtFoodDefaultDao ftFoodDefaultDao) {
String foodList = ftFoodDefaultDao.getFoodList();
String[] temp = foodList.split(",");
BigDecimal totalPrice = new BigDecimal(0);
for (String foodId : temp) {
BigDecimal price = iFtFoodDaoService.getById(Long.parseLong(foodId)).getPrice();
totalPrice = totalPrice.add(price);
}
ftFoodDefaultDao.setPrice(totalPrice);
ftFoodDefaultDao.setUpdatedAt(new Date());
return toAjax(iFtFoodDefaultDaoService.updateById(ftFoodDefaultDao) ? 1 : 0);
}
/**
* 删除默认报餐管理
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDefault:remove')")
@Log(title = "默认报餐管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtFoodDefaultDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
}

View File

@ -0,0 +1,100 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.annotation.Log;
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.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
import com.ruoyi.system.fantang.service.IFtFoodDemandDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 病人报餐Controller
*
* @author ft
* @date 2020-12-03
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/foodDemand")
public class FtFoodDemandDaoController extends BaseController {
private final IFtFoodDemandDaoService iFtFoodDemandDaoService;
/**
* 查询病人报餐列表
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDemand:list')")
@GetMapping("/list")
public TableDataInfo list(FtFoodDemandDao ftFoodDemandDao) {
startPage();
List<FtFoodDemandDao> list = iFtFoodDemandDaoService.listNewFormatter(ftFoodDemandDao);
return getDataTable(list);
}
/**
* 导出病人报餐列表
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDemand:export')")
@Log(title = "病人报餐", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtFoodDemandDao ftFoodDemandDao) {
LambdaQueryWrapper<FtFoodDemandDao> lqw = new LambdaQueryWrapper<FtFoodDemandDao>(ftFoodDemandDao);
List<FtFoodDemandDao> list = iFtFoodDemandDaoService.list(lqw);
ExcelUtil<FtFoodDemandDao> util = new ExcelUtil<FtFoodDemandDao>(FtFoodDemandDao.class);
return util.exportExcel(list, "foodDemand");
}
/**
* 获取病人报餐详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDemand:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
FtFoodDemandDao ftFoodDemandDao = iFtFoodDemandDaoService.getByIdNewFormatter(id);
return AjaxResult.success(ftFoodDemandDao);
}
/**
* 新增病人报餐
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDemand:add')")
@Log(title = "病人报餐", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtFoodDemandDao ftFoodDemandDao) {
ftFoodDemandDao.setFlag(true);
return toAjax(iFtFoodDemandDaoService.save(ftFoodDemandDao) ? 1 : 0);
}
/**
* 修改病人报餐
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDemand:edit')")
@Log(title = "病人报餐", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtFoodDemandDao ftFoodDemandDao) {
ftFoodDemandDao.setUpdateAt(new Date());
return toAjax(iFtFoodDemandDaoService.updateById(ftFoodDemandDao) ? 1 : 0);
}
/**
* 删除病人报餐
*/
@PreAuthorize("@ss.hasPermi('fantang:foodDemand:remove')")
@Log(title = "病人报餐", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtFoodDemandDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
}

View File

@ -0,0 +1,192 @@
package com.ruoyi.system.fantang.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtInvoiceDao;
import com.ruoyi.system.fantang.domain.FtSettlementDao;
import com.ruoyi.system.fantang.service.IFtInvoiceDaoService;
import com.ruoyi.system.fantang.service.IFtReturnDaoService;
import com.ruoyi.system.fantang.service.IFtSettlementDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 财务收费开票Controller
*
* @author ft
* @date 2020-12-08
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/invoice")
public class FtInvoiceDaoController extends BaseController {
private final IFtInvoiceDaoService iFtInvoiceDaoService;
private final IFtSettlementDaoService settSettlementDaoService;
private final IFtReturnDaoService ftReturnDaoService;
/**
* 查询财务收费开票列表
*/
@PreAuthorize("@ss.hasPermi('fantang:invoice:list')")
@GetMapping("/list")
public TableDataInfo list(FtInvoiceDao ftInvoiceDao) {
startPage();
LambdaQueryWrapper<FtInvoiceDao> lqw = Wrappers.lambdaQuery(ftInvoiceDao);
if (ftInvoiceDao.getInvoiceType() != null) {
lqw.eq(FtInvoiceDao::getInvoiceType, ftInvoiceDao.getInvoiceType());
}
List<FtInvoiceDao> list = iFtInvoiceDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出财务收费开票列表
*/
@PreAuthorize("@ss.hasPermi('fantang:invoice:export')")
@Log(title = "财务收费开票", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtInvoiceDao ftInvoiceDao) {
LambdaQueryWrapper<FtInvoiceDao> lqw = new LambdaQueryWrapper<FtInvoiceDao>(ftInvoiceDao);
List<FtInvoiceDao> list = iFtInvoiceDaoService.list(lqw);
ExcelUtil<FtInvoiceDao> util = new ExcelUtil<FtInvoiceDao>(FtInvoiceDao.class);
return util.exportExcel(list, "invoice");
}
/**
* 获取财务收费开票详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:invoice:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(iFtInvoiceDaoService.getById(id));
}
/**
* 新增财务收费开票
*/
@PreAuthorize("@ss.hasPermi('fantang:invoice:add')")
@Log(title = "财务收费开票", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtInvoiceDao ftInvoiceDao) {
return toAjax(iFtInvoiceDaoService.save(ftInvoiceDao) ? 1 : 0);
}
/**
* 修改财务收费开票
*/
@PreAuthorize("@ss.hasPermi('fantang:invoice:edit')")
@Log(title = "财务收费开票", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtInvoiceDao ftInvoiceDao) {
return toAjax(iFtInvoiceDaoService.updateById(ftInvoiceDao) ? 1 : 0);
}
/**
* 删除财务收费开票
*/
@PreAuthorize("@ss.hasPermi('fantang:invoice:remove')")
@Log(title = "财务收费开票", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtInvoiceDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
@PostMapping("/addToInvoice")
@Transactional(propagation = Propagation.REQUIRES_NEW)
public AjaxResult addToInvoice(@RequestBody JSONObject params) {
// 应收
BigDecimal payable = params.getBigDecimal("payable");
// 实收
BigDecimal receipts = params.getBigDecimal("receipts");
// 收款方式
String type = params.getString("type");
// 发票号
String invoiceNum = params.getString("invoiceNum");
// 发票名
String invoiceName = params.getString("invoiceName");
// 税号
String taxId = params.getString("taxId");
// 跟踪回款
Integer invoiceType = params.getInteger("invoiceType");
// 开票金额
BigDecimal invoiceAmount = params.getBigDecimal("invoiceAmount");
FtInvoiceDao invoiceDao = new FtInvoiceDao();
Date today = new Date();
invoiceDao.setCreateAt(today);
invoiceDao.setPayable(payable);
invoiceDao.setReceipts(receipts);
invoiceDao.setCollectionType(type);
invoiceDao.setInvoiceNum(invoiceNum);
invoiceDao.setInvoiceName(invoiceName);
invoiceDao.setTaxId(taxId);
invoiceDao.setInvoiceType(invoiceType);
invoiceDao.setInvoiceAmount(invoiceAmount);
iFtInvoiceDaoService.save(invoiceDao);
// 结算 ids
JSONArray settleIds = params.getJSONArray("settleIds");
if (settleIds!=null){
List<Long> ids = JSONObject.parseArray(settleIds.toString(), Long.class);
List<FtSettlementDao> settleList = new ArrayList<>();
for (Long id : ids) {
FtSettlementDao settlementDao = new FtSettlementDao();
settlementDao.setSettleId(id);
settlementDao.setInvoiceId(invoiceDao.getId());
settlementDao.setInvoiceFlag(1);
settleList.add(settlementDao);
}
settSettlementDaoService.updateBatchById(settleList);
}else {
FtSettlementDao settlementDao = new FtSettlementDao();
settlementDao.setSettleId(params.getLong("settleId"));
settlementDao.setInvoiceId(invoiceDao.getId());
settlementDao.setInvoiceFlag(1);
settSettlementDaoService.updateById(settlementDao);
}
return AjaxResult.success("已开票");
}
@PutMapping("/finish/{id}")
public AjaxResult finish(@PathVariable Long id){
FtInvoiceDao invoiceDao = new FtInvoiceDao();
invoiceDao.setId(id);
invoiceDao.setInvoiceType(1);
iFtInvoiceDaoService.updateById(invoiceDao);
return AjaxResult.success("已结束跟踪");
}
}

View File

@ -0,0 +1,133 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtNotifyDao;
import com.ruoyi.system.fantang.service.IFtNotifyDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 系统信息Controller
*
* @author ft
* @date 2020-12-17
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/notify")
public class FtNotifyDaoController extends BaseController {
private final IFtNotifyDaoService iFtNotifyDaoService;
@GetMapping("/isHaveNewMsg")
public AjaxResult isHaveNewMsg() {
QueryWrapper<FtNotifyDao> wrapper = new QueryWrapper<>();
wrapper.eq("read_flag", 0);
wrapper.eq("message_type",1);
List<FtNotifyDao> list = iFtNotifyDaoService.list(wrapper);
int size = list.size();
String msgBody = "";
if (list.size() > 0) {
msgBody = "" + list.size() + " 条病患冲突消息待处理";
}
Map<String, Object> messageData = new HashMap<>();
messageData.put("size", size);
messageData.put("msgBody", msgBody);
return AjaxResult.success(messageData);
}
/**
* 查询系统信息列表
*/
@PreAuthorize("@ss.hasPermi('fantang:notify:list')")
@GetMapping("/list")
public TableDataInfo list(FtNotifyDao ftNotifyDao) {
startPage();
LambdaQueryWrapper<FtNotifyDao> lqw = Wrappers.lambdaQuery(ftNotifyDao);
if (ftNotifyDao.getMessageType() != null) {
lqw.eq(FtNotifyDao::getMessageType, ftNotifyDao.getMessageType());
}
if (ftNotifyDao.getScope() != null) {
lqw.eq(FtNotifyDao::getScope, ftNotifyDao.getScope());
}
if (StringUtils.isNotBlank(ftNotifyDao.getMessageBody())) {
lqw.eq(FtNotifyDao::getMessageBody, ftNotifyDao.getMessageBody());
}
if (ftNotifyDao.getReadFlag() != null) {
lqw.eq(FtNotifyDao::getReadFlag, ftNotifyDao.getReadFlag());
}
List<FtNotifyDao> list = iFtNotifyDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出系统信息列表
*/
@PreAuthorize("@ss.hasPermi('fantang:notify:export')")
@Log(title = "系统信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtNotifyDao ftNotifyDao) {
LambdaQueryWrapper<FtNotifyDao> lqw = new LambdaQueryWrapper<FtNotifyDao>(ftNotifyDao);
List<FtNotifyDao> list = iFtNotifyDaoService.list(lqw);
ExcelUtil<FtNotifyDao> util = new ExcelUtil<FtNotifyDao>(FtNotifyDao.class);
return util.exportExcel(list, "notify");
}
/**
* 获取系统信息详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:notify:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(iFtNotifyDaoService.getById(id));
}
/**
* 新增系统信息
*/
@PreAuthorize("@ss.hasPermi('fantang:notify:add')")
@Log(title = "系统信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtNotifyDao ftNotifyDao) {
return toAjax(iFtNotifyDaoService.save(ftNotifyDao) ? 1 : 0);
}
/**
* 修改系统信息
*/
@PreAuthorize("@ss.hasPermi('fantang:notify:edit')")
@Log(title = "系统信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtNotifyDao ftNotifyDao) {
return toAjax(iFtNotifyDaoService.updateById(ftNotifyDao) ? 1 : 0);
}
/**
* 删除系统信息
*/
@PreAuthorize("@ss.hasPermi('fantang:notify:remove')")
@Log(title = "系统信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtNotifyDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
}

View File

@ -0,0 +1,121 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtNutritionFoodDao;
import com.ruoyi.system.fantang.service.IFtNutritionFoodDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 病患营养配餐Controller
*
* @author ft
* @date 2020-12-03
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/nutritionFood")
public class FtNutritionFoodDaoController extends BaseController {
private final IFtNutritionFoodDaoService iFtNutritionFoodDaoService;
/**
* 查询病患营养配餐列表
*/
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:list')")
@GetMapping("/list")
public TableDataInfo list(FtNutritionFoodDao ftNutritionFoodDao) {
startPage();
LambdaQueryWrapper<FtNutritionFoodDao> lqw = Wrappers.lambdaQuery(ftNutritionFoodDao);
if (StringUtils.isNotBlank(ftNutritionFoodDao.getName())) {
lqw.like(FtNutritionFoodDao::getName, ftNutritionFoodDao.getName());
}
if (ftNutritionFoodDao.getPrice() != null) {
lqw.eq(FtNutritionFoodDao::getPrice, ftNutritionFoodDao.getPrice());
}
if (ftNutritionFoodDao.getFlag() != null) {
lqw.eq(FtNutritionFoodDao::getFlag, ftNutritionFoodDao.getFlag());
}
List<FtNutritionFoodDao> list = iFtNutritionFoodDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出病患营养配餐列表
*/
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:export')")
@Log(title = "病患营养配餐", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtNutritionFoodDao ftNutritionFoodDao) {
LambdaQueryWrapper<FtNutritionFoodDao> lqw = new LambdaQueryWrapper<FtNutritionFoodDao>(ftNutritionFoodDao);
List<FtNutritionFoodDao> list = iFtNutritionFoodDaoService.list(lqw);
ExcelUtil<FtNutritionFoodDao> util = new ExcelUtil<FtNutritionFoodDao>(FtNutritionFoodDao.class);
return util.exportExcel(list, "nutritionFood");
}
/**
* 获取病患营养配餐详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(iFtNutritionFoodDaoService.getById(id));
}
/**
* 新增病患营养配餐
*/
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:add')")
@Log(title = "病患营养配餐", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtNutritionFoodDao ftNutritionFoodDao) {
ftNutritionFoodDao.setFlag(true);
ftNutritionFoodDao.setCreateAt(new Date());
return toAjax(iFtNutritionFoodDaoService.save(ftNutritionFoodDao) ? 1 : 0);
}
/**
* 修改病患营养配餐
*/
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:edit')")
@Log(title = "病患营养配餐", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtNutritionFoodDao ftNutritionFoodDao) {
return toAjax(iFtNutritionFoodDaoService.updateById(ftNutritionFoodDao) ? 1 : 0);
}
/**
* 停用病患营养配餐
*/
@PutMapping("/deactivate/{id}")
public AjaxResult deactivate(@PathVariable("id") Long id) {
FtNutritionFoodDao ftNutritionFoodDao = iFtNutritionFoodDaoService.getById(id);
ftNutritionFoodDao.setFlag(false);
iFtNutritionFoodDaoService.updateById(ftNutritionFoodDao);
return AjaxResult.success("停用成功");
}
/**
* 删除病患营养配餐
*/
@PreAuthorize("@ss.hasPermi('fantang:nutritionFood:remove')")
@Log(title = "病患营养配餐", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtNutritionFoodDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
}

View File

@ -0,0 +1,237 @@
package com.ruoyi.system.fantang.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtOrderDao;
import com.ruoyi.system.fantang.service.IFtOrderDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 订单管理Controller
*
* @author ft
* @date 2020-11-19
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/order")
public class FtOrderDaoController extends BaseController {
private final IFtOrderDaoService iFtOrderDaoService;
/**
* 查询订单管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:order:list')")
@GetMapping("/list")
public TableDataInfo list(FtOrderDao ftOrderDao) {
startPage();
LambdaQueryWrapper<FtOrderDao> lqw = Wrappers.lambdaQuery(ftOrderDao);
if (ftOrderDao.getOrderType() != null) {
lqw.eq(FtOrderDao::getOrderType, ftOrderDao.getOrderType());
}
if (ftOrderDao.getTotalPrice() != null) {
lqw.eq(FtOrderDao::getTotalPrice, ftOrderDao.getTotalPrice());
}
if (ftOrderDao.getDiscount() != null) {
lqw.eq(FtOrderDao::getDiscount, ftOrderDao.getDiscount());
}
if (ftOrderDao.getReceipts() != null) {
lqw.eq(FtOrderDao::getReceipts, ftOrderDao.getReceipts());
}
if (ftOrderDao.getCreateAt() != null) {
lqw.eq(FtOrderDao::getCreateAt, ftOrderDao.getCreateAt());
}
if (StringUtils.isNotBlank(ftOrderDao.getOrderSrc())) {
lqw.eq(FtOrderDao::getOrderSrc, ftOrderDao.getOrderSrc());
}
if (ftOrderDao.getCurrentPrice() != null) {
lqw.eq(FtOrderDao::getCurrentPrice, ftOrderDao.getCurrentPrice());
}
if (ftOrderDao.getPayType() != null) {
lqw.eq(FtOrderDao::getPayType, ftOrderDao.getPayType());
}
if (ftOrderDao.getWriteOffAt() != null) {
lqw.eq(FtOrderDao::getWriteOffAt, ftOrderDao.getWriteOffAt());
}
List<FtOrderDao> list = iFtOrderDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出订单管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:order:export')")
@Log(title = "订单管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtOrderDao ftOrderDao) {
LambdaQueryWrapper<FtOrderDao> lqw = new LambdaQueryWrapper<FtOrderDao>(ftOrderDao);
List<FtOrderDao> list = iFtOrderDaoService.list(lqw);
ExcelUtil<FtOrderDao> util = new ExcelUtil<FtOrderDao>(FtOrderDao.class);
return util.exportExcel(list, "order");
}
/**
* 获取订单管理详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:order:query')")
@GetMapping(value = "/{orderId}")
public AjaxResult getInfo(@PathVariable("orderId") Long orderId) {
return AjaxResult.success(iFtOrderDaoService.getById(orderId));
}
/**
* 新增订单管理
*/
@PreAuthorize("@ss.hasPermi('fantang:order:add')")
@Log(title = "订单管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtOrderDao ftOrderDao) {
return toAjax(iFtOrderDaoService.save(ftOrderDao) ? 1 : 0);
}
/**
* 修改订单管理
*/
@PreAuthorize("@ss.hasPermi('fantang:order:edit')")
@Log(title = "订单管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtOrderDao ftOrderDao) {
return toAjax(iFtOrderDaoService.updateById(ftOrderDao) ? 1 : 0);
}
/**
* 删除订单管理
*/
@PreAuthorize("@ss.hasPermi('fantang:order:remove')")
@Log(title = "订单管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{orderIds}")
public AjaxResult remove(@PathVariable Long[] orderIds) {
return toAjax(iFtOrderDaoService.removeByIds(Arrays.asList(orderIds)) ? 1 : 0);
}
/**
* 统计日报餐信息
*/
@PostMapping("/getStatisGetOrderOfDay")
public AjaxResult getStatisGetOrderOfDay(@RequestBody JSONObject params) {
Date selectDay = params.getDate("selectDay");
Integer statisticsType = params.getInteger("statisticsType");
Integer pageNum = params.getInteger("pageNum");
Integer pageSize = params.getInteger("pageSize");
if (statisticsType == 1) {
return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfDate(selectDay, pageNum, pageSize));
} else {
return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfDateByPerson(selectDay, pageNum, pageSize));
}
}
@PostMapping("/exportOrderOfDay")
public AjaxResult exportOrderOfDay(@RequestBody JSONObject params) {
Date selectDay = params.getDate("selectDay");
Integer statisticsType = params.getInteger("statisticsType");
List<FtOrderDao> list;
if (statisticsType != 1) {
list = iFtOrderDaoService.statisOrderOfDateByPersonNoPage(selectDay);
} else {
list = null;
}
ExcelUtil<FtOrderDao> util = new ExcelUtil<>(FtOrderDao.class);
return util.exportExcel(list, "员工用餐统计");
}
/**
* 统计周报餐信息
*/
@PostMapping("/getStatisGetOrderOfWeek")
public AjaxResult getStatisGetOrderOfWeek(@RequestBody JSONObject params) {
Date selectWeek = params.getDate("selectWeek");
Integer statisticsType = params.getInteger("statisticsType");
Integer pageNum = params.getInteger("pageNum");
Integer pageSize = params.getInteger("pageSize");
if (statisticsType == 1) {
return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfWeek(selectWeek, pageNum, pageSize));
} else {
return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfWeekByPerson(selectWeek, pageNum, pageSize));
}
}
@PostMapping("/exportOrderOfWeek")
public AjaxResult exportOrderOfWeek(@RequestBody JSONObject params) {
Date selectWeek = params.getDate("selectWeek");
Integer statisticsType = params.getInteger("statisticsType");
List<FtOrderDao> list;
if (statisticsType != 1) {
list = iFtOrderDaoService.statisOrderOfWeekByPersonNoPage(selectWeek);
} else {
list = null;
}
ExcelUtil<FtOrderDao> util = new ExcelUtil<>(FtOrderDao.class);
return util.exportExcel(list, "员工用餐统计");
}
/**
* 统计月报餐信息
*/
@PostMapping("/getStatisGetOrderOfMonth")
public AjaxResult getStatisGetOrderOfMonth(@RequestBody JSONObject params) {
Date selectMonth = params.getDate("selectMonth");
Integer statisticsType = params.getInteger("statisticsType");
Integer pageNum = params.getInteger("pageNum");
Integer pageSize = params.getInteger("pageSize");
if (statisticsType == 1) {
return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfMonth(selectMonth, pageNum, pageSize));
} else {
return AjaxResult.success(iFtOrderDaoService.statisGetOrderOfMonthByPerson(selectMonth, pageNum, pageSize));
}
}
@PostMapping("/exportOrderOfMonth")
public AjaxResult exportOrderOfMonth(@RequestBody JSONObject params){
Date selectMonth = params.getDate("selectMonth");
Integer statisticsType = params.getInteger("statisticsType");
List<FtOrderDao> list;
if (statisticsType != 1) {
list = iFtOrderDaoService.statisOrderOfMonthByPersonNoPage(selectMonth);
} else {
list = null;
}
ExcelUtil<FtOrderDao> util = new ExcelUtil<>(FtOrderDao.class);
return util.exportExcel(list, "员工用餐统计");
}
}

View File

@ -0,0 +1,155 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtPatientDao;
import com.ruoyi.system.fantang.service.IFtFoodDemandDaoService;
import com.ruoyi.system.fantang.service.IFtPatientDaoService;
import com.ruoyi.system.fantang.service.IFtReportMealsDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 病人管理Controller
*
* @author ft
* @date 2020-11-24
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/patient")
public class FtPatientDaoController extends BaseController {
private final IFtPatientDaoService iFtPatientDaoService;
private final IFtFoodDemandDaoService iFtFoodDemandDaoService;
@Autowired
private IFtReportMealsDaoService reportMealsDaoService;
/**
* 查询病人管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:patient:list')")
@GetMapping("/list")
public TableDataInfo list(FtPatientDao ftPatientDao) {
startPage();
LambdaQueryWrapper<FtPatientDao> lqw = Wrappers.lambdaQuery(ftPatientDao);
if (StringUtils.isNotBlank(ftPatientDao.getName())) {
lqw.like(FtPatientDao::getName, ftPatientDao.getName());
}
if (StringUtils.isNotBlank(ftPatientDao.getBedId())) {
lqw.eq(FtPatientDao::getBedId, ftPatientDao.getBedId());
}
if (StringUtils.isNotBlank(ftPatientDao.getHospitalId())) {
lqw.eq(FtPatientDao::getHospitalId, ftPatientDao.getHospitalId());
}
List<FtPatientDao> list = iFtPatientDaoService.list(lqw);
return getDataTable(list);
}
/**
* 根据 departId 查询病人列表
*/
@GetMapping("/selectPatientByDepartId/{departId}")
public AjaxResult selectPatientByDepartId(@PathVariable("departId") Long departId) {
QueryWrapper<FtPatientDao> wrapper = new QueryWrapper<>();
wrapper.eq("depart_id", departId);
List<FtPatientDao> list = iFtPatientDaoService.list(wrapper);
return AjaxResult.success(list);
}
/**
* 根据 departId 查询所有没有营养配餐的病人列表
* @author 陈智兴
*/
@GetMapping("/selectNoCateringByDepartId/{departId}")
public AjaxResult selectNoCateringByDepartId(@PathVariable("departId") Long departId) {
List<FtPatientDao> list = iFtPatientDaoService.selectNoCateringByDepartId(departId);
return AjaxResult.success(list);
}
/**
* 根据 patientId 查询病人床号
*/
@GetMapping("/getBedIdById/{patientId}")
public AjaxResult getBedIdById(@PathVariable("patientId") Long patientId) {
String bedId = iFtPatientDaoService.getById(patientId).getBedId();
return AjaxResult.success(bedId);
}
/**
* 导出病人管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:patient:export')")
@Log(title = "病人管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtPatientDao ftPatientDao) {
LambdaQueryWrapper<FtPatientDao> lqw = new LambdaQueryWrapper<FtPatientDao>(ftPatientDao);
List<FtPatientDao> list = iFtPatientDaoService.list(lqw);
ExcelUtil<FtPatientDao> util = new ExcelUtil<FtPatientDao>(FtPatientDao.class);
return util.exportExcel(list, "patient");
}
/**
* 获取病人管理详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:patient:query')")
@GetMapping(value = "/{patientId}")
public AjaxResult getInfo(@PathVariable("patientId") Long patientId) {
return AjaxResult.success(iFtPatientDaoService.getById(patientId));
}
/**
* 新增病人管理
*/
@PreAuthorize("@ss.hasPermi('fantang:patient:add')")
@Log(title = "病人管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtPatientDao ftPatientDao) {
ftPatientDao.setCreateAt(new Date());
ftPatientDao.setOffFlag(0);
iFtPatientDaoService.save(ftPatientDao);
iFtFoodDemandDaoService.GenerateOrderByPatientId(ftPatientDao.getPatientId());
reportMealsDaoService.insertTomorrowReportMealByPatient(ftPatientDao.getPatientId());
return AjaxResult.success("已添加");
}
/**
* 修改病人管理
*/
@PreAuthorize("@ss.hasPermi('fantang:patient:edit')")
@Log(title = "病人管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtPatientDao ftPatientDao) {
return toAjax(iFtPatientDaoService.updateById(ftPatientDao) ? 1 : 0);
}
/**
* 删除病人管理
*/
@PreAuthorize("@ss.hasPermi('fantang:patient:remove')")
@Log(title = "病人管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{patientIds}")
public AjaxResult remove(@PathVariable Long[] patientIds) {
return toAjax(iFtPatientDaoService.removeByIds(Arrays.asList(patientIds)) ? 1 : 0);
}
}

View File

@ -0,0 +1,227 @@
package com.ruoyi.system.fantang.controller;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtPrepaymentDao;
import com.ruoyi.system.fantang.domain.FtPrepaymentVo;
import com.ruoyi.system.fantang.service.IFtPrepaymentDaoService;
import com.ruoyi.system.fantang.utils.PdfUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 收费管理Controller
*
* @author ft
* @date 2020-11-19
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/prepayment")
public class FtPrepaymentDaoController extends BaseController {
private final IFtPrepaymentDaoService iFtPrepaymentDaoService;
@Value("${fantang.templatePath}")
private String templatePath;
@Value("${fantang.fileWebUrl}")
private String fileWebUrl;
@GetMapping("/getCountById/{patientId}")
public AjaxResult getCountById(@PathVariable("patientId") Long patientId) {
FtPrepaymentVo dao = iFtPrepaymentDaoService.getCountById(patientId);
if (dao == null)
return AjaxResult.error("无该记录");
return AjaxResult.success("操作成功", dao);
}
/**
* 通过病人id查询收费管理详细
* 作者陈智兴
* 日期2020年12月2日
* 功能 前端查询预付款情况
*
* @param patientId
* @return
*/
@GetMapping("/getPrepaymentByPatientId/{patientId}")
public AjaxResult getPrepaymentByPatientId(@PathVariable("patientId") Long patientId) {
FtPrepaymentDao ftPrepaymentDao = iFtPrepaymentDaoService.getByPatientId(patientId);
if (ftPrepaymentDao == null) {
return AjaxResult.error("无该记录");
}
return AjaxResult.success("操作成功", ftPrepaymentDao);
}
// 查询所有待缴费列表
@PreAuthorize("@ss.hasPermi('fantang:prepayment:list')")
@GetMapping("/listNoPrepay")
public TableDataInfo listNoPrepay(FtPrepaymentVo params) {
startPage();
return getDataTable(iFtPrepaymentDaoService.listNoPrepay(params));
}
// 查询所有已缴费列表
@PreAuthorize("@ss.hasPermi('fantang:prepayment:list')")
@GetMapping("/listPrepay")
public TableDataInfo listPrepay(FtPrepaymentVo params) {
startPage();
if (params.getPrepaidAt() != null) {
Date date = DateUtil.parse(params.getPrepaidAt().toString());
params.setPrepaidAt(date);
}
return getDataTable(iFtPrepaymentDaoService.listPrepay(params));
}
// 查询所有已结算列表
@PreAuthorize("@ss.hasPermi('fantang:prepayment:list')")
@GetMapping("/listAllPrepay")
public TableDataInfo listAllPrepay(FtPrepaymentVo params) {
startPage();
List<FtPrepaymentVo> list = iFtPrepaymentDaoService.listAllPrepay(params);
return getDataTable(list);
}
/**
* 查询收费管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:prepayment:list')")
@GetMapping("/list")
public TableDataInfo list(FtPrepaymentDao ftPrepaymentDao) {
startPage();
LambdaQueryWrapper<FtPrepaymentDao> lqw = Wrappers.lambdaQuery(ftPrepaymentDao);
if (ftPrepaymentDao.getCollectAt() != null) {
lqw.eq(FtPrepaymentDao::getCollectAt, ftPrepaymentDao.getCollectAt());
}
if (ftPrepaymentDao.getSettlementAt() != null) {
lqw.eq(FtPrepaymentDao::getSettlementAt, ftPrepaymentDao.getSettlementAt());
}
if (ftPrepaymentDao.getSettlementFlag() != null) {
lqw.eq(FtPrepaymentDao::getSettlementFlag, ftPrepaymentDao.getSettlementFlag());
}
if (ftPrepaymentDao.getPrepaid() != null) {
lqw.eq(FtPrepaymentDao::getPrepaid, ftPrepaymentDao.getPrepaid());
}
if (ftPrepaymentDao.getPrepaidAt() != null) {
lqw.eq(FtPrepaymentDao::getPrepaidAt, ftPrepaymentDao.getPrepaidAt());
}
if (ftPrepaymentDao.getPrepaidAt() != null) {
lqw.eq(FtPrepaymentDao::getPrepaidAt, ftPrepaymentDao.getPrepaidAt());
}
List<FtPrepaymentDao> list = iFtPrepaymentDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出收费管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:prepayment:export')")
@Log(title = "收费管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtPrepaymentDao ftPrepaymentDao) {
LambdaQueryWrapper<FtPrepaymentDao> lqw = new LambdaQueryWrapper<FtPrepaymentDao>(ftPrepaymentDao);
List<FtPrepaymentDao> list = iFtPrepaymentDaoService.list(lqw);
ExcelUtil<FtPrepaymentDao> util = new ExcelUtil<FtPrepaymentDao>(FtPrepaymentDao.class);
return util.exportExcel(list, "prepayment");
}
/**
* 获取收费管理详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:prepayment:query')")
@GetMapping(value = "/{prepaymentId}")
public AjaxResult getInfo(@PathVariable("prepaymentId") Long prepaymentId) {
return AjaxResult.success(iFtPrepaymentDaoService.getById(prepaymentId));
}
/**
* 新增收费管理
*/
@PreAuthorize("@ss.hasPermi('fantang:prepayment:add')")
@Log(title = "收费管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtPrepaymentDao ftPrepaymentDao) {
ftPrepaymentDao.setCollectAt(new Date());
return toAjax(iFtPrepaymentDaoService.save(ftPrepaymentDao) ? 1 : 0);
}
/**
* 修改收费管理
*/
@PreAuthorize("@ss.hasPermi('fantang:prepayment:edit')")
@Log(title = "收费管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtPrepaymentVo ftPrepaymentDao) {
return toAjax(iFtPrepaymentDaoService.updateById(ftPrepaymentDao) ? 1 : 0);
}
/**
* 删除收费管理
*/
@PreAuthorize("@ss.hasPermi('fantang:prepayment:remove')")
@Log(title = "收费管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{prepaymentIds}")
public AjaxResult remove(@PathVariable Long[] prepaymentIds) {
return toAjax(iFtPrepaymentDaoService.removeByIds(Arrays.asList(prepaymentIds)) ? 1 : 0);
}
/**
* 生成 pdf 收据
*/
@PostMapping("/generateReceiptPdf")
public AjaxResult generateReceiptPdf(@RequestBody JSONObject params) {
String patientId = params.getString("patientId");
// 模板路径
// String templatePath = "F:\\pdfTemplate\\饭堂票据模板2.pdf";
// String templatePath = "Z:\\程序开发\\项目测试\\三院饭堂\\饭堂收费票据模板.pdf";
// 生成的新文件路径
String outputPath = RuoYiConfig.getUploadPath() + "\\饭堂票据" + patientId + ".pdf";
PdfUtils.generatePrepaymentPdf(templatePath, outputPath, params);
// 下载地址
String downloadPath = "profile/upload/饭堂票据" + patientId + ".pdf";
return AjaxResult.success(fileWebUrl + downloadPath);
}
/**
* 出院结清
*/
@PutMapping("/leaveSettlePrepayment/{prepaymentId}")
public AjaxResult leaveSettlePrepayment(@PathVariable Long prepaymentId){
FtPrepaymentDao prepaymentDao = new FtPrepaymentDao();
prepaymentDao.setPrepaymentId(prepaymentId);
prepaymentDao.setPrepaid(new BigDecimal(0));
prepaymentDao.setSettlementFlag(1);
prepaymentDao.setSettlementAt(new Date());
iFtPrepaymentDaoService.updateById(prepaymentDao);
return AjaxResult.success("已结清");
}
}

View File

@ -0,0 +1,251 @@
package com.ruoyi.system.fantang.controller;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.DateUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtPrepaymentDao;
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
import com.ruoyi.system.fantang.entity.ReportMealsDayEntity;
import com.ruoyi.system.fantang.service.IFtPrepaymentDaoService;
import com.ruoyi.system.fantang.service.IFtReportMealsDaoService;
import com.ruoyi.system.fantang.vo.FtReportMealVo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import static com.ruoyi.common.core.domain.AjaxResult.success;
/**
* 报餐管理Controller
*
* @author ft
* @date 2020-11-19
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/meals")
public class FtReportMealsDaoController extends BaseController {
private final IFtReportMealsDaoService iFtReportMealsDaoService;
@Autowired
private IFtPrepaymentDaoService prepaymentDaoService;
/**
* 查询指定用户上一次结算的日期并通过这个日期计算未结算的天数
*/
@GetMapping("/getLastSettlementDate/{patientId}")
public AjaxResult getLastSettlementDate(@PathVariable("patientId") Long patientId) {
// 初始化一个返回对象
AjaxResult result = AjaxResult.success();
// 获取该病患的预付费数据
FtPrepaymentDao prepaymentDao = prepaymentDaoService.getByPatientId(patientId);
result.put("prepayment", prepaymentDao);
// 获取最近一次已结算的报餐记录如果首次结算则返回第一条已用餐的记录
FtReportMealsDao reportMealsDao = iFtReportMealsDaoService.getLastReportMeals(patientId);
// 获取用餐日期
Date diningAt = reportMealsDao.getDiningAt();
// 获取结算日期
Date settlementAt = reportMealsDao.getSettlementAt();
ReportMealsDayEntity reportMealsDayEntity = new ReportMealsDayEntity();
// 如果首次结算
if (settlementAt == null) {
// 计算第一条已用餐的用餐时间与现在相差多少天
long betweenDays = DateUtil.between(diningAt, new Date(), DateUnit.DAY);
reportMealsDayEntity.setDays(betweenDays);
reportMealsDayEntity.setLastCreateDate(diningAt);
result.put("reportMeals", reportMealsDayEntity);
return result;
}
//计算上次结算日期与现在相差多少天
long days = DateUtil.between(settlementAt, new Date(), DateUnit.DAY);
reportMealsDayEntity.setSettlementAt(settlementAt);
reportMealsDayEntity.setDays(days);
result.put("reportMeals", reportMealsDayEntity);
return result;
}
/**
* 查询所有报餐列表
*/
@PreAuthorize("@ss.hasPermi('fantang:meals:list')")
@GetMapping("/listAll")
public TableDataInfo listAll(FtReportMealVo ftReportMealsDao) {
startPage();
List<FtReportMealVo> list = iFtReportMealsDaoService.listAll();
return getDataTable(list);
}
/**
* 查询所有未付费报餐列表
*/
@PreAuthorize("@ss.hasPermi('fantang:meals:list')")
@GetMapping("/listNoPay")
public TableDataInfo listNoPay(FtReportMealVo ftReportMealsDao) {
startPage();
List<FtReportMealVo> list = iFtReportMealsDaoService.listNoPay();
return getDataTable(list);
}
/**
* 查询所有已付费报餐列表
*/
@PreAuthorize("@ss.hasPermi('fantang:meals:list')")
@GetMapping("/listPayoff")
public TableDataInfo listPayoff(FtReportMealVo ftReportMealsDao) {
startPage();
List<FtReportMealVo> list = iFtReportMealsDaoService.listPayoff();
return getDataTable(list);
}
/**
* 查询报餐管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:meals:list')")
@GetMapping("/list")
public TableDataInfo list(FtReportMealsDao ftReportMealsDao) {
startPage();
LambdaQueryWrapper<FtReportMealsDao> lqw = Wrappers.lambdaQuery(ftReportMealsDao);
if (ftReportMealsDao.getCreateAt() != null) {
lqw.eq(FtReportMealsDao::getCreateAt, ftReportMealsDao.getCreateAt());
}
if (ftReportMealsDao.getType() != null) {
lqw.eq(FtReportMealsDao::getType, ftReportMealsDao.getType());
}
if (ftReportMealsDao.getCreateBy() != null) {
lqw.eq(FtReportMealsDao::getCreateBy, ftReportMealsDao.getCreateBy());
}
if (ftReportMealsDao.getPrice() != null) {
lqw.eq(FtReportMealsDao::getPrice, ftReportMealsDao.getPrice());
}
List<FtReportMealsDao> list = iFtReportMealsDaoService.list(lqw);
return getDataTable(list);
}
@GetMapping("/listStatistics")
public TableDataInfo listStatistics(FtReportMealsDao ftReportMealsDao) {
startPage();
return getDataTable(iFtReportMealsDaoService.listNutrition(ftReportMealsDao));
}
@PreAuthorize("@ss.hasPermi('fantang:meals:list')")
@GetMapping("/listMealsWithInSettle")
public TableDataInfo listMealsWithInSettle(FtReportMealsDao ftReportMealsDao) {
startPage();
List<FtReportMealsDao> list = iFtReportMealsDaoService.listMealsWithInSettle(ftReportMealsDao);
return getDataTable(list);
}
/**
* 导出报餐管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:meals:export')")
@Log(title = "报餐管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtReportMealsDao ftReportMealsDao) {
Date createAt = ftReportMealsDao.getCreateAt();
if (createAt != null) {
ftReportMealsDao.setBeginOfDay(createAt);
ftReportMealsDao.setEndOfDay(createAt);
}
List<FtReportMealsDao> list = iFtReportMealsDaoService.listPatientReportMeals(ftReportMealsDao);
ExcelUtil<FtReportMealsDao> util = new ExcelUtil<>(FtReportMealsDao.class);
return util.exportExcel(list, "病患报餐统计");
}
/**
* 计算两个日期之间的未结算数据
*
* @param dao
* @return
*/
@GetMapping("/countBillingBetween")
public AjaxResult countBillingBetween(ReportMealsDayEntity dao) {
return success(iFtReportMealsDaoService.countBillingBetween(dao));
}
/**
* 获取报餐管理详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:meals:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(iFtReportMealsDaoService.getById(id));
}
/**
* 新增报餐管理
*/
@PreAuthorize("@ss.hasPermi('fantang:meals:add')")
@Log(title = "报餐管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtReportMealsDao ftReportMealsDao) {
return toAjax(iFtReportMealsDaoService.save(ftReportMealsDao) ? 1 : 0);
}
/**
* 修改报餐管理
*/
@PreAuthorize("@ss.hasPermi('fantang:meals:edit')")
@Log(title = "报餐管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtReportMealsDao ftReportMealsDao) {
return toAjax(iFtReportMealsDaoService.updateById(ftReportMealsDao) ? 1 : 0);
}
/**
* 删除报餐管理
*/
@PreAuthorize("@ss.hasPermi('fantang:meals:remove')")
@Log(title = "报餐管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtReportMealsDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
@GetMapping("/listPatientReportMeals")
public TableDataInfo listPatientReportMeals(FtReportMealsDao ftReportMealsDao) {
startPage();
Date createAt = ftReportMealsDao.getCreateAt();
if (createAt != null) {
ftReportMealsDao.setBeginOfDay(createAt);
ftReportMealsDao.setEndOfDay(createAt);
}
List<FtReportMealsDao> list = iFtReportMealsDaoService.listPatientReportMeals(ftReportMealsDao);
return getDataTable(list);
}
}

View File

@ -0,0 +1,165 @@
package com.ruoyi.system.fantang.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.annotation.Log;
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.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtInvoiceDao;
import com.ruoyi.system.fantang.domain.FtReturnDao;
import com.ruoyi.system.fantang.service.IFtInvoiceDaoService;
import com.ruoyi.system.fantang.service.IFtReturnDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 回款登记Controller
*
* @author ft
* @date 2021-01-25
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/returnManage")
public class FtReturnDaoController extends BaseController {
private final IFtReturnDaoService iFtReturnDaoService;
private final IFtInvoiceDaoService iFtInvoiceDaoService;
/**
* 查询回款登记列表
*/
@PreAuthorize("@ss.hasPermi('fantang:returnManage:list')")
@GetMapping("/list")
public TableDataInfo list(FtReturnDao ftReturnDao) {
startPage();
List<FtReturnDao> list = iFtReturnDaoService.queryList(ftReturnDao);
return getDataTable(list);
}
/**
* 导出回款登记列表
*/
@PreAuthorize("@ss.hasPermi('fantang:returnManage:export')")
@Log(title = "回款登记", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtReturnDao ftReturnDao) {
List<FtReturnDao> list = iFtReturnDaoService.queryList(ftReturnDao);
ExcelUtil<FtReturnDao> util = new ExcelUtil<FtReturnDao>(FtReturnDao.class);
return util.exportExcel(list, "returnManage");
}
/**
* 获取回款登记详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:returnManage:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(iFtReturnDaoService.getById(id));
}
/**
* 新增回款登记
*/
@PreAuthorize("@ss.hasPermi('fantang:returnManage:add')")
@Log(title = "回款登记", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtReturnDao ftReturnDao) {
return toAjax(iFtReturnDaoService.save(ftReturnDao) ? 1 : 0);
}
/**
* 修改回款登记
*/
@PreAuthorize("@ss.hasPermi('fantang:returnManage:edit')")
@Log(title = "回款登记", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtReturnDao ftReturnDao) {
return toAjax(iFtReturnDaoService.updateById(ftReturnDao) ? 1 : 0);
}
/**
* 删除回款登记
*/
@PreAuthorize("@ss.hasPermi('fantang:returnManage:remove')")
@Log(title = "回款登记", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtReturnDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
@PostMapping("/addToReturn")
public AjaxResult addToReturn(@RequestBody JSONObject params) {
System.out.println(params);
// 回款金额
BigDecimal returnPrice = params.getBigDecimal("returnPrice");
// 开票金额
BigDecimal invoiceAmount = params.getBigDecimal("invoiceAmount");
// 余额
BigDecimal nowBalancePrice;
// 发票 id
Long id = params.getLong("id");
if (returnPrice.compareTo(invoiceAmount) > 0) {
return AjaxResult.error("该次回款超出开票金额");
}
// 查找该发票上次的回款记录
FtReturnDao lastReturn = iFtReturnDaoService.selectLastReturn(id);
if (lastReturn == null) {
// 余额
nowBalancePrice = invoiceAmount.subtract(returnPrice);
} else {
BigDecimal lastBalancePrice = lastReturn.getBalancePrice();
if (lastBalancePrice.compareTo(returnPrice) < 0) {
return AjaxResult.error("该次回款超出开票金额");
} else {
nowBalancePrice = lastBalancePrice.subtract(returnPrice);
}
}
FtReturnDao ftReturnDao = new FtReturnDao();
ftReturnDao.setInvoiceId(id);
ftReturnDao.setReturnPrice(returnPrice);
ftReturnDao.setVoucherUrl(params.getString("voucherUrl"));
ftReturnDao.setReturnAt(new Date());
ftReturnDao.setBalancePrice(nowBalancePrice);
if (nowBalancePrice.compareTo(new BigDecimal(0)) == 0) {
FtInvoiceDao ftInvoiceDao = new FtInvoiceDao();
ftInvoiceDao.setId(id);
ftInvoiceDao.setInvoiceType(1);
iFtInvoiceDaoService.updateById(ftInvoiceDao);
}
iFtReturnDaoService.save(ftReturnDao);
return AjaxResult.success("回款成功");
}
@GetMapping("/getReturnByInvoice/{id}")
public TableDataInfo getReturnByInvoice(@PathVariable Long id) {
startPage();
QueryWrapper<FtReturnDao> wrapper = new QueryWrapper<>();
wrapper.eq("invoice_id", id);
List<FtReturnDao> list = iFtReturnDaoService.list(wrapper);
return getDataTable(list);
}
}

View File

@ -0,0 +1,289 @@
package com.ruoyi.system.fantang.controller;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtPrepaymentDao;
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
import com.ruoyi.system.fantang.domain.FtSettleDao;
import com.ruoyi.system.fantang.entity.ReportMealsPriceEntity;
import com.ruoyi.system.fantang.entity.SettleEntity;
import com.ruoyi.system.fantang.service.IFtInvoiceDaoService;
import com.ruoyi.system.fantang.service.IFtPrepaymentDaoService;
import com.ruoyi.system.fantang.service.IFtReportMealsDaoService;
import com.ruoyi.system.fantang.service.IFtSettleDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 结算报Controller
*
* @author ft
* @date 2020-11-19
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/settle")
public class FtSettleDaoController extends BaseController {
private final IFtSettleDaoService iFtSettleDaoService;
private final IFtReportMealsDaoService iFtReportMealsDaoService;
private final IFtPrepaymentDaoService iFtPrepaymentDaoService;
private final IFtInvoiceDaoService iFtInvoiceDaoService;
/**
* 显示报餐信息包含日期正餐与营养餐的总价格
*/
@PostMapping("/showMealsWithSelect")
public AjaxResult showMealsWithSelect(@RequestBody SettleEntity settlement) {
// 病人 id
Long patientId = settlement.getPatientId();
// 上次结算 / 用餐日期
Date lastBillingDate = settlement.getLastBillingDate();
// 用户选择结算日期
Date selectBillingDate = settlement.getSelectBillingDate();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 根据病人 id 上次结算日期选择日期查询病人非营养餐记录
QueryWrapper<FtReportMealsDao> reportMealsWrapper = new QueryWrapper<>();
reportMealsWrapper
.eq("patient_id", patientId)
.eq("dining_flag",1)
.between("dining_at", sdf.format(lastBillingDate), DateUtil.endOfDay(selectBillingDate));
Integer pageNum = settlement.getPageNum();
Integer pageSize = settlement.getPageSize();
IPage<FtReportMealsDao> reportMealsList = iFtReportMealsDaoService.listPage(reportMealsWrapper, pageNum, pageSize);
ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumTotalPrice(patientId, DateUtil.beginOfDay(lastBillingDate), DateUtil.endOfDay(selectBillingDate));
Map<String, Object> data = new HashMap<>(2);
data.put("reportMealsList", reportMealsList);
data.put("reportMealsPrice", reportMealsPrice);
return AjaxResult.success(data);
}
@GetMapping("/showAllMealsWithNoPay")
public AjaxResult showAllMealsWithNoPay(@RequestParam("patientId") Long patientId, @RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize") Integer pageSize) {
// 查找该病人所有已用餐未结算记录
QueryWrapper<FtReportMealsDao> wrapper = new QueryWrapper<>();
wrapper.eq("patient_id", patientId);
wrapper.eq("dining_flag",1);
wrapper.eq("settlement_flag",0);
IPage<FtReportMealsDao> reportMealsList = iFtReportMealsDaoService.listPage(wrapper, pageNum, pageSize);
ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumAllTotalPrice(patientId);
Map<String, Object> data = new HashMap<>(2);
data.put("reportMealsList", reportMealsList);
data.put("reportMealsPrice", reportMealsPrice);
return AjaxResult.success(data);
}
/**
* 新增结算报
*/
@PostMapping("/addSettle")
public AjaxResult addSettle(@RequestBody SettleEntity settlement) {
// 病人 id
Long patientId = settlement.getPatientId();
// 上次结算 / 用餐日期
Date lastBillingDate = settlement.getLastBillingDate();
// 用户选择结算日期
Date selectBillingDate = settlement.getSelectBillingDate();
// 应收
BigDecimal sumTotalPrice = settlement.getSumTotalPrice();
// 实收
BigDecimal netPeceipt = settlement.getNetPeceipt();
// 操作用户
String userName = settlement.getUserName();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 添加结算记录
FtSettleDao ftSettleDao = new FtSettleDao();
ftSettleDao.setReceipts(netPeceipt);
ftSettleDao.setPatientId(patientId);
Date nowDate = new Date();
ftSettleDao.setSettleAt(nowDate);
ftSettleDao.setOpera(userName);
ftSettleDao.setPayable(sumTotalPrice);
ftSettleDao.setReceipts(netPeceipt);
//支付方式
switch (settlement.getPayType()) {
case 1:
ftSettleDao.setType("现金");
break;
case 2:
// 根据病人 id 查询预付费记录
QueryWrapper<FtPrepaymentDao> prepaymentWrapper = new QueryWrapper<>();
prepaymentWrapper.eq("patient_id", patientId);
FtPrepaymentDao prepaymentDao = iFtPrepaymentDaoService.getOne(prepaymentWrapper);
// 预付费扣费
BigDecimal prepaid = prepaymentDao.getPrepaid();
BigDecimal balance = prepaid.subtract(netPeceipt);
prepaymentDao.setPrepaid(balance);
iFtPrepaymentDaoService.updateById(prepaymentDao);
ftSettleDao.setType("预付款冲减");
break;
case 3:
ftSettleDao.setType("在线支付");
break;
case 4 :
ftSettleDao.setType("银行汇款");
break;
case 5:
ftSettleDao.setType("挂账");
break;
default:
}
iFtSettleDaoService.save(ftSettleDao);
// 修改报餐信息
UpdateWrapper<FtReportMealsDao> reportMealsWrapper = new UpdateWrapper<>();
reportMealsWrapper.eq("patient_id", patientId);
reportMealsWrapper.between("create_at", sdf.format(lastBillingDate), sdf.format(selectBillingDate));
FtReportMealsDao reportMealsDao = new FtReportMealsDao();
reportMealsDao.setSettlementFlag(1);
reportMealsDao.setSettlementAt(nowDate);
reportMealsDao.setSettlementBy(userName);
reportMealsDao.setSettlementId(ftSettleDao.getSettleId());
iFtReportMealsDaoService.update(reportMealsDao, reportMealsWrapper);
return AjaxResult.success("已收费");
}
/**
* 查询结算报列表
*/
@PreAuthorize("@ss.hasPermi('fantang:settle:list')")
@GetMapping("/list")
public TableDataInfo list(FtSettleDao ftSettleDao) {
startPage();
LambdaQueryWrapper<FtSettleDao> lqw = Wrappers.lambdaQuery(ftSettleDao);
if (ftSettleDao.getSettleAt() != null) {
lqw.eq(FtSettleDao::getSettleAt, ftSettleDao.getSettleAt());
}
if (ftSettleDao.getPrice() != null) {
lqw.eq(FtSettleDao::getPrice, ftSettleDao.getPrice());
}
if (ftSettleDao.getPayable() != null) {
lqw.eq(FtSettleDao::getPayable, ftSettleDao.getPayable());
}
if (ftSettleDao.getReceipts() != null) {
lqw.eq(FtSettleDao::getReceipts, ftSettleDao.getReceipts());
}
if (StringUtils.isNotBlank(ftSettleDao.getType())) {
lqw.eq(FtSettleDao::getType, ftSettleDao.getType());
}
if (ftSettleDao.getRefund() != null) {
lqw.eq(FtSettleDao::getRefund, ftSettleDao.getRefund());
}
List<FtSettleDao> list = iFtSettleDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出结算报列表
*/
@PreAuthorize("@ss.hasPermi('fantang:settle:export')")
@Log(title = "结算报", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtSettleDao ftSettleDao) {
LambdaQueryWrapper<FtSettleDao> lqw = new LambdaQueryWrapper<FtSettleDao>(ftSettleDao);
List<FtSettleDao> list = iFtSettleDaoService.list(lqw);
ExcelUtil<FtSettleDao> util = new ExcelUtil<FtSettleDao>(FtSettleDao.class);
return util.exportExcel(list, "settle");
}
/**
* 获取结算报详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:settle:query')")
@GetMapping(value = "/{settleId}")
public AjaxResult getInfo(@PathVariable("settleId") Long settleId) {
return AjaxResult.success(iFtSettleDaoService.getById(settleId));
}
/**
* 新增结算报
*/
@PreAuthorize("@ss.hasPermi('fantang:settle:add')")
@Log(title = "结算报", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtSettleDao ftSettleDao) {
ftSettleDao.setSettleAt(new Date());
ftSettleDao.setReceipts(ftSettleDao.getNetPeceipt());
Long patientId = ftSettleDao.getPatientId();
Date lastBillingDate = ftSettleDao.getLastBillingDate();
Date selectBillingDate = ftSettleDao.getSelectBillingDate();
iFtSettleDaoService.save(ftSettleDao);
Long settlementId = ftSettleDao.getSettleId();
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
iFtReportMealsDaoService.settleMeals(settlementId, patientId, ft.format(lastBillingDate), ft.format(selectBillingDate));
iFtSettleDaoService.updateList(settlementId, patientId, ft.format(lastBillingDate), ft.format(selectBillingDate));
return AjaxResult.success("结算成功");
}
/**
* 修改结算报
*/
@PreAuthorize("@ss.hasPermi('fantang:settle:edit')")
@Log(title = "结算报", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtSettleDao ftSettleDao) {
return toAjax(iFtSettleDaoService.updateById(ftSettleDao) ? 1 : 0);
}
/**
* 删除结算报
*/
@PreAuthorize("@ss.hasPermi('fantang:settle:remove')")
@Log(title = "结算报", businessType = BusinessType.DELETE)
@DeleteMapping("/{settleIds}")
public AjaxResult remove(@PathVariable Long[] settleIds) {
return toAjax(iFtSettleDaoService.removeByIds(Arrays.asList(settleIds)) ? 1 : 0);
}
}

View File

@ -0,0 +1,98 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtSettleDao;
import com.ruoyi.system.fantang.domain.FtSettlementDao;
import com.ruoyi.system.fantang.service.IFtSettlementDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
/**
* 结算管理Controller
*
* @author ft
* @date 2020-12-25
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/settlement")
public class FtSettlementDaoController extends BaseController {
private final IFtSettlementDaoService iFtSettlementDaoService;
/**
* 查询结算管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:settlement:list')")
@GetMapping("/list")
public TableDataInfo list(FtSettlementDao ftSettlementDao) {
startPage();
List<FtSettlementDao> list = iFtSettlementDaoService.listWithPatient(ftSettlementDao);
return getDataTable(list);
}
/**
* 导出结算管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:settlement:export')")
@Log(title = "结算管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtSettlementDao ftSettlementDao) {
LambdaQueryWrapper<FtSettlementDao> lqw = new LambdaQueryWrapper<FtSettlementDao>(ftSettlementDao);
List<FtSettlementDao> list = iFtSettlementDaoService.list(lqw);
ExcelUtil<FtSettlementDao> util = new ExcelUtil<FtSettlementDao>(FtSettlementDao.class);
return util.exportExcel(list, "settlement");
}
/**
* 获取结算管理详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:settlement:query')")
@GetMapping(value = "/{settleId}")
public AjaxResult getInfo(@PathVariable("settleId") Long settleId) {
return AjaxResult.success(iFtSettlementDaoService.getById(settleId));
}
/**
* 新增结算管理
*/
@PreAuthorize("@ss.hasPermi('fantang:settlement:add')")
@Log(title = "结算管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtSettlementDao ftSettlementDao) {
return toAjax(iFtSettlementDaoService.save(ftSettlementDao) ? 1 : 0);
}
/**
* 修改结算管理
*/
@PreAuthorize("@ss.hasPermi('fantang:settlement:edit')")
@Log(title = "结算管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtSettlementDao ftSettlementDao) {
return toAjax(iFtSettlementDaoService.updateById(ftSettlementDao) ? 1 : 0);
}
/**
* 删除结算管理
*/
@PreAuthorize("@ss.hasPermi('fantang:settlement:remove')")
@Log(title = "结算管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{settleIds}")
public AjaxResult remove(@PathVariable Long[] settleIds) {
return toAjax(iFtSettlementDaoService.removeByIds(Arrays.asList(settleIds)) ? 1 : 0);
}
}

View File

@ -0,0 +1,130 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtStaffDemandDao;
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
import com.ruoyi.system.fantang.service.IFtStaffDemandDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
/**
* 员工报餐Controller
*
* @author ft
* @date 2020-12-07
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/staffDemand")
public class FtStaffDemandDaoController extends BaseController {
private final IFtStaffDemandDaoService iFtStaffDemandDaoService;
private final IFtConfigDaoService iFtConfigDaoService;
/**
* 查询员工报餐列表
*/
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:list')")
@GetMapping("/list")
public TableDataInfo list(FtStaffDemandDao ftStaffDemandDao) {
startPage();
LambdaQueryWrapper<FtStaffDemandDao> lqw = Wrappers.lambdaQuery(ftStaffDemandDao);
if (ftStaffDemandDao.getStaffId() != null) {
lqw.eq(FtStaffDemandDao::getStaffId, ftStaffDemandDao.getStaffId());
}
if (StringUtils.isNotBlank(ftStaffDemandDao.getFoods())) {
lqw.eq(FtStaffDemandDao::getFoods, ftStaffDemandDao.getFoods());
}
if (ftStaffDemandDao.getType() != null) {
lqw.eq(FtStaffDemandDao::getType, ftStaffDemandDao.getType());
}
if (ftStaffDemandDao.getCreateAt() != null) {
lqw.eq(FtStaffDemandDao::getCreateAt, ftStaffDemandDao.getCreateAt());
}
if (ftStaffDemandDao.getUpdateAt() != null) {
lqw.eq(FtStaffDemandDao::getUpdateAt, ftStaffDemandDao.getUpdateAt());
}
if (ftStaffDemandDao.getUpdateFrom() != null) {
lqw.eq(FtStaffDemandDao::getUpdateFrom, ftStaffDemandDao.getUpdateFrom());
}
if (StringUtils.isNotBlank(ftStaffDemandDao.getOrderInfo())) {
lqw.eq(FtStaffDemandDao::getOrderInfo, ftStaffDemandDao.getOrderInfo());
}
if (ftStaffDemandDao.getDemandMode() != null) {
lqw.eq(FtStaffDemandDao::getDemandMode, ftStaffDemandDao.getDemandMode());
}
if (ftStaffDemandDao.getStopFlag() != null) {
lqw.eq(FtStaffDemandDao::getStopFlag, ftStaffDemandDao.getStopFlag());
}
List<FtStaffDemandDao> list = iFtStaffDemandDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出员工报餐列表
*/
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:export')")
@Log(title = "员工报餐", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtStaffDemandDao ftStaffDemandDao) {
LambdaQueryWrapper<FtStaffDemandDao> lqw = new LambdaQueryWrapper<FtStaffDemandDao>(ftStaffDemandDao);
List<FtStaffDemandDao> list = iFtStaffDemandDaoService.list(lqw);
ExcelUtil<FtStaffDemandDao> util = new ExcelUtil<FtStaffDemandDao>(FtStaffDemandDao.class);
return util.exportExcel(list, "staffDemand");
}
/**
* 获取员工报餐详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(iFtStaffDemandDaoService.getById(id));
}
/**
* 新增员工报餐
*/
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:add')")
@Log(title = "员工报餐", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtStaffDemandDao ftStaffDemandDao) {
return toAjax(iFtStaffDemandDaoService.save(ftStaffDemandDao) ? 1 : 0);
}
/**
* 修改员工报餐
*/
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:edit')")
@Log(title = "员工报餐", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtStaffDemandDao ftStaffDemandDao) {
return toAjax(iFtStaffDemandDaoService.updateById(ftStaffDemandDao) ? 1 : 0);
}
/**
* 删除员工报餐
*/
@PreAuthorize("@ss.hasPermi('fantang:staffDemand:remove')")
@Log(title = "员工报餐", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtStaffDemandDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
}

View File

@ -0,0 +1,193 @@
package com.ruoyi.system.fantang.controller;
import cn.hutool.core.date.DateTime;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtStaffInfoDao;
import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 员工管理Controller
*
* @author ft
* @date 2020-11-24
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/staffInfo")
public class FtStaffInfoDaoController extends BaseController {
private final IFtStaffInfoDaoService iFtStaffInfoDaoService;
/**
* 查询员工管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:list')")
@GetMapping("/staffList")
public TableDataInfo staffList(FtStaffInfoDao ftStaffInfoDao) {
startPage();
LambdaQueryWrapper<FtStaffInfoDao> lqw = Wrappers.lambdaQuery(ftStaffInfoDao);
lqw.eq(FtStaffInfoDao::getStaffType, 1);
if (StringUtils.isNotBlank(ftStaffInfoDao.getName())) {
lqw.like(FtStaffInfoDao::getName, ftStaffInfoDao.getName());
}
if (StringUtils.isNotBlank(ftStaffInfoDao.getPost())) {
lqw.eq(FtStaffInfoDao::getPost, ftStaffInfoDao.getPost());
}
if (ftStaffInfoDao.getFlag() != null) {
lqw.eq(FtStaffInfoDao::getFlag, ftStaffInfoDao.getFlag());
}
List<FtStaffInfoDao> list = iFtStaffInfoDaoService.list(lqw);
return getDataTable(list);
}
@GetMapping("/staffListWithDepart")
public TableDataInfo staffListWithDepart(FtStaffInfoDao ftStaffInfoDao) {
startPage();
return getDataTable(iFtStaffInfoDaoService.selectStaffInfoWithDepart(ftStaffInfoDao));
}
/**
* 查询护工管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:list')")
@GetMapping("/careStaffList")
public TableDataInfo careStaffList(FtStaffInfoDao ftStaffInfoDao) {
startPage();
LambdaQueryWrapper<FtStaffInfoDao> lqw = Wrappers.lambdaQuery(ftStaffInfoDao);
lqw.eq(FtStaffInfoDao::getStaffType, 2);
if (StringUtils.isNotBlank(ftStaffInfoDao.getName())) {
lqw.like(FtStaffInfoDao::getName, ftStaffInfoDao.getName());
}
if (StringUtils.isNotBlank(ftStaffInfoDao.getPost())) {
lqw.eq(FtStaffInfoDao::getPost, ftStaffInfoDao.getPost());
}
List<FtStaffInfoDao> list = iFtStaffInfoDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出员工管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:export')")
@Log(title = "员工管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtStaffInfoDao ftStaffInfoDao) {
LambdaQueryWrapper<FtStaffInfoDao> lqw = new LambdaQueryWrapper<FtStaffInfoDao>(ftStaffInfoDao);
List<FtStaffInfoDao> list = iFtStaffInfoDaoService.list(lqw);
ExcelUtil<FtStaffInfoDao> util = new ExcelUtil<FtStaffInfoDao>(FtStaffInfoDao.class);
return util.exportExcel(list, "staffInfo");
}
/**
* 获取员工管理详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:query')")
@GetMapping(value = "/nursing/{staffId}")
public AjaxResult getNursingInfo(@PathVariable("staffId") Long staffId) {
return AjaxResult.success(iFtStaffInfoDaoService.getById(staffId));
}
/**
* 获取护工管理详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:query')")
@GetMapping(value = "/{staffId}")
public AjaxResult getInfo(@PathVariable("staffId") Long staffId) {
return AjaxResult.success(iFtStaffInfoDaoService.getById(staffId));
}
/**
* 新增员工管理
*/
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:add')")
@Log(title = "员工管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtStaffInfoDao ftStaffInfoDao) {
List<FtStaffInfoDao> list = iFtStaffInfoDaoService.list(null);
for (FtStaffInfoDao staffInfoDao : list) {
if (ftStaffInfoDao.getTel() != null && ftStaffInfoDao.getTel().equals(staffInfoDao.getTel())) {
return AjaxResult.error("该电话号码已存在");
}
}
// 判断是否有所属公司
if (ftStaffInfoDao.getCorpName() == null) {
ftStaffInfoDao.setStaffType(1L);
} else {
ftStaffInfoDao.setStaffType(2L);
}
// 判断密码是否为空
if (ftStaffInfoDao.getPassword() == null || "".equals(ftStaffInfoDao.getPassword())) {
ftStaffInfoDao.setPassword("123456");
}
ftStaffInfoDao.setCreateAt(new Date());
ftStaffInfoDao.setDeptList(ftStaffInfoDao.getDeptList());
iFtStaffInfoDaoService.save(ftStaffInfoDao);
return AjaxResult.success("添加成功");
}
/**
* 修改员工管理
*/
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:edit')")
@Log(title = "员工管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtStaffInfoDao ftStaffInfoDao) {
return toAjax(iFtStaffInfoDaoService.updateById(ftStaffInfoDao) ? 1 : 0);
}
/**
* 修改护工管理
*/
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:edit')")
@Log(title = "护工管理", businessType = BusinessType.UPDATE)
@PutMapping("/nursing")
public AjaxResult nursingEdit(@RequestBody JSONObject param) {
FtStaffInfoDao dao = new FtStaffInfoDao();
dao.setPassword(param.getString("password"));
dao.setTel(param.getString("tel"));
dao.setStaffId(param.getLong("staffId"));
dao.setCorpName(param.getString("corpName"));
dao.setCreateAt(new DateTime());
dao.setSex(param.getInteger("sex"));
dao.setDeptList(param.getString("deptList"));
dao.setStaffType(param.getLong("staffType"));
dao.setName(param.getString("name"));
return toAjax(iFtStaffInfoDaoService.updateById(dao) ? 1 : 0);
}
/**
* 删除员工管理
*/
@PreAuthorize("@ss.hasPermi('fantang:staffInfo:remove')")
@Log(title = "员工管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{staffIds}")
public AjaxResult remove(@PathVariable Long[] staffIds) {
return toAjax(iFtStaffInfoDaoService.removeByIds(Arrays.asList(staffIds)) ? 1 : 0);
}
}

View File

@ -0,0 +1,191 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.*;
import com.ruoyi.system.fantang.mapper.FtStaffInfoDaoMapper;
import com.ruoyi.system.fantang.service.IFtConfigDaoService;
import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService;
import com.ruoyi.system.fantang.service.IFtStaffSubsidyDaoService;
import com.ruoyi.system.fantang.vo.FtStaffSubsidyVo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.*;
/**
* 补贴流水查看Controller
*
* @author ft
* @date 2020-11-19
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/staffSubsidy")
public class FtStaffSubsidyDaoController extends BaseController {
private final IFtStaffSubsidyDaoService iFtStaffSubsidyDaoService;
private final IFtStaffInfoDaoService staffInfoDaoService;
private final IFtConfigDaoService configDaoService;
/**
* 查询补贴流水查看列表
*/
@PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:list')")
@GetMapping("/list")
public TableDataInfo list(FtStaffSubsidyDao ftStaffSubsidyDao) {
startPage();
LambdaQueryWrapper<FtStaffSubsidyDao> lqw = Wrappers.lambdaQuery(ftStaffSubsidyDao);
if (StringUtils.isNotBlank(ftStaffSubsidyDao.getSubsidyType())) {
lqw.eq(FtStaffSubsidyDao::getSubsidyType, ftStaffSubsidyDao.getSubsidyType());
}
if (ftStaffSubsidyDao.getIncomeType() != null) {
lqw.eq(FtStaffSubsidyDao::getIncomeType, ftStaffSubsidyDao.getIncomeType());
}
if (ftStaffSubsidyDao.getPrice() != null) {
lqw.eq(FtStaffSubsidyDao::getPrice, ftStaffSubsidyDao.getPrice());
}
if (ftStaffSubsidyDao.getConsumAt() != null) {
lqw.eq(FtStaffSubsidyDao::getConsumAt, ftStaffSubsidyDao.getConsumAt());
}
List<FtStaffSubsidyDao> list = iFtStaffSubsidyDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出补贴流水查看列表
*/
@PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:export')")
@Log(title = "补贴流水查看", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtStaffSubsidyDao ftStaffSubsidyDao) {
LambdaQueryWrapper<FtStaffSubsidyDao> lqw = new LambdaQueryWrapper<FtStaffSubsidyDao>(ftStaffSubsidyDao);
List<FtStaffSubsidyDao> list = iFtStaffSubsidyDaoService.list(lqw);
ExcelUtil<FtStaffSubsidyDao> util = new ExcelUtil<FtStaffSubsidyDao>(FtStaffSubsidyDao.class);
return util.exportExcel(list, "staffSubsidy");
}
/**
* 获取补贴流水查看详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:query')")
@GetMapping(value = "/{subsidyId}")
public AjaxResult getInfo(@PathVariable("subsidyId") Long subsidyId) {
return AjaxResult.success(iFtStaffSubsidyDaoService.getById(subsidyId));
}
/**
* 新增补贴流水查看
*/
@PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:add')")
@Log(title = "补贴流水查看", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtStaffSubsidyDao ftStaffSubsidyDao) {
return toAjax(iFtStaffSubsidyDaoService.save(ftStaffSubsidyDao) ? 1 : 0);
}
/**
* 修改补贴流水查看
*/
@PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:edit')")
@Log(title = "补贴流水查看", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtStaffSubsidyDao ftStaffSubsidyDao) {
return toAjax(iFtStaffSubsidyDaoService.updateById(ftStaffSubsidyDao) ? 1 : 0);
}
/**
* 删除补贴流水查看
*/
@PreAuthorize("@ss.hasPermi('fantang:staffSubsidy:remove')")
@Log(title = "补贴流水查看", businessType = BusinessType.DELETE)
@DeleteMapping("/{subsidyIds}")
public AjaxResult remove(@PathVariable Long[] subsidyIds) {
return toAjax(iFtStaffSubsidyDaoService.removeByIds(Arrays.asList(subsidyIds)) ? 1 : 0);
}
/**
* 发放员工补贴
*/
@PostMapping("/submitGiveOutSubsidy")
public AjaxResult submitGiveOutSubsidy(@RequestBody FtStaffSubsidyVo ftStaffSubsidyVo) {
FtSubsidyDao subsidy = ftStaffSubsidyVo.getSubsidy();
List<String> noGiveoutList = ftStaffSubsidyVo.getNoGiveoutList();
Date giveOutDate = ftStaffSubsidyVo.getGiveOutDate();
QueryWrapper<FtStaffInfoDao> wrapper = new QueryWrapper<>();
wrapper.notIn("staff_id", noGiveoutList);
List<FtStaffInfoDao> staffData = staffInfoDaoService.list(wrapper);
List<FtStaffSubsidyDao> ftStaffSubsidyDaoList = new ArrayList<>();
for (FtStaffInfoDao staffDatum : staffData) {
if (staffDatum.getGiveOutFlag()) {
FtStaffSubsidyDao ftStaffSubsidyDao = new FtStaffSubsidyDao();
ftStaffSubsidyDao.setStaffId(staffDatum.getStaffId());
ftStaffSubsidyDao.setSubsidyType(subsidy.getType());
ftStaffSubsidyDao.setIncomeType(1);
ftStaffSubsidyDao.setPrice(subsidy.getPrice());
ftStaffSubsidyDao.setConsumAt(giveOutDate);
ftStaffSubsidyDaoList.add(ftStaffSubsidyDao);
}
}
Integer ret = iFtStaffSubsidyDaoService.insertBatchStaffSubsidy(ftStaffSubsidyDaoList);
logger.info("发放补贴:{} 人", ret);
StringBuilder builder = new StringBuilder();
builder.append(String.format("本次发放合计:%d 人;", ret));
// 统计发放补贴后有多少人的补贴超过了设置的上限150元
// 1 先去应用数据配置表中找到该企业配置的最大补贴上限
QueryWrapper<FtConfigDao> wrapper1 = new QueryWrapper<>();
wrapper1
.eq("config_key", "max_subsidy")
.eq("corp_id", 1);
List<FtConfigDao> list = configDaoService.list(wrapper1);
if (list.size() <= 0 ) {
logger.error("获取系统配置的最大补贴数据失败!");
return AjaxResult.error("获取系统配置的最大补贴数据失败!");
}
FtConfigDao configDao = list.get(0);
Integer maxSubsidy = Integer.parseInt(configDao.getConfigValue());
// 2 去员工信息表中统计余额信息超过 最大补贴数的信息
QueryWrapper<FtStaffInfoDao> wrapper2 = new QueryWrapper<>();
wrapper2.gt("balance", 150);
int overflowCount = staffInfoDaoService.count(wrapper2);
builder.append(String.format("本次统计超出余额上限员工合计:%d", overflowCount));
if (overflowCount <= 0) {
builder.append(String.format("本次补贴发放没有累计余额超出上限员工"));
return AjaxResult.success(builder);
}
// 3 如果有超过的余额的进行余额冲减操作
iFtStaffSubsidyDaoService.reBalance(subsidy.getType(), maxSubsidy);
// 4 更新员工表的余额信息超过 最大数的全部冲减
UpdateWrapper<FtStaffInfoDao> updateWrapper=new UpdateWrapper<>();
FtStaffInfoDao staffInfoDao = new FtStaffInfoDao();
staffInfoDao.setBalance(BigDecimal.valueOf(maxSubsidy));
updateWrapper.gt("balance", maxSubsidy);
staffInfoDaoService.update(staffInfoDao, updateWrapper);
builder.append(String.format("本次超出余额上限员工全部进行冲减,请查看日志"));
return AjaxResult.success(builder);
}
}

View File

@ -0,0 +1,122 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.Date;
import java.util.List;
import java.util.Arrays;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.fantang.domain.FtSubsidyDao;
import com.ruoyi.system.fantang.service.IFtSubsidyDaoService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 补贴管理Controller
*
* @author ft
* @date 2020-11-25
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/subsidy" )
public class FtSubsidyDaoController extends BaseController {
private final IFtSubsidyDaoService iFtSubsidyDaoService;
/**
* 查询补贴管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:subsidy:list')")
@GetMapping("/list")
public TableDataInfo list(FtSubsidyDao ftSubsidyDao)
{
startPage();
LambdaQueryWrapper<FtSubsidyDao> lqw = Wrappers.lambdaQuery(ftSubsidyDao);
if (StringUtils.isNotBlank(ftSubsidyDao.getType())){
lqw.eq(FtSubsidyDao::getType ,ftSubsidyDao.getType());
}
if (ftSubsidyDao.getPrice() != null){
lqw.eq(FtSubsidyDao::getPrice ,ftSubsidyDao.getPrice());
}
if (ftSubsidyDao.getCreateAt() != null){
lqw.eq(FtSubsidyDao::getCreateAt ,ftSubsidyDao.getCreateAt());
}
if (StringUtils.isNotBlank(ftSubsidyDao.getCreateBy())){
lqw.eq(FtSubsidyDao::getCreateBy ,ftSubsidyDao.getCreateBy());
}
List<FtSubsidyDao> list = iFtSubsidyDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出补贴管理列表
*/
@PreAuthorize("@ss.hasPermi('fantang:subsidy:export')" )
@Log(title = "补贴管理" , businessType = BusinessType.EXPORT)
@GetMapping("/export" )
public AjaxResult export(FtSubsidyDao ftSubsidyDao) {
LambdaQueryWrapper<FtSubsidyDao> lqw = new LambdaQueryWrapper<FtSubsidyDao>(ftSubsidyDao);
List<FtSubsidyDao> list = iFtSubsidyDaoService.list(lqw);
ExcelUtil<FtSubsidyDao> util = new ExcelUtil<FtSubsidyDao>(FtSubsidyDao. class);
return util.exportExcel(list, "subsidy" );
}
/**
* 获取补贴管理详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:subsidy:query')" )
@GetMapping(value = "/{subsidyId}" )
public AjaxResult getInfo(@PathVariable("subsidyId" ) Long subsidyId) {
return AjaxResult.success(iFtSubsidyDaoService.getById(subsidyId));
}
/**
* 新增补贴管理
*/
@PreAuthorize("@ss.hasPermi('fantang:subsidy:add')" )
@Log(title = "补贴管理" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtSubsidyDao ftSubsidyDao) {
ftSubsidyDao.setCreateAt(new Date());
return toAjax(iFtSubsidyDaoService.save(ftSubsidyDao) ? 1 : 0);
}
/**
* 修改补贴管理
*/
@PreAuthorize("@ss.hasPermi('fantang:subsidy:edit')" )
@Log(title = "补贴管理" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtSubsidyDao ftSubsidyDao) {
return toAjax(iFtSubsidyDaoService.updateById(ftSubsidyDao) ? 1 : 0);
}
/**
* 删除补贴管理
*/
@PreAuthorize("@ss.hasPermi('fantang:subsidy:remove')" )
@Log(title = "补贴管理" , businessType = BusinessType.DELETE)
@DeleteMapping("/{subsidyIds}" )
public AjaxResult remove(@PathVariable Long[] subsidyIds) {
return toAjax(iFtSubsidyDaoService.removeByIds(Arrays.asList(subsidyIds)) ? 1 : 0);
}
}

View File

@ -0,0 +1,167 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtPatientDao;
import com.ruoyi.system.fantang.domain.FtSyncConflictGenDao;
import com.ruoyi.system.fantang.service.IFtPatientDaoService;
import com.ruoyi.system.fantang.service.IFtSyncConflictGenDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
/**
* 同步冲突Controller
*
* @author ft
* @date 2020-12-24
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/syncConflict")
public class FtSyncConflictGenDaoController extends BaseController {
private final IFtSyncConflictGenDaoService iFtSyncConflictGenDaoService;
private final IFtPatientDaoService iFftPatientDaoService;
/**
* 处理冲突
*/
@PostMapping("/solveConflict")
public AjaxResult solveConflict(@RequestBody FtSyncConflictGenDao syncConflictGenDao) {
Integer patientFlag = syncConflictGenDao.getPatientFlag();
Long patientId = syncConflictGenDao.getPatientId();
if (patientFlag==2){
if (syncConflictGenDao.getHospitalId().equals(syncConflictGenDao.getOldHospitalId())){
FtPatientDao patientDao = iFftPatientDaoService.getById(patientId);
patientDao.setDepartId(syncConflictGenDao.getDepartId());
patientDao.setBedId(syncConflictGenDao.getBedId());
patientDao.setName(syncConflictGenDao.getName());
iFftPatientDaoService.updateById(patientDao);
}else {
FtPatientDao ftPatientDao = new FtPatientDao();
ftPatientDao.setDepartId(syncConflictGenDao.getDepartId());
ftPatientDao.setBedId(syncConflictGenDao.getBedId());
ftPatientDao.setName(syncConflictGenDao.getName());
iFftPatientDaoService.save(ftPatientDao);
}
}
syncConflictGenDao.setIsSolve(1);
iFtSyncConflictGenDaoService.updateById(syncConflictGenDao);
return AjaxResult.success("已处理");
}
/**
* 查询同步冲突列表
*/
@PreAuthorize("@ss.hasPermi('fantang:syncConflict:list')")
@GetMapping("/list")
public TableDataInfo list(FtSyncConflictGenDao ftSyncConflictGenDao) {
startPage();
LambdaQueryWrapper<FtSyncConflictGenDao> lqw = Wrappers.lambdaQuery(ftSyncConflictGenDao);
if (StringUtils.isNotBlank(ftSyncConflictGenDao.getHospitalId())) {
lqw.eq(FtSyncConflictGenDao::getHospitalId, ftSyncConflictGenDao.getHospitalId());
}
if (StringUtils.isNotBlank(ftSyncConflictGenDao.getName())) {
lqw.like(FtSyncConflictGenDao::getName, ftSyncConflictGenDao.getName());
}
if (StringUtils.isNotBlank(ftSyncConflictGenDao.getDepartName())) {
lqw.like(FtSyncConflictGenDao::getDepartName, ftSyncConflictGenDao.getDepartName());
}
if (StringUtils.isNotBlank(ftSyncConflictGenDao.getBedId())) {
lqw.eq(FtSyncConflictGenDao::getBedId, ftSyncConflictGenDao.getBedId());
}
if (StringUtils.isNotBlank(ftSyncConflictGenDao.getOldHospitalId())) {
lqw.eq(FtSyncConflictGenDao::getOldHospitalId, ftSyncConflictGenDao.getOldHospitalId());
}
if (StringUtils.isNotBlank(ftSyncConflictGenDao.getOldName())) {
lqw.like(FtSyncConflictGenDao::getOldName, ftSyncConflictGenDao.getOldName());
}
if (StringUtils.isNotBlank(ftSyncConflictGenDao.getOldDepartName())) {
lqw.like(FtSyncConflictGenDao::getOldDepartName, ftSyncConflictGenDao.getOldDepartName());
}
if (StringUtils.isNotBlank(ftSyncConflictGenDao.getOldBedId())) {
lqw.eq(FtSyncConflictGenDao::getOldBedId, ftSyncConflictGenDao.getOldBedId());
}
if (ftSyncConflictGenDao.getDepartId() != null) {
lqw.eq(FtSyncConflictGenDao::getDepartId, ftSyncConflictGenDao.getDepartId());
}
if (ftSyncConflictGenDao.getOldDepartId() != null) {
lqw.eq(FtSyncConflictGenDao::getOldDepartId, ftSyncConflictGenDao.getOldDepartId());
}
if (ftSyncConflictGenDao.getIsSolve()!=null){
lqw.eq(FtSyncConflictGenDao::getIsSolve,ftSyncConflictGenDao.getIsSolve());
}
List<FtSyncConflictGenDao> list = iFtSyncConflictGenDaoService.list(lqw);
return getDataTable(list);
}
/**
* 导出同步冲突列表
*/
@PreAuthorize("@ss.hasPermi('fantang:syncConflict:export')")
@Log(title = "同步冲突", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(FtSyncConflictGenDao ftSyncConflictGenDao) {
LambdaQueryWrapper<FtSyncConflictGenDao> lqw = new LambdaQueryWrapper<FtSyncConflictGenDao>(ftSyncConflictGenDao);
List<FtSyncConflictGenDao> list = iFtSyncConflictGenDaoService.list(lqw);
ExcelUtil<FtSyncConflictGenDao> util = new ExcelUtil<FtSyncConflictGenDao>(FtSyncConflictGenDao.class);
return util.exportExcel(list, "syncConflict");
}
/**
* 获取同步冲突详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:syncConflict:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(iFtSyncConflictGenDaoService.getById(id));
}
/**
* 新增同步冲突
*/
@PreAuthorize("@ss.hasPermi('fantang:syncConflict:add')")
@Log(title = "同步冲突", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtSyncConflictGenDao ftSyncConflictGenDao) {
return toAjax(iFtSyncConflictGenDaoService.save(ftSyncConflictGenDao) ? 1 : 0);
}
/**
* 修改同步冲突
*/
@PreAuthorize("@ss.hasPermi('fantang:syncConflict:edit')")
@Log(title = "同步冲突", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtSyncConflictGenDao ftSyncConflictGenDao) {
return toAjax(iFtSyncConflictGenDaoService.updateById(ftSyncConflictGenDao) ? 1 : 0);
}
/**
* 删除同步冲突
*/
@PreAuthorize("@ss.hasPermi('fantang:syncConflict:remove')")
@Log(title = "同步冲突", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtSyncConflictGenDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
}

View File

@ -0,0 +1,97 @@
package com.ruoyi.system.fantang.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
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.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtWeekMenuDao;
import com.ruoyi.system.fantang.service.IFtWeekMenuDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
/**
* 每周菜单Controller
*
* @author ft
* @date 2020-11-27
*/
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/fantang/weekMenu")
public class FtWeekMenuDaoController extends BaseController {
private final IFtWeekMenuDaoService iFtWeekMenuDaoService;
/**
* 查询每周菜单列表
*/
@PreAuthorize("@ss.hasPermi('fantang:weekMenu:list')")
@GetMapping("/list")
public TableDataInfo list(FtWeekMenuDao ftWeekMenuDao) {
startPage();
List<FtWeekMenuDao> list = iFtWeekMenuDaoService.list(null);
return getDataTable(list);
}
/**
* 导出每周菜单列表
*/
@PreAuthorize("@ss.hasPermi('fantang:weekMenu:export')" )
@Log(title = "每周菜单" , businessType = BusinessType.EXPORT)
@GetMapping("/export" )
public AjaxResult export(FtWeekMenuDao ftWeekMenuDao) {
LambdaQueryWrapper<FtWeekMenuDao> lqw = new LambdaQueryWrapper<FtWeekMenuDao>(ftWeekMenuDao);
List<FtWeekMenuDao> list = iFtWeekMenuDaoService.list(lqw);
ExcelUtil<FtWeekMenuDao> util = new ExcelUtil<FtWeekMenuDao>(FtWeekMenuDao. class);
return util.exportExcel(list, "weekMenu" );
}
/**
* 获取每周菜单详细信息
*/
@PreAuthorize("@ss.hasPermi('fantang:weekMenu:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(iFtWeekMenuDaoService.getById(id));
}
/**
* 新增每周菜单
*/
@PreAuthorize("@ss.hasPermi('fantang:weekMenu:add')")
@Log(title = "每周菜单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody FtWeekMenuDao ftWeekMenuDao) {
return toAjax(iFtWeekMenuDaoService.save(ftWeekMenuDao) ? 1 : 0);
}
/**
* 修改每周菜单
*/
@PreAuthorize("@ss.hasPermi('fantang:weekMenu:edit')")
@Log(title = "每周菜单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody FtWeekMenuDao ftWeekMenuDao) {
return toAjax(iFtWeekMenuDaoService.updateById(ftWeekMenuDao) ? 1 : 0);
}
/**
* 删除每周菜单
*/
@PreAuthorize("@ss.hasPermi('fantang:weekMenu:remove')")
@Log(title = "每周菜单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtWeekMenuDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
}

View File

@ -0,0 +1,118 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.system.fantang.vo.FtCateringVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* 配餐功能对象 ft_catering
*
* @author ft
* @date 2020-12-07
*/
@Data
@ToString
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_catering")
public class FtCateringDao extends FtCateringVo {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(value = "id")
private Long id;
/**
* 病人 id
*/
private Long patientId;
/**
* 病人 ids
*/
@TableField(exist = false)
private List<Long> patientIds;
/**
* 正餐类型
*/
@Excel(name = "正餐类型")
private Integer type;
/**
* 配餐号
*/
@Excel(name = "配餐号")
private Long number;
/**
* 配餐频次
*/
@Excel(name = "配餐频次")
private String frequency;
/**
* 用法
*/
@Excel(name = "用法")
private Integer cateringUsage;
/**
* 是否代替正餐
*/
private Integer isReplace;
/**
* 启用标志
*/
private Boolean flag;
/**
* 更新日期
*/
private Date updateAt;
/**
* 更新人
*/
@Excel(name = "更新人")
private String updateBy;
/**
* 创建时间
*/
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
/**
* 创建人
*/
private String createBy;
/**
* 描述
*/
@Excel(name = "描述")
private String cateringDescribe;
// 暂停标志
@Excel(name = "停餐")
private Boolean suspendFlag;
}

View File

@ -0,0 +1,54 @@
package com.ruoyi.system.fantang.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 饭堂参数对象 ft_config
*
* @author ft
* @date 2020-12-07
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_config")
public class FtConfigDao implements Serializable {
private static final long serialVersionUID=1L;
/** $column.columnComment */
@TableId(value = "id")
private Long id;
/** $column.columnComment */
@Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
private Long corpId;
/** $column.columnComment */
@Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
private String configKey;
/** $column.columnComment */
@Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
private String configValue;
/** $column.columnComment */
@Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
private Long flag;
}

View File

@ -0,0 +1,54 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 科室管理对象 ft_depart
*
* @author ft
* @date 2020-11-24
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_depart")
public class FtDepartDao implements Serializable {
private static final long serialVersionUID=1L;
/** 科室编号 */
@TableId(value = "depart_id")
private Long departId;
/** 科室名称 */
@Excel(name = "科室名称")
private String departName;
/** 科室编号 */
@Excel(name = "科室编号")
private String departCode;
@TableField(exist = false)
private Long patientId;
@TableField(exist = false)
private String bedId;
@TableField(exist = false)
private String name;
}

View File

@ -0,0 +1,32 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("ft_faceEvent")
public class FtFaceEventDao {
@TableId(type = IdType.AUTO)
private Long id;
@TableField(value = "device_id")
private String deviceId;
@TableField(value = "person_id")
private String personId;
@TableField(fill= FieldFill.INSERT)
private int flag;
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@TableField(fill = FieldFill.INSERT)
private int findFlag;
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.system.fantang.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import java.util.Map;
import java.util.HashMap;
import java.math.BigDecimal;
/**
* 人脸信息对象 ft_faceInfo
*
* @author ryo
* @date 2021-01-11
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_faceInfo")
public class FtFaceinfoDao implements Serializable {
private static final long serialVersionUID=1L;
/** id */
@TableId(value = "id")
private Long id;
/** 设备 id */
@Excel(name = "设备 id")
private String deviceId;
/** 员工 id */
@Excel(name = "员工 id")
private Long personId;
/** 手机 */
@Excel(name = "手机")
private String phone;
/** $column.columnComment */
private Long memId;
/** 创建时间 */
@Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createtime;
@TableField(exist = false)
private Map<String, Object> params = new HashMap<>();
}

View File

@ -0,0 +1,70 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 食品管理对象 ft_food
*
* @author ft
* @date 2020-11-24
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_food")
public class FtFoodDao implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 食品id
*/
@TableId(value = "food_id")
private Long foodId;
/**
* 名称
*/
@Excel(name = "名称")
private String name;
/**
* 图片
*/
private String pictureUrl;
/**
* 售价
*/
@Excel(name = "售价")
private BigDecimal price;
/**
* 启用标志
*/
private Long flag;
/**
* 食品分类
*/
@Excel(name = "食品分类")
private Long type;
/**
* 用餐类型
*/
private Integer dinnerType;
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.system.fantang.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 默认报餐管理对象 ft_food_default
*
* @author ft
* @date 2020-11-25
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_food_default")
public class FtFoodDefaultDao implements Serializable {
private static final long serialVersionUID=1L;
/** id */
@TableId(value = "id")
private Long id;
/** 报餐类型 */
@Excel(name = "报餐类型")
private Long type;
/** 菜品列表 */
private String foodList;
/** 创建日期 */
@Excel(name = "创建日期" , width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createdAt;
/** 创建人 */
private Long createdBy;
/** 更新日期 */
@Excel(name = "更新日期" , width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updatedAt;
/** 更新人 */
private Long updatedBy;
/** 总价格 */
@Excel(name = "总价格")
private BigDecimal price;
}

View File

@ -0,0 +1,137 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.system.fantang.entity.BasePatient;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* 病人报餐对象 ft_food_demand
*
* @author ft
* @date 2020-12-03
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_food_demand")
public class FtFoodDemandDao extends BasePatient implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(value = "id")
private Long id;
/**
* 病人id
*/
private Long patientId;
/**
* 正餐清单
*/
@Excel(name = "正餐清单")
private String foods;
/**
* 正餐类型
*/
@Excel(name = "正餐类型")
private Integer type;
/**
* 创建时间
*/
private Date createAt;
/**
* 创建人
*/
private Long createBy;
/**
* 更新日期
*/
@Excel(name = "更新日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateAt;
/**
* 加菜
*/
@Excel(name = "加菜")
private Boolean vegetables;
/**
* 更新操作人 id
*/
private Long updateBy;
/**
* 加肉
*/
@Excel(name = "加肉")
private Boolean meat;
/**
* 更新来源
*/
private Integer updateFrom;
/**
* 加饭
*/
@Excel(name = "加饭")
private Boolean rice;
/**
* 加蛋
*/
@Excel(name = "加蛋")
private Integer egg;
/**
* 订单详情
*/
private String orderInfo;
/**
* 启用状态
*/
@Excel(name = "启用状态")
private Boolean flag;
/**
* 营养餐 id
**/
private Long nutritionFoodId;
/**
* 营养餐标志
**/
private Boolean nutritionFoodFlag;
/**
* 营养餐名
*/
@TableField(exist = false)
private String nutritionFood;
private Boolean openFlag;
}

View File

@ -0,0 +1,87 @@
package com.ruoyi.system.fantang.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 财务收费开票对象 ft_invoice
*
* @author ft
* @date 2020-12-08
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_invoice")
public class FtInvoiceDao implements Serializable {
private static final long serialVersionUID=1L;
/** id */
@TableId(value = "id")
private Long id;
/** 发票单位 */
private String invoiceUnit;
/** 发票 id */
private Long invoiceId;
/** 日期 */
private Date createAt;
/** 开票人 */
private String drawer;
/** 收款方式 */
private String collectionType;
/** 应收 */
private BigDecimal payable;
/** 实收 */
private BigDecimal receipts;
/** 凭证列表 */
private String voucherList;
/**
* 发票号
*/
private String invoiceNum;
/**
* 发票名
*/
private String invoiceName;
/**
* 税号
*/
private String taxId;
/**
* 开票类型
*/
private Integer invoiceType;
/**
* 开票金额
*/
private BigDecimal invoiceAmount;
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.system.fantang.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 系统信息对象 ft_notify
*
* @author ft
* @date 2020-12-17
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_notify")
public class FtNotifyDao implements Serializable {
private static final long serialVersionUID=1L;
/** $column.columnComment */
@TableId(value = "id")
private Long id;
/** 消息类型 */
@Excel(name = "消息类型")
private Integer messageType;
/** 消息范围 */
@Excel(name = "消息范围")
private Integer scope;
/** 消息内容 */
@Excel(name = "消息内容")
private String messageBody;
/** 创建时间 */
@Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
/** 创建人 */
private String createBy;
/** 阅读标志 */
@Excel(name = "阅读标志")
private Integer readFlag;
}

View File

@ -0,0 +1,66 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 病患营养配餐对象 ft_nutrition_food
*
* @author ft
* @date 2020-12-03
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_nutrition_food")
public class FtNutritionFoodDao implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(value = "id")
private Long id;
/**
* 营养餐名称
*/
@Excel(name = "营养餐名称")
private String name;
/**
* 价格
*/
@Excel(name = "价格")
private BigDecimal price;
/**
* 启用标志
*/
@Excel(name = "启用标志")
private Boolean flag;
/**
* 创建日期
*/
private Date createAt;
/**
* 创建人
*/
private String createBy;
}

View File

@ -0,0 +1,177 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 订单管理对象 ft_order
*
* @author ft
* @date 2020-11-19
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_order")
public class FtOrderDao implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 订单 id
*/
@TableId(value = "order_id")
private Long orderId;
@TableField(exist = false)
@Excel(name = "部门名称")
private String departName;
/**
* 员工姓名
*/
@TableField(exist = false)
@Excel(name = "员工姓名")
private String name;
@TableField(exist = false)
@Excel(name = "电话")
private String tel;
/**
* 订单类型
*/
@Excel(name = "订单类型", readConverterExp = "1=早餐,2=午餐,3=晚餐")
private Integer orderType;
@TableField(exist = false)
private String orderTypeString;
/**
* 员工 id
*/
private Long staffId;
/**
* 清单
*/
private String orderList;
/**
* 总价
*/
@Excel(name = "价格")
private BigDecimal totalPrice;
/**
* 统计总数
*/
@TableField(exist = false)
private Long total;
/**
* 报餐类型
*/
@TableField(exist = false)
private Integer type;
/**
* 折扣
*/
private BigDecimal discount;
/**
* 实收
*/
private BigDecimal receipts;
/**
* 创建时间
*/
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
// 订用餐日期
@Excel(name = "订用餐日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderDate;
/**
* 创建人
*/
private String createBy;
/**
* 订单来源
*/
private String orderSrc;
/**
* 订单现售
*/
private BigDecimal currentPrice;
/**
* 支付方式
*/
private Integer payType;
/**
* 支付标志
*/
private Integer payFlag;
/**
* 过期标志
*/
private Integer expiredFlag;
/**
* 核销标志
*/
@Excel(name = "是否核销", readConverterExp = "0=否,1=是")
private Integer writeOffFlag;
/**
* 核销时间
*/
@Excel(name = "核销时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date writeOffAt;
/**
* 是否过期
*/
private Integer isExpired;
/**
* 核销设备 id
*/
private Long deviceId;
@TableField(exist = false)
private Integer countOrder;
@TableField(exist = false)
private Long departId;
@TableField(exist = false)
private String staffName;
}

View File

@ -0,0 +1,66 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 病人管理对象 ft_patient
*
* @author ft
* @date 2020-11-24
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_patient")
public class FtPatientDao implements Serializable {
private static final long serialVersionUID=1L;
/** 病人id */
@TableId(value = "patient_id")
private Long patientId;
/** 姓名 */
@Excel(name = "姓名")
private String name;
/** 所属部门id */
private Long departId;
@TableField(exist = false)
private String departName;
/** 床号 */
@Excel(name = "床号")
private String bedId;
/** 住院号 */
@Excel(name = "住院号")
private String hospitalId;
/** 同步标志 */
private Integer syncFlag;
/** 出院标志 */
private Integer offFlag;
/** 创建时间 */
private Date createAt;
}

View File

@ -0,0 +1,91 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 收费管理对象 ft_prepayment
*
* @author ft
* @date 2020-11-19
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_prepayment")
public class FtPrepaymentDao implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 预付费id
*/
@TableId(value = "prepayment_id")
private Long prepaymentId;
/**
* 病人id
*/
private Long patientId;
/**
* 收款时间
*/
@Excel(name = "收款时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date collectAt;
/**
* 收款员
*/
private String collectBy;
/**
* 结算时间
*/
@Excel(name = "结算时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date settlementAt;
/**
* 结算员
*/
private Long settlementBy;
/**
* 结算报表id
*/
private Long settlementId;
/**
* 结算标志
*/
@Excel(name = "结算标志")
private Integer settlementFlag;
/**
* 预付费金额
*/
@Excel(name = "预付费金额")
private BigDecimal prepaid;
/**
* 预付费时间
*/
@Excel(name = "预付费时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date prepaidAt;
}

View File

@ -0,0 +1,44 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 收费管理对象 ft_prepayment
*
* @author ft
* @date 2020-11-19
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
public class FtPrepaymentVo extends FtPrepaymentDao {
/**
* select a.patient_id , a.name, a.hospital_id, b.depart_name, b.depart_code from ft_patient a
* LEFT JOIN ft_depart b on a.depart_id = b.depart_id
* where a.patient_id not in (select patient_id from ft_prepayment )
*/
private String name;
private String bedId;
private String departName;
private String hospitalId;
private String departCode;
}

View File

@ -0,0 +1,47 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 远程病患数据实体类
*
* @author 陈智兴
* @date 2020-11-24
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_sync")
public class FtRemotePatientDao implements Serializable {
private static final long serialVersionUID=1L;
/** 住院号 */
@TableField(value = "hospital_id")
private String hospitalid;
/** 姓名 */
private String name;
// 科室名称
@TableField("depart_name")
private String departName;
// 床号
@TableField("bed_id")
private String bedId;
}

View File

@ -0,0 +1,194 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 报餐管理对象 ft_report_meals
*
* @author ft
* @date 2020-11-19
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_report_meals")
public class FtReportMealsDao implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(value = "id")
private Long id;
/**
* 科室名
*/
@TableField(exist = false)
@Excel(name = "部门名称")
private String departName;
/**
* 住院号
*/
@TableField(exist = false)
@Excel(name = "住院号")
private String hospitalId;
/**
* 床号
*/
@TableField(exist = false)
@Excel(name = "床号")
private String bedId;
/**
* 病人姓名
*/
@TableField(exist = false)
@Excel(name = "姓名")
private String name;
/**
* 报餐日期
*/
@Excel(name = "报餐日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
/**
* 报餐类型
*/
@Excel(name = "报餐类型", readConverterExp = "1=早餐,2=午餐,3=晚餐,4=加餐")
private Long type;
/**
* 病人id
*/
private Long patientId;
/**
* 报餐人
*/
private Long createBy;
/**
* 订单列表
*/
private String foods;
/**
* 正餐总价
*/
@Excel(name = "正餐总价")
private BigDecimal price;
/**
* 结算标志
*/
private Integer settlementFlag;
private Long settlementId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date settlementAt;
private String settlementBy;
/**
* 科室 id
*/
@TableField(exist = false)
private String departId;
/**
* 营养餐 id
*/
private Long nutritionFoodId;
/**
* 营养配餐标志
*/
private Integer nutritionFoodFlag;
/**
* 是否替代正餐
*/
private Boolean isReplaceFood;
/**
* 营养配餐价格
*/
@Excel(name = "营养配餐价格")
private BigDecimal nutritionFoodPrice;
/**
* 当前报餐总价
*/
@Excel(name = "当餐总价")
private BigDecimal totalPrice;
private Boolean vegetables;
private Boolean meat;
private Boolean rice;
private Integer egg;
@TableField(exist = false)
private Integer total;
private Boolean openFlag;
@TableField(exist = false)
private Integer statisticsType;
/**
* 营养餐名称
*/
@TableField(exist = false)
private String nutritionName;
@TableField(exist = false)
private Integer cateringUsage;
/**
* 用餐开始时间
*/
@TableField(exist = false)
private Date beginOfDay;
/**
* 用餐结束时间
*/
@TableField(exist = false)
private Date endOfDay;
/**
* 用餐标志
*/
@Excel(name = "是否已用餐", readConverterExp = "1=是,0=否")
private Integer diningFlag;
@Excel(name = "用餐日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date diningAt;
}

View File

@ -0,0 +1,72 @@
package com.ruoyi.system.fantang.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;
import java.util.Map;
import java.util.HashMap;
import java.math.BigDecimal;
/**
* 回款登记对象 ft_return
*
* @author ft
* @date 2021-01-25
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_return")
public class FtReturnDao implements Serializable {
private static final long serialVersionUID=1L;
/** id */
@TableId(value = "id")
private Long id;
/** 对应发票id */
@Excel(name = "对应发票id")
private Long invoiceId;
/** 回款日期 */
@Excel(name = "回款日期" , width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date returnAt;
/** 回款金额 */
@Excel(name = "回款金额")
private BigDecimal returnPrice;
/** 余额 */
@Excel(name = "余额")
private BigDecimal balancePrice;
/** 操作员 */
@Excel(name = "操作员")
private String opera;
/** 凭证的图片url */
@Excel(name = "凭证的图片url")
private String voucherUrl;
/** 是否完成回款标志 */
@Excel(name = "是否完成回款标志")
private Integer returnFlag;
@TableField(exist = false)
private Map<String, Object> params = new HashMap<>();
}

View File

@ -0,0 +1,119 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 结算报对象 ft_settle
*
* @author ft
* @date 2020-11-19
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_settle")
public class FtSettleDao implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 结算 id
*/
@TableId(value = "settle_id")
private Long settleId;
/**
* 病人 id
*/
private Long patientId;
/**
* 结算日期
*/
@Excel(name = "结算日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date settleAt;
/**
* 操作员
*/
private String opera;
/**
* 记录清单
*/
@Excel(name = "记录清单")
private String list;
/**
* 结算总价
*/
@Excel(name = "结算总价")
private BigDecimal price;
/**
* 应收
*/
@Excel(name = "应收")
private BigDecimal payable;
/**
* 实收
*/
@Excel(name = "实收")
private BigDecimal receipts;
/**
* 结算类型
*/
@Excel(name = "结算类型")
private String type;
/**
* 退押金标志
*/
private Integer flag;
/**
* 退款总额
*/
@Excel(name = "退款总额")
private BigDecimal refund;
@TableField(exist = false)
private BigDecimal netPeceipt;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date lastBillingDate;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date selectBillingDate;
/**
* 开票标志
*/
private Boolean invoiceFlag;
/**
* 发票 id
*/
private Long invoiceId;
}

View File

@ -0,0 +1,112 @@
package com.ruoyi.system.fantang.domain;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 结算管理对象 ft_settle
*
* @author ft
* @date 2020-12-25
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_settle")
public class FtSettlementDao implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 结算 id
*/
@TableId(value = "settle_id")
private Long settleId;
/**
* 病人 id
*/
private Long patientId;
/**
* 结算日期
*/
@Excel(name = "结算日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date settleAt;
/**
* 操作员
*/
private String opera;
/**
* 记录清单
*/
@Excel(name = "记录清单")
private String list;
/**
* 结算总价
*/
@Excel(name = "结算总价")
private BigDecimal price;
/**
* 应收
*/
@Excel(name = "应收")
private BigDecimal payable;
/**
* 实收
*/
@Excel(name = "实收")
private BigDecimal receipts;
/**
* 结算类型
*/
@Excel(name = "结算类型")
private String type;
/**
* 退押金标志
*/
private Integer flag;
/**
* 退款总额
*/
@Excel(name = "退款总额")
private BigDecimal refund;
@TableField(exist = false)
private String name;
@TableField(exist = false)
private String beginOfDay;
@TableField(exist = false)
private String endOfDay;
private Long invoiceId;
private Integer invoiceFlag;
}

View File

@ -0,0 +1,83 @@
package com.ruoyi.system.fantang.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.system.fantang.entity.BaseStaff;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 员工报餐对象 ft_staff_demand
*
* @author ft
* @date 2020-12-07
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_staff_demand")
public class FtStaffDemandDao extends BaseStaff implements Serializable {
private static final long serialVersionUID=1L;
/** id */
@TableId(value = "id")
private Long id;
/** 员工 id */
@Excel(name = "员工 id")
private Integer staffId;
/** 正餐清单 */
@Excel(name = "正餐清单")
private String foods;
/** 用餐类型 */
@Excel(name = "用餐类型")
private Long type;
/** 创建时间 */
@Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
/** 创建人 */
private Long createBy;
/** 更新时间 */
@Excel(name = "更新时间" , width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateAt;
/** 更新人 */
private Long updateBy;
/** 更新来源 */
@Excel(name = "更新来源")
private Integer updateFrom;
/** 订单详情 */
@Excel(name = "订单详情")
private String orderInfo;
/** 报餐模式 */
@Excel(name = "报餐模式")
private Boolean demandMode;
/** 停用标志 */
@Excel(name = "停用标志")
private Integer stopFlag;
}

View File

@ -0,0 +1,152 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.Date;
/**
* 员工管理对象 ft_staff_info
*
* @author ft
* @date 2020-11-24
*/
@Data
@ToString
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_staff_info")
public class FtStaffInfoDao {
private static final long serialVersionUID = 1L;
/**
* 员工 id
*/
@TableId(value = "staff_id")
private Long staffId;
/**
* 科室 id
*/
private Long departId;
/**
* 科室名
*/
@TableField(exist = false)
private String departName;
/**
* 科室编号
*/
@TableField(exist = false)
private String departCode;
/**
* 姓名
*/
@Excel(name = "姓名")
private String name;
/**
* 岗位
*/
@Excel(name = "岗位")
private String post;
/**
* 角色
*/
@Excel(name = "角色")
private String role;
/**
* 密码
*/
private String password;
/**
* 创建日期
*/
@Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
/**
* 创建人
*/
private String createBy;
/**
* 启用标志
*/
@Excel(name = "启用标志")
private Boolean flag;
/**
* 补贴余额
*/
@Excel(name = "补贴余额")
private BigDecimal balance;
/**
* 员工类别
*/
private Long staffType;
/**
* 所属公司
*/
private String corpName;
/**
* 照片
*/
private String pictureUrl;
/**
* 报餐科室列表
*/
private String deptList;
/**
* 二维码
*/
private String qrCode;
/**
* 性别
*/
private Integer sex;
/**
* 手机号码
*/
private String tel;
private String token;
private Boolean loginFlag;
private String expired;
@TableField(exist = false)
private Boolean giveOutFlag = true;
/**
* 人脸设备里的员工 id
*/
private Long personId;
}

View File

@ -0,0 +1,55 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.system.fantang.entity.BaseStaff;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* 员工报餐对象 ft_staff_demand
*
* @author ft
* @date 2020-12-07
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_staff_stop_meals")
public class FtStaffStopMealsDao extends BaseStaff implements Serializable {
private static final long serialVersionUID=1L;
/** id */
@TableId(value = "id")
private Long id;
/** 员工 id */
@Excel(name = "员工 id")
private Long staffId;
/** 用餐类型 */
@Excel(name = "用餐类型")
private Integer type;
/** 创建时间 */
@Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
/** 停餐时间 */
@Excel(name = "停餐时间" , width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date demandDate;
}

View File

@ -0,0 +1,74 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 补贴流水查看对象 ft_staff_subsidy
*
* @author ft
* @date 2020-11-19
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_staff_subsidy")
public class FtStaffSubsidyDao implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 补贴流水 id
*/
@TableId(value = "subsidy_id")
private Long subsidyId;
/**
* 员工 id
*/
private Long staffId;
/**
* 补贴类型
*/
@Excel(name = "补贴类型")
private String subsidyType;
/**
* 收支类型
*/
@Excel(name = "收支类型")
private Integer incomeType;
/**
* 金额
*/
@Excel(name = "金额")
private BigDecimal price;
/**
* 消费日期
*/
@Excel(name = "消费日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date consumAt;
/**
* 消费订单 id
*/
private Long orderId;
}

View File

@ -0,0 +1,64 @@
package com.ruoyi.system.fantang.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 补贴管理对象 ft_subsidy
*
* @author ft
* @date 2020-11-25
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_subsidy")
public class FtSubsidyDao implements Serializable {
private static final long serialVersionUID=1L;
/** 补贴 id */
@TableId(value = "subsidy_id")
private Long subsidyId;
/** 补贴类型 */
@Excel(name = "补贴类型")
private String type;
/** 金额 */
@Excel(name = "金额")
private BigDecimal price;
/** 范围 */
private String subsidyRange;
/** 周期 */
private String cycle;
/** 启用标志 */
private Boolean flag;
/** 创建日期 */
@Excel(name = "创建日期" , width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createAt;
/** 创建人 */
@Excel(name = "创建人")
private String createBy;
}

View File

@ -0,0 +1,59 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 同步冲突对象 ft_sync_conflict
*
* @author ft
* @date 2020-12-24
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_sync_conflict")
public class FtSyncConflictGenDao implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id")
private Long id;
private String hospitalId;
private String name;
private String departName;
private String bedId;
private String oldHospitalId;
private String oldName;
private String oldDepartName;
private String oldBedId;
private Long departId;
private Long oldDepartId;
@TableField(exist = false)
private Integer patientFlag;
private Long patientId;
private Integer isSolve;
}

View File

@ -0,0 +1,43 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* 科室管理对象 ft_depart
*
* @author ft
* @date 2020-11-24
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_sync_log")
public class FtSyncLogDao implements Serializable {
private static final long serialVersionUID=1L;
/** 同步时间 */
@TableField(value = "created_at")
private Date createAt;
@TableField("total_record")
private Long totalRecord;
@TableField("sync_record")
private Long SyncRecord;
}

View File

@ -0,0 +1,45 @@
package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 远程病患数据实体类
*
* @author 陈智兴
* @date 2020-11-24
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_sync")
public class FtSyncPatientDao implements Serializable {
private static final long serialVersionUID=1L;
/** 住院号 */
@TableField(value = "hospital_id")
private String hospitalid;
/** 姓名 */
private String name;
// 科室名称
@TableField("depart_name")
private String departName;
// 床号
@TableField("bed_id")
private String bedId;
}

View File

@ -0,0 +1,58 @@
package com.ruoyi.system.fantang.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 每周菜单对象 ft_week_menu
*
* @author ft
* @date 2020-11-27
*/
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ft_week_menu")
public class FtWeekMenuDao implements Serializable {
private static final long serialVersionUID=1L;
/** id */
@TableId(value = "id")
private Long id;
/** 用餐类型 */
@Excel(name = "用餐类型")
private String dinnerType;
/** 星期几 */
@Excel(name = "星期几")
private String weekday;
/** 菜品列表 */
@Excel(name = "菜品列表")
private String foods;
/** 总价格 */
@Excel(name = "总价格")
private BigDecimal price;
/** 启用标志 */
@Excel(name = "启用标志")
private Boolean flag;
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.system.fantang.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BasePatient {
@TableField(exist = false)
public String hospitalId;
@TableField(exist = false)
public String bedId;
@TableField(exist = false)
public String name;
@TableField(exist = false)
public String departName;
@TableField(exist = false)
private Long departId;
@TableField(exist = false)
private Long total;
}

View File

@ -0,0 +1,20 @@
package com.ruoyi.system.fantang.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseStaff {
@TableField(exist = false)
public String name;
@TableField(exist = false)
public String departName;
@TableField(exist = false)
private Long departId;
@TableField(exist = false)
private Long total;
}

View File

@ -0,0 +1,25 @@
package com.ruoyi.system.fantang.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.util.Date;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ReportMealsDayEntity extends FtReportMealsDao {
// 用户自定义结算日期
@JsonFormat(pattern = "yyyy-MM-dd")
private Date selectBillingDate;
// 自上一次结算累计未结算天数
private Long days;
// 上次缴费日期
@JsonFormat(pattern = "yyyy-MM-dd")
private Date lastCreateDate;
}

View File

@ -0,0 +1,28 @@
package com.ruoyi.system.fantang.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ReportMealsPriceEntity {
/**
* 正餐总价
*/
private BigDecimal dinnerTotalPrice;
/**
* 营养餐总价
*/
private BigDecimal nutritionTotalPrice;
/**
* 正餐和营养餐总价
*/
private BigDecimal sumTotalPrice;
}

View File

@ -0,0 +1,71 @@
package com.ruoyi.system.fantang.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SettleEntity {
// 床号
private String bedId;
// 科室名
private String departName;
// 住院号
private String hospitalId;
// 上次缴费日期
@JsonFormat(pattern = "yyyy-MM-dd")
private Date lastBillingDate;
// 病人姓名
private String name;
// 实收
private BigDecimal netPeceipt;
// 操作员
private String opera;
// 病人 id
private Long patientId;
// 预付款金额
private BigDecimal prepayment;
// 应收
private BigDecimal price;
// 用户自定义结算日期
@JsonFormat(pattern = "yyyy-MM-dd")
private Date selectBillingDate;
// 自上一次结算累计未结算天数
private Long days;
// 操作员
private String userName;
// 正餐总价
private BigDecimal dinnerTotalPrice;
// 营养餐总价
private BigDecimal nutritionTotalPrice;
// 正餐和营养餐总价
private BigDecimal sumTotalPrice;
// 付款方式
private Integer payType;
// 分页信息
private Integer pageNum;
private Integer pageSize;
}

View File

@ -0,0 +1,19 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtCateringDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* 配餐功能Mapper接口
*
* @author ft
* @date 2020-12-07
*/
public interface FtCateringDaoMapper extends BaseMapper<FtCateringDao> {
List<FtCateringDao> listNewFormatter(FtCateringDao ftCateringDao);
FtCateringDao getByIdNewFormatter(Long id);
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtConfigDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 饭堂参数Mapper接口
*
* @author ft
* @date 2020-12-07
*/
public interface FtConfigDaoMapper extends BaseMapper<FtConfigDao> {
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtDepartDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 科室管理Mapper接口
*
* @author ft
* @date 2020-11-24
*/
public interface FtDepartDaoMapper extends BaseMapper<FtDepartDao> {
}

View File

@ -0,0 +1,9 @@
package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.fantang.domain.FtFaceEventDao;
import org.springframework.stereotype.Repository;
@Repository
public interface FtFaceEventDaoMapper extends BaseMapper<FtFaceEventDao> {
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtFaceinfoDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 人脸信息Mapper接口
*
* @author ryo
* @date 2021-01-11
*/
public interface FtFaceinfoDaoMapper extends BaseMapper<FtFaceinfoDao> {
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtFoodDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 食品管理Mapper接口
*
* @author ft
* @date 2020-11-24
*/
@Repository
public interface FtFoodDaoMapper extends BaseMapper<FtFoodDao> {
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtFoodDefaultDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 默认报餐管理Mapper接口
*
* @author ft
* @date 2020-11-25
*/
public interface FtFoodDefaultDaoMapper extends BaseMapper<FtFoodDefaultDao> {
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
import com.ruoyi.system.fantang.domain.FtOrderDao;
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
/**
* 病人报餐Mapper接口
*
* @author ft
* @date 2020-12-03
*/
public interface FtFoodDemandDaoMapper extends BaseMapper<FtFoodDemandDao> {
@Insert("insert into ft_food_demand (patient_id, foods, type, flag,create_at ) select #{patient_id}, food_list, type, 1, now() FROM ft_food_default")
public Integer GenerateOrderByPatientId(@Param("patient_id") Long patientId);
@Select("select a.patient_id from ft_patient a where a.patient_id not in (select patient_id from ft_food_demand c )")
public List<Long> getNewPatientNotDemand();
List<FtFoodDemandDao> listNewFormatter(FtFoodDemandDao ftFoodDemandDao);
FtFoodDemandDao getByIdNewFormatter(Long id);
@Select("SELECT\n" +
"\td.depart_name,\n" +
"\tcount(*) AS total,\n" +
"\ta.type \n" +
"FROM\n" +
"\tft_report_meals a\n" +
"\tLEFT JOIN ft_patient c ON a.patient_id = c.patient_id\n" +
"\tLEFT JOIN ft_depart d ON c.depart_id = d.depart_id \n" +
"WHERE\n" +
"\tc.depart_id = d.depart_id and a.create_at BETWEEN #{start} and #{end}\n" +
"\t\n" +
"GROUP BY\n" +
"\td.depart_name,\n" +
"\ta.type")
List<FtOrderDao> getStatisticsOfDate(@Param("start") String start, @Param("end") String end);
@Select("SELECT\n" +
"\ta.type,\n" +
"\tc.depart_name,\n" +
"\tCOUNT(*) AS total \n" +
"FROM\n" +
"\tft_food_demand a\n" +
"\tLEFT JOIN ft_patient b ON b.patient_id = a.patient_id\n" +
"\tLEFT JOIN ft_depart c ON c.depart_id = b.depart_id \n" +
"WHERE\n" +
"\tb.depart_id = c.depart_id \n" +
"\tAND flag = 1 \n" +
"GROUP BY\n" +
"\ta.type,\n" +
"\tc.depart_name")
List<FtReportMealsDao> getStatisticsFoodDemand();
@Update("UPDATE ft_food_demand set flag = 0 where patient_id = #{patientId} and type = 4 ")
void updateExtraByPatientId(@Param("patientId") Long patientId);
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtInvoiceDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 财务收费开票Mapper接口
*
* @author ft
* @date 2020-12-08
*/
public interface FtInvoiceDaoMapper extends BaseMapper<FtInvoiceDao> {
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtNotifyDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 系统信息Mapper接口
*
* @author ft
* @date 2020-12-17
*/
@Repository
public interface FtNotifyDaoMapper extends BaseMapper<FtNotifyDao> {
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtNutritionFoodDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 病患营养配餐Mapper接口
*
* @author ft
* @date 2020-12-03
*/
public interface FtNutritionFoodDaoMapper extends BaseMapper<FtNutritionFoodDao> {
}

View File

@ -0,0 +1,150 @@
package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.system.fantang.domain.FtFoodDemandDao;
import com.ruoyi.system.fantang.domain.FtOrderDao;
import com.ruoyi.system.fantang.domain.FtStaffDemandDao;
import com.ruoyi.system.fantang.domain.FtStaffStopMealsDao;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* 订单管理Mapper接口
*
* @author ft
* @date 2020-11-19
*/
public interface FtOrderDaoMapper extends BaseMapper<FtOrderDao> {
@Insert("insert into ft_order (order_type, staff_id, order_src, create_at, order_date, order_list, total_price) select type as order_type, staff_id, 1 as order_src, now() as create_at, date_add(now(), interval 1 day) as order_date, foods, (select sum(price) from ft_food f where FIND_IN_SET(f.food_id,d.foods)) as price from ft_staff_demand d where d.demand_mode = 1")
void GenerateStaffTomorrowOrder();
@Select("select a.order_type, count(a.order_type) as count_order , c.depart_name from ft_order a\n" +
" LEFT JOIN ft_staff_info b on a.staff_id = b.staff_id\n" +
" LEFT JOIN ft_depart c on b.depart_id = c.depart_id where b.depart_id = c.depart_id and a.order_date BETWEEN #{start} and #{end}\n" +
" GROUP BY a.order_type, c.depart_name")
IPage<FtOrderDao> statisGetOrderOfDate(Page<FtOrderDao> page, @Param("start") String start, @Param("end") String end);
@Select("SELECT\n" +
"\ta.order_type,\n" +
"\tcount( a.order_type ) AS count_order,\n" +
"\tc.depart_name,\n" +
"\tb.`name` AS staff_name,\n" +
"\tb.tel \n" +
"FROM\n" +
"\tft_order a\n" +
"\tLEFT JOIN ft_staff_info b ON a.staff_id = b.staff_id\n" +
"\tLEFT JOIN ft_depart c ON b.depart_id = c.depart_id \n" +
"WHERE\n" +
"\tb.depart_id = c.depart_id \n" +
"\tAND a.order_date BETWEEN #{start} \n" +
"\tAND #{end} \n" +
"GROUP BY\n" +
"\ta.order_type,\n" +
"\tc.depart_name,\n" +
"\tb.`name`,\n" +
"\tb.tel")
IPage<FtOrderDao> statisGetOrderOfDateByPerson(Page<FtOrderDao> page, @Param("start") String start, @Param("end") String end);
List<FtOrderDao> listDetailedByDate(@Param("orderType") Integer orderType, @Param("start") String start, @Param("end") String end);
List<FtOrderDao> listAllDetailedByDate(String start, String end);
@Select("SELECT\n" +
"\t* \n" +
"FROM\n" +
"\tft_order \n" +
"WHERE\n" +
"\tstaff_id = #{staffId} \n" +
"\tAND order_type = #{type} \n" +
"\tAND order_date BETWEEN DATE(\n" +
"\tNOW()) \n" +
"\tAND date_add(\n" +
"\tnow(),\n" +
"\tINTERVAL 1 DAY)")
FtOrderDao getNowOrder(@Param("staffId") Long staffId, @Param("type") int type);
@Insert("INSERT INTO ft_order ( order_type, staff_id, order_list, total_price, create_at, pay_type, pay_flag, write_off_flag, write_off_at, device_id, order_date ) SELECT\n" +
"#{type},\n" +
"#{staffId},\n" +
"b.food_list,\n" +
"b.price,\n" +
"now(),\n" +
"1,\n" +
"1,\n" +
"1,\n" +
"NOW(),\n" +
"#{deviceId},\n" +
"NOW() \n" +
"FROM\n" +
"\tft_food_default b \n" +
"WHERE\n" +
"\tb.type = #{type}")
void insertOrderAndWriteOff(@Param("staffId") Long staffId, @Param("type") int type, @Param("deviceId") Long deviceId);
@Select("SELECT\n" +
"\tc.depart_name,\n" +
"\ta.type,\n" +
"\ta.flag,\n" +
"count(*) as total\n" +
"FROM\n" +
"\tft_food_demand a\n" +
"LEFT JOIN ft_patient b ON a.patient_id = b.patient_id\n" +
"LEFT JOIN ft_depart c ON b.depart_id = c.depart_id\n" +
"WHERE\n" +
"\tb.off_flag = 0\n" +
"AND a.flag = 1\n" +
"GROUP BY a.type, c.depart_name")
List<FtFoodDemandDao> getStatisticsReportMealsOfTomorrow();
@Select("SELECT\n" +
"\tc.depart_name,\n" +
"\ta.type,\n" +
"\tcount(*) as total\n" +
"FROM\n" +
"\tft_staff_demand a\n" +
"LEFT JOIN ft_staff_info b ON a.staff_id = b.staff_id\n" +
"LEFT JOIN ft_depart c ON b.depart_id = c.depart_id\n" +
"WHERE\n" +
"\ta.demand_mode = 1\n" +
"GROUP BY\n" +
"\tc.depart_name,\n" +
"\ta.type")
List<FtStaffDemandDao> getStatisticsStaffOfTomorrow();
@Select("SELECT\n" +
"\tc.depart_name,\n" +
"\ta.type,\n" +
"\tcount(*) as total\n" +
"FROM\n" +
"\tft_staff_stop_meals a\n" +
"LEFT JOIN ft_staff_info b ON a.staff_id = b.staff_id\n" +
"LEFT JOIN ft_depart c ON b.depart_id = c.depart_id\n" +
"WHERE\n" +
"demand_date BETWEEN date_add(NOW(), INTERVAL 1 DAY)\n" +
"AND date_add(now(), INTERVAL 2 DAY)\n" +
"GROUP BY\n" +
"\tc.depart_name,\n" +
"\ta.type\n")
List<FtStaffStopMealsDao> getStopOrderOfTomorrow();
@Select("SELECT\n" +
"\tc.depart_name,\n" +
"\tb.`name`, b.tel,\n" +
"\ta.* \n" +
"FROM\n" +
"\tft_order a\n" +
"\tLEFT JOIN ft_staff_info b ON b.staff_id = a.staff_id\n" +
"\tLEFT JOIN ft_depart c ON c.depart_id = b.depart_id \n" +
"WHERE\n" +
"\ta.order_date BETWEEN #{start} \n" +
"\tAND #{end}")
List<FtOrderDao> statisOrderOfDateByPersonNoPage( @Param("start") String start, @Param("end") String end);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.fantang.domain.FtPatientDao;
import com.ruoyi.system.fantang.vo.FtDepartVo;
import com.ruoyi.system.fantang.vo.FtPatientVo;
import com.ruoyi.system.fantang.vo.ftSyncConflictVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 病人管理Mapper接口
*
* @author ft
* @date 2020-11-24
*/
@Repository
public interface FtPatientDaoMapper extends BaseMapper<FtPatientDao> {
@Update("update ft_patient set sync_flag = 0 where off_flag = 0")
public int initForSync();
@Update("update ft_patient a, ft_sync b set a.name= b.name, a.bed_id = b.bed_id, a.sync_flag = 1 where a.hospital_id = b.hospital_id and a.name = b.name and a.bed_id = b.bed_id and a.depart_id = b.depart_id")
public int syncEqual();
@Update("update ft_patient a, ft_sync b set a.name= b.name, a.bed_id = b.bed_id, a.sync_flag = 1 where a.hospital_id = b.hospital_id and a.name = b.name")
int syncEqualForHospitalAndName();
@Update("update ft_patient a, ft_sync b set a.name= b.name, a.bed_id = b.bed_id, a.sync_flag = 1 where a.hospital_id = b.hospital_id")
public int syncEqualHospitalId();
@Insert("Insert into ft_patient (hospital_id, name, depart_id, bed_id, sync_flag) select a.hospital_id, a.name, c.depart_id, a.bed_id,2 from ft_sync a LEFT JOIN ft_depart c on a.depart_name = c.depart_name LEFT JOIN ft_patient b on a.`name` = b.`name` and c.depart_id = b.depart_id where a.hospital_id not in (select hospital_id from ft_patient d)")
public int syncNewHospitalId();
@Update("update ft_patient set off_flag = 1 where sync_flag = 0")
public int updateOffHospitalFlag();
@Update("update ft_patient a inner join ft_sync b on a.hospital_id = b.hospital_id and a.sync_flag = 2 set a.depart_id = (select depart_id from ft_depart c where b.depart_name = c.depart_name )")
public int updateDepartIDToNewPatient();
@Update("update ft_sync, ft_depart set ft_sync.depart_id = ft_depart.depart_id where ft_sync.depart_name = ft_depart.depart_name")
public int updateDepartIDToPatient();
@Select("select a.hospital_id, a.name, a.depart_name, a.bed_id, b.depart_id, c.hospital_id as old_hospital_id, c.name as old_name, a.depart_name as old_depart_name, c.bed_id as old_bed_id, c.depart_id as old_depart_id, c.patient_id as patient_id from ft_sync a LEFT JOIN ft_depart b on a.depart_name = b.depart_name LEFT JOIN ft_patient c on a.hospital_id = c.hospital_id where b.depart_id = c.depart_id and a.bed_id = c.bed_id and a.name != c.name")
List<ftSyncConflictVo> syncConflictOnlyHospitalEqual();
@Select("select a.hospital_id, a.name, a.depart_name, a.bed_id, b.depart_id, c.hospital_id as old_hospital_id, c.name as old_name, a.depart_name as old_depart_name, c.bed_id as old_bed_id, c.depart_id as old_depart_id, c.patient_id as patient_id from ft_sync a LEFT JOIN ft_depart b on a.depart_name = b.depart_name LEFT JOIN ft_patient c on a.hospital_id = c.hospital_id where b.depart_id = c.depart_id and a.bed_id = c.bed_id and a.name = c.name and c.hospital_id!=a.hospital_id")
List<ftSyncConflictVo> syncConflictOtherAllEqual();
List<FtPatientVo> getReportMealsToday(@Param("createAt") String createAt, @Param("patientId") Long patientId);
List<FtPatientVo> getReportMealsByDepart(@Param("departId") Long departId, @Param("createAt") String createAt);
@Select("SELECT * from ft_patient where depart_id = #{departId} and patient_id not in (SELECT patient_id from ft_catering) ")
List<FtPatientDao> selectNoCateringByDepartId(@Param("departId") Long departId);
}

View File

@ -0,0 +1,29 @@
package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.system.fantang.domain.FtOrderDao;
import com.ruoyi.system.fantang.domain.FtPrepaymentDao;
import com.ruoyi.system.fantang.domain.FtPrepaymentVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;
/**
* 收费管理Mapper接口
*
* @author ft
* @date 2020-11-19
*/
public interface FtPrepaymentDaoMapper extends BaseMapper<FtPrepaymentDao> {
List<FtPrepaymentVo> listNoPrepay(FtPrepaymentVo params);
List<FtPrepaymentVo> listPrepay(FtPrepaymentVo params);
List<FtPrepaymentVo> listAllPrepay(FtPrepaymentVo params);
}

View File

@ -0,0 +1,11 @@
package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.fantang.domain.FtRemotePatientDao;
import org.springframework.stereotype.Repository;
@Repository
public interface FtRemotePatientDaoMapper extends BaseMapper<FtRemotePatientDao> {
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
import com.ruoyi.system.fantang.vo.FtReportMealVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 报餐管理Mapper接口
*
* @author ft
* @date 2020-11-19
*/
@Repository
public interface FtReportMealVoMapper extends BaseMapper<FtReportMealVo> {
@Select("select a.price, a.patient_id, b.hospital_id, b.bed_id, b.`name`, c.depart_name, c.depart_code from ft_report_meals a LEFT JOIN ft_patient b on a.patient_id = b.patient_id LEFT JOIN ft_depart c on b.depart_id = c.depart_id")
public List<FtReportMealVo> listAll();
@Select("select sum(a.price) as price, a.patient_id, b.hospital_id, b.bed_id, b.`name`, c.depart_name, c.depart_code from ft_report_meals a LEFT JOIN ft_patient b on a.patient_id = b.patient_id LEFT JOIN ft_depart c on b.depart_id = c.depart_id where a.settlement_flag = 0 GROUP BY a.patient_id")
public List<FtReportMealVo> listNoPay();
@Select("select sum(a.price) as price, a.patient_id, b.hospital_id, b.bed_id, b.`name`, c.depart_name, c.depart_code from ft_report_meals a LEFT JOIN ft_patient b on a.patient_id = b.patient_id LEFT JOIN ft_depart c on b.depart_id = c.depart_id where a.settlement_flag = 1 GROUP BY a.patient_id")
public List<FtReportMealVo> listPayoff();
// 根据foods列表和ft_food 的价格计算列表中菜单的总价
// select d.*, (select sum(price) from ft_food f where FIND_IN_SET(f.food_id,d.foods)) as price from ft_food_demand d
// 根据病患配餐表生成次日报餐记录并通过ft_food 菜品价格计算菜单总价
@Insert("INSERT INTO ft_report_meals (create_at,type,patient_id,foods,settlement_flag,price,open_flag,nutrition_food_flag,nutrition_food_id,nutrition_food_price, total_price) " +
"SELECT date_add(now(), INTERVAL 1 DAY), d.type, d.patient_id, d.foods,0," +
"(SELECT sum(price) FROM ft_food f WHERE FIND_IN_SET(f.food_id, d.foods)) AS price," +
"d.open_flag,0,d.nutrition_food_id, e.price as nutrition_food_price , (SELECT sum(price) FROM ft_food f WHERE FIND_IN_SET(f.food_id, d.foods)) AS total_price" +
"FROM ft_food_demand d " +
"LEFT JOIN ft_patient p ON p.patient_id = d.patient_id AND p.off_flag = 0 " +
"LEFT JOIN ft_nutrition_food e ON e.id = d.nutrition_food_id")
public void insertTomorrowReportMeal();
// 为指定病患生成次日报餐记录并通过ft_food 菜品价格计算菜单总价
@Insert("INSERT INTO ft_report_meals (create_at,type,patient_id,foods,settlement_flag,price,open_flag,nutrition_food_flag,nutrition_food_id,nutrition_food_price) " +
"SELECT date_add(now(), INTERVAL 1 DAY), d.type, d.patient_id, d.foods,0," +
"(SELECT sum(price) FROM ft_food f WHERE FIND_IN_SET(f.food_id, d.foods)) AS price," +
"d.open_flag,0,d.nutrition_food_id, e.price as nutrition_food_price " +
"FROM ft_food_demand d where d.patient_id = #{patientId}" +
"LEFT JOIN ft_patient p ON p.patient_id = d.patient_id AND p.off_flag = 0 " +
"LEFT JOIN ft_nutrition_food e ON e.id = d.nutrition_food_id")
public void insertTomorrowReportMealByPatient(@Param("patientId") Long patientId);
@Update("UPDATE ft_report_meals set dining_flag = 1, dining_at = now() where type = 1 and create_at =CURDATE()")
Integer updateBreakfastDinnerFlag();
@Update("UPDATE ft_report_meals set dining_flag = 1, dining_at = now() where type = 2 and create_at =CURDATE()")
Integer updateLunchDinnerFlag();
@Update("UPDATE ft_report_meals set dining_flag = 1, dining_at = now() where type = 3 and create_at =CURDATE()")
Integer updateDinnerDinnerFlag();
@Update("UPDATE ft_report_meals set dining_flag = 1, dining_at = now() where type = 4 and open_flag = 1 and create_at =CURDATE()")
Integer updateAdditionDinnerFlag();
}

View File

@ -0,0 +1,60 @@
package com.ruoyi.system.fantang.mapper;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
import com.ruoyi.system.fantang.entity.ReportMealsPriceEntity;
import com.ruoyi.system.fantang.vo.FtReportMealVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.Date;
import java.util.List;
/**
* 报餐管理Mapper接口
*
* @author ft
* @date 2020-11-19
*/
public interface FtReportMealsDaoMapper extends BaseMapper<FtReportMealsDao> {
@Select("SELECT sum(price) as price from ft_report_meals where patient_id = #{patientId} and settlement_flag = 0 and create_at BETWEEN #{createAt} and #{selectBillingDate}")
Long countBillingBetween(Long patientId, Date createAt, Date selectBillingDate);
List<FtReportMealsDao> listMealsWithInSettle(FtReportMealsDao ftReportMealsDao);
@Update("UPDATE ft_report_meals set settlement_flag = 1 , settlement_at = now() , settlement_id = #{settlementId} where patient_id = #{patientId} and create_at BETWEEN #{lastBillingDate} and #{selectBillingDate}")
Integer settleMeals(@Param("settlementId") Long settlementId, @Param("patientId") Long patientId, @Param("lastBillingDate") String lastBillingDate, @Param("selectBillingDate") String selectBillingDate);
/**
* SELECT a.patient_id,sum(a.price) as price , sum(a.nutrition_food_price ) as nutrition_food_price , sum(a.total_price) as total_price FROM ft_report_meals a where a.patient_id = 2 and a.create_at BETWEEN '2020-12-01' AND '2020-12-22'
*
* @param patientId
* @param lastBillingDate
* @param selectBillingDate
* @return
*/
@Select("SELECT a.patient_id,sum(a.price) as dinner_total_price , sum(a.nutrition_food_price ) as nutrition_total_price , sum(a.total_price) as sum_total_price FROM ft_report_meals a where a.patient_id = #{patientId} and a.dining_at BETWEEN #{lastBillingDate} AND #{selectBillingDate}")
ReportMealsPriceEntity sumTotalPrice(@Param("patientId") Long patientId, @Param("lastBillingDate") Date lastBillingDate, @Param("selectBillingDate") Date selectBillingDate);
List<FtReportMealsDao> listNutrition(@Param("beginOfDay") DateTime beginOfDay, @Param("endOfDay") DateTime endOfDay, FtReportMealsDao ftReportMealsDao);
List<FtReportMealsDao> listAllNutrition(FtReportMealsDao ftReportMealsDao);
@Select("SELECT a.type, a.foods, count(a.foods) as count, b.depart_id,c.depart_name\n" +
"from ft_report_meals a \n" +
"LEFT JOIN ft_patient b on a.patient_id = b.patient_id\n" +
"LEFT JOIN ft_depart c on b.depart_id = c.depart_id \n" +
"where b.depart_id = #{departId} and a.dining_at BETWEEN #{beginOfDay} and #{endOfDay}\n" +
"GROUP BY a.type, foods")
List<FtReportMealVo> getStatisticsFoods(@Param("departId") Integer departId,@Param("beginOfDay") DateTime beginOfDay, @Param("endOfDay") DateTime endOfDay);
@Select("SELECT a.patient_id,sum(a.price) as dinner_total_price , sum(a.nutrition_food_price ) as nutrition_total_price , sum(a.total_price) as sum_total_price FROM ft_report_meals a where a.patient_id = #{patientId} AND a.settlement_flag = 0 AND a.dining_flag = 1")
ReportMealsPriceEntity sumAllTotalPrice(@Param("patientId") Long patientId);
// SELECT a.*, b.`name` , b.bed_id, b.hospital_id, c.depart_name from ft_report_meals a LEFT JOIN ft_patient b on a.patient_id = b.patient_id LEFT JOIN ft_depart c on b.depart_id =c.depart_id where a.patient_id in (7) and a.create_at = CURDATE() + 1
List<FtReportMealsDao> listPatientReportMeals(FtReportMealsDao ftReportMealsDao);
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtReturnDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 回款登记Mapper接口
*
* @author ft
* @date 2021-01-25
*/
public interface FtReturnDaoMapper extends BaseMapper<FtReturnDao> {
}

View File

@ -0,0 +1,18 @@
package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.fantang.domain.FtSettleDao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
/**
* 结算报Mapper接口
*
* @author ft
* @date 2020-11-19
*/
public interface FtSettleDaoMapper extends BaseMapper<FtSettleDao> {
@Update("UPDATE ft_settle a set list = (select GROUP_CONCAT(b.id) from ft_report_meals b where b.patient_id = #{patientId} and b.create_at BETWEEN #{lastBillingDate} and #{selectBillingDate}) where a.settle_id = #{settlementId} ")
Integer updateList(@Param("settlementId") Long settlementId, @Param("patientId") Long patientId, @Param("lastBillingDate") String lastBillingDate, @Param("selectBillingDate") String selectBillingDate);
}

View File

@ -0,0 +1,17 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtSettlementDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* 结算管理Mapper接口
*
* @author ft
* @date 2020-12-25
*/
public interface FtSettlementDaoMapper extends BaseMapper<FtSettlementDao> {
List<FtSettlementDao> listWithPatient(FtSettlementDao ftSettlementDao);
}

View File

@ -0,0 +1,18 @@
package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.system.fantang.domain.FtStaffDemandDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
/**
* 员工报餐Mapper接口
*
* @author ft
* @date 2020-12-07
*/
public interface FtStaffDemandDaoMapper extends BaseMapper<FtStaffDemandDao> {
@Insert("INSERT into ft_staff_demand (staff_id, type, demand_mode) VALUES (#{staffId}, 1, 0),(#{staffId}, 2, 0),(#{staffId}, 3, 0)")
Integer initDemandMode(Long staffId);
}

View File

@ -0,0 +1,25 @@
package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.fantang.domain.FtStaffInfoDao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import java.util.List;
/**
* 员工管理Mapper接口
*
* @author ft
* @date 2020-11-19
*/
public interface FtStaffInfoDaoMapper extends BaseMapper<FtStaffInfoDao> {
// @Select("SELECT a.*, b.depart_name from ft_staff_info a LEFT JOIN ft_depart b on a.depart_id = b.depart_id where staff_type = 1")
List<FtStaffInfoDao> selectStaffInfoWithDepart(FtStaffInfoDao ftStaffInfoDao);
@Update("update ft_staff_info set token=#{token}, login_flag=1 where staff_id=#{staff_id}")
void updateLoginStatus(FtStaffInfoDao dao);
FtStaffInfoDao getDepartInfo(@Param("staffId") Long staffId);
}

Some files were not shown because too many files have changed in this diff Show More