diff --git a/LICENSE b/LICENSE index 0227962c16c32b2f963b66836daaee7b1311e329..7ad5243bcea94044b8a2a29f7759c0955d320391 100644 --- a/LICENSE +++ b/LICENSE @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright 2022-2024 武汉新致数字科技有限公司 + Copyright 2022-2025 湖北天天数链技术有限公司 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - OpenHis Copyright (C) 2022-2024 武汉新致数字科技有限公司 + OpenHis Copyright (C) 2022-2025 湖北天天数链技术有限公司 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/README.md b/README.md index 721e52ebc28bb6f66274d75c5231e6b253bbc695..cdf75d04dae20f732602eb750be01c71815d4652 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,50 @@ -# OpenHis-ITAII +# 平台介绍 + +## 🏠【关于我们】 + +![天天开源](https://open.tntlinking.com/assets/logo-b-BzFUYaRU.png) + +天天开源致⼒于打造中国应⽤管理软件开源⽣态,⾯向医疗、企业、教育三⼤⾏业信息化需求,提供优质的开源软件产品与解决⽅案。平台现已发布OpenHIS、OpenCOM、OpenEDU系列开源产品,并持续招募⽣态合作伙伴,期待共同构建开源创新的⾏业协作模式,加速⾏业的数字化进程。 + +天天开源的前⾝是新致开源,最早于2022年6⽉发布开源医疗软件平台OpenHIS.org.cn,于2023年6⽉发布开源企业软件平台OpenCOM.com.cn。2025年7⽉,新致开源品牌更新为天天开源,我们始终秉持开源、专业、协作的理念,致⼒于为医疗、教育、中⼩企业等⾏业提供优质的开源解决⽅案。 + +了解我们:https://open.tntlinking.com/about?site=gitee + +## 💾【部署包下载】 + +请访问官网产品中心下载部署包:https://open.tntlinking.com/resource/productCenter?site=gitee + +## 📚【支持文档】 + +技术支持资源:https://open.tntlinking.com/resource/technicalSupport?site=gitee +(含演示环境、操作手册、部署手册、开发手册、常见问题等) + +产品介绍:https://open.tntlinking.com/resource/industryKnowledge?site=gitee + +操作教程:https://open.tntlinking.com/resource/operationTutorial?site=gitee + +沙龙回顾:https://open.tntlinking.com/resource/openSourceSalon#23?site=gitee + +## 🤝【合作方式】 + +产品服务价格:https://open.tntlinking.com/cost?site=gitee + +加入生态伙伴:https://open.tntlinking.com/ecology/becomePartner?site=gitee + +## 🤗【技术社区】 + +请访问官网扫码加入技术社区交流:https://open.tntlinking.com/ecology/joinCommunity?site=gitee + +请关注公众号【天天开源软件】以便获得最新产品更新信息。 + + + +# 项目介绍 + +OpenHIS医院系统(信创版)集十大核心模块于一体,涵盖目录管理、基础数据配置、个性化设置、门诊/住院全流程管理、药房药库智能管控、精细化耗材管理、财务核算体系、医保合规对接及多维报表分析等功能模块,共计372项标准化功能。 + +系统深度适配民营及公立一二级医院业务场景,支持单体医院、集团化运营及区域医疗协同等多种部署模式,并通过国家信创认证体系,确保全栈技术自主可控。如有项目需求,可联系官方平台合作。 - OpenHis 信创版 ## 运行环境 diff --git a/openhis-server/.gitignore b/openhis-server-new/.gitignore similarity index 100% rename from openhis-server/.gitignore rename to openhis-server-new/.gitignore diff --git a/openhis-server/LICENSE b/openhis-server-new/LICENSE similarity index 100% rename from openhis-server/LICENSE rename to openhis-server-new/LICENSE diff --git a/openhis-server/README.md b/openhis-server-new/README.md similarity index 100% rename from openhis-server/README.md rename to openhis-server-new/README.md diff --git a/openhis-server/core-admin/pom.xml b/openhis-server-new/core-admin/pom.xml similarity index 100% rename from openhis-server/core-admin/pom.xml rename to openhis-server-new/core-admin/pom.xml diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/common/CaptchaController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/common/CaptchaController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/common/CaptchaController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/common/CaptchaController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/common/CommonController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/common/CommonController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/common/CommonController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/common/CommonController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/common/FileUploadController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/common/FileUploadController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/common/FileUploadController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/common/FileUploadController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/monitor/CacheController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/monitor/CacheController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/monitor/CacheController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/monitor/CacheController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/monitor/ServerController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/monitor/ServerController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/monitor/ServerController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/monitor/ServerController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/monitor/SysLogininforController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/monitor/SysLogininforController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/monitor/SysLogininforController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/monitor/SysLogininforController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/monitor/SysOperlogController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/monitor/SysOperlogController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/monitor/SysOperlogController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/monitor/SysOperlogController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/monitor/SysUserOnlineController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/monitor/SysUserOnlineController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/monitor/SysUserOnlineController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/monitor/SysUserOnlineController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysConfigController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysConfigController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysConfigController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysConfigController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysDeptController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysDeptController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysDeptController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysDeptController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysDictDataController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysDictDataController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysDictDataController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysDictDataController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysDictTypeController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysDictTypeController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysDictTypeController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysDictTypeController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysIndexController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysIndexController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysIndexController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysIndexController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysLoginController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysLoginController.java similarity index 97% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysLoginController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysLoginController.java index c13bed723ab01fa7559c9fa2bbdd376d0eddf402..978e48f66051b18088475c2b7f1eecb0b2defe97 100644 --- a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysLoginController.java +++ b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysLoginController.java @@ -21,7 +21,7 @@ import com.core.framework.web.service.SysPermissionService; import com.core.framework.web.service.TokenService; import com.core.system.service.ISysMenuService; -/** +/**已评审 * 登录验证 * * @author system @@ -40,9 +40,9 @@ public class SysLoginController { @Autowired private TokenService tokenService; - /** + /**已评审 * 登录方法 - * + * * @param loginBody 登录信息 * @return 结果 */ @@ -56,7 +56,7 @@ public class SysLoginController { return ajax; } - /** + /**已评审 整个admin合拼到app层 * 获取用户信息 * * @return 用户信息 diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysMenuController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysMenuController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysMenuController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysMenuController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysNoticeController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysNoticeController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysNoticeController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysNoticeController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysPostController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysPostController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysPostController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysPostController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysProfileController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysProfileController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysProfileController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysProfileController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysRegisterController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysRegisterController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysRegisterController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysRegisterController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysRoleController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysRoleController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysRoleController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysRoleController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysTenantController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysTenantController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysTenantController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysTenantController.java diff --git a/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysTenantOptionController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysTenantOptionController.java new file mode 100644 index 0000000000000000000000000000000000000000..103f46632956cebe5ca64a5fdd588104893d2023 --- /dev/null +++ b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysTenantOptionController.java @@ -0,0 +1,60 @@ +package com.core.web.controller.system; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.controller.BaseController; +import com.core.common.core.domain.R; +import com.core.system.domain.dto.SaveTenantOptionDetailDto; +import com.core.system.domain.dto.TenantOptionDto; +import com.core.system.service.ISysTenantOptionService; + +/** + * 租户配置项信息controller + * + * @author system + */ +@RestController +@RequestMapping("/system/tenant-option") +public class SysTenantOptionController extends BaseController { + @Autowired + private ISysTenantOptionService sysTenantOptionService; + + /** + * 查询租户配置项详情列表 + * + * @param tenantId 租户ID + * @return 租户配置项详情列表 + */ + @PreAuthorize("@ss.hasPermi('system:tenant:operate')") + @GetMapping("/detail-list/{tenantId}") + public R> getTenantOptionDetailList(@PathVariable Integer tenantId) { + return R.ok(sysTenantOptionService.getTenantOptionDetailList(tenantId)); + } + + /** + * 保存租户配置项详情列表 + * + * @param saveTenantOptionDetailDto 参数DTO + * @return 结果 + */ + @PreAuthorize("@ss.hasPermi('system:tenant:operate')") + @PostMapping("/detail-list") + public R saveTenantOptionDetailList(@RequestBody SaveTenantOptionDetailDto saveTenantOptionDetailDto) { + return sysTenantOptionService.saveTenantOptionDetailList(saveTenantOptionDetailDto); + } + + /** + * 查询租户配置项前端form表单列表 + * + * @return 租户配置项前端form表单列表 + */ + @PreAuthorize("@ss.hasPermi('system:tenant:operate')") + @GetMapping("/form-list") + public R getTenantOptionFormList() { + return R.ok(sysTenantOptionService.getTenantOptionFormList()); + } +} diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysUserController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysUserController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/system/SysUserController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/system/SysUserController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/controller/tool/TestController.java b/openhis-server-new/core-admin/src/main/java/com/core/web/controller/tool/TestController.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/controller/tool/TestController.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/controller/tool/TestController.java diff --git a/openhis-server/core-admin/src/main/java/com/core/web/core/config/SwaggerConfig.java b/openhis-server-new/core-admin/src/main/java/com/core/web/core/config/SwaggerConfig.java similarity index 100% rename from openhis-server/core-admin/src/main/java/com/core/web/core/config/SwaggerConfig.java rename to openhis-server-new/core-admin/src/main/java/com/core/web/core/config/SwaggerConfig.java diff --git a/openhis-server-new/core-admin/src/main/java/com/core/web/util/TenantOptionUtil.java b/openhis-server-new/core-admin/src/main/java/com/core/web/util/TenantOptionUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..46db6d80741edf29a5004b65cc15b3cea74c67a0 --- /dev/null +++ b/openhis-server-new/core-admin/src/main/java/com/core/web/util/TenantOptionUtil.java @@ -0,0 +1,36 @@ +package com.core.web.util; + +import com.core.common.core.domain.model.LoginUser; +import com.core.common.enums.TenantOptionDict; +import com.core.common.utils.SecurityUtils; + +/** + * 租户配置工具类 + * + * @author system + */ +public class TenantOptionUtil { + + /** + * 获取租户配置项内容 + * + * @param optionDict 租户配置项字典 + * @return 租户配置项内容 + */ + public static String getOptionContent(TenantOptionDict optionDict) { + LoginUser loginUser; + try { + loginUser = SecurityUtils.getLoginUser(); + } catch (Exception e) { + return null; + } + if (loginUser == null) { + return null; + } + if (loginUser.getOptionMap() == null || loginUser.getOptionMap().isEmpty()) { + return null; + } + return loginUser.getOptionMap().get(optionDict.getCode()); + } + +} diff --git a/openhis-server/core-common/pom.xml b/openhis-server-new/core-common/pom.xml similarity index 100% rename from openhis-server/core-common/pom.xml rename to openhis-server-new/core-common/pom.xml diff --git a/openhis-server/core-common/src/main/java/com/core/common/annotation/Anonymous.java b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/Anonymous.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/annotation/Anonymous.java rename to openhis-server-new/core-common/src/main/java/com/core/common/annotation/Anonymous.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/annotation/DataScope.java b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/DataScope.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/annotation/DataScope.java rename to openhis-server-new/core-common/src/main/java/com/core/common/annotation/DataScope.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/annotation/DataSource.java b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/DataSource.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/annotation/DataSource.java rename to openhis-server-new/core-common/src/main/java/com/core/common/annotation/DataSource.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/annotation/Excel.java b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/Excel.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/annotation/Excel.java rename to openhis-server-new/core-common/src/main/java/com/core/common/annotation/Excel.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/annotation/Excels.java b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/Excels.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/annotation/Excels.java rename to openhis-server-new/core-common/src/main/java/com/core/common/annotation/Excels.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/annotation/Log.java b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/Log.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/annotation/Log.java rename to openhis-server-new/core-common/src/main/java/com/core/common/annotation/Log.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/annotation/RateLimiter.java b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/RateLimiter.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/annotation/RateLimiter.java rename to openhis-server-new/core-common/src/main/java/com/core/common/annotation/RateLimiter.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/annotation/RepeatSubmit.java b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/RepeatSubmit.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/annotation/RepeatSubmit.java rename to openhis-server-new/core-common/src/main/java/com/core/common/annotation/RepeatSubmit.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/annotation/Sensitive.java b/openhis-server-new/core-common/src/main/java/com/core/common/annotation/Sensitive.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/annotation/Sensitive.java rename to openhis-server-new/core-common/src/main/java/com/core/common/annotation/Sensitive.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/config/CoreConfig.java b/openhis-server-new/core-common/src/main/java/com/core/common/config/CoreConfig.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/config/CoreConfig.java rename to openhis-server-new/core-common/src/main/java/com/core/common/config/CoreConfig.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/config/serializer/SensitiveJsonSerializer.java b/openhis-server-new/core-common/src/main/java/com/core/common/config/serializer/SensitiveJsonSerializer.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/config/serializer/SensitiveJsonSerializer.java rename to openhis-server-new/core-common/src/main/java/com/core/common/config/serializer/SensitiveJsonSerializer.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/constant/CacheConstants.java b/openhis-server-new/core-common/src/main/java/com/core/common/constant/CacheConstants.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/constant/CacheConstants.java rename to openhis-server-new/core-common/src/main/java/com/core/common/constant/CacheConstants.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/constant/Constants.java b/openhis-server-new/core-common/src/main/java/com/core/common/constant/Constants.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/constant/Constants.java rename to openhis-server-new/core-common/src/main/java/com/core/common/constant/Constants.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/constant/GenConstants.java b/openhis-server-new/core-common/src/main/java/com/core/common/constant/GenConstants.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/constant/GenConstants.java rename to openhis-server-new/core-common/src/main/java/com/core/common/constant/GenConstants.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/constant/HttpStatus.java b/openhis-server-new/core-common/src/main/java/com/core/common/constant/HttpStatus.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/constant/HttpStatus.java rename to openhis-server-new/core-common/src/main/java/com/core/common/constant/HttpStatus.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/constant/ScheduleConstants.java b/openhis-server-new/core-common/src/main/java/com/core/common/constant/ScheduleConstants.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/constant/ScheduleConstants.java rename to openhis-server-new/core-common/src/main/java/com/core/common/constant/ScheduleConstants.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/constant/UserConstants.java b/openhis-server-new/core-common/src/main/java/com/core/common/constant/UserConstants.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/constant/UserConstants.java rename to openhis-server-new/core-common/src/main/java/com/core/common/constant/UserConstants.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/controller/BaseController.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/controller/BaseController.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/controller/BaseController.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/controller/BaseController.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/AjaxResult.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/AjaxResult.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/AjaxResult.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/AjaxResult.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/BaseEntity.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/BaseEntity.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/BaseEntity.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/BaseEntity.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/HisBaseEntity.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/HisBaseEntity.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/HisBaseEntity.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/HisBaseEntity.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/R.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/R.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/R.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/R.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/TreeEntity.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/TreeEntity.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/TreeEntity.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/TreeEntity.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/TreeSelect.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/TreeSelect.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/TreeSelect.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/TreeSelect.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysDept.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysDept.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysDept.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysDept.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysDictData.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysDictData.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysDictData.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysDictData.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysDictType.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysDictType.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysDictType.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysDictType.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysMenu.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysMenu.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysMenu.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysMenu.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysRole.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysRole.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysRole.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysRole.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysUser.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysUser.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/entity/SysUser.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/entity/SysUser.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/model/LoginBody.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/model/LoginBody.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/model/LoginBody.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/model/LoginBody.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/model/LoginUser.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/model/LoginUser.java similarity index 94% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/model/LoginUser.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/model/LoginUser.java index c3c126b4e2fc04095bf5a971808f9fd294440177..fcf6565719b65d936b8928b773b9765878605c29 100644 --- a/openhis-server/core-common/src/main/java/com/core/common/core/domain/model/LoginUser.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/model/LoginUser.java @@ -1,8 +1,11 @@ package com.core.common.core.domain.model; import java.util.Collection; +import java.util.List; +import java.util.Map; import java.util.Set; +import com.core.common.core.domain.entity.SysRole; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; @@ -94,6 +97,16 @@ public class LoginUser implements UserDetails { */ private JSONObject optionJson; + /** + * option Map + */ + private Map optionMap; + + /** + * 当前登录账号角色集合 + */ + private List roleList; + /** * 用户信息 */ diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/model/LoginUserExtend.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/model/LoginUserExtend.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/model/LoginUserExtend.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/model/LoginUserExtend.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/domain/model/RegisterBody.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/domain/model/RegisterBody.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/domain/model/RegisterBody.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/domain/model/RegisterBody.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/page/PageDomain.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/page/PageDomain.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/page/PageDomain.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/page/PageDomain.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/page/TableDataInfo.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/page/TableDataInfo.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/page/TableDataInfo.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/page/TableDataInfo.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/page/TableSupport.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/page/TableSupport.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/page/TableSupport.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/page/TableSupport.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/redis/RedisCache.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/redis/RedisCache.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/redis/RedisCache.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/redis/RedisCache.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/text/CharsetKit.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/text/CharsetKit.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/text/CharsetKit.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/text/CharsetKit.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/text/Convert.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/text/Convert.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/text/Convert.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/text/Convert.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/core/text/StrFormatter.java b/openhis-server-new/core-common/src/main/java/com/core/common/core/text/StrFormatter.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/core/text/StrFormatter.java rename to openhis-server-new/core-common/src/main/java/com/core/common/core/text/StrFormatter.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/enums/BusinessStatus.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/BusinessStatus.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/enums/BusinessStatus.java rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/BusinessStatus.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/enums/BusinessType.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/BusinessType.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/enums/BusinessType.java rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/BusinessType.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/enums/DataSourceType.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/DataSourceType.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/enums/DataSourceType.java rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/DataSourceType.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/enums/DeleteFlag.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/DeleteFlag.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/enums/DeleteFlag.java rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/DeleteFlag.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/enums/DesensitizedType.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/DesensitizedType.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/enums/DesensitizedType.java rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/DesensitizedType.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/enums/HttpMethod.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/HttpMethod.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/enums/HttpMethod.java rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/HttpMethod.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/enums/LimitType.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/LimitType.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/enums/LimitType.java rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/LimitType.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/enums/OperatorType.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/OperatorType.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/enums/OperatorType.java rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/OperatorType.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/enums/TenantOptionDict.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/TenantOptionDict.java similarity index 45% rename from openhis-server/core-common/src/main/java/com/core/common/enums/TenantOptionDict.java rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/TenantOptionDict.java index 898d1efce96c87656231fa75c34b1752d52ab060..e2107993a2f09a6b38bb2fe8bea659eb0b244922 100644 --- a/openhis-server/core-common/src/main/java/com/core/common/enums/TenantOptionDict.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/enums/TenantOptionDict.java @@ -2,173 +2,211 @@ package com.core.common.enums; /** * 租户配置项字典(不存在DB中,以此文件为基准,新增修改只需在这里改) - * + * * @author system */ public enum TenantOptionDict { /** * 医院名称 */ - HOSPITAL_NAME("hospitalName", "医院名称"), + HOSPITAL_NAME("hospitalName", "医院名称", 0), + /** + * 医疗机构等级 + */ + MEDINS_LV("medinsLv", "医疗机构等级", 1), /** * 定点医药机构编号 */ - FIXMEDINS_CODE("fixmedinsCode", "定点医药机构编号"), + FIXMEDINS_CODE("fixmedinsCode", "定点医药机构编号", 2), /** * 电子发票appid */ - APP_ID("app_id", "电子发票appid"), + APP_ID("app_id", "电子发票appid", 3), /** * 电子发票key */ - KEY("key", "电子发票key"), + KEY("key", "电子发票key", 4), /** * 电子发票url */ - URL("url", "电子发票url"), + URL("url", "电子发票url", 5), /** * 医保开关 */ - YB_SWITCH("yb_switch", "医保开关"), + YB_SWITCH("yb_switch", "医保开关", 6), /** * 客户端私钥 */ - CLI_PRV_KEY("cliPrvKey", "客户端私钥"), + CLI_PRV_KEY("cliPrvKey", "客户端私钥", 7), /** * 客户端公钥 */ - CLI_PUB_KEY("cliPubKey", "客户端公钥"), + CLI_PUB_KEY("cliPubKey", "客户端公钥", 8), /** * 服务端公钥 */ - SERVER_PUB_KEY("serverPubKey", "服务端公钥"), + SERVER_PUB_KEY("serverPubKey", "服务端公钥", 9), /** * 定点医药机构名称 */ - FIXMEDINS_NAME("fixmedinsName", "定点医药机构名称"), + FIXMEDINS_NAME("fixmedinsName", "定点医药机构名称", 10), /** * 行政区划 */ - ADMVS("admvs", "行政区划"), + ADMVS("admvs", "行政区划", 11), /** * 授权范围 */ - SCOPE("scope", "授权范围"), + SCOPE("scope", "授权范围", 12), /** * 授权类型 */ - GRANT_TYPE("grantType", "授权类型"), + GRANT_TYPE("grantType", "授权类型", 13), /** * 密码 */ - PASSWORD("password", "密码"), + PASSWORD("password", "密码", 14), /** * 用户名 */ - USERNAME("username", "用户名"), + USERNAME("username", "用户名", 15), /** * 客户端安全码 */ - CLIENT_SECRET("clientSecret", "客户端安全码"), + CLIENT_SECRET("clientSecret", "客户端安全码", 16), /** * 客户端ID */ - CLIENT_ID("clientId", "客户端ID"), + CLIENT_ID("clientId", "客户端ID", 17), /** * 生产环境客户端公钥 */ - PROD_CLI_PUB_KEY("prod_cliPubKey", "生产环境客户端公钥"), + PROD_CLI_PUB_KEY("prod_cliPubKey", "生产环境客户端公钥", 18), /** * 生产环境客户端私钥 */ - PROD_CLI_PRV_KEY("prod_cliPrvKey", "生产环境客户端私钥"), + PROD_CLI_PRV_KEY("prod_cliPrvKey", "生产环境客户端私钥", 19), /** * 生产环境客户端ID */ - PROD_CLIENT_ID("prod_clientId", "生产环境客户端ID"), + PROD_CLIENT_ID("prod_clientId", "生产环境客户端ID", 20), /** * 文件路径 */ - FILE_PATH("filePath", "文件路径"), + FILE_PATH("filePath", "文件路径", 21), /** * 电子地址 */ - ELE_ADDRESS("eleAddress", "电子地址"), + ELE_ADDRESS("eleAddress", "电子地址", 22), /** * 服务地址 */ - ADDRESS("address", "服务地址"), + ADDRESS("address", "服务地址", 23), /** * 超时时间 */ - TIME("time", "超时时间"), + TIME("time", "超时时间", 24), /** * 是否加密 */ - IS_ENCRYPT("isEncrypt", "是否加密"), + IS_ENCRYPT("isEncrypt", "是否加密", 25), /** * 医保区划 */ - INSUPLC_ADMDVS("insuplc_admdvs", "医保区划"), + INSUPLC_ADMDVS("insuplc_admdvs", "医保区划", 26), /** * 电子处方appId */ - PRE_APP_ID("pre_app_id", "电子处方appId"), + PRE_APP_ID("pre_app_id", "电子处方appId", 27), /** * 电子处方appSecret */ - PRE_APP_SECRET("pre_app_secret", "电子处方appSecret"), + PRE_APP_SECRET("pre_app_secret", "电子处方appSecret", 28), /** * 电子处方私钥 */ - APP_PRVKEY("APP_PRVKEY", "电子处方私钥"), + APP_PRVKEY("APP_PRVKEY", "电子处方私钥", 29), /** * 电子处方公钥 */ - PLAF_PUBKEY("PLAF_PUBKEY", "电子处方公钥"), + PLAF_PUBKEY("PLAF_PUBKEY", "电子处方公钥", 30), /** * 医保客户端ID */ - YB_CLIENT_ID("ybClientId", "医保客户端ID"), + YB_CLIENT_ID("ybClientId", "医保客户端ID", 31), /** * 医保客户端安全码 */ - YB_CLIENT_SECRET("ybClientSecret", "医保客户端安全码"), + YB_CLIENT_SECRET("ybClientSecret", "医保客户端安全码", 32), /** * 医保用户名 */ - YB_USERNAME("ybUsername", "医保用户名"), + YB_USERNAME("ybUsername", "医保用户名", 33), /** * 医保密码 */ - YB_PASSWORD("ybPassword", "医保密码"), + YB_PASSWORD("ybPassword", "医保密码", 34), /** * 医保授权类型 */ - YB_GRANT_TYPE("ybGrantType", "医保授权类型"), + YB_GRANT_TYPE("ybGrantType", "医保授权类型", 35), /** * 医保授权范围 */ - YB_SCOPE("ybScope", "医保授权范围"), + YB_SCOPE("ybScope", "医保授权范围", 36), /** * 医保密钥 */ - YB_CLI_PRV_KEY("ybCliPrvKey", "医保密钥"), + YB_CLI_PRV_KEY("ybCliPrvKey", "医保密钥", 37), /** * 医保服务URL */ - YB_URL("ybUrl", "医保服务URL"), + YB_URL("ybUrl", "医保服务URL", 38), /** * 医院等级 */ - HOSPITAL_LV("hospital_lv", "医院等级"); + HOSPITAL_LV("hospital_lv", "医院等级", 39), + /** + * LIS接口地址 + */ + LIS_API_URL("lisApiUrl", "LIS接口地址", 40), + /** + * LISAppId + */ + LIS_APP_ID("lisAppId", "LISAppId", 41), + /** + * LISAppSecret + */ + LIS_APP_SECRET("lisAppSecret", "LISAppSecret", 42), + /** + * PACS接口地址 + */ + PACS_API_URL("pacsApiUrl", "PACS接口地址", 43), + /** + * PACSAppId + */ + PACS_APP_ID("pacsAppId", "PACSAppId", 44), + /** + * PACSAppSecret + */ + PACS_APP_SECRET("pacsAppSecret", "PACSAppSecret", 45), + /** + * PACSAppSecret + */ + INVOICE_URL("invoiceUrl", "电子发票中转服务的路径", 46), + /** + * PACSAppSecret + */ + FORWARD_SWITCH("forwardSwitch", "电子发票中转服务开关", 47); private final String code; private final String name; + private final Integer sort; - TenantOptionDict(String code, String name) { + TenantOptionDict(String code, String name, Integer sort) { this.code = code; this.name = name; + this.sort = sort; } public String getCode() { @@ -179,6 +217,10 @@ public enum TenantOptionDict { return name; } + public Integer getSort() { + return sort; + } + public static TenantOptionDict getByCode(String code) { if (code == null) { return null; diff --git a/openhis-server/core-common/src/main/java/com/core/common/enums/TenantStatus.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/TenantStatus.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/enums/TenantStatus.java rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/TenantStatus.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/enums/UserStatus.java b/openhis-server-new/core-common/src/main/java/com/core/common/enums/UserStatus.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/enums/UserStatus.java rename to openhis-server-new/core-common/src/main/java/com/core/common/enums/UserStatus.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/CustomException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/CustomException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/CustomException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/CustomException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/DemoModeException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/DemoModeException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/DemoModeException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/DemoModeException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/GlobalException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/GlobalException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/GlobalException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/GlobalException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/NonCaptureException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/NonCaptureException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/NonCaptureException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/NonCaptureException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/ServiceException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/ServiceException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/ServiceException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/ServiceException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/UtilException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/UtilException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/UtilException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/UtilException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/base/BaseException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/base/BaseException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/base/BaseException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/base/BaseException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/file/FileException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/file/FileException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/file/FileException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/file/FileException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/file/FileNameLengthLimitExceededException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/file/FileNameLengthLimitExceededException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/file/FileNameLengthLimitExceededException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/file/FileNameLengthLimitExceededException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/file/FileSizeLimitExceededException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/file/FileSizeLimitExceededException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/file/FileSizeLimitExceededException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/file/FileSizeLimitExceededException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/file/FileUploadException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/file/FileUploadException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/file/FileUploadException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/file/FileUploadException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/file/InvalidExtensionException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/file/InvalidExtensionException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/file/InvalidExtensionException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/file/InvalidExtensionException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/job/TaskException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/job/TaskException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/job/TaskException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/job/TaskException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/user/BlackListException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/user/BlackListException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/user/BlackListException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/user/BlackListException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/user/CaptchaException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/user/CaptchaException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/user/CaptchaException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/user/CaptchaException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/user/CaptchaExpireException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/user/CaptchaExpireException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/user/CaptchaExpireException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/user/CaptchaExpireException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/user/UserException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/user/UserException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/user/UserException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/user/UserException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/user/UserNotExistsException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/user/UserNotExistsException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/user/UserNotExistsException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/user/UserNotExistsException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/user/UserPasswordNotMatchException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/user/UserPasswordNotMatchException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/user/UserPasswordNotMatchException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/user/UserPasswordNotMatchException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/exception/user/UserPasswordRetryLimitExceedException.java b/openhis-server-new/core-common/src/main/java/com/core/common/exception/user/UserPasswordRetryLimitExceedException.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/exception/user/UserPasswordRetryLimitExceedException.java rename to openhis-server-new/core-common/src/main/java/com/core/common/exception/user/UserPasswordRetryLimitExceedException.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/filter/PropertyPreExcludeFilter.java b/openhis-server-new/core-common/src/main/java/com/core/common/filter/PropertyPreExcludeFilter.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/filter/PropertyPreExcludeFilter.java rename to openhis-server-new/core-common/src/main/java/com/core/common/filter/PropertyPreExcludeFilter.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/filter/RepeatableFilter.java b/openhis-server-new/core-common/src/main/java/com/core/common/filter/RepeatableFilter.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/filter/RepeatableFilter.java rename to openhis-server-new/core-common/src/main/java/com/core/common/filter/RepeatableFilter.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/filter/RepeatedlyRequestWrapper.java b/openhis-server-new/core-common/src/main/java/com/core/common/filter/RepeatedlyRequestWrapper.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/filter/RepeatedlyRequestWrapper.java rename to openhis-server-new/core-common/src/main/java/com/core/common/filter/RepeatedlyRequestWrapper.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/filter/XssFilter.java b/openhis-server-new/core-common/src/main/java/com/core/common/filter/XssFilter.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/filter/XssFilter.java rename to openhis-server-new/core-common/src/main/java/com/core/common/filter/XssFilter.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/filter/XssHttpServletRequestWrapper.java b/openhis-server-new/core-common/src/main/java/com/core/common/filter/XssHttpServletRequestWrapper.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/filter/XssHttpServletRequestWrapper.java rename to openhis-server-new/core-common/src/main/java/com/core/common/filter/XssHttpServletRequestWrapper.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/AgeCalculatorUtil.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/AgeCalculatorUtil.java similarity index 80% rename from openhis-server/core-common/src/main/java/com/core/common/utils/AgeCalculatorUtil.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/AgeCalculatorUtil.java index 2a43840bcf540f25197dbeb6adb1c4ed96b2777e..142b9eb6884f6faad0719e6802725a97382939d6 100644 --- a/openhis-server/core-common/src/main/java/com/core/common/utils/AgeCalculatorUtil.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/utils/AgeCalculatorUtil.java @@ -1,5 +1,6 @@ package com.core.common.utils; +import java.time.LocalDate; import java.time.LocalDateTime; import java.time.Period; import java.time.ZoneId; @@ -14,6 +15,24 @@ import java.util.Date; */ public final class AgeCalculatorUtil { + /** + * 计算年龄 + * + * @param birthDate 生日 + * @return 年龄 + */ + public static int calculateAge(Date birthDate) { + if (birthDate == null) { + return 0; + } + // 将Date转换为LocalDate(需指定时区) + LocalDate birthLocalDate = birthDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate currentDate = LocalDate.now(); + // 计算两个日期之间的Period + Period period = Period.between(birthLocalDate, currentDate); + return period.getYears(); + } + /** * 当前年龄取得(床位列表表示年龄用) */ @@ -29,7 +48,7 @@ public final class AgeCalculatorUtil { Period period = Period.between(dateTime.toLocalDate(), now.toLocalDate()); int months = period.getMonths(); int days = period.getDays(); - long hours = ChronoUnit.HOURS.between(dateTime, now) - (days * 24); + long hours = ChronoUnit.HOURS.between(dateTime, now) - (days * 24L); if (hours < 0) { hours += 24; diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/Arith.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/Arith.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/Arith.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/Arith.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/AssignSeqUtil.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/AssignSeqUtil.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/AssignSeqUtil.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/AssignSeqUtil.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/ChineseConvertUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/ChineseConvertUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/ChineseConvertUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/ChineseConvertUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/DateUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/DateUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/DateUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/DateUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/DesensitizedUtil.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/DesensitizedUtil.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/DesensitizedUtil.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/DesensitizedUtil.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/DictUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/DictUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/DictUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/DictUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/ExceptionUtil.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/ExceptionUtil.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/ExceptionUtil.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/ExceptionUtil.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/LogUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/LogUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/LogUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/LogUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/MessageUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/MessageUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/MessageUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/MessageUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/PageUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/PageUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/PageUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/PageUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/SecurityUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/SecurityUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/SecurityUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/SecurityUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/ServletUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/ServletUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/ServletUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/ServletUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/SpringContextUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/SpringContextUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/SpringContextUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/SpringContextUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/StringUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/StringUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/StringUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/StringUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/Threads.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/Threads.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/Threads.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/Threads.java diff --git a/openhis-server-new/core-common/src/main/java/com/core/common/utils/TimeUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/TimeUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..0fa7219408d0f3259b8181ff3df01f63ce8a6040 --- /dev/null +++ b/openhis-server-new/core-common/src/main/java/com/core/common/utils/TimeUtils.java @@ -0,0 +1,90 @@ +package com.core.common.utils; + +import org.apache.commons.lang3.time.DateFormatUtils; + +import java.lang.management.ManagementFactory; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.*; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.util.Calendar; +import java.util.Date; + + +/** + * 时间处理工具类 + */ +public class TimeUtils { + private static final ZoneId DEFAULT_ZONE = ZoneId.systemDefault(); + private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss"); + private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(DEFAULT_ZONE); + + /** + * 解析时间字符串 + */ + public static LocalTime parseTime(String timeStr) { + if (timeStr == null) { + throw new IllegalArgumentException("时间未设定"); + } + + try { + if (timeStr.length() == 4) { + // 处理"0200"格式 + int hours = Integer.parseInt(timeStr.substring(0, 2)); + int minutes = Integer.parseInt(timeStr.substring(2, 4)); + return LocalTime.of(hours, minutes); + } else if (timeStr.contains(":")) { + // 处理"HH:mm"格式 + return LocalTime.parse(timeStr, DateTimeFormatter.ofPattern("HH:mm")); + } else { + throw new IllegalArgumentException("不支持的时间格式: " + timeStr); + } + } catch (Exception e) { + throw new RuntimeException("时间解析失败: " + timeStr, e); + } + } + + /** + * LocalTime转Date + */ + public static Date localTimeToDate(LocalTime localTime) { + LocalDateTime localDateTime = LocalDateTime.of(LocalDate.now(), localTime); + return Date.from(localDateTime.atZone(DEFAULT_ZONE).toInstant()); + } + + /** + * Date转LocalDate + */ + public static LocalDate dateToLocalDate(Date date) { + return date.toInstant().atZone(DEFAULT_ZONE).toLocalDate(); + } + + /** + * Date转字符串(HH:mm:ss) + */ + public static String dateToTimeString(Date date) { + return date.toInstant() + .atZone(DEFAULT_ZONE) + .toLocalTime() + .format(TIME_FORMATTER); + } + + /** + * Date转字符串(yyyy-MM-dd) + */ + public static String dateToDateString(Date date) { + return date.toInstant() + .atZone(DEFAULT_ZONE) + .toLocalDate() + .format(DATE_FORMATTER); + } + + /** + * 解析日期时间字符串 + */ + public static LocalDateTime parseDateTime(String dateStr) { + return LocalDateTime.parse(dateStr, DATE_TIME_FORMATTER); + } +} diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/bean/BeanUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/bean/BeanUtils.java similarity index 91% rename from openhis-server/core-common/src/main/java/com/core/common/utils/bean/BeanUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/bean/BeanUtils.java index 8ef51023cb9919b5973cef23af8cc364cce2f2e0..87d882273f02ead00a67061a298e778da540848b 100644 --- a/openhis-server/core-common/src/main/java/com/core/common/utils/bean/BeanUtils.java +++ b/openhis-server-new/core-common/src/main/java/com/core/common/utils/bean/BeanUtils.java @@ -8,24 +8,30 @@ import java.util.regex.Pattern; /** * Bean 工具类 - * + * * @author system */ public class BeanUtils extends org.springframework.beans.BeanUtils { - /** Bean方法名中属性名开始的下标 */ + /** + * Bean方法名中属性名开始的下标 + */ private static final int BEAN_METHOD_PROP_INDEX = 3; - /** * 匹配getter方法的正则表达式 */ + /** + * 匹配getter方法的正则表达式 + */ private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)"); - /** * 匹配setter方法的正则表达式 */ + /** + * 匹配setter方法的正则表达式 + */ private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)"); /** * Bean属性复制工具方法。 - * + * * @param dest 目标对象 - * @param src 源对象 + * @param src 源对象 */ public static void copyBeanProp(Object dest, Object src) { try { @@ -37,7 +43,7 @@ public class BeanUtils extends org.springframework.beans.BeanUtils { /** * 获取对象的setter方法。 - * + * * @param obj 对象 * @return 对象的setter方法列表 */ @@ -62,7 +68,7 @@ public class BeanUtils extends org.springframework.beans.BeanUtils { /** * 获取对象的getter方法。 - * + * * @param obj 对象 * @return 对象的getter方法列表 */ @@ -86,7 +92,7 @@ public class BeanUtils extends org.springframework.beans.BeanUtils { /** * 检查Bean方法名中的属性名是否相等。
* 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。 - * + * * @param m1 方法名1 * @param m2 方法名2 * @return 属性名一样返回true,否则返回false diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/bean/BeanValidators.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/bean/BeanValidators.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/bean/BeanValidators.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/bean/BeanValidators.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/file/FileTypeUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/file/FileTypeUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/file/FileTypeUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/file/FileTypeUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/file/FileUploadUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/file/FileUploadUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/file/FileUploadUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/file/FileUploadUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/file/FileUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/file/FileUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/file/FileUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/file/FileUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/file/ImageUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/file/ImageUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/file/ImageUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/file/ImageUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/file/MimeTypeUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/file/MimeTypeUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/file/MimeTypeUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/file/MimeTypeUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/html/EscapeUtil.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/html/EscapeUtil.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/html/EscapeUtil.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/html/EscapeUtil.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/html/HTMLFilter.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/html/HTMLFilter.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/html/HTMLFilter.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/html/HTMLFilter.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/http/HttpHelper.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/http/HttpHelper.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/http/HttpHelper.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/http/HttpHelper.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/http/HttpUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/http/HttpUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/http/HttpUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/http/HttpUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/ip/AddressUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/ip/AddressUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/ip/AddressUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/ip/AddressUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/ip/IpUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/ip/IpUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/ip/IpUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/ip/IpUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/poi/ExcelHandlerAdapter.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/poi/ExcelHandlerAdapter.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/poi/ExcelHandlerAdapter.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/poi/ExcelHandlerAdapter.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/poi/ExcelUtil.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/poi/ExcelUtil.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/poi/ExcelUtil.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/poi/ExcelUtil.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/reflect/ReflectUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/reflect/ReflectUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/reflect/ReflectUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/reflect/ReflectUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/sign/Base64.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/sign/Base64.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/sign/Base64.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/sign/Base64.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/sign/Md5Utils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/sign/Md5Utils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/sign/Md5Utils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/sign/Md5Utils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/spring/SpringUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/spring/SpringUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/spring/SpringUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/spring/SpringUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/sql/SqlUtil.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/sql/SqlUtil.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/sql/SqlUtil.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/sql/SqlUtil.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/uuid/IdUtils.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/uuid/IdUtils.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/uuid/IdUtils.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/uuid/IdUtils.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/uuid/Seq.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/uuid/Seq.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/uuid/Seq.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/uuid/Seq.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/utils/uuid/UUID.java b/openhis-server-new/core-common/src/main/java/com/core/common/utils/uuid/UUID.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/utils/uuid/UUID.java rename to openhis-server-new/core-common/src/main/java/com/core/common/utils/uuid/UUID.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/xss/Xss.java b/openhis-server-new/core-common/src/main/java/com/core/common/xss/Xss.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/xss/Xss.java rename to openhis-server-new/core-common/src/main/java/com/core/common/xss/Xss.java diff --git a/openhis-server/core-common/src/main/java/com/core/common/xss/XssValidator.java b/openhis-server-new/core-common/src/main/java/com/core/common/xss/XssValidator.java similarity index 100% rename from openhis-server/core-common/src/main/java/com/core/common/xss/XssValidator.java rename to openhis-server-new/core-common/src/main/java/com/core/common/xss/XssValidator.java diff --git a/openhis-server/core-flowable/pom.xml b/openhis-server-new/core-flowable/pom.xml similarity index 100% rename from openhis-server/core-flowable/pom.xml rename to openhis-server-new/core-flowable/pom.xml diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/common/constant/ProcessConstants.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/common/constant/ProcessConstants.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/common/constant/ProcessConstants.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/common/constant/ProcessConstants.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/common/enums/FlowComment.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/common/enums/FlowComment.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/common/enums/FlowComment.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/common/enums/FlowComment.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/common/expand/el/BaseEl.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/common/expand/el/BaseEl.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/common/expand/el/BaseEl.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/common/expand/el/BaseEl.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/common/expand/el/FlowEl.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/common/expand/el/FlowEl.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/common/expand/el/FlowEl.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/common/expand/el/FlowEl.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/config/FlowableConfig.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/config/FlowableConfig.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/config/FlowableConfig.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/config/FlowableConfig.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/controller/FlowDefinitionController.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowDefinitionController.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/controller/FlowDefinitionController.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowDefinitionController.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/controller/FlowInstanceController.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowInstanceController.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/controller/FlowInstanceController.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowInstanceController.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/controller/FlowTaskController.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowTaskController.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/controller/FlowTaskController.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/FlowTaskController.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/controller/SysExpressionController.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/SysExpressionController.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/controller/SysExpressionController.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/SysExpressionController.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/controller/SysFormController.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/SysFormController.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/controller/SysFormController.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/SysFormController.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/controller/SysListenerController.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/SysListenerController.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/controller/SysListenerController.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/controller/SysListenerController.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowCommentDto.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowCommentDto.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowCommentDto.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowCommentDto.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowFromFieldDTO.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowFromFieldDTO.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowFromFieldDTO.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowFromFieldDTO.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowNextDto.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowNextDto.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowNextDto.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowNextDto.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowSaveXmlVo.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowSaveXmlVo.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowSaveXmlVo.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowSaveXmlVo.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowTaskDto.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowTaskDto.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowTaskDto.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowTaskDto.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowViewerDto.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowViewerDto.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowViewerDto.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/dto/FlowViewerDto.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/domain/vo/FlowQueryVo.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/vo/FlowQueryVo.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/domain/vo/FlowQueryVo.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/vo/FlowQueryVo.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/domain/vo/FlowTaskVo.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/vo/FlowTaskVo.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/domain/vo/FlowTaskVo.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/vo/FlowTaskVo.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/domain/vo/ReturnTaskNodeVo.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/vo/ReturnTaskNodeVo.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/domain/vo/ReturnTaskNodeVo.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/domain/vo/ReturnTaskNodeVo.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/factory/FlowServiceFactory.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/factory/FlowServiceFactory.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/factory/FlowServiceFactory.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/factory/FlowServiceFactory.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/flow/CustomProcessDiagramCanvas.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/CustomProcessDiagramCanvas.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/flow/CustomProcessDiagramCanvas.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/CustomProcessDiagramCanvas.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/flow/CustomProcessDiagramGenerator.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/CustomProcessDiagramGenerator.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/flow/CustomProcessDiagramGenerator.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/CustomProcessDiagramGenerator.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/flow/FindNextNodeUtil.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/FindNextNodeUtil.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/flow/FindNextNodeUtil.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/FindNextNodeUtil.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/flow/FlowableUtils.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/FlowableUtils.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/flow/FlowableUtils.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/flow/FlowableUtils.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/listener/FlowExecutionListener.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/listener/FlowExecutionListener.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/listener/FlowExecutionListener.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/listener/FlowExecutionListener.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/listener/FlowTaskListener.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/listener/FlowTaskListener.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/listener/FlowTaskListener.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/listener/FlowTaskListener.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/service/IFlowDefinitionService.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/IFlowDefinitionService.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/service/IFlowDefinitionService.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/IFlowDefinitionService.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/service/IFlowInstanceService.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/IFlowInstanceService.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/service/IFlowInstanceService.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/IFlowInstanceService.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/service/IFlowTaskService.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/IFlowTaskService.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/service/IFlowTaskService.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/IFlowTaskService.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/service/ISysDeployFormService.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/ISysDeployFormService.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/service/ISysDeployFormService.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/ISysDeployFormService.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/service/ISysFormService.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/ISysFormService.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/service/ISysFormService.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/ISysFormService.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/service/impl/FlowDefinitionServiceImpl.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowDefinitionServiceImpl.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/service/impl/FlowDefinitionServiceImpl.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowDefinitionServiceImpl.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/service/impl/FlowInstanceServiceImpl.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowInstanceServiceImpl.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/service/impl/FlowInstanceServiceImpl.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowInstanceServiceImpl.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/service/impl/FlowTaskServiceImpl.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowTaskServiceImpl.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/service/impl/FlowTaskServiceImpl.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/FlowTaskServiceImpl.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/service/impl/SysDeployFormServiceImpl.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/SysDeployFormServiceImpl.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/service/impl/SysDeployFormServiceImpl.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/SysDeployFormServiceImpl.java diff --git a/openhis-server/core-flowable/src/main/java/com/core/flowable/service/impl/SysFormServiceImpl.java b/openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/SysFormServiceImpl.java similarity index 100% rename from openhis-server/core-flowable/src/main/java/com/core/flowable/service/impl/SysFormServiceImpl.java rename to openhis-server-new/core-flowable/src/main/java/com/core/flowable/service/impl/SysFormServiceImpl.java diff --git a/openhis-server/core-framework/pom.xml b/openhis-server-new/core-framework/pom.xml similarity index 100% rename from openhis-server/core-framework/pom.xml rename to openhis-server-new/core-framework/pom.xml diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/DataScopeAspect.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/aspectj/DataScopeAspect.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/aspectj/DataScopeAspect.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/aspectj/DataScopeAspect.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/DataSourceAspect.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/aspectj/DataSourceAspect.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/aspectj/DataSourceAspect.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/aspectj/DataSourceAspect.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/LogAspect.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/aspectj/LogAspect.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/aspectj/LogAspect.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/aspectj/LogAspect.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/RateLimiterAspect.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/aspectj/RateLimiterAspect.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/aspectj/RateLimiterAspect.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/aspectj/RateLimiterAspect.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/aspectj/TransactionAspect.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/ApplicationConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/ApplicationConfig.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/ApplicationConfig.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/ApplicationConfig.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/CaptchaConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/CaptchaConfig.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/CaptchaConfig.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/CaptchaConfig.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/DruidConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/DruidConfig.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/DruidConfig.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/DruidConfig.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/FastJson2JsonRedisSerializer.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/FastJson2JsonRedisSerializer.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/FastJson2JsonRedisSerializer.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/FastJson2JsonRedisSerializer.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/FilterConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/FilterConfig.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/FilterConfig.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/FilterConfig.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/I18nConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/I18nConfig.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/I18nConfig.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/I18nConfig.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/KaptchaTextCreator.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/KaptchaTextCreator.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/KaptchaTextCreator.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/KaptchaTextCreator.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/MybatisPlusConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/MybatisPlusConfig.java similarity index 96% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/MybatisPlusConfig.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/MybatisPlusConfig.java index b87817b239aa0cb28457ba0a743f982d92392488..1c1d5661c3c9e82fe29aba9a9066e0e4a4f25f49 100644 --- a/openhis-server/core-framework/src/main/java/com/core/framework/config/MybatisPlusConfig.java +++ b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/MybatisPlusConfig.java @@ -95,8 +95,8 @@ public class MybatisPlusConfig { "adm_patient_identifier", "adm_practitioner", "adm_practitioner_role", "adm_supplier", "cli_condition", "cli_condition_definition", "cli_diagnosis_belong_binding", "cli_procedure", "cli_procedure_performer", "doc_emr", "doc_emr_template", "doc_emr_detail", "doc_emr_dict", "fin_claim", "fin_claim_response", - "fin_contract", "fin_payment_notice", "fin_payment_rec_detail", "fin_payment_reconciliation", - "med_medication", "med_medication_definition", "med_medication_dispense", "med_medication_request", + "fin_payment_notice", "fin_payment_rec_detail", "fin_payment_reconciliation", "med_medication", + "med_medication_definition", "med_medication_dispense", "med_medication_request", "wor_activity_definition", "wor_device_dispense", "wor_device_request", "wor_inventory_item", "wor_service_request", "wor_service_request_detail", "wor_supply_delivery", "wor_supply_request", "sys_operation_record")); diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/RedisConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/RedisConfig.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/RedisConfig.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/RedisConfig.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/ResourcesConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/ResourcesConfig.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/ResourcesConfig.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/ResourcesConfig.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/SecurityConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/SecurityConfig.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/SecurityConfig.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/SecurityConfig.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/ServerConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/ServerConfig.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/ServerConfig.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/ServerConfig.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/TenantContext.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/TenantContext.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/TenantContext.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/TenantContext.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/ThreadPoolConfig.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/ThreadPoolConfig.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/ThreadPoolConfig.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/ThreadPoolConfig.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/properties/DruidProperties.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/properties/DruidProperties.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/properties/DruidProperties.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/properties/DruidProperties.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/config/properties/PermitAllUrlProperties.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/config/properties/PermitAllUrlProperties.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/config/properties/PermitAllUrlProperties.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/config/properties/PermitAllUrlProperties.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/datasource/DynamicDataSource.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/datasource/DynamicDataSource.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/datasource/DynamicDataSource.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/datasource/DynamicDataSource.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/datasource/DynamicDataSourceContextHolder.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/datasource/DynamicDataSourceContextHolder.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/datasource/DynamicDataSourceContextHolder.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/datasource/DynamicDataSourceContextHolder.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/handler/MybastisColumnsHandler.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/handler/MybastisColumnsHandler.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/handler/MybastisColumnsHandler.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/handler/MybastisColumnsHandler.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/interceptor/RepeatSubmitInterceptor.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/interceptor/RepeatSubmitInterceptor.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/interceptor/RepeatSubmitInterceptor.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/interceptor/RepeatSubmitInterceptor.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/interceptor/impl/SameUrlDataInterceptor.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/interceptor/impl/SameUrlDataInterceptor.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/interceptor/impl/SameUrlDataInterceptor.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/interceptor/impl/SameUrlDataInterceptor.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/manager/AsyncManager.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/manager/AsyncManager.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/manager/AsyncManager.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/manager/AsyncManager.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/manager/ShutdownManager.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/manager/ShutdownManager.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/manager/ShutdownManager.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/manager/ShutdownManager.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/manager/factory/AsyncFactory.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/manager/factory/AsyncFactory.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/manager/factory/AsyncFactory.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/manager/factory/AsyncFactory.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/security/context/AuthenticationContextHolder.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/security/context/AuthenticationContextHolder.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/security/context/AuthenticationContextHolder.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/security/context/AuthenticationContextHolder.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/security/context/PermissionContextHolder.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/security/context/PermissionContextHolder.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/security/context/PermissionContextHolder.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/security/context/PermissionContextHolder.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/security/filter/JwtAuthenticationTokenFilter.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/security/filter/JwtAuthenticationTokenFilter.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/security/filter/JwtAuthenticationTokenFilter.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/security/filter/JwtAuthenticationTokenFilter.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/security/handle/AuthenticationEntryPointImpl.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/security/handle/AuthenticationEntryPointImpl.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/security/handle/AuthenticationEntryPointImpl.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/security/handle/AuthenticationEntryPointImpl.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/security/handle/LogoutSuccessHandlerImpl.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/security/handle/LogoutSuccessHandlerImpl.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/security/handle/LogoutSuccessHandlerImpl.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/security/handle/LogoutSuccessHandlerImpl.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/domain/Server.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/Server.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/domain/Server.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/Server.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/domain/server/Cpu.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/server/Cpu.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/domain/server/Cpu.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/server/Cpu.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/domain/server/Jvm.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/server/Jvm.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/domain/server/Jvm.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/server/Jvm.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/domain/server/Mem.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/server/Mem.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/domain/server/Mem.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/server/Mem.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/domain/server/Sys.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/server/Sys.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/domain/server/Sys.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/server/Sys.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/domain/server/SysFile.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/server/SysFile.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/domain/server/SysFile.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/domain/server/SysFile.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/exception/GlobalExceptionHandler.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/exception/GlobalExceptionHandler.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/exception/GlobalExceptionHandler.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/exception/GlobalExceptionHandler.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/service/PermissionService.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/PermissionService.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/service/PermissionService.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/PermissionService.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/service/SysLoginService.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysLoginService.java similarity index 94% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/service/SysLoginService.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysLoginService.java index 97a3ed963057ccb0c56ebae7a66d6fc53b1a54ae..42ed21725a1944e0553ceb45224123e07d3a61c1 100644 --- a/openhis-server/core-framework/src/main/java/com/core/framework/web/service/SysLoginService.java +++ b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysLoginService.java @@ -18,6 +18,7 @@ import com.core.common.constant.CacheConstants; import com.core.common.constant.Constants; import com.core.common.constant.UserConstants; import com.core.common.core.domain.R; +import com.core.common.core.domain.entity.SysRole; import com.core.common.core.domain.entity.SysUser; import com.core.common.core.domain.model.LoginUser; import com.core.common.core.domain.model.LoginUserExtend; @@ -35,6 +36,7 @@ import com.core.framework.manager.factory.AsyncFactory; import com.core.framework.security.context.AuthenticationContextHolder; import com.core.system.domain.SysTenant; import com.core.system.service.ISysConfigService; +import com.core.system.service.ISysTenantOptionService; import com.core.system.service.ISysTenantService; import com.core.system.service.ISysUserService; @@ -63,6 +65,9 @@ public class SysLoginService { @Autowired private ISysTenantService sysTenantService; + @Autowired + private ISysTenantOptionService sysTenantOptionService; + /** * 登录验证 * @@ -146,6 +151,10 @@ public class SysLoginService { loginUser.getUser().setOrgId(loginUserExtend.getOrgId()); // 科室id loginUser.getUser().setOrgName(loginUserExtend.getOrgName()); // 科室名称 } + List roleList = userService.getRoleList(loginUser.getUserId()); + if (!roleList.isEmpty()) { + loginUser.setRoleList(roleList); + } // 设置租户ID loginUser.getUser().setTenantId(tenantId); @@ -163,6 +172,12 @@ public class SysLoginService { optionJson.put(key, value); } loginUser.setOptionJson(optionJson); + + // TODO:下面的配置项启用后,上面option集合处理注释掉 + + // 全部租户配置项 + Map optionMap = sysTenantOptionService.getAllTenantOption(tenantId); + loginUser.setOptionMap(optionMap); } /** diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/service/SysPasswordService.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysPasswordService.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/service/SysPasswordService.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysPasswordService.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/service/SysPermissionService.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysPermissionService.java similarity index 99% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/service/SysPermissionService.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysPermissionService.java index 3e69fae760af185374cb0d0ba669a2c3493bba36..f8815c02ddbc173b0c071e1b59d9cc1ddaa57830 100644 --- a/openhis-server/core-framework/src/main/java/com/core/framework/web/service/SysPermissionService.java +++ b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysPermissionService.java @@ -17,7 +17,7 @@ import com.core.system.service.ISysRoleService; /** * 用户权限处理 - * + * * @author system */ @Component @@ -30,7 +30,7 @@ public class SysPermissionService { /** * 获取角色数据权限 - * + * * @param user 用户信息 * @return 角色权限信息 */ @@ -47,7 +47,7 @@ public class SysPermissionService { /** * 获取菜单数据权限 - * + * * @param user 用户信息 * @return 菜单权限信息 */ diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/service/SysRegisterService.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysRegisterService.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/service/SysRegisterService.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/SysRegisterService.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/service/TokenService.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/TokenService.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/service/TokenService.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/TokenService.java diff --git a/openhis-server/core-framework/src/main/java/com/core/framework/web/service/UserDetailsServiceImpl.java b/openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/UserDetailsServiceImpl.java similarity index 100% rename from openhis-server/core-framework/src/main/java/com/core/framework/web/service/UserDetailsServiceImpl.java rename to openhis-server-new/core-framework/src/main/java/com/core/framework/web/service/UserDetailsServiceImpl.java diff --git a/openhis-server/core-generator/pom.xml b/openhis-server-new/core-generator/pom.xml similarity index 100% rename from openhis-server/core-generator/pom.xml rename to openhis-server-new/core-generator/pom.xml diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/config/GenConfig.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/config/GenConfig.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/config/GenConfig.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/config/GenConfig.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/controller/GenController.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/controller/GenController.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/controller/GenController.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/controller/GenController.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/domain/GenTable.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/domain/GenTable.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/domain/GenTable.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/domain/GenTable.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/domain/GenTableColumn.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/domain/GenTableColumn.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/domain/GenTableColumn.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/domain/GenTableColumn.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/mapper/GenTableColumnMapper.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/mapper/GenTableColumnMapper.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/mapper/GenTableColumnMapper.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/mapper/GenTableColumnMapper.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/mapper/GenTableMapper.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/mapper/GenTableMapper.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/mapper/GenTableMapper.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/mapper/GenTableMapper.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/service/GenTableColumnServiceImpl.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/service/GenTableColumnServiceImpl.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/service/GenTableColumnServiceImpl.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/service/GenTableColumnServiceImpl.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/service/GenTableServiceImpl.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/service/GenTableServiceImpl.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/service/GenTableServiceImpl.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/service/GenTableServiceImpl.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/service/IGenTableColumnService.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/service/IGenTableColumnService.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/service/IGenTableColumnService.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/service/IGenTableColumnService.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/service/IGenTableService.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/service/IGenTableService.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/service/IGenTableService.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/service/IGenTableService.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/util/GenUtils.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/util/GenUtils.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/util/GenUtils.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/util/GenUtils.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/util/VelocityInitializer.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/util/VelocityInitializer.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/util/VelocityInitializer.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/util/VelocityInitializer.java diff --git a/openhis-server/core-generator/src/main/java/com/core/generator/util/VelocityUtils.java b/openhis-server-new/core-generator/src/main/java/com/core/generator/util/VelocityUtils.java similarity index 100% rename from openhis-server/core-generator/src/main/java/com/core/generator/util/VelocityUtils.java rename to openhis-server-new/core-generator/src/main/java/com/core/generator/util/VelocityUtils.java diff --git a/openhis-server/core-generator/src/main/resources/generator.yml b/openhis-server-new/core-generator/src/main/resources/generator.yml similarity index 100% rename from openhis-server/core-generator/src/main/resources/generator.yml rename to openhis-server-new/core-generator/src/main/resources/generator.yml diff --git a/openhis-server/core-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/openhis-server-new/core-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml similarity index 100% rename from openhis-server/core-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml rename to openhis-server-new/core-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml diff --git a/openhis-server/core-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/openhis-server-new/core-generator/src/main/resources/mapper/generator/GenTableMapper.xml similarity index 100% rename from openhis-server/core-generator/src/main/resources/mapper/generator/GenTableMapper.xml rename to openhis-server-new/core-generator/src/main/resources/mapper/generator/GenTableMapper.xml diff --git a/openhis-server/core-generator/src/main/resources/vm/java/domain.java.vm b/openhis-server-new/core-generator/src/main/resources/vm/java/domain.java.vm similarity index 100% rename from openhis-server/core-generator/src/main/resources/vm/java/domain.java.vm rename to openhis-server-new/core-generator/src/main/resources/vm/java/domain.java.vm diff --git a/openhis-server/core-generator/src/main/resources/vm/java/mapper.java.vm b/openhis-server-new/core-generator/src/main/resources/vm/java/mapper.java.vm similarity index 100% rename from openhis-server/core-generator/src/main/resources/vm/java/mapper.java.vm rename to openhis-server-new/core-generator/src/main/resources/vm/java/mapper.java.vm diff --git a/openhis-server/core-generator/src/main/resources/vm/java/service.java.vm b/openhis-server-new/core-generator/src/main/resources/vm/java/service.java.vm similarity index 100% rename from openhis-server/core-generator/src/main/resources/vm/java/service.java.vm rename to openhis-server-new/core-generator/src/main/resources/vm/java/service.java.vm diff --git a/openhis-server/core-generator/src/main/resources/vm/java/serviceImpl.java.vm b/openhis-server-new/core-generator/src/main/resources/vm/java/serviceImpl.java.vm similarity index 100% rename from openhis-server/core-generator/src/main/resources/vm/java/serviceImpl.java.vm rename to openhis-server-new/core-generator/src/main/resources/vm/java/serviceImpl.java.vm diff --git a/openhis-server/core-generator/src/main/resources/vm/xml/mapper.xml.vm b/openhis-server-new/core-generator/src/main/resources/vm/xml/mapper.xml.vm similarity index 100% rename from openhis-server/core-generator/src/main/resources/vm/xml/mapper.xml.vm rename to openhis-server-new/core-generator/src/main/resources/vm/xml/mapper.xml.vm diff --git a/openhis-server/core-quartz/pom.xml b/openhis-server-new/core-quartz/pom.xml similarity index 100% rename from openhis-server/core-quartz/pom.xml rename to openhis-server-new/core-quartz/pom.xml diff --git a/openhis-server/core-quartz/src/main/java/com/core/quartz/domain/SysJob.java b/openhis-server-new/core-quartz/src/main/java/com/core/quartz/domain/SysJob.java similarity index 100% rename from openhis-server/core-quartz/src/main/java/com/core/quartz/domain/SysJob.java rename to openhis-server-new/core-quartz/src/main/java/com/core/quartz/domain/SysJob.java diff --git a/openhis-server/core-quartz/src/main/java/com/core/quartz/domain/SysJobLog.java b/openhis-server-new/core-quartz/src/main/java/com/core/quartz/domain/SysJobLog.java similarity index 100% rename from openhis-server/core-quartz/src/main/java/com/core/quartz/domain/SysJobLog.java rename to openhis-server-new/core-quartz/src/main/java/com/core/quartz/domain/SysJobLog.java diff --git a/openhis-server/core-quartz/src/main/java/com/core/quartz/mapper/SysJobLogMapper.java b/openhis-server-new/core-quartz/src/main/java/com/core/quartz/mapper/SysJobLogMapper.java similarity index 100% rename from openhis-server/core-quartz/src/main/java/com/core/quartz/mapper/SysJobLogMapper.java rename to openhis-server-new/core-quartz/src/main/java/com/core/quartz/mapper/SysJobLogMapper.java diff --git a/openhis-server/core-quartz/src/main/java/com/core/quartz/mapper/SysJobMapper.java b/openhis-server-new/core-quartz/src/main/java/com/core/quartz/mapper/SysJobMapper.java similarity index 100% rename from openhis-server/core-quartz/src/main/java/com/core/quartz/mapper/SysJobMapper.java rename to openhis-server-new/core-quartz/src/main/java/com/core/quartz/mapper/SysJobMapper.java diff --git a/openhis-server/core-quartz/src/main/java/com/core/quartz/util/CronUtils.java b/openhis-server-new/core-quartz/src/main/java/com/core/quartz/util/CronUtils.java similarity index 100% rename from openhis-server/core-quartz/src/main/java/com/core/quartz/util/CronUtils.java rename to openhis-server-new/core-quartz/src/main/java/com/core/quartz/util/CronUtils.java diff --git a/openhis-server/core-quartz/src/main/java/com/core/quartz/util/JobInvokeUtil.java b/openhis-server-new/core-quartz/src/main/java/com/core/quartz/util/JobInvokeUtil.java similarity index 100% rename from openhis-server/core-quartz/src/main/java/com/core/quartz/util/JobInvokeUtil.java rename to openhis-server-new/core-quartz/src/main/java/com/core/quartz/util/JobInvokeUtil.java diff --git a/openhis-server/core-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml b/openhis-server-new/core-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml similarity index 100% rename from openhis-server/core-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml rename to openhis-server-new/core-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml diff --git a/openhis-server/core-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml b/openhis-server-new/core-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml similarity index 100% rename from openhis-server/core-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml rename to openhis-server-new/core-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml diff --git a/openhis-server/core-system/pom.xml b/openhis-server-new/core-system/pom.xml similarity index 100% rename from openhis-server/core-system/pom.xml rename to openhis-server-new/core-system/pom.xml diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/FlowProcDefDto.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/FlowProcDefDto.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/FlowProcDefDto.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/FlowProcDefDto.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysCache.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysCache.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysCache.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysCache.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysConfig.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysConfig.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysConfig.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysConfig.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysDeployForm.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysDeployForm.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysDeployForm.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysDeployForm.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysExpression.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysExpression.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysExpression.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysExpression.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysForm.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysForm.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysForm.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysForm.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysListener.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysListener.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysListener.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysListener.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysLogininfor.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysLogininfor.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysLogininfor.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysLogininfor.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysNotice.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysNotice.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysNotice.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysNotice.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysOperLog.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysOperLog.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysOperLog.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysOperLog.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysPost.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysPost.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysPost.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysPost.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysRoleDept.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysRoleDept.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysRoleDept.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysRoleDept.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysRoleMenu.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysRoleMenu.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysRoleMenu.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysRoleMenu.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysTaskForm.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysTaskForm.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysTaskForm.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysTaskForm.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysTenant.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysTenant.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysTenant.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysTenant.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysTenantOption.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysTenantOption.java similarity index 89% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysTenantOption.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysTenantOption.java index 554f6c13c92c3b252564ae7d3d2537d02061e546..afb2acdd8bdf9df6b6c611b74aecea9be2a4fd98 100644 --- a/openhis-server/core-system/src/main/java/com/core/system/domain/SysTenantOption.java +++ b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysTenantOption.java @@ -24,7 +24,7 @@ public class SysTenantOption implements Serializable { /** * ID(使用数据库序列生成) */ - @TableId(type = IdType.AUTO) + @TableId(type = IdType.ASSIGN_ID) private Long id; /** @@ -37,12 +37,6 @@ public class SysTenantOption implements Serializable { */ private String optionCode; - /** - * 配置项名称 - */ - @TableField(exist = false) - private String optionName; - /** * 配置项内容 */ diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysUserOnline.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysUserOnline.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysUserOnline.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysUserOnline.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysUserPost.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysUserPost.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysUserPost.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysUserPost.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysUserRole.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysUserRole.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysUserRole.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysUserRole.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/SysUserTenant.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/SysUserTenant.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/SysUserTenant.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/SysUserTenant.java diff --git a/openhis-server-new/core-system/src/main/java/com/core/system/domain/dto/SaveTenantOptionDetailDto.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/dto/SaveTenantOptionDetailDto.java new file mode 100644 index 0000000000000000000000000000000000000000..22cfee11f418dfa514b4f529feccd7c01647b265 --- /dev/null +++ b/openhis-server-new/core-system/src/main/java/com/core/system/domain/dto/SaveTenantOptionDetailDto.java @@ -0,0 +1,29 @@ +package com.core.system.domain.dto; + +import java.util.List; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 保存租户配置项详情Dto + * + * @author system + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class SaveTenantOptionDetailDto { + + /** + * 名称 + */ + private Integer tenantId; + + /** + * 内容 + */ + private List optionList; + +} diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/dto/SysTenantOptionDto.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/dto/TenantOptionDto.java similarity index 92% rename from openhis-server/core-system/src/main/java/com/core/system/domain/dto/SysTenantOptionDto.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/dto/TenantOptionDto.java index 04498c818844fa403a4c279f8fce175a5f550d60..607a3134f03feaff020bf1b2d323566fd30525e6 100644 --- a/openhis-server/core-system/src/main/java/com/core/system/domain/dto/SysTenantOptionDto.java +++ b/openhis-server-new/core-system/src/main/java/com/core/system/domain/dto/TenantOptionDto.java @@ -12,7 +12,7 @@ import lombok.experimental.Accessors; @Data @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -public class SysTenantOptionDto { +public class TenantOptionDto { /** * 编码 diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/vo/MetaVo.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/vo/MetaVo.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/vo/MetaVo.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/vo/MetaVo.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/domain/vo/RouterVo.java b/openhis-server-new/core-system/src/main/java/com/core/system/domain/vo/RouterVo.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/domain/vo/RouterVo.java rename to openhis-server-new/core-system/src/main/java/com/core/system/domain/vo/RouterVo.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/FlowDeployMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/FlowDeployMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/FlowDeployMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/FlowDeployMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysConfigMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysConfigMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysConfigMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysConfigMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysDeployFormMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysDeployFormMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysDeployFormMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysDeployFormMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysDeptMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysDeptMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysDeptMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysDeptMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysDictDataMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysDictDataMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysDictDataMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysDictDataMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysDictTypeMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysDictTypeMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysDictTypeMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysDictTypeMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysExpressionMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysExpressionMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysExpressionMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysExpressionMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysFormMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysFormMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysFormMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysFormMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysListenerMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysListenerMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysListenerMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysListenerMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysLogininforMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysLogininforMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysLogininforMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysLogininforMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysMenuMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysMenuMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysMenuMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysMenuMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysNoticeMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysNoticeMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysNoticeMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysNoticeMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysOperLogMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysOperLogMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysOperLogMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysOperLogMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysPostMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysPostMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysPostMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysPostMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysRoleDeptMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysRoleDeptMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysRoleDeptMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysRoleDeptMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysRoleMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysRoleMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysRoleMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysRoleMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysRoleMenuMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysRoleMenuMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysRoleMenuMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysRoleMenuMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysTaskFormMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysTaskFormMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysTaskFormMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysTaskFormMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysTenantMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysTenantMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysTenantMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysTenantMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysTenantOptionMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysTenantOptionMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysTenantOptionMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysTenantOptionMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysUserMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysUserMapper.java similarity index 93% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysUserMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysUserMapper.java index 40ecd69a96794f1df4f094a0a3ba3ab7a1928e52..409028ece8e75b2d4c5f077b640d1856e9b9533f 100644 --- a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysUserMapper.java +++ b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysUserMapper.java @@ -3,6 +3,7 @@ package com.core.system.mapper; import java.util.List; import java.util.Map; +import com.core.common.core.domain.entity.SysRole; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -155,4 +156,12 @@ public interface SysUserMapper extends BaseMapper { */ List> getOptionList(@Param("tenantId") Integer tenantId); + /** + * 查询当前登录账号角色集合 + * + * @param userId 系统用户id + * @return 当前登录账号角色集合 + */ + List getRoleList(@Param("userId") Long userId); + } diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysUserPostMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysUserPostMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysUserPostMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysUserPostMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysUserRoleMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysUserRoleMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysUserRoleMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysUserRoleMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/mapper/SysUserTenantMapper.java b/openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysUserTenantMapper.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/mapper/SysUserTenantMapper.java rename to openhis-server-new/core-system/src/main/java/com/core/system/mapper/SysUserTenantMapper.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysConfigService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysConfigService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysConfigService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysConfigService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysDeptService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysDeptService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysDeptService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysDeptService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysDictDataService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysDictDataService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysDictDataService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysDictDataService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysDictTypeService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysDictTypeService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysDictTypeService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysDictTypeService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysExpressionService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysExpressionService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysExpressionService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysExpressionService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysListenerService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysListenerService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysListenerService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysListenerService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysLogininforService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysLogininforService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysLogininforService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysLogininforService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysMenuService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysMenuService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysMenuService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysMenuService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysNoticeService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysNoticeService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysNoticeService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysNoticeService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysOperLogService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysOperLogService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysOperLogService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysOperLogService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysPostService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysPostService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysPostService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysPostService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysRoleService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysRoleService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysRoleService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysRoleService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysTenantOptionService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysTenantOptionService.java similarity index 34% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysTenantOptionService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysTenantOptionService.java index 9979a1769ebbab5e4ec5e34327f1a68cfa6d91b7..060fc923e015e34e7c45e54225dcdeeef69529ff 100644 --- a/openhis-server/core-system/src/main/java/com/core/system/service/ISysTenantOptionService.java +++ b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysTenantOptionService.java @@ -1,13 +1,13 @@ package com.core.system.service; import java.util.List; +import java.util.Map; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.core.common.core.domain.R; -import com.core.common.enums.TenantOptionDict; import com.core.system.domain.SysTenantOption; -import com.core.system.domain.dto.SysTenantOptionDto; +import com.core.system.domain.dto.SaveTenantOptionDetailDto; +import com.core.system.domain.dto.TenantOptionDto; /** * 租户配置项表Service接口 @@ -17,46 +17,33 @@ import com.core.system.domain.dto.SysTenantOptionDto; public interface ISysTenantOptionService extends IService { /** - * 查询租户配置项分页列表 - * - * @param tenantId 租户ID查询 - * @param optionCode 配置项编码查询 - * @param pageNum 当前页 - * @param pageSize 每页多少条 - * @return 租户配置项分页列表 + * 查询全部租户配置项 + * + * @param tenantId 租户ID + * @return 全部租户配置项 */ - R> getTenantOptionPage(Integer tenantId, String optionCode, Integer pageNum, - Integer pageSize); + Map getAllTenantOption(Integer tenantId); /** - * 新增租户配置项 + * 查询租户配置项详情列表 * - * @param sysTenantOption 租户配置项实体 - * @return 结果 + * @param tenantId 租户ID + * @return 租户配置项详情列表 */ - R addTenantOption(SysTenantOption sysTenantOption); + List getTenantOptionDetailList(Integer tenantId); /** - * 查询租户配置项下拉列表 + * 保存租户配置项详情列表 * - * @return 租户配置项下拉列表 - */ - List getTenantOptionDropdown(); - - /** - * 查询全部租户配置项 - * - * @param tenantId 租户ID - * @return 全部租户配置项 + * @param saveTenantOptionDetailDto 参数DTO + * @return 结果 */ - List getAllTenantOption(Integer tenantId); + R saveTenantOptionDetailList(SaveTenantOptionDetailDto saveTenantOptionDetailDto); /** - * 查询指定的租户配置项内容 + * 查询租户配置项前端form表单列表 * - * @param tenantId 租户ID - * @param tenantOptionDict 配置项字典枚举 - * @return 指定的租户配置项内容(不存在返回NULL) + * @return 租户配置项前端form表单列表 */ - SysTenantOptionDto getTenantOptionContent(Integer tenantId, TenantOptionDict tenantOptionDict); + List getTenantOptionFormList(); } diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysTenantService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysTenantService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysTenantService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysTenantService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysUserOnlineService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysUserOnlineService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysUserOnlineService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysUserOnlineService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysUserService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysUserService.java similarity index 94% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysUserService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysUserService.java index 5256db6c9a2f265a8ad10f42f7c92c649d9656dc..574744fe75879c59e0169743604f15e9204e5659 100644 --- a/openhis-server/core-system/src/main/java/com/core/system/service/ISysUserService.java +++ b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysUserService.java @@ -4,6 +4,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.core.common.core.domain.entity.SysRole; import com.core.common.core.domain.entity.SysUser; import com.core.common.core.domain.model.LoginUserExtend; @@ -229,5 +230,13 @@ public interface ISysUserService { * @param tenantId 租户id * @return option集合 */ - List> getOptionList(Integer tenantId); + List> getOptionList(Integer tenantId); + + /** + * 查询当前登录账号角色id集合 + * + * @param userId 系统用户id + * @return 当前登录账号角色id集合 + */ + List getRoleList(Long userId); } diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/ISysUserTenantService.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/ISysUserTenantService.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/ISysUserTenantService.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/ISysUserTenantService.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysConfigServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysConfigServiceImpl.java similarity index 98% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysConfigServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysConfigServiceImpl.java index 6157ff3929d5507e8a4f35636554322efb237962..e21f039b2ac0c6c3a3b45e3961abf37265a8f103 100644 --- a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysConfigServiceImpl.java +++ b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysConfigServiceImpl.java @@ -22,7 +22,7 @@ import com.core.system.service.ISysConfigService; /** * 参数配置 服务层实现 - * + * * @author system */ @Service @@ -43,7 +43,7 @@ public class SysConfigServiceImpl implements ISysConfigService { /** * 查询参数配置信息 - * + * * @param configId 参数配置ID * @return 参数配置信息 */ @@ -57,7 +57,7 @@ public class SysConfigServiceImpl implements ISysConfigService { /** * 根据键名查询参数配置信息 - * + * * @param configKey 参数key * @return 参数键值 */ @@ -79,7 +79,7 @@ public class SysConfigServiceImpl implements ISysConfigService { /** * 获取验证码开关 - * + * * @return true开启,false关闭 */ @Override @@ -93,7 +93,7 @@ public class SysConfigServiceImpl implements ISysConfigService { /** * 查询参数配置列表 - * + * * @param config 参数配置信息 * @return 参数配置集合 */ @@ -104,7 +104,7 @@ public class SysConfigServiceImpl implements ISysConfigService { /** * 新增参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @@ -119,7 +119,7 @@ public class SysConfigServiceImpl implements ISysConfigService { /** * 修改参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @@ -139,7 +139,7 @@ public class SysConfigServiceImpl implements ISysConfigService { /** * 批量删除参数信息 - * + * * @param configIds 需要删除的参数ID */ @Override @@ -185,7 +185,7 @@ public class SysConfigServiceImpl implements ISysConfigService { /** * 校验参数键名是否唯一 - * + * * @param config 参数配置信息 * @return 结果 */ @@ -201,7 +201,7 @@ public class SysConfigServiceImpl implements ISysConfigService { /** * 设置cache key - * + * * @param configKey 参数键 * @return 缓存键key */ diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysDeptServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysDeptServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysDeptServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysDeptServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysDictDataServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysDictDataServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysDictDataServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysDictDataServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysDictTypeServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysDictTypeServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysDictTypeServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysDictTypeServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysExpressionServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysExpressionServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysExpressionServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysExpressionServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysListenerServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysListenerServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysListenerServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysListenerServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysLogininforServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysLogininforServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysLogininforServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysLogininforServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysMenuServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysMenuServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysMenuServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysMenuServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysNoticeServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysNoticeServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysNoticeServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysNoticeServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysOperLogServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysOperLogServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysOperLogServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysOperLogServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysPostServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysPostServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysPostServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysPostServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysRoleServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysRoleServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysRoleServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysRoleServiceImpl.java diff --git a/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysTenantOptionServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysTenantOptionServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..d29d704c865d7af3604d5219fe201265a7983e24 --- /dev/null +++ b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysTenantOptionServiceImpl.java @@ -0,0 +1,132 @@ +package com.core.system.service.impl; + +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.core.common.core.domain.R; +import com.core.common.enums.TenantOptionDict; +import com.core.system.domain.SysTenantOption; +import com.core.system.domain.dto.SaveTenantOptionDetailDto; +import com.core.system.domain.dto.TenantOptionDto; +import com.core.system.mapper.SysTenantOptionMapper; +import com.core.system.service.ISysTenantOptionService; + +/** + * 租户配置项表Service业务层处理 + * + * @author system + */ +@Service +public class SysTenantOptionServiceImpl extends ServiceImpl + implements ISysTenantOptionService { + + /** + * 查询全部租户配置项 + * + * @param tenantId 租户ID + * @return 全部租户配置项 + */ + @Override + public Map getAllTenantOption(Integer tenantId) { + // 查询该租户所有配置项 + List sysTenantOptionList = + baseMapper.selectList(new LambdaQueryWrapper().eq(SysTenantOption::getTenantId, tenantId)); + if (sysTenantOptionList.isEmpty()) { + return Collections.emptyMap(); + } + // 作成Map + return sysTenantOptionList.stream() + .collect(Collectors.toMap(SysTenantOption::getOptionCode, SysTenantOption::getOptionContent)); + } + + /** + * 查询租户配置项详情列表 + * + * @param tenantId 租户ID + * @return 租户配置项详情列表 + */ + @Override + public List getTenantOptionDetailList(Integer tenantId) { + // 获取全部租户配置项字典,并按照指定顺序排序 + TenantOptionDict[] optionDictArray = TenantOptionDict.values(); + List optionDictList = Arrays.stream(optionDictArray) + .sorted(Comparator.comparing(TenantOptionDict::getSort)).collect(Collectors.toList()); + // 查询该租户所有配置项,并作成Map + List sysTenantOptionList = + baseMapper.selectList(new LambdaQueryWrapper().eq(SysTenantOption::getTenantId, tenantId)); + Map sysTenantOptionMap = sysTenantOptionList.stream() + .collect(Collectors.toMap(SysTenantOption::getOptionCode, SysTenantOption::getOptionContent)); + // 循环查询结果,返回字典项和实际配置的值 + List dtoList = new ArrayList<>(); + TenantOptionDto dto; + for (TenantOptionDict dict : optionDictList) { + dto = new TenantOptionDto(); + dto.setCode(dict.getCode()).setName(dict.getName()).setContent(sysTenantOptionMap.get(dict.getCode())); + dtoList.add(dto); + } + return dtoList; + } + + /** + * 保存租户配置项详情列表 + * + * @param saveTenantOptionDetailDto 参数DTO + * @return 结果 + */ + @Override + public R saveTenantOptionDetailList(SaveTenantOptionDetailDto saveTenantOptionDetailDto) { + // 入参配置项详情列表作成Map + Map tenantOptionDtoMap = saveTenantOptionDetailDto.getOptionList().stream() + .collect(Collectors.toMap(TenantOptionDto::getCode, Function.identity())); + // 查询该租户所有配置项,并作成Map + List sysTenantOptionList = baseMapper.selectList(new LambdaQueryWrapper() + .eq(SysTenantOption::getTenantId, saveTenantOptionDetailDto.getTenantId())); + Map sysTenantOptionMap = + sysTenantOptionList.stream().collect(Collectors.toMap(SysTenantOption::getOptionCode, Function.identity())); + // 循环配置项字典 + List newOptionList = new ArrayList<>(); + List existOptionList = new ArrayList<>(); + SysTenantOption newOption; + for (TenantOptionDict dict : TenantOptionDict.values()) { + // 根据是否输入,是否已存在,区分并作成新增列表和更新列表 + TenantOptionDto inputOption = tenantOptionDtoMap.getOrDefault(dict.getCode(), new TenantOptionDto()); + SysTenantOption existOption = sysTenantOptionMap.get(dict.getCode()); + if (existOption == null) { + newOption = new SysTenantOption().setTenantId(saveTenantOptionDetailDto.getTenantId()) + .setOptionCode(dict.getCode()) + .setOptionContent(Optional.ofNullable(inputOption.getContent()).orElse("")); + newOptionList.add(newOption); + } else { + existOption.setOptionContent(Optional.ofNullable(inputOption.getContent()).orElse("")); + existOptionList.add(existOption); + } + } + // 新增 + if (!newOptionList.isEmpty()) { + this.saveBatch(newOptionList); + } + // 更新 + if (!existOptionList.isEmpty()) { + this.updateBatchById(existOptionList); + } + return R.ok(); + } + + /** + * 查询租户配置项前端form表单列表 + * + * @return 租户配置项前端form表单列表 + */ + @Override + public List getTenantOptionFormList() { + return Arrays.stream(TenantOptionDict.values()).sorted(Comparator.comparing(TenantOptionDict::getSort)) + .map(dict -> new TenantOptionDto().setCode(dict.getCode()).setName(dict.getName())) + .collect(Collectors.toList()); + } + +} diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysTenantServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysTenantServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysTenantServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysTenantServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysUserOnlineServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysUserOnlineServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysUserOnlineServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysUserOnlineServiceImpl.java diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysUserServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysUserServiceImpl.java similarity index 97% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysUserServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysUserServiceImpl.java index 6fbd0ac82dac083548cc8881d37012b213139a08..74372424b1ba1cf061f46b0e44061788d9b6feeb 100644 --- a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysUserServiceImpl.java +++ b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysUserServiceImpl.java @@ -1,14 +1,12 @@ package com.core.system.service.impl; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import javax.validation.Validator; -import com.core.common.core.domain.model.LoginUserExtend; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -20,6 +18,7 @@ import com.core.common.annotation.DataScope; import com.core.common.constant.UserConstants; import com.core.common.core.domain.entity.SysRole; import com.core.common.core.domain.entity.SysUser; +import com.core.common.core.domain.model.LoginUserExtend; import com.core.common.exception.ServiceException; import com.core.common.utils.SecurityUtils; import com.core.common.utils.StringUtils; @@ -506,7 +505,7 @@ public class SysUserServiceImpl implements ISysUserService { * @return 医院id */ @Override - public Long getHospitalIdByOrgId(Long orgId){ + public Long getHospitalIdByOrgId(Long orgId) { return userMapper.getHospitalIdByOrgId(orgId); } @@ -517,8 +516,19 @@ public class SysUserServiceImpl implements ISysUserService { * @return option集合 */ @Override - public List> getOptionList(Integer tenantId){ + public List> getOptionList(Integer tenantId) { return userMapper.getOptionList(tenantId); } + /** + * 查询当前登录账号角色集合 + * + * @param userId 系统用户id + * @return 当前登录账号角色集合 + */ + @Override + public List getRoleList(Long userId) { + return userMapper.getRoleList(userId); + } + } diff --git a/openhis-server/core-system/src/main/java/com/core/system/service/impl/SysUserTenantServiceImpl.java b/openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysUserTenantServiceImpl.java similarity index 100% rename from openhis-server/core-system/src/main/java/com/core/system/service/impl/SysUserTenantServiceImpl.java rename to openhis-server-new/core-system/src/main/java/com/core/system/service/impl/SysUserTenantServiceImpl.java diff --git a/openhis-server/core-system/src/main/resources/mapper/flowable/FlowDeployMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/flowable/FlowDeployMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/flowable/FlowDeployMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/flowable/FlowDeployMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/flowable/SysTaskFormMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/flowable/SysTaskFormMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/flowable/SysTaskFormMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/flowable/SysTaskFormMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysConfigMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysConfigMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysConfigMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysConfigMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysDeployFormMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysDeployFormMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysDeployFormMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysDeployFormMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysDeptMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysDeptMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysDeptMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysDeptMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysDictDataMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysDictDataMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysDictDataMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysDictDataMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysDictTypeMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysDictTypeMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysDictTypeMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysExpressionMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysExpressionMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysExpressionMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysExpressionMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysFormMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysFormMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysFormMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysFormMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysListenerMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysListenerMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysListenerMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysListenerMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysLogininforMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysLogininforMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysLogininforMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysLogininforMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysMenuMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysMenuMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysMenuMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysMenuMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysNoticeMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysNoticeMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysNoticeMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysOperLogMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysOperLogMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysOperLogMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysOperLogMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysPostMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysPostMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysPostMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysPostMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysRoleMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysRoleMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysRoleMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysRoleMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysTenantMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysTenantMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysTenantMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysTenantMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysTenantOptionMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysTenantOptionMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysTenantOptionMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysTenantOptionMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysUserMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysUserMapper.xml similarity index 95% rename from openhis-server/core-system/src/main/resources/mapper/system/SysUserMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysUserMapper.xml index 4ea96e7e0f2a0230788ab69e004f22289fe4ff4c..1a4b9676bd6b2f78cfd40f6c4593422117a31f7d 100644 --- a/openhis-server/core-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/openhis-server-new/core-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -293,14 +293,21 @@ + + \ No newline at end of file diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysUserPostMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysUserPostMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysUserPostMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysUserPostMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysUserRoleMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysUserRoleMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysUserRoleMapper.xml diff --git a/openhis-server/core-system/src/main/resources/mapper/system/SysUserTenantMapper.xml b/openhis-server-new/core-system/src/main/resources/mapper/system/SysUserTenantMapper.xml similarity index 100% rename from openhis-server/core-system/src/main/resources/mapper/system/SysUserTenantMapper.xml rename to openhis-server-new/core-system/src/main/resources/mapper/system/SysUserTenantMapper.xml diff --git a/openhis-server/openhis-application/pom.xml b/openhis-server-new/openhis-application/pom.xml similarity index 100% rename from openhis-server/openhis-application/pom.xml rename to openhis-server-new/openhis-application/pom.xml diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/OpenHisApplication.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/OpenHisApplication.java similarity index 93% rename from openhis-server/openhis-application/src/main/java/com/openhis/OpenHisApplication.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/OpenHisApplication.java index 1a8f389b568b69ca3362738d6e02fb56a6d8c63c..cdaba7407c7b63984208b2acae65405e15c955e3 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/OpenHisApplication.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/OpenHisApplication.java @@ -3,14 +3,16 @@ package com.openhis; import java.net.InetAddress; import java.net.UnknownHostException; -import com.openhis.web.ybmanage.config.YbServiceConfig; -import org.springframework.beans.factory.annotation.Autowired; +import com.alibaba.fastjson2.JSONObject; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.core.env.Environment; +import org.springframework.scheduling.annotation.EnableAsync; + +import com.openhis.web.ybmanage.config.YbServiceConfig; /** * 启动程序 @@ -19,6 +21,7 @@ import org.springframework.core.env.Environment; */ @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.core", "com.openhis"}) @EnableConfigurationProperties(YbServiceConfig.class) +@EnableAsync public class OpenHisApplication { public static void main(String[] args) throws UnknownHostException { // System.setProperty("spring.devtools.restart.enabled", "false"); diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/config/HttpConfig.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/config/HttpConfig.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/config/HttpConfig.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/config/HttpConfig.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/controller/SysJobController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/controller/SysJobController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/controller/SysJobController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/controller/SysJobController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/controller/SysJobLogController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/controller/SysJobLogController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/controller/SysJobLogController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/controller/SysJobLogController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/service/ISysJobLogService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/service/ISysJobLogService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/service/ISysJobLogService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/service/ISysJobLogService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/service/ISysJobService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/service/ISysJobService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/service/ISysJobService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/service/ISysJobService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/service/impl/SysJobLogServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/service/impl/SysJobLogServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/service/impl/SysJobLogServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/service/impl/SysJobLogServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/service/impl/SysJobServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/service/impl/SysJobServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/service/impl/SysJobServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/service/impl/SysJobServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/task/ExampleTask.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/ExampleTask.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/task/ExampleTask.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/ExampleTask.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/task/RyTask.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/RyTask.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/task/RyTask.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/RyTask.java diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/StocktakingBatchTask.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/StocktakingBatchTask.java new file mode 100644 index 0000000000000000000000000000000000000000..58dc314daa10a8f2d441978e1de00f8f7b99d51e --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/task/StocktakingBatchTask.java @@ -0,0 +1,54 @@ +package com.openhis.quartz.task; + +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; + +import com.alibaba.fastjson2.JSONObject; +import com.core.common.core.domain.R; +import com.core.common.utils.DateUtils; +import com.openhis.web.inventorymanage.appservice.IProductStocktakingAppService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import com.core.common.utils.StringUtils; +import com.core.framework.config.TenantContext; +import com.openhis.administration.domain.Location; +import com.openhis.administration.service.ILocationService; + +/** + * 批量盘点定时任务 + * + * @author yuxj + */ +@Component("stocktakingBatchTask") +public class StocktakingBatchTask { + + Logger logger = LoggerFactory.getLogger(StocktakingBatchTask.class); + @Resource + IProductStocktakingAppService productStocktakingAppService; + + public void autoStocktakingBatch(Integer tenantId) { + // 定时任务指定租户id,示例 + try { + // 在控制台打印当前时间加执行的功能名 + System.out.println("执行自动批量盘点START:" + DateUtils.getNowDate()); + logger.info("执行自动批量盘点START:" + DateUtils.getNowDate()); + + // 设置当前线程的租户ID + TenantContext.setCurrentTenant(tenantId); + //执行自动盘点 + productStocktakingAppService.autoStocktakingBatch(); + + logger.info("执行自动批量盘点END:" + DateUtils.getNowDate()); + // 在控制台打印当前时间加执行的功能名 + System.out.println("执行自动批量盘点END:" + DateUtils.getNowDate()); + } finally { + // 清除线程局部变量,防止内存泄漏 + TenantContext.clear(); + } + + } +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/util/AbstractQuartzJob.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/util/AbstractQuartzJob.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/util/AbstractQuartzJob.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/util/AbstractQuartzJob.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/util/QuartzDisallowConcurrentExecution.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/util/QuartzDisallowConcurrentExecution.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/util/QuartzDisallowConcurrentExecution.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/util/QuartzDisallowConcurrentExecution.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/util/QuartzJobExecution.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/util/QuartzJobExecution.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/util/QuartzJobExecution.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/util/QuartzJobExecution.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/quartz/util/ScheduleUtils.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/util/ScheduleUtils.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/quartz/util/ScheduleUtils.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/quartz/util/ScheduleUtils.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/rule/component/ACmp.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/rule/component/ACmp.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/rule/component/ACmp.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/rule/component/ACmp.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/rule/component/BCmp.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/rule/component/BCmp.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/rule/component/BCmp.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/rule/component/BCmp.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/rule/component/CCmp.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/rule/component/CCmp.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/rule/component/CCmp.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/rule/component/CCmp.java diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IBodyStructureAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IBodyStructureAppService.java new file mode 100644 index 0000000000000000000000000000000000000000..859b02a11d40ea4c18069858008fc9b776b4e7a8 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IBodyStructureAppService.java @@ -0,0 +1,64 @@ +package com.openhis.web.basedatamanage.appservice; + +import javax.servlet.http.HttpServletRequest; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.openhis.web.basedatamanage.dto.BodyStructureDto; +import com.openhis.web.basedatamanage.dto.OrganizationDto; + +/** + * BodyStructure 应该服务类 + */ +public interface IBodyStructureAppService { + /** + * 查询身体部位树 + * + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param request 请求数据 + * @return 身体部位树分页列表 + */ + Page getBodyStructureTree(Integer pageNo, Integer pageSize, HttpServletRequest request); + + /** + * 身体部位信息详情 + * + * @param id 身体部位信息id + * @return 身体部位详情 + */ + R getBodyStructureInfo(Long id); + + /** + * 添加/编辑体身体部位信息 + * + * @param bodyStructureDto 身体部位信息 + * @return 操作结果 + */ + R addOrEditBodyStructure(BodyStructureDto bodyStructureDto); + + /** + * 身体部位信息 + * + * @param ids 身体部位信息id + * @return 操作结果 + */ + R deleteBodyStructure(String ids); + + /** + * 身体部位启用 + * + * @param id 身体部位信息id + * @return 操作结果 + */ + R activeBodyStructure(Long id); + + /** + * 身体部位停用 + * + * @param id 身体部位信息id + * @return 操作结果 + */ + R inactiveBodyStructure(Long id); + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/ILocationAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/ILocationAppService.java similarity index 75% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/ILocationAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/ILocationAppService.java index 914b643e22929569336ab5b7f984b895220ae456..9a0c96a27a947dee7271eb2171cdba440ee15326 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/ILocationAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/ILocationAppService.java @@ -5,6 +5,9 @@ import javax.servlet.http.HttpServletRequest; import com.core.common.core.domain.R; import com.openhis.web.basedatamanage.dto.LocationAddOrEditDto; import com.openhis.web.basedatamanage.dto.LocationPageParam; +import com.openhis.web.common.dto.LocationDto; + +import java.util.List; /** * Location 应该服务类 @@ -13,12 +16,13 @@ public interface ILocationAppService { /** * 位置信息 * - * @param formKey 查询条件 + * @param formList 类型 * @param pageNo 当前页码 * @param pageSize 查询条数 + * @param isInHospital 是否为住院 * @return 位置信息分页列表 */ - R getLocationTree(Integer formKey, Integer pageNo, Integer pageSize); + R getLocationTree(List formList, Integer pageNo, Integer pageSize, String isInHospital); /** * 位置信息详情 @@ -71,4 +75,20 @@ public interface ILocationAppService { * @return 初始化信息 */ R locationInit(); + + /** + * 启用 + * + * @param locationIdList 位置id + * @return 操作结果 + */ + R enableLocation(List locationIdList); + + /** + * 停用 + * + * @param locationIdList 位置id + * @return 操作结果 + */ + R deactivateLocation(List locationIdList); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IOrganizationAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IOrganizationAppService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IOrganizationAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IOrganizationAppService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IOrganizationLocationAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IOrganizationLocationAppService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IOrganizationLocationAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IOrganizationLocationAppService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerAppService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerAppService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerRoleAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerRoleAppService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerRoleAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/IPractitionerRoleAppService.java diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/BodyStructureAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/BodyStructureAppServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..f620478e6793eea6a36dc7c07ec4596adf4732a6 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/BodyStructureAppServiceImpl.java @@ -0,0 +1,196 @@ +package com.openhis.web.basedatamanage.appservice.impl; + +import java.util.*; +import java.util.stream.Collectors; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.ChineseConvertUtils; +import com.core.common.utils.MessageUtils; +import com.core.common.utils.StringUtils; +import com.openhis.administration.domain.BodyStructure; +import com.openhis.administration.service.IBodyStructureService; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.AssignSeqEnum; +import com.openhis.common.enums.PublicationStatus; +import com.openhis.common.utils.EnumUtils; +import com.openhis.web.basedatamanage.appservice.IBodyStructureAppService; +import com.openhis.web.basedatamanage.dto.BodyStructureDto; + +@Service +public class BodyStructureAppServiceImpl implements IBodyStructureAppService { + + @Resource + private IBodyStructureService bodyStructureService; + + @Resource + private AssignSeqUtil assignSeqUtil; + + @Override + public Page getBodyStructureTree(Integer pageNo, Integer pageSize, HttpServletRequest request) { + // 查询身体部位列表 + Page page = bodyStructureService.page(new Page<>(pageNo, pageSize)); + List bodyStructureList = page.getRecords(); + // 将身体部位列表转为树结构 + List orgTree = buildTree(bodyStructureList); + Page orgQueryDtoPage = new Page<>(pageNo, pageSize, page.getTotal()); + orgQueryDtoPage.setRecords(orgTree); + return orgQueryDtoPage; + } + + /** + * 将身体部位列表转换为树结构 + * + * @param records 机构列表 + * @return tree + */ + private List buildTree(List records) { + // 按b_no的层级排序,确保父节点先处理 + List sortedRecords = records.stream() + .sorted(Comparator.comparingInt(r -> r.getBusNo().split("\\.").length)).collect(Collectors.toList()); + + Map nodeMap = new HashMap<>(); + List tree = new ArrayList<>(); + + for (BodyStructure record : sortedRecords) { + String bNo = record.getBusNo(); + String[] parts = bNo.split("\\."); + BodyStructureDto node = new BodyStructureDto(); + BeanUtils.copyProperties(record, node); + node.setStatusEnum_enumText(EnumUtils.getInfoByValue(PublicationStatus.class, node.getStatusEnum())); + + // 将当前节点加入映射 + nodeMap.put(bNo, node); + + if (parts.length == 1) { + // 根节点 + tree.add(node); + } else { + // 获取父节点的b_no(去掉最后一部分) + String parentBNo = String.join(".", Arrays.copyOf(parts, parts.length - 1)); + BodyStructureDto parent = nodeMap.get(parentBNo); + + if (parent != null) { + parent.getChildren().add(node); + } else { + // 处理父节点不存在的情况(例如数据缺失) + // 可根据需求调整为将节点加入根或抛出异常 + } + } + } + return tree; + } + + /** + * 身体部位信息详情 + * + * @param id 身体部位id + * @return 机构信息详情 + */ + @Override + public R getBodyStructureInfo(Long id) { + BodyStructure bodyStructure = bodyStructureService.getById(id); + return R.ok(bodyStructure, + MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息查询"})); + } + + /** + * 添加/编辑部位 + * + * @param bodyStructureDto 身体部位信息 + * @return 操作结果 + */ + @Override + public R addOrEditBodyStructure(BodyStructureDto bodyStructureDto) { + + // 新增身体部位信息 + BodyStructure bodyStructure = new BodyStructure(); + BeanUtils.copyProperties(bodyStructureDto, bodyStructure); + + // 拼音码 + bodyStructure.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(bodyStructureDto.getName())); + // 五笔码 + bodyStructure.setWbStr(ChineseConvertUtils.toWBFirstLetter(bodyStructureDto.getName())); + + if (bodyStructureDto.getId() != null) { + // 更新身体部位信息 + bodyStructureService.updateById(bodyStructure); + } else { + bodyStructure.setStatusEnum(PublicationStatus.ACTIVE.getValue()); + // 采番bus_no三位 + String code = assignSeqUtil.getSeq(AssignSeqEnum.BODY_STRUCTURE_NO.getPrefix(), 3); + // 如果传了上级部位 把当前的code拼到后边 + if (StringUtils.isNotEmpty(bodyStructure.getBusNo())) { + bodyStructure.setBusNo(String.format(CommonConstants.Common.MONTAGE_FORMAT, bodyStructure.getBusNo(), + CommonConstants.Common.POINT, code)); + } else { + bodyStructure.setBusNo(code); + } + // 生成待发送的机构信息 + bodyStructureService.save(bodyStructure); + } + // 返回身体部位id + return R.ok(bodyStructure.getId(), + MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息更新添加"})); + } + + /** + * 删除身体部位 + * + * @param id 身体部位id + * @return 操作结果 + */ + @Override + public R deleteBodyStructure(String id) { + + List orgIdList = new ArrayList<>(); + if (id != null) { + orgIdList = Arrays.stream(id.split(",")).map(Long::parseLong).collect(Collectors.toList()); + } + + // 删除身体部位信息 + boolean deleteOrgSuccess = bodyStructureService.removeByIds(orgIdList); + return deleteOrgSuccess + ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[] {"身体部位信息"})) + : R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"身体部位信息"})); + } + + /** + * 身体部位列表启用 + * + * @param id 身体部位列表信息id + * @return 操作结果 + */ + @Override + public R activeBodyStructure(Long id) { + // 机构启用 + boolean result = bodyStructureService.activeBodyStructure(id); + return result + ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息启用"})) + : R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"身体部位信息启用"})); + } + + /** + * 身体部位列表停用 + * + * @param id 身体部位列表信息id + * @return 操作结果 + */ + @Override + public R inactiveBodyStructure(Long id) { + // 机构停用 + boolean result = bodyStructureService.inactiveBodyStructure(id); + return result + ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"身体部位信息停用"})) + : R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"身体部位信息停用"})); + } + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/LocationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/LocationAppServiceImpl.java similarity index 66% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/LocationAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/LocationAppServiceImpl.java index 6b461123db5bb8c628e0ddc4f0b57996c8cecdda..1cbe64bd55fd4525284f58501fc632d5fe4fb22d 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/LocationAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/LocationAppServiceImpl.java @@ -13,13 +13,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.core.domain.R; -import com.core.common.utils.AssignSeqUtil; -import com.core.common.utils.ChineseConvertUtils; -import com.core.common.utils.MessageUtils; -import com.core.common.utils.StringUtils; +import com.core.common.utils.*; +import com.openhis.administration.domain.EncounterLocation; import com.openhis.administration.domain.Location; import com.openhis.administration.mapper.LocationMapper; +import com.openhis.administration.service.IEncounterLocationService; import com.openhis.administration.service.ILocationService; +import com.openhis.administration.service.IPractitionerRoleService; import com.openhis.common.constant.CommonConstants; import com.openhis.common.constant.PromptMsgConstant; import com.openhis.common.enums.*; @@ -28,6 +28,7 @@ import com.openhis.common.utils.HisPageUtils; import com.openhis.common.utils.HisQueryUtils; import com.openhis.web.basedatamanage.appservice.ILocationAppService; import com.openhis.web.basedatamanage.dto.*; +import com.openhis.web.common.appservice.ICommonService; @Service public class LocationAppServiceImpl implements ILocationAppService { @@ -35,12 +36,21 @@ public class LocationAppServiceImpl implements ILocationAppService { @Resource private ILocationService locationService; + @Resource + private ICommonService commonService; + @Resource private AssignSeqUtil assignSeqUtil; @Resource private LocationMapper locationMapper; + @Resource + private IPractitionerRoleService practitionerRoleService; + + @Resource + private IEncounterLocationService encounterLocationService; + /** * 位置初始化 * @@ -59,6 +69,86 @@ public class LocationAppServiceImpl implements ILocationAppService { return R.ok(initDto); } + /** + * 启用 + * + * @param locationIdList 位置id + * @return 操作结果 + */ + @Override + public R enableLocation(List locationIdList) { + List locationList = locationService.getLocationList(locationIdList); + if (locationIdList != null && !locationIdList.isEmpty()) { + for (Location location : locationList) { + if (LocationForm.HOUSE.getValue().equals(location.getFormEnum()) + || LocationForm.BED.getValue().equals(location.getFormEnum())) { + // 获取父节点的busNo(病区) + String parentBusNo = + location.getBusNo().substring(0, location.getBusNo().indexOf(CommonConstants.Common.POINT)); + // 查询所有父集位置 + List fatherLocations = + locationService.list(new LambdaQueryWrapper().like(Location::getBusNo, parentBusNo) + .in(Location::getFormEnum, LocationForm.WARD.getValue(), LocationForm.HOUSE.getValue())); + // 启用所有对应的父节点 + for (Location fatherLocation : fatherLocations) { + fatherLocation.setStatusEnum(LocationStatus.ACTIVE.getValue()); + locationService.updateLocation(fatherLocation); + } + // 病床单独设置状态为空闲 + if (LocationForm.BED.getValue().equals(location.getFormEnum())) { + location.setStatusEnum(LocationStatus.IDLE.getValue()); + locationService.updateLocation(location); + } + } else { + location.setStatusEnum(LocationStatus.ACTIVE.getValue()); + locationService.updateLocation(location); + } + } + return R.ok("启用成功"); + } + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null)); + } + + /** + * 停用 + * + * @param locationIdList 位置id + * @return 操作结果 + */ + @Override + public R deactivateLocation(List locationIdList) { + List locationList = locationService.getLocationList(locationIdList); + if (locationIdList != null && !locationIdList.isEmpty()) { + for (Location location : locationList) { + if (LocationForm.BED.getValue().equals(location.getFormEnum())) { + List encounterLocationList = + encounterLocationService.getEncounterLocationInfo(null, location.getId()); + if (encounterLocationList != null && !encounterLocationList.isEmpty()) { + return R.fail("有被占用的床位,不可停用"); + } + } else if (LocationForm.HOUSE.getValue().equals(location.getFormEnum())) { + // 检查病房下是否有启用的病床 + List activeBeds = + commonService.getChildLocation(location.getId(), LocationForm.BED.getValue()); + if ((activeBeds != null && !activeBeds.isEmpty())) { + return R.fail("病房下有启用或被占用的床位,不可停用"); + } + } else if (LocationForm.WARD.getValue().equals(location.getFormEnum())) { + // 检查病区下是否有启用的病房 + List activeHouses = + commonService.getChildLocation(location.getId(), LocationForm.HOUSE.getValue()); + if ((activeHouses != null && !activeHouses.isEmpty())) { + return R.fail("病区下有启用或被占用的病房,不可停用"); + } + } + location.setStatusEnum(LocationStatus.INACTIVE.getValue()); + locationService.updateLocation(location); + } + return R.ok("停用成功"); + } + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null)); + } + /** * 位置信息详情 * @@ -110,7 +200,7 @@ public class LocationAppServiceImpl implements ILocationAppService { @Override public R getLocationPage(LocationPageParam locationPageParam, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) { - //数据初始化,不使用eq条件拼接 + // 数据初始化,不使用eq条件拼接 List formList = locationPageParam.getLocationFormList(); locationPageParam.setLocationFormList(null); String busNo = locationPageParam.getBusNo(); @@ -156,6 +246,10 @@ public class LocationAppServiceImpl implements ILocationAppService { Location location = new Location(); BeanUtils.copyProperties(locationAddOrEditDto, location); location.setFormEnum(Integer.valueOf(locationAddOrEditDto.getFormEnum())); + // 新增病床设置状态为空闲 + if (LocationForm.BED.getValue().equals(Integer.valueOf(locationAddOrEditDto.getFormEnum()))) { + location.setStatusEnum(LocationStatus.IDLE.getValue()); + } // 拼音码 location.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(locationAddOrEditDto.getName())); // 五笔码 @@ -200,18 +294,25 @@ public class LocationAppServiceImpl implements ILocationAppService { /** * 位置分页列表-树型 * + * @param formList 类型 * @param pageNo 当前页码 * @param pageSize 查询条数 + * @param isInHospital 是否住院 * @return 位置分页列表 */ @Override - public R getLocationTree(Integer formKey, Integer pageNo, Integer pageSize) { + public R getLocationTree(List formList, Integer pageNo, Integer pageSize, String isInHospital) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - if (formKey != null) { - queryWrapper.eq(Location::getFormEnum, formKey); + if (formList != null && !formList.isEmpty()) { + queryWrapper.in(Location::getFormEnum, formList); + } + if (Whether.YES.getCode().equals(isInHospital)) { + // 当前登录者的id + Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId(); + List locationIds = practitionerRoleService.getLocationIdsByPractitionerId(practitionerId); + queryWrapper.in(Location::getId, locationIds); } - // 查询位置列表 Page page = locationService.page(new Page<>(pageNo, pageSize), queryWrapper); List locationList = page.getRecords(); diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationAppServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationAppServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationLocationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationLocationAppServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationLocationAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/OrganizationLocationAppServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerAppServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerRoleAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerRoleAppServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerRoleAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/appservice/impl/PractitionerRoleAppServiceImpl.java diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/BodyStructureController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/BodyStructureController.java new file mode 100644 index 0000000000000000000000000000000000000000..8ba0f608707939486fc3250821e2db3ab11493cd --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/BodyStructureController.java @@ -0,0 +1,107 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.basedatamanage.controller; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.MessageUtils; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.web.basedatamanage.appservice.IBodyStructureAppService; +import com.openhis.web.basedatamanage.dto.BodyStructureDto; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +/** + * 身体部位管理controller + * + * @author + * @date 2025-02-21 + */ +@RestController +@RequestMapping("/base-data-manage/body-structure") +@Slf4j +@AllArgsConstructor +public class BodyStructureController { + + private final IBodyStructureAppService bodyStructureService; + + /** + * 身体部位分页列表 + * + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 身体部位分页列表 + */ + @GetMapping(value = "/body") + public R getBodyStructurePage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize, HttpServletRequest request) { + Page bodyStructureTree = bodyStructureService.getBodyStructureTree(pageNo, pageSize, request); + return R.ok(bodyStructureTree, + MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"身体部位信息"})); + } + + /** + * 获取身体部位需要编辑的信息 + * + * @param id 身体部位信息 + * @return 操作结果 + */ + @GetMapping("/body-getById") + public R getOrgInfo(@Validated @RequestParam Long id) { + return bodyStructureService.getBodyStructureInfo(id); + } + + /** + * 添加/编辑身体部位 + * + * @param bodyStructureDto 身体部位信息 + * @return 操作结果 + */ + @PostMapping("/body") + public R addOrEditInventoryReceipt(@Validated @RequestBody BodyStructureDto bodyStructureDto) { + return bodyStructureService.addOrEditBodyStructure(bodyStructureDto); + } + + /** + * 删除身体部位 + * + * @param ids 需要删除的Id + * @return 操作结果 + */ + @DeleteMapping("/body") + public R deleteBodyStructure(@RequestParam String ids) { + return bodyStructureService.deleteBodyStructure(ids); + } + + /** + * 身体部位启用 + * + * @param id 启用数据的Id + * @return 操作结果 + * + */ + @PutMapping("/body-active") + public R activeBodyStructure(@RequestParam Long id) { + return bodyStructureService.activeBodyStructure(id); + } + + /** + * 身体部位停用 + * + * @param id 停用数据的Id + * @return 操作结果 + * + */ + @PutMapping("/body-inactive") + public R inactiveBodyStructure(@RequestParam Long id) { + return bodyStructureService.inactiveBodyStructure(id); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/FrequencyController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/FrequencyController.java new file mode 100644 index 0000000000000000000000000000000000000000..3d2ed964d9072d81786c08e137744b9db6172ae9 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/FrequencyController.java @@ -0,0 +1,79 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.basedatamanage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.MessageUtils; +import com.openhis.administration.domain.Frequency; +import com.openhis.administration.service.IFrequencyService; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.web.basedatamanage.appservice.IOrganizationAppService; +import com.openhis.web.basedatamanage.dto.FrequencyDto; +import com.openhis.web.basedatamanage.dto.OrgLocQueryDto; +import com.openhis.web.basedatamanage.dto.OrganizationDto; +import com.openhis.web.basedatamanage.dto.OrganizationInitDto; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.Collections; +import java.util.List; + +/** + * 频次信息管理controller + * + */ +@RestController +@RequestMapping("/personalization/frequency") +@Slf4j +@AllArgsConstructor +public class FrequencyController { + + private final IFrequencyService frequencyService; + + /** + * 频次详情分页列表 + * + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 机构分页列表 + */ + @GetMapping(value = "/getPageList") + public R getOrganizationPage(@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "100") Integer pageSize, String code,HttpServletRequest request) { + Page pageList= frequencyService.getPageList(pageNo, pageSize, code,request) ; + return R.ok(pageList, + MessageUtils.createMessage(PromptMsgConstant.Common.M00009, new Object[] {"频次详情信息"})); + } + + + @PostMapping("/save") + public R addOrEditFrequency(@Validated @RequestBody FrequencyDto frequencyDto) { + // 创建 Frequency 对象 + Frequency frequency = new Frequency(); + // 使用 BeanUtils 拷贝属性 + BeanUtils.copyProperties(frequencyDto, frequency); + // 获取并转换 dayTimes 字段 + List dayTimesList = frequencyDto.getDayTimes(); + if (dayTimesList != null && !dayTimesList.isEmpty()) { + Collections.sort(dayTimesList); + String dayTimesStr = String.join(",", dayTimesList); // 转换为逗号分隔的字符串 + frequency.setDayTimes(dayTimesStr); // 将转换后的字符串设置到 Frequency 对象 + } + + return R.ok(frequencyService.saveOrUpdate(frequency, new LambdaQueryWrapper().eq(Frequency::getRateCode, frequency.getRateCode())),MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"保存频次详情"})); + } + + @DeleteMapping("{id}") + public R deleteFrequency(@PathVariable Long id) { + return R.ok(frequencyService.removeById(id),MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"删除频次详情"})); + } + + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/LocationController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/LocationController.java similarity index 76% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/LocationController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/LocationController.java index 0a3cd91c4365a53856129adf920c0ee883c07fb1..3ad9df17b172107f9b764a6a8b34aa87aa2c4cc1 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/LocationController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/LocationController.java @@ -3,9 +3,12 @@ */ package com.openhis.web.basedatamanage.controller; +import java.util.List; + import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import com.openhis.web.common.dto.LocationDto; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -45,15 +48,18 @@ public class LocationController { /** * 位置分页列表-树型 * + * @param formList 类型 * @param pageNo 当前页码 * @param pageSize 查询条数 + * @param isInHospital 是否住院 * @return 位置分页列表 */ @GetMapping(value = "/location-page-tree") - public R getLocationPage(@RequestParam(required = false, value = "formKey", defaultValue = "") Integer formKey, + public R getLocationPage(@RequestParam List formList, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { - return locationAppService.getLocationTree(formKey, pageNo, pageSize); + @RequestParam(value = "pageSize", defaultValue = "1000") Integer pageSize, + @RequestParam(value = "isInHospital", defaultValue = "0") String isInHospital) { + return locationAppService.getLocationTree(formList, pageNo, pageSize, isInHospital); } /** @@ -118,4 +124,26 @@ public class LocationController { return locationAppService.deleteLocation(busNo); } + /** + * 启用 + * + * @param locationIdList 位置id + * @return 操作结果 + */ + @PutMapping("/enable") + public R enableLocation(@RequestBody List locationIdList) { + return locationAppService.enableLocation(locationIdList); + } + + /** + * 停用 + * + * @param locationIdList 位置id + * @return 操作结果 + */ + @PutMapping("/deactivate") + public R deactivateLocation(@RequestBody List locationIdList) { + return locationAppService.deactivateLocation(locationIdList); + } + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/OrganizationController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/OrganizationController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/OrganizationController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/OrganizationController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/OrganizationLocationController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/OrganizationLocationController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/OrganizationLocationController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/OrganizationLocationController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerRoleController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerRoleController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerRoleController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/controller/PractitionerRoleController.java diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/BodyStructureDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/BodyStructureDto.java new file mode 100644 index 0000000000000000000000000000000000000000..e49eefae7f98d847ab06fb38f4ce5fc13a62ee6e --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/BodyStructureDto.java @@ -0,0 +1,45 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.basedatamanage.dto; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @author liuhr + * @date 2025-07-23 + */ +@Data +@Accessors(chain = true) +public class BodyStructureDto { + + /** ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + /** 编码 */ + private String busNo; + + /** 名称 */ + private String name; + + /** 状态枚举 */ + private Integer statusEnum; + private String statusEnum_enumText; + + /** 拼音码 */ + private String pyStr; + + /** 五笔码 */ + private String wbStr; + + /** 子集合 */ + private List children = new ArrayList<>(); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/FrequencyDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/FrequencyDto.java new file mode 100644 index 0000000000000000000000000000000000000000..1cb03d516742569d8973f5a5af1e2da27479fb02 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/FrequencyDto.java @@ -0,0 +1,90 @@ +package com.openhis.web.basedatamanage.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @Description TODO + * @Author + * @Date 2025/8/25 + */ +@Data +public class FrequencyDto { + /** + * 频次代码,唯一标识与字典表对应 + */ + private String rateCode; + + /** + * 频次名称 + */ + private String name; + + /** + * 每天执行的次数 + */ + private Integer dayCount; + + /** + * 每次执行之间的间隔(天数) + */ + private Integer dayInterval; + + /** + * 每天的具体执行时间点,逗号分隔 + */ + private List dayTimes; + + /** + * 是否周期性每周执行,0 为否,1 为是 + */ + private Integer weekCycleFlag; + + /** + * 每周执行的间隔,单位为周 + */ + private Integer weekInterval; + + /** + * 每周执行的次数 + */ + private Integer weekTimes; + + /** + * 是否为连续执行,0 为否,1 为是 + */ + private Integer continueFlag; + + /** + * 执行总次数,记录任务累计执行次数 + */ + private Integer totalExecutionCount; + + /** + * 任务执行周期长度 + */ + private Integer executionPeriod; + + /** + * 任务执行周期的单位,如 day、week、month + */ + private String executionPeriodUnit; + + /** + * 第三方代码,外部系统使用 + */ + private String thirdCode; + + /** + * 备注信息 + */ + private String memo; + + /** + * 并发戳,用于版本控制和并发冲突检测 + */ + private Integer concurrencyStamp; + + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationAddOrEditDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationAddOrEditDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationAddOrEditDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationAddOrEditDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationInfoDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationInfoDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationInfoDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationInfoDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationPageParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationPageParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationPageParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/LocationPageParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryDto.java similarity index 86% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryDto.java index 3763684ea1335a48724e722c02b46aefd644971d..c88b9ef0ee40bc6ff9aa8196c1311829e952c0cd 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryDto.java @@ -4,10 +4,7 @@ package com.openhis.web.basedatamanage.dto; import java.sql.Time; -import java.util.Date; -import java.util.Timer; -import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; @@ -44,7 +41,9 @@ public class OrgLocQueryDto { * 诊疗定义id */ @JsonSerialize(using = ToStringSerializer.class) + @Dict(dictCode = "id", dictText = "name", dictTable = "wor_activity_definition") private Long activityDefinitionId; + private String activityDefinitionId_dictText; /** * 诊疗类型 @@ -54,11 +53,11 @@ public class OrgLocQueryDto { private String activityCategoryCode_dictText; /** 开始时间 */ - //@JsonFormat(pattern = "HH:mm:ss") + // @JsonFormat(pattern = "HH:mm:ss") private Time startTime; /** 结束时间 */ - //@JsonFormat(pattern = "HH:mm:ss") + // @JsonFormat(pattern = "HH:mm:ss") private Time endTime; /** 显示顺序 */ diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrgLocQueryParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrganizationDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrganizationDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrganizationDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrganizationDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrganizationInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrganizationInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrganizationInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/OrganizationInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractRoleSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractRoleSearchParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractRoleSearchParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractRoleSearchParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractSearchParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractSearchParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractSearchParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerOrgAndLocationDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerOrgAndLocationDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerOrgAndLocationDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerOrgAndLocationDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRoleDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRoleDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRoleDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRoleDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRolesDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRolesDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRolesDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/PractitionerRolesDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/SelectableOrgDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/SelectableOrgDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/SelectableOrgDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/SelectableOrgDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/UserAndPractitionerDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/UserAndPractitionerDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/UserAndPractitionerDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/dto/UserAndPractitionerDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basedatamanage/mapper/PractitionerAppAppMapper.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/controller/HealthcareServiceController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/controller/HealthcareServiceController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/controller/HealthcareServiceController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/controller/HealthcareServiceController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/dto/ChargeItemDefinitionFormData.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/ChargeItemDefinitionFormData.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/dto/ChargeItemDefinitionFormData.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/ChargeItemDefinitionFormData.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceAddOrUpdateParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceAddOrUpdateParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceAddOrUpdateParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceAddOrUpdateParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceFormData.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceFormData.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceFormData.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceFormData.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/dto/HealthcareServiceInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/mapper/HealthcareServiceBizMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/mapper/HealthcareServiceBizMapper.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/basicservice/mapper/HealthcareServiceBizMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/basicservice/mapper/HealthcareServiceBizMapper.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/catalogmanage/appservice/ICatalogService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/catalogmanage/appservice/ICatalogService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/catalogmanage/appservice/ICatalogService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/catalogmanage/appservice/ICatalogService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/catalogmanage/appservice/impl/CatalogServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/catalogmanage/appservice/impl/CatalogServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/catalogmanage/appservice/impl/CatalogServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/catalogmanage/appservice/impl/CatalogServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/catalogmanage/controller/CatalogController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/catalogmanage/controller/CatalogController.java similarity index 70% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/catalogmanage/controller/CatalogController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/catalogmanage/controller/CatalogController.java index 173be8f4d434c8751ad08ab367ba18f83bcd0493..5c3ec3d4c321b8dac029530388d223e3e74bfaa6 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/catalogmanage/controller/CatalogController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/catalogmanage/controller/CatalogController.java @@ -3,23 +3,21 @@ */ package com.openhis.web.catalogmanage.controller; -import com.core.common.annotation.Anonymous; -import com.core.common.core.domain.R; -import com.openhis.web.catalogmanage.appservice.ICatalogService; -import com.openhis.web.patientmanage.appservice.IPatientInformationService; -import com.openhis.web.patientmanage.dto.PatientInfoSearchParam; -import com.openhis.web.ybmanage.config.YbServiceConfig; -import io.swagger.models.auth.In; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; +import javax.servlet.http.HttpServletRequest; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; +import com.core.common.annotation.Anonymous; +import com.core.common.core.domain.R; +import com.openhis.web.catalogmanage.appservice.ICatalogService; +import com.openhis.web.ybmanage.config.YbServiceConfig; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; /** * 医保目录 @@ -37,6 +35,7 @@ public class CatalogController { ICatalogService iCatalogService; @Autowired YbServiceConfig ybServiceConfig; + /** * 分页查询医保目录信息,可选条件 * @@ -47,12 +46,10 @@ public class CatalogController { */ @Anonymous @GetMapping("/page") - public R getPage(Integer catalogType, - @RequestParam(value = "searchKey", defaultValue = "") String searchKey, - @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { - + public R getPage(Integer catalogType, @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { System.out.println(ybServiceConfig.getUrl()); - return R.ok(iCatalogService.getPage(catalogType, searchKey, pageNo, pageSize,request)); + return R.ok(iCatalogService.getPage(catalogType, searchKey, pageNo, pageSize, request)); } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/catalogmanage/mapper/CatalogMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/catalogmanage/mapper/CatalogMapper.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/catalogmanage/mapper/CatalogMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/catalogmanage/mapper/CatalogMapper.java diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IInpatientChargeAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IInpatientChargeAppService.java new file mode 100644 index 0000000000000000000000000000000000000000..778152f692fe60143160114ead91da11a466c81b --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IInpatientChargeAppService.java @@ -0,0 +1,66 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.chargemanage.appservice; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import com.core.common.core.domain.R; +import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; +import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto; + +/** + * 门诊收费 service + * + * @author zwh + * @date 2025-03-12 + */ +public interface IInpatientChargeAppService { + + /** + * 查询就诊患者分页列表 + * + * @param encounterPatientPageParam 查询条件 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @param request 请求 + * @return 就诊患者分页列表 + */ + R getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, Integer pageNo, + Integer pageSize, HttpServletRequest request); + + /** + * 根据就诊id查询患者处方列表 + * + * @param encounterId 就诊id + * @return 患者处方列表 + */ + List getEncounterPatientPrescription(Long encounterId, String startTime, + String endTime); + + /** + * 医保转自费 + * + * @param encounterId 就诊id + * @return 操作结果 + */ + R changeToSelfPay(Long encounterId); + + /** + * 自费转医保 + * + * @param encounterId 就诊id + * @return 操作结果 + */ + R changeToMedicalInsurance(Long encounterId); + + /** + * 门诊收费页面初始化 + * + * @return 初始化信息 + */ + R outpatientChargeInit(); +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientChargeAppService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientPricingAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientPricingAppService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientPricingAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientPricingAppService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java similarity index 91% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java index ba2411b07ea406de17dcb24f01ac38fc1661f5cd..9ed70df6c206a9de3115be4f0a0254659969ebce 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRefundAppService.java @@ -59,9 +59,11 @@ public interface IOutpatientRefundAppService { * 根据就诊id查询患者的退费账单 * * @param encounterId 就诊id + * @param billDateSTime 收费时间开始 + * @param billDateETime 收费时间结束 * @return 退费账单列表 */ - R getEncounterPatientRefund(Long encounterId); + R getEncounterPatientRefund(Long encounterId, String billDateSTime, String billDateETime); /** * 根据就诊id查询患者因退费重新生成的账单 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRegistrationAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRegistrationAppService.java similarity index 94% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRegistrationAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRegistrationAppService.java index d56d4f835e4891782dd816c66e63b7eb0c0b99d1..0497e04e3da620fd9b0a13f69f66642a3c46e4d7 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRegistrationAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/IOutpatientRegistrationAppService.java @@ -26,13 +26,6 @@ public interface IOutpatientRegistrationAppService { */ Page getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize); - /** - * 查询费用性质 - * - * @return 费用性质 - */ - List getContractMetadata(); - /** * 查询门诊科室数据 * diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/InpatientChargeAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/InpatientChargeAppServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..b4243141c7493d3b88b4d8836b470e9789d5e391 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/InpatientChargeAppServiceImpl.java @@ -0,0 +1,186 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.chargemanage.appservice.impl; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.AgeCalculatorUtil; +import com.core.common.utils.MessageUtils; +import com.openhis.administration.service.IAccountService; +import com.openhis.administration.service.IChargeItemService; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.AdministrativeGender; +import com.openhis.common.enums.ChargeItemContext; +import com.openhis.common.enums.ChargeItemStatus; +import com.openhis.common.enums.EncounterClass; +import com.openhis.common.utils.EnumUtils; +import com.openhis.common.utils.HisQueryUtils; +import com.openhis.web.chargemanage.appservice.IInpatientChargeAppService; +import com.openhis.web.chargemanage.dto.EncounterPatientPageDto; +import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; +import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto; +import com.openhis.web.chargemanage.dto.OutpatientInitDto; +import com.openhis.web.chargemanage.mapper.InpatientChargeAppMapper; + +/** + * 门诊收费 impl + * + * @author zwh + * @date 2025-03-12 + */ +@Service +public class InpatientChargeAppServiceImpl implements IInpatientChargeAppService { + + @Autowired + private InpatientChargeAppMapper inpatientChargeAppMapper; + @Autowired + private IChargeItemService chargeItemService; + @Autowired + private IAccountService accountService; + + /** + * 门诊收费页面初始化 + * + * @return 初始化信息 + */ + @Override + public R outpatientChargeInit() { + OutpatientInitDto initDto = new OutpatientInitDto(); + List chargeItemStatusOptions = new ArrayList<>(); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.PLANNED.getValue(), + ChargeItemStatus.PLANNED.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLABLE.getValue(), + ChargeItemStatus.BILLABLE.getInfo())); + chargeItemStatusOptions.add(new OutpatientInitDto.chargeItemStatusOption(ChargeItemStatus.BILLED.getValue(), + ChargeItemStatus.BILLED.getInfo())); + initDto.setChargeItemStatusOptions(chargeItemStatusOptions); + return R.ok(initDto); + } + + /** + * 查询就诊患者分页列表 + * + * @param encounterPatientPageParam 查询条件 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @param request 请求 + * @return 就诊患者分页列表 + */ + @Override + public R getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, String searchKey, + Integer pageNo, Integer pageSize, HttpServletRequest request) { + // 构建查询条件 + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper( + encounterPatientPageParam, searchKey, + new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientWbStr, CommonConstants.FieldName.PatientPyStr, + CommonConstants.FieldName.PatientName, CommonConstants.FieldName.PatientBusNo, + CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)), + request); + // 就诊患者分页列表 + Page encounterPatientPage = inpatientChargeAppMapper + .selectEncounterPatientPage(EncounterClass.IMP.getValue(), new Page<>(pageNo, pageSize), queryWrapper); + + encounterPatientPage.getRecords().forEach(e -> { + // 性别枚举 + e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum())); + // 收费状态枚举 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum())); + // 计算年龄 + e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : ""); + }); + return R.ok(encounterPatientPage); + } + + /** + * 根据就诊id查询患者处方列表 + * + * @param encounterId 就诊id + * @return 患者处方列表 + */ + @Override + public List getEncounterPatientPrescription(Long encounterId, String startTime, + String endTime) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); + + startTime = startTime + "000000"; + + endTime = endTime + "235959"; + + Date startDate = null; + Date endDate = null; + try { + startDate = sdf.parse(startTime); + endDate = sdf.parse(endTime); + } catch (ParseException e) { + e.printStackTrace(); + } + + List prescriptionDtoList = + inpatientChargeAppMapper.selectEncounterPatientPrescription(encounterId, + ChargeItemContext.ACTIVITY.getValue(), ChargeItemContext.MEDICATION.getValue(), + ChargeItemContext.DEVICE.getValue(), ChargeItemContext.REGISTER.getValue(), + ChargeItemStatus.PLANNED.getValue(), ChargeItemStatus.BILLABLE.getValue(), + ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(), + ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(), startDate, endDate); + prescriptionDtoList.forEach(e -> { + // 收费状态枚举 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getStatusEnum())); + }); + return prescriptionDtoList; + } + + /** + * 医保转自费 + * + * @param encounterId 就诊id + * @return 操作结果 + */ + @Override + public R changeToSelfPay(Long encounterId) { + // 获取就诊患者的自费账户id + Long accountId = accountService.getSelfPayAccount(encounterId); + if (accountId == null) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"自费账户"})); + } + // 医保转自费 + boolean result = chargeItemService.updateAccountType(encounterId, accountId); + if (!result) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null)); + } + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + + /** + * 自费转医保 + * + * @param encounterId 就诊id + * @return 操作结果 + */ + @Override + public R changeToMedicalInsurance(Long encounterId) { + // 获取就诊患者的医保账户id + Long accountId = accountService.getMedicalInsuranceAccount(encounterId); + if (accountId == null) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"})); + } + // 自费转医保 + boolean result = chargeItemService.updateAccountType(encounterId, accountId); + if (!result) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null)); + } + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java similarity index 90% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java index dc040a8caca64a596d1d41b183b66638d867d936..155c5085bf5909a7280d075d88af72a7cd61e80d 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientChargeAppServiceImpl.java @@ -25,6 +25,7 @@ import com.openhis.common.constant.PromptMsgConstant; import com.openhis.common.enums.AdministrativeGender; import com.openhis.common.enums.ChargeItemContext; import com.openhis.common.enums.ChargeItemStatus; +import com.openhis.common.enums.EncounterClass; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; import com.openhis.web.chargemanage.appservice.IOutpatientChargeAppService; @@ -90,8 +91,8 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)), request); // 就诊患者分页列表 - Page encounterPatientPage = - outpatientChargeAppMapper.selectEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper); + Page encounterPatientPage = outpatientChargeAppMapper + .selectEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper, EncounterClass.AMB.getValue()); encounterPatientPage.getRecords().forEach(e -> { // 性别枚举 @@ -137,14 +138,14 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi // 获取就诊患者的自费账户id Long accountId = accountService.getSelfPayAccount(encounterId); if (accountId == null) { - R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null)); + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"自费账户"})); } // 医保转自费 boolean result = chargeItemService.updateAccountType(encounterId, accountId); if (!result) { - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null)); + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null)); } - return R.ok(); + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); } /** @@ -158,13 +159,13 @@ public class OutpatientChargeAppServiceImpl implements IOutpatientChargeAppServi // 获取就诊患者的医保账户id Long accountId = accountService.getMedicalInsuranceAccount(encounterId); if (accountId == null) { - R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null)); + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00008, new Object[] {"医保账户"})); } // 自费转医保 boolean result = chargeItemService.updateAccountType(encounterId, accountId); if (!result) { - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null)); + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Payment.M00009, null)); } - return R.ok(); + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java similarity index 98% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java index 17852af9fbaa011de2a97a63aa32bfe1cffc115f..caaffbea8baf04b60d86f4cc50fc5f5a27ce0250 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java @@ -17,6 +17,8 @@ import com.openhis.web.doctorstation.appservice.IDoctorStationMainAppService; import com.openhis.web.doctorstation.dto.AdviceBaseDto; import com.openhis.web.doctorstation.dto.PatientInfoDto; +import java.util.List; + /** * 门诊划价 impl * @@ -66,7 +68,7 @@ public class OutpatientPricingAppServiceImpl implements IOutpatientPricingAppSer public IPage getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId, Long organizationId, Integer pageNo, Integer pageSize) { return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, null, - organizationId, pageNo, pageSize, Whether.YES.getValue()); + organizationId, pageNo, pageSize, Whether.YES.getValue(), List.of(1, 2, 3)); } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java similarity index 82% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java index 6b46e98c4c965075098eb266b7ade730097d7f56..a0b85578b736121693a1fa8a26619ffccf23d0c4 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRefundAppServiceImpl.java @@ -22,6 +22,7 @@ import com.core.common.exception.ServiceException; import com.core.common.utils.AgeCalculatorUtil; import com.core.common.utils.AssignSeqUtil; import com.core.common.utils.MessageUtils; +import com.core.common.utils.SecurityUtils; import com.openhis.administration.domain.ChargeItem; import com.openhis.administration.service.IChargeItemService; import com.openhis.common.constant.CommonConstants; @@ -168,9 +169,9 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi MedicationRequest medicationRequest = medicationRequestService.getById(creatdDto.getRequestId()); // 生成新的药品请求 medicationRequest.setId(null); // 药品请求id - medicationRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 10)); // 药品请求编码 - medicationRequest.setPrescriptionNo( - String.valueOf(new StringBuilder("C").append(creatdDto.getPrescriptionNo()))); // 处方号 + medicationRequest + .setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); // 药品请求编码 + medicationRequest.setPrescriptionNo(String.valueOf("C" + creatdDto.getPrescriptionNo())); // 处方号 medicationRequestService.save(medicationRequest); // 药品发放查询 @@ -178,7 +179,8 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi medicationDispenseService.getById(creatdDto.getDispenseId()); // 生成新的药品发放 medicationDispense.setId(null); // 药品发放id - medicationDispense.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 10)); // 药品发放编码 + medicationDispense + .setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4)); // 药品发放编码 medicationDispense.setMedReqId(medicationRequest.getId()); // 药品请求id medicationDispenseService.save(medicationDispense); @@ -188,8 +190,7 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi chargeItem.setRefundId(chargeItem.getId());// 退费id chargeItem.setId(null); // 费用项id chargeItem.setBusNo(AssignSeqEnum.CHARGE_ITEM_NO.getPrefix().concat(medicationRequest.getBusNo())); // 编码 - chargeItem.setPrescriptionNo( - String.valueOf(new StringBuilder("C").append(creatdDto.getPrescriptionNo()))); // 处方号 + chargeItem.setPrescriptionNo(String.valueOf("C" + creatdDto.getPrescriptionNo())); // 处方号 chargeItem.setServiceId(medicationRequest.getId()); // 医疗服务ID chargeItem.setStatusEnum(ChargeItemStatus.PLANNED.getValue());// 收费单状态:待收费 chargeItemService.save(chargeItem); @@ -199,7 +200,7 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi ServiceRequest serviceRequest = serviceRequestService.getById(creatdDto.getRequestId()); // 生成新的服务请求 serviceRequest.setId(null); // 服务请求id - serviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 10)); // 服务请求编码 + serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码 serviceRequestService.save(serviceRequest); // 费用项查询 @@ -217,14 +218,14 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi DeviceRequest deviceRequest = deviceRequestService.getById(creatdDto.getRequestId()); // 生成新的耗材请求 deviceRequest.setId(null); // 耗材请求id - deviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 10)); // 耗材请求编码 + deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4)); // 耗材请求编码 deviceRequestService.save(deviceRequest); // 耗材发放查询 DeviceDispense deviceDispense = deviceDispenseService.getById(creatdDto.getDispenseId()); // 生成新的耗材发放 deviceDispense.setId(null); // 耗材id - deviceDispense.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 10)); // 器材发放id + deviceDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_DIS_NO.getPrefix(), 4)); // 器材发放id deviceDispense.setDeviceReqId(deviceRequest.getId()); // 器材请求id deviceDispenseService.save(deviceDispense); @@ -269,13 +270,13 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi } // 生成药品请求(退药) medicationRequest.setId(null); // 药品请求id - medicationRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 10)); // 药品请求编码 + medicationRequest + .setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_RES_NO.getPrefix(), 4)); // 药品请求编码 medicationRequest.setQuantity(dto.getQuantity() * (-1)); // 请求数量 medicationRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码 - medicationRequest.setStatusEnum(RequestStatus.IN_REFUND.getValue()); // 请求状态 + medicationRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态 medicationRequest.setRefundMedicineId(dto.getRequestId()); // 退药id - medicationRequest - .setPrescriptionNo(String.valueOf(new StringBuilder("T").append(dto.getPrescriptionNo()))); + medicationRequest.setPrescriptionNo(String.valueOf("T" + dto.getPrescriptionNo())); medicationRequestService.save(medicationRequest); } else { @@ -292,14 +293,14 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi // 服务请求查询 ServiceRequest serviceRequest = serviceRequestService.getById(dto.getRequestId()); if (serviceRequest.getRefundServiceId() != null) { - throw new ServiceException("已申请退药,请勿重复申请"); + throw new ServiceException("已申请退费,请勿重复申请"); } // 生成服务请求(取消服务) serviceRequest.setId(null); // 服务请求id - serviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 10)); // 服务请求编码 + serviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.SERVICE_RES_NO.getPrefix(), 4)); // 服务请求编码 serviceRequest.setQuantity(dto.getQuantity() * (-1)); // 请求数量 serviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码 - serviceRequest.setStatusEnum(RequestStatus.ENDED.getValue()); // 请求状态 + serviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态 serviceRequest.setRefundServiceId(dto.getRequestId()); // 退药id serviceRequestService.save(serviceRequest); @@ -316,36 +317,22 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi || DispenseStatus.PART_COMPLETED.getValue().equals(dto.getDispenseStatus())) { // 耗材请求查询 DeviceRequest deviceRequest = deviceRequestService.getById(dto.getRequestId()); - if (deviceRequest.getRefundDeviceId() != null) { - throw new ServiceException("已申请退药,请勿重复申请"); - } - // 生成耗材请求(退耗材) - deviceRequest.setId(null); // 耗材请求id - deviceRequest.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 10)); // 耗材请求编码 - deviceRequest.setQuantity(dto.getQuantity() * (-1)); // 请求数量 - deviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码 - deviceRequest.setStatusEnum(RequestStatus.IN_REFUND.getValue()); // 请求状态 - deviceRequest.setRefundDeviceId(dto.getRequestId()); // 退药id - deviceRequestService.save(deviceRequest); - - } else { - if (DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus()) - && NotPerformedReason.REFUND.getValue().equals(dto.getNotPerformedReason())) { - throw new ServiceException("已申请退药,请勿重复申请"); + if (deviceRequest.getRefundDeviceId() == null) { + // 生成耗材请求(退耗材) + deviceRequest.setId(null); // 耗材请求id + deviceRequest.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEVICE_RES_NO.getPrefix(), 4)); // 耗材请求编码 + deviceRequest.setQuantity(dto.getQuantity() * (-1)); // 请求数量 + deviceRequest.setUnitCode(dto.getUnitCode()); // 请求单位编码 + deviceRequest.setStatusEnum(RequestStatus.CANCELLED.getValue()); // 请求状态 + deviceRequest.setRefundDeviceId(dto.getRequestId()); // 退药id + deviceRequestService.save(deviceRequest); } + } else if (!DispenseStatus.STOPPED.getValue().equals(dto.getDispenseStatus())) { devDisIdList.add(dto.getDispenseId()); } } } - // // 付款id集合 - // List paymentIdList = - // refundItemList.stream().map(RefundItemParam::getPaymentId).collect(Collectors.toList()); - // // 付款id去重 - // paymentIdList = paymentIdList.stream().distinct().collect(Collectors.toList()); - // // 更新支付状态:退款中 - // paymentReconciliationService.updateRefundingStatus(paymentIdList); - // 更新收费状态:退费中 chargeItemService.updateRefundChargeStatus(chargeItemIdList); @@ -387,10 +374,11 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.idCard)), request); // 就诊患者分页列表 - Page encounterPatientPage = outpatientRefundAppMapper.selectBilledEncounterPatientPage( - new Page<>(pageNo, pageSize), queryWrapper, ChargeItemStatus.BILLED.getValue(), - ChargeItemStatus.REFUNDING.getValue(), ChargeItemStatus.REFUNDED.getValue(), - ChargeItemStatus.PART_REFUND.getValue(), AccountType.MEDICAL_ELECTRONIC_CERTIFICATE.getCode()); + Page encounterPatientPage = + outpatientRefundAppMapper.selectBilledEncounterPatientPage(new Page<>(pageNo, pageSize), queryWrapper, + ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDING.getValue(), + ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(), + AccountType.MEDICAL_ELECTRONIC_CERTIFICATE.getCode(), EncounterClass.AMB.getValue()); encounterPatientPage.getRecords().forEach(e -> { // 性别枚举 @@ -409,14 +397,17 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi * 根据就诊id查询患者的退费账单 * * @param encounterId 就诊id + * @param billDateSTime 收费时间开始 + * @param billDateETime 收费时间结束 * @return 退费账单列表 */ @Override - public R getEncounterPatientRefund(Long encounterId) { - List refundDtoList = outpatientRefundAppMapper.selectEncounterPatientRefund( - encounterId, ChargeItemStatus.REFUNDING.getValue(), ChargeItemStatus.REFUNDED.getValue(), - ChargeItemStatus.PART_REFUND.getValue(), CommonConstants.TableName.WOR_SERVICE_REQUEST, - CommonConstants.TableName.WOR_DEVICE_REQUEST, CommonConstants.TableName.MED_MEDICATION_REQUEST); + public R getEncounterPatientRefund(Long encounterId, String billDateSTime, String billDateETime) { + List refundDtoList = + outpatientRefundAppMapper.selectEncounterPatientRefund(encounterId, ChargeItemStatus.REFUNDING.getValue(), + ChargeItemStatus.REFUNDED.getValue(), ChargeItemStatus.PART_REFUND.getValue(), + CommonConstants.TableName.WOR_SERVICE_REQUEST, CommonConstants.TableName.WOR_DEVICE_REQUEST, + CommonConstants.TableName.MED_MEDICATION_REQUEST, billDateSTime, billDateETime); refundDtoList.forEach(e -> { // 收费状态枚举 e.setChargeStatus_enumText(EnumUtils.getInfoByValue(ChargeItemStatus.class, e.getChargeStatus())); @@ -467,18 +458,22 @@ public class OutpatientRefundAppServiceImpl implements IOutpatientRefundAppServi new LambdaQueryWrapper().in(MedicationRequest::getRefundMedicineId, medReqIdList)); if (!medicationRequestList.isEmpty()) { if (medicationRequestList.stream().map(MedicationRequest::getStatusEnum) - .anyMatch(x -> x.equals(RequestStatus.IN_REFUND.getValue()))) { + .anyMatch(x -> x.equals(RequestStatus.CANCELLED.getValue()))) { throw new ServiceException("请先退药后再退费"); } } } - if (!devReqIdList.isEmpty()) { - List deviceRequestList = deviceRequestService - .list(new LambdaQueryWrapper().in(DeviceRequest::getRefundDeviceId, devReqIdList)); - if (!deviceRequestList.isEmpty()) { - if (deviceRequestList.stream().map(DeviceRequest::getStatusEnum) - .anyMatch(x -> x.equals(RequestStatus.IN_REFUND.getValue()))) { - throw new ServiceException("请先退耗材后再退费"); + String fixmedinsCode = + SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.FIXMEDINS_CODE); + if (!HospitalCodeEnum.CCU.getCode().equals(fixmedinsCode)) { + if (!devReqIdList.isEmpty()) { + List deviceRequestList = deviceRequestService + .list(new LambdaQueryWrapper().in(DeviceRequest::getRefundDeviceId, devReqIdList)); + if (!deviceRequestList.isEmpty()) { + if (deviceRequestList.stream().map(DeviceRequest::getStatusEnum) + .anyMatch(x -> x.equals(RequestStatus.CANCELLED.getValue()))) { + throw new ServiceException("请先退耗材后再退费"); + } } } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java similarity index 66% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java index 9272a1efbebbc0eb4f0beed80f3d3659f1c0c39c..8ae4fb209db0454fec2f1a5ac9085913f873c071 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java @@ -9,9 +9,6 @@ import java.util.stream.Collectors; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import com.openhis.administration.domain.*; -import com.openhis.financial.domain.PaymentReconciliation; -import liquibase.pro.packaged.A; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -20,10 +17,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.core.domain.R; import com.core.common.utils.AgeCalculatorUtil; -import com.core.common.utils.AssignSeqUtil; import com.core.common.utils.MessageUtils; import com.core.common.utils.SecurityUtils; +import com.core.common.utils.StringUtils; import com.core.common.utils.bean.BeanUtils; +import com.openhis.administration.domain.*; import com.openhis.administration.mapper.PatientMapper; import com.openhis.administration.service.*; import com.openhis.common.constant.CommonConstants; @@ -32,19 +30,18 @@ import com.openhis.common.enums.*; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisPageUtils; import com.openhis.common.utils.HisQueryUtils; -import com.openhis.financial.domain.Contract; -import com.openhis.financial.mapper.ContractMapper; -import com.openhis.financial.service.IContractService; +import com.openhis.financial.domain.PaymentReconciliation; import com.openhis.web.basicservice.dto.HealthcareServiceDto; import com.openhis.web.basicservice.mapper.HealthcareServiceBizMapper; import com.openhis.web.chargemanage.appservice.IOutpatientRegistrationAppService; -import com.openhis.web.chargemanage.dto.*; +import com.openhis.web.chargemanage.dto.CurrentDayEncounterDto; +import com.openhis.web.chargemanage.dto.OrgMetadata; +import com.openhis.web.chargemanage.dto.PatientMetadata; +import com.openhis.web.chargemanage.dto.PractitionerMetadata; import com.openhis.web.chargemanage.mapper.OutpatientRegistrationAppMapper; -import com.openhis.web.doctorstation.appservice.IDoctorStationAdviceAppService; import com.openhis.web.paymentmanage.appservice.IPaymentRecService; import com.openhis.web.paymentmanage.dto.CancelPaymentDto; import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto; -import com.openhis.workflow.service.IServiceRequestService; import com.openhis.yb.model.CancelRegPaymentModel; import com.openhis.yb.service.YbManager; @@ -57,9 +54,6 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra @Resource PatientMapper patientMapper; - @Resource - ContractMapper contractMapper; - @Resource OutpatientRegistrationAppMapper outpatientRegistrationAppMapper; @@ -69,12 +63,6 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra @Resource IEncounterService iEncounterService; - @Resource - IEncounterLocationService iEncounterLocationService; - - @Resource - IEncounterParticipantService iEncounterParticipantService; - @Resource IAccountService iAccountService; @@ -88,41 +76,40 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra YbManager ybManager; @Resource - IDoctorStationAdviceAppService iDoctorStationAdviceAppService; - - @Resource - AssignSeqUtil assignSeqUtil; - - @Resource - IServiceRequestService iServiceRequestService; - - @Resource - IContractService iContractService; + IPaymentRecService iPaymentRecService; @Resource - IPaymentRecService iPaymentRecService; + IPatientIdentifierService patientIdentifierService; /** * 门诊挂号 - 查询患者信息 * * @param searchKey 模糊查询关键字 - * @param pageNo 当前页 - * @param pageSize 每页多少条 + * @param pageNo 当前页 + * @param pageSize 每页多少条 * @return 患者信息 */ @Override public Page getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize) { // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey, - new HashSet<>(Arrays.asList("id_card", "name", "py_str", "wb_str")), null); + new HashSet<>(Arrays.asList("id_card", "name", "py_str", "wb_str")), null); // 设置排序 queryWrapper.orderByDesc("update_time"); + // 通过证件号匹配 patient + if (StringUtils.isNotEmpty(searchKey)) { + PatientIdentifier patientIdentifier = patientIdentifierService + .getOne(new LambdaQueryWrapper().eq(PatientIdentifier::getIdentifierNo, searchKey)); + if (patientIdentifier != null) { + queryWrapper.or(q -> q.eq("id", patientIdentifier.getPatientId())); + } + } // 患者信息 Page patientMetadataPage = - HisPageUtils.selectPage(patientMapper, queryWrapper, pageNo, pageSize, PatientMetadata.class); + HisPageUtils.selectPage(patientMapper, queryWrapper, pageNo, pageSize, PatientMetadata.class); // 现有就诊过的患者id集合 List patientIdList = - iEncounterService.list().stream().map(e -> e.getPatientId()).collect(Collectors.toList()); + iEncounterService.list().stream().map(e -> e.getPatientId()).collect(Collectors.toList()); patientMetadataPage.getRecords().forEach(e -> { // 性别枚举 @@ -131,34 +118,12 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra e.setAge(e.getBirthDate() != null ? AgeCalculatorUtil.getAge(e.getBirthDate()) : ""); // 初复诊 e.setFirstEnum_enumText(patientIdList.contains(e.getId()) ? EncounterType.FOLLOW_UP.getInfo() - : EncounterType.INITIAL.getInfo()); + : EncounterType.INITIAL.getInfo()); }); return patientMetadataPage; } - /** - * 查询费用性质 - * - * @return 费用性质 - */ - @Override - public List getContractMetadata() { - // TODO: Contract表的基础数据维护还没做,具体不知道状态字段的取值是什么,先查询默认值为0的数据 - List ContractList = - contractMapper.selectList(new LambdaQueryWrapper().eq(Contract::getStatusEnum, 0)); - // 复制同名字段并 return - return ContractList.stream().map(contract -> { - ContractMetadata metadata = new ContractMetadata(); - try { - BeanUtils.copyProperties(contract, metadata); - } catch (Exception e) { - e.printStackTrace(); - } - return metadata; - }).collect(Collectors.toList()); - } - /** * 查询门诊科室数据 * @@ -167,7 +132,7 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra @Override public List getOrgMetadata() { List list = - iOrganizationService.getList(OrganizationType.DEPARTMENT.getValue(), OrganizationClass.CLINIC.getValue()); + iOrganizationService.getList(OrganizationType.DEPARTMENT.getValue(), OrganizationClass.CLINIC.getValue()); List orgMetadataList = new ArrayList<>(); OrgMetadata orgMetadata; for (Organization organization : list) { @@ -181,21 +146,21 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra /** * 根据科室id筛选医生 * - * @param orgId 科室ID + * @param orgId 科室ID * @param searchKey 模糊查询关键字 - * @param pageNo 当前页 - * @param pageSize 每页多少条 + * @param pageNo 当前页 + * @param pageSize 每页多少条 * @return 筛选医生 */ @Override public IPage getPractitionerMetadataByLocationId(Long orgId, String searchKey, Integer pageNo, - Integer pageSize) { + Integer pageSize) { // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey, - new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null); + new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null); IPage practitionerMetadataPage = - outpatientRegistrationAppMapper.getPractitionerMetadataPage(new Page<>(pageNo, pageSize), orgId, - PractitionerRoles.DOCTOR.getCode(), queryWrapper); + outpatientRegistrationAppMapper.getPractitionerMetadataPage(new Page<>(pageNo, pageSize), orgId, + PractitionerRoles.DOCTOR.getCode(), queryWrapper); practitionerMetadataPage.getRecords().forEach(e -> { // 性别 e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum())); @@ -207,22 +172,22 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra * 根据机构id筛选服务项目 * * @param organizationId 机构id - * @param searchKey 模糊查询关键字 - * @param pageNo 当前页 - * @param pageSize 每页多少条 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 * @return 服务项目 */ @Override public IPage getHealthcareMetadataByOrganizationId(Long organizationId, String searchKey, - Integer pageNo, Integer pageSize) { + Integer pageNo, Integer pageSize) { // 构建查询条件 HealthcareServiceDto healthcareServiceDto = new HealthcareServiceDto(); healthcareServiceDto.setOfferedOrgId(organizationId); QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(healthcareServiceDto, - searchKey, new HashSet<>(Arrays.asList("name", "charge_name")), null); + searchKey, new HashSet<>(Arrays.asList("name", "charge_name")), null); return healthcareServiceBizMapper.getHealthcareServicePage(new Page<>(pageNo, pageSize), - CommonConstants.TableName.ADM_HEALTHCARE_SERVICE, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, - queryWrapper); + CommonConstants.TableName.ADM_HEALTHCARE_SERVICE, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, + queryWrapper); } /** @@ -240,31 +205,32 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra iEncounterService.returnRegister(cancelRegPaymentDto.getEncounterId()); // 查询账户信息 Account account = iAccountService - .getOne(new LambdaQueryWrapper().eq(Account::getEncounterId, cancelRegPaymentDto.getEncounterId()) - .ne(Account::getTypeCode, AccountType.PERSONAL_CASH_ACCOUNT.getCode()) - .eq(Account::getEncounterFlag, Whether.YES.getValue())); + .getOne(new LambdaQueryWrapper().eq(Account::getEncounterId, cancelRegPaymentDto.getEncounterId()) + .ne(Account::getTypeCode, AccountType.PERSONAL_CASH_ACCOUNT.getCode()) + .eq(Account::getEncounterFlag, Whether.YES.getValue())); CancelPaymentDto cancelPaymentDto = new CancelPaymentDto(); BeanUtils.copyProperties(cancelRegPaymentDto, cancelPaymentDto); // 开通医保的处理 if ("1".equals(SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH)) - && account != null && !"0000".equals(account.getContractNo())) { + && account != null && !CommonConstants.BusinessName.DEFAULT_CONTRACT_NO.equals(account.getContractNo())) { CancelRegPaymentModel model = new CancelRegPaymentModel(); BeanUtils.copyProperties(cancelRegPaymentDto, model); + model.setContractNo(account.getContractNo()); ybManager.cancelReg(model); cancelPaymentDto.setSetlId(model.getSetlId()); - //return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"医保退号"})); + // return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"医保退号"})); } R result = iPaymentRecService.cancelRegPayment(cancelPaymentDto); PaymentReconciliation paymentRecon = null; if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) { - paymentRecon = (PaymentReconciliation) result.getData(); + paymentRecon = (PaymentReconciliation)result.getData(); } - if(paymentRecon!=null) { - List strings = Arrays.asList(paymentRecon.getChargeItemIds().split(",")); + if (paymentRecon != null) { + String[] strings = paymentRecon.getChargeItemIds().split(","); List chargeItemIds = new ArrayList<>(); for (String string : strings) { chargeItemIds.add(Long.parseLong(string)); @@ -276,28 +242,28 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra } // 2025/05/05 该处保存费用项后,会通过统一收费处理进行收费 - return R.ok(paymentRecon, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"退号"})); + return R.ok(paymentRecon, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"退号"})); } /** * 查询当日就诊数据 * * @param searchKey 模糊查询关键字 - * @param pageNo 当前页 - * @param pageSize 每页多少条 + * @param pageNo 当前页 + * @param pageSize 每页多少条 * @return 当日就诊数据 */ @Override public IPage getCurrentDayEncounter(String searchKey, Integer pageNo, Integer pageSize, - HttpServletRequest request) { + HttpServletRequest request) { // 构建查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey, - new HashSet<>(Arrays.asList("patient_name", "organization_name", "practitioner_name", "healthcare_name")), - request); + new HashSet<>(Arrays.asList("patient_name", "organization_name", "practitioner_name", "healthcare_name")), + request); IPage currentDayEncounter = outpatientRegistrationAppMapper.getCurrentDayEncounter( - new Page<>(pageNo, pageSize), EncounterClass.AMB.getValue(), ParticipantType.ADMITTER.getCode(), - queryWrapper, ChargeItemContext.REGISTER.getValue(), PaymentStatus.SUCCESS.getValue()); + new Page<>(pageNo, pageSize), EncounterClass.AMB.getValue(), ParticipantType.ADMITTER.getCode(), + queryWrapper, ChargeItemContext.REGISTER.getValue(), PaymentStatus.SUCCESS.getValue()); currentDayEncounter.getRecords().forEach(e -> { // 性别 e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum())); diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/InpatientChargeController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/InpatientChargeController.java new file mode 100644 index 0000000000000000000000000000000000000000..8d7386a1227f4687c63220734861e983e859da1b --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/InpatientChargeController.java @@ -0,0 +1,95 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.chargemanage.controller; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.web.chargemanage.appservice.IInpatientChargeAppService; +import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +/** + * 门诊收费 controller + * + * @author zwh + * @date 2025-03-12 + */ +@RestController +@RequestMapping("/charge-manage/inpa-charge") +@Slf4j +@AllArgsConstructor +public class InpatientChargeController { + + @Autowired + private IInpatientChargeAppService inpatientChargeAppService; + + /** + * 收费页面初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R outpatientChargeInit() { + return inpatientChargeAppService.outpatientChargeInit(); + } + + /** + * 查询就诊患者分页列表 + * + * @param encounterPatientPageParam 查询条件 + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @param request 请求 + * @return 就诊患者分页列表 + */ + @GetMapping(value = "/encounter-patient-page") + public R getEncounterPatientPage(EncounterPatientPageParam encounterPatientPageParam, + @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { + return R.ok(inpatientChargeAppService.getEncounterPatientPage(encounterPatientPageParam, searchKey, pageNo, + pageSize, request)); + } + + /** + * 根据就诊id查询患者处方列表 + * + * @param encounterId 就诊id + * @return 患者处方列表 + */ + @GetMapping(value = "/patient-prescription") + public R getEncounterPatientPrescription(@RequestParam Long encounterId, @RequestParam String startTime, + @RequestParam String endTime) { + return R.ok(inpatientChargeAppService.getEncounterPatientPrescription(encounterId, startTime, endTime)); + } + + /** + * 医保转自费 + * + * @param encounterId 就诊id + * @return 操作结果 + */ + @PutMapping("/self-pay") + public R changeToSelfPay(@RequestParam Long encounterId) { + return inpatientChargeAppService.changeToSelfPay(encounterId); + } + + /** + * 自费转医保 + * + * @param encounterId 就诊id + * @return 操作结果 + */ + @PutMapping("/medical-insurance") + public R changeToMedicalInsurance(@RequestParam Long encounterId) { + return inpatientChargeAppService.changeToMedicalInsurance(encounterId); + } +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientChargeController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientPricingController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientPricingController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientPricingController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientPricingController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java similarity index 94% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java index 86ae606602b854454a68f7f7784a6fa4f8705047..426c424dce95c322c62ff20a356b9ca8e0a53616 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRefundController.java @@ -88,11 +88,14 @@ public class OutpatientRefundController { * 根据就诊id查询患者的退费账单 * * @param encounterId 就诊id + * @param billDateSTime 收费时间开始 + * @param billDateETime 收费时间结束 * @return 退费账单列表 */ @GetMapping(value = "/patient-refund") - public R getEncounterPatientRefund(@RequestParam Long encounterId) { - return outpatientRefundAppService.getEncounterPatientRefund(encounterId); + public R getEncounterPatientRefund(@RequestParam Long encounterId, @RequestParam String billDateSTime, + @RequestParam String billDateETime) { + return outpatientRefundAppService.getEncounterPatientRefund(encounterId, billDateSTime, billDateETime); } /** diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRegistrationController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRegistrationController.java similarity index 93% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRegistrationController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRegistrationController.java index cd44fcd9ee23a56afa7c2fac8b3bfafb53d9f17e..d2f72db49a571ea76a19b3e3439e152d76e503a9 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRegistrationController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/controller/OutpatientRegistrationController.java @@ -4,21 +4,20 @@ package com.openhis.web.chargemanage.controller; import java.util.List; -import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.servlet.http.HttpServletRequest; -import com.openhis.financial.domain.PaymentReconciliation; -import com.openhis.web.paymentmanage.appservice.IEleInvoiceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import com.core.common.core.domain.R; import com.openhis.common.enums.PriorityLevel; +import com.openhis.financial.domain.PaymentReconciliation; import com.openhis.web.chargemanage.appservice.IOutpatientRegistrationAppService; import com.openhis.web.chargemanage.dto.OutpatientRegistrationInitDto; +import com.openhis.web.paymentmanage.appservice.IEleInvoiceService; import com.openhis.web.paymentmanage.dto.CancelRegPaymentDto; import lombok.AllArgsConstructor; @@ -37,6 +36,7 @@ public class OutpatientRegistrationController { @Autowired private IEleInvoiceService eleInvoiceService; + /** * 基础数据初始化 */ @@ -67,16 +67,6 @@ public class OutpatientRegistrationController { return R.ok(iOutpatientRegistrationAppService.getPatientMetadataBySearchKey(searchKey, pageNo, pageSize)); } - /** - * 查询费用性质 - * - * @return 费用性质 - */ - @GetMapping(value = "/contract-list") - public R getContractList() { - return R.ok(iOutpatientRegistrationAppService.getContractMetadata()); - } - /** * 查询就诊科室 * @@ -127,7 +117,8 @@ public class OutpatientRegistrationController { if (PaymentReconciliation.class.isAssignableFrom(result.getData().getClass())) { paymentRecon = (PaymentReconciliation)result.getData(); } - R eleResult = eleInvoiceService.invoiceWriteoff(paymentRecon.getRelationId(), cancelRegPaymentDto.getReason()); + R eleResult = + eleInvoiceService.invoiceWriteoff(paymentRecon.getRelationId(), cancelRegPaymentDto.getReason()); if (eleResult.getCode() != 200) { // 因取消付款成功前端需要关闭弹窗,此处信息仅用于提示所以返回ok return R.ok(null, " 取消付款成功,电子发票开具失败 :" + eleResult.getMsg()); diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/AccountFormData.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ChargeItemFormData.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ContractMetadata.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ContractMetadata.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ContractMetadata.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/ContractMetadata.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/CurrentDayEncounterDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/CurrentDayEncounterDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/CurrentDayEncounterDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/CurrentDayEncounterDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterDiagnosisFormData.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterDiagnosisFormData.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterDiagnosisFormData.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterDiagnosisFormData.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterFormData.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterFormData.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterFormData.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterFormData.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterLocationFormData.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterLocationFormData.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterLocationFormData.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterLocationFormData.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterParticipantFormData.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java similarity index 86% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java index f4279df452b530501fe0280a5b616c5be1f4ccca..1e9abc1bab3073916adf1655969d68d8bc116620 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageDto.java @@ -6,6 +6,9 @@ package com.openhis.web.chargemanage.dto; import java.math.BigDecimal; import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; + +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; @@ -124,5 +127,12 @@ public class EncounterPatientPageDto { /** * 结算时间 */ - private Date billDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") + private Date maxBillDate; + + /** + * 开始时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java similarity index 93% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java index 7e73124158a2696bd5480916e1f5b042c077c5d5..b7acf61454ca9caf710691c39a2eb0255c0ab557 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPageParam.java @@ -53,6 +53,11 @@ public class EncounterPatientPageParam { */ private Date receptionTime; + /** + * 住院开始时间 + */ + private Date startTime; + /** * 收费时间 */ diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPaymentDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPaymentDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPaymentDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPaymentDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPrescriptionDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPrescriptionDto.java similarity index 97% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPrescriptionDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPrescriptionDto.java index 9b56191ec45c6f5e9318b29e0e05a443c6e3d5e6..8d63b2daffb64c0de98e7ddff48e5c32cbda26ca 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPrescriptionDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientPrescriptionDto.java @@ -100,4 +100,7 @@ public class EncounterPatientPrescriptionDto { /** 合同名称 */ private String contractName; + + /** 服务所在表 */ + private String serviceTable; } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientRefundDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientRefundDto.java similarity index 83% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientRefundDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientRefundDto.java index 8ad19c9d4f345debc6fa7a9347707f73427f6ad6..c074d5a6c6f067fc84df1853fb5396db74ba9d58 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientRefundDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/EncounterPatientRefundDto.java @@ -7,11 +7,12 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.openhis.common.annotation.Dict; -import com.openhis.web.paymentmanage.dto.PaymentDetailDto; +import com.openhis.yb.dto.PaymentDetailDto; import lombok.Data; import lombok.experimental.Accessors; @@ -41,6 +42,14 @@ public class EncounterPatientRefundDto { @JsonSerialize(using = ToStringSerializer.class) private Long patientId; + /** 请求ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long requestId; + + /** 发放ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long dispenseId; + /** 处方号 */ private String prescriptionNo; @@ -62,6 +71,9 @@ public class EncounterPatientRefundDto { /** 收款人 */ private String entererName; + /** 服务表名 */ + private String serviceTable; + /** 收费状态 */ private Integer chargeStatus; private String chargeStatus_enumText; @@ -96,6 +108,7 @@ public class EncounterPatientRefundDto { private BigDecimal totalPrice; /** 结算时间 */ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") private Date billDate; /** diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OrgMetadata.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OrgMetadata.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OrgMetadata.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OrgMetadata.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientPricingInventoryDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientPricingInventoryDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientPricingInventoryDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientPricingInventoryDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientPricingPriceDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientPricingPriceDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientPricingPriceDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientPricingPriceDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationAddParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationAddParam.java similarity index 79% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationAddParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationAddParam.java index b7b39ca8111eba16c04c92eea9b16582db578ffa..26eb6dd7204da3e01a10bfdc7ba8ab7a03c03599 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationAddParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationAddParam.java @@ -1,14 +1,14 @@ package com.openhis.web.chargemanage.dto; +import java.util.List; + import javax.validation.Valid; -import com.openhis.web.paymentmanage.dto.PaymentDetailDto; import com.openhis.yb.dto.Info5301SpecialConditionResult; + import lombok.Data; import lombok.experimental.Accessors; -import java.util.List; - /** * 门诊挂号 新增参数 */ @@ -45,7 +45,7 @@ public class OutpatientRegistrationAddParam { @Valid private AccountFormData accountFormData; /** - * 费用项管理-表单数据 //todo:挂号费会绑定诊查费,该字段会变成List,挂号前先把这个收费项开个前台,后台没有保存 + * 费用项管理-表单数据 //todo:挂号费会绑定诊查费,该字段会变成List,挂号前先把这个收费项开个前台,后台没有保存 */ @Valid private ChargeItemFormData chargeItemFormData; @@ -53,7 +53,7 @@ public class OutpatientRegistrationAddParam { /** * 密钥 医保挂号时使用 */ - private String busiCardInfo;//2025/05/16 前后端一致,前端大写,后端保持大写 + private String busiCardInfo;// 2025/05/16 前后端一致,前端大写,后端保持大写 /** * 类型 医保挂号时使用 @@ -63,14 +63,13 @@ public class OutpatientRegistrationAddParam { * 医保个人结算方式 参照枚举 按项目结算 01 按定额结算 02 */ private String YbPsnSetlWay; - - public OutpatientRegistrationAddParam(){ - this.YbPsnSetlWay = "01"; - } - /** * 特慢病列表 */ private List feedetail; + public OutpatientRegistrationAddParam() { + this.YbPsnSetlWay = "01"; + } + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationSettleParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationSettleParam.java similarity index 53% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationSettleParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationSettleParam.java index 2971f8908992ff4fa00d53eec613b38825a7b2ad..78bc2dd59332b2636cf7fc62fee6b526190ae838 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationSettleParam.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/OutpatientRegistrationSettleParam.java @@ -1,22 +1,22 @@ package com.openhis.web.chargemanage.dto; -import com.openhis.web.paymentmanage.dto.PaymentDetailDto; +import java.util.List; + +import com.openhis.yb.dto.PaymentDetailDto; + import lombok.Data; import lombok.experimental.Accessors; -import javax.validation.Valid; -import java.util.List; - @Data @Accessors(chain = true) public class OutpatientRegistrationSettleParam { OutpatientRegistrationAddParam outpatientRegistrationAddParam; - String chrgBchno;//收费批次号 付款时必传 + String chrgBchno;// 收费批次号 付款时必传 - String busNo;//挂号no + String busNo;// 挂号no - List paymentDetails;//支付渠道 付款时必传 + List paymentDetails;// 支付渠道 付款时必传 } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PatientMetadata.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PatientMetadata.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PatientMetadata.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PatientMetadata.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PractitionerMetadata.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PractitionerMetadata.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PractitionerMetadata.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PractitionerMetadata.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PricingProjectDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PricingProjectDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PricingProjectDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/PricingProjectDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/dto/RefundItemParam.java diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/InpatientChargeAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/InpatientChargeAppMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..7c704e233db2125130e0b29526d67a69d882f365 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/InpatientChargeAppMapper.java @@ -0,0 +1,60 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.chargemanage.mapper; + +import java.util.Date; +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.openhis.web.chargemanage.dto.EncounterPatientPageDto; +import com.openhis.web.chargemanage.dto.EncounterPatientPageParam; +import com.openhis.web.chargemanage.dto.EncounterPatientPrescriptionDto; + +/** + * 门诊收费 appMapper + * + * @author zwh + * @date 2025-03-13 + */ +@Repository +public interface InpatientChargeAppMapper { + + /** + * 查询就诊患者分页列表 + * + * @param page 分页 + * @param queryWrapper 查询条件 + * @return 就诊患者分页列表 + */ + Page selectEncounterPatientPage(@Param("classEnum") Integer classEnum, + @Param("page") Page page, + @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + /** + * 根据就诊id查询患者处方列表 + * + * @param encounterId 就诊id + * @param activity 项目 + * @param medication 药品 + * @param device 耗材 + * @param register 挂号费 + * @param planned 收费状态:待收费 + * @param billable 收费状态:待结算 + * @param billed 收费状态:已结算 + * @param refunding 收费状态:退费中 + * @param refunded 收费状态:全部退费 + * @param partRefund 收费状态:部分退费 + * @return 患者处方列表 + */ + List selectEncounterPatientPrescription(@Param("encounterId") Long encounterId, + @Param("activity") Integer activity, @Param("medication") Integer medication, @Param("device") Integer device, + @Param("register") Integer register, @Param("planned") Integer planned, @Param("billable") Integer billable, + @Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded, + @Param("partRefund") Integer partRefund, @Param("startTime") Date startTime, @Param("endTime") Date endTime); +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientChargeAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientChargeAppMapper.java similarity index 95% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientChargeAppMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientChargeAppMapper.java index 77d569f2601ab32578aacf96963fd7d2e3b948a7..a43d2086a8afb88dc2de361548a050825a909884 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientChargeAppMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientChargeAppMapper.java @@ -29,10 +29,11 @@ public interface OutpatientChargeAppMapper { * * @param page 分页 * @param queryWrapper 查询条件 + * @param amb 就诊类型:门诊 * @return 就诊患者分页列表 */ Page selectEncounterPatientPage(@Param("page") Page page, - @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("amb") Integer amb); /** * 根据就诊id查询患者处方列表 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientPricingAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientPricingAppMapper.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientPricingAppMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientPricingAppMapper.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java similarity index 90% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java index 86cb6363ca2ffc87b957c76c7921ebac19871bc9..439cb429343cc32f3ee214c136858d8ee6a1ee6e 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRefundAppMapper.java @@ -60,12 +60,13 @@ public interface OutpatientRefundAppMapper { * @param refunded 收费状态:已退费 * @param partRefund 收费状态:部分退费 * @param insurance 账户类型:医保 + * @param amb 就诊类型:门诊 * @return 已结算就诊患者分页列表 */ Page selectBilledEncounterPatientPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("billed") Integer billed, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded, - @Param("partRefund") Integer partRefund, @Param("insurance") String insurance); + @Param("partRefund") Integer partRefund, @Param("insurance") String insurance, @Param("amb") Integer amb); /** * 查询患者退费项目 @@ -77,10 +78,13 @@ public interface OutpatientRefundAppMapper { * @param worServiceRequest 服务请求表 * @param worDeviceRequest 设备请求表 * @param medMedicationRequest 药品请求表 + * @param billDateSTime 收费时间开始 + * @param billDateETime 收费时间结束 * @return 查询患者退费项目 */ List selectEncounterPatientRefund(@Param("encounterId") Long encounterId, @Param("refunding") Integer refunding, @Param("refunded") Integer refunded, @Param("partRefund") Integer partRefund, @Param("worServiceRequest") String worServiceRequest, - @Param("worDeviceRequest") String worDeviceRequest, @Param("medMedicationRequest") String medMedicationRequest); + @Param("worDeviceRequest") String worDeviceRequest, @Param("medMedicationRequest") String medMedicationRequest, + @Param("billDateSTime") String billDateSTime, @Param("billDateETime") String billDateETime); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRegistrationAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRegistrationAppMapper.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRegistrationAppMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/mapper/OutpatientRegistrationAppMapper.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/appservice/ICommonService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/ICommonService.java similarity index 60% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/common/appservice/ICommonService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/ICommonService.java index c1ba63ab4696ed3338d8144775b91550ffbc4de1..4f929a87afc39a9b3a6677c641a78416389075f8 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/appservice/ICommonService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/ICommonService.java @@ -6,8 +6,10 @@ package com.openhis.web.common.appservice; import java.util.List; import com.core.common.core.domain.R; +import com.openhis.administration.domain.Organization; import com.openhis.web.common.dto.InventoryItemParam; import com.openhis.web.common.dto.LocationDto; +import com.openhis.web.common.dto.SearchTraceNoParam; /** * app常用接口 @@ -38,6 +40,13 @@ public interface ICommonService { */ List getCabinetList(); + /** + * 仓库列表 + * + * @return 仓库列表 + */ + List getWarehouseList(); + /** * 药库列表(库房用) * @@ -55,9 +64,10 @@ public interface ICommonService { /** * 获取病区列表 * - * @return 药库列表 + * @param orgId 科室id + * @return 病区列表 */ - List getWardList(); + List getWardList(Long orgId); /** * 库存项目下拉列表(药库业务使用) @@ -86,6 +96,13 @@ public interface ICommonService { */ R getDepartmentList(); + /** + * 科室列表 + * + * @return 科室列表 + */ + List departmentList(); + /** * 根据追溯码获取药品/耗材信息 * @@ -93,4 +110,43 @@ public interface ICommonService { * @return 项目信息 */ R getItemInfoByTraceNo(List traceNoList); + + /** + * 追溯码查询 + * + * @param searchTraceNoParam 查询条件 + * @return 项目信息 + */ + R searchTraceNo(SearchTraceNoParam searchTraceNoParam); + + /** + * 查询费用性质 + * + * @return 费用性质 + */ + R getContractMetadata(); + + /** + * 根据科室查询护士 + * + * @param orgId 科室id + * @return 护士列表 + */ + R getNurseListByOrg(Long orgId); + + /** + * 根据父级位置id查询他所有的子集 + * + * @param locationId 位置id + * @param locationForm 位置类型 + * @return 位置列表 + */ + List getChildLocation(Long locationId, Integer locationForm); + + /** + * 查询登录者管理的病区 + * + * @return 病区列表 + */ + List getPractitionerWard(); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/appservice/impl/CommonServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/impl/CommonServiceImpl.java similarity index 62% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/common/appservice/impl/CommonServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/impl/CommonServiceImpl.java index 23ec406f2eaf6aed576b529788e2ae219eea9832..6cbb4cfccf60fbad3b66bb5629b41c759aca38d3 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/appservice/impl/CommonServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/appservice/impl/CommonServiceImpl.java @@ -4,6 +4,7 @@ package com.openhis.web.common.appservice.impl; import java.util.*; +import java.util.stream.Collectors; import javax.annotation.Resource; @@ -18,21 +19,24 @@ import com.core.common.utils.SecurityUtils; import com.core.common.utils.StringUtils; import com.core.common.utils.bean.BeanUtils; import com.openhis.administration.domain.Location; +import com.openhis.administration.domain.TraceNoManage; +import com.openhis.administration.mapper.TraceNoManageMapper; import com.openhis.administration.service.ILocationService; import com.openhis.administration.service.IOrganizationService; import com.openhis.administration.service.IPractitionerRoleService; import com.openhis.common.constant.CommonConstants; -import com.openhis.common.enums.ConditionCode; -import com.openhis.common.enums.ItemType; -import com.openhis.common.enums.OrganizationType; -import com.openhis.common.enums.PublicationStatus; +import com.openhis.common.enums.*; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; +import com.openhis.financial.domain.Contract; +import com.openhis.financial.mapper.ContractMapper; +import com.openhis.web.chargemanage.dto.ContractMetadata; import com.openhis.web.common.appservice.ICommonService; import com.openhis.web.common.dto.*; import com.openhis.web.common.mapper.CommonAppMapper; import com.openhis.workflow.domain.InventoryItem; import com.openhis.workflow.service.IInventoryItemService; +import com.openhis.administration.domain.Organization; /** * app常用接口 @@ -43,6 +47,9 @@ import com.openhis.workflow.service.IInventoryItemService; @Service public class CommonServiceImpl implements ICommonService { + @Resource + private TraceNoManageMapper traceNoManageMapper; + @Resource private CommonAppMapper commonAppMapper; @@ -58,6 +65,9 @@ public class CommonServiceImpl implements ICommonService { @Resource private IInventoryItemService iInventoryItemService; + @Resource + private ContractMapper contractMapper; + /** * 获取药房列表 * @@ -123,6 +133,24 @@ public class CommonServiceImpl implements ICommonService { return locationDtoList; } + /** + * 获取仓库列表 + * + * @return 仓库列表 + */ + @Override + public List getWarehouseList() { + List pharmacyList = locationService.getWarehouseList(); + List locationDtoList = new ArrayList<>(); + LocationDto locationDto; + for (Location location : pharmacyList) { + locationDto = new LocationDto(); + BeanUtils.copyProperties(location, locationDto); + locationDtoList.add(locationDto); + } + return locationDtoList; + } + /** * 获取药库列表(库房用) * @@ -171,11 +199,17 @@ public class CommonServiceImpl implements ICommonService { /** * 获取病区列表 * + * @param orgId 科室id * @return 病区列表 */ @Override - public List getWardList() { - List getWardList = locationService.getWardList(); + public List getWardList(Long orgId) { + List getWardList = new ArrayList<>(); + if (orgId != null) { + getWardList = locationService.getWardList(orgId); + } else { + getWardList = locationService.getWardList(null); + } List locationDtoList = new ArrayList<>(); LocationDto locationDto; for (Location location : getWardList) { @@ -261,6 +295,16 @@ public class CommonServiceImpl implements ICommonService { return R.ok(organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null)); } + /** + * 科室列表 + * + * @return 科室列表 + */ + @Override + public List departmentList(){ + return organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null); + } + /** * 根据追溯码获取药品/耗材信息 * @@ -272,10 +316,14 @@ public class CommonServiceImpl implements ICommonService { Map traceNoMap = new HashMap<>(); for (String traceNo : traceNoList) { if (traceNo != null && !StringUtils.isEmpty(traceNo)) { + // 数据源更改 InventoryItem inventoryItem = iInventoryItemService.getOne( new LambdaQueryWrapper().like(InventoryItem::getTraceNo, traceNo).last("LIMIT 1")); if (inventoryItem != null) { String itemId = inventoryItem.getItemId().toString(); + // TraceNoManage traceNoManage = commonAppMapper.getInfoByTraceNo("%" + traceNo + "%"); + // if (traceNoManage != null) { + // String itemId = traceNoManage.getItemId().toString(); // 如果map中已经存在该itemId,拼接traceNo,否则直接添加 if (traceNoMap.containsKey(itemId)) { String existingTraceNos = traceNoMap.get(itemId); @@ -291,4 +339,116 @@ public class CommonServiceImpl implements ICommonService { return R.ok(traceNoMap); } + /** + * 追溯码查询 + * + * @param searchTraceNoParam 查询条件 + * @return 项目信息 + */ + @Override + public R searchTraceNo(SearchTraceNoParam searchTraceNoParam) { + List traceNoManageList = new ArrayList<>(); + Map traceNoMap = new HashMap<>(); + // 判断传入的是药品还是耗材,查询追溯码状态只有进的数据 + if (searchTraceNoParam.getItemType().equals(ItemType.MEDICINE.getValue())) { + traceNoManageList = traceNoManageMapper.getItemTraceNoInfo( + CommonConstants.TableName.MED_MEDICATION_DEFINITION, searchTraceNoParam.getItemId(), + searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber()); + } else if (searchTraceNoParam.getItemType().equals(ItemType.DEVICE.getValue())) { + traceNoManageList = traceNoManageMapper.getItemTraceNoInfo(CommonConstants.TableName.ADM_DEVICE_DEFINITION, + searchTraceNoParam.getItemId(), searchTraceNoParam.getLocationId(), searchTraceNoParam.getLotNumber()); + } + if (traceNoManageList != null) { + for (TraceNoManage traceNoItem : traceNoManageList) { + traceNoMap.put(traceNoItem.getItemId().toString(), traceNoItem.getTraceNo()); + } + } + return R.ok(traceNoMap); + } + + /** + * 查询费用性质 + * + * @return 费用性质 + */ + @Override + public R getContractMetadata() { + // TODO: Contract表的基础数据维护还没做,具体不知道状态字段的取值是什么,先查询默认值为0的数据 + List ContractList = + contractMapper.selectList(new LambdaQueryWrapper().eq(Contract::getStatusEnum, 0)); + // 复制同名字段并 return + return R.ok(ContractList.stream().map(contract -> { + ContractMetadata metadata = new ContractMetadata(); + try { + BeanUtils.copyProperties(contract, metadata); + } catch (Exception e) { + e.printStackTrace(); + } + return metadata; + }).collect(Collectors.toList())); + } + + /** + * 根据科室查询护士 + * + * @param orgId 科室id + * @return 护士列表 + */ + @Override + public R getNurseListByOrg(Long orgId) { + return R.ok(practitionerRoleService.getNurseList(orgId)); + } + + /** + * 根据父级位置id查询他所有的子集 + * + * @param locationId 位置id + * @param locationForm 位置类型 + * @return 位置列表 + */ + @Override + public List getChildLocation(Long locationId, Integer locationForm) { + // 获取当前位置信息 + Location location = locationService.getById(locationId); + // 查询所有子集位置 + List childLocations = locationService.list(new LambdaQueryWrapper() + .likeRight(Location::getBusNo, location.getBusNo()).eq(Location::getFormEnum, locationForm) + .ne(Location::getStatusEnum, LocationStatus.INACTIVE.getValue())); + List locationDtoList = new ArrayList<>(); + LocationDto locationDto; + for (Location childLocation : childLocations) { + locationDto = new LocationDto(); + BeanUtils.copyProperties(childLocation, locationDto); + locationDtoList.add(locationDto); + } + // 8. 返回成功响应 + return locationDtoList; + } + + /** + * 查询登录者管理的病区 + * + * @return 病区列表 + */ + @Override + public List getPractitionerWard() { + // 查询当前登录者管理的病区 + Long practitionerId = SecurityUtils.getLoginUser().getPractitionerId(); + List locationIds = practitionerRoleService.getLocationIdsByPractitionerId(practitionerId); + List locationList = locationService.getLocationList(locationIds); + List wardList = new ArrayList<>(); + for (Location ward : locationList) { + if (LocationForm.WARD.getValue().equals(ward.getFormEnum())) { + wardList.add(ward); + } + } + List locationDtoList = new ArrayList<>(); + LocationDto locationDto; + for (Location ward : wardList) { + locationDto = new LocationDto(); + BeanUtils.copyProperties(ward, locationDto); + locationDtoList.add(locationDto); + } + return locationDtoList; + } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java similarity index 69% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java index 8c9949e2f360cdb88ae5cac9618347c935f9fd53..20eead33d5a43d4635f17b0e55ed9f63f3119048 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/controller/CommonAppController.java @@ -3,6 +3,8 @@ */ package com.openhis.web.common.controller; +import java.util.List; + import javax.annotation.Resource; import org.springframework.web.bind.annotation.GetMapping; @@ -13,12 +15,12 @@ import org.springframework.web.bind.annotation.RestController; import com.core.common.core.domain.R; import com.openhis.web.common.appservice.ICommonService; import com.openhis.web.common.dto.InventoryItemParam; +import com.openhis.web.common.dto.LocationDto; +import com.openhis.web.common.dto.SearchTraceNoParam; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import java.util.List; - /** * app常用接口 * @@ -90,8 +92,8 @@ public class CommonAppController { * @return 病区列表 */ @GetMapping(value = "/ward-list") - public R getWardList() { - return R.ok(commonService.getWardList()); + public R getWardList(@RequestParam(value = "orgId", required = false) Long orgId) { + return R.ok(commonService.getWardList(orgId)); } /** @@ -143,4 +145,57 @@ public class CommonAppController { return commonService.getItemInfoByTraceNo(traceNoList); } + /** + * 追溯码查询 + * + * @param searchTraceNoParam 查询条件 + * @return 项目信息 + */ + @GetMapping(value = "/search-trace-no") + public R searchTraceNo(SearchTraceNoParam searchTraceNoParam) { + return commonService.searchTraceNo(searchTraceNoParam); + } + + /** + * 查询费用性质 + * + * @return 费用性质 + */ + @GetMapping(value = "/contract-list") + public R getContractList() { + return commonService.getContractMetadata(); + } + + /** + * 根据科室查询护士 + * + * @param orgId 科室id + * @return 护士列表 + */ + @GetMapping(value = "/nurse-list") + public R getNurseListByOrg(Long orgId) { + return commonService.getNurseListByOrg(orgId); + } + + /** + * 根据父级位置id查询他所有的子集 + * + * @param locationId 位置id + * @param locationForm 位置类型 + * @return 位置列表 + */ + @GetMapping(value = "/child-location-list") + public List getChildLocation(Long locationId, Integer locationForm) { + return commonService.getChildLocation(locationId, locationForm); + } + + /** + * 查询登录者管理的病区 + * + * @return 病区列表 + */ + @GetMapping(value = "/practitioner-ward") + public List getPractitionerWard() { + return commonService.getPractitionerWard(); + } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/InventoryItemDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/InventoryItemDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/InventoryItemDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/InventoryItemDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/InventoryItemParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/InventoryItemParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/InventoryItemParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/InventoryItemParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/LocationDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/LocationDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/LocationDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/LocationDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/LocationInventoryDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/LocationInventoryDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/LocationInventoryDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/LocationInventoryDto.java diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/PerformInfoDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/PerformInfoDto.java new file mode 100644 index 0000000000000000000000000000000000000000..501973069767c0d5113d3da82ab64c5db0818453 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/PerformInfoDto.java @@ -0,0 +1,64 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.common.dto; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 执行信息dto + * + * @author zwh + * @date 2025-08-13 + */ +@Data +@Accessors(chain = true) +public class PerformInfoDto { + + /** 请求id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long requestId; + + /** 医嘱项目id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long itemId; + + /** 住院id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long encounterId; + + /** 发放id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long dispenseId; + + /** 执行id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long procedureId; + + /** 请求所在表 */ + private String requestTable; + + /** 执行位置 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long locationId; + + /** 执行开始时间 */ + private Date exeStartTime; + + /** 执行结束时间 */ + private Date exeEndTime; + + /** 组号 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long groupId; + + /** 执行时间列表 */ + private List executeTimes; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/PerformRecordDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/PerformRecordDto.java new file mode 100644 index 0000000000000000000000000000000000000000..684b7a83083f2143629680f09706ae168a9937fb --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/PerformRecordDto.java @@ -0,0 +1,60 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.common.dto; + +import java.util.Date; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 执行记录dto + * + * @author zwh + * @date 2025-08-14 + */ +@Data +@Accessors(chain = true) +public class PerformRecordDto { + + /** 执行id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long procedureId; + + /** 执行状态 */ + private Integer statusEnum; + private String statusEnum_enumText; + + /** 执行时间 */ + private Date occurrenceTime; + + /** 执行位置 */ + private String locationName; + + /** 执行科室 */ + private String orgName; + + /** 项目id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long requestId; + + /** 执行开始时间 */ + private Date startTime; + + /** 执行结束时间 */ + private Date endTime; + + /** 执行人 */ + private String practitionerName; + + /** 取消执行id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long refundId; + + /** 操作时间 */ + private Date createTime; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/SearchTraceNoParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/SearchTraceNoParam.java new file mode 100644 index 0000000000000000000000000000000000000000..c1ff23b1fe36ba72ce46e99d98a3b7ff31c845c0 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/SearchTraceNoParam.java @@ -0,0 +1,38 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.common.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 追溯码查询条件 + * + * @author yuxj + * @date 2025-07-10 + */ +@Data +@Accessors(chain = true) +public class SearchTraceNoParam { + + /** + * 项目类型 + */ + private Integer itemType; // 1:药品 , 2: 耗材 , 3:诊疗 + + /** + * 项目id + */ + private Long itemId; + + /** + * 药房药库 + */ + private Long locationId; + + /** + * 产品批号 + */ + private String lotNumber; +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/UnitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/UnitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/UnitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/UnitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/UnitQuantityDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/UnitQuantityDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/common/dto/UnitQuantityDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/dto/UnitQuantityDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/mapper/CommonAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/mapper/CommonAppMapper.java similarity index 90% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/common/mapper/CommonAppMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/mapper/CommonAppMapper.java index c1c0903b41ae457546b8b7d93e8572067bc372dc..b28b6700fe6279cfe4b011c51428167b8bc4b045 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/common/mapper/CommonAppMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/common/mapper/CommonAppMapper.java @@ -5,6 +5,7 @@ package com.openhis.web.common.mapper; import java.util.List; +import com.openhis.administration.domain.TraceNoManage; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -57,4 +58,12 @@ public interface CommonAppMapper { @Param("medicationTableName") String medicationTableName, @Param("deviceTableName") String deviceTableName, @Param("objLocationId") Long objLocationId, @Param("lotNumber") String lotNumber, @Param("itemId") Long itemId, @Param("purchase") String purchase); + + /** + * 查询追溯码信息 + * + * @param traceNo 追溯码 + * @return + */ + TraceNoManage getInfoByTraceNo(@Param("traceNo") String traceNo); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDeviceManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDeviceManageAppService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDeviceManageAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDeviceManageAppService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiagTreatMAppService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiseaseManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiseaseManageAppService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiseaseManageAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IDiseaseManageAppService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IItemDefinitionService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IMedicationManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IMedicationManageAppService.java similarity index 83% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IMedicationManageAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IMedicationManageAppService.java index 7851f2486c670d162de7ad9bd832b66825029b21..26dc75709c3cdb42b28c2ca26048897b5e44a95d 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IMedicationManageAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/IMedicationManageAppService.java @@ -8,13 +8,13 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.openhis.web.datadictionary.dto.MedicationSearchParam; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; import com.core.common.core.domain.R; import com.openhis.web.datadictionary.dto.MedicationManageUpDto; +import com.openhis.web.datadictionary.dto.MedicationSearchParam; /** * 药品目录 service @@ -37,8 +37,8 @@ public interface IMedicationManageAppService { * @param pageSize 查询条数 * @return 药品目录查询结果 */ - R getMedicationList(MedicationSearchParam medicationSearchParam,String searchKey, - Integer pageNo, Integer pageSize, HttpServletRequest request); + R getMedicationList(MedicationSearchParam medicationSearchParam, String searchKey, Integer pageNo, + Integer pageSize, HttpServletRequest request); /** * 药品目录详细查询 @@ -82,4 +82,19 @@ public interface IMedicationManageAppService { @RequestParam(value = "ybMatchFlag", defaultValue = "-1") Integer ybMatchFlag, @RequestParam(value = "statusEnum", defaultValue = "-1") Integer statusEnum, @RequestParam(value = "categoryCode", defaultValue = "") String categoryCode, HttpServletResponse response); + + /** + * 导入药品目录 + * + * @param file 文件 + * @return 结果 + */ + R importData(MultipartFile file); + + /** + * 获取导入模板 + * + * @param response 响应 + */ + void importTemplate(HttpServletResponse response); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ItemDefinitionAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ItemDefinitionAppService.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ItemDefinitionAppService.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ItemDefinitionAppService.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DeviceManageAppServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiagTreatMAppServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiseaseManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiseaseManageAppServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiseaseManageAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/DiseaseManageAppServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionAppServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionAppServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/ItemDefinitionServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java similarity index 91% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java index f5f5bac8cd212865f7c1365f19bc65733f2fd475..1c992957dba47992346d8b53048f00e9e87b57e4 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java @@ -3,6 +3,7 @@ */ package com.openhis.web.datadictionary.appservice.impl; +import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; @@ -18,6 +19,7 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -30,6 +32,8 @@ import com.core.common.utils.poi.ExcelUtil; import com.core.system.service.ISysDictTypeService; import com.openhis.administration.domain.ChargeItemDefinition; import com.openhis.administration.domain.Supplier; +import com.openhis.administration.service.IChargeItemDefDetailService; +import com.openhis.administration.service.IChargeItemDefinitionService; import com.openhis.administration.service.ISupplierService; import com.openhis.common.constant.CommonConstants; import com.openhis.common.constant.PromptMsgConstant; @@ -51,7 +55,7 @@ import com.openhis.workflow.service.ISupplyRequestService; import com.openhis.yb.service.YbManager; /** - * 药品目录 impl + * TODO:DTO已UI最小需要值返回 药品目录 impl * * @author * @date 2025-03-17 @@ -65,6 +69,12 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi @Autowired private IMedicationDefinitionService medicationDefinitionService; + @Autowired + IChargeItemDefinitionService chargeItemDefinitionService; + + @Autowired + IChargeItemDefDetailService chargeItemDefDetailService; + @Autowired private MedicationManageSearchMapper medicationManageSearchMapper; @Autowired @@ -100,7 +110,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi public R getMedicationInit() { MedicationManageInitDto medicationManageInitDto = new MedicationManageInitDto(); - // 获取状态 + // 获取状态,从枚举里面取下拉值 List statusEnumOptions = Stream.of(PublicationStatus.values()) .map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo())) .collect(Collectors.toList()); @@ -164,7 +174,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi } /** - * 药品目录查询 + * 已评审 药品目录查询 * * @param * @param searchKey 查询条件-模糊查询 @@ -230,21 +240,25 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi } /** - * 编辑药品目录信息 + * 已评审 编辑药品目录信息 * * @param medicationManageUpDto 药品目录信息 */ @Override public R editMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) { - // 校验是否可以编辑 - boolean result = supplyRequestService.verifyAbleEdit(medicationManageUpDto.getMedicationDefId()); - if (result) { - return R.fail("该药品已经发生过业务,不可编辑"); - } + // // 校验是否可以编辑 + // boolean result = supplyRequestService.verifyAbleEdit(medicationManageUpDto.getMedicationDefId()); + // if (result) { + // return R.fail("该药品已经发生过业务,不可编辑"); + // } // boolean result = medicationDispenseService.verifyAbleEdit(medicationManageUpDto.getMedicationDefId()); // if (result) { // return R.fail("该药品已经发生过业务,不可编辑"); // } + + // Todo:用Medication和medicationDefinition的domainservice来创造新的实例,根据业务需求,使用构造函数; + // 如果小于5哥变量,就用基本类型传递,如果大于5哥,在domain层定义构造方法的入参 + MedicationDefinition medicationDefinition = new MedicationDefinition(); Medication medication = new Medication(); BeanUtils.copyProperties(medicationManageUpDto, medication); // 子表信息 @@ -286,7 +300,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi // 插入操作记录 iOperationRecordService.addEntityOperationRecord(DbOpType.UPDATE.getCode(), CommonConstants.TableName.MED_MEDICATION_DEFINITION, medication); - + // Todo:封装一个价格初始话的方法给app层调用 // 更新价格表 boolean updateChargeItemDefinition = itemDefinitionServic.updateItem(chargeItemDefinition); // 更新子表,修改购入价,条件:采购 @@ -309,7 +323,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi } /** - * 药品目录详细查询 + * 已评审 药品目录详细查询 * * @param id 查询条件 * @return 药品目录查询结果 @@ -342,6 +356,8 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi medication.setStatusEnum(PublicationStatus.RETIRED.getValue()); medicationList.add(medication); } + + // TODO:别用三元,日志在业务代码以后记录 // 插入操作记录 iOperationRecordService.addIdsOperationRecord(DbOpType.STOP.getCode(), CommonConstants.TableName.MED_MEDICATION_DEFINITION, ids); @@ -352,7 +368,7 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi } /** - * 药品目录启用 + * TODO:业务代码写在Domain里 药品目录启用 * * @param ids 药品目录ID列表 * @return @@ -447,4 +463,35 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi util.exportExcel(response, list, "药品目录"); return null; } + + /** + * 导入药品目录 + * + * @param file 文件 + * @return 结果 + */ + @Override + public R importData(MultipartFile file) { + ExcelUtil util = new ExcelUtil<>(MedicationImportDto.class); + List dtoList; + try { + dtoList = util.importExcel(file.getInputStream()); + } catch (IOException e) { + return R.fail("文件读取失败"); + } + + return null; + } + + /** + * 获取导入模板 + * + * @param response 响应 + */ + @Override + public void importTemplate(HttpServletResponse response) { + ExcelUtil util = new ExcelUtil<>(MedicationImportDto.class); + util.importTemplateExcel(response, "药品目录数据"); + } + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/assembler/ItemDefinitionAssembler.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/assembler/ItemDefinitionAssembler.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/assembler/ItemDefinitionAssembler.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/assembler/ItemDefinitionAssembler.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DeviceManageController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DeviceManageController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DeviceManageController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DeviceManageController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/ItemDefinitionController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/ItemDefinitionController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/ItemDefinitionController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/ItemDefinitionController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/MedicationManageController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/MedicationManageController.java similarity index 76% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/MedicationManageController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/MedicationManageController.java index 679ec3cc69e8a7831adacf2327af7a7b0b6e69a2..3a2413ba86fe5f10707f3cda8b07aead40f98b8c 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/MedicationManageController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/MedicationManageController.java @@ -5,20 +5,21 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.openhis.web.datadictionary.dto.MedicationSearchParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import com.core.common.core.domain.R; import com.openhis.web.datadictionary.appservice.IMedicationManageAppService; import com.openhis.web.datadictionary.dto.MedicationManageUpDto; +import com.openhis.web.datadictionary.dto.MedicationSearchParam; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; /** - * TODO:药品目录 + * 已评审 TODO:药品目录 * * @author lpt * @date 2025-02-21 @@ -33,7 +34,7 @@ public class MedicationManageController { private IMedicationManageAppService medicationManageAppService; /** - * 药品目录初始化 + * 已评审 药品目录初始化 * * @return */ @@ -43,7 +44,7 @@ public class MedicationManageController { } /** - * 查询药品目录分页列表 + * 已评审 查询药品目录分页列表 * * @param medicationSearchParam 查询条件 * @param searchKey 模糊查询条件 @@ -52,16 +53,16 @@ public class MedicationManageController { * @return */ @GetMapping("/information-page") - public R getMedicationList( - MedicationSearchParam medicationSearchParam,@RequestParam(value = "searchKey", defaultValue = "") String searchKey, + public R getMedicationList(MedicationSearchParam medicationSearchParam, + @RequestParam(value = "searchKey", defaultValue = "") String searchKey, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { - return medicationManageAppService.getMedicationList(medicationSearchParam,searchKey,pageNo, - pageSize, request); + return medicationManageAppService.getMedicationList(medicationSearchParam, searchKey, pageNo, pageSize, + request); } /** - * 根据id查询药品详情 + * 已评审 根据id查询药品详情 * * @param id 药品ID * @return @@ -71,20 +72,26 @@ public class MedicationManageController { return medicationManageAppService.getMedicationOne(id); } - // 药品目录编辑 + /** + * 已评审 药品目录编辑 + * + * @param medicationManageUpDto + * @return + */ @PutMapping("/information") public R editMedication(@RequestBody MedicationManageUpDto medicationManageUpDto) { return medicationManageAppService.editMedication(medicationManageUpDto); } /** - * 药品目录停用 + * 一品神 药品目录停用 * * @param ids 药品ID列表 * @return */ @PutMapping("/information-stop") public R editMedicationStop(@RequestBody List ids) { + // todo:用动宾短语命名业务方法 如stopMedication return medicationManageAppService.editMedicationStop(ids); } @@ -100,7 +107,7 @@ public class MedicationManageController { } /** - * 新增外来药品目录 + * 已评审 新增外来药品目录 * * @param medicationManageUpDto 药品目录信息 * @return @@ -138,4 +145,25 @@ public class MedicationManageController { @RequestParam(value = "categoryCode", defaultValue = "") String categoryCode, HttpServletResponse response) { return medicationManageAppService.exportMedication(searchKey, ybMatchFlag, statusEnum, categoryCode, response); } + + /** + * 导入药品目录 + * + * @param file 文件 + * @return 结果 + */ + @PostMapping("/import-data") + public R importData(MultipartFile file) { + return medicationManageAppService.importData(file); + } + + /** + * 获取导入模板 + * + * @param response 响应 + */ + @PostMapping("/import-template") + public void importTemplate(HttpServletResponse response) { + medicationManageAppService.importTemplate(response); + } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ActivityChildJsonDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ActivityChildJsonDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ActivityChildJsonDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ActivityChildJsonDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ChargeItemDefPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ChargeItemDefPageDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ChargeItemDefPageDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ChargeItemDefPageDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ChargeItemOptionDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ChargeItemOptionDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ChargeItemOptionDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ChargeItemOptionDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageDto.java similarity index 94% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageDto.java index 85026623dee075f12ba70debe8ef849d5bc8d240..c6935d33e6446e837a68d551696601c89827bb68 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageDto.java @@ -98,6 +98,9 @@ public class DeviceManageDto { /** 医保编码 */ private String ybNo; + /** 医药机构目录编码 */ + private String ybOrgNo; + /** 医保对码标记 */ private Integer ybMatchFlag; private String ybMatchFlag_enumText; @@ -157,4 +160,10 @@ public class DeviceManageDto { /** 医保等级 */ private Integer chrgitmLv; + /** 最小库存警戒数量(常规单位) */ + private BigDecimal itemMinQuantity; + + /** 最大库存警戒数量(常规单位) */ + private BigDecimal itemMaxQuantity; + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageSelParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageSelParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageSelParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageSelParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageUpDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageUpDto.java similarity index 92% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageUpDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageUpDto.java index f2307005e8d27d2e792ab67a22e48306898a9e27..2b579dd0099a3a0cb8d262b2463541d1a343f48e 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageUpDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DeviceManageUpDto.java @@ -89,6 +89,9 @@ public class DeviceManageUpDto { /** 医保编码 */ private String ybNo; + /** 医药机构目录编码 */ + private String ybOrgNo; + /** 医保对码标记 */ private Integer ybMatchFlag; @@ -136,4 +139,10 @@ public class DeviceManageUpDto { /** 医保等级 */ private Integer chrgitmLv; + + /** 最小库存警戒数量(常规单位) */ + private BigDecimal itemMinQuantity; + + /** 最大库存警戒数量(常规单位) */ + private BigDecimal itemMaxQuantity; } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java similarity index 95% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java index 38f5bc23e091357390fc477807b5523e2b58a6fa..f1b2e08075248ee6feabf6036ff6aee4369549c6 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentDto.java @@ -67,7 +67,8 @@ public class DiagnosisTreatmentDto { private String statusEnum_enumText; /** 身体部位 */ - @Dict(dictCode = "body_site_code") + @Dict(dictTable = "adm_body_structure", dictCode = "id", dictText = "name") + @JsonSerialize(using = ToStringSerializer.class) private String bodySiteCode; private String bodySiteCode_dictText; diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentSelParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentSelParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentSelParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentSelParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiagnosisTreatmentUpDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageSelParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageSelParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageSelParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageSelParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageUpDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageUpDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageUpDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/DiseaseManageUpDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefSearchParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefSearchParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefSearchParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionDetailDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionDetailDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionDetailDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionDetailDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemDefinitionInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemUpFromDirectoryDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemUpFromDirectoryDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemUpFromDirectoryDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/ItemUpFromDirectoryDto.java diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationImportDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationImportDto.java new file mode 100644 index 0000000000000000000000000000000000000000..e110cdc52100945abc8e323e9313489934fee38c --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationImportDto.java @@ -0,0 +1,195 @@ +package com.openhis.web.datadictionary.dto; + +import java.math.BigDecimal; + +import com.core.common.annotation.Excel; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 药品目录导入Dto + * + * @author GuoRui + * @date 2025-08-18 + */ +@Data +@Accessors(chain = true) +public class MedicationImportDto { + + // ---------------------- 药品定义 med_medication_definition ------------------------------------- + + /** 药品名称 */ + @Excel(name = "药品名称") + private String name; + + /** 药品版本 */ + @Excel(name = "药品版本") + private String version; + + /** 英文药名 */ + @Excel(name = "英文药名") + private String nameEn; + + /** 药品分类 */ + @Excel(name = "药品分类", dictType = "med_category_code", comboReadDict = true) + private String categoryCode; + + /** 商品名称 */ + @Excel(name = "商品名称") + private String merchandiseName; + + /** 药品单位 */ + @Excel(name = "药品单位", dictType = "unit_code", comboReadDict = true) + private String unitCode; + + /** 最小单位 */ + @Excel(name = "最小单位", dictType = "unit_code", comboReadDict = true) + private String minUnitCode; + + /** 拆零比 */ + @Excel(name = "拆零比") + private BigDecimal partPercent; + + /** 剂量形式 */ + @Excel(name = "剂量形式", dictType = "dose_from_code", comboReadDict = true) + private String doseFrom; + + /** 批准文号 */ + @Excel(name = "批准文号") + private String approvalNumber; + + /** 医保是否对码 */ + @Excel(name = "医保是否对码", readConverterExp = "0=否,1=是", combo = "否,是") + private String ybMatchFlag; + + /** 医保编码 */ + @Excel(name = "医保编码") + private String ybNo; + + /** 是否皮试 */ + @Excel(name = "是否皮试", readConverterExp = "0=否,1=是", combo = "否,是") + private String skinTestFlag; + + /** 是否为注射药物 */ + @Excel(name = "是否为注射药物", readConverterExp = "0=否,1=是", combo = "否,是") + private String injectFlag; + + /** 生产厂商文本 */ + @Excel(name = "生产厂商文本") + private String manufacturerText; + + /** 是否限制使用 */ + @Excel(name = "是否限制使用", readConverterExp = "0=否,1=是", combo = "否,是") + private String restrictedFlag; + + /** 限制使用范围 */ + @Excel(name = "限制使用范围") + private String restrictedScope; + + /** 儿童用药标志 */ + @Excel(name = "儿童用药标志", readConverterExp = "0=否,1=是", combo = "否,是") + private String childrenFlag; + + /** 贯标国家编码 */ + @Excel(name = "贯标国家编码") + private String nationalDrugCode; + + /** 拆分属性 */ + @Excel(name = "拆分属性", readConverterExp = "1=门诊按最小单位每次量向上取整,2=门诊按包装单位不可拆分,3=门诊按最小单位总量向上取整,4=门诊按包装单位每次量向上取整", + combo = "门诊按最小单位每次量向上取整,门诊按包装单位不可拆分,门诊按最小单位总量向上取整,门诊按包装单位每次量向上取整") + private String partAttributeEnum; + + /** 是否抗生素 */ + @Excel(name = "是否抗生素", readConverterExp = "0=否,1=是", combo = "否,是") + private String antibioticFlag; + + /** 抗生素分类 */ + @Excel(name = "抗生素分类", dictType = "antibiotic_type_code", comboReadDict = true) + private String antibioticCode; + + /** 权限限制 */ + @Excel(name = "权限限制", readConverterExp = "1=非限制使用,2=限制使用,3=特殊使用", combo = "非限制使用,限制使用,特殊使用") + private String restrictedEnum; + + /** 是否自制 */ + @Excel(name = "是否自制", readConverterExp = "0=否,1=是", combo = "否,是") + private String selfFlag; + + /** 基药标识 */ + @Excel(name = "基药标识", readConverterExp = "0=否,1=是", combo = "否,是") + private String basicFlag; + + /** 住院临时医嘱拆分属性 */ + @Excel(name = "住院临时医嘱拆分属性", + readConverterExp = "1=临时医嘱按最小单位每次量向上取整,2=临时医嘱按包装单位开立,3=临时医嘱按最小单位总量向上取整,4=临时医嘱按包装单位每次量向上取整", + combo = "临时医嘱按最小单位每次量向上取整,临时医嘱按包装单位开立,临时医嘱按最小单位总量向上取整,临时医嘱按包装单位每次量向上取整") + private String thoPartAttributeEnum; + + /** 剂量单位换算比 */ + @Excel(name = "剂量单位换算比") + private BigDecimal unitConversionRatio; + + /** 医保等级 */ + @Excel(name = "医保等级", dictType = "chrgitm_lv", comboReadDict = true) + private String chrgitmLv; + + /** 处方标志 */ + @Excel(name = "处方标志", readConverterExp = "0=否,1=是", combo = "否,是") + private String rxFlag; + + // ---------------------- 药品基本信息 med_medication ---------------------------------------------- + + /** 所在位置名称(locationId) */ + @Excel(name = "所在位置名称") + private String locationName; + + /** 规格 */ + @Excel(name = "规格") + private String totalVolume; + + /** 用法 */ + @Excel(name = "用法", dictType = "method_code", comboReadDict = true) + private String methodCode; + + /** 用药频次 */ + @Excel(name = "用药频次", dictType = "rate_code", comboReadDict = true) + private String rateCode; + + /** 单次剂量 */ + @Excel(name = "单次剂量") + private BigDecimal dose; + + /** 剂量单位 */ + @Excel(name = "剂量单位", dictType = "unit_code", comboReadDict = true) + private String doseUnitCode; + + /** 单次最大剂量 */ + @Excel(name = "单次最大剂量") + private BigDecimal maxUnit; + + // ---------------------- 费用定价 adm_charge_item_definition ---------------------------------------------- + + /** 财务类别 */ + @Excel(name = "财务类别", dictType = "fin_type_code", comboReadDict = true) + private String typeCode; + + /** 医保费用类别 */ + @Excel(name = "医保费用类别", dictType = "med_chrgitm_type", comboReadDict = true) + private String ybType; + + // ---------------------- 费用定价子表 adm_charge_item_def_detail ---------------------------------------------- + + /** 购入价 */ + @Excel(name = "购入价") + private BigDecimal purchasePrice; + + /** 零售价 */ + @Excel(name = "零售价") + private BigDecimal retailPrice; + + /** 最高零售价 */ + @Excel(name = "最高零售价") + private BigDecimal maximumRetailPrice; + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageUpDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationSearchParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationSearchParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationSearchParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierInitDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierInitDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierInitDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierSearchParam.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierSearchParam.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierSearchParam.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierSearchParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierUpDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierUpDto.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierUpDto.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/SupplierUpDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ActivityDefinitionManageMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ActivityDefinitionManageMapper.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ActivityDefinitionManageMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ActivityDefinitionManageMapper.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ChargeItemDefSearchMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ChargeItemDefSearchMapper.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ChargeItemDefSearchMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ChargeItemDefSearchMapper.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/DeviceManageMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/DeviceManageMapper.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/DeviceManageMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/DeviceManageMapper.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ItemDefinitionAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ItemDefinitionAppMapper.java similarity index 100% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ItemDefinitionAppMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/ItemDefinitionAppMapper.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/MedicationManageSearchMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/MedicationManageSearchMapper.java similarity index 91% rename from openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/MedicationManageSearchMapper.java rename to openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/MedicationManageSearchMapper.java index c5a0744f601b783e4f285b63492d91e9bfcb975e..285c4e3d8dd7d886f01d3bf16c617e4f6415d6ac 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/MedicationManageSearchMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/datadictionary/mapper/MedicationManageSearchMapper.java @@ -44,6 +44,15 @@ public interface MedicationManageSearchMapper extends BaseMapper getList(@Param("searchKey") String searchKey, @Param("ybMatchFlag") Integer ybMatchFlag, @Param("statusEnum") Integer statusEnum, @Param("categoryCode") String categoryCode,@Param("tenantId") Integer tenantId); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentCommonService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentCommonService.java new file mode 100644 index 0000000000000000000000000000000000000000..e5bb470f74e0a488b51bff291c3fe2e1bc814739 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentCommonService.java @@ -0,0 +1,79 @@ +package com.openhis.web.departmentmanage.appservice; + +import javax.servlet.http.HttpServletRequest; + +import com.core.common.core.domain.R; +import com.openhis.web.departmentmanage.dto.DepartmentInitDto; +import com.openhis.web.departmentmanage.dto.DepartmentSearchParam; + +/** + * 科室材料共通方法 + * + * @author yuxj + * @date 2025-07-22 + */ +public interface IDepartmentCommonService { + /** + * 单据初始化 + * + * @return 初始化信息 + */ + DepartmentInitDto init(); + + /** + * 获取物资 + * + * @param purchaseOrderSearchParam 查询条件 + * @return 物资信息 + */ + R getDeviceInfo(DepartmentSearchParam purchaseOrderSearchParam, Integer pageNo, Integer pageSize, + String searchKey, HttpServletRequest request); + + /** + * 单据列表 + * + * @param purchaseOrderSearchParam 查询条件 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @param locationFlg 仓库flg + * @param supplyType 单据类型 + * @return 订货单据分页列表 + */ + R getPage(DepartmentSearchParam purchaseOrderSearchParam, Integer pageNo, Integer pageSize, + String searchKey, HttpServletRequest request,String locationFlg,Integer supplyType); + + /** + * 删除单据 + * + * @param busNo 单据号 + * @return 操作结果 + */ + R deleteOrder(String busNo); + +// /** +// * 提交审批 +// * +// * @param busNo 单据号 +// * @return 操作结果 +// */ +// R submitApproval(String busNo); + +// /** +// * 同意审批 +// * +// * @param busNo 单据号 +// * @return 操作结果 +// */ +// R agreeApproval(String busNo); + +// /** +// * 撤回审批 +// * +// * @param busNo 单据号 +// * @return 操作结果 +// */ +// R withdrawApproval(String busNo); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentIssuanceOrderService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentIssuanceOrderService.java new file mode 100644 index 0000000000000000000000000000000000000000..166021e3327814db3d712cae4dfb9adcd2b3102e --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentIssuanceOrderService.java @@ -0,0 +1,40 @@ +package com.openhis.web.departmentmanage.appservice; + +import java.util.List; + +import com.core.common.core.domain.R; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; + +/** + * 科室材料发出单 + * + * @author yuxj + * @date 2025-07-22 + */ +public interface IDepartmentIssuanceOrderService { + /** + * 单据初始化 + * + * @return 初始化信息 + */ + R init(); + + /** + * 发出单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 发出单单据详情 + */ + R getDetailPage(String busNo, Integer pageNo, Integer pageSize); + + /** + * 添加/编辑发出单 + * + * @param dispenseIdList 耗材发放id + * @return 操作结果 + */ + boolean addOrEditIssuanceOrder(List dispenseIdList); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentProfitLossOrderService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentProfitLossOrderService.java new file mode 100644 index 0000000000000000000000000000000000000000..ba09f0c465768af31e2d821f71b08ed6471b52f0 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentProfitLossOrderService.java @@ -0,0 +1,47 @@ +package com.openhis.web.departmentmanage.appservice; + +import java.util.List; + +import com.core.common.core.domain.R; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; + +/** + * 科室材料损益单 + * + * @author yuxj + * @date 2025-07-22 + */ +public interface IDepartmentProfitLossOrderService { + /** + * 单据初始化 + * + * @return 初始化信息 + */ + R init(); + + /** + * 损益单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 损益单单据详情 + */ + R getDetailPage(String busNo, Integer pageNo, Integer pageSize); + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + R getBusNo(); + + /** + * 添加/编辑损益单 + * + * @param profitLossOrderDtoList 损益信息 + * @return 操作结果 + */ + R addOrEditProfitLossOrder(List profitLossOrderDtoList); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentReceiptApprovalService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentReceiptApprovalService.java new file mode 100644 index 0000000000000000000000000000000000000000..68b0193dc33cc9e513fd804dc04dee2a8b45e429 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentReceiptApprovalService.java @@ -0,0 +1,89 @@ +package com.openhis.web.departmentmanage.appservice; + +import java.util.List; + +import com.core.common.core.domain.R; +import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto; + +/** + * 科室材料审批方法 + * + * @author yuxj + * @date 2025-07-22 + */ +public interface IDepartmentReceiptApprovalService { + + /** + * 请领单同意审批 + * + * @param busNo 单据号 + * @return 操作结果 + */ + R requisitionOrderAgreeApproval(String busNo); + + /** + * 药房入库单据审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + R stockInOrderAgreeApproved(String busNo); + + /** + * 科室材料退库审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + R returnToWarehouseAgreeApproved(String busNo); + + +// /** +// * 药房发药审批通过 +// * +// * @param busNo 单据号 +// * @return 操作结果 +// */ +// R dispensingAgreeApproved(String busNo); + + /** + * 药房损益单审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + R profitLossAgreeApproved(String busNo); + + /** + * 药房盘点单审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + R stocktakingAgreepproved(String busNo); + /** + * 药房调入单审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + R transferInAgreeApproved(String busNo); + + /** + * 药房调出单审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + R transferOutAgreeApproved(String busNo); + + /** + * 根据单据号获取供应单据及供应项相关详细信息 + * + * @param busNo 单据号 + * @return 供应单据及供应项相关详细信息 + */ + List getSupplyItemDetail(String busNo); + + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentRequisitionOrderService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentRequisitionOrderService.java new file mode 100644 index 0000000000000000000000000000000000000000..a54b42d9d27aff2f9a14dc0f7375cddcf57d4f78 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentRequisitionOrderService.java @@ -0,0 +1,47 @@ +package com.openhis.web.departmentmanage.appservice; + +import java.util.List; + +import com.core.common.core.domain.R; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; + +/** + * 科室材料请领单 + * + * @author yuxj + * @date 2025-07-22 + */ +public interface IDepartmentRequisitionOrderService { + /** + * 单据初始化 + * + * @return 初始化信息 + */ + R init(); + + /** + * 请领单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 请领单单据详情 + */ + R getDetailPage(String busNo, Integer pageNo, Integer pageSize); + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + R getBusNo(); + + /** + * 添加/编辑请领单 + * + * @param requisitionOrderDtoList 请领信息 + * @return 操作结果 + */ + R addOrEditRequisitionOrder(List requisitionOrderDtoList); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentReturnToWarehouseOrderService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentReturnToWarehouseOrderService.java new file mode 100644 index 0000000000000000000000000000000000000000..d9a7d8ce114ba320662fe48ec18c6eb0ceef554f --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentReturnToWarehouseOrderService.java @@ -0,0 +1,47 @@ +package com.openhis.web.departmentmanage.appservice; + +import java.util.List; + +import com.core.common.core.domain.R; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; + +/** + * 科室材料退库单 + * + * @author yuxj + * @date 2025-07-22 + */ +public interface IDepartmentReturnToWarehouseOrderService { + /** + * 单据初始化 + * + * @return 初始化信息 + */ + R init(); + + /** + * 退库单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 退库单单据详情 + */ + R getDetailPage(String busNo, Integer pageNo, Integer pageSize); + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + R getBusNo(); + + /** + * 添加/编辑退库单 + * + * @param returnToDispensaryOrderDtoList 退库信息 + * @return 操作结果 + */ + R addOrEditReturnToWarehouseOrder(List returnToDispensaryOrderDtoList); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentStockInOrderService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentStockInOrderService.java new file mode 100644 index 0000000000000000000000000000000000000000..fbee5cf2e7f2937238aeaf1c3018a1b691f54e51 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentStockInOrderService.java @@ -0,0 +1,47 @@ +package com.openhis.web.departmentmanage.appservice; + +import java.util.List; + +import com.core.common.core.domain.R; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; + +/** + * 科室材料入库单 + * + * @author yuxj + * @date 2025-07-22 + */ +public interface IDepartmentStockInOrderService { + /** + * 单据初始化 + * + * @return 初始化信息 + */ + R init(); + + /** + * 入库单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 入库单单据详情 + */ + R getDetailPage(String busNo, Integer pageNo, Integer pageSize); + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + R getBusNo(); + + /** + * 添加/编辑入库单 + * + * @param stockInOrderDtoList 入库信息 + * @return 操作结果 + */ + R addOrEditStockInOrder(List stockInOrderDtoList); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentStocktakingOrderService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentStocktakingOrderService.java new file mode 100644 index 0000000000000000000000000000000000000000..9a0e90a9d351164f1b7c2624817e9c9b0d85c6de --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentStocktakingOrderService.java @@ -0,0 +1,47 @@ +package com.openhis.web.departmentmanage.appservice; + +import java.util.List; + +import com.core.common.core.domain.R; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; + +/** + * 科室材料盘点单 + * + * @author yuxj + * @date 2025-07-22 + */ +public interface IDepartmentStocktakingOrderService { + /** + * 单据初始化 + * + * @return 初始化信息 + */ + R init(); + + /** + * 盘点单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 盘点单单据详情 + */ + R getDetailPage(String busNo, Integer pageNo, Integer pageSize); + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + R getBusNo(); + + /** + * 添加/编辑盘点单 + * + * @param stocktakingOrderDtoList 盘点信息 + * @return 操作结果 + */ + R addOrEditStocktakingOrder(List stocktakingOrderDtoList); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentTransferInOrderService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentTransferInOrderService.java new file mode 100644 index 0000000000000000000000000000000000000000..37c4e2a382b4c846a56740d6d7b2fd67b2b4f792 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentTransferInOrderService.java @@ -0,0 +1,47 @@ +package com.openhis.web.departmentmanage.appservice; + +import java.util.List; + +import com.core.common.core.domain.R; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; + +/** + * 科室材料调入单 + * + * @author yuxj + * @date 2025-07-22 + */ +public interface IDepartmentTransferInOrderService { + /** + * 单据初始化 + * + * @return 初始化信息 + */ + R init(); + + /** + * 调入单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 调入单单据详情 + */ + R getDetailPage(String busNo, Integer pageNo, Integer pageSize); + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + R getBusNo(); + + /** + * 添加/编辑调出单 + * + * @param transferInOrderDtoList 调出信息 + * @return 操作结果 + */ + R addOrEditTransferInOrder(List transferInOrderDtoList); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentTransferOutOrderService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentTransferOutOrderService.java new file mode 100644 index 0000000000000000000000000000000000000000..d94d01d9734ae2ab070d8323ba245a31941db0f2 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/IDepartmentTransferOutOrderService.java @@ -0,0 +1,47 @@ +package com.openhis.web.departmentmanage.appservice; + +import java.util.List; + +import com.core.common.core.domain.R; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; + +/** + * 科室材料调出单 + * + * @author yuxj + * @date 2025-07-22 + */ +public interface IDepartmentTransferOutOrderService { + /** + * 单据初始化 + * + * @return 初始化信息 + */ + R init(); + + /** + * 调出单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 调出单单据详情 + */ + R getDetailPage(String busNo, Integer pageNo, Integer pageSize); + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + R getBusNo(); + + /** + * 添加/编辑调出单 + * + * @param transferOutOrderDtoList 调出信息 + * @return 操作结果 + */ + R addOrEditTransferOutOrder(List transferOutOrderDtoList); + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentCommonServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentCommonServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..7d4285dbb0ce3ebb855e30eee083274792a0f3da --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentCommonServiceImpl.java @@ -0,0 +1,224 @@ +package com.openhis.web.departmentmanage.appservice.impl; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import com.openhis.administration.domain.Organization; +import com.openhis.administration.service.IOrganizationService; +import com.openhis.common.enums.*; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.MessageUtils; +import com.openhis.administration.domain.Practitioner; +import com.openhis.administration.domain.Supplier; +import com.openhis.administration.service.IPractitionerService; +import com.openhis.administration.service.ISupplierService; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.utils.EnumUtils; +import com.openhis.common.utils.HisQueryUtils; +import com.openhis.web.common.appservice.ICommonService; +import com.openhis.web.common.dto.LocationDto; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.dto.DepartmentDto; +import com.openhis.web.departmentmanage.dto.DepartmentInitDto; +import com.openhis.web.departmentmanage.dto.DepartmentDeviceInfoDto; +import com.openhis.web.departmentmanage.dto.DepartmentSearchParam; +import com.openhis.web.departmentmanage.mapper.DepartmentCommonMapper; +import com.openhis.workflow.domain.SupplyRequest; +import com.openhis.workflow.service.ISupplyRequestService; + +/** + * 科室材料订货单 + * + * @author yuxj + * @date 2025-07-22 + */ +@Service +public class DepartmentCommonServiceImpl implements IDepartmentCommonService { + + @Resource + private ISupplierService supplierService; + + @Resource + private IPractitionerService practitionerService; + + @Resource + private ISupplyRequestService supplyRequestService; + + @Resource + private DepartmentCommonMapper departmentCommonMapper; + @Resource + private ICommonService commonServiceImpl; + @Resource + private IOrganizationService organizationService; + + /** + * 初始化 + * + * @return 初始化信息 + */ + @Override + public DepartmentInitDto init() { + DepartmentInitDto orderInitDto = new DepartmentInitDto(); + + // 查询供应商列表 + List supplierList = supplierService.getList(); + // 查询经手人列表 + List practitionerList = practitionerService.getList(); + // 经手人信息 + List practitionerListOption = practitionerList.stream() + .map(practitioner -> new DepartmentInitDto.LongOption(practitioner.getId(), practitioner.getName())) + .collect(Collectors.toList()); + // 供应商信息 + List supplierListOption = supplierList.stream() + .map(supplier -> new DepartmentInitDto.SupplierOption(supplier.getId(), supplier.getName() ,supplier.getPhone())) + .collect(Collectors.toList()); + // 审批状态 + List supplyStatusOption = Stream.of(SupplyStatus.values()).map( + supplyStatus -> new DepartmentInitDto.IntegerOption(supplyStatus.getValue(), supplyStatus.getInfo())) + .collect(Collectors.toList()); + + // 包装情况 + List packagingConditionOption = Stream.of(PackagingCondition.values()) + .map(packagingCondition -> new DepartmentInitDto.IntegerOption(packagingCondition.getValue(), + packagingCondition.getInfo())) + .collect(Collectors.toList()); + + // 验收结果 + List acceptanceResultOption = Stream.of(AcceptanceResult.values()) + .map(acceptanceResult -> new DepartmentInitDto.IntegerOption(acceptanceResult.getValue(), + acceptanceResult.getInfo())) + .collect(Collectors.toList()); + + // 仓库列表 + List warehouseList = commonServiceImpl.getWarehouseList(); + // 科室列表 + List departmentList = organizationService.getList(OrganizationType.DEPARTMENT.getValue(), null); + + orderInitDto.setWarehouseListOptions(warehouseList).setDepartmentListOptions(departmentList) + .setSupplierOption(supplierListOption).setPractitionerOption(practitionerListOption) + .setSupplyStatusOptions(supplyStatusOption).setPackagingConditionOptions(packagingConditionOption) + .setAcceptanceResultoryOptions(acceptanceResultOption); + + return orderInitDto; + } + + /** + * 获取物资 + * + * @param purchaseOrderSearchParam 查询条件 + * @return 物资信息 + */ + @Override + public R getDeviceInfo(DepartmentSearchParam purchaseOrderSearchParam, Integer pageNo, + Integer pageSize, String searchKey, HttpServletRequest request) { + + Long locationId = purchaseOrderSearchParam.getLocationId(); + purchaseOrderSearchParam.setLocationId(null); + Long supplierId = purchaseOrderSearchParam.getSupplierId(); + purchaseOrderSearchParam.setSupplierId(null); + // 构建查询条件 + QueryWrapper queryWrapper = + HisQueryUtils.buildQueryWrapper(purchaseOrderSearchParam, searchKey, + new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, CommonConstants.FieldName.PyStr)), request); + // 设置排序 + queryWrapper.orderByDesc(CommonConstants.FieldName.Name); + + Page medicationInfoDto = departmentCommonMapper + .getDeviceInfo(new Page<>(pageNo, pageSize), queryWrapper, locationId, supplierId); + + for (DepartmentDeviceInfoDto item : medicationInfoDto.getRecords()) { + List unitList = new ArrayList<>(); + unitList + .add(new DepartmentDeviceInfoDto.Option(item.getUnitCode(), item.getUnitCode_dictText())); + unitList.add( + new DepartmentDeviceInfoDto.Option(item.getMinUnitCode(), item.getMinUnitCode_dictText())); + + item.setUnitList(unitList); + } + + return R.ok(medicationInfoDto); + } + + /** + * 单据列表 + * + * @param purchaseOrderSearchParam 查询条件 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @param locationFlg 仓库flg + * @param supplyType 单据类型 + * @return 订货单据分页列表 + */ + @Override + public R getPage(DepartmentSearchParam purchaseOrderSearchParam, Integer pageNo, Integer pageSize, + String searchKey, HttpServletRequest request, String locationFlg,Integer supplyType) { + //判断哪个画面使用 + if (supplyType != null) { + purchaseOrderSearchParam.setTypeEnum(supplyType); + } +// if (locationForm != null) { +// purchaseOrderSearchParam.setLocationTypeEnum(locationForm); +// } + String originalBusNoFlg = purchaseOrderSearchParam.getOriginalBusNoFlg(); + purchaseOrderSearchParam.setOriginalBusNoFlg(null); + // 构建查询条件 + QueryWrapper queryWrapper = + HisQueryUtils.buildQueryWrapper(purchaseOrderSearchParam, searchKey, + new HashSet<>( + Arrays.asList(CommonConstants.FieldName.SupplyBusNo, CommonConstants.FieldName.ApplicantName)), + request); + // 设置排序 + queryWrapper.orderByDesc(CommonConstants.FieldName.SupplyBusNo); + // 查询订货单分页列表 + Page purchaseOrderDtoPage = + departmentCommonMapper.getPage(new Page<>(pageNo, pageSize), queryWrapper,originalBusNoFlg, locationFlg); + + purchaseOrderDtoPage.getRecords().forEach(e -> { + // 单据状态 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(SupplyStatus.class, e.getStatusEnum())); + // 单据类型 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(SupplyType.class, e.getTypeEnum())); + }); + + return R.ok(purchaseOrderDtoPage); + } + + /** + * 删除单据 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @Override + public R deleteOrder(String busNo) { + // 根据原始单据号查询信息 + List supplyRequest = supplyRequestService.getSupplyByOriginalBusNo(busNo); + if (!supplyRequest.isEmpty()) { + // 将原始单据号信息的原始单据号删除 + boolean flg = supplyRequestService.updateByBusNo(supplyRequest.get(0).getBusNo()); + if (!flg) { + R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + } + + // 删除单据 + boolean result = supplyRequestService.removeByBusNo(busNo); + return result ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)) + : R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentIssuanceOrderServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentIssuanceOrderServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..08553fa20419c974f81a6bdb8eca9b4caf12612b --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentIssuanceOrderServiceImpl.java @@ -0,0 +1,179 @@ +package com.openhis.web.departmentmanage.appservice.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import com.openhis.web.departmentmanage.mapper.DepartmentIssuanceOrderMapper; +import com.openhis.web.pharmacyDispensarymanage.dto.PharmacyDispensaryDetailDto; +import com.openhis.web.pharmacyDispensarymanage.dto.PharmacyDispensaryInitDto; +import com.openhis.web.pharmacyDispensarymanage.mapper.PharmacyDispensaryDispensingOrderMapper; +import com.openhis.workflow.domain.SupplyDelivery; +import com.openhis.workflow.service.ISupplyDeliveryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.MessageUtils; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.utils.EnumUtils; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentIssuanceOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentInitDto; +import com.openhis.web.departmentmanage.mapper.DepartmentCommonMapper; +import com.openhis.web.inventorymanage.dto.ProductStocktakingInitDto; +import com.openhis.workflow.domain.SupplyRequest; +import com.openhis.workflow.service.ISupplyRequestService; + +/** + * 科室材料发出单 + * + * @author yuxj + * @date 2025-07-22 + */ +@Service +public class DepartmentIssuanceOrderServiceImpl implements IDepartmentIssuanceOrderService { + + @Resource + private AssignSeqUtil assignSeqUtil; + @Resource + private ISupplyRequestService supplyRequestService; + @Resource + private ISupplyDeliveryService supplyDeliveryService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + + @Autowired + private DepartmentCommonMapper departmentCommonMapper; + @Autowired + private DepartmentIssuanceOrderMapper departmentIssuanceOrderMapper; + /** + * 初始化 + * + * @return 初始化信息 + */ + @Override + public R init() { + + DepartmentInitDto issuanceOrderInitDto = departmentCommonService.init(); + + // 单据分类 + List supplyCategoryOption = new ArrayList<>(); + supplyCategoryOption + .add(new DepartmentInitDto.IntegerOption(SupplyCategory.OUTPATIENT_PATIENT_DISPENSING.getValue(), + SupplyCategory.OUTPATIENT_PATIENT_DISPENSING.getInfo())); + supplyCategoryOption + .add(new DepartmentInitDto.IntegerOption(SupplyCategory.INPATIENT_PATIENT_DISPENSING.getValue(), + SupplyCategory.INPATIENT_PATIENT_DISPENSING.getInfo())); + supplyCategoryOption.add( + new DepartmentInitDto.IntegerOption(SupplyCategory.INPATIENT_PATIENT_SUMMARY_DISPENSING.getValue(), + SupplyCategory.INPATIENT_PATIENT_SUMMARY_DISPENSING.getInfo())); + + issuanceOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption); + + return R.ok(issuanceOrderInitDto); + } + + /** + * 发出单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 发出单单据详情 + */ + @Override + public R getDetailPage(String busNo, Integer pageNo, Integer pageSize) { + + Page issuanceOrderDtoDetailPage = + departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo); + + issuanceOrderDtoDetailPage.getRecords().forEach(e -> { + // 单据分类 + e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(SupplyCategory.class, e.getCategoryEnum())); + // 单据状态 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(SupplyStatus.class, e.getStatusEnum())); + // 单据类型 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(SupplyType.class, e.getTypeEnum())); + }); + + return R.ok(issuanceOrderDtoDetailPage); + } + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + public String getBusNo() { + return assignSeqUtil.getSeqByDay(AssignSeqEnum.DISPENSING_ORDER.getPrefix(), 4); + } + + /** + * 添加/编辑发出单 + * + * @param dispenseIdList 耗材发放id + * @return 操作结果 + */ + + @Override + public boolean addOrEditIssuanceOrder(List dispenseIdList) { + + // 获取单据号 + String busNo = this.getBusNo(); + // 获取更表所需信息 + List detailDto = + departmentIssuanceOrderMapper.getInfo(dispenseIdList, DispenseStatus.COMPLETED.getValue()); + + List supplyRequestList = new ArrayList<>(); + SupplyRequest supplyRequest; + List supplyDeliveryList = new ArrayList<>(); + SupplyDelivery supplyDelivery; + for (DepartmentDetailDto item : detailDto) { + // 供应申请 + supplyRequest = new SupplyRequest().setBusNo(busNo).setTypeEnum(SupplyType.DISPENSING_ORDER.getValue()) + .setStatusEnum(SupplyStatus.AGREE.getValue()).setCategoryEnum(item.getCategoryEnum()) + .setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId()) + .setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity()) + .setLotNumber(item.getLotNumber()) + .setSourceTypeEnum(LocationForm.CABINET.getValue()).setSourceLocationId(item.getSourceLocationId()) + .setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue()) + .setPurposeLocationId(item.getPurposeLocationId()).setApplicantId(item.getApplicantId()) + .setApplyTime(item.getApplyTime()).setApproverId(item.getApproverId()) + .setApprovalTime(item.getApprovalTime()); + supplyRequestList.add(supplyRequest); + // 供应发放 + supplyDelivery = new SupplyDelivery().setRequestId(supplyRequest.getId()) + .setStatusEnum(DispenseStatus.COMPLETED.getValue()).setTypeEnum(supplyRequest.getTypeEnum()) + .setItemTable(supplyRequest.getItemTable()).setItemId(supplyRequest.getItemId()) + .setBasedOnTable(CommonConstants.TableName.WOR_DEVICE_DISPENSE).setBasedOnIds(item.getDispenseIds()) + .setUnitCode(supplyRequest.getUnitCode()).setQuantity(supplyRequest.getItemQuantity()) + .setLotNumber(supplyRequest.getLotNumber()) + .setPractitionerId(supplyRequest.getApplicantId()).setOccurrenceTime(supplyRequest.getApprovalTime()) + .setReceiverId(supplyRequest.getPurposeLocationId()).setReceiveTime(supplyRequest.getApprovalTime()); + + supplyDeliveryList.add(supplyDelivery); + } + + // 更新供应请求表 + boolean requestFlg = supplyRequestService.saveBatch(supplyRequestList); + if (!requestFlg) { + return false; + } + // 更新供应发放表 + boolean deliveryFlg = supplyDeliveryService.saveBatch(supplyDeliveryList); + if (!deliveryFlg) { + return false; + } + + return true; + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentProfitLossOrderServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentProfitLossOrderServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..b22470c8c578c0176262990f3da9da7efd953eef --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentProfitLossOrderServiceImpl.java @@ -0,0 +1,174 @@ +package com.openhis.web.departmentmanage.appservice.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.DateUtils; +import com.core.common.utils.MessageUtils; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.utils.EnumUtils; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentProfitLossOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentInitDto; +import com.openhis.web.departmentmanage.mapper.DepartmentCommonMapper; +import com.openhis.web.departmentmanage.mapper.DepartmentProfitLossOrderMapper; +import com.openhis.web.inventorymanage.dto.ProductStocktakingInitDto; +import com.openhis.workflow.domain.SupplyRequest; +import com.openhis.workflow.service.ISupplyRequestService; + +/** + * 科室材料损益单 + * + * @author yuxj + * @date 2025-07-22 + */ +@Service +public class DepartmentProfitLossOrderServiceImpl implements IDepartmentProfitLossOrderService { + + @Resource + private AssignSeqUtil assignSeqUtil; + @Resource + private ISupplyRequestService supplyRequestService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + @Autowired + private DepartmentCommonMapper departmentCommonMapper; + /** + * 初始化 + * + * @return 初始化信息 + */ + @Override + public R init() { + + DepartmentInitDto purchaseOrderInitDto = departmentCommonService.init(); + + // 单据分类 + List supplyCategoryOption = new ArrayList<>(); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption(SupplyCategory.GENERAL_PROFIT_AND_LOSS.getValue(), + SupplyCategory.GENERAL_PROFIT_AND_LOSS.getInfo())); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption(SupplyCategory.STOCKTAKING_PROFIT_AND_LOSS.getValue(), + SupplyCategory.STOCKTAKING_PROFIT_AND_LOSS.getInfo())); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption(SupplyCategory.STANDBY_RESCUE_MEDICINES.getValue(), + SupplyCategory.STANDBY_RESCUE_MEDICINES.getInfo())); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption(SupplyCategory.DAMAGED_EXPIRED_MEDICINES.getValue(), + SupplyCategory.DAMAGED_EXPIRED_MEDICINES.getInfo())); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption(SupplyCategory.DONATED_MEDICINES.getValue(), + SupplyCategory.DONATED_MEDICINES.getInfo())); + + purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption); + + return R.ok(purchaseOrderInitDto); + } + + /** + * 损益单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 损益单单据详情 + */ + @Override + public R getDetailPage(String busNo, Integer pageNo, Integer pageSize) { + + Page profitLossOrderDtoDetailPage = + departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo); + + profitLossOrderDtoDetailPage.getRecords().forEach(e -> { + // 单据分类 + e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(SupplyCategory.class, e.getCategoryEnum())); + // 单据状态 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(SupplyStatus.class, e.getStatusEnum())); + // 单据类型 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(SupplyType.class, e.getTypeEnum())); + }); + + List unitList; + for (DepartmentDetailDto item : profitLossOrderDtoDetailPage.getRecords()) { + unitList = new ArrayList<>(); + unitList.add(new DepartmentDetailDto.Option(item.getMaxUnitCode(),item.getMaxUnitCode_dictText())); + unitList.add(new DepartmentDetailDto.Option(item.getMinUnitCode(),item.getMinUnitCode_dictText() + )); + + item.setUnitList(unitList); + } + return R.ok(profitLossOrderDtoDetailPage); + } + + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @Override + public R getBusNo() { + + ProductStocktakingInitDto initDto = new ProductStocktakingInitDto(); + // 单据号 + initDto.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEPARTMENT_PRPFITLOSS.getPrefix(), 4)); + + return R.ok(initDto); + } + + /** + * 添加/编辑损益单 + * + * @param profitLossOrderDtoList 损益信息 + * @return 操作结果 + */ + + @Override + public R addOrEditProfitLossOrder(List profitLossOrderDtoList) { + // 请求数据取得 + List requestList = supplyRequestService.getSupplyByBusNo(profitLossOrderDtoList.get(0).getBusNo()); + if (!requestList.isEmpty()) { + // 请求id取得 + List requestIdList = requestList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + // 单据信息删除 + supplyRequestService.removeByIds(requestIdList); + } + + List supplyRequestList = new ArrayList<>(); + Date applyTime = DateUtils.getNowDate(); + for (DepartmentDetailDto item : profitLossOrderDtoList) { + SupplyRequest supplyRequest = + new SupplyRequest().setBusNo(item.getBusNo()).setTypeEnum(SupplyType.DEPARTMENT_PRPFITLOSS.getValue()) + .setStatusEnum(SupplyStatus.PENDING_REVIEW.getValue()).setCategoryEnum(item.getCategoryEnum()) + .setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId()) + .setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity()).setPrice(item.getPrice()) + .setTotalPrice(item.getTotalPrice()).setRetailPrice(item.getRetailPrice()) + .setTotalRetailPrice(item.getTotalRetailPrice()).setBatchInventory(item.getBatchInventory()) + .setSpecificationInventory(item.getSpecificationInventory()).setStartTime(item.getStartTime()) + .setEndTime(item.getEndTime()).setLotNumber(item.getLotNumber()).setTraceNo(item.getTraceNo()) + .setTraceNoUnitCode(item.getTraceNoUnitCode()).setReason(item.getReason()) + .setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue()).setPurposeLocationId(item.getPurposeLocationId()) + .setApplicantId(item.getApplicantId()) + .setApplyTime(applyTime).setRemake(item.getRemake()); + supplyRequestList.add(supplyRequest); + } + // 更新请求表 + boolean flg = supplyRequestService.saveOrUpdateBatch(supplyRequestList); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null)); + } + + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentReceiptApprovalServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentReceiptApprovalServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..f3411347a2045ce23755943ced18c13e5bd13772 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentReceiptApprovalServiceImpl.java @@ -0,0 +1,933 @@ +package com.openhis.web.departmentmanage.appservice.impl; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.core.common.core.domain.R; +import com.core.common.utils.DateUtils; +import com.core.common.utils.MessageUtils; +import com.core.common.utils.SecurityUtils; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.DispenseStatus; +import com.openhis.common.enums.SupplyType; +import com.openhis.common.enums.TraceNoStatus; +import com.openhis.common.enums.Whether; +import com.openhis.common.enums.ybenums.YbInvChgType; +import com.openhis.common.enums.ybenums.YbRxFlag; +import com.openhis.medication.domain.MedicationDispense; +import com.openhis.medication.service.IMedicationDispenseService; +import com.openhis.web.departmentmanage.appservice.IDepartmentReceiptApprovalService; +import com.openhis.web.inventorymanage.appservice.IReceiptApprovalAppService; +import com.openhis.web.inventorymanage.appservice.ITraceNoAppService; +import com.openhis.web.inventorymanage.assembler.InventoryManageAssembler; +import com.openhis.web.inventorymanage.dto.ItemChargeDetailDto; +import com.openhis.web.inventorymanage.dto.SupplyItemDetailDto; +import com.openhis.web.inventorymanage.mapper.ReceiptApprovalMapper; +import com.openhis.workflow.domain.DeviceDispense; +import com.openhis.workflow.domain.InventoryItem; +import com.openhis.workflow.domain.SupplyDelivery; +import com.openhis.workflow.domain.SupplyRequest; +import com.openhis.workflow.service.IDeviceDispenseService; +import com.openhis.workflow.service.IInventoryItemService; +import com.openhis.workflow.service.ISupplyDeliveryService; +import com.openhis.workflow.service.ISupplyRequestService; +import com.openhis.yb.dto.Medical3503Param; +import com.openhis.yb.dto.MedicalInventory3501Param; +import com.openhis.yb.dto.MedicalInventory3502Param; +import com.openhis.yb.dto.MedicalPurchase3504Param; +import com.openhis.yb.service.YbManager; + +/** + * 科室材料审批 + * + * @author yuxj + * @date 2025-07-22 + */ +@Service +public class DepartmentReceiptApprovalServiceImpl implements IDepartmentReceiptApprovalService { + @Autowired + private ITraceNoAppService traceNoAppService; + @Resource + private ISupplyRequestService supplyRequestService; + + @Autowired + private ISupplyDeliveryService supplyDeliveryService; + @Autowired + private IInventoryItemService inventoryItemService; + @Autowired + private ReceiptApprovalMapper receiptApprovalMapper; + @Autowired + private YbManager ybService; + @Autowired + private IMedicationDispenseService medicationDispenseService; + @Autowired + private IDeviceDispenseService deviceDispenseService; + @Autowired + private IReceiptApprovalAppService receiptApprovalAppService; + + /** + * 请领单同意审批 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @Override + public R requisitionOrderAgreeApproval(String busNo) { + // 获取当前时间 + Date now = DateUtils.getNowDate(); + // 审批单据并返回单据详情 + List agreedList = supplyRequestService.agreeRequest(busNo, now); + if (agreedList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + // // 获取审批通过后的供应请求id列表 + // List supplyReqIdList = agreedList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + // + // // 校验(已经审批通过的单号(发放状态是已完成),不能再重复审批通过) + // boolean validation = supplyDeliveryService.supplyDeliveryValidation(supplyReqIdList); + // if (validation) { + // throw new ServiceException("请勿重复审批"); + // } + // // 根据单据,生成供应发放单 + // List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); + // if (deliveredList.isEmpty()) { + // return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + // } + + return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + + /** + * 科室材料入库单据审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @Override + public R stockInOrderAgreeApproved(String busNo) { + // 获取当前时间 + Date now = DateUtils.getNowDate(); + // 审批单据并返回单据详情 + List agreedList = supplyRequestService.agreeRequest(busNo, now); + if (agreedList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + + // 根据单据,发放物品 + List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); + if (deliveredList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + + // 查询供应项目的详细信息 + List supplyItemDetailList = this.getSupplyItemDetail(busNo); + // 返回信息 + String returnMsg = null; + if (!supplyItemDetailList.isEmpty()) { + InventoryItem inventoryItemPurpose = null; + // 新增库存信息 + List supplyList = new ArrayList<>(); + + for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) { + // 根据项目id,产品批号,仓库id 查询仓库库存表信息 + List inventoryItemList = inventoryItemService.selectInventoryByItemId( + supplyItemDetailDto.getItemId(), supplyItemDetailDto.getLotNumber(), + supplyItemDetailDto.getPurposeLocationId(), SecurityUtils.getLoginUser().getTenantId()); + + if (!inventoryItemList.isEmpty()) { + inventoryItemPurpose = inventoryItemList.get(0); + } + + if (inventoryItemPurpose == null) { + // 新增库存信息 + supplyList.add(supplyItemDetailDto); + } else { + // 最小数量(最小单位库存数量) + BigDecimal minQuantity = inventoryItemPurpose.getQuantity(); + + // 计算盘点后库存数量,结果取小单位 + // 供应申请的物品计量单位与包装单位相同 + if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) { + // 源仓库库存+(调拨数量*拆零比) + minQuantity = minQuantity + .add(supplyItemDetailDto.getPartPercent().multiply(supplyItemDetailDto.getItemQuantity())); + + } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { + // 供应申请的物品计量单位与最小单位相同 + // 源仓库库存+调拨数量 + minQuantity = minQuantity.add(supplyItemDetailDto.getItemQuantity()); + } + // 更新源仓库库存数量 + Boolean aBoolean = + inventoryItemService.updateInventoryQuantity(inventoryItemPurpose.getId(), minQuantity, now); + + if (!aBoolean) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + } + } + + if (!supplyList.isEmpty()) { + // 将供应项目的详细信息装配为库存项目 + List inventoryItemList = InventoryManageAssembler.assembleInventoryItem(supplyList); + // 入库 + inventoryItemService.stockIn(inventoryItemList); + } + + // 追加追溯码信息 + boolean flg = traceNoAppService.addTraceNoManage(supplyItemDetailList, TraceNoStatus.IN.getValue(), + SupplyType.PURCHASE_STOCKIN.getValue()); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + + // 调用医保商品采购接口 todo 科室材料相关医保接口未对应 + String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关 + if (Whether.YES.getCode().equals(ybSwitch)) { + List uploadFailedNoList = + this.ybInventoryIntegrated(supplyItemDetailList, YbInvChgType.PURCHASE_IN, false, true, false, now); + if (!uploadFailedNoList.isEmpty()) { + returnMsg = "3503商品采购上传错误,错误项目编码" + uploadFailedNoList; + } else { + returnMsg = "3503商品采购上传成功"; + } + } + } + return R.ok(returnMsg, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + + /** + * 药库退库审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @Override + public R returnToWarehouseAgreeApproved(String busNo) { + // 获取当前时间 + Date now = DateUtils.getNowDate(); + // 审批单据并返回单据详情 + List agreedList = supplyRequestService.agreeRequest(busNo, now); + if (agreedList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + + // 根据单据,发放物品 + List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); + if (deliveredList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + + // 查询供应项目的详细信息 + List supplyItemDetailList = this.getSupplyItemDetail(busNo); + // 返回信息 + String returnMsg = null; + if (!supplyItemDetailList.isEmpty()) { + for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) { + // 根据项目id,产品批号,目的仓库id 查询仓库库存表信息 + List inventoryItemList = inventoryItemService.selectInventoryByItemId( + supplyItemDetailDto.getItemId(), supplyItemDetailDto.getLotNumber(), + supplyItemDetailDto.getSourceLocationId(), SecurityUtils.getLoginUser().getTenantId()); + InventoryItem inventoryItemSource; + if (!inventoryItemList.isEmpty()) { + inventoryItemSource = inventoryItemList.get(0); + // 最小数量(最小单位库存数量) + BigDecimal minQuantity = inventoryItemSource.getQuantity(); + + // 计算退货后库存数量,结果取小单位 + // 供应申请的物品计量单位与包装单位相同 + if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) { + if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { + // 库存数量不足 + return R.fail(MessageUtils.createMessage("操作失败,库存数量不足", null)); + } else { + // 仓库库存-(退货数量*拆零比) + minQuantity = minQuantity.subtract( + supplyItemDetailDto.getPartPercent().multiply(supplyItemDetailDto.getItemQuantity())); + } + } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { + if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { + // 库存数量不足 + return R.fail(MessageUtils.createMessage("操作失败,库存数量不足", null)); + } else { + // 供应申请的物品计量单位与最小单位相同 + // 仓库库存-退货数量 + minQuantity = minQuantity.subtract(supplyItemDetailDto.getItemQuantity()); + } + } + // 更新仓库库存数量 + Boolean aBoolean = + inventoryItemService.updateInventoryQuantity(inventoryItemSource.getId(), minQuantity, now); + + if (!aBoolean) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + } + } + // 追加追溯码信息 + boolean flg = traceNoAppService.addTraceNoManage(supplyItemDetailList, TraceNoStatus.OUT.getValue(), + SupplyType.PURCHASE_RETURN.getValue()); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + // 调用医保采购退货接口 + String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关 + if (Whether.YES.getCode().equals(ybSwitch)) { + List uploadFailedNoList = + this.ybInventoryIntegrated(supplyItemDetailList, YbInvChgType.RETURN_OUT, false, false, true, now); + if (!uploadFailedNoList.isEmpty()) { + returnMsg = "3504采购退货上传错误,错误项目编码" + uploadFailedNoList; + } + } + } + return R.ok(returnMsg, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + // + // /** + // * 科室材料发药审批通过 todo 发药只查询,没有审批 + // * + // * @param busNo 单据号 + // * @return 操作结果 + // */ + // @Override + // public R dispensingAgreeApproved(String busNo) { + // // 获取当前时间 + // Date now = DateUtils.getNowDate(); + // // 审批单据并返回单据详情 + // List agreedList = supplyRequestService.agreeRequest(busNo, now); + // if (agreedList.isEmpty()) { + // return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + // } + // // 根据单据,发放物品 + // List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); + // if (deliveredList.isEmpty()) { + // return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + // } + // + // // 查询供应项目的详细信息 + // List supplyItemDetailList = this.getSupplyItemDetail(busNo); + // + // if (!supplyItemDetailList.isEmpty()) { + // + // for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) { + // // 根据项目id,产品批号,源仓库id 查询源仓库库存表信息 + // List inventoryItemSourceList = inventoryItemService.selectInventoryByItemId( + // supplyItemDetailDto.getItemId(), supplyItemDetailDto.getLotNumber(), + // supplyItemDetailDto.getSourceLocationId(), SecurityUtils.getLoginUser().getTenantId()); + // InventoryItem inventoryItemSource = new InventoryItem(); + // if (!inventoryItemSourceList.isEmpty()) { + // inventoryItemSource = inventoryItemSourceList.get(0); + // + // // 包装数量(常规单位库存数量) 更新库存数量方法中没用到 + // BigDecimal baseQuantitySource = inventoryItemSource.getQuantity(); + // // 最小数量(最小单位库存数量) + // BigDecimal minQuantitySource = inventoryItemSource.getQuantity(); + // + // // 供应申请的物品计量单位与包装单位相同 + // if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) { + // if (minQuantitySource.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { + // // 库存数量不足 + // return R.fail(MessageUtils.createMessage("操作失败,库存数量不足", null)); + // } else { + // // 源仓库库存-(领用数量*拆零比) + // minQuantitySource = minQuantitySource.subtract( + // supplyItemDetailDto.getPartPercent().multiply(supplyItemDetailDto.getItemQuantity())); + // } + // } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { + // if (minQuantitySource.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { + // // 库存数量不足 + // return R.fail(MessageUtils.createMessage("操作失败,库存数量不足", null)); + // } else { + // // 供应申请的物品计量单位与最小单位相同 + // // 源仓库库存-领用数量 + // minQuantitySource = minQuantitySource.subtract(supplyItemDetailDto.getItemQuantity()); + // } + // } + // // 更新源仓库库存数量 + // Boolean aBooleanSource = inventoryItemService.updateInventoryQuantity(inventoryItemSource.getId(), + // baseQuantitySource, minQuantitySource, now, supplyItemDetailDto.getTraceNo()); + // + // if (!aBooleanSource) { + // return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + // } + // } + // } + // + // } + // return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + // } + + /** + * 科室材料损益单审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @Override + public R profitLossAgreeApproved(String busNo) { + // 获取当前时间 + Date now = DateUtils.getNowDate(); + // 审批单据并返回单据详情 + List agreedList = supplyRequestService.agreeRequest(busNo, now); + if (agreedList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + // 根据单据,生成供应发放单 + List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); + if (deliveredList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + // 返回信息 + String returnMsg = null; + // 查询供应项目的详细信息 + List supplyItemDetailList = this.getSupplyItemDetail(busNo); + if (!supplyItemDetailList.isEmpty()) { + + for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) { + // 根据id,产品批号,仓库 查询库存表信息 + List inventoryItemList = inventoryItemService.selectInventoryByItemId( + supplyItemDetailDto.getItemId(), supplyItemDetailDto.getLotNumber(), + supplyItemDetailDto.getPurposeLocationId(), SecurityUtils.getLoginUser().getTenantId()); + InventoryItem inventoryItem = new InventoryItem(); + if (!inventoryItemList.isEmpty()) { + inventoryItem = inventoryItemList.get(0); + // 最小数量(最小单位库存数量) + BigDecimal minQuantity = null; + + // 计算报损后库存数量,结果取小单位 + // 供应申请的物品计量单位与包装单位相同 + if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) { + // 数量*拆零比 + minQuantity = + supplyItemDetailDto.getPartPercent().multiply(supplyItemDetailDto.getItemQuantity()); + } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { + // 供应申请的物品计量单位与最小单位相同 + // 数量 + minQuantity = supplyItemDetailDto.getItemQuantity(); + } + // 更新库存数量 + Boolean aBoolean = + inventoryItemService.updateInventoryQuantity(inventoryItem.getId(), minQuantity, now); + if (!aBoolean) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + } + } + + // 追加追溯码信息 + boolean flg = + traceNoAppService.updateTraceNoList(supplyItemDetailList, SupplyType.PURCHASE_PRPFITLOSS.getValue()); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + + // 调用医保库存变更接口 + String ybSwitch = SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关 + if (Whether.YES.getCode().equals(ybSwitch)) { + List uploadFailedNoList = this.ybInventoryIntegrated(supplyItemDetailList, + YbInvChgType.DESTRUCTION, false, false, false, now); + if (!uploadFailedNoList.isEmpty()) { + returnMsg = "3502库存变更上传错误,错误项目编码" + uploadFailedNoList; + } + } + } + return R.ok(returnMsg, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + + /** + * 科室材料盘点单审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @Override + public R stocktakingAgreepproved(String busNo) { + // 获取当前时间 + Date now = DateUtils.getNowDate(); + // 审批单据并返回单据详情 + List agreedList = supplyRequestService.agreeRequest(busNo, now); + if (agreedList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + // 根据单据,生成供应发放单 + List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); + if (deliveredList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + + // 查询供应项目的详细信息 + List supplyItemDetailList = this.getSupplyItemDetail(busNo); + // 首次盘存列表 + List firstSupplyItemDetailList = new ArrayList<>(); + // 药品/耗材发放列表 + List medicationDispenses = null; + List deviceDispenses = null; + // 返回信息 + String stocktakingReturnMsg = null; + String changeReturnMsg = null; + if (!supplyItemDetailList.isEmpty()) { + // 获取盘盈列表(itemQuantity > 0) + List positiveList = supplyItemDetailList.stream() + .filter(item -> item.getItemQuantity() != null && item.getItemQuantity().compareTo(BigDecimal.ZERO) > 0) + .collect(Collectors.toList()); + // 获取盘亏列表(itemQuantity < 0) + List negativeList = supplyItemDetailList.stream() + .filter(item -> item.getItemQuantity() != null && item.getItemQuantity().compareTo(BigDecimal.ZERO) < 0) + .collect(Collectors.toList()); + + for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) { + // 根据id,产品批号,仓库 查询库存表信息 + List inventoryItemList = inventoryItemService.selectInventoryByItemId( + supplyItemDetailDto.getItemId(), supplyItemDetailDto.getLotNumber(), + supplyItemDetailDto.getPurposeLocationId(), SecurityUtils.getLoginUser().getTenantId()); + // 查看该批号的药品/耗材是否发放过(用于证明是否首次盘存) + if (CommonConstants.TableName.MED_MEDICATION_DEFINITION.equals(supplyItemDetailDto.getItemTable())) { + medicationDispenses = medicationDispenseService.list(new LambdaQueryWrapper() + .eq(MedicationDispense::getLotNumber, supplyItemDetailDto.getLotNumber())); + if (medicationDispenses.isEmpty()) { + firstSupplyItemDetailList.add(supplyItemDetailDto); + } + } else if (CommonConstants.TableName.ADM_DEVICE_DEFINITION.equals(supplyItemDetailDto.getItemTable())) { + deviceDispenses = deviceDispenseService.list(new LambdaQueryWrapper() + .in(DeviceDispense::getLotNumber, supplyItemDetailDto.getLotNumber())); + if (deviceDispenses.isEmpty()) { + firstSupplyItemDetailList.add(supplyItemDetailDto); + } + } + if (!inventoryItemList.isEmpty()) { + InventoryItem inventoryItem = inventoryItemList.get(0); + // 包装数量(常规单位库存数量) 更新库存数量方法中没用到 + BigDecimal baseQuantity = inventoryItem.getQuantity(); + // 最小数量(最小单位库存数量) + BigDecimal minQuantity = null; + + // 计算盘点后库存数量,结果取小单位 + // 供应申请的物品计量单位与包装单位相同 + if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) { + minQuantity = + supplyItemDetailDto.getPartPercent().multiply(supplyItemDetailDto.getTotalQuantity()); + // 供应申请的物品计量单位与最小单位相同 + } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { + minQuantity = supplyItemDetailDto.getTotalQuantity(); + } + // 更新库存数量 + Boolean aBoolean = + inventoryItemService.updateInventoryQuantity(inventoryItem.getId(), minQuantity, now); + if (!aBoolean) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + } + + String ybSwitch = + SecurityUtils.getLoginUser().getOptionJson().getString(CommonConstants.Option.YB_SWITCH); // 医保开关 + if (Whether.YES.getCode().equals(ybSwitch)) { + // 如果首次盘点信息不为空 + if (!firstSupplyItemDetailList.isEmpty()) { + // 调用医保盘存接口,盘盈 + List uploadFailedNoList = this.ybInventoryIntegrated(firstSupplyItemDetailList, + YbInvChgType.INVENTORY_GAIN, true, false, false, now); + if (!uploadFailedNoList.isEmpty()) { + stocktakingReturnMsg = "3501盘存上传错误,错误项目编码" + uploadFailedNoList; + } + } + List uploadFailedGainList = null; + List uploadFailedLossList = null; + if (!positiveList.isEmpty()) { + // 调用医保库存变更接口,盘盈 + uploadFailedGainList = this.ybInventoryIntegrated(positiveList, YbInvChgType.INVENTORY_GAIN, + false, false, false, now); + } + if (!negativeList.isEmpty()) { + // 调用医保库存变更接口,盘亏 + uploadFailedLossList = this.ybInventoryIntegrated(negativeList, YbInvChgType.INVENTORY_LOSS, + false, false, false, now); + } + if (uploadFailedGainList != null || uploadFailedLossList != null) { + changeReturnMsg = "3502库存变更上传错误,错误项目编码" + uploadFailedGainList + uploadFailedLossList; + } + } + } + // 追加追溯码信息 + boolean flg = + traceNoAppService.updateTraceNoList(supplyItemDetailList, SupplyType.PURCHASE_STOCKTAKING.getValue()); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + } + return R.ok(stocktakingReturnMsg + changeReturnMsg, + MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + + /** + * 科室材料调入单审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @Override + public R transferInAgreeApproved(String busNo) { + // 获取当前时间 + Date now = DateUtils.getNowDate(); + // 审批单据并返回单据详情 + List agreedList = supplyRequestService.agreeRequest(busNo, now); + if (agreedList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + // 根据单据,发放物品 + List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); + if (deliveredList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + + // 查询供应项目的详细信息 + List supplyItemDetailList = this.getSupplyItemDetail(busNo); + + if (!supplyItemDetailList.isEmpty()) { + + // 新增库存信息 + List supplylList = new ArrayList<>(); + + for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) { + // 根据项目id,产品批号,目的仓库id 查询目的仓库库存表信息 + List inventoryItemPurposeList = inventoryItemService.selectInventoryByItemId( + supplyItemDetailDto.getItemId(), supplyItemDetailDto.getLotNumber(), + supplyItemDetailDto.getPurposeLocationId(), SecurityUtils.getLoginUser().getTenantId()); + InventoryItem inventoryItemPurpose = null; + if (!inventoryItemPurposeList.isEmpty()) { + inventoryItemPurpose = inventoryItemPurposeList.get(0); + } + + if (inventoryItemPurpose == null) { + // 新增库存信息 + supplylList.add(supplyItemDetailDto); + } else { + // 包装数量(常规单位库存数量) 更新库存数量方法中没用到 + BigDecimal baseQuantity = inventoryItemPurpose.getQuantity(); + // 最小数量(最小单位库存数量) + BigDecimal minQuantity = inventoryItemPurpose.getQuantity(); + + // 计算盘点后库存数量,结果取小单位 + // 供应申请的物品计量单位与包装单位相同 + if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) { + // 源仓库库存+(退库数量*拆零比) + minQuantity = minQuantity + .add(supplyItemDetailDto.getPartPercent().multiply(supplyItemDetailDto.getItemQuantity())); + } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { + // 供应申请的物品计量单位与最小单位相同 + // 源仓库库存+退库数量 + minQuantity = minQuantity.add(supplyItemDetailDto.getItemQuantity()); + } + // 更新目的仓库库存数量 + Boolean bBooleanPurpose = + inventoryItemService.updateInventoryQuantity(inventoryItemPurpose.getId(), minQuantity, now); + if (!bBooleanPurpose) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + } + } + if (!supplylList.isEmpty()) { + // 将供应项目的详细信息装配为库存项目 + List inventoryItemList = InventoryManageAssembler.assembleInventoryItem(supplylList); + // 入库 + inventoryItemService.stockIn(inventoryItemList); + } + // 追加追溯码信息 + boolean flg = traceNoAppService.addTraceNoManage(supplyItemDetailList, TraceNoStatus.IN.getValue(), + SupplyType.PURCHASE_TRANSFERIN.getValue()); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + } + return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + + } + + /** + * 科室材料调出单审批通过 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @Override + public R transferOutAgreeApproved(String busNo) { + // 获取当前时间 + Date now = DateUtils.getNowDate(); + // 审批单据并返回单据详情 + List agreedList = supplyRequestService.agreeRequest(busNo, now); + if (agreedList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + // 根据单据,发放物品 + List deliveredList = supplyDeliveryService.createCompletedSupplyDelivery(agreedList, now); + if (deliveredList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + + // 查询供应项目的详细信息 + List supplyItemDetailList = this.getSupplyItemDetail(busNo); + + if (!supplyItemDetailList.isEmpty()) { + for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) { + // 根据项目id,产品批号,目的仓库id 查询目的仓库库存表信息 + List inventoryItemSourceList = inventoryItemService.selectInventoryByItemId( + supplyItemDetailDto.getItemId(), supplyItemDetailDto.getLotNumber(), + supplyItemDetailDto.getSourceLocationId(), SecurityUtils.getLoginUser().getTenantId()); + InventoryItem inventoryItemSource = null; + if (!inventoryItemSourceList.isEmpty()) { + inventoryItemSource = inventoryItemSourceList.get(0); + + // 包装数量(常规单位库存数量) 更新库存数量方法中没用到 + BigDecimal baseQuantity = inventoryItemSource.getQuantity(); + // 最小数量(最小单位库存数量) + BigDecimal minQuantity = inventoryItemSource.getQuantity(); + + // 计算盘点后库存数量,结果取小单位 + // 供应申请的物品计量单位与包装单位相同 + if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getUnitCode())) { + if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { + // 库存数量不足 + return R.fail(MessageUtils.createMessage("操作失败,库存数量不足", null)); + } else { + // 源仓库库存-(退库数量*拆零比) + minQuantity = minQuantity.subtract( + supplyItemDetailDto.getPartPercent().multiply(supplyItemDetailDto.getItemQuantity())); + } + } else if (supplyItemDetailDto.getItemUnit().equals(supplyItemDetailDto.getMinUnitCode())) { + if (minQuantity.compareTo(supplyItemDetailDto.getItemQuantity()) < 0) { + // 库存数量不足 + return R.fail(MessageUtils.createMessage("操作失败,库存数量不足", null)); + } else { + // 供应申请的物品计量单位与最小单位相同 + // 源仓库库存-退库数量 + minQuantity = minQuantity.subtract(supplyItemDetailDto.getItemQuantity()); + } + } + // 更新目的仓库库存数量 + Boolean bBooleanSource = + inventoryItemService.updateInventoryQuantity(inventoryItemSource.getId(), minQuantity, now); + if (!bBooleanSource) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + } + } + // 追加追溯码信息 + boolean flg = traceNoAppService.addTraceNoManage(supplyItemDetailList, TraceNoStatus.OUT.getValue(), + SupplyType.PURCHASE_TRANSFEROUT.getValue()); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + } + return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + + } + + /** + * 根据单据号获取供应单据及供应项相关详细信息 + * + * @param busNo 单据号 + * @return 供应单据及供应项相关详细信息 + */ + @Override + public List getSupplyItemDetail(String busNo) { + return receiptApprovalMapper.selectSupplyDetail(busNo, DispenseStatus.COMPLETED.getValue()); + } + + /** + * 医保库存相关进销存接口 + * + * @param supplyItemDetailList 供应申请项目详细信息 + * @param ybInvChgType 库存变更类型 + * @param firstFlag 首次盘存标识 + * @param now 库存变更时间 + * @return 上传失败的id集合 + */ + private List ybInventoryIntegrated(List supplyItemDetailList, + YbInvChgType ybInvChgType, Boolean firstFlag, Boolean purchaseFlag, Boolean returnFlag, Date now) { + List uploadFailedNoList = new ArrayList<>(); + R result; + R firstResult = R.ok(); + R returnResult = R.ok(); + R purchaseResult = R.ok(); + for (SupplyItemDetailDto supplyItemDetailDto : supplyItemDetailList) { + if (supplyItemDetailDto.getYbNo() == null) { + continue; + } + switch (ybInvChgType) { + case ALLOCATION_IN: + case ALLOCATION_OUT: + case INVENTORY_GAIN: + case INVENTORY_LOSS: + case DESTRUCTION: + case OTHER_IN: + case OTHER_OUT: + case DONATION_IN: + case DONATION_RETURN_OUT: + case PURCHASE_IN: + case RETURN_OUT: + if (firstFlag) { + firstResult = + ybService.uploadInventoryCount(getMedicalInventory3501Param(supplyItemDetailDto, now), now); + if (firstResult.getCode() != 200) { + uploadFailedNoList.add(supplyItemDetailDto.getItemBusNo()); + } + } + if (returnFlag) { + returnResult = + ybService.cancelProcurement(getMedicalPurchase3504Param(supplyItemDetailDto, now)); + if (returnResult.getCode() != 200) { + uploadFailedNoList.add(supplyItemDetailDto.getItemBusNo()); + } + } + if (purchaseFlag) { + purchaseResult = ybService.procurement(getMedical3503Param(supplyItemDetailDto, now)); + if (purchaseResult.getCode() != 200) { + uploadFailedNoList.add(supplyItemDetailDto.getItemBusNo()); + } + } + result = ybService.updateInventoryCount( + getMedicalInventory3502Param(supplyItemDetailDto, now, ybInvChgType.getValue())); + if (result.getCode() != 200) { + uploadFailedNoList.add(supplyItemDetailDto.getItemBusNo()); + } + break; + default: + throw new IllegalArgumentException("未知的库存变更类型: " + ybInvChgType); + } + } + return uploadFailedNoList; + } + + private MedicalPurchase3504Param getMedicalPurchase3504Param(SupplyItemDetailDto supplyItemDetailDto, Date now) { + MedicalPurchase3504Param medicalPurchase3504Param = new MedicalPurchase3504Param(); + medicalPurchase3504Param.setMedListCodg(supplyItemDetailDto.getYbNo()) + .setFixmedinsBchno(supplyItemDetailDto.getLotNumber()) + .setFixmedinsHilistId(supplyItemDetailDto.getItemBusNo()) + .setFixmedinsHilistName(supplyItemDetailDto.getItemTable()) + .setSplerName(supplyItemDetailDto.getSupplierName()).setPurcInvoNo(supplyItemDetailDto.getInvoiceNo()) + .setManuDate(supplyItemDetailDto.getStartTime()).setExpyEnd(supplyItemDetailDto.getEndTime()) + .setPurcRetnCnt(supplyItemDetailDto.getItemQuantity()).setPurcRetnStoinTime(now) + .setPurcRetnOpterName(supplyItemDetailDto.getPractitionerName()); + if (YbRxFlag.IMPORTANT_HERBAL_SLICES.getCode() == supplyItemDetailDto.getRxFlag()) { + medicalPurchase3504Param.setRxFlag(YbRxFlag.IMPORTANT_HERBAL_SLICES.getName()); + } else if (YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getCode() == supplyItemDetailDto.getRxFlag()) { + medicalPurchase3504Param.setRxFlag(YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getName()); + } else if (YbRxFlag.SELF_PREPARED_MEDICATION.getCode() == supplyItemDetailDto.getRxFlag()) { + medicalPurchase3504Param.setRxFlag(YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getName()); + } + return medicalPurchase3504Param; + } + + private Medical3503Param getMedical3503Param(SupplyItemDetailDto supplyItemDetailDto, Date now) { + Medical3503Param medical3503Param = new Medical3503Param(); + medical3503Param.setMedListCodg(supplyItemDetailDto.getYbNo()) + .setFixmedinsBchno(supplyItemDetailDto.getLotNumber()) + .setFixmedinsHilistId(supplyItemDetailDto.getItemBusNo()) + .setFixmedinsHilistName(supplyItemDetailDto.getItemTable()) + .setSplerName(supplyItemDetailDto.getSupplierName()).setManuLotnum(supplyItemDetailDto.getLotNumber()) + .setProdentpName(supplyItemDetailDto.getManufacturerText()) + .setAprvno(supplyItemDetailDto.getApprovalNumber()).setManuDate(supplyItemDetailDto.getStartTime()) + .setExpyEnd(supplyItemDetailDto.getEndTime()).setPurcRetnCnt(supplyItemDetailDto.getItemQuantity()) + .setPurcRetnStoinTime(now).setPurcRetnOpterName(supplyItemDetailDto.getPractitionerName()); + if (YbRxFlag.IMPORTANT_HERBAL_SLICES.getCode() == supplyItemDetailDto.getRxFlag()) { + medical3503Param.setRxFlag(YbRxFlag.IMPORTANT_HERBAL_SLICES.getName()); + } else if (YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getCode() == supplyItemDetailDto.getRxFlag()) { + medical3503Param.setRxFlag(YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getName()); + } else if (YbRxFlag.SELF_PREPARED_MEDICATION.getCode() == supplyItemDetailDto.getRxFlag()) { + medical3503Param.setRxFlag(YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getName()); + } + + return medical3503Param; + } + + private MedicalInventory3502Param getMedicalInventory3502Param(SupplyItemDetailDto supplyItemDetailDto, Date now, + String ybInvChgType) { + MedicalInventory3502Param medicalInventory3502Param = new MedicalInventory3502Param(); + // 查库存信息 + List inventoryItemList = + inventoryItemService.selectInventoryByItemId(supplyItemDetailDto.getItemId(), + supplyItemDetailDto.getLotNumber(), null, SecurityUtils.getLoginUser().getTenantId()); + // 查询商品价格信息 + List itemChargeDetailList = + receiptApprovalAppService.getItemChargeDetail(List.of(supplyItemDetailDto.getItemId())); + if (!inventoryItemList.isEmpty() && !itemChargeDetailList.isEmpty()) { + // 获取该项目所有的数量(最小单位) + BigDecimal totalQuantity = inventoryItemList.stream() + .map(item -> item.getQuantity() != null ? item.getQuantity() : BigDecimal.ZERO) + .reduce(BigDecimal.ZERO, BigDecimal::add); + // 最小单位售卖价格 + BigDecimal minPrice = BigDecimal.ZERO; + Optional price = itemChargeDetailList.stream() + .filter(x -> x.getConditionValue().equals(supplyItemDetailDto.getLotNumber())) + .map(ItemChargeDetailDto::getSellPrice).findFirst(); + if (price.isPresent()) { + if (supplyItemDetailDto.getPartPercent().compareTo(BigDecimal.ZERO) > 0) { + minPrice = price.get().divide(supplyItemDetailDto.getPartPercent(), RoundingMode.HALF_UP); + } + } + // 转换为JSON + JSONArray medicalTraceNo = new JSONArray(); + // 获取追溯码信息 + if (supplyItemDetailDto.getTraceNo() != null) { + List traceNoList = + Arrays.stream(supplyItemDetailDto.getTraceNo().split(CommonConstants.Common.COMMA)) + .map(String::trim).filter(s -> !s.isEmpty()).collect(Collectors.toList()); + for (String traceNo : traceNoList) { + Map traceNoMap = new HashMap<>(); + traceNoMap.put("drug_trac_codg", traceNo); + medicalTraceNo.add(traceNoMap); + } + } + medicalInventory3502Param.setMedListCodg(supplyItemDetailDto.getYbNo()).setInvChgType(ybInvChgType) + .setFixmedinsHilistId(supplyItemDetailDto.getItemBusNo()) + .setFixmedinsHilistName(supplyItemDetailDto.getItemTable()) + .setFixmedinsBchno(supplyItemDetailDto.getLotNumber()).setPric(minPrice).setCnt(totalQuantity) + .setInvChgTime(now).setDrugtracinfo(medicalTraceNo); + if (YbRxFlag.IMPORTANT_HERBAL_SLICES.getCode() == supplyItemDetailDto.getRxFlag()) { + medicalInventory3502Param.setRxFlag(YbRxFlag.IMPORTANT_HERBAL_SLICES.getName()); + } else if (YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getCode() == supplyItemDetailDto.getRxFlag()) { + medicalInventory3502Param.setRxFlag(YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getName()); + } else if (YbRxFlag.SELF_PREPARED_MEDICATION.getCode() == supplyItemDetailDto.getRxFlag()) { + medicalInventory3502Param.setRxFlag(YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getName()); + } + } + return medicalInventory3502Param; + } + + private MedicalInventory3501Param getMedicalInventory3501Param(SupplyItemDetailDto supplyItemDetailDto, Date date) { + MedicalInventory3501Param medicalInventory3501Param = new MedicalInventory3501Param(); + // 查库存信息 + List inventoryItemList = + inventoryItemService.selectInventoryByItemId(supplyItemDetailDto.getItemId(), + supplyItemDetailDto.getLotNumber(), null, SecurityUtils.getLoginUser().getTenantId()); + if (!inventoryItemList.isEmpty()) { + // 获取该项目所有的数量(最小单位) + BigDecimal totalQuantity = inventoryItemList.stream() + .map(item -> item.getQuantity() != null ? item.getQuantity() : BigDecimal.ZERO) + .reduce(BigDecimal.ZERO, BigDecimal::add); + medicalInventory3501Param.setMedListCodg(supplyItemDetailDto.getYbNo()) + .setFixmedinsHilistId(supplyItemDetailDto.getItemBusNo()) + .setFixmedinsHilistName(supplyItemDetailDto.getItemTable()).setInvdate(date).setInvCnt(totalQuantity) + .setFixmedinsBchno(supplyItemDetailDto.getLotNumber()).setManuDate(supplyItemDetailDto.getStartTime()) + .setExpyEnd(supplyItemDetailDto.getEndTime()); + if (YbRxFlag.IMPORTANT_HERBAL_SLICES.getCode() == supplyItemDetailDto.getRxFlag()) { + medicalInventory3501Param.setRxFlag(YbRxFlag.IMPORTANT_HERBAL_SLICES.getName()); + } else if (YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getCode() == supplyItemDetailDto.getRxFlag()) { + medicalInventory3501Param.setRxFlag(YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getName()); + } else if (YbRxFlag.SELF_PREPARED_MEDICATION.getCode() == supplyItemDetailDto.getRxFlag()) { + medicalInventory3501Param.setRxFlag(YbRxFlag.WESTERN_AND_CHINESE_PATENT_MEDICINE.getName()); + } + } + return medicalInventory3501Param; + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentRequisitionOrderServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentRequisitionOrderServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..424e5eaf4808bf38c2c90b669546c0b347fae953 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentRequisitionOrderServiceImpl.java @@ -0,0 +1,163 @@ +package com.openhis.web.departmentmanage.appservice.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.MessageUtils; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.utils.EnumUtils; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentRequisitionOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentInitDto; +import com.openhis.web.departmentmanage.mapper.DepartmentCommonMapper; +import com.openhis.web.departmentmanage.mapper.DepartmentRequisitionOrderMapper; +import com.openhis.web.inventorymanage.dto.ProductStocktakingInitDto; +import com.openhis.workflow.domain.SupplyRequest; +import com.openhis.workflow.service.ISupplyRequestService; + +/** + * 科室材料请领单 + * + * @author yuxj + * @date 2025-07-22 + */ +@Service +public class DepartmentRequisitionOrderServiceImpl implements IDepartmentRequisitionOrderService { + + @Resource + private AssignSeqUtil assignSeqUtil; + @Resource + private ISupplyRequestService supplyRequestService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + + @Autowired + private DepartmentCommonMapper departmentCommonMapper; + /** + * 初始化 + * + * @return 初始化信息 + */ + @Override + public R init() { + + DepartmentInitDto requisitionOrderInitDto = departmentCommonService.init(); + + // 单据分类 + List supplyCategoryOption = new ArrayList<>(); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption(SupplyCategory.NORMAL.getValue(), + SupplyCategory.NORMAL.getInfo())); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption(SupplyCategory.PURCHASE_APPLICATION.getValue(), + SupplyCategory.PURCHASE_APPLICATION.getInfo())); + + requisitionOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption); + + return R.ok(requisitionOrderInitDto); + } + + /** + * 请领单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 请领单单据详情 + */ + @Override + public R getDetailPage(String busNo, Integer pageNo, Integer pageSize) { + + Page requisitionOrderDtoDetailPage = + departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo); + + requisitionOrderDtoDetailPage.getRecords().forEach(e -> { + // 单据分类 + e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(SupplyCategory.class, e.getCategoryEnum())); + // 单据状态 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(SupplyStatus.class, e.getStatusEnum())); + // 单据类型 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(SupplyType.class, e.getTypeEnum())); + }); + + List unitList; + for (DepartmentDetailDto item : requisitionOrderDtoDetailPage.getRecords()) { + unitList = new ArrayList<>(); + unitList.add(new DepartmentDetailDto.Option(item.getMaxUnitCode(),item.getMaxUnitCode_dictText())); + unitList.add(new DepartmentDetailDto.Option(item.getMinUnitCode(),item.getMinUnitCode_dictText() + )); + + item.setUnitList(unitList); + } + + return R.ok(requisitionOrderDtoDetailPage); + } + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @Override + public R getBusNo() { + + ProductStocktakingInitDto initDto = new ProductStocktakingInitDto(); + // 单据号 + initDto.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEPARTMENT_REQUISITION.getPrefix(), 4)); + + return R.ok(initDto); + } + + /** + * 添加/编辑请领单 + * + * @param requisitionOrderDtoList 请领信息 + * @return 操作结果 + */ + + @Override + public R addOrEditRequisitionOrder(List requisitionOrderDtoList) { + // 请求数据取得 + List requestList = supplyRequestService.getSupplyByBusNo(requisitionOrderDtoList.get(0).getBusNo()); + if (!requestList.isEmpty()) { + // 请求id取得 + List requestIdList = requestList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + // 单据信息删除 + supplyRequestService.removeByIds(requestIdList); + } + + List supplyRequestList = new ArrayList<>(); + for (DepartmentDetailDto item : requisitionOrderDtoList) { + SupplyRequest supplyRequest = + new SupplyRequest().setBusNo(item.getBusNo()).setTypeEnum(SupplyType.DEPARTMENT_REQUISITION.getValue()) + .setStatusEnum(SupplyStatus.PENDING_REVIEW.getValue()).setCategoryEnum(item.getCategoryEnum()) + .setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId()) + .setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity()) + .setRetailPrice(item.getRetailPrice()).setTotalRetailPrice(item.getTotalRetailPrice()) + .setSpecificationInventory(item.getSpecificationInventory()).setSupplierId(item.getSupplierId()) + .setReason(item.getReason()).setSourceTypeEnum(LocationForm.CABINET.getValue()) + .setSourceLocationId(item.getSourceLocationId()).setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue()) + .setPurposeLocationId(item.getPurposeLocationId()).setApplicantId(item.getApplicantId()) + .setApplyTime(item.getApplyTime()).setRemake(item.getRemake()); + supplyRequestList.add(supplyRequest); + } + // 更新请求表 + boolean flg = supplyRequestService.saveOrUpdateBatch(supplyRequestList); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null)); + } + + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentReturnToWarehouseOrderServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentReturnToWarehouseOrderServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..6dd1368d26f196acce5b74bb28d86c301b0bd742 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentReturnToWarehouseOrderServiceImpl.java @@ -0,0 +1,165 @@ +package com.openhis.web.departmentmanage.appservice.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.DateUtils; +import com.core.common.utils.MessageUtils; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.utils.EnumUtils; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentReturnToWarehouseOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentInitDto; +import com.openhis.web.departmentmanage.mapper.DepartmentCommonMapper; +import com.openhis.web.departmentmanage.mapper.DepartmentReturnToWarehouseOrderMapper; +import com.openhis.web.inventorymanage.dto.ProductStocktakingInitDto; +import com.openhis.workflow.domain.SupplyRequest; +import com.openhis.workflow.service.ISupplyRequestService; + +/** + * 科室材料退库单 + * + * @author yuxj + * @date 2025-07-22 + */ +@Service +public class DepartmentReturnToWarehouseOrderServiceImpl implements IDepartmentReturnToWarehouseOrderService { + + @Resource + private AssignSeqUtil assignSeqUtil; + @Resource + private ISupplyRequestService supplyRequestService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + @Autowired + private DepartmentCommonMapper departmentCommonMapper; + /** + * 初始化 + * + * @return 初始化信息 + */ + @Override + public R init() { + + DepartmentInitDto purchaseOrderInitDto = departmentCommonService.init(); + + // 单据分类 + List supplyCategoryOption = new ArrayList<>(); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption(SupplyCategory.NORMAL.getValue(), + SupplyCategory.NORMAL.getInfo())); + + purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption); + + return R.ok(purchaseOrderInitDto); + } + + /** + * 退库单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 退库单单据详情 + */ + @Override + public R getDetailPage(String busNo, Integer pageNo, Integer pageSize) { + + Page returnToDispensaryOrderDtoDetailPage = + departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo); + + returnToDispensaryOrderDtoDetailPage.getRecords().forEach(e -> { + // 单据分类 + e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(SupplyCategory.class, e.getCategoryEnum())); + // 单据状态 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(SupplyStatus.class, e.getStatusEnum())); + // 单据类型 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(SupplyType.class, e.getTypeEnum())); + }); + + List unitList; + for (DepartmentDetailDto item : returnToDispensaryOrderDtoDetailPage.getRecords()) { + unitList = new ArrayList<>(); + unitList.add(new DepartmentDetailDto.Option(item.getMaxUnitCode(),item.getMaxUnitCode_dictText())); + unitList.add(new DepartmentDetailDto.Option(item.getMinUnitCode(),item.getMinUnitCode_dictText() + )); + + item.setUnitList(unitList); + } + return R.ok(returnToDispensaryOrderDtoDetailPage); + } + + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @Override + public R getBusNo() { + + ProductStocktakingInitDto initDto = new ProductStocktakingInitDto(); + // 单据号 + initDto.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEPARTMENT_RETURN.getPrefix(), 4)); + + return R.ok(initDto); + } + + /** + * 添加/编辑退库单 + * + * @param returnToDispensaryOrderDtoList 退库信息 + * @return 操作结果 + */ + + @Override + public R addOrEditReturnToWarehouseOrder(List returnToDispensaryOrderDtoList) { + // 请求数据取得 + List requestList = supplyRequestService.getSupplyByBusNo(returnToDispensaryOrderDtoList.get(0).getBusNo()); + if (!requestList.isEmpty()) { + // 请求id取得 + List requestIdList = requestList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + // 单据信息删除 + supplyRequestService.removeByIds(requestIdList); + } + + List supplyRequestList = new ArrayList<>(); + Date applyTime = DateUtils.getNowDate(); + for (DepartmentDetailDto item : returnToDispensaryOrderDtoList) { + SupplyRequest supplyRequest = new SupplyRequest().setBusNo(item.getBusNo()) + .setTypeEnum(SupplyType.DEPARTMENT_RETURN.getValue()) + .setStatusEnum(SupplyStatus.PENDING_REVIEW.getValue()).setCategoryEnum(item.getCategoryEnum()) + .setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId()) + .setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity()) + .setRetailPrice(item.getRetailPrice()).setTotalRetailPrice(item.getTotalRetailPrice()) + .setStartTime(item.getStartTime()).setEndTime(item.getEndTime()).setLotNumber(item.getLotNumber()) + .setTraceNo(item.getTraceNo()).setTraceNoUnitCode(item.getTraceNoUnitCode()) + .setSupplierId(item.getSupplierId()).setReason(item.getReason()) + .setSourceTypeEnum(LocationForm.DEPARTMENT.getValue()).setSourceLocationId(item.getSourceLocationId()) + .setPurposeTypeEnum(LocationForm.WAREHOUSE.getValue()).setPurposeLocationId(item.getPurposeLocationId()) + .setApplicantId(item.getApplicantId()).setApplyTime(applyTime).setRemake(item.getRemake()); + supplyRequestList.add(supplyRequest); + } + // 更新请求表 + boolean flg = supplyRequestService.saveOrUpdateBatch(supplyRequestList); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null)); + } + + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentStockInOrderServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentStockInOrderServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..fb29b8c3c8b4fa62ac7413294a039d88684b68de --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentStockInOrderServiceImpl.java @@ -0,0 +1,172 @@ +package com.openhis.web.departmentmanage.appservice.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.DateUtils; +import com.core.common.utils.MessageUtils; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.utils.EnumUtils; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentStockInOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentInitDto; +import com.openhis.web.departmentmanage.mapper.DepartmentCommonMapper; +import com.openhis.web.departmentmanage.mapper.DepartmentStockInOrderMapper; +import com.openhis.web.inventorymanage.dto.ProductStocktakingInitDto; +import com.openhis.workflow.domain.SupplyRequest; +import com.openhis.workflow.service.ISupplyRequestService; + +/** + * 科室材料入库单 + * + * @author yuxj + * @date 2025-07-22 + */ +@Service +public class DepartmentStockInOrderServiceImpl implements IDepartmentStockInOrderService { + + @Resource + private AssignSeqUtil assignSeqUtil; + @Resource + private ISupplyRequestService supplyRequestService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + @Autowired + private DepartmentCommonMapper departmentCommonMapper; + + /** + * 初始化 + * + * @return 初始化信息 + */ + @Override + public R init() { + + DepartmentInitDto purchaseOrderInitDto = departmentCommonService.init(); + + // 单据分类 + List supplyCategoryOption = new ArrayList<>(); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption(SupplyCategory.NORMAL.getValue(), + SupplyCategory.NORMAL.getInfo())); + + purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption); + + return R.ok(purchaseOrderInitDto); + } + + /** + * 入库单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 入库单单据详情 + */ + @Override + public R getDetailPage(String busNo, Integer pageNo, Integer pageSize) { + + Page stockInOrderDtoDetailPage = + departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo); + + stockInOrderDtoDetailPage.getRecords().forEach(e -> { + // 单据分类 + e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(SupplyCategory.class, e.getCategoryEnum())); + // 单据状态 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(SupplyStatus.class, e.getStatusEnum())); + // 单据类型 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(SupplyType.class, e.getTypeEnum())); + }); + + List unitList; + for (DepartmentDetailDto item : stockInOrderDtoDetailPage.getRecords()) { + unitList = new ArrayList<>(); + unitList.add(new DepartmentDetailDto.Option(item.getMaxUnitCode(), item.getMaxUnitCode_dictText())); + unitList.add(new DepartmentDetailDto.Option(item.getMinUnitCode(), item.getMinUnitCode_dictText())); + + item.setUnitList(unitList); + } + return R.ok(stockInOrderDtoDetailPage); + } + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @Override + public R getBusNo() { + + ProductStocktakingInitDto initDto = new ProductStocktakingInitDto(); + // 单据号 + initDto.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEPARTMENT_STOCKIN.getPrefix(), 4)); + + return R.ok(initDto); + } + + /** + * 添加/编辑入库单 + * + * @param stockInOrderDtoList 入库信息 + * @return 操作结果 + */ + + @Override + public R addOrEditStockInOrder(List stockInOrderDtoList) { + // 请求数据取得 + List requestList = supplyRequestService.getSupplyByBusNo(stockInOrderDtoList.get(0).getBusNo()); + if (!requestList.isEmpty()) { + // 请求id取得 + List requestIdList = requestList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + // 单据信息删除 + supplyRequestService.removeByIds(requestIdList); + } + //添加原始单据号 + if(stockInOrderDtoList.get(0).getOriginalBusNo()!=null){ + // 审批单据并返回单据详情 + List agreedList = supplyRequestService.addOriginalBusNo(stockInOrderDtoList.get(0).getOriginalBusNo(), stockInOrderDtoList.get(0).getBusNo()); + if (agreedList.isEmpty()) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); + } + } + + List supplyRequestList = new ArrayList<>(); + Date applyTime = DateUtils.getNowDate(); + for (DepartmentDetailDto item : stockInOrderDtoList) { + SupplyRequest supplyRequest = new SupplyRequest().setBusNo(item.getBusNo()) + .setTypeEnum(SupplyType.DEPARTMENT_STOCKIN.getValue()) + .setStatusEnum(SupplyStatus.PENDING_REVIEW.getValue()).setCategoryEnum(item.getCategoryEnum()) + .setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId()) + .setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity()) + .setRetailPrice(item.getRetailPrice()).setTotalRetailPrice(item.getTotalRetailPrice()) + .setStartTime(item.getStartTime()).setEndTime(item.getEndTime()).setLotNumber(item.getLotNumber()) + .setTraceNo(item.getTraceNo()).setTraceNoUnitCode(item.getTraceNoUnitCode()) + .setSupplierId(item.getSupplierId()).setReason(item.getReason()) + .setSourceTypeEnum(LocationForm.WAREHOUSE.getValue()).setSourceLocationId(item.getSourceLocationId()) + .setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue()).setPurposeLocationId(item.getPurposeLocationId()) + .setApplicantId(item.getApplicantId()).setApplyTime(applyTime).setRemake(item.getRemake()); + supplyRequestList.add(supplyRequest); + } + // 更新请求表 + boolean flg = supplyRequestService.saveOrUpdateBatch(supplyRequestList); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null)); + } + + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentStocktakingOrderServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentStocktakingOrderServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..fa706958f887c7867f38a7d2ab00a97ac7841667 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentStocktakingOrderServiceImpl.java @@ -0,0 +1,167 @@ +package com.openhis.web.departmentmanage.appservice.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.DateUtils; +import com.core.common.utils.MessageUtils; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.utils.EnumUtils; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentStocktakingOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentInitDto; +import com.openhis.web.departmentmanage.mapper.DepartmentCommonMapper; +import com.openhis.web.departmentmanage.mapper.DepartmentStocktakingOrderMapper; +import com.openhis.web.inventorymanage.dto.ProductStocktakingInitDto; +import com.openhis.workflow.domain.SupplyRequest; +import com.openhis.workflow.service.ISupplyRequestService; + +/** + * 科室材料盘点单 + * + * @author yuxj + * @date 2025-07-22 + */ +@Service +public class DepartmentStocktakingOrderServiceImpl implements IDepartmentStocktakingOrderService { + + @Resource + private AssignSeqUtil assignSeqUtil; + @Resource + private ISupplyRequestService supplyRequestService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + @Autowired + private DepartmentCommonMapper departmentCommonMapper; + + /** + * 初始化 + * + * @return 初始化信息 + */ + @Override + public R init() { + + DepartmentInitDto purchaseOrderInitDto = departmentCommonService.init(); + + // 单据分类 + List supplyCategoryOption = new ArrayList<>(); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption( + SupplyCategory.GENERAL_STOCKTAKING.getValue(), SupplyCategory.GENERAL_STOCKTAKING.getInfo())); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption( + SupplyCategory.MONTHLY_STOCKTAKING.getValue(), SupplyCategory.MONTHLY_STOCKTAKING.getInfo())); + + purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption); + + return R.ok(purchaseOrderInitDto); + } + + /** + * 盘点单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 盘点单单据详情 + */ + @Override + public R getDetailPage(String busNo, Integer pageNo, Integer pageSize) { + + Page stocktakingOrderDtoDetailPage = + departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo); + + stocktakingOrderDtoDetailPage.getRecords().forEach(e -> { + // 单据分类 + e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(SupplyCategory.class, e.getCategoryEnum())); + // 单据状态 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(SupplyStatus.class, e.getStatusEnum())); + // 单据类型 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(SupplyType.class, e.getTypeEnum())); + }); + + List unitList; + for (DepartmentDetailDto item : stocktakingOrderDtoDetailPage.getRecords()) { + unitList = new ArrayList<>(); + unitList.add(new DepartmentDetailDto.Option(item.getMaxUnitCode(), item.getMaxUnitCode_dictText())); + unitList.add(new DepartmentDetailDto.Option(item.getMinUnitCode(), item.getMinUnitCode_dictText())); + + item.setUnitList(unitList); + } + return R.ok(stocktakingOrderDtoDetailPage); + } + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @Override + public R getBusNo() { + + ProductStocktakingInitDto initDto = new ProductStocktakingInitDto(); + // 单据号 + initDto.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEPARTMENT_STOCKTAKING.getPrefix(), 4)); + + return R.ok(initDto); + } + + /** + * 添加/编辑盘点单 + * + * @param stocktakingOrderDtoList 盘点信息 + * @return 操作结果 + */ + + @Override + public R addOrEditStocktakingOrder(List stocktakingOrderDtoList) { + // 请求数据取得 + List requestList = + supplyRequestService.getSupplyByBusNo(stocktakingOrderDtoList.get(0).getBusNo()); + if (!requestList.isEmpty()) { + // 请求id取得 + List requestIdList = requestList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + // 单据信息删除 + supplyRequestService.removeByIds(requestIdList); + } + + List supplyRequestList = new ArrayList<>(); + Date applyTime = DateUtils.getNowDate(); + for (DepartmentDetailDto item : stocktakingOrderDtoList) { + SupplyRequest supplyRequest = new SupplyRequest().setBusNo(item.getBusNo()) + .setTypeEnum(SupplyType.DEPARTMENT_STOCKTAKING.getValue()) + .setStatusEnum(SupplyStatus.PENDING_REVIEW.getValue()).setCategoryEnum(item.getCategoryEnum()) + .setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId()) + .setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity()) + .setTotalQuantity(item.getTotalQuantity()).setPrice(item.getPrice()).setTotalPrice(item.getTotalPrice()) + .setRetailPrice(item.getRetailPrice()).setTotalRetailPrice(item.getTotalRetailPrice()) + .setBatchInventory(item.getBatchInventory()).setLotNumber(item.getLotNumber()) + .setTraceNo(item.getTraceNo()).setTraceNoUnitCode(item.getTraceNoUnitCode()) + .setReasonCode(item.getReasonCode()).setReason(item.getReason()) + .setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue()).setPurposeLocationId(item.getPurposeLocationId()) + .setApplicantId(item.getApplicantId()).setApplyTime(applyTime).setRemake(item.getRemake()); + supplyRequestList.add(supplyRequest); + } + // 更新请求表 + boolean flg = supplyRequestService.saveOrUpdateBatch(supplyRequestList); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null)); + } + + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentTransferInOrderServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentTransferInOrderServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..eda1069560a6613c78869a2ffa214966554af4be --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentTransferInOrderServiceImpl.java @@ -0,0 +1,165 @@ +package com.openhis.web.departmentmanage.appservice.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.DateUtils; +import com.core.common.utils.MessageUtils; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.utils.EnumUtils; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentTransferInOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentInitDto; +import com.openhis.web.departmentmanage.mapper.DepartmentCommonMapper; +import com.openhis.web.departmentmanage.mapper.DepartmentTransferInOrderMapper; +import com.openhis.web.inventorymanage.dto.ProductStocktakingInitDto; +import com.openhis.workflow.domain.SupplyRequest; +import com.openhis.workflow.service.ISupplyRequestService; + +/** + * 科室材料调入单 + * + * @author yuxj + * @date 2025-07-22 + */ +@Service +public class DepartmentTransferInOrderServiceImpl implements IDepartmentTransferInOrderService { + + @Resource + private AssignSeqUtil assignSeqUtil; + @Resource + private ISupplyRequestService supplyRequestService; + @Autowired + private IDepartmentCommonService departmentCommonService; + @Autowired + private DepartmentCommonMapper departmentCommonMapper; + + /** + * 初始化 + * + * @return 初始化信息 + */ + @Override + public R init() { + + DepartmentInitDto purchaseOrderInitDto = departmentCommonService.init(); + + // 单据分类 + List supplyCategoryOption = new ArrayList<>(); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption(SupplyCategory.NORMAL.getValue(), + SupplyCategory.NORMAL.getInfo())); + + purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption); + + return R.ok(purchaseOrderInitDto); + } + + /** + * 调入单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 调入单单据详情 + */ + @Override + public R getDetailPage(String busNo, Integer pageNo, Integer pageSize) { + + Page transferInOrderDtoDetailPage = + departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo); + + transferInOrderDtoDetailPage.getRecords().forEach(e -> { + // 单据分类 + e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(SupplyCategory.class, e.getCategoryEnum())); + // 单据状态 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(SupplyStatus.class, e.getStatusEnum())); + // 单据类型 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(SupplyType.class, e.getTypeEnum())); + }); + + List unitList; + for (DepartmentDetailDto item : transferInOrderDtoDetailPage.getRecords()) { + unitList = new ArrayList<>(); + unitList.add(new DepartmentDetailDto.Option(item.getMaxUnitCode(), item.getMaxUnitCode_dictText())); + unitList.add(new DepartmentDetailDto.Option(item.getMinUnitCode(), item.getMinUnitCode_dictText())); + + item.setUnitList(unitList); + } + + return R.ok(transferInOrderDtoDetailPage); + } + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @Override + public R getBusNo() { + + ProductStocktakingInitDto initDto = new ProductStocktakingInitDto(); + // 单据号 + initDto.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEPARTMENT_TRANSFERIN.getPrefix(), 4)); + + return R.ok(initDto); + } + + /** + * 添加/编辑调出单 + * + * @param transferInOrderDtoList 调出信息 + * @return 操作结果 + */ + + @Override + public R addOrEditTransferInOrder(List transferInOrderDtoList) { + // 请求数据取得 + List requestList = supplyRequestService.getSupplyByBusNo(transferInOrderDtoList.get(0).getBusNo()); + if (!requestList.isEmpty()) { + // 请求id取得 + List requestIdList = requestList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + // 单据信息删除 + supplyRequestService.removeByIds(requestIdList); + } + + List supplyRequestList = new ArrayList<>(); + Date applyTime = DateUtils.getNowDate(); + for (DepartmentDetailDto item : transferInOrderDtoList) { + SupplyRequest supplyRequest = new SupplyRequest().setBusNo(item.getBusNo()) + .setTypeEnum(SupplyType.DEPARTMENT_TRANSFERIN.getValue()) + .setStatusEnum(SupplyStatus.PENDING_REVIEW.getValue()) + .setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId()) + .setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity()).setRetailPrice(item.getPrice()) + .setTotalRetailPrice(item.getTotalPrice()).setBatchInventory(item.getBatchInventory()) + .setSpecificationInventory(item.getSpecificationInventory()).setEndTime(item.getEndTime()) + .setLotNumber(item.getLotNumber()).setTraceNo(item.getTraceNo()) + .setTraceNoUnitCode(item.getTraceNoUnitCode()).setSupplierId(item.getSupplierId()) + .setReason(item.getReason()).setSourceTypeEnum(LocationForm.DEPARTMENT.getValue()) + .setSourceLocationId(item.getSourceLocationId()).setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue()) + .setPurposeLocationId(item.getPurposeLocationId()) + .setApplicantId(item.getApplicantId()).setApplyTime(applyTime).setRemake(item.getRemake()); + supplyRequestList.add(supplyRequest); + } + // 更新请求表 + boolean flg = supplyRequestService.saveOrUpdateBatch(supplyRequestList); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null)); + } + + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentTransferOutOrderServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentTransferOutOrderServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..4a0c69432817aacebbed7564592bd6ea892fcc7c --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/appservice/impl/DepartmentTransferOutOrderServiceImpl.java @@ -0,0 +1,165 @@ +package com.openhis.web.departmentmanage.appservice.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.DateUtils; +import com.core.common.utils.MessageUtils; +import com.openhis.common.constant.CommonConstants; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.common.enums.*; +import com.openhis.common.utils.EnumUtils; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentTransferOutOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentInitDto; +import com.openhis.web.departmentmanage.mapper.DepartmentCommonMapper; +import com.openhis.web.departmentmanage.mapper.DepartmentTransferOutOrderMapper; +import com.openhis.web.inventorymanage.dto.ProductStocktakingInitDto; +import com.openhis.workflow.domain.SupplyRequest; +import com.openhis.workflow.service.ISupplyRequestService; + +/** + * 科室材料调出单 + * + * @author yuxj + * @date 2025-07-22 + */ +@Service +public class DepartmentTransferOutOrderServiceImpl implements IDepartmentTransferOutOrderService { + + @Resource + private AssignSeqUtil assignSeqUtil; + @Resource + private ISupplyRequestService supplyRequestService; + @Autowired + private IDepartmentCommonService departmentCommonService; + @Autowired + private DepartmentCommonMapper departmentCommonMapper; + + /** + * 初始化 + * + * @return 初始化信息 + */ + @Override + public R init() { + + DepartmentInitDto purchaseOrderInitDto = departmentCommonService.init(); + + // 单据分类 + List supplyCategoryOption = new ArrayList<>(); + supplyCategoryOption.add(new DepartmentInitDto.IntegerOption(SupplyCategory.NORMAL.getValue(), + SupplyCategory.NORMAL.getInfo())); + + purchaseOrderInitDto.setSupplyCategoryOptions(supplyCategoryOption); + + return R.ok(purchaseOrderInitDto); + } + + /** + * 调出单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 调出单单据详情 + */ + @Override + public R getDetailPage(String busNo, Integer pageNo, Integer pageSize) { + + Page transferOutOrderDtoDetailPage = + departmentCommonMapper.getDetailPage(new Page<>(pageNo, pageSize), busNo); + + transferOutOrderDtoDetailPage.getRecords().forEach(e -> { + // 单据分类 + e.setCategoryEnum_enumText(EnumUtils.getInfoByValue(SupplyCategory.class, e.getCategoryEnum())); + // 单据状态 + e.setStatusEnum_enumText(EnumUtils.getInfoByValue(SupplyStatus.class, e.getStatusEnum())); + // 单据类型 + e.setTypeEnum_enumText(EnumUtils.getInfoByValue(SupplyType.class, e.getTypeEnum())); + }); + + List unitList; + for (DepartmentDetailDto item : transferOutOrderDtoDetailPage.getRecords()) { + unitList = new ArrayList<>(); + unitList.add(new DepartmentDetailDto.Option(item.getMaxUnitCode(), item.getMaxUnitCode_dictText())); + unitList.add(new DepartmentDetailDto.Option(item.getMinUnitCode(), item.getMinUnitCode_dictText())); + + item.setUnitList(unitList); + } + + return R.ok(transferOutOrderDtoDetailPage); + } + + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @Override + public R getBusNo() { + + ProductStocktakingInitDto initDto = new ProductStocktakingInitDto(); + // 单据号 + initDto.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.DEPARTMENT_TRANSFEROUT.getPrefix(), 4)); + + return R.ok(initDto); + } + + /** + * 添加/编辑调出单 + * + * @param transferOutOrderDtoList 调出信息 + * @return 操作结果 + */ + + @Override + public R addOrEditTransferOutOrder(List transferOutOrderDtoList) { + // 请求数据取得 + List requestList = supplyRequestService.getSupplyByBusNo(transferOutOrderDtoList.get(0).getBusNo()); + if (!requestList.isEmpty()) { + // 请求id取得 + List requestIdList = requestList.stream().map(SupplyRequest::getId).collect(Collectors.toList()); + // 单据信息删除 + supplyRequestService.removeByIds(requestIdList); + } + + List supplyRequestList = new ArrayList<>(); + Date applyTime = DateUtils.getNowDate(); + for (DepartmentDetailDto item : transferOutOrderDtoList) { + SupplyRequest supplyRequest = new SupplyRequest().setBusNo(item.getBusNo()) + .setTypeEnum(SupplyType.DEPARTMENT_TRANSFEROUT.getValue()) + .setStatusEnum(SupplyStatus.PENDING_REVIEW.getValue()) + .setItemTable(CommonConstants.TableName.ADM_DEVICE_DEFINITION).setItemId(item.getItemId()) + .setUnitCode(item.getUnitCode()).setItemQuantity(item.getItemQuantity()).setRetailPrice(item.getPrice()) + .setTotalRetailPrice(item.getTotalPrice()).setBatchInventory(item.getBatchInventory()) + .setSpecificationInventory(item.getSpecificationInventory()).setEndTime(item.getEndTime()) + .setLotNumber(item.getLotNumber()).setTraceNo(item.getTraceNo()) + .setTraceNoUnitCode(item.getTraceNoUnitCode()).setSupplierId(item.getSupplierId()) + .setReason(item.getReason()).setSourceTypeEnum(LocationForm.DEPARTMENT.getValue()) + .setSourceLocationId(item.getSourceLocationId()).setPurposeTypeEnum(LocationForm.DEPARTMENT.getValue()) + .setPurposeLocationId(item.getPurposeLocationId()) + .setApplicantId(item.getApplicantId()).setApplyTime(applyTime).setRemake(item.getRemake()); + supplyRequestList.add(supplyRequest); + } + // 更新请求表 + boolean flg = supplyRequestService.saveOrUpdateBatch(supplyRequestList); + if (!flg) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, null)); + } + + return R.ok(MessageUtils.createMessage(PromptMsgConstant.Common.M00004, null)); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentIssuanceOrderController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentIssuanceOrderController.java new file mode 100644 index 0000000000000000000000000000000000000000..72c4fe79a5c8b1fd44d3b5e66a5965822353d4cc --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentIssuanceOrderController.java @@ -0,0 +1,82 @@ +package com.openhis.web.departmentmanage.controller; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.common.enums.SupplyType; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentReceiptApprovalService; +import com.openhis.web.departmentmanage.appservice.IDepartmentIssuanceOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentSearchParam; + +import lombok.extern.slf4j.Slf4j; + +/** + * 科室材料发出单 + * + * @author yuxj + * @date 2025-07-22 + */ +@RestController +@RequestMapping("/department/issuance-order") +@Slf4j +public class DepartmentIssuanceOrderController { + + @Autowired + private IDepartmentIssuanceOrderService departmentIssuanceOrderService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + + @Autowired + private IDepartmentReceiptApprovalService departmentReceiptApprovalService; + /** + * 发出单初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R init() { + return departmentIssuanceOrderService.init(); + } + + /** + * 发出单单据列表 + * + * @param issuanceOrderSearchParam 查询条件 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @return 发出单据分页列表 + */ + @GetMapping(value = "/issuance-order-page") + public R getPage(DepartmentSearchParam issuanceOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getPage(issuanceOrderSearchParam, pageNo, pageSize, searchKey, request, + "1", SupplyType.DISPENSING_ORDER.getValue()); + } + /** + * 发出单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 发出单单据详情 + */ + @GetMapping(value = "/issuance-order-detail-page") + public R getDetail(@RequestParam String busNo, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + return departmentIssuanceOrderService.getDetailPage(busNo, pageNo, pageSize); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentProfitLossOrderController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentProfitLossOrderController.java new file mode 100644 index 0000000000000000000000000000000000000000..7c9d8009525c20be0be286df326ee68ea80d278a --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentProfitLossOrderController.java @@ -0,0 +1,137 @@ +package com.openhis.web.departmentmanage.controller; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.common.enums.SupplyType; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentProfitLossOrderService; +import com.openhis.web.departmentmanage.appservice.IDepartmentReceiptApprovalService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentSearchParam; + +import lombok.extern.slf4j.Slf4j; + +/** + * 科室材料损益单 + * + * @author yuxj + * @date 2025-07-22 + */ +@RestController +@RequestMapping("/department/profitLoss-order") +@Slf4j +public class DepartmentProfitLossOrderController { + + @Autowired + private IDepartmentProfitLossOrderService departmentProfitLossOrderService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + @Autowired + private IDepartmentReceiptApprovalService departmentReceiptApprovalService; + /** + * 损益单初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R init() { + return departmentProfitLossOrderService.init(); + } + + /** + * 获取物资 + * + * @param purchaseOrderSearchParam 查询条件 + * @return 物资信息 + */ + @GetMapping(value = "/device-info") + public R getDeviceInfo(DepartmentSearchParam purchaseOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getDeviceInfo(purchaseOrderSearchParam, pageNo, pageSize, searchKey, request); + } + + /** + * 损益单单据列表 + * + * @param profitLossOrderSearchParam 查询条件 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @return 损益单据分页列表 + */ + @GetMapping(value = "/profitLoss-order-page") + public R getPage(DepartmentSearchParam profitLossOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getPage(profitLossOrderSearchParam, pageNo, pageSize, searchKey, request, + null, SupplyType.DEPARTMENT_PRPFITLOSS.getValue()); + } + /** + * 损益单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 损益单单据详情 + */ + @GetMapping(value = "/profitLoss-order-detail-page") + public R getDetail(@RequestParam String busNo, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + return departmentProfitLossOrderService.getDetailPage(busNo, pageNo, pageSize); + } + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @GetMapping(value = "/busNo-init") + public R getBusNo() { + return departmentProfitLossOrderService.getBusNo(); + } + + /** + * 添加/编辑损益单 + * + * @param profitLossOrderDtoList 损益信息 + * @return 操作结果 + */ + @PutMapping("/addOrEdit-profitLossOrder") + public R addOrEditProfitLossOrder(@Validated @RequestBody List profitLossOrderDtoList) { + return departmentProfitLossOrderService.addOrEditProfitLossOrder(profitLossOrderDtoList); + } + + /** + * 删除单据 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @DeleteMapping("/delete-profitLossOrder") + public R deleteProfitLossOrder(@RequestParam String busNo) { + return departmentCommonService.deleteOrder(busNo); + } + /** + * 同意审批 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @PutMapping("/agree-approval") + public R agreeApproval(@RequestParam String busNo) { + return departmentReceiptApprovalService.profitLossAgreeApproved(busNo); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentRequisitionOrderController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentRequisitionOrderController.java new file mode 100644 index 0000000000000000000000000000000000000000..d4d39b1c4720282954a04355ed0ea98a7afa3beb --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentRequisitionOrderController.java @@ -0,0 +1,139 @@ +package com.openhis.web.departmentmanage.controller; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.common.enums.SupplyType; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentReceiptApprovalService; +import com.openhis.web.departmentmanage.appservice.IDepartmentRequisitionOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentSearchParam; + +import lombok.extern.slf4j.Slf4j; + +/** + * 科室材料请领单 + * + * @author yuxj + * @date 2025-07-22 + */ +@RestController +@RequestMapping("/department/requisition-order") +@Slf4j +public class DepartmentRequisitionOrderController { + + @Autowired + private IDepartmentRequisitionOrderService departmentRequisitionOrderService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + + @Autowired + private IDepartmentReceiptApprovalService departmentReceiptApprovalService; + /** + * 请领单初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R init() { + return departmentRequisitionOrderService.init(); + } + + /** + * 获取物资 + * + * @param requisitionOrderSearchParam 查询条件 + * @return 物资信息 + */ + @GetMapping(value = "/device-info") + public R getDeviceInfo(DepartmentSearchParam requisitionOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getDeviceInfo(requisitionOrderSearchParam, pageNo, pageSize, searchKey, request); + } + + /** + * 请领单单据列表 + * + * @param requisitionOrderSearchParam 查询条件 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @return 请领单据分页列表 + */ + @GetMapping(value = "/requisition-order-page") + public R getPage(DepartmentSearchParam requisitionOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getPage(requisitionOrderSearchParam, pageNo, pageSize, searchKey, request, + null, SupplyType.DEPARTMENT_REQUISITION.getValue()); + } + /** + * 请领单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 请领单单据详情 + */ + @GetMapping(value = "/requisition-order-detail-page") + public R getDetail(@RequestParam String busNo, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + return departmentRequisitionOrderService.getDetailPage(busNo, pageNo, pageSize); + } + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @GetMapping(value = "/busNo-init") + public R getBusNo() { + return departmentRequisitionOrderService.getBusNo(); + } + + /** + * 添加/编辑采购单 + * + * @param requisitionOrderDtoList 采购信息 + * @return 操作结果 + */ + @PutMapping("/addOrEdit-requisitionOrder") + public R addOrEditRequisitionOrder(@Validated @RequestBody List requisitionOrderDtoList) { + return departmentRequisitionOrderService.addOrEditRequisitionOrder(requisitionOrderDtoList); + } + + /** + * 删除单据 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @DeleteMapping("/delete-requisitionOrder") + public R deleteRequisitionOrder(@RequestParam String busNo) { + return departmentCommonService.deleteOrder(busNo); + } + + /** + * 同意审批 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @PutMapping("/agree-approval") + public R agreeApproval(@RequestParam String busNo) { + return departmentReceiptApprovalService.requisitionOrderAgreeApproval(busNo); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentReturnToWarehouseOrderController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentReturnToWarehouseOrderController.java new file mode 100644 index 0000000000000000000000000000000000000000..996cbfe0258a2f379a66e4d54bca94e720dca221 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentReturnToWarehouseOrderController.java @@ -0,0 +1,137 @@ +package com.openhis.web.departmentmanage.controller; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.common.enums.SupplyType; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentReceiptApprovalService; +import com.openhis.web.departmentmanage.appservice.IDepartmentReturnToWarehouseOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentSearchParam; + +import lombok.extern.slf4j.Slf4j; + +/** + * 科室材料退库单 + * + * @author yuxj + * @date 2025-07-22 + */ +@RestController +@RequestMapping("/department/returnToWarehouse-order") +@Slf4j +public class DepartmentReturnToWarehouseOrderController { + + @Autowired + private IDepartmentReturnToWarehouseOrderService departmentReturnToWarehouseOrderService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + @Autowired + private IDepartmentReceiptApprovalService departmentReceiptApprovalService; + /** + * 退库单初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R init() { + return departmentReturnToWarehouseOrderService.init(); + } + + /** + * 获取物资 + * + * @param purchaseOrderSearchParam 查询条件 + * @return 物资信息 + */ + @GetMapping(value = "/device-info") + public R getDeviceInfo(DepartmentSearchParam purchaseOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getDeviceInfo(purchaseOrderSearchParam, pageNo, pageSize, searchKey, request); + } + + /** + * 退库单单据列表 + * + * @param returnToDispensaryOrderSearchParam 查询条件 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @return 退库单据分页列表 + */ + @GetMapping(value = "/returnToDispensary-order-page") + public R getPage(DepartmentSearchParam returnToDispensaryOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getPage(returnToDispensaryOrderSearchParam, pageNo, pageSize, searchKey, request, + "1", SupplyType.DEPARTMENT_RETURN.getValue()); + } + /** + * 退库单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 退库单单据详情 + */ + @GetMapping(value = "/returnToDispensary-order-detail-page") + public R getDetail(@RequestParam String busNo, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + return departmentReturnToWarehouseOrderService.getDetailPage(busNo, pageNo, pageSize); + } + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @GetMapping(value = "/busNo-init") + public R getBusNo() { + return departmentReturnToWarehouseOrderService.getBusNo(); + } + + /** + * 添加/编辑退库单 + * + * @param returnToDispensaryOrderDtoList 退库信息 + * @return 操作结果 + */ + @PutMapping("/addOrEdit-returnToDispensaryOrder") + public R addOrEditReturnToDispensaryOrder(@Validated @RequestBody List returnToDispensaryOrderDtoList) { + return departmentReturnToWarehouseOrderService.addOrEditReturnToWarehouseOrder(returnToDispensaryOrderDtoList); + } + + /** + * 删除单据 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @DeleteMapping("/delete-returnToDispensaryOrder") + public R deleteReturnToDispensaryOrder(@RequestParam String busNo) { + return departmentCommonService.deleteOrder(busNo); + } + /** + * 同意审批 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @PutMapping("/agree-approval") + public R agreeApproval(@RequestParam String busNo) { + return departmentReceiptApprovalService.returnToWarehouseAgreeApproved(busNo); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentStockInOrderController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentStockInOrderController.java new file mode 100644 index 0000000000000000000000000000000000000000..66a63bebbb6dbde100fe6ce655b9a9465398e8fc --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentStockInOrderController.java @@ -0,0 +1,137 @@ +package com.openhis.web.departmentmanage.controller; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.common.enums.SupplyType; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentReceiptApprovalService; +import com.openhis.web.departmentmanage.appservice.IDepartmentStockInOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentSearchParam; + +import lombok.extern.slf4j.Slf4j; + +/** + * 科室材料入库单 + * + * @author yuxj + * @date 2025-07-22 + */ +@RestController +@RequestMapping("/department/stockIn-order") +@Slf4j +public class DepartmentStockInOrderController { + + @Autowired + private IDepartmentStockInOrderService departmentStockInOrderService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + @Autowired + private IDepartmentReceiptApprovalService departmentReceiptApprovalService; + /** + * 入库单初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R init() { + return departmentStockInOrderService.init(); + } + + /** + * 获取物资 + * + * @param purchaseOrderSearchParam 查询条件 + * @return 物资信息 + */ + @GetMapping(value = "/device-info") + public R getDeviceInfo(DepartmentSearchParam purchaseOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getDeviceInfo(purchaseOrderSearchParam, pageNo, pageSize, searchKey, request); + } + + /** + * 入库单单据列表 + * + * @param stockInOrderSearchParam 查询条件 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @return 入库单据分页列表 + */ + @GetMapping(value = "/stockIn-order-page") + public R getPage(DepartmentSearchParam stockInOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getPage(stockInOrderSearchParam, pageNo, pageSize, searchKey, request, + null, SupplyType.DEPARTMENT_STOCKIN.getValue()); + } + /** + * 入库单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 入库单单据详情 + */ + @GetMapping(value = "/stockIn-order-detail-page") + public R getDetail(@RequestParam String busNo, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + return departmentStockInOrderService.getDetailPage(busNo, pageNo, pageSize); + } + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @GetMapping(value = "/busNo-init") + public R getBusNo() { + return departmentStockInOrderService.getBusNo(); + } + + /** + * 添加/编辑入库单 + * + * @param stockInOrderDtoList 入库信息 + * @return 操作结果 + */ + @PutMapping("/addOrEdit-stockInOrder") + public R addOrEditStockInOrder(@Validated @RequestBody List stockInOrderDtoList) { + return departmentStockInOrderService.addOrEditStockInOrder(stockInOrderDtoList); + } + + /** + * 删除单据 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @DeleteMapping("/delete-stockInOrder") + public R deleteStockInOrder(@RequestParam String busNo) { + return departmentCommonService.deleteOrder(busNo); + } + /** + * 同意审批 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @PutMapping("/agree-approval") + public R agreeApproval(@RequestParam String busNo) { + return departmentReceiptApprovalService.stockInOrderAgreeApproved(busNo); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentStocktakingOrderController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentStocktakingOrderController.java new file mode 100644 index 0000000000000000000000000000000000000000..5c200e85c34454b649376094ad1cccb6af19b5ff --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentStocktakingOrderController.java @@ -0,0 +1,137 @@ +package com.openhis.web.departmentmanage.controller; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.common.enums.SupplyType; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentReceiptApprovalService; +import com.openhis.web.departmentmanage.appservice.IDepartmentStocktakingOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentSearchParam; + +import lombok.extern.slf4j.Slf4j; + +/** + * 科室材料盘点单 + * + * @author yuxj + * @date 2025-07-22 + */ +@RestController +@RequestMapping("/department/stocktaking-order") +@Slf4j +public class DepartmentStocktakingOrderController { + + @Autowired + private IDepartmentStocktakingOrderService departmentStocktakingOrderService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + @Autowired + private IDepartmentReceiptApprovalService departmentReceiptApprovalService; + /** + * 盘点单初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R init() { + return departmentStocktakingOrderService.init(); + } + + /** + * 获取物资 + * + * @param purchaseOrderSearchParam 查询条件 + * @return 物资信息 + */ + @GetMapping(value = "/device-info") + public R getDeviceInfo(DepartmentSearchParam purchaseOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getDeviceInfo(purchaseOrderSearchParam, pageNo, pageSize, searchKey, request); + } + + /** + * 盘点单单据列表 + * + * @param stocktakingOrderSearchParam 查询条件 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @return 盘点单据分页列表 + */ + @GetMapping(value = "/stocktaking-order-page") + public R getPage(DepartmentSearchParam stocktakingOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getPage(stocktakingOrderSearchParam, pageNo, pageSize, searchKey, request, + null, SupplyType.DEPARTMENT_STOCKTAKING.getValue()); + } + /** + * 盘点单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 盘点单单据详情 + */ + @GetMapping(value = "/stocktaking-order-detail-page") + public R getDetail(@RequestParam String busNo, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + return departmentStocktakingOrderService.getDetailPage(busNo, pageNo, pageSize); + } + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @GetMapping(value = "/busNo-init") + public R getBusNo() { + return departmentStocktakingOrderService.getBusNo(); + } + + /** + * 添加/编辑盘点单 + * + * @param stocktakingOrderDtoList 盘点信息 + * @return 操作结果 + */ + @PutMapping("/addOrEdit-stocktakingOrder") + public R addOrEditStocktakingOrder(@Validated @RequestBody List stocktakingOrderDtoList) { + return departmentStocktakingOrderService.addOrEditStocktakingOrder(stocktakingOrderDtoList); + } + + /** + * 删除单据 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @DeleteMapping("/delete-stocktakingOrder") + public R deleteStocktakingOrder(@RequestParam String busNo) { + return departmentCommonService.deleteOrder(busNo); + } + /** + * 同意审批 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @PutMapping("/agree-approval") + public R agreeApproval(@RequestParam String busNo) { + return departmentReceiptApprovalService.stocktakingAgreepproved(busNo); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentTransferInOrderController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentTransferInOrderController.java new file mode 100644 index 0000000000000000000000000000000000000000..31b1c617fdd1e9fdfa33f308cd4aa5996f19c62b --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentTransferInOrderController.java @@ -0,0 +1,139 @@ +package com.openhis.web.departmentmanage.controller; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.common.enums.SupplyType; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentReceiptApprovalService; +import com.openhis.web.departmentmanage.appservice.IDepartmentTransferInOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentSearchParam; + +import lombok.extern.slf4j.Slf4j; + +/** + * 科室材料调入单 + * + * @author yuxj + * @date 2025-07-22 + */ +@RestController +@RequestMapping("/department/transferIn-order") +@Slf4j +public class DepartmentTransferInOrderController { + + @Autowired + private IDepartmentTransferInOrderService departmentTransferInOrderService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + + @Autowired + private IDepartmentReceiptApprovalService departmentReceiptApprovalService; + + /** + * 调入单初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R init() { + return departmentTransferInOrderService.init(); + } + + /** + * 获取物资 + * + * @param purchaseOrderSearchParam 查询条件 + * @return 物资信息 + */ + @GetMapping(value = "/device-info") + public R getDeviceInfo(DepartmentSearchParam purchaseOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getDeviceInfo(purchaseOrderSearchParam, pageNo, pageSize, searchKey, request); + } + /** + * 调入单单据列表 + * + * @param transferInOrderSearchParam 查询条件 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @return 调入单据分页列表 + */ + @GetMapping(value = "/transferIn-order-page") + public R getPage(DepartmentSearchParam transferInOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getPage(transferInOrderSearchParam, pageNo, pageSize, searchKey, request, + null, SupplyType.DEPARTMENT_TRANSFERIN.getValue()); + } + + /** + * 调入单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 调入单单据详情 + */ + @GetMapping(value = "/transferIn-order-detail-page") + public R getDetail(@RequestParam String busNo, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + return departmentTransferInOrderService.getDetailPage(busNo, pageNo, pageSize); + } + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @GetMapping(value = "/busNo-init") + public R getBusNo() { + return departmentTransferInOrderService.getBusNo(); + } + + /** + * 添加/编辑采购单 + * + * @param transferInOrderDtoList 采购信息 + * @return 操作结果 + */ + @PutMapping("/addOrEdit-transferInOrder") + public R addOrEditTransferInOrder(@Validated @RequestBody List transferInOrderDtoList) { + return departmentTransferInOrderService.addOrEditTransferInOrder(transferInOrderDtoList); + } + + /** + * 删除单据 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @DeleteMapping("/delete-transferInOrder") + public R deleteTransferInOrder(@RequestParam String busNo) { + return departmentCommonService.deleteOrder(busNo); + } + + /** + * 同意审批 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @PutMapping("/agree-approval") + public R agreeApproval(@RequestParam String busNo) { + return departmentReceiptApprovalService.transferInAgreeApproved(busNo); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentTransferOutOrderController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentTransferOutOrderController.java new file mode 100644 index 0000000000000000000000000000000000000000..e508d829fad372fe3ffe1ca4bdb8e740f559ec8e --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/controller/DepartmentTransferOutOrderController.java @@ -0,0 +1,139 @@ +package com.openhis.web.departmentmanage.controller; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.openhis.common.enums.SupplyType; +import com.openhis.web.departmentmanage.appservice.IDepartmentCommonService; +import com.openhis.web.departmentmanage.appservice.IDepartmentReceiptApprovalService; +import com.openhis.web.departmentmanage.appservice.IDepartmentTransferOutOrderService; +import com.openhis.web.departmentmanage.dto.DepartmentDetailDto; +import com.openhis.web.departmentmanage.dto.DepartmentSearchParam; + +import lombok.extern.slf4j.Slf4j; + +/** + * 科室材料调出单 + * + * @author yuxj + * @date 2025-07-22 + */ +@RestController +@RequestMapping("/department/transferOut-order") +@Slf4j +public class DepartmentTransferOutOrderController { + + @Autowired + private IDepartmentTransferOutOrderService departmentTransferOutOrderService; + + @Autowired + private IDepartmentCommonService departmentCommonService; + + @Autowired + private IDepartmentReceiptApprovalService departmentReceiptApprovalService; + + /** + * 调出单初始化 + * + * @return 初始化信息 + */ + @GetMapping(value = "/init") + public R init() { + return departmentTransferOutOrderService.init(); + } + + /** + * 获取物资 + * + * @param purchaseOrderSearchParam 查询条件 + * @return 物资信息 + */ + @GetMapping(value = "/device-info") + public R getDeviceInfo(DepartmentSearchParam purchaseOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getDeviceInfo(purchaseOrderSearchParam, pageNo, pageSize, searchKey, request); + } + /** + * 调出单单据列表 + * + * @param transferOutOrderSearchParam 查询条件 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @param searchKey 模糊查询关键字 + * @param request 请求数据 + * @return 调出单据分页列表 + */ + @GetMapping(value = "/transferOut-order-page") + public R getPage(DepartmentSearchParam transferOutOrderSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "searchKey", required = false) String searchKey, HttpServletRequest request) { + return departmentCommonService.getPage(transferOutOrderSearchParam, pageNo, pageSize, searchKey, request, + "1", SupplyType.DEPARTMENT_TRANSFEROUT.getValue()); + } + + /** + * 调出单单据详情 + * + * @param busNo 单据号 + * @param pageNo 当前页码 + * @param pageSize 查询条数 + * @return 调出单单据详情 + */ + @GetMapping(value = "/transferOut-order-detail-page") + public R getDetail(@RequestParam String busNo, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + return departmentTransferOutOrderService.getDetailPage(busNo, pageNo, pageSize); + } + /** + * 获取单据号 + * + * @return 初始化信息 + */ + @GetMapping(value = "/busNo-init") + public R getBusNo() { + return departmentTransferOutOrderService.getBusNo(); + } + + /** + * 添加/编辑采购单 + * + * @param transferOutOrderDtoList 采购信息 + * @return 操作结果 + */ + @PutMapping("/addOrEdit-transferOutOrder") + public R addOrEditTransferOutOrder(@Validated @RequestBody List transferOutOrderDtoList) { + return departmentTransferOutOrderService.addOrEditTransferOutOrder(transferOutOrderDtoList); + } + + /** + * 删除单据 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @DeleteMapping("/delete-transferOutOrder") + public R deleteTransferOutOrder(@RequestParam String busNo) { + return departmentCommonService.deleteOrder(busNo); + } + + /** + * 同意审批 + * + * @param busNo 单据号 + * @return 操作结果 + */ + @PutMapping("/agree-approval") + public R agreeApproval(@RequestParam String busNo) { + return departmentReceiptApprovalService.transferOutAgreeApproved(busNo); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/dto/DepartmentDetailDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/dto/DepartmentDetailDto.java new file mode 100644 index 0000000000000000000000000000000000000000..e992b24f4ce53611ecc4dd84e46cb52a91987fa3 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/departmentmanage/dto/DepartmentDetailDto.java @@ -0,0 +1,214 @@ +/* + * Copyright ©2023 CJB-CNIT Team. All rights reserved + */ +package com.openhis.web.departmentmanage.dto; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.openhis.common.annotation.Dict; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 单据详细信息 + * + * @author yuxj + * @date 2025-07-22 + */ +@Data +@Accessors(chain = true) +public class DepartmentDetailDto implements Serializable { + + /** ID */ + @TableId(type = IdType.ASSIGN_ID) + @JsonSerialize(using = ToStringSerializer.class) + private Long id; + + /** 单据号 */ + private String busNo; + /** 再生成单据号 */ + private String originalBusNo; + + /** 药品编码 */ + private String itemBusNo; + + /** 物品id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long itemId; + + /** 物品名称 */ + private String itemName; + + /** 规格 */ + private String totalVolume; + + /** 选择单位 */ + @Dict(dictCode = "unit_code") + private String unitCode; + private String unitCode_dictText; + + /** 常规单位 */ + @Dict(dictCode = "unit_code") + private String maxUnitCode; + private String maxUnitCode_dictText; + + /** 最小单位 */ + @Dict(dictCode = "unit_code") + private String minUnitCode; + private String minUnitCode_dictText; + + /** 拆零比 */ + private String partPercent; + + /** 数量 */ + private BigDecimal itemQuantity; + + /** 合计数量 */ + private BigDecimal totalQuantity; + + /** 单价 */ + private BigDecimal price; + + /** 总价 */ + private BigDecimal totalPrice; + + /** 零售价 */ + private BigDecimal retailPrice; + + /** 零价金额 */ + private BigDecimal totalRetailPrice; + + /** 厂家/产地 */ + private String manufacturerText; + + /** 批准文号 */ + private String approvalNumber; + + /** 批次库存 */ + private BigDecimal batchInventory; + /** 规格库存 */ + private BigDecimal specificationInventory; + + /** 备注 */ + private String remake; + + /** 理由类型 */ + private String reasonCode; + + /** 摘要(理由) */ + private String reason; + + /** 供应商 */ + @JsonSerialize(using = ToStringSerializer.class) + @Dict(dictCode = "id", dictText = "name", dictTable = "adm_supplier") + private Long supplierId; + private String supplierId_dictText; + + /** 源仓库类型 */ + private Integer sourceTypeEnum; + /** 源仓库 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long sourceLocationId; + + /** 目的仓库类型 */ + private Integer purposeTypeEnum; + /** 目的仓库 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long purposeLocationId; + + /** 采购员 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long applicantId; + + /** 审批人 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long approverId; + /** 审批时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date approvalTime; + + /** 申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date applyTime; + + /** 状态 */ + private Integer statusEnum; + private String statusEnum_enumText; + + /** 类型 */ + private Integer typeEnum; + private String typeEnum_enumText; + + /** 单据分类 */ + private Integer categoryEnum; + private String categoryEnum_enumText; + + /** 供应商联系人 */ + private String phone; + + /** 仓库员 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long practitionerId; + + /** 发票号 */ + private String invoiceNo; + + /** 产品批号 */ + private String lotNumber; + + /** 生产日期 */ + private Date startTime; + + /** 失效日期 */ + private Date endTime; + + /** 追溯码*/ + private String traceNo; + + /** 追溯码单位 */ + @Dict(dictCode = "unit_code") + private String traceNoUnitCode; + private String traceNoUnitCode_dictText; + + /** 包装情况 */ + private Integer packagingConditionEnum; + private String packagingConditionEnum_enumText; + + /** 验收结果 */ + private Integer acceptanceResultEnum; + private String acceptanceResultEnum_enumText; + + /** 禁用日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date occurrenceTime; + + /** 药品发放id */ + private String dispenseIds; + /** + * 单位列表 + */ + private List