Browse Source

REMOVE HOSPITAL 模块

yzx 6 days ago
parent
commit
45cc56ac3e
100 changed files with 3 additions and 10128 deletions
  1. 1 1
      fs-admin/src/main/java/com/fs/hisStore/task/ErpTask.java
  2. 0 109
      fs-admin/src/main/java/com/fs/hospital/controller/HospitalController.java
  3. 2 2
      fs-admin/src/main/java/com/fs/qw/FsCourseTask.java
  4. 0 120
      fs-hospital/pom.xml
  5. 0 14
      fs-hospital/src/main/java/com/fs/FSServletInitializer.java
  6. 0 22
      fs-hospital/src/main/java/com/fs/FsHospitalApplication.java
  7. 0 171
      fs-hospital/src/main/java/com/fs/framework/aspectj/DataScopeAspect.java
  8. 0 73
      fs-hospital/src/main/java/com/fs/framework/aspectj/DataSourceAspect.java
  9. 0 219
      fs-hospital/src/main/java/com/fs/framework/aspectj/LogAspect.java
  10. 0 31
      fs-hospital/src/main/java/com/fs/framework/config/ApplicationConfig.java
  11. 0 85
      fs-hospital/src/main/java/com/fs/framework/config/CaptchaConfig.java
  12. 0 123
      fs-hospital/src/main/java/com/fs/framework/config/DruidConfig.java
  13. 0 72
      fs-hospital/src/main/java/com/fs/framework/config/FastJson2JsonRedisSerializer.java
  14. 0 59
      fs-hospital/src/main/java/com/fs/framework/config/FilterConfig.java
  15. 0 76
      fs-hospital/src/main/java/com/fs/framework/config/KaptchaTextCreator.java
  16. 0 133
      fs-hospital/src/main/java/com/fs/framework/config/MyBatisConfig.java
  17. 0 161
      fs-hospital/src/main/java/com/fs/framework/config/RedisConfig.java
  18. 0 65
      fs-hospital/src/main/java/com/fs/framework/config/ResourcesConfig.java
  19. 0 153
      fs-hospital/src/main/java/com/fs/framework/config/SecurityConfig.java
  20. 0 33
      fs-hospital/src/main/java/com/fs/framework/config/ServerConfig.java
  21. 0 63
      fs-hospital/src/main/java/com/fs/framework/config/ThreadPoolConfig.java
  22. 0 77
      fs-hospital/src/main/java/com/fs/framework/config/properties/DruidProperties.java
  23. 0 28
      fs-hospital/src/main/java/com/fs/framework/datasource/DynamicDataSource.java
  24. 0 45
      fs-hospital/src/main/java/com/fs/framework/datasource/DynamicDataSourceContextHolder.java
  25. 0 115
      fs-hospital/src/main/java/com/fs/framework/exception/GlobalExceptionHandler.java
  26. 0 56
      fs-hospital/src/main/java/com/fs/framework/interceptor/RepeatSubmitInterceptor.java
  27. 0 126
      fs-hospital/src/main/java/com/fs/framework/interceptor/impl/SameUrlDataInterceptor.java
  28. 0 56
      fs-hospital/src/main/java/com/fs/framework/manager/AsyncManager.java
  29. 0 40
      fs-hospital/src/main/java/com/fs/framework/manager/ShutdownManager.java
  30. 0 112
      fs-hospital/src/main/java/com/fs/framework/manager/factory/AsyncFactory.java
  31. 0 69
      fs-hospital/src/main/java/com/fs/framework/security/LoginBody.java
  32. 0 266
      fs-hospital/src/main/java/com/fs/framework/security/LoginUser.java
  33. 0 89
      fs-hospital/src/main/java/com/fs/framework/security/SecurityUtils.java
  34. 0 49
      fs-hospital/src/main/java/com/fs/framework/security/filter/JwtAuthenticationTokenFilter.java
  35. 0 35
      fs-hospital/src/main/java/com/fs/framework/security/handle/AuthenticationEntryPointImpl.java
  36. 0 55
      fs-hospital/src/main/java/com/fs/framework/security/handle/LogoutSuccessHandlerImpl.java
  37. 0 93
      fs-hospital/src/main/java/com/fs/framework/service/HospitalLoginService.java
  38. 0 69
      fs-hospital/src/main/java/com/fs/framework/service/HospitalPermissionService.java
  39. 0 172
      fs-hospital/src/main/java/com/fs/framework/service/PermissionService.java
  40. 0 236
      fs-hospital/src/main/java/com/fs/framework/service/TokenService.java
  41. 0 77
      fs-hospital/src/main/java/com/fs/framework/service/UserDetailsServiceImpl.java
  42. 0 97
      fs-hospital/src/main/java/com/fs/hospital/controller/common/CaptchaController.java
  43. 0 176
      fs-hospital/src/main/java/com/fs/hospital/controller/common/CommonController.java
  44. 0 132
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalConfigController.java
  45. 0 181
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalDeptController.java
  46. 0 117
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalExamItemController.java
  47. 0 97
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalExamOrderController.java
  48. 0 114
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalInspectItemController.java
  49. 0 97
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalInspectOrderController.java
  50. 0 110
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalLoginController.java
  51. 0 105
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalLogininforController.java
  52. 0 140
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMemberBillController.java
  53. 0 118
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMemberController.java
  54. 0 133
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMemberIntegralLogsController.java
  55. 0 129
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMemberLevelController.java
  56. 0 114
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMemberRechargeController.java
  57. 0 147
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMenuController.java
  58. 0 105
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOperLogController.java
  59. 0 155
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOrderController.java
  60. 0 140
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOrderItemController.java
  61. 0 103
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOrderLogsController.java
  62. 0 202
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOutpatientOrderController.java
  63. 0 103
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOutpatientOrderLogsController.java
  64. 0 189
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalPatientController.java
  65. 0 122
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalPaymentController.java
  66. 0 132
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalPharmacyOrderController.java
  67. 0 103
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalPharmacyOrderLogsController.java
  68. 0 132
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalPostController.java
  69. 0 123
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductCheckOrderController.java
  70. 0 105
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductCheckOrderItemController.java
  71. 0 126
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductController.java
  72. 0 112
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductLogsController.java
  73. 0 156
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductOutOrderController.java
  74. 0 113
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductOutOrderItemController.java
  75. 0 159
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductPurchaseOrderController.java
  76. 0 103
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductPurchaseOrderItemController.java
  77. 0 134
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProfileController.java
  78. 0 193
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalRoleController.java
  79. 0 27
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalStatisticsController.java
  80. 0 141
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalStoreController.java
  81. 0 117
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalTreatItemController.java
  82. 0 165
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalTreatOrderController.java
  83. 0 107
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalTreatOrderLogsController.java
  84. 0 266
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalUserController.java
  85. 0 97
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalUserPostController.java
  86. 0 97
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalUserRoleController.java
  87. 0 103
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalWarehouseController.java
  88. 0 77
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/SysDictDataController.java
  89. 0 76
      fs-hospital/src/main/java/com/fs/hospital/controller/hospital/SysDictTypeController.java
  90. 0 26
      fs-hospital/src/main/java/com/fs/hospital/utils/JsonUtils.java
  91. 0 87
      fs-hospital/src/main/java/com/fs/hospital/utils/JwtUtils.java
  92. 0 29
      fs-hospital/src/main/java/com/fs/hospital/utils/MD5PasswordEncoder.java
  93. 0 36
      fs-hospital/src/main/java/com/fs/hospital/utils/UserUtil.java
  94. 0 54
      fs-hospital/src/main/java/com/fs/hospital/vo/WangUploadVO.java
  95. 0 1
      fs-hospital/src/main/resources/META-INF/spring-devtools.properties
  96. 0 8
      fs-hospital/src/main/resources/application.yml
  97. 0 2
      fs-hospital/src/main/resources/banner.txt
  98. 0 37
      fs-hospital/src/main/resources/i18n/messages.properties
  99. 0 93
      fs-hospital/src/main/resources/logback.xml
  100. 0 15
      fs-hospital/src/main/resources/mybatis/mybatis-config.xml

+ 1 - 1
fs-admin/src/main/java/com/fs/hisStore/task/ErpTask.java

@@ -8,7 +8,7 @@ import com.fs.erp.service.IErpOrderService;
 import com.fs.hisStore.domain.FsStoreOrderScrm;
 import com.fs.hisStore.service.IFsStoreOrderScrmService;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 

+ 0 - 109
fs-admin/src/main/java/com/fs/hospital/controller/HospitalController.java

@@ -1,109 +0,0 @@
-package com.fs.hospital.controller;
-
-import java.util.List;
-
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.SecurityUtils;
-import com.fs.hospital.param.HospitalParam;
-import com.fs.hospital.vo.HospitalHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.Hospital;
-import com.fs.hospital.service.IHospitalService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 诊所Controller
- *
- * @author fs
- * @date 2024-02-26
- */
-@RestController
-@RequestMapping("/hospital/hospital")
-public class HospitalController extends BaseController
-{
-    @Autowired
-    private IHospitalService hospitalService;
-
-    /**
-     * 查询诊所列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospital:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalParam hospital)
-    {
-        startPage();
-        List<HospitalHVO> list = hospitalService.selectHospitalListVO(hospital);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出诊所列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospital:export')")
-    @Log(title = "诊所", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalParam hospital)
-    {
-        List<HospitalHVO> list = hospitalService.selectHospitalListVO(hospital);
-        ExcelUtil<HospitalHVO> util = new ExcelUtil<HospitalHVO>(HospitalHVO.class);
-        return util.exportExcel(list, "诊所数据");
-    }
-
-    /**
-     * 获取诊所详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospital:query')")
-    @GetMapping(value = "/{hospitalId}")
-    public AjaxResult getInfo(@PathVariable("hospitalId") Long hospitalId)
-    {
-        return AjaxResult.success(hospitalService.selectHospitalByHospitalId(hospitalId));
-    }
-
-    /**
-     * 新增诊所
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospital:add')")
-    @Log(title = "诊所", businessType = BusinessType.INSERT)
-    @PostMapping
-    public R add(@RequestBody Hospital hospital)
-    {
-        hospital.setPassword(SecurityUtils.encryptPassword(hospital.getPassword()));
-        return hospitalService.insertHospital(hospital);
-    }
-
-    /**
-     * 修改诊所
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospital:edit')")
-    @Log(title = "诊所", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody Hospital hospital)
-    {
-        return toAjax(hospitalService.updateHospital(hospital));
-    }
-
-    /**
-     * 删除诊所
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospital:remove')")
-    @Log(title = "诊所", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{hospitalIds}")
-    public AjaxResult remove(@PathVariable Long[] hospitalIds)
-    {
-        return toAjax(hospitalService.deleteHospitalByHospitalIds(hospitalIds));
-    }
-}

+ 2 - 2
fs-admin/src/main/java/com/fs/qw/FsCourseTask.java

@@ -10,7 +10,7 @@ import com.fs.system.mapper.SysConfigMapper;
 import io.jsonwebtoken.lang.Assert;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.http.util.Asserts;
 import org.redisson.api.RLock;
 import org.redisson.api.RedissonClient;
@@ -80,7 +80,7 @@ public class FsCourseTask {
             sysConfigMapper.updateConfig(sysConfig);
 
         }catch (Exception e){
-            log.error("充值失败 原因:{}", ExceptionUtils.getFullStackTrace(e),e);
+            log.error("充值失败 原因:{}", ExceptionUtils.getMessage(e),e);
             throw new RuntimeException(e);
         }finally {
             if (lock.isHeldByCurrentThread()) {

+ 0 - 120
fs-hospital/pom.xml

@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>fs</artifactId>
-        <groupId>com.fs</groupId>
-        <version>1.1.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <groupId>com.fs</groupId>
-    <artifactId>fs-hospital</artifactId>
-    <description>
-        诊所接口
-    </description>
-
-    <dependencies>
-
-        <!-- spring-boot-devtools -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-devtools</artifactId>
-            <optional>true</optional> <!-- 表示依赖不会传递 -->
-        </dependency>
-        <!-- swagger2-->
-
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger2</artifactId>
-        </dependency>
-
-        <!-- swagger2-UI-->
-
-        <dependency>
-            <groupId>com.github.xiaoymin</groupId>
-            <artifactId>swagger-bootstrap-ui</artifactId>
-            <version>1.9.3</version>
-        </dependency>
-
-
-        <!-- Mysql驱动包 -->
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-        </dependency>
-
-        <!-- SpringBoot Web容器 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-
-        <!-- SpringBoot 拦截器 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-aop</artifactId>
-        </dependency>
-
-        <!-- 阿里数据库连接池 -->
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
-        </dependency>
-
-        <!-- 验证码 -->
-        <dependency>
-            <groupId>com.github.penggle</groupId>
-            <artifactId>kaptcha</artifactId>
-            <exclusions>
-                <exclusion>
-                    <artifactId>javax.servlet-api</artifactId>
-                    <groupId>javax.servlet</groupId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-
-        <!-- 获取系统信息 -->
-        <dependency>
-            <groupId>com.github.oshi</groupId>
-            <artifactId>oshi-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.fs</groupId>
-            <artifactId>fs-service</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <version>2.1.1.RELEASE</version>
-                <configuration>
-                    <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
-                </configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-war-plugin</artifactId>
-                <version>3.1.0</version>
-                <configuration>
-                    <failOnMissingWebXml>false</failOnMissingWebXml>
-                    <warName>${project.artifactId}</warName>
-                </configuration>
-            </plugin>
-        </plugins>
-        <finalName>${project.artifactId}</finalName>
-    </build>
-
-
-</project>

+ 0 - 14
fs-hospital/src/main/java/com/fs/FSServletInitializer.java

@@ -1,14 +0,0 @@
-package com.fs;
-
-import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
-
-
-public class FSServletInitializer extends SpringBootServletInitializer
-{
-    @Override
-    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
-    {
-        return application.sources(FsHospitalApplication.class);
-    }
-}

+ 0 - 22
fs-hospital/src/main/java/com/fs/FsHospitalApplication.java

@@ -1,22 +0,0 @@
-package com.fs;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
-
-/**
- * 启动程序
- */
-@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
-@EnableTransactionManagement
-@EnableAsync
-public class FsHospitalApplication
-{
-    public static void main(String[] args)
-    {
-        SpringApplication.run(FsHospitalApplication.class, args);
-        System.out.println("HospitalAPI启动成功");
-    }
-}

+ 0 - 171
fs-hospital/src/main/java/com/fs/framework/aspectj/DataScopeAspect.java

@@ -1,171 +0,0 @@
-package com.fs.framework.aspectj;
-
-import com.fs.common.annotation.DataScope;
-import com.fs.common.core.domain.BaseEntity;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
-import com.fs.common.utils.spring.SpringUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.domain.HospitalRole;
-import com.fs.hospital.domain.HospitalUser;
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.Signature;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Before;
-import org.aspectj.lang.annotation.Pointcut;
-import org.aspectj.lang.reflect.MethodSignature;
-import org.springframework.stereotype.Component;
-
-import java.lang.reflect.Method;
-
-/**
- * 数据过滤处理
- *
-
- */
-@Aspect
-@Component
-public class DataScopeAspect
-{
-    /**
-     * 全部数据权限
-     */
-    public static final String DATA_SCOPE_ALL = "1";
-
-    /**
-     * 自定数据权限
-     */
-    public static final String DATA_SCOPE_CUSTOM = "2";
-
-    /**
-     * 部门数据权限
-     */
-    public static final String DATA_SCOPE_DEPT = "3";
-
-    /**
-     * 部门及以下数据权限
-     */
-    public static final String DATA_SCOPE_DEPT_AND_CHILD = "4";
-
-    /**
-     * 仅本人数据权限
-     */
-    public static final String DATA_SCOPE_SELF = "5";
-
-    /**
-     * 数据权限过滤关键字
-     */
-    public static final String DATA_SCOPE = "dataScope";
-
-    // 配置织入点
-    @Pointcut("@annotation(com.fs.common.annotation.DataScope)")
-    public void dataScopePointCut()
-    {
-    }
-
-    @Before("dataScopePointCut()")
-    public void doBefore(JoinPoint point) throws Throwable
-    {
-        handleDataScope(point);
-    }
-
-    protected void handleDataScope(final JoinPoint joinPoint)
-    {
-        // 获得注解
-        DataScope controllerDataScope = getAnnotationLog(joinPoint);
-        if (controllerDataScope == null)
-        {
-            return;
-        }
-        // 获取当前的用户
-        LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-        if (StringUtils.isNotNull(loginUser))
-        {
-            HospitalUser currentUser = loginUser.getUser();
-            // 如果是超级管理员,则不过滤数据
-            if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
-            {
-                dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
-                        controllerDataScope.userAlias());
-            }
-        }
-    }
-
-    /**
-     * 数据范围过滤
-     *
-     * @param joinPoint 切点
-     * @param user 用户
-     * @param userAlias 别名
-     */
-    public static void dataScopeFilter(JoinPoint joinPoint, HospitalUser user, String deptAlias, String userAlias)
-    {
-        StringBuilder sqlString = new StringBuilder();
-
-        for (HospitalRole role : user.getRoles())
-        {
-            String dataScope = role.getDataScope();
-            if (DATA_SCOPE_ALL.equals(dataScope))
-            {
-                sqlString = new StringBuilder();
-                break;
-            }
-            else if (DATA_SCOPE_CUSTOM.equals(dataScope))
-            {
-                sqlString.append(StringUtils.format(
-                        " OR {}.dept_id IN ( SELECT dept_id FROM company_role_dept WHERE role_id = {} ) ", deptAlias,
-                        role.getRoleId()));
-            }
-            else if (DATA_SCOPE_DEPT.equals(dataScope))
-            {
-                sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId()));
-            }
-            else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
-            {
-                sqlString.append(StringUtils.format(
-                        " OR {}.dept_id IN ( SELECT dept_id FROM company_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
-                        deptAlias, user.getDeptId(), user.getDeptId()));
-            }
-            else if (DATA_SCOPE_SELF.equals(dataScope))
-            {
-                if (StringUtils.isNotBlank(userAlias))
-                {
-                    sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId()));
-                }
-                else
-                {
-                    // 数据权限为仅本人且没有userAlias别名不查询任何数据
-                    //sqlString.append(" OR 1=0 ");
-                        sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId()));
-                }
-            }
-        }
-
-        if (StringUtils.isNotBlank(sqlString.toString()))
-        {
-            Object params = joinPoint.getArgs()[0];
-            if (StringUtils.isNotNull(params) && params instanceof BaseEntity)
-            {
-                BaseEntity baseEntity = (BaseEntity) params;
-                baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
-            }
-        }
-    }
-
-    /**
-     * 是否存在注解,如果存在就获取
-     */
-    private DataScope getAnnotationLog(JoinPoint joinPoint)
-    {
-        Signature signature = joinPoint.getSignature();
-        MethodSignature methodSignature = (MethodSignature) signature;
-        Method method = methodSignature.getMethod();
-
-        if (method != null)
-        {
-            return method.getAnnotation(DataScope.class);
-        }
-        return null;
-    }
-}

+ 0 - 73
fs-hospital/src/main/java/com/fs/framework/aspectj/DataSourceAspect.java

@@ -1,73 +0,0 @@
-package com.fs.framework.aspectj;
-
-import com.fs.common.annotation.DataSource;
-import com.fs.common.utils.StringUtils;
-import com.fs.framework.datasource.DynamicDataSourceContextHolder;
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.aspectj.lang.reflect.MethodSignature;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.annotation.AnnotationUtils;
-import org.springframework.core.annotation.Order;
-import org.springframework.stereotype.Component;
-
-import java.util.Objects;
-
-/**
- * 多数据源处理
- *
-
- */
-@Aspect
-@Order(1)
-@Component
-public class DataSourceAspect
-{
-    protected Logger logger = LoggerFactory.getLogger(getClass());
-
-    @Pointcut("@annotation(com.fs.common.annotation.DataSource)"
-            + "|| @within(com.fs.common.annotation.DataSource)")
-    public void dsPointCut()
-    {
-
-    }
-
-    @Around("dsPointCut()")
-    public Object around(ProceedingJoinPoint point) throws Throwable
-    {
-        DataSource dataSource = getDataSource(point);
-
-        if (StringUtils.isNotNull(dataSource))
-        {
-            DynamicDataSourceContextHolder.setDataSourceType(dataSource.value().name());
-        }
-
-        try
-        {
-            return point.proceed();
-        }
-        finally
-        {
-            // 销毁数据源 在执行方法之后
-            DynamicDataSourceContextHolder.clearDataSourceType();
-        }
-    }
-
-    /**
-     * 获取需要切换的数据源
-     */
-    public DataSource getDataSource(ProceedingJoinPoint point)
-    {
-        MethodSignature signature = (MethodSignature) point.getSignature();
-        DataSource dataSource = AnnotationUtils.findAnnotation(signature.getMethod(), DataSource.class);
-        if (Objects.nonNull(dataSource))
-        {
-            return dataSource;
-        }
-
-        return AnnotationUtils.findAnnotation(signature.getDeclaringType(), DataSource.class);
-    }
-}

+ 0 - 219
fs-hospital/src/main/java/com/fs/framework/aspectj/LogAspect.java

@@ -1,219 +0,0 @@
-package com.fs.framework.aspectj;
-
-import com.alibaba.fastjson.JSON;
-import com.fs.common.annotation.Log;
-import com.fs.common.enums.BusinessStatus;
-import com.fs.common.enums.HttpMethod;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
-import com.fs.common.utils.ip.IpUtils;
-import com.fs.common.utils.spring.SpringUtils;
-import com.fs.hospital.domain.HospitalOperLog;
-import com.fs.framework.manager.AsyncManager;
-import com.fs.framework.manager.factory.AsyncFactory;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.Signature;
-import org.aspectj.lang.annotation.AfterReturning;
-import org.aspectj.lang.annotation.AfterThrowing;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.aspectj.lang.reflect.MethodSignature;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.servlet.HandlerMapping;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.lang.reflect.Method;
-import java.util.Map;
-
-/**
- * 操作日志记录处理
- *
-
- */
-@Aspect
-@Component
-public class LogAspect
-{
-    private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
-
-    // 配置织入点
-    @Pointcut("@annotation(com.fs.common.annotation.Log)")
-    public void logPointCut()
-    {
-    }
-
-    /**
-     * 处理完请求后执行
-     *
-     * @param joinPoint 切点
-     */
-    @AfterReturning(pointcut = "logPointCut()", returning = "jsonResult")
-    public void doAfterReturning(JoinPoint joinPoint, Object jsonResult)
-    {
-        handleLog(joinPoint, null, jsonResult);
-    }
-
-    /**
-     * 拦截异常操作
-     *
-     * @param joinPoint 切点
-     * @param e 异常
-     */
-    @AfterThrowing(value = "logPointCut()", throwing = "e")
-    public void doAfterThrowing(JoinPoint joinPoint, Exception e)
-    {
-        handleLog(joinPoint, e, null);
-    }
-
-    protected void handleLog(final JoinPoint joinPoint, final Exception e, Object jsonResult)
-    {
-        try
-        {
-            // 获得注解
-            Log controllerLog = getAnnotationLog(joinPoint);
-            if (controllerLog == null)
-            {
-                return;
-            }
-
-            // 获取当前的用户
-            LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
-
-            // *========数据库日志=========*//
-            HospitalOperLog operLog = new HospitalOperLog();
-            operLog.setHospitalId(1L);
-            operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
-            // 请求的地址
-            String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
-            operLog.setOperIp(ip);
-            // 返回参数
-            operLog.setJsonResult(JSON.toJSONString(jsonResult));
-
-            operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
-            if (loginUser != null)
-            {
-                operLog.setOperName(loginUser.getUsername());
-            }
-
-            if (e != null)
-            {
-                operLog.setStatus(BusinessStatus.FAIL.ordinal());
-                operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
-            }
-            // 设置方法名称
-            String className = joinPoint.getTarget().getClass().getName();
-            String methodName = joinPoint.getSignature().getName();
-            operLog.setMethod(className + "." + methodName + "()");
-            // 设置请求方式
-            operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
-            // 处理设置注解上的参数
-            getControllerMethodDescription(joinPoint, controllerLog, operLog);
-            // 保存数据库
-            AsyncManager.me().execute(AsyncFactory.recordOper(operLog));
-        }
-        catch (Exception exp)
-        {
-            // 记录本地异常日志
-            log.error("==前置通知异常==");
-            log.error("异常信息:{}", exp.getMessage());
-            exp.printStackTrace();
-        }
-    }
-
-    /**
-     * 获取注解中对方法的描述信息 用于Controller层注解
-     *
-     * @param log 日志
-     * @param operLog 操作日志
-     * @throws Exception
-     */
-    public void getControllerMethodDescription(JoinPoint joinPoint, Log log, HospitalOperLog operLog) throws Exception
-    {
-        // 设置action动作
-        operLog.setBusinessType(log.businessType().ordinal());
-        // 设置标题
-        operLog.setTitle(log.title());
-        // 设置操作人类别
-        operLog.setOperatorType(log.operatorType().ordinal());
-        // 是否需要保存request,参数和值
-        if (log.isSaveRequestData())
-        {
-            // 获取参数的信息,传入到数据库中。
-            setRequestValue(joinPoint, operLog);
-        }
-    }
-
-    /**
-     * 获取请求的参数,放到log中
-     *
-     * @param operLog 操作日志
-     * @throws Exception 异常
-     */
-    private void setRequestValue(JoinPoint joinPoint, HospitalOperLog operLog) throws Exception
-    {
-        String requestMethod = operLog.getRequestMethod();
-        if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))
-        {
-            String params = argsArrayToString(joinPoint.getArgs());
-            operLog.setOperParam(StringUtils.substring(params, 0, 2000));
-        }
-        else
-        {
-            Map<?, ?> paramsMap = (Map<?, ?>) ServletUtils.getRequest().getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
-            operLog.setOperParam(StringUtils.substring(paramsMap.toString(), 0, 2000));
-        }
-    }
-
-    /**
-     * 是否存在注解,如果存在就获取
-     */
-    private Log getAnnotationLog(JoinPoint joinPoint) throws Exception
-    {
-        Signature signature = joinPoint.getSignature();
-        MethodSignature methodSignature = (MethodSignature) signature;
-        Method method = methodSignature.getMethod();
-
-        if (method != null)
-        {
-            return method.getAnnotation(Log.class);
-        }
-        return null;
-    }
-
-    /**
-     * 参数拼装
-     */
-    private String argsArrayToString(Object[] paramsArray)
-    {
-        String params = "";
-        if (paramsArray != null && paramsArray.length > 0)
-        {
-            for (int i = 0; i < paramsArray.length; i++)
-            {
-                if (!isFilterObject(paramsArray[i]))
-                {
-                    Object jsonObj = JSON.toJSON(paramsArray[i]);
-                    params += jsonObj.toString() + " ";
-                }
-            }
-        }
-        return params.trim();
-    }
-
-    /**
-     * 判断是否需要过滤的对象。
-     *
-     * @param o 对象信息。
-     * @return 如果是需要过滤的对象,则返回true;否则返回false。
-     */
-    public boolean isFilterObject(final Object o)
-    {
-        return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse;
-    }
-}

+ 0 - 31
fs-hospital/src/main/java/com/fs/framework/config/ApplicationConfig.java

@@ -1,31 +0,0 @@
-package com.fs.framework.config;
-
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-
-import java.util.TimeZone;
-
-/**
- * 程序注解配置
- *
-
- */
-@Configuration
-// 表示通过aop框架暴露该代理对象,AopContext能够访问
-@EnableAspectJAutoProxy(exposeProxy = true)
-// 指定要扫描的Mapper类的包的路径
-@MapperScan("com.fs.**.mapper")
-public class ApplicationConfig
-{
-    /**
-     * 时区配置
-     */
-    @Bean
-    public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization()
-    {
-        return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault());
-    }
-}

+ 0 - 85
fs-hospital/src/main/java/com/fs/framework/config/CaptchaConfig.java

@@ -1,85 +0,0 @@
-package com.fs.framework.config;
-
-import com.google.code.kaptcha.impl.DefaultKaptcha;
-import com.google.code.kaptcha.util.Config;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.Properties;
-
-import static com.google.code.kaptcha.Constants.*;
-
-/**
- * 验证码配置
- *
-
- */
-@Configuration
-public class CaptchaConfig
-{
-    @Bean(name = "captchaProducer")
-    public DefaultKaptcha getKaptchaBean()
-    {
-        DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
-        Properties properties = new Properties();
-        // 是否有边框 默认为true 我们可以自己设置yes,no
-        properties.setProperty(KAPTCHA_BORDER, "yes");
-        // 验证码文本字符颜色 默认为Color.BLACK
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "black");
-        // 验证码图片宽度 默认为200
-        properties.setProperty(KAPTCHA_IMAGE_WIDTH, "160");
-        // 验证码图片高度 默认为50
-        properties.setProperty(KAPTCHA_IMAGE_HEIGHT, "60");
-        // 验证码文本字符大小 默认为40
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_SIZE, "38");
-        // KAPTCHA_SESSION_KEY
-        properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCode");
-        // 验证码文本字符长度 默认为5
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "4");
-        // 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_NAMES, "Arial,Courier");
-        // 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
-        properties.setProperty(KAPTCHA_OBSCURIFICATOR_IMPL, "com.google.code.kaptcha.impl.ShadowGimpy");
-        Config config = new Config(properties);
-        defaultKaptcha.setConfig(config);
-        return defaultKaptcha;
-    }
-
-    @Bean(name = "captchaProducerMath")
-    public DefaultKaptcha getKaptchaBeanMath()
-    {
-        DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
-        Properties properties = new Properties();
-        // 是否有边框 默认为true 我们可以自己设置yes,no
-        properties.setProperty(KAPTCHA_BORDER, "yes");
-        // 边框颜色 默认为Color.BLACK
-        properties.setProperty(KAPTCHA_BORDER_COLOR, "105,179,90");
-        // 验证码文本字符颜色 默认为Color.BLACK
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_COLOR, "blue");
-        // 验证码图片宽度 默认为200
-        properties.setProperty(KAPTCHA_IMAGE_WIDTH, "160");
-        // 验证码图片高度 默认为50
-        properties.setProperty(KAPTCHA_IMAGE_HEIGHT, "60");
-        // 验证码文本字符大小 默认为40
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_SIZE, "35");
-        // KAPTCHA_SESSION_KEY
-        properties.setProperty(KAPTCHA_SESSION_CONFIG_KEY, "kaptchaCodeMath");
-        // 验证码文本生成器
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_IMPL, "com.fs.framework.config.KaptchaTextCreator");
-        // 验证码文本字符间距 默认为2
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_SPACE, "3");
-        // 验证码文本字符长度 默认为5
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_CHAR_LENGTH, "6");
-        // 验证码文本字体样式 默认为new Font("Arial", 1, fontSize), new Font("Courier", 1, fontSize)
-        properties.setProperty(KAPTCHA_TEXTPRODUCER_FONT_NAMES, "Arial,Courier");
-        // 验证码噪点颜色 默认为Color.BLACK
-        properties.setProperty(KAPTCHA_NOISE_COLOR, "white");
-        // 干扰实现类
-        properties.setProperty(KAPTCHA_NOISE_IMPL, "com.google.code.kaptcha.impl.NoNoise");
-        // 图片样式 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy
-        properties.setProperty(KAPTCHA_OBSCURIFICATOR_IMPL, "com.google.code.kaptcha.impl.ShadowGimpy");
-        Config config = new Config(properties);
-        defaultKaptcha.setConfig(config);
-        return defaultKaptcha;
-    }
-}

+ 0 - 123
fs-hospital/src/main/java/com/fs/framework/config/DruidConfig.java

@@ -1,123 +0,0 @@
-package com.fs.framework.config;
-
-import com.alibaba.druid.pool.DruidDataSource;
-import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
-import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
-import com.alibaba.druid.util.Utils;
-import com.fs.framework.datasource.DynamicDataSource;
-import com.fs.common.enums.DataSourceType;
-import com.fs.common.utils.spring.SpringUtils;
-import com.fs.framework.config.properties.DruidProperties;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.web.servlet.FilterRegistrationBean;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Primary;
-
-import javax.servlet.*;
-import javax.sql.DataSource;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * druid 配置多数据源
- *
-
- */
-@Configuration
-public class DruidConfig
-{
-    @Bean
-    @ConfigurationProperties("spring.datasource.mysql.druid.master")
-    public DataSource masterDataSource(DruidProperties druidProperties)
-    {
-        DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
-        return druidProperties.dataSource(dataSource);
-    }
-
-    @Bean
-    @ConfigurationProperties("spring.datasource.mysql.druid.slave")
-    @ConditionalOnProperty(prefix = "spring.datasource.mysql.druid.slave", name = "enabled", havingValue = "true")
-    public DataSource slaveDataSource(DruidProperties druidProperties)
-    {
-        DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
-        return druidProperties.dataSource(dataSource);
-    }
-
-    @Bean(name = "dynamicDataSource")
-    @Primary
-    public DynamicDataSource dataSource(DataSource masterDataSource)
-    {
-        Map<Object, Object> targetDataSources = new HashMap<>();
-        targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
-        setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
-        return new DynamicDataSource(masterDataSource, targetDataSources);
-    }
-
-    /**
-     * 设置数据源
-     *
-     * @param targetDataSources 备选数据源集合
-     * @param sourceName 数据源名称
-     * @param beanName bean名称
-     */
-    public void setDataSource(Map<Object, Object> targetDataSources, String sourceName, String beanName)
-    {
-        try
-        {
-            DataSource dataSource = SpringUtils.getBean(beanName);
-            targetDataSources.put(sourceName, dataSource);
-        }
-        catch (Exception e)
-        {
-        }
-    }
-
-    /**
-     * 去除监控页面底部的广告
-     */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    @Bean
-    @ConditionalOnProperty(name = "spring.datasource.mysql.druid.statViewServlet.enabled", havingValue = "true")
-    public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties)
-    {
-        // 获取web监控页面的参数
-        DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
-        // 提取common.js的配置路径
-        String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
-        String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
-        final String filePath = "support/http/resources/js/common.js";
-        // 创建filter进行过滤
-        Filter filter = new Filter()
-        {
-
-            public void init(FilterConfig filterConfig) throws ServletException
-            {
-            }
-            @Override
-            public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
-                    throws IOException, ServletException
-            {
-                chain.doFilter(request, response);
-                // 重置缓冲区,响应头不会被重置
-                response.resetBuffer();
-                // 获取common.js
-                String text = Utils.readFromResource(filePath);
-                // 正则替换banner, 除去底部的广告信息
-                text = text.replaceAll("<a.*?banner\"></a><br/>", "");
-                text = text.replaceAll("powered.*?shrek.wang</a>", "");
-                response.getWriter().write(text);
-            }
-            @Override
-            public void destroy()
-            {
-            }
-        };
-        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
-        registrationBean.setFilter(filter);
-        registrationBean.addUrlPatterns(commonJsPattern);
-        return registrationBean;
-    }
-}

+ 0 - 72
fs-hospital/src/main/java/com/fs/framework/config/FastJson2JsonRedisSerializer.java

@@ -1,72 +0,0 @@
-package com.fs.framework.config;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.parser.ParserConfig;
-import com.alibaba.fastjson.serializer.SerializerFeature;
-import com.fasterxml.jackson.databind.JavaType;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import org.springframework.data.redis.serializer.RedisSerializer;
-import org.springframework.data.redis.serializer.SerializationException;
-import org.springframework.util.Assert;
-
-import java.nio.charset.Charset;
-
-/**
- * Redis使用FastJson序列化
- *
-
- */
-public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
-{
-    @SuppressWarnings("unused")
-    private ObjectMapper objectMapper = new ObjectMapper();
-
-    public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
-
-    private Class<T> clazz;
-
-    static
-    {
-        ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
-    }
-
-    public FastJson2JsonRedisSerializer(Class<T> clazz)
-    {
-        super();
-        this.clazz = clazz;
-    }
-
-    @Override
-    public byte[] serialize(T t) throws SerializationException
-    {
-        if (t == null)
-        {
-            return new byte[0];
-        }
-        return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET);
-    }
-
-    @Override
-    public T deserialize(byte[] bytes) throws SerializationException
-    {
-        if (bytes == null || bytes.length <= 0)
-        {
-            return null;
-        }
-        String str = new String(bytes, DEFAULT_CHARSET);
-
-        return JSON.parseObject(str, clazz);
-    }
-
-    public void setObjectMapper(ObjectMapper objectMapper)
-    {
-        Assert.notNull(objectMapper, "'objectMapper' must not be null");
-        this.objectMapper = objectMapper;
-    }
-
-    protected JavaType getJavaType(Class<?> clazz)
-    {
-        return TypeFactory.defaultInstance().constructType(clazz);
-    }
-}

+ 0 - 59
fs-hospital/src/main/java/com/fs/framework/config/FilterConfig.java

@@ -1,59 +0,0 @@
-package com.fs.framework.config;
-
-import com.fs.common.filter.RepeatableFilter;
-import com.fs.common.filter.XssFilter;
-import com.fs.common.utils.StringUtils;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.web.servlet.FilterRegistrationBean;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import javax.servlet.DispatcherType;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Filter配置
- *
-
- */
-@Configuration
-@ConditionalOnProperty(value = "xss.enabled", havingValue = "true")
-public class FilterConfig
-{
-    @Value("${xss.excludes}")
-    private String excludes;
-
-    @Value("${xss.urlPatterns}")
-    private String urlPatterns;
-
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    @Bean
-    public FilterRegistrationBean xssFilterRegistration()
-    {
-        FilterRegistrationBean registration = new FilterRegistrationBean();
-        registration.setDispatcherTypes(DispatcherType.REQUEST);
-        registration.setFilter(new XssFilter());
-        registration.addUrlPatterns(StringUtils.split(urlPatterns, ","));
-        registration.setName("xssFilter");
-        registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE);
-        Map<String, String> initParameters = new HashMap<String, String>();
-        initParameters.put("excludes", excludes);
-        registration.setInitParameters(initParameters);
-        return registration;
-    }
-
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    @Bean
-    public FilterRegistrationBean someFilterRegistration()
-    {
-        FilterRegistrationBean registration = new FilterRegistrationBean();
-        registration.setFilter(new RepeatableFilter());
-        registration.addUrlPatterns("/*");
-        registration.setName("repeatableFilter");
-        registration.setOrder(FilterRegistrationBean.LOWEST_PRECEDENCE);
-        return registration;
-    }
-
-}

+ 0 - 76
fs-hospital/src/main/java/com/fs/framework/config/KaptchaTextCreator.java

@@ -1,76 +0,0 @@
-package com.fs.framework.config;
-
-import com.google.code.kaptcha.text.impl.DefaultTextCreator;
-
-import java.util.Random;
-
-/**
- * 验证码文本生成器
- *
-
- */
-public class KaptchaTextCreator extends DefaultTextCreator
-{
-    private static final String[] CNUMBERS = "0,1,2,3,4,5,6,7,8,9,10".split(",");
-
-    @Override
-    public String getText()
-    {
-        Integer result = 0;
-        Random random = new Random();
-        int x = random.nextInt(10);
-        int y = random.nextInt(10);
-        StringBuilder suChinese = new StringBuilder();
-        int randomoperands = (int) Math.round(Math.random() * 2);
-        if (randomoperands == 0)
-        {
-            result = x * y;
-            suChinese.append(CNUMBERS[x]);
-            suChinese.append("*");
-            suChinese.append(CNUMBERS[y]);
-        }
-        else if (randomoperands == 1)
-        {
-            if (!(x == 0) && y % x == 0)
-            {
-                result = y / x;
-                suChinese.append(CNUMBERS[y]);
-                suChinese.append("/");
-                suChinese.append(CNUMBERS[x]);
-            }
-            else
-            {
-                result = x + y;
-                suChinese.append(CNUMBERS[x]);
-                suChinese.append("+");
-                suChinese.append(CNUMBERS[y]);
-            }
-        }
-        else if (randomoperands == 2)
-        {
-            if (x >= y)
-            {
-                result = x - y;
-                suChinese.append(CNUMBERS[x]);
-                suChinese.append("-");
-                suChinese.append(CNUMBERS[y]);
-            }
-            else
-            {
-                result = y - x;
-                suChinese.append(CNUMBERS[y]);
-                suChinese.append("-");
-                suChinese.append(CNUMBERS[x]);
-            }
-        }
-        else
-        {
-            result = x + y;
-            suChinese.append(CNUMBERS[x]);
-            suChinese.append("+");
-            suChinese.append(CNUMBERS[y]);
-        }
-        suChinese.append("=?@" + result);
-        return suChinese.toString();
-    }
-}

+ 0 - 133
fs-hospital/src/main/java/com/fs/framework/config/MyBatisConfig.java

@@ -1,133 +0,0 @@
-package com.fs.framework.config;
-
-import com.fs.common.utils.StringUtils;
-import org.apache.ibatis.io.VFS;
-import org.apache.ibatis.session.SqlSessionFactory;
-import org.mybatis.spring.SqlSessionFactoryBean;
-import org.mybatis.spring.boot.autoconfigure.SpringBootVFS;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.env.Environment;
-import org.springframework.core.io.DefaultResourceLoader;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
-import org.springframework.core.io.support.ResourcePatternResolver;
-import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
-import org.springframework.core.type.classreading.MetadataReader;
-import org.springframework.core.type.classreading.MetadataReaderFactory;
-import org.springframework.util.ClassUtils;
-
-import javax.sql.DataSource;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-
-/**
- * Mybatis支持*匹配扫描包
- *
-
- */
-@Configuration
-public class MyBatisConfig
-{
-    @Autowired
-    private Environment env;
-
-    static final String DEFAULT_RESOURCE_PATTERN = "**/*.class";
-
-    public static String setTypeAliasesPackage(String typeAliasesPackage)
-    {
-        ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver();
-        MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver);
-        List<String> allResult = new ArrayList<String>();
-        try
-        {
-            for (String aliasesPackage : typeAliasesPackage.split(","))
-            {
-                List<String> result = new ArrayList<String>();
-                aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
-                        + ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN;
-                Resource[] resources = resolver.getResources(aliasesPackage);
-                if (resources != null && resources.length > 0)
-                {
-                    MetadataReader metadataReader = null;
-                    for (Resource resource : resources)
-                    {
-                        if (resource.isReadable())
-                        {
-                            metadataReader = metadataReaderFactory.getMetadataReader(resource);
-                            try
-                            {
-                                result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage().getName());
-                            }
-                            catch (ClassNotFoundException e)
-                            {
-                                e.printStackTrace();
-                            }
-                        }
-                    }
-                }
-                if (result.size() > 0)
-                {
-                    HashSet<String> hashResult = new HashSet<String>(result);
-                    allResult.addAll(hashResult);
-                }
-            }
-            if (allResult.size() > 0)
-            {
-                typeAliasesPackage = String.join(",", (String[]) allResult.toArray(new String[0]));
-            }
-            else
-            {
-                throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包");
-            }
-        }
-        catch (IOException e)
-        {
-            e.printStackTrace();
-        }
-        return typeAliasesPackage;
-    }
-
-    public Resource[] resolveMapperLocations(String[] mapperLocations)
-    {
-        ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver();
-        List<Resource> resources = new ArrayList<Resource>();
-        if (mapperLocations != null)
-        {
-            for (String mapperLocation : mapperLocations)
-            {
-                try
-                {
-                    Resource[] mappers = resourceResolver.getResources(mapperLocation);
-                    resources.addAll(Arrays.asList(mappers));
-                }
-                catch (IOException e)
-                {
-                    // ignore
-                }
-            }
-        }
-        return resources.toArray(new Resource[resources.size()]);
-    }
-
-    @Bean
-    public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception
-    {
-        String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage");
-        String mapperLocations = env.getProperty("mybatis.mapperLocations");
-        String configLocation = env.getProperty("mybatis.configLocation");
-        typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
-        VFS.addImplClass(SpringBootVFS.class);
-
-        final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
-        sessionFactory.setDataSource(dataSource);
-        sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
-        sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
-        sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
-        return sessionFactory.getObject();
-    }
-}

+ 0 - 161
fs-hospital/src/main/java/com/fs/framework/config/RedisConfig.java

@@ -1,161 +0,0 @@
-package com.fs.framework.config;
-
-import com.fasterxml.jackson.annotation.JsonAutoDetect;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import com.fasterxml.jackson.annotation.PropertyAccessor;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
-import com.fs.framework.config.FastJson2JsonRedisSerializer;
-import org.springframework.cache.annotation.CachingConfigurerSupport;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.connection.RedisConnectionFactory;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.script.DefaultRedisScript;
-import org.springframework.data.redis.serializer.GenericToStringSerializer;
-import org.springframework.data.redis.serializer.StringRedisSerializer;
-
-import java.math.BigDecimal;
-
-/**
- * redis配置
- *
-
- */
-@Configuration
-@EnableCaching
-public class RedisConfig extends CachingConfigurerSupport
-{
-    @Bean
-    @SuppressWarnings(value = { "unchecked", "rawtypes" })
-    public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory)
-    {
-        RedisTemplate<Object, Object> template = new RedisTemplate<>();
-        template.setConnectionFactory(connectionFactory);
-
-        FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class);
-
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
-        mapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
-        serializer.setObjectMapper(mapper);
-
-        // 使用StringRedisSerializer来序列化和反序列化redis的key值
-        template.setKeySerializer(new StringRedisSerializer());
-        template.setValueSerializer(serializer);
-
-        // Hash的key也采用StringRedisSerializer的序列化方式
-        template.setHashKeySerializer(new StringRedisSerializer());
-        template.setHashValueSerializer(serializer);
-
-        template.afterPropertiesSet();
-        return template;
-    }
-
-    @Bean
-    public RedisTemplate<String, Boolean> redisTemplateForBoolean(RedisConnectionFactory connectionFactory) {
-        RedisTemplate<String, Boolean> template = new RedisTemplate<>();
-        template.setConnectionFactory(connectionFactory);
-
-        // 使用StringRedisSerializer来序列化和反序列化redis的key值
-        template.setKeySerializer(new StringRedisSerializer());
-        template.setValueSerializer(new GenericToStringSerializer<>(Boolean.class));
-
-        // Hash的key也采用StringRedisSerializer的序列化方式
-        template.setHashKeySerializer(new StringRedisSerializer());
-        template.setHashValueSerializer(new GenericToStringSerializer<>(Boolean.class));
-
-        template.afterPropertiesSet();
-        return template;
-    }
-    @Bean
-    public RedisTemplate<String, Integer> redisTemplateForInteger(RedisConnectionFactory connectionFactory) {
-        RedisTemplate<String, Integer> template = new RedisTemplate<>();
-        template.setConnectionFactory(connectionFactory);
-
-        // 使用StringRedisSerializer来序列化和反序列化redis的key值
-        template.setKeySerializer(new StringRedisSerializer());
-
-        // 使用GenericToStringSerializer保证BigDecimal精度不丢失
-        template.setValueSerializer(new GenericToStringSerializer<>(Integer.class));
-
-        // Hash的key也采用StringRedisSerializer的序列化方式
-        template.setHashKeySerializer(new StringRedisSerializer());
-        template.setHashValueSerializer(new GenericToStringSerializer<>(Integer.class));
-
-        template.afterPropertiesSet();
-        return template;
-    }
-    @Bean
-    @SuppressWarnings(value = { "unchecked", "rawtypes" })
-    public RedisTemplate<String, Object> redisTemplateForObject(RedisConnectionFactory connectionFactory) {
-        RedisTemplate<String, Object> template = new RedisTemplate<>();
-        template.setConnectionFactory(connectionFactory);
-
-        FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class);
-
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
-        mapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
-        serializer.setObjectMapper(mapper);
-
-        // 使用StringRedisSerializer来序列化和反序列化redis的key值
-        template.setKeySerializer(new StringRedisSerializer());
-        template.setValueSerializer(serializer);
-
-        // Hash的key也采用StringRedisSerializer的序列化方式
-        template.setHashKeySerializer(new StringRedisSerializer());
-        template.setHashValueSerializer(serializer);
-
-        template.afterPropertiesSet();
-        return template;
-    }
-
-    @Bean
-    public RedisTemplate<String, BigDecimal> redisTemplateForBigDecimal(RedisConnectionFactory connectionFactory) {
-        RedisTemplate<String, BigDecimal> template = new RedisTemplate<>();
-        template.setConnectionFactory(connectionFactory);
-
-        // 使用StringRedisSerializer来序列化和反序列化redis的key值
-        template.setKeySerializer(new StringRedisSerializer());
-
-        // 使用GenericToStringSerializer保证BigDecimal精度不丢失
-        template.setValueSerializer(new GenericToStringSerializer<>(BigDecimal.class));
-
-        // Hash的key也采用StringRedisSerializer的序列化方式
-        template.setHashKeySerializer(new StringRedisSerializer());
-        template.setHashValueSerializer(new GenericToStringSerializer<>(BigDecimal.class));
-
-        template.afterPropertiesSet();
-        return template;
-    }
-
-    @Bean
-    public DefaultRedisScript<Long> limitScript()
-    {
-        DefaultRedisScript<Long> redisScript = new DefaultRedisScript<>();
-        redisScript.setScriptText(limitScriptText());
-        redisScript.setResultType(Long.class);
-        return redisScript;
-    }
-
-    /**
-     * 限流脚本
-     */
-    private String limitScriptText()
-    {
-        return "local key = KEYS[1]\n" +
-                "local count = tonumber(ARGV[1])\n" +
-                "local time = tonumber(ARGV[2])\n" +
-                "local current = redis.call('get', key);\n" +
-                "if current and tonumber(current) > count then\n" +
-                "    return current;\n" +
-                "end\n" +
-                "current = redis.call('incr', key)\n" +
-                "if tonumber(current) == 1 then\n" +
-                "    redis.call('expire', key, time)\n" +
-                "end\n" +
-                "return current;";
-    }
-}

+ 0 - 65
fs-hospital/src/main/java/com/fs/framework/config/ResourcesConfig.java

@@ -1,65 +0,0 @@
-package com.fs.framework.config;
-
-import com.fs.framework.interceptor.RepeatSubmitInterceptor;
-import com.fs.common.config.FSConfig;
-import com.fs.common.constant.Constants;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.cors.CorsConfiguration;
-import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
-import org.springframework.web.filter.CorsFilter;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-/**
- * 通用配置
- *
-
- */
-@Configuration
-public class ResourcesConfig implements WebMvcConfigurer
-{
-    @Autowired
-    private RepeatSubmitInterceptor repeatSubmitInterceptor;
-
-    @Override
-    public void addResourceHandlers(ResourceHandlerRegistry registry)
-    {
-        /** 本地文件上传路径 */
-        registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + FSConfig.getProfile() + "/");
-
-        /** swagger配置 */
-        registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
-    }
-
-    /**
-     * 自定义拦截规则
-     */
-    @Override
-    public void addInterceptors(InterceptorRegistry registry)
-    {
-        registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**");
-    }
-
-    /**
-     * 跨域配置
-     */
-    @Bean
-    public CorsFilter corsFilter()
-    {
-        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
-        CorsConfiguration config = new CorsConfiguration();
-        config.setAllowCredentials(true);
-        // 设置访问源地址
-        config.addAllowedOrigin("*");
-        // 设置访问源请求头
-        config.addAllowedHeader("*");
-        // 设置访问源请求方法
-        config.addAllowedMethod("*");
-        // 对接口配置跨域设置
-        source.registerCorsConfiguration("/**", config);
-        return new CorsFilter(source);
-    }
-}

+ 0 - 153
fs-hospital/src/main/java/com/fs/framework/config/SecurityConfig.java

@@ -1,153 +0,0 @@
-package com.fs.framework.config;
-
-
-import com.fs.framework.security.filter.JwtAuthenticationTokenFilter;
-import com.fs.framework.security.handle.AuthenticationEntryPointImpl;
-import com.fs.framework.security.handle.LogoutSuccessHandlerImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.http.HttpMethod;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
-import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
-import org.springframework.security.config.http.SessionCreationPolicy;
-import org.springframework.security.core.userdetails.UserDetailsService;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
-import org.springframework.security.web.authentication.logout.LogoutFilter;
-import org.springframework.web.filter.CorsFilter;
-
-/**
- * spring security配置
- *
-
- */
-@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
-public class SecurityConfig extends WebSecurityConfigurerAdapter
-{
-    /**
-     * 自定义用户认证逻辑
-     */
-    @Autowired
-    private UserDetailsService userDetailsService;
-
-    /**
-     * 认证失败处理类
-     */
-    @Autowired
-    private AuthenticationEntryPointImpl unauthorizedHandler;
-
-    /**
-     * 退出处理类
-     */
-    @Autowired
-    private LogoutSuccessHandlerImpl logoutSuccessHandler;
-
-    /**
-     * token认证过滤器
-     */
-    @Autowired
-    private JwtAuthenticationTokenFilter authenticationTokenFilter;
-
-    /**
-     * 跨域过滤器
-     */
-    @Autowired
-    private CorsFilter corsFilter;
-
-    /**
-     * 解决 无法直接注入 AuthenticationManager
-     *
-     * @return
-     * @throws Exception
-     */
-    @Bean
-    @Override
-    public AuthenticationManager authenticationManagerBean() throws Exception
-    {
-        return super.authenticationManagerBean();
-    }
-
-    /**
-     * anyRequest          |   匹配所有请求路径
-     * access              |   SpringEl表达式结果为true时可以访问
-     * anonymous           |   匿名可以访问
-     * denyAll             |   用户不能访问
-     * fullyAuthenticated  |   用户完全认证可以访问(非remember-me下自动登录)
-     * hasAnyAuthority     |   如果有参数,参数表示权限,则其中任何一个权限可以访问
-     * hasAnyRole          |   如果有参数,参数表示角色,则其中任何一个角色可以访问
-     * hasAuthority        |   如果有参数,参数表示权限,则其权限可以访问
-     * hasIpAddress        |   如果有参数,参数表示IP地址,如果用户IP和参数匹配,则可以访问
-     * hasRole             |   如果有参数,参数表示角色,则其角色可以访问
-     * permitAll           |   用户可以任意访问
-     * rememberMe          |   允许通过remember-me登录的用户访问
-     * authenticated       |   用户登录后可访问
-     */
-    @Override
-    protected void configure(HttpSecurity httpSecurity) throws Exception
-    {
-        httpSecurity
-                // CSRF禁用,因为不使用session
-                .csrf().disable()
-                // 认证失败处理类
-                .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
-                // 基于token,所以不需要session
-                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
-                // 过滤请求
-                .authorizeRequests()
-                // 对于登录login 注册register 验证码captchaImage 允许匿名访问
-                .antMatchers("/login", "/register", "/captchaImage").anonymous()
-                .antMatchers(
-                        HttpMethod.GET,
-                        "/",
-                        "/*.html",
-                        "/**/*.html",
-                        "/**/*.css",
-                        "/**/*.js",
-                        "/profile/**"
-                ).permitAll()
-
-
-                .antMatchers("/common/getId**").anonymous()
-                .antMatchers("/common/uploadOSS**").anonymous()
-                .antMatchers("/common/uploadWang**").anonymous()
-                .antMatchers("/common/download**").anonymous()
-                .antMatchers("/common/download/resource**").anonymous()
-                .antMatchers("/swagger-ui.html").anonymous()
-                .antMatchers("/swagger-resources/**").anonymous()
-                .antMatchers("/webjars/**").anonymous()
-                .antMatchers("/*/api-docs").anonymous()
-                .antMatchers("/druid/**").anonymous()
-                // 除上面外的所有请求全部需要鉴权认证
-                .anyRequest().authenticated()
-                .and()
-                .headers().frameOptions().disable();
-        httpSecurity.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);
-        // 添加JWT filter
-        httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
-        // 添加CORS filter
-        httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class);
-        httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
-    }
-
-    /**
-     * 强散列哈希加密实现
-     */
-    @Bean
-    public BCryptPasswordEncoder bCryptPasswordEncoder()
-    {
-        return new BCryptPasswordEncoder();
-    }
-
-    /**
-     * 身份认证接口
-     */
-    @Override
-    protected void configure(AuthenticationManagerBuilder auth) throws Exception
-    {
-        auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
-    }
-}

+ 0 - 33
fs-hospital/src/main/java/com/fs/framework/config/ServerConfig.java

@@ -1,33 +0,0 @@
-package com.fs.framework.config;
-
-import com.fs.common.utils.ServletUtils;
-import org.springframework.stereotype.Component;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * 服务相关配置
- *
-
- */
-@Component
-public class ServerConfig
-{
-    /**
-     * 获取完整的请求路径,包括:域名,端口,上下文访问路径
-     *
-     * @return 服务地址
-     */
-    public String getUrl()
-    {
-        HttpServletRequest request = ServletUtils.getRequest();
-        return getDomain(request);
-    }
-
-    public static String getDomain(HttpServletRequest request)
-    {
-        StringBuffer url = request.getRequestURL();
-        String contextPath = request.getServletContext().getContextPath();
-        return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString();
-    }
-}

+ 0 - 63
fs-hospital/src/main/java/com/fs/framework/config/ThreadPoolConfig.java

@@ -1,63 +0,0 @@
-package com.fs.framework.config;
-
-import com.fs.common.utils.Threads;
-import org.apache.commons.lang3.concurrent.BasicThreadFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadPoolExecutor;
-
-/**
- * 线程池配置
- *
-
- **/
-@Configuration
-public class ThreadPoolConfig
-{
-    // 核心线程池大小
-    private int corePoolSize = 50;
-
-    // 最大可创建的线程数
-    private int maxPoolSize = 200;
-
-    // 队列最大长度
-    private int queueCapacity = 1000;
-
-    // 线程池维护线程所允许的空闲时间
-    private int keepAliveSeconds = 300;
-
-    @Bean(name = "threadPoolTaskExecutor")
-    public ThreadPoolTaskExecutor threadPoolTaskExecutor()
-    {
-        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
-        executor.setMaxPoolSize(maxPoolSize);
-        executor.setCorePoolSize(corePoolSize);
-        executor.setQueueCapacity(queueCapacity);
-        executor.setKeepAliveSeconds(keepAliveSeconds);
-        // 线程池对拒绝任务(无线程可用)的处理策略
-        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
-        return executor;
-    }
-
-    /**
-     * 执行周期性或定时任务
-     */
-    @Bean(name = "scheduledExecutorService")
-    protected ScheduledExecutorService scheduledExecutorService()
-    {
-        return new ScheduledThreadPoolExecutor(corePoolSize,
-                new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build())
-        {
-            @Override
-            protected void afterExecute(Runnable r, Throwable t)
-            {
-                super.afterExecute(r, t);
-                Threads.printException(r, t);
-            }
-        };
-    }
-}

+ 0 - 77
fs-hospital/src/main/java/com/fs/framework/config/properties/DruidProperties.java

@@ -1,77 +0,0 @@
-package com.fs.framework.config.properties;
-
-import com.alibaba.druid.pool.DruidDataSource;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * druid 配置属性
- *
-
- */
-@Configuration
-public class DruidProperties
-{
-    @Value("${spring.datasource.mysql.druid.initialSize}")
-    private int initialSize;
-
-    @Value("${spring.datasource.mysql.druid.minIdle}")
-    private int minIdle;
-
-    @Value("${spring.datasource.mysql.druid.maxActive}")
-    private int maxActive;
-
-    @Value("${spring.datasource.mysql.druid.maxWait}")
-    private int maxWait;
-
-    @Value("${spring.datasource.mysql.druid.timeBetweenEvictionRunsMillis}")
-    private int timeBetweenEvictionRunsMillis;
-
-    @Value("${spring.datasource.mysql.druid.minEvictableIdleTimeMillis}")
-    private int minEvictableIdleTimeMillis;
-
-    @Value("${spring.datasource.mysql.druid.maxEvictableIdleTimeMillis}")
-    private int maxEvictableIdleTimeMillis;
-
-    @Value("${spring.datasource.mysql.druid.validationQuery}")
-    private String validationQuery;
-
-    @Value("${spring.datasource.mysql.druid.testWhileIdle}")
-    private boolean testWhileIdle;
-
-    @Value("${spring.datasource.mysql.druid.testOnBorrow}")
-    private boolean testOnBorrow;
-
-    @Value("${spring.datasource.mysql.druid.testOnReturn}")
-    private boolean testOnReturn;
-
-    public DruidDataSource dataSource(DruidDataSource datasource)
-    {
-        /** 配置初始化大小、最小、最大 */
-        datasource.setInitialSize(initialSize);
-        datasource.setMaxActive(maxActive);
-        datasource.setMinIdle(minIdle);
-
-        /** 配置获取连接等待超时的时间 */
-        datasource.setMaxWait(maxWait);
-
-        /** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */
-        datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
-
-        /** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */
-        datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
-        datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis);
-
-        /**
-         * 用来检测连接是否有效的sql,要求是一个查询语句,常用select 'x'。如果validationQuery为null,testOnBorrow、testOnReturn、testWhileIdle都不会起作用。
-         */
-        datasource.setValidationQuery(validationQuery);
-        /** 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。 */
-        datasource.setTestWhileIdle(testWhileIdle);
-        /** 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
-        datasource.setTestOnBorrow(testOnBorrow);
-        /** 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。 */
-        datasource.setTestOnReturn(testOnReturn);
-        return datasource;
-    }
-}

+ 0 - 28
fs-hospital/src/main/java/com/fs/framework/datasource/DynamicDataSource.java

@@ -1,28 +0,0 @@
-package com.fs.framework.datasource;
-
-import com.fs.framework.datasource.DynamicDataSourceContextHolder;
-import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
-
-import javax.sql.DataSource;
-import java.util.Map;
-
-/**
- * 动态数据源
- *
-
- */
-public class DynamicDataSource extends AbstractRoutingDataSource
-{
-    public DynamicDataSource(DataSource defaultTargetDataSource, Map<Object, Object> targetDataSources)
-    {
-        super.setDefaultTargetDataSource(defaultTargetDataSource);
-        super.setTargetDataSources(targetDataSources);
-        super.afterPropertiesSet();
-    }
-
-    @Override
-    protected Object determineCurrentLookupKey()
-    {
-        return DynamicDataSourceContextHolder.getDataSourceType();
-    }
-}

+ 0 - 45
fs-hospital/src/main/java/com/fs/framework/datasource/DynamicDataSourceContextHolder.java

@@ -1,45 +0,0 @@
-package com.fs.framework.datasource;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 数据源切换处理
- *
-
- */
-public class DynamicDataSourceContextHolder
-{
-    public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class);
-
-    /**
-     * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本,
-     *  所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。
-     */
-    private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
-
-    /**
-     * 设置数据源的变量
-     */
-    public static void setDataSourceType(String dsType)
-    {
-//        log.info("切换到{}数据源", dsType);
-        CONTEXT_HOLDER.set(dsType);
-    }
-
-    /**
-     * 获得数据源的变量
-     */
-    public static String getDataSourceType()
-    {
-        return CONTEXT_HOLDER.get();
-    }
-
-    /**
-     * 清空数据源变量
-     */
-    public static void clearDataSourceType()
-    {
-        CONTEXT_HOLDER.remove();
-    }
-}

+ 0 - 115
fs-hospital/src/main/java/com/fs/framework/exception/GlobalExceptionHandler.java

@@ -1,115 +0,0 @@
-package com.fs.framework.exception;
-
-import com.fs.common.constant.HttpStatus;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.exception.DemoModeException;
-import com.fs.common.exception.ServiceException;
-import com.fs.common.utils.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.security.access.AccessDeniedException;
-import org.springframework.validation.BindException;
-import org.springframework.web.HttpRequestMethodNotSupportedException;
-import org.springframework.web.bind.MethodArgumentNotValidException;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.RestControllerAdvice;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * 全局异常处理器
- *
-
- */
-@RestControllerAdvice
-public class GlobalExceptionHandler
-{
-    private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
-
-    /**
-     * 权限校验异常
-     */
-    @ExceptionHandler(AccessDeniedException.class)
-    public AjaxResult handleAccessDeniedException(AccessDeniedException e, HttpServletRequest request)
-    {
-        String requestURI = request.getRequestURI();
-        log.error("请求地址'{}',权限校验失败'{}'", requestURI, e.getMessage());
-        return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
-    }
-
-    /**
-     * 请求方式不支持
-     */
-    @ExceptionHandler(HttpRequestMethodNotSupportedException.class)
-    public AjaxResult handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e,
-            HttpServletRequest request)
-    {
-        String requestURI = request.getRequestURI();
-        log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod());
-        return AjaxResult.error(e.getMessage());
-    }
-
-    /**
-     * 业务异常
-     */
-    @ExceptionHandler(ServiceException.class)
-    public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request)
-    {
-        log.error(e.getMessage(), e);
-        Integer code = e.getCode();
-        return StringUtils.isNotNull(code) ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage());
-    }
-
-    /**
-     * 拦截未知的运行时异常
-     */
-    @ExceptionHandler(RuntimeException.class)
-    public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request)
-    {
-        String requestURI = request.getRequestURI();
-        log.error("请求地址'{}',发生未知异常.", requestURI, e);
-        return AjaxResult.error(e.getMessage());
-    }
-
-    /**
-     * 系统异常
-     */
-    @ExceptionHandler(Exception.class)
-    public AjaxResult handleException(Exception e, HttpServletRequest request)
-    {
-        String requestURI = request.getRequestURI();
-        log.error("请求地址'{}',发生系统异常.", requestURI, e);
-        return AjaxResult.error(e.getMessage());
-    }
-
-    /**
-     * 自定义验证异常
-     */
-    @ExceptionHandler(BindException.class)
-    public AjaxResult handleBindException(BindException e)
-    {
-        log.error(e.getMessage(), e);
-        String message = e.getAllErrors().get(0).getDefaultMessage();
-        return AjaxResult.error(message);
-    }
-
-    /**
-     * 自定义验证异常
-     */
-    @ExceptionHandler(MethodArgumentNotValidException.class)
-    public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e)
-    {
-        log.error(e.getMessage(), e);
-        String message = e.getBindingResult().getFieldError().getDefaultMessage();
-        return AjaxResult.error(message);
-    }
-
-    /**
-     * 演示模式异常
-     */
-    @ExceptionHandler(DemoModeException.class)
-    public AjaxResult handleDemoModeException(DemoModeException e)
-    {
-        return AjaxResult.error("演示模式,不允许操作");
-    }
-}

+ 0 - 56
fs-hospital/src/main/java/com/fs/framework/interceptor/RepeatSubmitInterceptor.java

@@ -1,56 +0,0 @@
-package com.fs.framework.interceptor;
-
-import com.alibaba.fastjson.JSONObject;
-import com.fs.common.annotation.RepeatSubmit;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.utils.ServletUtils;
-import org.springframework.stereotype.Component;
-import org.springframework.web.method.HandlerMethod;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.lang.reflect.Method;
-
-/**
- * 防止重复提交拦截器
- *
-
- */
-@Component
-public abstract class RepeatSubmitInterceptor extends HandlerInterceptorAdapter
-{
-    @Override
-    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
-    {
-        if (handler instanceof HandlerMethod)
-        {
-            HandlerMethod handlerMethod = (HandlerMethod) handler;
-            Method method = handlerMethod.getMethod();
-            RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
-            if (annotation != null)
-            {
-                if (this.isRepeatSubmit(request))
-                {
-                    AjaxResult ajaxResult = AjaxResult.error("不允许重复提交,请稍后再试");
-                    ServletUtils.renderString(response, JSONObject.toJSONString(ajaxResult));
-                    return false;
-                }
-            }
-            return true;
-        }
-        else
-        {
-            return super.preHandle(request, response, handler);
-        }
-    }
-
-    /**
-     * 验证是否重复提交由子类实现具体的防重复提交的规则
-     *
-     * @param request
-     * @return
-     * @throws Exception
-     */
-    public abstract boolean isRepeatSubmit(HttpServletRequest request);
-}

+ 0 - 126
fs-hospital/src/main/java/com/fs/framework/interceptor/impl/SameUrlDataInterceptor.java

@@ -1,126 +0,0 @@
-package com.fs.framework.interceptor.impl;
-
-import com.alibaba.fastjson.JSONObject;
-import com.fs.framework.interceptor.RepeatSubmitInterceptor;
-import com.fs.common.constant.Constants;
-import com.fs.common.core.redis.RedisCache;
-import com.fs.common.filter.RepeatedlyRequestWrapper;
-import com.fs.common.utils.StringUtils;
-import com.fs.common.utils.http.HttpHelper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 判断请求url和数据是否和上一次相同,
- * 如果和上次相同,则是重复提交表单。 有效时间为10秒内。
- *
-
- */
-@Component
-public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
-{
-    public final String REPEAT_PARAMS = "repeatParams";
-
-    public final String REPEAT_TIME = "repeatTime";
-
-    // 令牌自定义标识
-    @Value("${token.header}")
-    private String header;
-
-    @Autowired
-    private RedisCache redisCache;
-
-    /**
-     * 间隔时间,单位:秒 默认10秒
-     *
-     * 两次相同参数的请求,如果间隔时间大于该参数,系统不会认定为重复提交的数据
-     */
-    private int intervalTime = 10;
-
-    public void setIntervalTime(int intervalTime)
-    {
-        this.intervalTime = intervalTime;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public boolean isRepeatSubmit(HttpServletRequest request)
-    {
-        String nowParams = "";
-        if (request instanceof RepeatedlyRequestWrapper)
-        {
-            RepeatedlyRequestWrapper repeatedlyRequest = (RepeatedlyRequestWrapper) request;
-            nowParams = HttpHelper.getBodyString(repeatedlyRequest);
-        }
-
-        // body参数为空,获取Parameter的数据
-        if (StringUtils.isEmpty(nowParams))
-        {
-            nowParams = JSONObject.toJSONString(request.getParameterMap());
-        }
-        Map<String, Object> nowDataMap = new HashMap<String, Object>();
-        nowDataMap.put(REPEAT_PARAMS, nowParams);
-        nowDataMap.put(REPEAT_TIME, System.currentTimeMillis());
-
-        // 请求地址(作为存放cache的key值)
-        String url = request.getRequestURI();
-
-        // 唯一值(没有消息头则使用请求地址)
-        String submitKey = request.getHeader(header);
-        if (StringUtils.isEmpty(submitKey))
-        {
-            submitKey = url;
-        }
-
-        // 唯一标识(指定key + 消息头)
-        String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + submitKey;
-
-        Object sessionObj = redisCache.getCacheObject(cacheRepeatKey);
-        if (sessionObj != null)
-        {
-            Map<String, Object> sessionMap = (Map<String, Object>) sessionObj;
-            if (sessionMap.containsKey(url))
-            {
-                Map<String, Object> preDataMap = (Map<String, Object>) sessionMap.get(url);
-                if (compareParams(nowDataMap, preDataMap) && compareTime(nowDataMap, preDataMap))
-                {
-                    return true;
-                }
-            }
-        }
-        Map<String, Object> cacheMap = new HashMap<String, Object>();
-        cacheMap.put(url, nowDataMap);
-        redisCache.setCacheObject(cacheRepeatKey, cacheMap, intervalTime, TimeUnit.SECONDS);
-        return false;
-    }
-
-    /**
-     * 判断参数是否相同
-     */
-    private boolean compareParams(Map<String, Object> nowMap, Map<String, Object> preMap)
-    {
-        String nowParams = (String) nowMap.get(REPEAT_PARAMS);
-        String preParams = (String) preMap.get(REPEAT_PARAMS);
-        return nowParams.equals(preParams);
-    }
-
-    /**
-     * 判断两次间隔时间
-     */
-    private boolean compareTime(Map<String, Object> nowMap, Map<String, Object> preMap)
-    {
-        long time1 = (Long) nowMap.get(REPEAT_TIME);
-        long time2 = (Long) preMap.get(REPEAT_TIME);
-        if ((time1 - time2) < (this.intervalTime * 1000))
-        {
-            return true;
-        }
-        return false;
-    }
-}

+ 0 - 56
fs-hospital/src/main/java/com/fs/framework/manager/AsyncManager.java

@@ -1,56 +0,0 @@
-package com.fs.framework.manager;
-
-import com.fs.common.utils.Threads;
-import com.fs.common.utils.spring.SpringUtils;
-
-import java.util.TimerTask;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 异步任务管理器
- *
-
- */
-public class AsyncManager
-{
-    /**
-     * 操作延迟10毫秒
-     */
-    private final int OPERATE_DELAY_TIME = 10;
-
-    /**
-     * 异步操作任务调度线程池
-     */
-    private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService");
-
-    /**
-     * 单例模式
-     */
-    private AsyncManager(){}
-
-    private static AsyncManager me = new AsyncManager();
-
-    public static AsyncManager me()
-    {
-        return me;
-    }
-
-    /**
-     * 执行任务
-     *
-     * @param task 任务
-     */
-    public void execute(TimerTask task)
-    {
-        executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS);
-    }
-
-    /**
-     * 停止任务线程池
-     */
-    public void shutdown()
-    {
-        Threads.shutdownAndAwaitTermination(executor);
-    }
-}

+ 0 - 40
fs-hospital/src/main/java/com/fs/framework/manager/ShutdownManager.java

@@ -1,40 +0,0 @@
-package com.fs.framework.manager;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PreDestroy;
-
-/**
- * 确保应用退出时能关闭后台线程
- *
-
- */
-@Component
-public class ShutdownManager
-{
-    private static final Logger logger = LoggerFactory.getLogger("sys-user");
-
-    @PreDestroy
-    public void destroy()
-    {
-        shutdownAsyncManager();
-    }
-
-    /**
-     * 停止异步执行任务
-     */
-    private void shutdownAsyncManager()
-    {
-        try
-        {
-            logger.info("====关闭后台任务任务线程池====");
-            AsyncManager.me().shutdown();
-        }
-        catch (Exception e)
-        {
-            logger.error(e.getMessage(), e);
-        }
-    }
-}

+ 0 - 112
fs-hospital/src/main/java/com/fs/framework/manager/factory/AsyncFactory.java

@@ -1,112 +0,0 @@
-package com.fs.framework.manager.factory;
-
-import com.fs.common.constant.Constants;
-import com.fs.common.utils.LogUtils;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.ip.AddressUtils;
-import com.fs.common.utils.ip.IpUtils;
-import com.fs.common.utils.spring.SpringUtils;
-import com.fs.company.domain.CompanyLogininfor;
-import com.fs.company.domain.CompanyOperLog;
-import com.fs.company.service.ICompanyLogininforService;
-import com.fs.company.service.ICompanyOperLogService;
-import com.fs.hospital.domain.Hospital;
-import com.fs.hospital.domain.HospitalLogininfor;
-import com.fs.hospital.domain.HospitalOperLog;
-import com.fs.hospital.service.IHospitalLogininforService;
-import com.fs.hospital.service.IHospitalOperLogService;
-import eu.bitwalker.useragentutils.UserAgent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Date;
-import java.util.TimerTask;
-
-/**
- * 异步工厂(产生任务用)
- *
-
- */
-public class AsyncFactory
-{
-    private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user");
-
-    /**
-     * 记录登录信息
-     *
-     * @param username 用户名
-     * @param status 状态
-     * @param message 消息
-     * @param args 列表
-     * @return 任务task
-     */
-    public static TimerTask recordLogininfor(final Long hospitalId,final String username, final String status, final String message,
-            final Object... args)
-    {
-        final UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
-        final String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
-        return new TimerTask()
-        {
-            @Override
-            public void run()
-            {
-                String address = AddressUtils.getRealAddressByIP(ip);
-                StringBuilder s = new StringBuilder();
-                s.append(LogUtils.getBlock(ip));
-                s.append(address);
-                s.append(LogUtils.getBlock(username));
-                s.append(LogUtils.getBlock(status));
-                s.append(LogUtils.getBlock(message));
-                // 打印信息到日志
-                sys_user_logger.info(s.toString(), args);
-                // 获取客户端操作系统
-                String os = userAgent.getOperatingSystem().getName();
-                // 获取客户端浏览器
-                String browser = userAgent.getBrowser().getName();
-                // 封装对象
-                HospitalLogininfor logininfor = new HospitalLogininfor();
-                logininfor.setInfoId(hospitalId);
-                logininfor.setUserName(username);
-                logininfor.setIpaddr(ip);
-                logininfor.setLoginLocation(address);
-                logininfor.setBrowser(browser);
-                logininfor.setOs(os);
-                logininfor.setMsg(message);
-                // 日志状态
-                if (Constants.LOGIN_SUCCESS.equals(status) || Constants.LOGOUT.equals(status))
-                {
-                    logininfor.setStatus(Constants.SUCCESS);
-                }
-                else if (Constants.LOGIN_FAIL.equals(status))
-                {
-                    logininfor.setStatus(Constants.FAIL);
-                }
-                logininfor.setLoginTime(new Date());
-                // 插入数据
-                SpringUtils.getBean(IHospitalLogininforService.class).insertHospitalLogininfor(logininfor);
-            }
-        };
-
-    }
-
-    /**
-     * 操作日志记录
-     *
-     * @param operLog 操作日志信息
-     * @return 任务task
-     */
-    public static TimerTask recordOper(final HospitalOperLog operLog)
-    {
-        return new TimerTask()
-        {
-            @Override
-            public void run()
-            {
-                // 远程查询操作地点
-                operLog.setOperTime(new Date());
-                operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
-                SpringUtils.getBean(IHospitalOperLogService.class).insertHospitalOperLog(operLog);
-            }
-        };
-    }
-}

+ 0 - 69
fs-hospital/src/main/java/com/fs/framework/security/LoginBody.java

@@ -1,69 +0,0 @@
-package com.fs.framework.security;
-
-/**
- * 用户登录对象
- *
-
- */
-public class LoginBody
-{
-    /**
-     * 用户名
-     */
-    private String username;
-
-    /**
-     * 用户密码
-     */
-    private String password;
-
-    /**
-     * 验证码
-     */
-    private String code;
-
-    /**
-     * 唯一标识
-     */
-    private String uuid = "";
-
-    public String getUsername()
-    {
-        return username;
-    }
-
-    public void setUsername(String username)
-    {
-        this.username = username;
-    }
-
-    public String getPassword()
-    {
-        return password;
-    }
-
-    public void setPassword(String password)
-    {
-        this.password = password;
-    }
-
-    public String getCode()
-    {
-        return code;
-    }
-
-    public void setCode(String code)
-    {
-        this.code = code;
-    }
-
-    public String getUuid()
-    {
-        return uuid;
-    }
-
-    public void setUuid(String uuid)
-    {
-        this.uuid = uuid;
-    }
-}

+ 0 - 266
fs-hospital/src/main/java/com/fs/framework/security/LoginUser.java

@@ -1,266 +0,0 @@
-package com.fs.framework.security;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fs.company.domain.Company;
-import com.fs.company.domain.CompanyRole;
-import com.fs.company.domain.CompanyUser;
-import com.fs.hospital.domain.Hospital;
-import com.fs.hospital.domain.HospitalRole;
-import com.fs.hospital.domain.HospitalUser;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.userdetails.UserDetails;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-/**
- * 登录用户身份权限
- *
-
- */
-public class LoginUser implements UserDetails
-{
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 用户唯一标识
-     */
-    private String token;
-
-    /**
-     * 登录时间
-     */
-    private Long loginTime;
-
-    /**
-     * 过期时间
-     */
-    private Long expireTime;
-
-    /**
-     * 登录IP地址
-     */
-    private String ipaddr;
-
-    /**
-     * 登录地点
-     */
-    private String loginLocation;
-
-    /**
-     * 浏览器类型
-     */
-    private String browser;
-
-    /**
-     * 操作系统
-     */
-    private String os;
-
-
-
-    /**
-     * 权限列表
-     */
-    private Set<String> permissions;
-
-    /**
-     * 用户信息
-     */
-    private HospitalUser user;
-
-    private Hospital hospital;
-
-    private List<HospitalRole> roles;
-
-    public static long getSerialVersionUID() {
-        return serialVersionUID;
-    }
-
-
-    public Hospital getHospital() {
-        return hospital;
-    }
-
-    public void setHospital(Hospital hospital) {
-        this.hospital = hospital;
-    }
-
-    public String getToken()
-    {
-        return token;
-    }
-
-    public void setToken(String token)
-    {
-        this.token = token;
-    }
-
-    public LoginUser()
-    {
-    }
-    public LoginUser(HospitalUser user, Set<String> permissions, Hospital hospital)
-    {
-        this.user = user;
-        this.permissions = permissions;
-        this.hospital=hospital;
-    }
-    public LoginUser(HospitalUser user, Set<String> permissions)
-    {
-        this.user = user;
-        this.permissions = permissions;
-    }
-
-    @JsonIgnore
-    @Override
-    public String getPassword()
-    {
-        return user.getPassword();
-    }
-
-    @Override
-    public String getUsername()
-    {
-        return user.getUserName();
-    }
-
-    /**
-     * 账户是否未过期,过期无法验证
-     */
-    @JsonIgnore
-    @Override
-    public boolean isAccountNonExpired()
-    {
-        return true;
-    }
-
-    /**
-     * 指定用户是否解锁,锁定的用户无法进行身份验证
-     *
-     * @return
-     */
-    @JsonIgnore
-    @Override
-    public boolean isAccountNonLocked()
-    {
-        return true;
-    }
-
-    /**
-     * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证
-     *
-     * @return
-     */
-    @JsonIgnore
-    @Override
-    public boolean isCredentialsNonExpired()
-    {
-        return true;
-    }
-
-    /**
-     * 是否可用 ,禁用的用户不能身份验证
-     *
-     * @return
-     */
-    @JsonIgnore
-    @Override
-    public boolean isEnabled()
-    {
-        return true;
-    }
-
-    public Long getLoginTime()
-    {
-        return loginTime;
-    }
-
-    public void setLoginTime(Long loginTime)
-    {
-        this.loginTime = loginTime;
-    }
-
-    public String getIpaddr()
-    {
-        return ipaddr;
-    }
-
-    public void setIpaddr(String ipaddr)
-    {
-        this.ipaddr = ipaddr;
-    }
-
-    public String getLoginLocation()
-    {
-        return loginLocation;
-    }
-
-    public void setLoginLocation(String loginLocation)
-    {
-        this.loginLocation = loginLocation;
-    }
-
-    public String getBrowser()
-    {
-        return browser;
-    }
-
-    public void setBrowser(String browser)
-    {
-        this.browser = browser;
-    }
-
-    public String getOs()
-    {
-        return os;
-    }
-
-    public void setOs(String os)
-    {
-        this.os = os;
-    }
-
-    public Long getExpireTime()
-    {
-        return expireTime;
-    }
-
-    public void setExpireTime(Long expireTime)
-    {
-        this.expireTime = expireTime;
-    }
-
-    public Set<String> getPermissions()
-    {
-        return permissions;
-    }
-
-    public void setPermissions(Set<String> permissions)
-    {
-        this.permissions = permissions;
-    }
-
-    public HospitalUser getUser()
-    {
-        return user;
-    }
-    public List<HospitalRole> getRoles() {
-        return roles;
-    }
-
-    public void setRoles(List<HospitalRole> roles) {
-        this.roles = roles;
-    }
-
-    public void setUser(HospitalUser user)
-    {
-        this.user = user;
-    }
-
-    @Override
-    public Collection<? extends GrantedAuthority> getAuthorities()
-    {
-        return null;
-    }
-}

+ 0 - 89
fs-hospital/src/main/java/com/fs/framework/security/SecurityUtils.java

@@ -1,89 +0,0 @@
-package com.fs.framework.security;
-
-import com.fs.common.constant.HttpStatus;
-import com.fs.common.exception.CustomException;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-
-/**
- * 安全服务工具类
- *
-
- */
-public class SecurityUtils
-{
-    /**
-     * 获取用户账户
-     **/
-    public static String getUsername()
-    {
-        try
-        {
-            return getLoginUser().getUsername();
-        }
-        catch (Exception e)
-        {
-            throw new CustomException("获取用户账户异常", HttpStatus.UNAUTHORIZED);
-        }
-    }
-
-    /**
-     * 获取用户
-     **/
-    public static LoginUser getLoginUser()
-    {
-        try
-        {
-            return (LoginUser) getAuthentication().getPrincipal();
-        }
-        catch (Exception e)
-        {
-            throw new CustomException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
-        }
-    }
-
-    /**
-     * 获取Authentication
-     */
-    public static Authentication getAuthentication()
-    {
-        return SecurityContextHolder.getContext().getAuthentication();
-    }
-
-    /**
-     * 生成BCryptPasswordEncoder密码
-     *
-     * @param password 密码
-     * @return 加密字符串
-     */
-    public static String encryptPassword(String password)
-    {
-        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
-        return passwordEncoder.encode(password);
-    }
-
-    /**
-     * 判断密码是否相同
-     *
-     * @param rawPassword 真实密码
-     * @param encodedPassword 加密后字符
-     * @return 结果
-     */
-    public static boolean matchesPassword(String rawPassword, String encodedPassword)
-    {
-        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
-        return passwordEncoder.matches(rawPassword, encodedPassword);
-    }
-
-    /**
-     * 是否为管理员
-     *
-     * @param userId 用户ID
-     * @return 结果
-     */
-    public static boolean isAdmin(Long userId)
-    {
-        return userId != null && 1L == userId;
-    }
-}

+ 0 - 49
fs-hospital/src/main/java/com/fs/framework/security/filter/JwtAuthenticationTokenFilter.java

@@ -1,49 +0,0 @@
-package com.fs.framework.security.filter;
-
-import com.fs.common.core.redis.RedisCache;
-import com.fs.common.utils.StringUtils;
-
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.security.SecurityUtils;
-import com.fs.framework.service.TokenService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
-import org.springframework.stereotype.Component;
-import org.springframework.web.filter.OncePerRequestFilter;
-
-import javax.servlet.FilterChain;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-/**
- * token过滤器 验证token有效性
- *
-
- */
-@Component
-public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
-{
-    @Autowired
-    private TokenService tokenService;
-    @Autowired
-    private RedisCache redisCache;
-    @Override
-    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
-            throws ServletException, IOException
-    {
-
-        LoginUser loginUser = tokenService.getLoginUser(request);
-        if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication()))
-        {
-            tokenService.verifyToken(loginUser);
-            UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities());
-            authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
-            SecurityContextHolder.getContext().setAuthentication(authenticationToken);
-        }
-        chain.doFilter(request, response);
-    }
-}

+ 0 - 35
fs-hospital/src/main/java/com/fs/framework/security/handle/AuthenticationEntryPointImpl.java

@@ -1,35 +0,0 @@
-package com.fs.framework.security.handle;
-
-import com.alibaba.fastjson.JSON;
-import com.fs.common.constant.HttpStatus;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
-import org.springframework.security.core.AuthenticationException;
-import org.springframework.security.web.AuthenticationEntryPoint;
-import org.springframework.stereotype.Component;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.Serializable;
-
-/**
- * 认证失败处理类 返回未授权
- *
-
- */
-@Component
-public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, Serializable
-{
-    private static final long serialVersionUID = -8970718410437077606L;
-
-    @Override
-    public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException e)
-            throws IOException
-    {
-        int code = HttpStatus.UNAUTHORIZED;
-        String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI());
-        ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg)));
-    }
-}

+ 0 - 55
fs-hospital/src/main/java/com/fs/framework/security/handle/LogoutSuccessHandlerImpl.java

@@ -1,55 +0,0 @@
-package com.fs.framework.security.handle;
-
-import com.alibaba.fastjson.JSON;
-import com.fs.common.constant.Constants;
-import com.fs.common.constant.HttpStatus;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
-
-import com.fs.framework.manager.AsyncManager;
-import com.fs.framework.manager.factory.AsyncFactory;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-/**
- * 自定义退出处理类 返回成功
- *
-
- */
-@Configuration
-public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
-{
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 退出处理
-     *
-     * @return
-     */
-    @Override
-    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
-            throws IOException, ServletException
-    {
-        LoginUser loginUser = tokenService.getLoginUser(request);
-        if (StringUtils.isNotNull(loginUser))
-        {
-            String userName = loginUser.getUsername();
-            // 删除用户缓存记录
-            tokenService.delLoginUser(loginUser.getToken());
-            // 记录用户退出日志
-            AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginUser.getHospital().getHospitalId(),userName, Constants.LOGOUT, "退出成功"));
-        }
-        ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(HttpStatus.SUCCESS, "退出成功")));
-    }
-}

+ 0 - 93
fs-hospital/src/main/java/com/fs/framework/service/HospitalLoginService.java

@@ -1,93 +0,0 @@
-package com.fs.framework.service;
-
-import com.fs.common.constant.Constants;
-import com.fs.common.core.redis.RedisCache;
-import com.fs.common.exception.ServiceException;
-import com.fs.common.exception.user.CaptchaException;
-import com.fs.common.exception.user.CaptchaExpireException;
-import com.fs.common.exception.user.UserPasswordNotMatchException;
-import com.fs.common.utils.MessageUtils;
-import com.fs.framework.manager.AsyncManager;
-import com.fs.framework.manager.factory.AsyncFactory;
-import com.fs.framework.security.LoginUser;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.authentication.BadCredentialsException;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.Authentication;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 登录校验方法
- *
-
- */
-@Component
-public class HospitalLoginService
-{
-    @Autowired
-    private TokenService tokenService;
-
-    @Resource
-    private AuthenticationManager authenticationManager;
-
-    @Autowired
-    private RedisCache redisCache;
-
-    /**
-     * 登录验证
-     *
-     * @param username 用户名
-     * @param password 密码
-     * @param code 验证码
-     * @param uuid 唯一标识
-     * @return 结果
-     */
-    public String login(String username, String password, String code, String uuid)
-    {
-        System.out.println("登录");
-        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
-        String captcha = redisCache.getCacheObject(verifyKey);
-        redisCache.deleteObject(verifyKey);
-        if (captcha == null)
-        {
-            AsyncManager.me().execute(AsyncFactory.recordLogininfor(0l,username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
-            throw new CaptchaExpireException();
-        }
-        if (!code.equalsIgnoreCase(captcha))
-        {
-            AsyncManager.me().execute(AsyncFactory.recordLogininfor(0l,username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
-            throw new CaptchaException();
-        }
-        // 用户验证
-        Authentication authentication = null;
-        try
-        {
-            // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
-            authentication = authenticationManager
-                    .authenticate(new UsernamePasswordAuthenticationToken(username, password));
-        }
-        catch (Exception e)
-        {
-            if (e instanceof BadCredentialsException)
-            {
-                AsyncManager.me().execute(AsyncFactory.recordLogininfor(0l,username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
-                throw new UserPasswordNotMatchException();
-            }
-            else
-            {
-                AsyncManager.me().execute(AsyncFactory.recordLogininfor(0l,username, Constants.LOGIN_FAIL, e.getMessage()));
-                throw new ServiceException(e.getMessage());
-            }
-        }
-        LoginUser loginUser = (LoginUser) authentication.getPrincipal();
-        AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginUser.getUser().getHospitalId(),username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
-        redisCache.setCacheObject("hospitalId:"+loginUser.getUser().getUserId(),loginUser.getUser().getHospitalId(),604800, TimeUnit.SECONDS);
-        // 生成token
-        return tokenService.createToken(loginUser);
-    }
-
-}

+ 0 - 69
fs-hospital/src/main/java/com/fs/framework/service/HospitalPermissionService.java

@@ -1,69 +0,0 @@
-package com.fs.framework.service;
-
-import com.fs.company.domain.CompanyUser;
-import com.fs.company.service.ICompanyMenuService;
-import com.fs.company.service.ICompanyRoleService;
-import com.fs.hospital.domain.HospitalUser;
-import com.fs.hospital.service.IHospitalMenuService;
-import com.fs.hospital.service.IHospitalRoleService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * 用户权限处理
- *
-
- */
-@Component
-public class HospitalPermissionService
-{
-    @Autowired
-    private IHospitalRoleService roleService;
-    @Autowired
-    private IHospitalMenuService menuService;
-
-    /**
-     * 获取角色数据权限
-     *
-     * @param user 用户信息
-     * @return 角色权限信息
-     */
-    public Set<String> getRolePermission(HospitalUser user)
-    {
-        Set<String> roles = new HashSet<String>();
-        // 管理员拥有所有权限
-        if (user.isAdmin())
-        {
-            roles.add("admin");
-        }
-        else
-        {
-            roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId()));
-        }
-        return roles;
-    }
-
-    /**
-     * 获取菜单数据权限
-     *
-     * @param user 用户信息
-     * @return 菜单权限信息
-     */
-    public Set<String> getMenuPermission(HospitalUser user)
-    {
-        Set<String> perms = new HashSet<String>();
-        // 管理员拥有所有权限
-        if (user.isAdmin())
-        {
-            perms.add("*:*:*");
-        }
-        else
-        {
-            perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId()));
-        }
-        return perms;
-    }
-}

+ 0 - 172
fs-hospital/src/main/java/com/fs/framework/service/PermissionService.java

@@ -1,172 +0,0 @@
-package com.fs.framework.service;
-
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
-import com.fs.company.domain.CompanyRole;
-import com.fs.framework.security.LoginUser;
-import com.fs.hospital.domain.HospitalRole;
-import com.fs.hospital.domain.HospitalUser;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import java.util.Set;
-
-/**
- * 自定义权限实现,ss取自SpringSecurity首字母
- */
-@Service("ss")
-public class PermissionService
-{
-    /** 所有权限标识 */
-    private static final String ALL_PERMISSION = "*:*:*";
-
-    /** 管理员角色权限标识 */
-    private static final String SUPER_ADMIN = "admin";
-
-    private static final String ROLE_DELIMETER = ",";
-
-    private static final String PERMISSION_DELIMETER = ",";
-
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 验证用户是否具备某权限
-     *
-     * @param permission 权限字符串
-     * @return 用户是否具备某权限
-     */
-    public boolean hasPermi(String permission)
-    {
-        if (StringUtils.isEmpty(permission))
-        {
-            return false;
-        }
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions()))
-        {
-            return false;
-        }
-        return hasPermissions(loginUser.getPermissions(), permission);
-    }
-
-    /**
-     * 验证用户是否不具备某权限,与 hasPermi逻辑相反
-     *
-     * @param permission 权限字符串
-     * @return 用户是否不具备某权限
-     */
-    public boolean lacksPermi(String permission)
-    {
-        return hasPermi(permission) != true;
-    }
-
-    /**
-     * 验证用户是否具有以下任意一个权限
-     *
-     * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表
-     * @return 用户是否具有以下任意一个权限
-     */
-    public boolean hasAnyPermi(String permissions)
-    {
-        if (StringUtils.isEmpty(permissions))
-        {
-            return false;
-        }
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getPermissions()))
-        {
-            return false;
-        }
-        Set<String> authorities = loginUser.getPermissions();
-        for (String permission : permissions.split(PERMISSION_DELIMETER))
-        {
-            if (permission != null && hasPermissions(authorities, permission))
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 判断用户是否拥有某个角色
-     *
-     * @param role 角色字符串
-     * @return 用户是否具备某角色
-     */
-    public boolean hasRole(String role)
-    {
-        if (StringUtils.isEmpty(role))
-        {
-            return false;
-        }
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles()))
-        {
-            return false;
-        }
-        for (HospitalRole sysRole : loginUser.getUser().getRoles())
-        {
-            String roleKey = sysRole.getRoleKey();
-            if (SUPER_ADMIN.contains(roleKey) || roleKey.contains(StringUtils.trim(role)))
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 验证用户是否不具备某角色,与 isRole逻辑相反。
-     *
-     * @param role 角色名称
-     * @return 用户是否不具备某角色
-     */
-    public boolean lacksRole(String role)
-    {
-        return hasRole(role) != true;
-    }
-
-    /**
-     * 验证用户是否具有以下任意一个角色
-     *
-     * @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表
-     * @return 用户是否具有以下任意一个角色
-     */
-    public boolean hasAnyRoles(String roles)
-    {
-        if (StringUtils.isEmpty(roles))
-        {
-            return false;
-        }
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles()))
-        {
-            return false;
-        }
-        for (String role : roles.split(ROLE_DELIMETER))
-        {
-            if (hasRole(role))
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 判断是否包含权限
-     *
-     * @param permissions 权限列表
-     * @param permission 权限字符串
-     * @return 用户是否具备某权限
-     */
-    private boolean hasPermissions(Set<String> permissions, String permission)
-    {
-        return permissions.contains(ALL_PERMISSION) || permissions.contains(StringUtils.trim(permission));
-    }
-
-
-}

+ 0 - 236
fs-hospital/src/main/java/com/fs/framework/service/TokenService.java

@@ -1,236 +0,0 @@
-package com.fs.framework.service;
-
-import com.fs.common.constant.Constants;
-import com.fs.common.core.redis.RedisCache;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
-import com.fs.common.utils.ip.AddressUtils;
-import com.fs.common.utils.ip.IpUtils;
-import com.fs.common.utils.uuid.IdUtils;
-import com.fs.framework.security.LoginUser;
-import eu.bitwalker.useragentutils.UserAgent;
-import io.jsonwebtoken.Claims;
-import io.jsonwebtoken.Jwts;
-import io.jsonwebtoken.SignatureAlgorithm;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-/**
- * token验证处理
- *
-
- */
-@Component
-public class TokenService
-{
-    // 令牌自定义标识
-    @Value("${token.header}")
-    private String header;
-
-    // 令牌秘钥
-    @Value("${token.secret}")
-    private String secret;
-
-    // 令牌有效期(默认30分钟)
-    @Value("${token.expireTime}")
-    private int expireTime;
-
-    protected static final long MILLIS_SECOND = 1000;
-
-    protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
-
-    private static final Long MILLIS_MINUTE_TEN = 20 * 60 * 100000000000L;
-
-    @Autowired
-    private RedisCache redisCache;
-
-    /**
-     * 获取用户身份信息
-     *
-     * @return 用户信息
-     */
-    public LoginUser getLoginUser(HttpServletRequest request)
-    {
-        // 获取请求携带的令牌
-        String token = getToken(request);
-        if (StringUtils.isNotEmpty(token))
-        {
-            Claims claims = parseToken(token);
-            // 解析对应的权限以及用户信息
-            String uuid = (String) claims.get(Constants.HOSPITAL_LOGIN_USER_KEY);
-            String userKey = getTokenKey(uuid);
-            LoginUser user = redisCache.getCacheObject(userKey);
-            return user;
-        }
-        token=getUrlToken(request);
-        if (StringUtils.isNotEmpty(token))
-        {
-            Claims claims = parseToken(token);
-            // 解析对应的权限以及用户信息
-            String uuid = (String) claims.get(Constants.HOSPITAL_LOGIN_USER_KEY);
-            String userKey = getTokenKey(uuid);
-            LoginUser user = redisCache.getCacheObject(userKey);
-            return user;
-        }
-
-        return null;
-    }
-
-    /**
-     * 设置用户身份信息
-     */
-    public void setLoginUser(LoginUser loginUser)
-    {
-        if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken()))
-        {
-            refreshToken(loginUser);
-        }
-    }
-
-    /**
-     * 删除用户身份信息
-     */
-    public void delLoginUser(String token)
-    {
-        if (StringUtils.isNotEmpty(token))
-        {
-            String userKey = getTokenKey(token);
-            redisCache.deleteObject(userKey);
-        }
-    }
-
-    /**
-     * 创建令牌
-     *
-     * @param loginUser 用户信息
-     * @return 令牌
-     */
-    public String createToken(LoginUser loginUser)
-    {
-        String token = IdUtils.fastUUID();
-        loginUser.setToken(token);
-        setUserAgent(loginUser);
-        refreshToken(loginUser);
-
-        Map<String, Object> claims = new HashMap<>();
-        claims.put(Constants.HOSPITAL_LOGIN_USER_KEY, token);
-        return createToken(claims);
-    }
-
-    /**
-     * 验证令牌有效期,相差不足20分钟,自动刷新缓存
-     *
-     * @param loginUser
-     * @return 令牌
-     */
-    public void verifyToken(LoginUser loginUser)
-    {
-        long expireTime = loginUser.getExpireTime();
-        long currentTime = System.currentTimeMillis();
-        if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
-        {
-            refreshToken(loginUser);
-        }
-    }
-
-    /**
-     * 刷新令牌有效期
-     *
-     * @param loginUser 登录信息
-     */
-    public void refreshToken(LoginUser loginUser)
-    {
-        loginUser.setLoginTime(System.currentTimeMillis());
-        loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE);
-        // 根据uuid将loginUser缓存
-        String userKey = getTokenKey(loginUser.getToken());
-        redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
-    }
-
-    /**
-     * 设置用户代理信息
-     *
-     * @param loginUser 登录信息
-     */
-    public void setUserAgent(LoginUser loginUser)
-    {
-        UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
-        String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
-        loginUser.setIpaddr(ip);
-        loginUser.setLoginLocation(AddressUtils.getRealAddressByIP(ip));
-        loginUser.setBrowser(userAgent.getBrowser().getName());
-        loginUser.setOs(userAgent.getOperatingSystem().getName());
-    }
-
-    /**
-     * 从数据声明生成令牌
-     *
-     * @param claims 数据声明
-     * @return 令牌
-     */
-    private String createToken(Map<String, Object> claims)
-    {
-        String token = Jwts.builder()
-                .setClaims(claims)
-                .signWith(SignatureAlgorithm.HS512, secret).compact();
-        return token;
-    }
-
-    /**
-     * 从令牌中获取数据声明
-     *
-     * @param token 令牌
-     * @return 数据声明
-     */
-    private Claims parseToken(String token)
-    {
-        return Jwts.parser()
-                .setSigningKey(secret)
-                .parseClaimsJws(token)
-                .getBody();
-    }
-
-    /**
-     * 从令牌中获取用户名
-     *
-     * @param token 令牌
-     * @return 用户名
-     */
-    public String getUsernameFromToken(String token)
-    {
-        Claims claims = parseToken(token);
-        return claims.getSubject();
-    }
-
-    /**
-     * 获取请求token
-     *
-     * @param request
-     * @return token
-     */
-    private String getToken(HttpServletRequest request)
-    {
-        String token = request.getHeader(header);
-        if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX))
-        {
-            token = token.replace(Constants.TOKEN_PREFIX, "");
-        }
-        return token;
-    }
-    private String getUrlToken(HttpServletRequest request)
-    {
-        String token = request.getParameter("token");
-        return token;
-    }
-
-    private String getTokenKey(String uuid)
-    {
-        return Constants.HOSPITAL_LOGIN_TOKEN_KEY + uuid;
-    }
-}

+ 0 - 77
fs-hospital/src/main/java/com/fs/framework/service/UserDetailsServiceImpl.java

@@ -1,77 +0,0 @@
-package com.fs.framework.service;
-
-
-import com.fs.common.enums.UserStatus;
-import com.fs.common.exception.CustomException;
-import com.fs.common.utils.StringUtils;
-import com.fs.company.domain.Company;
-import com.fs.company.domain.CompanyUser;
-import com.fs.framework.security.LoginUser;
-import com.fs.hospital.domain.Hospital;
-import com.fs.hospital.domain.HospitalUser;
-import com.fs.hospital.service.IHospitalService;
-import com.fs.hospital.service.IHospitalUserService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.security.core.userdetails.UserDetailsService;
-import org.springframework.security.core.userdetails.UsernameNotFoundException;
-import org.springframework.stereotype.Service;
-
-/**
- * 用户验证处理
- *
-
- */
-@Service
-public class UserDetailsServiceImpl implements UserDetailsService
-{
-    private static final Logger log = LoggerFactory.getLogger(UserDetailsServiceImpl.class);
-
-    @Autowired
-    private IHospitalUserService userService;
-
-    @Autowired
-    private HospitalPermissionService permissionService;
-
-    @Autowired
-    private IHospitalService hospitalService;
-
-
-
-
-    @Override
-    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
-    {
-
-
-        HospitalUser user = userService.selectUserByUserName(username);
-        if (StringUtils.isNull(user))
-        {
-            log.info("登录用户:{} 不存在.", username);
-            throw new UsernameNotFoundException("登录用户:" + username + " 不存在");
-        }
-        Hospital hospital=hospitalService.selectHospitalByHospitalId(user.getHospitalId()) ;
-        if(hospital==null||hospital.getStatus()==0||hospital.getIsDel()==1){
-            throw new CustomException("此用户所属公司不存在或已停用");
-        }
-        if (UserStatus.DELETED.getCode().equals(user.getIsDel()))
-        {
-            log.info("登录用户:{} 已被删除.", username);
-            throw new CustomException("对不起,您的账号:" + username + " 已被删除");
-        }
-        else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
-        {
-            log.info("登录用户:{} 已被停用.", username);
-            throw new CustomException("对不起,您的账号:" + username + " 已停用");
-        }
-
-        return createLoginUser(user);
-    }
-
-    public UserDetails createLoginUser(HospitalUser user)
-    {
-        return new LoginUser(user, permissionService.getMenuPermission(user),hospitalService.selectHospitalByHospitalId(user.getHospitalId()));
-    }
-}

+ 0 - 97
fs-hospital/src/main/java/com/fs/hospital/controller/common/CaptchaController.java

@@ -1,97 +0,0 @@
-package com.fs.hospital.controller.common;
-
-import com.fs.common.constant.Constants;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.redis.RedisCache;
-import com.fs.common.utils.sign.Base64;
-import com.fs.common.utils.uuid.IdUtils;
-import com.fs.system.service.ISysConfigService;
-import com.google.code.kaptcha.Producer;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.util.FastByteArrayOutputStream;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import javax.imageio.ImageIO;
-import javax.servlet.http.HttpServletResponse;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 验证码操作处理
- *
-
- */
-@RestController
-public class CaptchaController
-{
-    @Resource(name = "captchaProducer")
-    private Producer captchaProducer;
-
-    @Resource(name = "captchaProducerMath")
-    private Producer captchaProducerMath;
-
-    @Autowired
-    private RedisCache redisCache;
-
-    // 验证码类型
-    @Value("${fs.captchaType}")
-    private String captchaType;
-
-    @Autowired
-    private ISysConfigService configService;
-    /**
-     * 生成验证码
-     */
-    @GetMapping("/captchaImage")
-    public AjaxResult getCode(HttpServletResponse response) throws IOException
-    {
-        AjaxResult ajax = AjaxResult.success();
-        boolean captchaOnOff = configService.selectCaptchaOnOff();
-        ajax.put("captchaOnOff", captchaOnOff);
-        if (!captchaOnOff)
-        {
-            return ajax;
-        }
-
-        // 保存验证码信息
-        String uuid = IdUtils.simpleUUID();
-        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
-
-        String capStr = null, code = null;
-        BufferedImage image = null;
-
-        // 生成验证码
-        if ("math".equals(captchaType))
-        {
-            String capText = captchaProducerMath.createText();
-            capStr = capText.substring(0, capText.lastIndexOf("@"));
-            code = capText.substring(capText.lastIndexOf("@") + 1);
-            image = captchaProducerMath.createImage(capStr);
-        }
-        else if ("char".equals(captchaType))
-        {
-            capStr = code = captchaProducer.createText();
-            image = captchaProducer.createImage(capStr);
-        }
-
-        redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
-        // 转换流信息写出
-        FastByteArrayOutputStream os = new FastByteArrayOutputStream();
-        try
-        {
-            ImageIO.write(image, "jpg", os);
-        }
-        catch (IOException e)
-        {
-            return AjaxResult.error(e.getMessage());
-        }
-
-        ajax.put("uuid", uuid);
-        ajax.put("img", Base64.encode(os.toByteArray()));
-        return ajax;
-    }
-}

+ 0 - 176
fs-hospital/src/main/java/com/fs/hospital/controller/common/CommonController.java

@@ -1,176 +0,0 @@
-package com.fs.hospital.controller.common;
-
-import com.fs.common.config.FSConfig;
-import com.fs.common.constant.Constants;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.domain.R;
-import com.fs.common.exception.file.OssException;
-import com.fs.common.utils.StringUtils;
-import com.fs.common.utils.file.FileUploadUtils;
-import com.fs.common.utils.file.FileUtils;
-import com.fs.framework.config.ServerConfig;
-import com.fs.hospital.vo.WangUploadVO;
-import com.fs.system.oss.CloudStorageService;
-import com.fs.system.oss.OSSFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 通用请求处理
- *
-
- */
-@RestController
-public class CommonController
-{
-
-
-    private static final Logger log = LoggerFactory.getLogger(CommonController.class);
-
-    @Autowired
-    private ServerConfig serverConfig;
-
-    /**
-     * 通用下载请求
-     *
-     * @param fileName 文件名称
-     * @param delete 是否删除
-     */
-    @GetMapping("common/download")
-    public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
-    {
-        try
-        {
-            if (!FileUtils.checkAllowDownload(fileName))
-            {
-                throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
-            }
-            String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
-            String filePath = FSConfig.getDownloadPath() + fileName;
-
-            response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
-            FileUtils.setAttachmentResponseHeader(response, realFileName);
-            FileUtils.writeBytes(filePath, response.getOutputStream());
-            if (delete)
-            {
-                FileUtils.deleteFile(filePath);
-            }
-        }
-        catch (Exception e)
-        {
-            log.error("下载文件失败", e);
-        }
-    }
-
-    /**
-     * 通用上传请求
-     */
-    @PostMapping("/common/upload")
-    public AjaxResult uploadFile(MultipartFile file) throws Exception
-    {
-        try
-        {
-            // 上传文件路径
-            String filePath = FSConfig.getUploadPath();
-            // 上传并返回新文件名称
-            String fileName = FileUploadUtils.upload(filePath, file);
-            String url = serverConfig.getUrl() + fileName;
-            AjaxResult ajax = AjaxResult.success();
-            ajax.put("fileName", fileName);
-            ajax.put("url", url);
-            return ajax;
-        }
-        catch (Exception e)
-        {
-            return AjaxResult.error(e.getMessage());
-        }
-    }
-
-    /**
-     * 本地资源通用下载
-     */
-    @GetMapping("/common/download/resource")
-    public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
-            throws Exception
-    {
-        try
-        {
-            if (!FileUtils.checkAllowDownload(resource))
-            {
-                throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
-            }
-            // 本地资源路径
-            String localPath = FSConfig.getProfile();
-            // 数据库资源地址
-            String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
-            // 下载名称
-            String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
-            response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
-            FileUtils.setAttachmentResponseHeader(response, downloadName);
-            FileUtils.writeBytes(downloadPath, response.getOutputStream());
-        }
-        catch (Exception e)
-        {
-            log.error("下载文件失败", e);
-        }
-    }
-
-    @PostMapping("common/uploadOSS")
-    public R uploadOSS(@RequestParam("file") MultipartFile file) throws Exception
-    {
-        if (file.isEmpty())
-        {
-            throw new OssException("上传文件不能为空");
-        }
-        // 上传文件
-        String fileName = file.getOriginalFilename();
-        String suffix = fileName.substring(fileName.lastIndexOf("."));
-        CloudStorageService storage = OSSFactory.build();
-        String url = storage.uploadSuffix(file.getBytes(), suffix);
-        return R.ok().put("url",url);
-    }
-    @PostMapping("/common/uploadWang")
-    public WangUploadVO uploadWang(@RequestParam(value = "fileName", required = false) MultipartFile file) throws Exception
-    {
-        WangUploadVO vo=new WangUploadVO();
-        try
-        {
-            if (file.isEmpty())
-            {
-                throw new OssException("上传文件不能为空");
-            }
-            // 上传文件
-            String fileName = file.getOriginalFilename();
-            String suffix = fileName.substring(fileName.lastIndexOf("."));
-            CloudStorageService storage = OSSFactory.build();
-            String url = storage.uploadSuffix(file.getBytes(), suffix);
-            vo.setErrno(0);
-            List<WangUploadVO.WangUploadItem> items=new ArrayList<>();
-            WangUploadVO.WangUploadItem item=new WangUploadVO.WangUploadItem();
-            item.setUrl(url);
-            items.add(item);
-            vo.setData(items);
-            return vo;
-        }
-        catch (Exception e)
-        {
-            vo.setErrno(-1);
-            return vo;
-        }
-    }
-
-
-
-}

+ 0 - 132
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalConfigController.java

@@ -1,132 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.annotation.RepeatSubmit;
-import com.fs.common.utils.SecurityUtils;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.system.domain.SysConfig;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalConfig;
-import com.fs.hospital.service.IHospitalConfigService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 参数配置Controller
- *
- * @author fs
- * @date 2024-03-13
- */
-@RestController
-@RequestMapping("/hospital/hospitalConfig")
-public class HospitalConfigController extends BaseController
-{
-    @Autowired
-    private IHospitalConfigService hospitalConfigService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询参数配置列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalConfig:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalConfig hospitalConfig)
-    {
-        startPage();
-        List<HospitalConfig> list = hospitalConfigService.selectHospitalConfigList(hospitalConfig);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出参数配置列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalConfig:export')")
-    @Log(title = "参数配置", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalConfig hospitalConfig)
-    {
-        List<HospitalConfig> list = hospitalConfigService.selectHospitalConfigList(hospitalConfig);
-        ExcelUtil<HospitalConfig> util = new ExcelUtil<HospitalConfig>(HospitalConfig.class);
-        return util.exportExcel(list, "参数配置数据");
-    }
-
-    /**
-     * 获取参数配置详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalConfig:query')")
-    @GetMapping(value = "/{configId}")
-    public AjaxResult getInfo(@PathVariable("configId") Long configId)
-    {
-        return AjaxResult.success(hospitalConfigService.selectHospitalConfigByConfigId(configId));
-    }
-
-    /**
-     * 根据参数键名查询参数值
-     */
-    @GetMapping(value = "/configKey/{configKey}")
-    public AjaxResult getConfigKey(@PathVariable String configKey)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        return AjaxResult.success(hospitalConfigService.selectHospitalConfigByKey(configKey,loginUser.getHospital().getHospitalId()));
-    }
-
-    /**
-     * 新增参数配置
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalConfig:add')")
-    @Log(title = "参数配置", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalConfig hospitalConfig)
-    {
-        return toAjax(hospitalConfigService.insertHospitalConfig(hospitalConfig));
-    }
-
-    /**
-     * 修改参数配置
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalConfig:edit')")
-    @Log(title = "参数配置", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalConfig hospitalConfig)
-    {
-        return toAjax(hospitalConfigService.updateHospitalConfig(hospitalConfig));
-    }
-
-    /**
-     * 删除参数配置
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalConfig:remove')")
-    @Log(title = "参数配置", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{configIds}")
-    public AjaxResult remove(@PathVariable Long[] configIds)
-    {
-        return toAjax(hospitalConfigService.deleteHospitalConfigByConfigIds(configIds));
-    }
-
-    @PostMapping(value = "/updateHospitalConfig")
-    @RepeatSubmit
-    public AjaxResult updateConfigByKey(@Validated @RequestBody HospitalConfig hospitalConfig)
-    {
-        hospitalConfig.setUpdateBy(SecurityUtils.getUsername());
-        return toAjax(hospitalConfigService.updateHospitalConfig(hospitalConfig));
-    }
-}

+ 0 - 181
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalDeptController.java

@@ -1,181 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.annotation.Log;
-import com.fs.common.constant.UserConstants;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
-import com.fs.hospital.domain.HospitalDept;
-import com.fs.hospital.service.IHospitalDeptService;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.security.SecurityUtils;
-import com.fs.framework.service.TokenService;
-import org.apache.commons.lang3.ArrayUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * 部门信息
- *
-
- */
-@RestController
-@RequestMapping("/hospital/dept")
-public class HospitalDeptController extends BaseController
-{
-    @Autowired
-    private IHospitalDeptService deptService;
-    @Autowired
-    private TokenService tokenService;
-    /**
-     * 获取部门列表
-     */
-    @GetMapping("/list")
-    public AjaxResult list(HospitalDept dept)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        dept.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalDept> depts = deptService.selectHospitalDeptList(dept);
-        return AjaxResult.success(depts);
-    }
-
-    /**
-     * 查询部门列表(排除节点)
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:dept:list')")
-    @GetMapping("/list/exclude/{deptId}")
-    public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        HospitalDept dept=new HospitalDept();
-        dept.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalDept> depts = deptService.selectHospitalDeptList(dept);
-        Iterator<HospitalDept> it = depts.iterator();
-        while (it.hasNext())
-        {
-            HospitalDept d = (HospitalDept) it.next();
-            if (d.getDeptId().intValue() == deptId
-                    || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""))
-            {
-                it.remove();
-            }
-        }
-        return AjaxResult.success(depts);
-    }
-
-    /**
-     * 根据部门编号获取详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:dept:query')")
-    @GetMapping(value = "/{deptId}")
-    public AjaxResult getInfo(@PathVariable Long deptId)
-    {
-        return AjaxResult.success(deptService.selectHospitalDeptByDeptId(deptId));
-    }
-
-    /**
-     * 获取部门下拉树列表
-     */
-    @GetMapping("/treeselect")
-    public AjaxResult treeselect(HospitalDept dept)
-    {
-        System.out.println("查询部门");
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        dept.setHospitalId(loginUser.getHospital().getHospitalId());
-        dept.setStatus("0");
-        List<HospitalDept> depts = deptService.selectHospitalDeptList(dept);
-        return AjaxResult.success(deptService.buildDeptTreeSelect(depts));
-    }
-    /**
-     * 加载对应角色部门列表树
-     */
-    @GetMapping(value = "/roleDeptTreeselect/{roleId}")
-    public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        HospitalDept dept=new HospitalDept();
-        dept.setHospitalId(loginUser.getHospital().getHospitalId());
-        dept.setStatus("0");
-        List<HospitalDept> depts = deptService.selectHospitalDeptList(dept);
-        AjaxResult ajax = AjaxResult.success();
-        ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
-        ajax.put("depts", deptService.buildDeptTreeSelect(depts));
-        return ajax;
-    }
-
-    /**
-     * 新增部门
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:dept:add')")
-    @Log(title = "部门管理", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@Validated @RequestBody HospitalDept dept)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        dept.setHospitalId(loginUser.getHospital().getHospitalId());
-        if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
-        {
-            return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
-        }
-        dept.setCreateBy(SecurityUtils.getUsername());
-        return toAjax(deptService.insertHospitalDept(dept));
-    }
-
-    /**
-     * 修改部门
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:dept:edit')")
-    @Log(title = "部门管理", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@Validated @RequestBody HospitalDept dept)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        dept.setHospitalId(loginUser.getHospital().getHospitalId());
-        if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
-        {
-            return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
-        }
-        else if (dept.getParentId().equals(dept.getDeptId()))
-        {
-            return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
-        }
-        else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
-                && deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0)
-        {
-            return AjaxResult.error("该部门包含未停用的子部门!");
-        }
-        dept.setUpdateBy(SecurityUtils.getUsername());
-        return toAjax(deptService.updateHospitalDept(dept));
-    }
-
-    /**
-     * 删除部门
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:dept:remove')")
-    @Log(title = "部门管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{deptId}")
-    public AjaxResult remove(@PathVariable Long deptId)
-    {
-        if (deptService.hasChildByDeptId(deptId)>0)
-        {
-            return AjaxResult.error("存在下级部门,不允许删除");
-        }
-        if (deptService.checkDeptExistUser(deptId)>0)
-        {
-            return AjaxResult.error("部门存在用户,不允许删除");
-        }
-        return toAjax(deptService.deleteHospitalDeptByDeptId(deptId));
-    }
-
-
-
-
-
-}

+ 0 - 117
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalExamItemController.java

@@ -1,117 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import cn.hutool.http.HttpUtil;
-import cn.hutool.json.JSONUtil;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalExamItem;
-import com.fs.hospital.service.IHospitalExamItemService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 检验项目Controller
- *
- * @author fs
- * @date 2024-03-26
- */
-@RestController
-@RequestMapping("/hospital/hospitalExamItem")
-public class HospitalExamItemController extends BaseController
-{
-    @Autowired
-    private IHospitalExamItemService hospitalExamItemService;
-    @Autowired
-    private TokenService tokenService;
-    /**
-     * 查询检验项目列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalExamItem:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalExamItem hospitalExamItem)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalExamItem.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalExamItem> list = hospitalExamItemService.selectHospitalExamItemList(hospitalExamItem);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出检验项目列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalExamItem:export')")
-    @Log(title = "检验项目", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalExamItem hospitalExamItem)
-    {
-
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalExamItem.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalExamItem> list = hospitalExamItemService.selectHospitalExamItemList(hospitalExamItem);
-        ExcelUtil<HospitalExamItem> util = new ExcelUtil<HospitalExamItem>(HospitalExamItem.class);
-        return util.exportExcel(list, "检验项目数据");
-    }
-
-    /**
-     * 获取检验项目详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalExamItem:query')")
-    @GetMapping(value = "/{examId}")
-    public AjaxResult getInfo(@PathVariable("examId") Long examId)
-    {
-        return AjaxResult.success(hospitalExamItemService.selectHospitalExamItemByExamId(examId));
-    }
-
-    /**
-     * 新增检验项目
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalExamItem:add')")
-    @Log(title = "检验项目", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalExamItem hospitalExamItem)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalExamItem.setHospitalId( loginUser.getHospital().getHospitalId());
-        return toAjax(hospitalExamItemService.insertHospitalExamItem(hospitalExamItem));
-    }
-
-    /**
-     * 修改检验项目
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalExamItem:edit')")
-    @Log(title = "检验项目", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalExamItem hospitalExamItem)
-    {
-        return toAjax(hospitalExamItemService.updateHospitalExamItem(hospitalExamItem));
-    }
-
-    /**
-     * 删除检验项目
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalExamItem:remove')")
-    @Log(title = "检验项目", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{examIds}")
-    public AjaxResult remove(@PathVariable Long[] examIds)
-    {
-        return toAjax(hospitalExamItemService.deleteHospitalExamItemByExamIds(examIds));
-    }
-}

+ 0 - 97
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalExamOrderController.java

@@ -1,97 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.param.HospitalExamOrderParam;
-import com.fs.hospital.vo.HospitalExamOrderVO;
-import com.fs.hospital.vo.HospitalInspectOrderVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalExamOrder;
-import com.fs.hospital.service.IHospitalExamOrderService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 检验单Controller
- *
- * @author fs
- * @date 2024-03-26
- */
-@RestController
-@RequestMapping("/hospital/hospitalExamOrder")
-public class HospitalExamOrderController extends BaseController
-{
-    @Autowired
-    private IHospitalExamOrderService hospitalExamOrderService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询检验单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalExamOrder:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalExamOrderParam param)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalExamOrderVO> list = hospitalExamOrderService.selectHospitalExamOrderListVO(param);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出检验单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalExamOrder:export')")
-    @Log(title = "检验单", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalExamOrderParam param)
-    {
-        List<HospitalExamOrderVO> list = hospitalExamOrderService.selectHospitalExamOrderListVO(param);
-        ExcelUtil<HospitalExamOrderVO> util = new ExcelUtil<HospitalExamOrderVO>(HospitalExamOrderVO.class);
-        return util.exportExcel(list, "检验单数据");
-    }
-
-    /**
-     * 获取检验单详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalExamOrder:query')")
-    @GetMapping(value = "/{orderId}")
-    public R getInfo(@PathVariable("orderId") Long orderId)
-    {
-        return hospitalExamOrderService.selectHospitalExamOrderVOByOrderId(orderId);
-    }
-
-
-    /**
-     * 修改检验单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalExamOrder:edit')")
-    @Log(title = "检验单", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalExamOrder hospitalExamOrder)
-    {
-        return toAjax(hospitalExamOrderService.updateHospitalExamOrder(hospitalExamOrder));
-    }
-
-
-}

+ 0 - 114
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalInspectItemController.java

@@ -1,114 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalInspectItem;
-import com.fs.hospital.service.IHospitalInspectItemService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 检查Controller
- *
- * @author fs
- * @date 2024-03-26
- */
-@RestController
-@RequestMapping("/hospital/hospitalInspectItem")
-public class HospitalInspectItemController extends BaseController
-{
-    @Autowired
-    private IHospitalInspectItemService hospitalInspectItemService;
-    @Autowired
-    private TokenService tokenService;
-    /**
-     * 查询检查列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalInspectItem:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalInspectItem hospitalInspectItem)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalInspectItem.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalInspectItem> list = hospitalInspectItemService.selectHospitalInspectItemList(hospitalInspectItem);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出检查列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalInspectItem:export')")
-    @Log(title = "检查", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalInspectItem hospitalInspectItem)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalInspectItem.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalInspectItem> list = hospitalInspectItemService.selectHospitalInspectItemList(hospitalInspectItem);
-        ExcelUtil<HospitalInspectItem> util = new ExcelUtil<HospitalInspectItem>(HospitalInspectItem.class);
-        return util.exportExcel(list, "检查数据");
-    }
-
-    /**
-     * 获取检查详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalInspectItem:query')")
-    @GetMapping(value = "/{inspectId}")
-    public AjaxResult getInfo(@PathVariable("inspectId") Long inspectId)
-    {
-        return AjaxResult.success(hospitalInspectItemService.selectHospitalInspectItemByInspectId(inspectId));
-    }
-
-    /**
-     * 新增检查
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalInspectItem:add')")
-    @Log(title = "检查", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalInspectItem hospitalInspectItem)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalInspectItem.setHospitalId( loginUser.getHospital().getHospitalId());
-        return toAjax(hospitalInspectItemService.insertHospitalInspectItem(hospitalInspectItem));
-    }
-
-    /**
-     * 修改检查
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalInspectItem:edit')")
-    @Log(title = "检查", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalInspectItem hospitalInspectItem)
-    {
-        return toAjax(hospitalInspectItemService.updateHospitalInspectItem(hospitalInspectItem));
-    }
-
-    /**
-     * 删除检查
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalInspectItem:remove')")
-    @Log(title = "检查", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{inspectIds}")
-    public AjaxResult remove(@PathVariable Long[] inspectIds)
-    {
-        return toAjax(hospitalInspectItemService.deleteHospitalInspectItemByInspectIds(inspectIds));
-    }
-}

+ 0 - 97
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalInspectOrderController.java

@@ -1,97 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.param.HospitalInspectOrderParam;
-import com.fs.hospital.vo.HospitalInspectOrderVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalInspectOrder;
-import com.fs.hospital.service.IHospitalInspectOrderService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 检查单Controller
- *
- * @author fs
- * @date 2024-03-26
- */
-@RestController
-@RequestMapping("/hospital/hospitalInspectOrder")
-public class HospitalInspectOrderController extends BaseController
-{
-    @Autowired
-    private IHospitalInspectOrderService hospitalInspectOrderService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询检查单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalInspectOrder:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalInspectOrderParam param)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalInspectOrderVO> list = hospitalInspectOrderService.selectHospitalInspectOrderListVO(param);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出检查单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalInspectOrder:export')")
-    @Log(title = "检查单", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalInspectOrderParam param)
-    {
-        List<HospitalInspectOrderVO> list = hospitalInspectOrderService.selectHospitalInspectOrderListVO(param);
-        ExcelUtil<HospitalInspectOrderVO> util = new ExcelUtil<HospitalInspectOrderVO>(HospitalInspectOrderVO.class);
-        return util.exportExcel(list, "检查单数据");
-    }
-
-    /**
-     * 获取检查单详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalInspectOrder:query')")
-    @GetMapping(value = "/{orderId}")
-    public R getInfo(@PathVariable("orderId") Long orderId)
-    {
-        return hospitalInspectOrderService.selectHospitalInspectOrderVOByOrderId(orderId);
-    }
-
-
-    /**
-     * 修改检查单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalInspectOrder:edit')")
-    @Log(title = "检查单", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalInspectOrder hospitalInspectOrder)
-    {
-        return toAjax(hospitalInspectOrderService.updateHospitalInspectOrder(hospitalInspectOrder));
-    }
-
-
-
-}

+ 0 - 110
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalLoginController.java

@@ -1,110 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.constant.Constants;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.redis.RedisCache;
-import com.fs.common.utils.ServletUtils;
-import com.fs.company.domain.CompanyMenu;
-import com.fs.company.domain.CompanyUser;
-import com.fs.company.service.ICompanyMenuService;
-import com.fs.framework.security.LoginBody;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.HospitalLoginService;
-import com.fs.framework.service.HospitalPermissionService;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.domain.Hospital;
-import com.fs.hospital.domain.HospitalMenu;
-import com.fs.hospital.domain.HospitalUser;
-import com.fs.hospital.service.IHospitalMenuService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * 登录验证
- *
-
- */
-@RestController
-public class HospitalLoginController
-{
-    @Autowired
-    private HospitalLoginService loginService;
-
-    @Autowired
-    private IHospitalMenuService menuService;
-
-    @Autowired
-    private HospitalPermissionService permissionService;
-
-    @Autowired
-    private TokenService tokenService;
-    @Autowired
-    private RedisCache redisCache;
-
-    /**
-     * 登录方法
-     *
-     * @param loginBody 登录信息
-     * @return 结果
-     */
-    @PostMapping("/login")
-    public AjaxResult login(@RequestBody LoginBody loginBody)
-    {
-        AjaxResult ajax = AjaxResult.success();
-        // 生成令牌
-        String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
-                loginBody.getUuid());
-        ajax.put(Constants.TOKEN, token);
-        return ajax;
-    }
-
-
-    /**
-     * 获取用户信息
-     *
-     * @return 用户信息
-     */
-    @GetMapping("getInfo")
-    public AjaxResult getInfo()
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        Hospital hospital = loginUser.getHospital();
-        HospitalUser user = loginUser.getUser();
-        // 角色集合
-        Set<String> roles = permissionService.getRolePermission(user);
-        // 权限集合
-        Set<String> permissions = permissionService.getMenuPermission(user);
-        AjaxResult ajax = AjaxResult.success();
-        ajax.put("user", user);
-        ajax.put("hospital", hospital);
-        ajax.put("roles", roles);
-        ajax.put("permissions", permissions);
-
-
-        return ajax;
-    }
-
-    /**
-     * 获取路由信息
-     *
-     * @return 路由信息
-     */
-    @GetMapping("getRouters")
-    public AjaxResult getRouters()
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        // 用户信息
-        HospitalUser user = loginUser.getUser();
-        List<HospitalMenu> menus = menuService.selectMenuTreeByUserId(user.getUserId(), loginUser.getUser().isAdmin());
-
-        return AjaxResult.success(menuService.buildMenus(menus));
-    }
-
-}
-

+ 0 - 105
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalLogininforController.java

@@ -1,105 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.page.TableDataInfo;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.domain.HospitalLogininfor;
-import com.fs.hospital.service.IHospitalLogininforService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 系统访问记录Controller
- *
- * @author fs
- * @date 2021-10-04
- */
-@RestController
-@RequestMapping("/hospital/logininfor")
-public class HospitalLogininforController extends BaseController
-{
-    @Autowired
-    private IHospitalLogininforService hospitalLogininforService;
-    @Autowired
-    private TokenService tokenService;
-    /**
-     * 查询系统访问记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalLogininfor:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalLogininfor hospitalLogininfor)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        startPage();
-        hospitalLogininfor.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalLogininfor> list = hospitalLogininforService.selectHospitalLogininforList(hospitalLogininfor);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出系统访问记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalLogininfor:export')")
-    @Log(title = "系统访问记录", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalLogininfor hospitalLogininfor)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalLogininfor.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalLogininfor> list = hospitalLogininforService.selectHospitalLogininforList(hospitalLogininfor);
-        ExcelUtil<HospitalLogininfor> util = new ExcelUtil<HospitalLogininfor>(HospitalLogininfor.class);
-        return util.exportExcel(list, "hospitalLogininfor");
-    }
-
-    /**
-     * 获取系统访问记录详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalLogininfor:query')")
-    @GetMapping(value = "/{infoId}")
-    public AjaxResult getInfo(@PathVariable("infoId") Long infoId)
-    {
-        return AjaxResult.success(hospitalLogininforService.selectHospitalLogininforByInfoId(infoId));
-    }
-
-    /**
-     * 新增系统访问记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalLogininfor:add')")
-    @Log(title = "系统访问记录", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalLogininfor hospitalLogininfor)
-    {
-        return toAjax(hospitalLogininforService.insertHospitalLogininfor(hospitalLogininfor));
-    }
-
-    /**
-     * 修改系统访问记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalLogininfor:edit')")
-    @Log(title = "系统访问记录", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalLogininfor hospitalLogininfor)
-    {
-        return toAjax(hospitalLogininforService.updateHospitalLogininfor(hospitalLogininfor));
-    }
-
-    /**
-     * 删除系统访问记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalLogininfor:remove')")
-    @Log(title = "系统访问记录", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{infoIds}")
-    public AjaxResult remove(@PathVariable Long[] infoIds)
-    {
-        return toAjax(hospitalLogininforService.deleteHospitalLogininforByInfoIds(infoIds));
-    }
-}

+ 0 - 140
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMemberBillController.java

@@ -1,140 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.domain.HospitalMember;
-import com.fs.hospital.service.IHospitalMemberService;
-import com.fs.hospital.vo.HospitalMemberBillHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalMemberBill;
-import com.fs.hospital.service.IHospitalMemberBillService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 会员帐单Controller
- *
- * @author fs
- * @date 2024-03-04
- */
-@RestController
-@RequestMapping("/hospital/hospitalMemberBill")
-public class HospitalMemberBillController extends BaseController
-{
-    @Autowired
-    private IHospitalMemberBillService hospitalMemberBillService;
-    @Autowired
-    private TokenService tokenService;
-    @Autowired
-    private IHospitalMemberService hospitalMemberService;
-
-    /**
-     * 查询会员帐单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberBill:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalMemberBill hospitalMemberBill)
-    {
-        startPage();
-        List<HospitalMemberBillHVO> list = hospitalMemberBillService.selectHospitalMemberBillListPVO(hospitalMemberBill);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出会员帐单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberBill:export')")
-    @Log(title = "会员帐单", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalMemberBill hospitalMemberBill)
-    {
-        List<HospitalMemberBill> list = hospitalMemberBillService.selectHospitalMemberBillList(hospitalMemberBill);
-        ExcelUtil<HospitalMemberBill> util = new ExcelUtil<HospitalMemberBill>(HospitalMemberBill.class);
-        return util.exportExcel(list, "会员帐单数据");
-    }
-
-    /**
-     * 获取会员帐单详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberBill:query')")
-    @GetMapping(value = "/{billId}")
-    public AjaxResult getInfo(@PathVariable("billId") Long billId)
-    {
-        return AjaxResult.success(hospitalMemberBillService.selectHospitalMemberBillByBillId(billId));
-    }
-
-    /**
-     * 新增会员帐单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberBill:add')")
-    @Log(title = "会员帐单", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalMemberBill hospitalMemberBill)
-    {
-        return toAjax(hospitalMemberBillService.insertHospitalMemberBill(hospitalMemberBill));
-    }
-
-    @Log(title = "会员帐单", businessType = BusinessType.INSERT)
-    @PostMapping("/addRefundBill")
-    public AjaxResult addRefundBill(@RequestBody HospitalMemberBill hospitalMemberBill)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        HospitalMember hospitalMember = hospitalMemberService.selectHospitalMemberByMemberId(hospitalMemberBill.getMemberId());
-        if (hospitalMember!=null){
-            if ((hospitalMember.getBalance().compareTo(hospitalMemberBill.getMoney())<0)){
-             return AjaxResult.error("余额不足");
-            }
-            hospitalMember.setBalance(hospitalMember.getBalance().subtract(hospitalMemberBill.getMoney()));
-            hospitalMemberBill.setHospitalId(loginUser.getHospital().getHospitalId());
-            hospitalMemberService.updateHospitalMember(hospitalMember);
-            hospitalMemberBill.setBillType(2);
-            hospitalMemberBill.setMoney(hospitalMemberBill.getMoney().multiply(new BigDecimal(-1)));
-            hospitalMemberBill.setBalance(hospitalMember.getBalance());
-            hospitalMember.setCreateTime(new Date());
-            hospitalMemberBill.setTitle("退款扣款");
-            return toAjax(hospitalMemberBillService.insertHospitalMemberBill(hospitalMemberBill));
-        }else {
-            return AjaxResult.error("会员不存在");
-        }
-    }
-
-    /**
-     * 修改会员帐单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberBill:edit')")
-    @Log(title = "会员帐单", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalMemberBill hospitalMemberBill)
-    {
-        return toAjax(hospitalMemberBillService.updateHospitalMemberBill(hospitalMemberBill));
-    }
-
-    /**
-     * 删除会员帐单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberBill:remove')")
-    @Log(title = "会员帐单", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{billIds}")
-    public AjaxResult remove(@PathVariable Long[] billIds)
-    {
-        return toAjax(hospitalMemberBillService.deleteHospitalMemberBillByBillIds(billIds));
-    }
-}

+ 0 - 118
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMemberController.java

@@ -1,118 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.domain.HospitalPatient;
-import com.fs.hospital.service.IHospitalPatientService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalMember;
-import com.fs.hospital.service.IHospitalMemberService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 诊所会员Controller
- *
- * @author fs
- * @date 2024-03-04
- */
-@RestController
-@RequestMapping("/hospital/hospitalMember")
-public class HospitalMemberController extends BaseController
-{
-    @Autowired
-    private IHospitalMemberService hospitalMemberService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    @Autowired
-    private IHospitalPatientService patientService;
-
-    /**
-     * 查询诊所会员列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMember:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalMember hospitalMember)
-    {
-        startPage();
-        List<HospitalMember> list = hospitalMemberService.selectHospitalMemberList(hospitalMember);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出诊所会员列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMember:export')")
-    @Log(title = "诊所会员", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalMember hospitalMember)
-    {
-        List<HospitalMember> list = hospitalMemberService.selectHospitalMemberList(hospitalMember);
-        ExcelUtil<HospitalMember> util = new ExcelUtil<HospitalMember>(HospitalMember.class);
-        return util.exportExcel(list, "诊所会员数据");
-    }
-
-    /**
-     * 获取诊所会员详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMember:query')")
-    @GetMapping(value = "/{memberId}")
-    public AjaxResult getInfo(@PathVariable("memberId") Long memberId)
-    {
-        return AjaxResult.success(hospitalMemberService.selectHospitalMemberByMemberId(memberId));
-    }
-
-    /**
-     * 新增诊所会员
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMember:add')")
-    @Log(title = "诊所会员", businessType = BusinessType.INSERT)
-    @PostMapping
-    public R add(@RequestBody HospitalMember hospitalMember)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalMember.setHospitalId(loginUser.getHospital().getHospitalId());
-        return hospitalMemberService.insertHospitalMember(hospitalMember);
-    }
-
-    /**
-     * 修改诊所会员
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMember:edit')")
-    @Log(title = "诊所会员", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalMember hospitalMember)
-    {
-        return toAjax(hospitalMemberService.updateHospitalMember(hospitalMember));
-    }
-
-    /**
-     * 删除诊所会员
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMember:remove')")
-    @Log(title = "诊所会员", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{memberIds}")
-    public AjaxResult remove(@PathVariable Long[] memberIds)
-    {
-        return toAjax(hospitalMemberService.deleteHospitalMemberByMemberIds(memberIds));
-    }
-}

+ 0 - 133
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMemberIntegralLogsController.java

@@ -1,133 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.domain.HospitalUser;
-import com.fs.hospital.vo.HospitalMemberIntegralLogsListHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalMemberIntegralLogs;
-import com.fs.hospital.service.IHospitalMemberIntegralLogsService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 积分记录Controller
- *
- * @author fs
- * @date 2024-03-04
- */
-@RestController
-@RequestMapping("/hospital/hospitalMemberIntegralLogs")
-public class HospitalMemberIntegralLogsController extends BaseController
-{
-    @Autowired
-    private TokenService tokenService;
-    @Autowired
-    private IHospitalMemberIntegralLogsService hospitalMemberIntegralLogsService;
-
-    /**
-     * 查询积分记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberIntegralLogs:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalMemberIntegralLogs hospitalMemberIntegralLogs)
-    {
-        startPage();
-        List<HospitalMemberIntegralLogsListHVO> list = hospitalMemberIntegralLogsService.selectHospitalMemberIntegralLogsListPVO(hospitalMemberIntegralLogs);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出积分记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberIntegralLogs:export')")
-    @Log(title = "积分记录", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalMemberIntegralLogs hospitalMemberIntegralLogs)
-    {
-        List<HospitalMemberIntegralLogs> list = hospitalMemberIntegralLogsService.selectHospitalMemberIntegralLogsList(hospitalMemberIntegralLogs);
-        ExcelUtil<HospitalMemberIntegralLogs> util = new ExcelUtil<HospitalMemberIntegralLogs>(HospitalMemberIntegralLogs.class);
-        return util.exportExcel(list, "积分记录数据");
-    }
-
-    /**
-     * 获取积分记录详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberIntegralLogs:query')")
-    @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
-        return AjaxResult.success(hospitalMemberIntegralLogsService.selectHospitalMemberIntegralLogsById(id));
-    }
-
-    /**
-     * 新增积分记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberIntegralLogs:add')")
-    @Log(title = "积分记录", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalMemberIntegralLogs hospitalMemberIntegralLogs)
-    {
-        return toAjax(hospitalMemberIntegralLogsService.insertHospitalMemberIntegralLogs(hospitalMemberIntegralLogs));
-    }
-
-    /**
-     * 修改积分记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberIntegralLogs:edit')")
-    @Log(title = "积分记录", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalMemberIntegralLogs hospitalMemberIntegralLogs)
-    {
-        return toAjax(hospitalMemberIntegralLogsService.updateHospitalMemberIntegralLogs(hospitalMemberIntegralLogs));
-    }
-
-
-    @Log(title = "积分", businessType = BusinessType.UPDATE)
-    @PutMapping("/add")
-    public AjaxResult addIntegral(@RequestBody HospitalMemberIntegralLogs hospitalMemberIntegralLogs)
-    {
-        HospitalUser user = tokenService.getLoginUser(ServletUtils.getRequest()).getUser();
-        hospitalMemberIntegralLogs.setHospitalUserId(user.getUserId());
-        hospitalMemberIntegralLogs.setHospitalId(user.getHospitalId());
-        return toAjax(hospitalMemberIntegralLogsService.addHospitalMemberIntegral(hospitalMemberIntegralLogs));
-    }
-
-    @Log(title = "积分", businessType = BusinessType.UPDATE)
-    @PutMapping("/sub")
-    public AjaxResult subIntegral(@RequestBody HospitalMemberIntegralLogs hospitalMemberIntegralLogs)
-    {
-        HospitalUser user = tokenService.getLoginUser(ServletUtils.getRequest()).getUser();
-        hospitalMemberIntegralLogs.setHospitalUserId(user.getUserId());
-        hospitalMemberIntegralLogs.setHospitalId(user.getHospitalId());
-        return toAjax(hospitalMemberIntegralLogsService.subHospitalMemberIntegral(hospitalMemberIntegralLogs));
-    }
-
-
-    /**
-     * 删除积分记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberIntegralLogs:remove')")
-    @Log(title = "积分记录", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
-
-        return toAjax(hospitalMemberIntegralLogsService.deleteHospitalMemberIntegralLogsByIds(ids));
-    }
-}

+ 0 - 129
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMemberLevelController.java

@@ -1,129 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.vo.HospitalMemberLevelHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalMemberLevel;
-import com.fs.hospital.service.IHospitalMemberLevelService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 会员等级Controller
- *
- * @author fs
- * @date 2024-03-04
- */
-@RestController
-@RequestMapping("/hospital/hospitalMemberLevel")
-public class HospitalMemberLevelController extends BaseController
-{
-    @Autowired
-    private IHospitalMemberLevelService hospitalMemberLevelService;
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询会员等级列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberLevel:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalMemberLevel hospitalMemberLevel)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalMemberLevel.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalMemberLevelHVO> list = hospitalMemberLevelService.selectHospitalMemberLevelListPVO(hospitalMemberLevel);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出会员等级列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberLevel:export')")
-    @Log(title = "会员等级", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalMemberLevel hospitalMemberLevel)
-    {
-        List<HospitalMemberLevel> list = hospitalMemberLevelService.selectHospitalMemberLevelList(hospitalMemberLevel);
-        ExcelUtil<HospitalMemberLevel> util = new ExcelUtil<HospitalMemberLevel>(HospitalMemberLevel.class);
-        return util.exportExcel(list, "会员等级数据");
-    }
-
-    /**
-     * 获取会员等级详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberLevel:query')")
-    @GetMapping(value = "/{levelId}")
-    public AjaxResult getInfo(@PathVariable("levelId") Long levelId)
-    {
-        return AjaxResult.success(hospitalMemberLevelService.selectHospitalMemberLevelByLevelId(levelId));
-    }
-
-    /**
-     * 新增会员等级
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberLevel:add')")
-    @Log(title = "会员等级", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalMemberLevel hospitalMemberLevel)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalMemberLevel.setHospitalId(loginUser.getHospital().getHospitalId());
-        return toAjax(hospitalMemberLevelService.insertHospitalMemberLevel(hospitalMemberLevel));
-    }
-
-    /**
-     * 修改会员等级
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberLevel:edit')")
-    @Log(title = "会员等级", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalMemberLevel hospitalMemberLevel)
-    {
-
-        return toAjax(hospitalMemberLevelService.updateHospitalMemberLevel(hospitalMemberLevel));
-    }
-
-    /**
-     * 删除会员等级
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberLevel:remove')")
-    @Log(title = "会员等级", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{levelIds}")
-    public AjaxResult remove(@PathVariable Long[] levelIds)
-    {
-        return toAjax(hospitalMemberLevelService.deleteHospitalMemberLevelByLevelIds(levelIds));
-    }
-
-    /**
-     * 查询所有会员等级
-     */
-    @GetMapping("/allLevel")
-    public R allLevel()
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        List<HospitalMemberLevel> list = hospitalMemberLevelService.selectAllLevel(loginUser.getHospital().getHospitalId());
-        return R.ok().put("data",list);
-    }
-
-
-}

+ 0 - 114
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMemberRechargeController.java

@@ -1,114 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalMemberRecharge;
-import com.fs.hospital.service.IHospitalMemberRechargeService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 用户充值Controller
- *
- * @author fs
- * @date 2024-03-04
- */
-@RestController
-@RequestMapping("/hospital/hospitalMemberRecharge")
-public class HospitalMemberRechargeController extends BaseController
-{
-    @Autowired
-    private IHospitalMemberRechargeService hospitalMemberRechargeService;
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询用户充值列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberRecharge:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalMemberRecharge hospitalMemberRecharge)
-    {
-        startPage();
-        List<HospitalMemberRecharge> list = hospitalMemberRechargeService.selectHospitalMemberRechargeList(hospitalMemberRecharge);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出用户充值列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberRecharge:export')")
-    @Log(title = "用户充值", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalMemberRecharge hospitalMemberRecharge)
-    {
-        List<HospitalMemberRecharge> list = hospitalMemberRechargeService.selectHospitalMemberRechargeList(hospitalMemberRecharge);
-        ExcelUtil<HospitalMemberRecharge> util = new ExcelUtil<HospitalMemberRecharge>(HospitalMemberRecharge.class);
-        return util.exportExcel(list, "用户充值数据");
-    }
-
-    /**
-     * 获取用户充值详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberRecharge:query')")
-    @GetMapping(value = "/{rechargeId}")
-    public AjaxResult getInfo(@PathVariable("rechargeId") Long rechargeId)
-    {
-
-        return AjaxResult.success(hospitalMemberRechargeService.selectHospitalMemberRechargeByRechargeId(rechargeId));
-    }
-
-    /**
-     * 新增用户充值
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberRecharge:add')")
-    @Log(title = "用户充值", businessType = BusinessType.INSERT)
-    @PostMapping
-    public R add(@RequestBody HospitalMemberRecharge hospitalMemberRecharge)
-    {
-        System.out.println(hospitalMemberRecharge);
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalMemberRecharge.setHospitalId(loginUser.getHospital().getHospitalId());
-        return hospitalMemberRechargeService.insertHospitalMemberRecharge(hospitalMemberRecharge);
-    }
-
-    /**
-     * 修改用户充值
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberRecharge:edit')")
-    @Log(title = "用户充值", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalMemberRecharge hospitalMemberRecharge)
-    {
-        return toAjax(hospitalMemberRechargeService.updateHospitalMemberRecharge(hospitalMemberRecharge));
-    }
-
-    /**
-     * 删除用户充值
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalMemberRecharge:remove')")
-    @Log(title = "用户充值", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{rechargeIds}")
-    public AjaxResult remove(@PathVariable Long[] rechargeIds)
-    {
-        return toAjax(hospitalMemberRechargeService.deleteHospitalMemberRechargeByRechargeIds(rechargeIds));
-    }
-}

+ 0 - 147
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalMenuController.java

@@ -1,147 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.annotation.Log;
-import com.fs.common.constant.Constants;
-import com.fs.common.constant.UserConstants;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.security.SecurityUtils;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.domain.HospitalMenu;
-import com.fs.hospital.domain.HospitalMenuTreeSelect;
-import com.fs.hospital.service.IHospitalMenuService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 菜单信息
- *
-
- */
-@RestController
-@RequestMapping("/hospital/menu")
-public class HospitalMenuController extends BaseController
-{
-    @Autowired
-    private IHospitalMenuService menuService;
-
-
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 获取菜单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:menu:list')")
-    @GetMapping("/list")
-    public AjaxResult list(HospitalMenu menu)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        Long userId = loginUser.getUser().getUserId();
-        List<HospitalMenu> menus = menuService.selectMenuList(menu, userId,loginUser.getUser().getUserType());
-        return AjaxResult.success(menus);
-    }
-
-    /**
-     * 根据菜单编号获取详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:menu:query')")
-    @GetMapping(value = "/{menuId}")
-    public AjaxResult getInfo(@PathVariable Long menuId)
-    {
-        return AjaxResult.success(menuService.selectHospitalMenuByMenuId(menuId));
-    }
-
-    /**
-     * 获取菜单下拉树列表
-     */
-    @GetMapping("/treeselect")
-    public AjaxResult treeselect(HospitalMenu menu)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        Long userId = loginUser.getUser().getUserId();
-        List<HospitalMenu> menus = menuService.selectMenuList(menu, userId,loginUser.getUser().getUserType());
-        List<HospitalMenuTreeSelect> hospitalMenuTreeSelects = menuService.buildMenuTreeSelect(menus);
-        System.out.println(hospitalMenuTreeSelects);
-        return AjaxResult.success(hospitalMenuTreeSelects);
-    }
-
-    /**
-     * 加载对应角色菜单列表树
-     */
-    @GetMapping(value = "/roleMenuTreeselect/{roleId}")
-    public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        List<HospitalMenu> menus = menuService.selectMenuList(new HospitalMenu(),loginUser.getUser().getUserId(),loginUser.getUser().getUserType());
-        AjaxResult ajax = AjaxResult.success();
-        ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId));
-        ajax.put("menus", menuService.buildMenuTreeSelect(menus));
-        return ajax;
-    }
-
-    /**
-     * 新增菜单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:menu:add')")
-    @Log(title = "菜单管理", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@Validated @RequestBody HospitalMenu menu)
-    {
-       if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
-                && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS))
-        {
-            return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
-        }
-        menu.setCreateBy(SecurityUtils.getUsername());
-        return toAjax(menuService.insertHospitalMenu(menu));
-    }
-
-    /**
-     * 修改菜单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:menu:edit')")
-    @Log(title = "菜单管理", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@Validated @RequestBody HospitalMenu menu)
-    {
-         if (UserConstants.YES_FRAME.equals(menu.getIsFrame())
-                && !StringUtils.startsWithAny(menu.getPath(), Constants.HTTP, Constants.HTTPS))
-        {
-            return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
-        }
-        else if (menu.getMenuId().equals(menu.getParentId()))
-        {
-            return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
-        }
-        menu.setUpdateBy(SecurityUtils.getUsername());
-        return toAjax(menuService.updateHospitalMenu(menu));
-    }
-
-    /**
-     * 删除菜单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:menu:remove')")
-    @Log(title = "菜单管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{menuId}")
-    public AjaxResult remove(@PathVariable("menuId") Long menuId)
-    {
-        if (menuService.hasChildByMenuId(menuId))
-        {
-            return AjaxResult.error("存在子菜单,不允许删除");
-        }
-        if (menuService.checkMenuExistRole(menuId))
-        {
-            return AjaxResult.error("菜单已分配,不允许删除");
-        }
-        return toAjax(menuService.deleteHospitalMenuByMenuId(menuId));
-    }
-}

+ 0 - 105
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOperLogController.java

@@ -1,105 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.page.TableDataInfo;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.domain.HospitalOperLog;
-import com.fs.hospital.service.IHospitalOperLogService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 操作日志记录Controller
- *
- * @author fs
- * @date 2021-10-04
- */
-@RestController
-@RequestMapping("/hospital/hospitalOperLog")
-public class HospitalOperLogController extends BaseController
-{
-    @Autowired
-    private IHospitalOperLogService hospitalOperLogService;
-    @Autowired
-    private TokenService tokenService;
-    /**
-     * 查询操作日志记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOperLog:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalOperLog hospitalOperLog)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        startPage();
-        hospitalOperLog.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalOperLog> list = hospitalOperLogService.selectHospitalOperLogList(hospitalOperLog);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出操作日志记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOperLog:export')")
-    @Log(title = "操作日志记录", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalOperLog hospitalOperLog)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalOperLog.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalOperLog> list = hospitalOperLogService.selectHospitalOperLogList(hospitalOperLog);
-        ExcelUtil<HospitalOperLog> util = new ExcelUtil<HospitalOperLog>(HospitalOperLog.class);
-        return util.exportExcel(list, "hospitalOperLog");
-    }
-
-    /**
-     * 获取操作日志记录详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOperLog:query')")
-    @GetMapping(value = "/{operId}")
-    public AjaxResult getInfo(@PathVariable("operId") Long operId)
-    {
-        return AjaxResult.success(hospitalOperLogService.selectHospitalOperLogByOperId(operId));
-    }
-
-    /**
-     * 新增操作日志记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOperLog:add')")
-    @Log(title = "操作日志记录", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalOperLog hospitalOperLog)
-    {
-        return toAjax(hospitalOperLogService.insertHospitalOperLog(hospitalOperLog));
-    }
-
-    /**
-     * 修改操作日志记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOperLog:edit')")
-    @Log(title = "操作日志记录", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalOperLog hospitalOperLog)
-    {
-        return toAjax(hospitalOperLogService.updateHospitalOperLog(hospitalOperLog));
-    }
-
-    /**
-     * 删除操作日志记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOperLog:remove')")
-    @Log(title = "操作日志记录", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{operIds}")
-    public AjaxResult remove(@PathVariable Long[] operIds)
-    {
-        return toAjax(hospitalOperLogService.deleteHospitalOperLogByOperIds(operIds));
-    }
-}

+ 0 - 155
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOrderController.java

@@ -1,155 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.BeanCopyUtils;
-import com.fs.common.annotation.RepeatSubmit;
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.param.HospitalOrderCashierParam;
-import com.fs.hospital.param.HospitalOrderParam;
-import com.fs.hospital.param.HospitalTreatOrderAddParam;
-import com.fs.hospital.vo.HospitalOrderListHVO;
-import org.json.JSONObject;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalOrder;
-import com.fs.hospital.service.IHospitalOrderService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 诊疗订单Controller
- *
- * @author fs
- * @date 2024-03-22
- */
-@RestController
-@RequestMapping("/hospital/hospitalOrder")
-public class HospitalOrderController extends BaseController
-{
-    @Autowired
-    private IHospitalOrderService hospitalOrderService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询诊疗订单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrder:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalOrderParam param)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalOrderListHVO> list = hospitalOrderService.selectHospitalOrderListHVO(param);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出诊疗订单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrder:export')")
-    @Log(title = "诊疗订单", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalOrder hospitalOrder)
-    {
-        List<HospitalOrder> list = hospitalOrderService.selectHospitalOrderList(hospitalOrder);
-        ExcelUtil<HospitalOrder> util = new ExcelUtil<HospitalOrder>(HospitalOrder.class);
-        return util.exportExcel(list, "诊疗订单数据");
-    }
-
-    /**
-     * 获取诊疗订单详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrder:query')")
-    @GetMapping(value = "/{orderId}")
-    public R getInfo(@PathVariable("orderId") Long orderId)
-    {
-        return hospitalOrderService.selectHospitalOrderByOrderId(orderId);
-    }
-
-    /**
-     * 新增诊疗订单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrder:add')")
-    @Log(title = "诊疗订单", businessType = BusinessType.INSERT)
-    @PostMapping
-    @RepeatSubmit
-    public AjaxResult add(@RequestBody HospitalOrder hospitalOrder)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalOrder.setHospitalId( loginUser.getHospital().getHospitalId());
-        return toAjax(hospitalOrderService.insertHospitalOrder(hospitalOrder));
-    }
-
-    /**
-     * 修改诊疗订单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrder:edit')")
-    @Log(title = "诊疗订单", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalOrder hospitalOrder)
-    {
-        return toAjax(hospitalOrderService.updateHospitalOrder(hospitalOrder));
-    }
-
-    /**
-     * 删除诊疗订单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrder:remove')")
-    @Log(title = "诊疗订单", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{orderIds}")
-    public AjaxResult remove(@PathVariable Long[] orderIds)
-    {
-        return toAjax(hospitalOrderService.deleteHospitalOrderByOrderIds(orderIds));
-    }
-
-    @Log(title = "收费", businessType = BusinessType.UPDATE)
-    @PostMapping("/cashier")
-    public R cashier(@RequestBody HospitalOrderCashierParam param)
-    {
-        return hospitalOrderService.cashier(param);
-    }
-
-    @Log(title = "挂单or挂单or退费等门诊-收费操作",businessType = BusinessType.DELETE)
-    @PostMapping("/handleOrderChangeExecute/{orderId}")
-    public AjaxResult handleOrderChangeExecute(@PathVariable Long orderId,@RequestBody int type){
-        return toAjax(hospitalOrderService.handleOrderChangeExecute(orderId,type));
-    }
-
-
-    /**
-     *  获取患者的收费记录
-     */
-    @GetMapping("/getFeeRecordsByPatientIdList/{patientId}")
-    public R selectHospitalOrderByPatientIdList(@PathVariable Long patientId,@RequestParam("status") int status){
-
-        return R.ok().put("data",hospitalOrderService.selectHospitalOrderByPatientIdList(patientId,status));
-    }
-
-    /** 获取患者的某一条收费详细记录 */
-    @GetMapping("/getFeeRecordsByOrderId/{orderId}")
-    public R getFeeRecordsByOrderId(@PathVariable Long orderId){
-
-        return  R.ok().put("data", hospitalOrderService.getFeeRecordsByOrderId(orderId));
-    }
-
-    /** 完成新增收费 */
-    @PostMapping("finishOrder")
-    public R finishOrder(@RequestBody HospitalOrderParam param)
-    {
-        System.out.println(param);
-        return R.ok().put("data", hospitalOrderService.finishOrder(param));
-    }
-
-}

+ 0 - 140
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOrderItemController.java

@@ -1,140 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.annotation.RepeatSubmit;
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.domain.HospitalExamItem;
-import com.fs.hospital.domain.HospitalInspectItem;
-import com.fs.hospital.domain.HospitalPayment;
-import com.fs.hospital.param.HospitalOrderItemParam;
-import com.fs.hospital.service.IHospitalExamItemService;
-import com.fs.hospital.service.IHospitalInspectItemService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalOrderItem;
-import com.fs.hospital.service.IHospitalOrderItemService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 诊疗项目Controller
- *
- * @author fs
- * @date 2024-03-22
- */
-@RestController
-@RequestMapping("/hospital/hospitalOrderItem")
-public class HospitalOrderItemController extends BaseController
-{
-    @Autowired
-    private IHospitalOrderItemService hospitalOrderItemService;
-    @Autowired
-    private TokenService tokenService;
-    @Autowired
-    private IHospitalExamItemService hospitalExamItemService;
-    @Autowired
-    private IHospitalInspectItemService hospitalInspectItemService;
-
-    /**
-     * 查询诊疗项目列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderItem:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalOrderItem hospitalOrderItem)
-    {
-        startPage();
-        List<HospitalOrderItem> list = hospitalOrderItemService.selectHospitalOrderItemList(hospitalOrderItem);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出诊疗项目列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderItem:export')")
-    @Log(title = "诊疗项目", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalOrderItem hospitalOrderItem)
-    {
-        List<HospitalOrderItem> list = hospitalOrderItemService.selectHospitalOrderItemList(hospitalOrderItem);
-        ExcelUtil<HospitalOrderItem> util = new ExcelUtil<HospitalOrderItem>(HospitalOrderItem.class);
-        return util.exportExcel(list, "诊疗项目数据");
-    }
-
-    /**
-     * 获取诊疗项目详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderItem:query')")
-    @GetMapping(value = "/{itemId}")
-    public AjaxResult getInfo(@PathVariable("itemId") Long itemId)
-    {
-        return AjaxResult.success(hospitalOrderItemService.selectHospitalOrderItemByItemId(itemId));
-    }
-
-    /**
-     * 新增诊疗项目
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderItem:add')")
-    @Log(title = "诊疗项目", businessType = BusinessType.INSERT)
-    @PostMapping
-    @RepeatSubmit
-    public AjaxResult add(@RequestBody HospitalOrderItem hospitalOrderItem)
-    {
-        return toAjax(hospitalOrderItemService.insertHospitalOrderItem(hospitalOrderItem));
-    }
-
-    /**
-     * 修改诊疗项目
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderItem:edit')")
-    @Log(title = "诊疗项目", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalOrderItem hospitalOrderItem)
-    {
-        return toAjax(hospitalOrderItemService.updateHospitalOrderItem(hospitalOrderItem));
-    }
-
-    /**
-     * 删除诊疗项目
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderItem:remove')")
-    @Log(title = "诊疗项目", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{itemIds}")
-    public AjaxResult remove(@PathVariable Long[] itemIds)
-    {
-        return toAjax(hospitalOrderItemService.deleteHospitalOrderItemByItemIds(itemIds));
-    }
-
-    /**
-     *  商品查询
-     */
-    @GetMapping("/goodsSearch")
-    public R goodsSearch(HospitalOrderItemParam param)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId(loginUser.getHospital().getHospitalId());
-        return hospitalOrderItemService.selectHospitalOrderItemListHVO(param);
-    }
-
-    @Log(title = "完成挂号收费", businessType = BusinessType.UPDATE)
-    @PostMapping("/finishRegistration")
-    public R finishRegistration(@RequestBody HospitalOrderItem orderItem)
-    {
-        return hospitalOrderItemService.finishRegistration(orderItem);
-    }
-}

+ 0 - 103
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOrderLogsController.java

@@ -1,103 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalOrderLogs;
-import com.fs.hospital.service.IHospitalOrderLogsService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 日志Controller
- *
- * @author fs
- * @date 2024-03-22
- */
-@RestController
-@RequestMapping("/hospital/hospitalOrderLogs")
-public class HospitalOrderLogsController extends BaseController
-{
-    @Autowired
-    private IHospitalOrderLogsService hospitalOrderLogsService;
-
-    /**
-     * 查询日志列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderLogs:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalOrderLogs hospitalOrderLogs)
-    {
-        startPage();
-        List<HospitalOrderLogs> list = hospitalOrderLogsService.selectHospitalOrderLogsList(hospitalOrderLogs);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出日志列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderLogs:export')")
-    @Log(title = "日志", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalOrderLogs hospitalOrderLogs)
-    {
-        List<HospitalOrderLogs> list = hospitalOrderLogsService.selectHospitalOrderLogsList(hospitalOrderLogs);
-        ExcelUtil<HospitalOrderLogs> util = new ExcelUtil<HospitalOrderLogs>(HospitalOrderLogs.class);
-        return util.exportExcel(list, "日志数据");
-    }
-
-    /**
-     * 获取日志详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderLogs:query')")
-    @GetMapping(value = "/{logsId}")
-    public AjaxResult getInfo(@PathVariable("logsId") Long logsId)
-    {
-        return AjaxResult.success(hospitalOrderLogsService.selectHospitalOrderLogsByLogsId(logsId));
-    }
-
-    /**
-     * 新增日志
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderLogs:add')")
-    @Log(title = "日志", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalOrderLogs hospitalOrderLogs)
-    {
-        return toAjax(hospitalOrderLogsService.insertHospitalOrderLogs(hospitalOrderLogs));
-    }
-
-    /**
-     * 修改日志
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderLogs:edit')")
-    @Log(title = "日志", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalOrderLogs hospitalOrderLogs)
-    {
-        return toAjax(hospitalOrderLogsService.updateHospitalOrderLogs(hospitalOrderLogs));
-    }
-
-    /**
-     * 删除日志
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOrderLogs:remove')")
-    @Log(title = "日志", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{logsIds}")
-    public AjaxResult remove(@PathVariable Long[] logsIds)
-    {
-        return toAjax(hospitalOrderLogsService.deleteHospitalOrderLogsByLogsIds(logsIds));
-    }
-}

+ 0 - 202
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOutpatientOrderController.java

@@ -1,202 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.*;
-
-import com.fs.common.annotation.RepeatSubmit;
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.his.vo.FsInquiryOrderListDVO;
-import com.fs.hospital.domain.HospitalOrderItem;
-import com.fs.hospital.domain.HospitalPayment;
-import com.fs.hospital.param.HospitalOutpatientOrderFinishParam;
-import com.fs.hospital.param.HospitalOutpatientOrderParam;
-import com.fs.hospital.service.IHospitalOrderItemService;
-import com.fs.hospital.service.IHospitalPaymentService;
-import com.fs.hospital.vo.HospitalOutpatientOrderCountHVO;
-import com.fs.hospital.vo.HospitalOutpatientOrderHVO;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalOutpatientOrder;
-import com.fs.hospital.service.IHospitalOutpatientOrderService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 门诊单Controller
- *
- * @author fs
- * @date 2024-03-22
- */
-@RestController
-@RequestMapping("/hospital/hospitalOutpatientOrder")
-public class HospitalOutpatientOrderController extends BaseController
-{
-    @Autowired
-    private IHospitalOutpatientOrderService hospitalOutpatientOrderService;
-
-    @Autowired
-    private TokenService tokenService;
-    @Autowired
-    private IHospitalPaymentService paymentService;
-    @Autowired
-    private IHospitalOrderItemService hospitalOrderItemService;
-
-    /**
-     * 查询门诊单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrder:list')")
-    @GetMapping("/list")
-    public R list(HospitalOutpatientOrderParam param)
-    {
-        PageHelper.startPage(param.getPageNum(), param.getPageSize());
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        if (param.getYuyueTime()==null){
-            param.setYuyueTime(new Date());
-        }
-        List<HospitalOutpatientOrderHVO> list = hospitalOutpatientOrderService.selectHospitalOutpatientOrderListHVO(param);
-        PageInfo<HospitalOutpatientOrderHVO> listPageInfo=new PageInfo<>(list);
-        List<HospitalOutpatientOrderCountHVO>  countList = hospitalOutpatientOrderService.selectHospitalOutpatientOrderCountListHVO(param);
-        List<HospitalOutpatientOrderCountHVO> allCount = new ArrayList<>();
-        HospitalOutpatientOrderCountHVO count = hospitalOutpatientOrderService.selectHospitalOutpatientOrderAllCountByTime(param);
-        allCount.add(count);
-        return R.ok().put("orderList", listPageInfo).put("countList", countList).put("allCount", allCount);
-    }
-
-    @GetMapping("/orderList")
-    public R orderList(HospitalOutpatientOrderParam param)
-    {
-        PageHelper.startPage(param.getPageNum(), param.getPageSize());
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalOutpatientOrderHVO> list = hospitalOutpatientOrderService.selectHospitalOutpatientOrderListHVO(param);
-        PageInfo<HospitalOutpatientOrderHVO> listPageInfo=new PageInfo<>(list);
-        return R.ok().put("row", listPageInfo);
-    }
-
-    @GetMapping("/outpatientOrderList")
-    public R outpatientOrderList(HospitalOutpatientOrderParam param)
-    {
-        PageHelper.startPage(param.getPageNum(), param.getPageSize());
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalOutpatientOrderHVO> list = hospitalOutpatientOrderService.selectAllOutpatientOrderListHVO(param);
-        PageInfo<HospitalOutpatientOrderHVO> listPageInfo=new PageInfo<>(list);
-        return R.ok().put("row", listPageInfo);
-    }
-
-    /**
-     * 导出门诊单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrder:export')")
-    @Log(title = "门诊单", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalOutpatientOrder hospitalOutpatientOrder)
-    {
-        List<HospitalOutpatientOrder> list = hospitalOutpatientOrderService.selectHospitalOutpatientOrderList(hospitalOutpatientOrder);
-        ExcelUtil<HospitalOutpatientOrder> util = new ExcelUtil<HospitalOutpatientOrder>(HospitalOutpatientOrder.class);
-        return util.exportExcel(list, "门诊单数据");
-    }
-
-    /**
-     * 获取挂号详情信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrder:query')")
-    @GetMapping(value = "/{orderId}")
-    public R getInfo(@PathVariable("orderId") Long orderId)
-    {
-        HospitalOutpatientOrder hospitalOutpatientOrder = hospitalOutpatientOrderService.selectHospitalOutpatientOrderByOrderId(orderId);
-        if (hospitalOutpatientOrder!=null){
-            HospitalOrderItem orderItem = hospitalOrderItemService.selectHospitalOrderItemByRegistration(hospitalOutpatientOrder.getOrderId());
-            return R.ok().put("data", hospitalOutpatientOrder).put("orderItem",orderItem);
-        }
-        return R.error("未查询到挂号详情");
-    }
-
-    /**
-     * 获取门诊单详情信息
-     */
-    @GetMapping("/getOutpatientOrder")
-    public R getOutPatientOrder(@RequestParam("orderId") Long orderId)
-    {
-        return hospitalOutpatientOrderService.getOutpatientOrder(orderId);
-    }
-
-    /**  获取患者门诊历史订单 */
-    @GetMapping("/getOutpatientOrderHistory")
-    public R getOutpatientOrderHistory(@RequestParam("orderId") Long orderId){
-        return hospitalOutpatientOrderService.getOutpatientOrderHistory(orderId);
-    }
-
-    /**
-     * 新增挂号预约
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrder:add')")
-    @Log(title = "挂号预约", businessType = BusinessType.INSERT)
-    @PostMapping("/registration")
-    public R add(@RequestBody HospitalOutpatientOrder hospitalOutpatientOrder)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalOutpatientOrder.setHospitalId( loginUser.getHospital().getHospitalId());
-        hospitalOutpatientOrder.setDeptId(loginUser.getUser().getDeptId());
-        return hospitalOutpatientOrderService.insertHospitalOutpatientOrder(hospitalOutpatientOrder);
-    }
-
-    /**
-     * 新增门诊
-     */
-//    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrder:add')")
-    @Log(title = "门诊", businessType = BusinessType.INSERT)
-    @PostMapping("addOutpatientOrder")
-    public R addOutpatientOrder(@RequestBody HospitalOutpatientOrder hospitalOutpatientOrder)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalOutpatientOrder.setHospitalId( loginUser.getHospital().getHospitalId());
-        hospitalOutpatientOrder.setDeptId(loginUser.getUser().getDeptId());
-        return hospitalOutpatientOrderService.createOutpatientOrder(hospitalOutpatientOrder);
-    }
-
-    @Log(title = "完成接诊", businessType = BusinessType.INSERT)
-    @PostMapping("finishOutpatientOrder")
-    @RepeatSubmit
-    public R finishOutpatientOrder(@RequestBody HospitalOutpatientOrderFinishParam param)
-    {
-        return hospitalOutpatientOrderService.finishOutpatientOrder(param);
-    }
-
-
-    /**
-     * 修改门诊单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrder:edit')")
-    @Log(title = "门诊单", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalOutpatientOrder hospitalOutpatientOrder)
-    {
-        return toAjax(hospitalOutpatientOrderService.updateHospitalOutpatientOrder(hospitalOutpatientOrder));
-    }
-
-    /**
-     * 删除门诊单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrder:remove')")
-    @Log(title = "门诊单", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{orderIds}")
-    public AjaxResult remove(@PathVariable Long[] orderIds)
-    {
-        return toAjax(hospitalOutpatientOrderService.deleteHospitalOutpatientOrderByOrderIds(orderIds));
-    }
-
-
-
-
-}

+ 0 - 103
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalOutpatientOrderLogsController.java

@@ -1,103 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalOutpatientOrderLogs;
-import com.fs.hospital.service.IHospitalOutpatientOrderLogsService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 日志Controller
- *
- * @author fs
- * @date 2024-03-26
- */
-@RestController
-@RequestMapping("/hospital/hospitalOutpatientOrderLogs")
-public class HospitalOutpatientOrderLogsController extends BaseController
-{
-    @Autowired
-    private IHospitalOutpatientOrderLogsService hospitalOutpatientOrderLogsService;
-
-    /**
-     * 查询日志列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrderLogs:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalOutpatientOrderLogs hospitalOutpatientOrderLogs)
-    {
-        startPage();
-        List<HospitalOutpatientOrderLogs> list = hospitalOutpatientOrderLogsService.selectHospitalOutpatientOrderLogsList(hospitalOutpatientOrderLogs);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出日志列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrderLogs:export')")
-    @Log(title = "日志", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalOutpatientOrderLogs hospitalOutpatientOrderLogs)
-    {
-        List<HospitalOutpatientOrderLogs> list = hospitalOutpatientOrderLogsService.selectHospitalOutpatientOrderLogsList(hospitalOutpatientOrderLogs);
-        ExcelUtil<HospitalOutpatientOrderLogs> util = new ExcelUtil<HospitalOutpatientOrderLogs>(HospitalOutpatientOrderLogs.class);
-        return util.exportExcel(list, "日志数据");
-    }
-
-    /**
-     * 获取日志详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrderLogs:query')")
-    @GetMapping(value = "/{logsId}")
-    public AjaxResult getInfo(@PathVariable("logsId") Long logsId)
-    {
-        return AjaxResult.success(hospitalOutpatientOrderLogsService.selectHospitalOutpatientOrderLogsByLogsId(logsId));
-    }
-
-    /**
-     * 新增日志
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrderLogs:add')")
-    @Log(title = "日志", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalOutpatientOrderLogs hospitalOutpatientOrderLogs)
-    {
-        return toAjax(hospitalOutpatientOrderLogsService.insertHospitalOutpatientOrderLogs(hospitalOutpatientOrderLogs));
-    }
-
-    /**
-     * 修改日志
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrderLogs:edit')")
-    @Log(title = "日志", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalOutpatientOrderLogs hospitalOutpatientOrderLogs)
-    {
-        return toAjax(hospitalOutpatientOrderLogsService.updateHospitalOutpatientOrderLogs(hospitalOutpatientOrderLogs));
-    }
-
-    /**
-     * 删除日志
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalOutpatientOrderLogs:remove')")
-    @Log(title = "日志", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{logsIds}")
-    public AjaxResult remove(@PathVariable Long[] logsIds)
-    {
-        return toAjax(hospitalOutpatientOrderLogsService.deleteHospitalOutpatientOrderLogsByLogsIds(logsIds));
-    }
-}

+ 0 - 189
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalPatientController.java

@@ -1,189 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.annotation.RepeatSubmit;
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.service.IHospitalMemberService;
-import com.fs.hospital.vo.HospitalPatientHVO;
-import com.fs.hospital.vo.HospitalPharmacyOrderHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalPatient;
-import com.fs.hospital.service.IHospitalPatientService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 患者Controller
- *
- * @author fs
- * @date 2024-03-04
- */
-@RestController
-@RequestMapping("/hospital/hospitalPatient")
-public class HospitalPatientController extends BaseController
-{
-    @Autowired
-    private IHospitalPatientService hospitalPatientService;
-
-    @Autowired
-    private IHospitalMemberService hospitalMemberService;
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询患者列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPatient:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalPatient hospitalPatient)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalPatient.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalPatient> list = hospitalPatientService.selectHospitalPatientList(hospitalPatient);
-        return getDataTable(list);
-    }
-
-    /** 根据条件模糊查询患者列表 */
-    @GetMapping("/patientScreenlist")
-    public TableDataInfo patientScreenlist(HospitalPatient hospitalPatient)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalPatient.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalPatient> list = hospitalPatientService.selectHospitalPatientScreenList(hospitalPatient);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出患者列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPatient:export')")
-    @Log(title = "患者", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalPatient hospitalPatient)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalPatient.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalPatient> list = hospitalPatientService.selectHospitalPatientList(hospitalPatient);
-        ExcelUtil<HospitalPatient> util = new ExcelUtil<HospitalPatient>(HospitalPatient.class);
-        return util.exportExcel(list, "患者数据");
-    }
-
-    /**
-     * 获取患者详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPatient:query')")
-    @GetMapping(value = "/{patientId}")
-    public AjaxResult getInfo(@PathVariable("patientId") Long patientId)
-    {
-        HospitalPatientHVO hospitalPatientPVO = hospitalPatientService.selectHospitalPatientPVOByPatientId(patientId);
-        if (hospitalPatientPVO.getMemberId()!=null){
-            hospitalPatientPVO.setHospitalMember(hospitalMemberService.selectHospitalMemberByMemberId(hospitalPatientPVO.getMemberId()));
-        }
-        return AjaxResult.success(hospitalPatientPVO);
-    }
-
-    /**
-     * 新增患者
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPatient:add')")
-    @Log(title = "患者", businessType = BusinessType.INSERT)
-    @PostMapping
-    @RepeatSubmit
-    public AjaxResult add(@RequestBody HospitalPatient hospitalPatient)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalPatient.setHospitalId( loginUser.getHospital().getHospitalId());
-        return toAjax(hospitalPatientService.insertHospitalPatient(hospitalPatient));
-    }
-
-    /**
-     * 修改患者
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPatient:edit')")
-    @Log(title = "患者", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalPatient hospitalPatient)
-    {
-        return toAjax(hospitalPatientService.updateHospitalPatient(hospitalPatient));
-    }
-
-    /**
-     * 删除患者
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPatient:remove')")
-    @Log(title = "患者", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{patientIds}")
-    public AjaxResult remove(@PathVariable Long[] patientIds)
-    {
-        return toAjax(hospitalPatientService.deleteHospitalPatientByPatientIds(patientIds));
-    }
-
-    @GetMapping("/patientByMemberList")
-    public TableDataInfo patientByMemberList(HospitalPatient hospitalPatient)
-    {
-        startPage();
-        hospitalPatient.setIsDel(0);
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalPatient.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalPatient> list = hospitalPatientService.selectHospitalPatientListPVO(hospitalPatient);
-        return getDataTable(list);
-    }
-
-
-    /**
-     *  新增患者
-     */
-    @Log(title = "患者", businessType = BusinessType.INSERT)
-    @PostMapping("/addPatient")
-    public R addPatient(@RequestBody HospitalPatient hospitalPatient)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalPatient.setHospitalId( loginUser.getHospital().getHospitalId());
-        if (hospitalPatientService.insertHospitalPatient(hospitalPatient)>0){
-            return R.ok().put("data",hospitalPatient);
-        }
-        return R.error("新增失败");
-    }
-
-    @GetMapping("/allPatient")
-    public R allPatient(HospitalPatient hospitalPatient)
-    {
-        hospitalPatient.setIsDel(0);
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalPatient.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalPatient> list = hospitalPatientService.selectHospitalPatientList(hospitalPatient);
-        return R.ok().put("data",list);
-    }
-
-    /**
-     *  获取患者病例就诊大概记录
-     * @param patientId 患者ID
-     */
-    @GetMapping("/getCaseRecords/{patientId}")
-    public R getCaseRecords(@PathVariable Long patientId){
-        return R.ok().put("data",hospitalPatientService.getCaseRecords(patientId));
-    }
-
-    /**
-     *  获取详细的病例就诊记录(如诊疗订单)
-     * @param orderId hospital_outpatient_order门诊订单id
-     */
-    @GetMapping("/getDetailedCaseRecords/{orderId}")
-    public R getDetailedCaseRecords(@PathVariable Long orderId, @RequestParam("type") int type){
-
-        return R.ok().put("data",hospitalPatientService.getDetailedCaseRecords(orderId,type));
-    }
-
-}

+ 0 - 122
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalPaymentController.java

@@ -1,122 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalPayment;
-import com.fs.hospital.service.IHospitalPaymentService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 支付明细Controller
- *
- * @author fs
- * @date 2024-03-26
- */
-@RestController
-@RequestMapping("/hospital/hospitalPayment")
-public class HospitalPaymentController extends BaseController
-{
-    @Autowired
-    private IHospitalPaymentService hospitalPaymentService;
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询支付明细列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPayment:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalPayment hospitalPayment)
-    {
-        startPage();
-        List<HospitalPayment> list = hospitalPaymentService.selectHospitalPaymentList(hospitalPayment);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出支付明细列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPayment:export')")
-    @Log(title = "支付明细", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalPayment hospitalPayment)
-    {
-        List<HospitalPayment> list = hospitalPaymentService.selectHospitalPaymentList(hospitalPayment);
-        ExcelUtil<HospitalPayment> util = new ExcelUtil<HospitalPayment>(HospitalPayment.class);
-        return util.exportExcel(list, "支付明细数据");
-    }
-
-    /**
-     * 获取支付明细详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPayment:query')")
-    @GetMapping(value = "/{paymentId}")
-    public AjaxResult getInfo(@PathVariable("paymentId") Long paymentId)
-    {
-        return AjaxResult.success(hospitalPaymentService.selectHospitalPaymentByPaymentId(paymentId));
-    }
-
-    /**
-     * 新增支付明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPayment:add')")
-    @Log(title = "支付明细", businessType = BusinessType.INSERT)
-    @PostMapping
-    public R add(@RequestBody HospitalPayment hospitalPayment)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalPayment.setHospitalId( loginUser.getHospital().getHospitalId());
-        hospitalPayment.setUserId(loginUser.getUser().getUserId());
-        return hospitalPaymentService.insertHospitalPayment(hospitalPayment);
-    }
-
-    /**
-     * 修改支付明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPayment:edit')")
-    @Log(title = "支付明细", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalPayment hospitalPayment)
-    {
-        return toAjax(hospitalPaymentService.updateHospitalPayment(hospitalPayment));
-    }
-
-    /**
-     * 删除支付明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPayment:remove')")
-    @Log(title = "支付明细", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{paymentIds}")
-    public AjaxResult remove(@PathVariable Long[] paymentIds)
-    {
-        return toAjax(hospitalPaymentService.deleteHospitalPaymentByPaymentIds(paymentIds));
-    }
-
-    @Log(title = "完成收费", businessType = BusinessType.UPDATE)
-    @PostMapping("/finishPayment")
-    public R finishPayment(@RequestBody HospitalPayment hospitalPayment)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalPayment.setUserId(loginUser.getUser().getUserId());
-        return hospitalPaymentService.finishPayment(hospitalPayment);
-    }
-}

+ 0 - 132
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalPharmacyOrderController.java

@@ -1,132 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.annotation.RepeatSubmit;
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.param.HospitalPharmacyOrderParam;
-import com.fs.hospital.vo.HospitalPharmacyOrderListHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalPharmacyOrder;
-import com.fs.hospital.service.IHospitalPharmacyOrderService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 药房订单Controller
- *
- * @author fs
- * @date 2024-03-22
- */
-@RestController
-@RequestMapping("/hospital/hospitalPharmacyOrder")
-public class HospitalPharmacyOrderController extends BaseController
-{
-    @Autowired
-    private IHospitalPharmacyOrderService hospitalPharmacyOrderService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询药房订单列表
-     */
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalPharmacyOrderParam param)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalPharmacyOrderListHVO> list = hospitalPharmacyOrderService.selectHospitalPharmacyOrderListHVO(param);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出药房订单列表
-     */
-//    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrder:export')")
-//    @Log(title = "药房订单", businessType = BusinessType.EXPORT)
-//    @GetMapping("/export")
-//    public AjaxResult export(HospitalPharmacyOrder hospitalPharmacyOrder)
-//    {
-//        List<HospitalPharmacyOrder> list = hospitalPharmacyOrderService.selectHospitalPharmacyOrderList(hospitalPharmacyOrder);
-//        ExcelUtil<HospitalPharmacyOrder> util = new ExcelUtil<HospitalPharmacyOrder>(HospitalPharmacyOrder.class);
-//        return util.exportExcel(list, "药房订单数据");
-//    }
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrder:export')")
-    @Log(title = "药房订单", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalPharmacyOrderParam param)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-
-        List<HospitalPharmacyOrderListHVO> list = hospitalPharmacyOrderService.selectHospitalPharmacyOrderListHVO(param);
-
-        ExcelUtil<HospitalPharmacyOrderListHVO> util = new ExcelUtil<HospitalPharmacyOrderListHVO>(HospitalPharmacyOrderListHVO.class);
-        return util.exportExcel(list, "药房订单数据");
-    }
-
-
-    /**
-     * 获取药房订单详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrder:query')")
-    @GetMapping(value = "/{orderId}")
-    public R getInfo(@PathVariable("orderId") Long orderId)
-    {
-
-//        return AjaxResult.success(hospitalPharmacyOrderService.selectHospitalPharmacyOrderPVOByOrderId(orderId));
-        return hospitalPharmacyOrderService.selectHospitalPharmacyOrderPVOByOrderId(orderId);
-    }
-
-    /**
-     * 新增药房订单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrder:add')")
-    @Log(title = "药房订单", businessType = BusinessType.INSERT)
-    @PostMapping
-    @RepeatSubmit
-    public AjaxResult add(@RequestBody HospitalPharmacyOrder hospitalPharmacyOrder)
-    {
-        return toAjax(hospitalPharmacyOrderService.insertHospitalPharmacyOrder(hospitalPharmacyOrder));
-    }
-
-    /**
-     * 修改药房订单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrder:edit')")
-    @Log(title = "药房订单", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalPharmacyOrder hospitalPharmacyOrder)
-    {
-        return toAjax(hospitalPharmacyOrderService.updateHospitalPharmacyOrder(hospitalPharmacyOrder));
-    }
-
-    /** 提交发药状态 */
-
-    @Log(title = "药房订单", businessType = BusinessType.UPDATE)
-    @PostMapping("/dispensing/{orderId}")
-    public AjaxResult UpdateDispensingHospitalPharmacyOrder(@PathVariable Long orderId,@RequestBody int type){
-        return  toAjax(hospitalPharmacyOrderService.UpdateDispensingHospitalPharmacyOrder(orderId,type));
-    }
-    /**
-     * 删除药房订单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrder:remove')")
-    @Log(title = "药房订单", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{orderIds}")
-    public AjaxResult remove(@PathVariable Long[] orderIds)
-    {
-        return toAjax(hospitalPharmacyOrderService.deleteHospitalPharmacyOrderByOrderIds(orderIds));
-    }
-}

+ 0 - 103
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalPharmacyOrderLogsController.java

@@ -1,103 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalPharmacyOrderLogs;
-import com.fs.hospital.service.IHospitalPharmacyOrderLogsService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 日志Controller
- *
- * @author fs
- * @date 2024-03-26
- */
-@RestController
-@RequestMapping("/hospital/hospitalPharmacyOrderLogs")
-public class HospitalPharmacyOrderLogsController extends BaseController
-{
-    @Autowired
-    private IHospitalPharmacyOrderLogsService hospitalPharmacyOrderLogsService;
-
-    /**
-     * 查询日志列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrderLogs:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalPharmacyOrderLogs hospitalPharmacyOrderLogs)
-    {
-        startPage();
-        List<HospitalPharmacyOrderLogs> list = hospitalPharmacyOrderLogsService.selectHospitalPharmacyOrderLogsList(hospitalPharmacyOrderLogs);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出日志列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrderLogs:export')")
-    @Log(title = "日志", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalPharmacyOrderLogs hospitalPharmacyOrderLogs)
-    {
-        List<HospitalPharmacyOrderLogs> list = hospitalPharmacyOrderLogsService.selectHospitalPharmacyOrderLogsList(hospitalPharmacyOrderLogs);
-        ExcelUtil<HospitalPharmacyOrderLogs> util = new ExcelUtil<HospitalPharmacyOrderLogs>(HospitalPharmacyOrderLogs.class);
-        return util.exportExcel(list, "日志数据");
-    }
-
-    /**
-     * 获取日志详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrderLogs:query')")
-    @GetMapping(value = "/{logsId}")
-    public AjaxResult getInfo(@PathVariable("logsId") Long logsId)
-    {
-        return AjaxResult.success(hospitalPharmacyOrderLogsService.selectHospitalPharmacyOrderLogsByLogsId(logsId));
-    }
-
-    /**
-     * 新增日志
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrderLogs:add')")
-    @Log(title = "日志", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalPharmacyOrderLogs hospitalPharmacyOrderLogs)
-    {
-        return toAjax(hospitalPharmacyOrderLogsService.insertHospitalPharmacyOrderLogs(hospitalPharmacyOrderLogs));
-    }
-
-    /**
-     * 修改日志
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrderLogs:edit')")
-    @Log(title = "日志", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalPharmacyOrderLogs hospitalPharmacyOrderLogs)
-    {
-        return toAjax(hospitalPharmacyOrderLogsService.updateHospitalPharmacyOrderLogs(hospitalPharmacyOrderLogs));
-    }
-
-    /**
-     * 删除日志
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPharmacyOrderLogs:remove')")
-    @Log(title = "日志", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{logsIds}")
-    public AjaxResult remove(@PathVariable Long[] logsIds)
-    {
-        return toAjax(hospitalPharmacyOrderLogsService.deleteHospitalPharmacyOrderLogsByLogsIds(logsIds));
-    }
-}

+ 0 - 132
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalPostController.java

@@ -1,132 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.annotation.Log;
-import com.fs.common.constant.UserConstants;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.page.TableDataInfo;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.hospital.domain.HospitalPost;
-import com.fs.hospital.service.IHospitalPostService;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.security.SecurityUtils;
-import com.fs.framework.service.TokenService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 岗位信息操作处理
- *
-
- */
-@RestController
-@RequestMapping("/hospital/post")
-public class HospitalPostController extends BaseController
-{
-    @Autowired
-    private IHospitalPostService postService;
-    @Autowired
-    private TokenService tokenService;
-    /**
-     * 获取岗位列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:post:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalPost post)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        post.setHospitalId(loginUser.getHospital().getHospitalId());
-        startPage();
-        List<HospitalPost> list = postService.selectHospitalPostList(post);
-        return getDataTable(list);
-    }
-
-    @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
-    @PreAuthorize("@ss.hasPermi('hospital:post:export')")
-    @GetMapping("/export")
-    public AjaxResult export(HospitalPost post)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        post.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalPost> list = postService.selectHospitalPostList(post);
-        ExcelUtil<HospitalPost> util = new ExcelUtil<HospitalPost>(HospitalPost.class);
-        return util.exportExcel(list, "岗位数据");
-    }
-
-    /**
-     * 根据岗位编号获取详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:post:query')")
-    @GetMapping(value = "/{postId}")
-    public AjaxResult getInfo(@PathVariable Long postId)
-    {
-        return AjaxResult.success(postService.selectHospitalPostByPostId(postId));
-    }
-
-    /**
-     * 新增岗位
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:post:add')")
-    @Log(title = "岗位管理", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@Validated @RequestBody HospitalPost post)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        post.setHospitalId(loginUser.getHospital().getHospitalId());
-       if (postService.checkPostCodeUnique(post)>0)
-        {
-            return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
-        }
-        post.setCreateBy(SecurityUtils.getUsername());
-        return toAjax(postService.insertHospitalPost(post));
-    }
-
-    /**
-     * 修改岗位
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:post:edit')")
-    @Log(title = "岗位管理", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@Validated @RequestBody HospitalPost post)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        post.setHospitalId(loginUser.getHospital().getHospitalId());
-        if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
-        {
-            return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
-        }
-        post.setUpdateBy(SecurityUtils.getUsername());
-        return toAjax(postService.updateHospitalPost(post));
-    }
-
-    /**
-     * 删除岗位
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:post:remove')")
-    @Log(title = "岗位管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{postIds}")
-    public AjaxResult remove(@PathVariable Long[] postIds)
-    {
-
-        return toAjax(postService.deleteHospitalPostByPostIds(postIds));
-    }
-
-    /**
-     * 获取岗位选择框列表
-     */
-    @GetMapping("/optionselect")
-    public AjaxResult optionselect()
-    {
-        HospitalPost postMap=new HospitalPost();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        postMap.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalPost> posts = postService.selectHospitalPostList(postMap);
-        return AjaxResult.success(posts);
-    }
-}

+ 0 - 123
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductCheckOrderController.java

@@ -1,123 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.param.HospitalProductCheckOrderAddParam;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalProductCheckOrder;
-import com.fs.hospital.service.IHospitalProductCheckOrderService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 采购单Controller
- *
- * @author fs
- * @date 2024-03-14
- */
-@RestController
-@RequestMapping("/hospital/hospitalProductCheckOrder")
-public class HospitalProductCheckOrderController extends BaseController
-{
-    @Autowired
-    private IHospitalProductCheckOrderService hospitalProductCheckOrderService;
-    @Autowired
-    private TokenService tokenService;
-    /**
-     * 查询采购单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrder:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalProductCheckOrder hospitalProductCheckOrder)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProductCheckOrder.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProductCheckOrder> list = hospitalProductCheckOrderService.selectHospitalProductCheckOrderList(hospitalProductCheckOrder);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出采购单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrder:export')")
-    @Log(title = "采购单", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalProductCheckOrder hospitalProductCheckOrder)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProductCheckOrder.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProductCheckOrder> list = hospitalProductCheckOrderService.selectHospitalProductCheckOrderList(hospitalProductCheckOrder);
-        ExcelUtil<HospitalProductCheckOrder> util = new ExcelUtil<HospitalProductCheckOrder>(HospitalProductCheckOrder.class);
-        return util.exportExcel(list, "采购单数据");
-    }
-
-    /**
-     * 获取采购单详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrder:query')")
-    @GetMapping(value = "/{orderId}")
-    public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
-    {
-        return AjaxResult.success(hospitalProductCheckOrderService.selectHospitalProductCheckOrderByOrderIdHVO(orderId));
-    }
-
-    /**
-     * 新增采购单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrder:add')")
-    @Log(title = "采购单", businessType = BusinessType.INSERT)
-    @PostMapping
-    public R add(@RequestBody HospitalProductCheckOrderAddParam param)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        if (param.getItemList()==null||param.getItemList().size()==0){
-            return R.error("请添加商品");
-        }
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        param.setUserId(loginUser.getUser().getUserId());
-        param.setStatus(4);
-        param.setProductCount(param.getItemList().size());
-        return hospitalProductCheckOrderService.insertHospitalProductCheckOrder(param);
-    }
-
-    /**
-     * 修改采购单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrder:edit')")
-    @Log(title = "采购单", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalProductCheckOrder hospitalProductCheckOrder)
-    {
-        return toAjax(hospitalProductCheckOrderService.updateHospitalProductCheckOrder(hospitalProductCheckOrder));
-    }
-
-    /**
-     * 删除采购单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrder:remove')")
-    @Log(title = "采购单", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{orderIds}")
-    public AjaxResult remove(@PathVariable Long[] orderIds)
-    {
-        return toAjax(hospitalProductCheckOrderService.deleteHospitalProductCheckOrderByOrderIds(orderIds));
-    }
-}

+ 0 - 105
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductCheckOrderItemController.java

@@ -1,105 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.hospital.vo.HospitalProductCheckOrderItemListHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalProductCheckOrderItem;
-import com.fs.hospital.service.IHospitalProductCheckOrderItemService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 采购单明细Controller
- *
- * @author fs
- * @date 2024-03-14
- */
-@RestController
-@RequestMapping("/hospital/hospitalProductCheckOrderItem")
-public class HospitalProductCheckOrderItemController extends BaseController
-{
-    @Autowired
-    private IHospitalProductCheckOrderItemService hospitalProductCheckOrderItemService;
-
-    /**
-     * 查询采购单明细列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrderItem:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalProductCheckOrderItem hospitalProductCheckOrderItem)
-    {
-        startPage();
-        List<HospitalProductCheckOrderItemListHVO> list = hospitalProductCheckOrderItemService.selectHospitalProductCheckOrderItemListPVO(hospitalProductCheckOrderItem);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出采购单明细列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrderItem:export')")
-    @Log(title = "采购单明细", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalProductCheckOrderItem hospitalProductCheckOrderItem)
-    {
-        List<HospitalProductCheckOrderItem> list = hospitalProductCheckOrderItemService.selectHospitalProductCheckOrderItemList(hospitalProductCheckOrderItem);
-        ExcelUtil<HospitalProductCheckOrderItem> util = new ExcelUtil<HospitalProductCheckOrderItem>(HospitalProductCheckOrderItem.class);
-        return util.exportExcel(list, "采购单明细数据");
-    }
-
-    /**
-     * 获取采购单明细详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrderItem:query')")
-    @GetMapping(value = "/{itemId}")
-    public AjaxResult getInfo(@PathVariable("itemId") Long itemId)
-    {
-        return AjaxResult.success(hospitalProductCheckOrderItemService.selectHospitalProductCheckOrderItemByItemId(itemId));
-    }
-
-    /**
-     * 新增采购单明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrderItem:add')")
-    @Log(title = "采购单明细", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalProductCheckOrderItem hospitalProductCheckOrderItem)
-    {
-        return toAjax(hospitalProductCheckOrderItemService.insertHospitalProductCheckOrderItem(hospitalProductCheckOrderItem));
-    }
-
-    /**
-     * 修改采购单明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrderItem:edit')")
-    @Log(title = "采购单明细", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalProductCheckOrderItem hospitalProductCheckOrderItem)
-    {
-        return toAjax(hospitalProductCheckOrderItemService.updateHospitalProductCheckOrderItem(hospitalProductCheckOrderItem));
-    }
-
-    /**
-     * 删除采购单明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductCheckOrderItem:remove')")
-    @Log(title = "采购单明细", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{itemIds}")
-    public AjaxResult remove(@PathVariable Long[] itemIds)
-    {
-        return toAjax(hospitalProductCheckOrderItemService.deleteHospitalProductCheckOrderItemByItemIds(itemIds));
-    }
-}

+ 0 - 126
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductController.java

@@ -1,126 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.vo.HospitalProductListHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalProduct;
-import com.fs.hospital.service.IHospitalProductService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 诊所商品Controller
- *
- * @author fs
- * @date 2024-03-12
- */
-@RestController
-@RequestMapping("/hospital/hospitalProduct")
-public class HospitalProductController extends BaseController
-{
-    @Autowired
-    private IHospitalProductService hospitalProductService;
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询诊所商品列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProduct:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalProduct hospitalProduct)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProduct.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProduct> list = hospitalProductService.selectHospitalProductList(hospitalProduct);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出诊所商品列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProduct:export')")
-    @Log(title = "诊所商品", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalProduct hospitalProduct)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProduct.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProduct> list = hospitalProductService.selectHospitalProductList(hospitalProduct);
-        ExcelUtil<HospitalProduct> util = new ExcelUtil<HospitalProduct>(HospitalProduct.class);
-        return util.exportExcel(list, "诊所商品数据");
-    }
-
-    /**
-     * 获取诊所商品详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProduct:query')")
-    @GetMapping(value = "/{productId}")
-    public AjaxResult getInfo(@PathVariable("productId") Long productId)
-    {
-        return AjaxResult.success(hospitalProductService.selectHospitalProductByProductId(productId));
-    }
-
-    /**
-     * 新增诊所商品
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProduct:add')")
-    @Log(title = "诊所商品", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalProduct hospitalProduct)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProduct.setHospitalId( loginUser.getHospital().getHospitalId());
-        return toAjax(hospitalProductService.insertHospitalProduct(hospitalProduct));
-    }
-
-    /**
-     * 修改诊所商品
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProduct:edit')")
-    @Log(title = "诊所商品", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalProduct hospitalProduct)
-    {
-        return toAjax(hospitalProductService.updateHospitalProduct(hospitalProduct));
-    }
-
-    /**
-     * 删除诊所商品
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProduct:remove')")
-    @Log(title = "诊所商品", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{productIds}")
-    public AjaxResult remove(@PathVariable Long[] productIds)
-    {
-        return toAjax(hospitalProductService.deleteHospitalProductByProductIds(productIds));
-    }
-
-    @GetMapping("/listByPurchase")
-    public TableDataInfo listByPurchase(HospitalProduct hospitalProduct)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProduct.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProductListHVO> list = hospitalProductService.selectHospitalProductListPVO(hospitalProduct);
-        return getDataTable(list);
-    }
-}

+ 0 - 112
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductLogsController.java

@@ -1,112 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalProductLogs;
-import com.fs.hospital.service.IHospitalProductLogsService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 商品记录Controller
- *
- * @author fs
- * @date 2024-03-12
- */
-@RestController
-@RequestMapping("/hospital/hospitalProductLogs")
-public class HospitalProductLogsController extends BaseController
-{
-    @Autowired
-    private IHospitalProductLogsService hospitalProductLogsService;
-    @Autowired
-    private TokenService tokenService;
-    /**
-     * 查询商品记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductLogs:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalProductLogs hospitalProductLogs)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProductLogs.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProductLogs> list = hospitalProductLogsService.selectHospitalProductLogsList(hospitalProductLogs);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出商品记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductLogs:export')")
-    @Log(title = "商品记录", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalProductLogs hospitalProductLogs)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProductLogs.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProductLogs> list = hospitalProductLogsService.selectHospitalProductLogsList(hospitalProductLogs);
-        ExcelUtil<HospitalProductLogs> util = new ExcelUtil<HospitalProductLogs>(HospitalProductLogs.class);
-        return util.exportExcel(list, "商品记录数据");
-    }
-
-    /**
-     * 获取商品记录详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductLogs:query')")
-    @GetMapping(value = "/{logsId}")
-    public AjaxResult getInfo(@PathVariable("logsId") Long logsId)
-    {
-        return AjaxResult.success(hospitalProductLogsService.selectHospitalProductLogsByLogsId(logsId));
-    }
-
-    /**
-     * 新增商品记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductLogs:add')")
-    @Log(title = "商品记录", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalProductLogs hospitalProductLogs)
-    {
-        return toAjax(hospitalProductLogsService.insertHospitalProductLogs(hospitalProductLogs));
-    }
-
-    /**
-     * 修改商品记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductLogs:edit')")
-    @Log(title = "商品记录", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalProductLogs hospitalProductLogs)
-    {
-        return toAjax(hospitalProductLogsService.updateHospitalProductLogs(hospitalProductLogs));
-    }
-
-    /**
-     * 删除商品记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductLogs:remove')")
-    @Log(title = "商品记录", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{logsIds}")
-    public AjaxResult remove(@PathVariable Long[] logsIds)
-    {
-        return toAjax(hospitalProductLogsService.deleteHospitalProductLogsByLogsIds(logsIds));
-    }
-}

+ 0 - 156
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductOutOrderController.java

@@ -1,156 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.param.HospitalProductOutOrderAddParam;
-import com.fs.hospital.vo.HospitalProductOutOrderListHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalProductOutOrder;
-import com.fs.hospital.service.IHospitalProductOutOrderService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 领用单Controller
- *
- * @author fs
- * @date 2024-03-14
- */
-@RestController
-@RequestMapping("/hospital/hospitalProductOutOrder")
-public class HospitalProductOutOrderController extends BaseController
-{
-    @Autowired
-    private IHospitalProductOutOrderService hospitalProductOutOrderService;
-    @Autowired
-    private TokenService tokenService;
-    /**
-     * 查询领用单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrder:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalProductOutOrder hospitalProductOutOrder)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProductOutOrder.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProductOutOrderListHVO> list = hospitalProductOutOrderService.selectHospitalProductOutOrderListPVO(hospitalProductOutOrder);
-        return getDataTable(list);
-    }
-
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrder:list')")
-    @GetMapping("/outList")
-    public TableDataInfo outList(HospitalProductOutOrder hospitalProductOutOrder)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProductOutOrder.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProductOutOrderListHVO> list = hospitalProductOutOrderService.selectHospitalProductOutOrderOutListPVO(hospitalProductOutOrder);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出领用单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrder:export')")
-    @Log(title = "领用单", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalProductOutOrder hospitalProductOutOrder)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProductOutOrder.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProductOutOrder> list = hospitalProductOutOrderService.selectHospitalProductOutOrderList(hospitalProductOutOrder);
-        ExcelUtil<HospitalProductOutOrder> util = new ExcelUtil<HospitalProductOutOrder>(HospitalProductOutOrder.class);
-        return util.exportExcel(list, "领用单数据");
-    }
-
-    /**
-     * 获取领用单详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrder:query')")
-    @GetMapping(value = "/{orderId}")
-    public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
-    {
-        return AjaxResult.success(hospitalProductOutOrderService.selectHospitalProductOutOrderByOrderIdHVO(orderId));
-    }
-
-    /**
-     * 新增领用单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrder:add')")
-    @Log(title = "领用单", businessType = BusinessType.INSERT)
-    @PostMapping
-    public R add(@RequestBody HospitalProductOutOrderAddParam param)
-    {
-
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        if (param.getItemList()==null||param.getItemList().size()==0){
-            return R.error("请添加商品");
-        }
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        param.setUserId(loginUser.getUser().getUserId());
-        param.setStatus(4);
-        param.setProductCount(param.getItemList().size());
-        return hospitalProductOutOrderService.insertHospitalProductOutOrder(param);
-    }
-
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrder:returnItem')")
-    @Log(title = "领用单", businessType = BusinessType.INSERT)
-    @PostMapping("/returnItem")
-    public R returnItem(@RequestBody HospitalProductOutOrderAddParam param)
-    {
-
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        if (param.getItemList()==null||param.getItemList().size()==0){
-            return R.error("请添加商品");
-        }
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        param.setUserId(loginUser.getUser().getUserId());
-        param.setStatus(4);
-        param.setProductCount(param.getItemList().size());
-        System.out.println(param);
-        return hospitalProductOutOrderService.insertReturnHospitalProductOutOrder(param);
-    }
-
-
-    /**
-     * 修改领用单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrder:edit')")
-    @Log(title = "领用单", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalProductOutOrder hospitalProductOutOrder)
-    {
-        return toAjax(hospitalProductOutOrderService.updateHospitalProductOutOrder(hospitalProductOutOrder));
-    }
-
-    /**
-     * 删除领用单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrder:remove')")
-    @Log(title = "领用单", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{orderIds}")
-    public AjaxResult remove(@PathVariable Long[] orderIds)
-    {
-        return toAjax(hospitalProductOutOrderService.deleteHospitalProductOutOrderByOrderIds(orderIds));
-    }
-}

+ 0 - 113
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductOutOrderItemController.java

@@ -1,113 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.vo.HospitalProductOutOrderItemListHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalProductOutOrderItem;
-import com.fs.hospital.service.IHospitalProductOutOrderItemService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 领用单明细Controller
- *
- * @author fs
- * @date 2024-03-14
- */
-@RestController
-@RequestMapping("/hospital/hospitalProductOutOrderItem")
-public class HospitalProductOutOrderItemController extends BaseController
-{
-    @Autowired
-    private IHospitalProductOutOrderItemService hospitalProductOutOrderItemService;
-    @Autowired
-    private TokenService tokenService;
-    /**
-     * 查询领用单明细列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrderItem:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalProductOutOrderItem hospitalProductOutOrderItem)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProductOutOrderItem.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProductOutOrderItemListHVO> list = hospitalProductOutOrderItemService.selectHospitalProductOutOrderItemListPVO(hospitalProductOutOrderItem);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出领用单明细列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrderItem:export')")
-    @Log(title = "领用单明细", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalProductOutOrderItem hospitalProductOutOrderItem)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalProductOutOrderItem.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProductOutOrderItem> list = hospitalProductOutOrderItemService.selectHospitalProductOutOrderItemList(hospitalProductOutOrderItem);
-        ExcelUtil<HospitalProductOutOrderItem> util = new ExcelUtil<HospitalProductOutOrderItem>(HospitalProductOutOrderItem.class);
-        return util.exportExcel(list, "领用单明细数据");
-    }
-
-    /**
-     * 获取领用单明细详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrderItem:query')")
-    @GetMapping(value = "/{itemId}")
-    public AjaxResult getInfo(@PathVariable("itemId") Long itemId)
-    {
-        return AjaxResult.success(hospitalProductOutOrderItemService.selectHospitalProductOutOrderItemByItemId(itemId));
-    }
-
-    /**
-     * 新增领用单明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrderItem:add')")
-    @Log(title = "领用单明细", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalProductOutOrderItem hospitalProductOutOrderItem)
-    {
-        return toAjax(hospitalProductOutOrderItemService.insertHospitalProductOutOrderItem(hospitalProductOutOrderItem));
-    }
-
-    /**
-     * 修改领用单明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrderItem:edit')")
-    @Log(title = "领用单明细", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalProductOutOrderItem hospitalProductOutOrderItem)
-    {
-        return toAjax(hospitalProductOutOrderItemService.updateHospitalProductOutOrderItem(hospitalProductOutOrderItem));
-    }
-
-    /**
-     * 删除领用单明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalProductOutOrderItem:remove')")
-    @Log(title = "领用单明细", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{itemIds}")
-    public AjaxResult remove(@PathVariable Long[] itemIds)
-    {
-        return toAjax(hospitalProductOutOrderItemService.deleteHospitalProductOutOrderItemByItemIds(itemIds));
-    }
-}

+ 0 - 159
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductPurchaseOrderController.java

@@ -1,159 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.domain.HospitalProductPurchaseOrderItem;
-import com.fs.hospital.param.HospitalProductPurchaseOrderAddEditParam;
-import com.fs.hospital.param.HospitalProductPurchaseOrderParam;
-import com.fs.hospital.service.IHospitalProductPurchaseOrderItemService;
-import com.fs.hospital.vo.HospitalProductPurchaseOrderHVO;
-import com.fs.hospital.vo.HospitalProductPurchaseOrderItemHVO;
-import com.fs.hospital.vo.HospitalProductPurchaseOrdeHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalProductPurchaseOrder;
-import com.fs.hospital.service.IHospitalProductPurchaseOrderService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 采购单Controller
- *
- * @author fs
- * @date 2024-03-12
- */
-@RestController
-@RequestMapping("/hospital/hospitalPurchaseOrder")
-public class HospitalProductPurchaseOrderController extends BaseController
-{
-    @Autowired
-    private IHospitalProductPurchaseOrderService hospitalPurchaseOrderService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    @Autowired
-    private IHospitalProductPurchaseOrderItemService hospitalPurchaseOrderItemService;
-
-    /**
-     * 查询采购单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrder:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalProductPurchaseOrderParam param)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalProductPurchaseOrdeHVO> list = hospitalPurchaseOrderService.selectHospitalPurchaseOrderListPVO(param);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出采购单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrder:export')")
-    @Log(title = "采购单", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalProductPurchaseOrder hospitalProductPurchaseOrder)
-    {
-        List<HospitalProductPurchaseOrder> list = hospitalPurchaseOrderService.selectHospitalPurchaseOrderList(hospitalProductPurchaseOrder);
-        ExcelUtil<HospitalProductPurchaseOrder> util = new ExcelUtil<HospitalProductPurchaseOrder>(HospitalProductPurchaseOrder.class);
-        return util.exportExcel(list, "采购单数据");
-    }
-
-    /**
-     * 获取采购单详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrder:query')")
-    @GetMapping(value = "/{orderId}")
-    public R getInfo(@PathVariable("orderId") Long orderId)
-    {
-        HospitalProductPurchaseOrderHVO order = hospitalPurchaseOrderService.selectHospitalPurchaseOrderHVOByOrderId(orderId);
-        HospitalProductPurchaseOrderItem item = new HospitalProductPurchaseOrderItem();
-        item.setOrderId(orderId);
-        List<HospitalProductPurchaseOrderItemHVO> items = hospitalPurchaseOrderItemService.selectHospitalPurchaseOrderItemListPVO(item);
-        Map<String,Object> maps=new HashMap<>();
-        maps.put("order",order);
-        maps.put("items",items);
-        return R.ok().put("data",maps);
-    }
-
-    /**
-     * 新增采购入库
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrder:add')")
-    @Log(title = "采购单", businessType = BusinessType.INSERT)
-    @PostMapping("/addPurchaseOrder")
-    public R add(@Validated @RequestBody HospitalProductPurchaseOrderAddEditParam param)
-    {
-        if (param.getItemList()==null||param.getItemList().size()==0){
-            return R.error("请添加商品");
-        }
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        param.setUserId(loginUser.getUser().getUserId());
-        param.setStatus(1);
-        return hospitalPurchaseOrderService.insertHospitalPurchaseOrder(param);
-    }
-
-    /**
-     * 新增退货出库
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrder:addSales')")
-    @PostMapping("/addSales")
-    public R addSales(@Validated @RequestBody HospitalProductPurchaseOrderAddEditParam param)
-    {
-        if (param.getItemList()==null||param.getItemList().size()==0){
-            return R.error("退货商品不能为空");
-        }
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        param.setUserId(loginUser.getUser().getUserId());
-        param.setStatus(1);
-        return hospitalPurchaseOrderService.addSalesOut(param);
-    }
-
-
-
-    /**
-     * 修改采购单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrder:edit')")
-    @Log(title = "采购单", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalProductPurchaseOrder hospitalProductPurchaseOrder)
-    {
-        return toAjax(hospitalPurchaseOrderService.updateHospitalPurchaseOrder(hospitalProductPurchaseOrder));
-    }
-
-    /**
-     * 删除采购单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrder:remove')")
-    @Log(title = "采购单", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{orderIds}")
-    public AjaxResult remove(@PathVariable Long[] orderIds)
-    {
-        return toAjax(hospitalPurchaseOrderService.deleteHospitalPurchaseOrderByOrderIds(orderIds));
-    }
-}

+ 0 - 103
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProductPurchaseOrderItemController.java

@@ -1,103 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalProductPurchaseOrderItem;
-import com.fs.hospital.service.IHospitalProductPurchaseOrderItemService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 采购单明细Controller
- *
- * @author fs
- * @date 2024-03-12
- */
-@RestController
-@RequestMapping("/hospital/hospitalPurchaseOrderItem")
-public class HospitalProductPurchaseOrderItemController extends BaseController
-{
-    @Autowired
-    private IHospitalProductPurchaseOrderItemService hospitalPurchaseOrderItemService;
-
-    /**
-     * 查询采购单明细列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrderItem:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalProductPurchaseOrderItem hospitalProductPurchaseOrderItem)
-    {
-        startPage();
-        List<HospitalProductPurchaseOrderItem> list = hospitalPurchaseOrderItemService.selectHospitalPurchaseOrderItemList(hospitalProductPurchaseOrderItem);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出采购单明细列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrderItem:export')")
-    @Log(title = "采购单明细", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalProductPurchaseOrderItem hospitalProductPurchaseOrderItem)
-    {
-        List<HospitalProductPurchaseOrderItem> list = hospitalPurchaseOrderItemService.selectHospitalPurchaseOrderItemList(hospitalProductPurchaseOrderItem);
-        ExcelUtil<HospitalProductPurchaseOrderItem> util = new ExcelUtil<HospitalProductPurchaseOrderItem>(HospitalProductPurchaseOrderItem.class);
-        return util.exportExcel(list, "采购单明细数据");
-    }
-
-    /**
-     * 获取采购单明细详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrderItem:query')")
-    @GetMapping(value = "/{itemId}")
-    public AjaxResult getInfo(@PathVariable("itemId") Long itemId)
-    {
-        return AjaxResult.success(hospitalPurchaseOrderItemService.selectHospitalPurchaseOrderItemByItemId(itemId));
-    }
-
-    /**
-     * 新增采购单明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrderItem:add')")
-    @Log(title = "采购单明细", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalProductPurchaseOrderItem hospitalProductPurchaseOrderItem)
-    {
-        return toAjax(hospitalPurchaseOrderItemService.insertHospitalPurchaseOrderItem(hospitalProductPurchaseOrderItem));
-    }
-
-    /**
-     * 修改采购单明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrderItem:edit')")
-    @Log(title = "采购单明细", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalProductPurchaseOrderItem hospitalProductPurchaseOrderItem)
-    {
-        return toAjax(hospitalPurchaseOrderItemService.updateHospitalPurchaseOrderItem(hospitalProductPurchaseOrderItem));
-    }
-
-    /**
-     * 删除采购单明细
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalPurchaseOrderItem:remove')")
-    @Log(title = "采购单明细", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{itemIds}")
-    public AjaxResult remove(@PathVariable Long[] itemIds)
-    {
-        return toAjax(hospitalPurchaseOrderItemService.deleteHospitalPurchaseOrderItemByItemIds(itemIds));
-    }
-}

+ 0 - 134
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalProfileController.java

@@ -1,134 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.annotation.Log;
-import com.fs.common.config.FSConfig;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.file.FileUploadUtils;
-import com.fs.hospital.domain.HospitalUser;
-
-import com.fs.hospital.param.HospitalUserEditParam;
-import com.fs.hospital.service.IHospitalDeptService;
-import com.fs.hospital.service.IHospitalUserService;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.security.SecurityUtils;
-import com.fs.framework.service.TokenService;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.IOException;
-
-/**
- * 个人信息
- */
-
-@RestController
-@RequestMapping("hospital/user/profile")
-public class HospitalProfileController extends BaseController
-{
-    @Autowired
-    private IHospitalUserService userService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    @Autowired
-    private IHospitalDeptService deptService;
-
-    /**
-     * 个人信息
-     */
-    @GetMapping
-    public AjaxResult profile()
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        HospitalUser user = loginUser.getUser();
-        AjaxResult ajax = AjaxResult.success(user);
-        ajax.put("dept", deptService.selectHospitalDeptByDeptId(user.getDeptId()));
-        ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername()));
-        ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername()));
-        return ajax;
-    }
-
-
-
-    /**
-     * 修改用户
-     */
-    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult updateProfile(@RequestBody HospitalUserEditParam param)
-    {
-        HospitalUser user=new HospitalUser();
-        BeanUtils.copyProperties(param,user);
-
-        if (userService.updateUserProfile(user) > 0)
-        {
-            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-            // 更新缓存用户信息
-            loginUser.getUser().setNickName(user.getNickName());
-            loginUser.getUser().setMobile(user.getMobile());
-            loginUser.getUser().setEmail(user.getEmail());
-            loginUser.getUser().setSex(user.getSex());
-            tokenService.setLoginUser(loginUser);
-            return AjaxResult.success();
-        }
-        return AjaxResult.error("修改个人信息异常,请联系管理员");
-    }
-
-    /**
-     * 重置密码
-     */
-    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
-    @PutMapping("/updatePwd")
-    public AjaxResult updatePwd(String oldPassword, String newPassword)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        String userName = loginUser.getUsername();
-        String password = loginUser.getPassword();
-        if (!SecurityUtils.matchesPassword(oldPassword, password))
-        {
-            return AjaxResult.error("修改密码失败,旧密码错误");
-        }
-        if (SecurityUtils.matchesPassword(newPassword, password))
-        {
-            return AjaxResult.error("新密码不能与旧密码相同");
-        }
-        if (userService.resetUserPwd(userName, SecurityUtils.encryptPassword(newPassword)) > 0)
-        {
-            // 更新缓存用户密码
-            loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
-            tokenService.setLoginUser(loginUser);
-            return AjaxResult.success();
-        }
-        return AjaxResult.error("修改密码异常,请联系管理员");
-    }
-
-    /**
-     * 头像上传
-     */
-    @Log(title = "用户头像", businessType = BusinessType.UPDATE)
-    @PostMapping("/avatar")
-    public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException
-    {
-        if (!file.isEmpty())
-        {
-            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-            String avatar = FileUploadUtils.upload(FSConfig.getAvatarPath(), file);
-            if (userService.updateUserAvatar(loginUser.getUsername(), avatar)>0)
-            {
-                AjaxResult ajax = AjaxResult.success();
-                ajax.put("imgUrl", avatar);
-                // 更新缓存用户头像
-                loginUser.getUser().setAvatar(avatar);
-                tokenService.setLoginUser(loginUser);
-                return ajax;
-            }
-        }
-        return AjaxResult.error("上传图片异常,请联系管理员");
-    }
-}

+ 0 - 193
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalRoleController.java

@@ -1,193 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.annotation.Log;
-import com.fs.common.constant.UserConstants;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.page.TableDataInfo;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.hospital.domain.HospitalRole;
-import com.fs.hospital.service.IHospitalRoleService;
-import com.fs.hospital.service.IHospitalUserService;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.security.SecurityUtils;
-import com.fs.framework.service.HospitalPermissionService;
-import com.fs.framework.service.TokenService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * 角色信息
- *
-
- */
-@RestController
-@RequestMapping("/hospital/role")
-public class HospitalRoleController extends BaseController
-{
-    @Autowired
-    private IHospitalRoleService roleService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    @Autowired
-    private HospitalPermissionService permissionService;
-
-    @Autowired
-    private IHospitalUserService userService;
-
-    @PreAuthorize("@ss.hasPermi('hospital:role:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalRole role)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        role.setHospitalId(loginUser.getHospital().getHospitalId());
-        startPage();
-        List<HospitalRole> list = roleService.selectHospitalRoleList(role);
-        return getDataTable(list);
-    }
-
-    @Log(title = "角色管理", businessType = BusinessType.EXPORT)
-    @PreAuthorize("@ss.hasPermi('hospital:role:export')")
-    @GetMapping("/export")
-    public AjaxResult export(HospitalRole role)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        role.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalRole> list = roleService.selectHospitalRoleList(role);
-        ExcelUtil<HospitalRole> util = new ExcelUtil<HospitalRole>(HospitalRole.class);
-        return util.exportExcel(list, "角色数据");
-    }
-
-    /**
-     * 根据角色编号获取详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:role:query')")
-    @GetMapping(value = "/{roleId}")
-    public AjaxResult getInfo(@PathVariable Long roleId)
-    {
-        return AjaxResult.success(roleService.selectHospitalRoleByRoleId(roleId));
-    }
-
-    /**
-     * 新增角色
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:role:add')")
-    @Log(title = "角色管理", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@Validated @RequestBody HospitalRole role)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        role.setHospitalId(loginUser.getHospital().getHospitalId());
-        role.setCreateTime(new Date());
-        if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
-        {
-            return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
-        }
-        else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
-        {
-            return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
-        }
-        role.setCreateBy(SecurityUtils.getUsername());
-        return toAjax(roleService.insertRole(role));
-
-    }
-
-    /**
-     * 修改保存角色
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:role:edit')")
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@Validated @RequestBody HospitalRole role)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        role.setHospitalId(loginUser.getHospital().getHospitalId());
-        if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
-        {
-            return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
-        }
-        else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
-        {
-            return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
-        }
-        role.setUpdateBy(SecurityUtils.getUsername());
-
-        if (roleService.updateRole(role) > 0)
-        {
-            // 更新缓存用户权限
-            if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
-            {
-                loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
-                loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
-                tokenService.setLoginUser(loginUser);
-            }
-            return AjaxResult.success();
-        }
-        return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
-    }
-
-    /**
-     * 修改保存数据权限
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:role:edit')")
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @PutMapping("/dataScope")
-    public AjaxResult dataScope(@RequestBody HospitalRole role)
-    {
-        return toAjax(roleService.authDataScope(role));
-    }
-
-    /**
-     * 状态修改
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:role:edit')")
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @PutMapping("/changeStatus")
-    public AjaxResult changeStatus(@RequestBody HospitalRole role)
-    {
-        HospitalRole hospitalRole=roleService.selectHospitalRoleByRoleId(role.getRoleId());
-        if(hospitalRole.getRoleKey().equals("admin")){
-            return AjaxResult.error("管理员角色不能修改状态");
-        }
-        role.setUpdateBy(SecurityUtils.getUsername());
-        return toAjax(roleService.updateRoleStatus(role));
-    }
-
-    /**
-     * 删除角色
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:role:remove')")
-    @Log(title = "角色管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{roleIds}")
-    public AjaxResult remove(@PathVariable Long[] roleIds)
-    {
-
-        return toAjax(roleService.deleteHospitalRoleByRoleIds(roleIds));
-    }
-
-    /**
-     * 获取角色选择框列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:role:query')")
-    @GetMapping("/optionselect")
-    public AjaxResult optionselect()
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        HospitalRole role=new HospitalRole();
-        role.setHospitalId(loginUser.getHospital().getHospitalId());
-        return AjaxResult.success(roleService.selectHospitalRoleList(role));
-    }
-
-
-
-}

+ 0 - 27
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalStatisticsController.java

@@ -1,27 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.his.service.IFsDataService;
-import com.fs.his.vo.OrderDataVO;
-import com.fs.hospital.domain.Hospital;
-import com.fs.hospital.service.IHospitalStatisticsService;
-import com.fs.hospital.service.impl.HospitalStatisticsServiceImpl;
-import com.fs.hospital.vo.HospitalStatisticsVO;
-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.RestController;
-
-@RestController
-@RequestMapping("/hospital/statistics")
-public class HospitalStatisticsController {
-    @Autowired
-    IHospitalStatisticsService hospitalStatisticsService;
-
-
-    @GetMapping("/orderData")
-    public AjaxResult list() {
-        HospitalStatisticsVO vo = hospitalStatisticsService.getIndexStatisticsVO();
-        return AjaxResult.success(vo);
-    }
-}

+ 0 - 141
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalStoreController.java

@@ -1,141 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.his.domain.FsStore;
-import com.fs.his.service.IFsStoreService;
-import com.fs.hospital.param.HospitalStoreParam;
-import com.fs.hospital.vo.HospitalStoreHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalStore;
-import com.fs.hospital.service.IHospitalStoreService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * 诊所供应商关联Controller
- *
- * @author fs
- * @date 2024-03-12
- */
-@RestController
-@RequestMapping("/hospital/hospitalStore")
-public class HospitalStoreController extends BaseController
-{
-    @Autowired
-    private IHospitalStoreService hospitalStoreService;
-    @Autowired
-    private IFsStoreService storeService;
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询诊所供应商关联列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalStore:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalStoreParam param)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        param.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalStoreHVO> list = hospitalStoreService.selectHospitalStoreListPVO(param);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出诊所供应商关联列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalStore:export')")
-    @Log(title = "诊所供应商关联", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalStore hospitalStore)
-    {
-        List<HospitalStore> list = hospitalStoreService.selectHospitalStoreList(hospitalStore);
-        ExcelUtil<HospitalStore> util = new ExcelUtil<HospitalStore>(HospitalStore.class);
-        return util.exportExcel(list, "诊所供应商关联数据");
-    }
-
-    /**
-     * 获取诊所供应商关联详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalStore:query')")
-    @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
-        return AjaxResult.success(hospitalStoreService.selectHospitalStoreById(id));
-    }
-
-    /**
-     * 新增诊所供应商关联
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalStore:add')")
-    @Log(title = "诊所供应商关联", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalStore hospitalStore)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalStore.setHospitalId( loginUser.getHospital().getHospitalId());
-        return toAjax(hospitalStoreService.insertHospitalStore(hospitalStore));
-    }
-
-    /**
-     * 修改诊所供应商关联
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalStore:edit')")
-    @Log(title = "诊所供应商关联", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalStore hospitalStore)
-    {
-        return toAjax(hospitalStoreService.updateHospitalStore(hospitalStore));
-    }
-
-    /**
-     * 删除诊所供应商关联
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalStore:remove')")
-    @Log(title = "诊所供应商关联", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
-        return toAjax(hospitalStoreService.deleteHospitalStoreByIds(ids));
-    }
-
-    @GetMapping("/getStoreList")
-    public R getStoreList(HttpServletRequest request){
-        FsStore map=new FsStore();
-        map.setStatus(1);
-        map.setIsAudit(1);
-        List<FsStore> stores=storeService.selectFsStoreList(map);
-        return R.ok().put("data", stores);
-    }
-
-    @GetMapping("/getHospitalStoreList")
-    public R getHospitalStoreList(HttpServletRequest request){
-        HospitalStoreParam map=new HospitalStoreParam();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        map.setHospitalId( loginUser.getHospital().getHospitalId());
-        map.setStatus(1);
-        List<HospitalStoreHVO> list = hospitalStoreService.selectHospitalStoreListPVO(map);
-        return R.ok().put("data", list);
-    }
-}

+ 0 - 117
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalTreatItemController.java

@@ -1,117 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.annotation.RepeatSubmit;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalTreatItem;
-import com.fs.hospital.service.IHospitalTreatItemService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 治疗Controller
- *
- * @author fs
- * @date 2024-03-26
- */
-@RestController
-@RequestMapping("/hospital/hospitalTreatItem")
-public class HospitalTreatItemController extends BaseController
-{
-    @Autowired
-    private IHospitalTreatItemService hospitalTreatItemService;
-    @Autowired
-    private TokenService tokenService;
-
-    /**
-     * 查询治疗列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatItem:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalTreatItem hospitalTreatItem)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalTreatItem.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalTreatItem> list = hospitalTreatItemService.selectHospitalTreatItemList(hospitalTreatItem);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出治疗列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatItem:export')")
-    @Log(title = "治疗", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalTreatItem hospitalTreatItem)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalTreatItem.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalTreatItem> list = hospitalTreatItemService.selectHospitalTreatItemList(hospitalTreatItem);
-        ExcelUtil<HospitalTreatItem> util = new ExcelUtil<HospitalTreatItem>(HospitalTreatItem.class);
-        return util.exportExcel(list, "治疗数据");
-    }
-
-    /**
-     * 获取治疗详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatItem:query')")
-    @GetMapping(value = "/{treatId}")
-    public AjaxResult getInfo(@PathVariable("treatId") Long treatId)
-    {
-        return AjaxResult.success(hospitalTreatItemService.selectHospitalTreatItemByTreatId(treatId));
-    }
-
-    /**
-     * 新增治疗
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatItem:add')")
-    @Log(title = "治疗", businessType = BusinessType.INSERT)
-    @PostMapping
-    @RepeatSubmit
-    public AjaxResult add(@RequestBody HospitalTreatItem hospitalTreatItem)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalTreatItem.setHospitalId(loginUser.getHospital().getHospitalId());
-        return toAjax(hospitalTreatItemService.insertHospitalTreatItem(hospitalTreatItem));
-    }
-
-    /**
-     * 修改治疗
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatItem:edit')")
-    @Log(title = "治疗", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalTreatItem hospitalTreatItem)
-    {
-        return toAjax(hospitalTreatItemService.updateHospitalTreatItem(hospitalTreatItem));
-    }
-
-    /**
-     * 删除治疗
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatItem:remove')")
-    @Log(title = "治疗", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{treatIds}")
-    public AjaxResult remove(@PathVariable Long[] treatIds)
-    {
-        return toAjax(hospitalTreatItemService.deleteHospitalTreatItemByTreatIds(treatIds));
-    }
-}

+ 0 - 165
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalTreatOrderController.java

@@ -1,165 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.HashMap;
-import java.util.List;
-
-import com.fs.common.annotation.RepeatSubmit;
-import com.fs.common.core.domain.R;
-import com.fs.common.utils.ServletUtils;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.service.TokenService;
-import com.fs.hospital.domain.HospitalOrderItem;
-import com.fs.hospital.domain.HospitalOrderItemLogs;
-import com.fs.hospital.domain.HospitalTreatOrderLogs;
-import com.fs.hospital.param.HospitalOutpatientOrderFinishParam;
-import com.fs.hospital.param.HospitalTreatOrderAddParam;
-import com.fs.hospital.param.HospitalTreatOrderExecuteParam;
-import com.fs.hospital.param.HospitalTreatOrderHParam;
-import com.fs.hospital.service.IHospitalOrderItemLogsService;
-import com.fs.hospital.service.IHospitalTreatOrderLogsService;
-import com.fs.hospital.vo.HospitalOrderItemListHVO;
-import com.fs.hospital.vo.HospitalTreatOrderHVO;
-import com.fs.hospital.vo.HospitalTreatOrderListHVO;
-import com.fs.hospital.vo.HospitalTreatOrderLogsHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalTreatOrder;
-import com.fs.hospital.service.IHospitalTreatOrderService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 执行Controller
- *
- * @author fs
- * @date 2024-03-22
- */
-@RestController
-@RequestMapping("/hospital/hospitalTreatOrder")
-public class HospitalTreatOrderController extends BaseController
-{
-    @Autowired
-    private IHospitalTreatOrderService hospitalTreatOrderService;
-    @Autowired
-    private TokenService tokenService;
-    @Autowired
-    private IHospitalTreatOrderLogsService hospitalTreatOrderLogsService;
-
-    @Autowired
-    private IHospitalOrderItemLogsService iHospitalOrderItemLogsService;
-    /**
-     * 查询执行单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrder:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalTreatOrderHParam hospitalTreatOrder)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalTreatOrder.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalTreatOrderListHVO> list = hospitalTreatOrderService.selectHospitalTreatOrderListHVO(hospitalTreatOrder);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出执行单列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrder:export')")
-    @Log(title = "治疗单", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalTreatOrder hospitalTreatOrder)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalTreatOrder.setHospitalId( loginUser.getHospital().getHospitalId());
-        List<HospitalTreatOrder> list = hospitalTreatOrderService.selectHospitalTreatOrderList(hospitalTreatOrder);
-        ExcelUtil<HospitalTreatOrder> util = new ExcelUtil<HospitalTreatOrder>(HospitalTreatOrder.class);
-        return util.exportExcel(list, "治疗单数据");
-    }
-
-    /**
-     * 获取治疗单详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrder:query')")
-    @GetMapping(value = "/{orderId}")
-    public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
-    {
-        HospitalTreatOrderLogs hospitalTreatOrderLogs = new HospitalTreatOrderLogs();
-        hospitalTreatOrderLogs.setOrderId(orderId);
-        List<HospitalTreatOrderLogsHVO> list = hospitalTreatOrderLogsService.selectHospitalTreatOrderLogsListVO(hospitalTreatOrderLogs);
-        List<HospitalOrderItemLogs> hospitalOrderItemLogs = iHospitalOrderItemLogsService.selectHospitalOrderItemLogsList(orderId);
-        HospitalTreatOrderHVO hospitalTreatOrder = hospitalTreatOrderService.selectHospitalTreatOrderHVOByOrderId(orderId);
-        List<HospitalOrderItemListHVO> orderItemListHVOS = hospitalTreatOrderService.selectOrderItemByTreatId(orderId);
-        HashMap<String, Object> map = new HashMap<>();
-        map.put("logs",list);
-        map.put("order",hospitalTreatOrder);
-        map.put("orderItems",orderItemListHVOS);
-        map.put("itemLogs",hospitalOrderItemLogs);
-        return AjaxResult.success(map);
-    }
-
-    /**
-     * 新增治疗单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrder:add')")
-    @Log(title = "治疗单", businessType = BusinessType.INSERT)
-    @PostMapping
-    @RepeatSubmit
-    public R add(@RequestBody HospitalTreatOrder hospitalTreatOrder)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalTreatOrder.setHospitalId( loginUser.getHospital().getHospitalId());
-        return hospitalTreatOrderService.insertHospitalTreatOrder(hospitalTreatOrder);
-    }
-
-    @Log(title = "完成开单", businessType = BusinessType.INSERT)
-    @PostMapping("finishTreatOrder")
-    public R finishTreatOrder(@RequestBody HospitalTreatOrderAddParam param)
-    {
-        return hospitalTreatOrderService.finishTreatOrder(param);
-    }
-
-    /**
-     * 修改治疗单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrder:edit')")
-    @Log(title = "治疗单", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalTreatOrder hospitalTreatOrder)
-    {
-        return toAjax(hospitalTreatOrderService.updateHospitalTreatOrder(hospitalTreatOrder));
-    }
-
-    /**
-     * 删除治疗单
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrder:remove')")
-    @Log(title = "治疗单", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{orderIds}")
-    public AjaxResult remove(@PathVariable Long[] orderIds)
-    {
-        return toAjax(hospitalTreatOrderService.deleteHospitalTreatOrderByOrderIds(orderIds));
-    }
-
-    @Log(title = "执行", businessType = BusinessType.UPDATE)
-    @PostMapping("/execute")
-    public R itemExecute(@RequestBody HospitalTreatOrderExecuteParam param)
-    {
-       return hospitalTreatOrderService.itemExecute(param);
-    }
-
-    /**
-     *  查询要执行的订单
-     */
-    @GetMapping("/getExecuteList")
-    public R getExecuteList(@RequestParam("orderId") Long orderId)
-    {
-        List<HospitalOrderItemListHVO> orderItemListHVOS = hospitalTreatOrderService.selectOrderItemByExecute(orderId);
-        return R.ok().put("data",orderItemListHVOS);
-    }
-
-}

+ 0 - 107
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalTreatOrderLogsController.java

@@ -1,107 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-
-import com.fs.common.annotation.RepeatSubmit;
-import com.fs.hospital.vo.HospitalTreatOrderLogsHVO;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalTreatOrderLogs;
-import com.fs.hospital.service.IHospitalTreatOrderLogsService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 治疗记录Controller
- *
- * @author fs
- * @date 2024-03-26
- */
-@RestController
-@RequestMapping("/hospital/hospitalTreatOrderLogs")
-public class HospitalTreatOrderLogsController extends BaseController
-{
-    @Autowired
-    private IHospitalTreatOrderLogsService hospitalTreatOrderLogsService;
-
-    /**
-     * 查询治疗记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrderLogs:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalTreatOrderLogs hospitalTreatOrderLogs)
-    {
-        startPage();
-        List<HospitalTreatOrderLogsHVO> list = hospitalTreatOrderLogsService.selectHospitalTreatOrderLogsListVO(hospitalTreatOrderLogs);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出治疗记录列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrderLogs:export')")
-    @Log(title = "治疗记录", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalTreatOrderLogs hospitalTreatOrderLogs)
-    {
-        List<HospitalTreatOrderLogs> list = hospitalTreatOrderLogsService.selectHospitalTreatOrderLogsList(hospitalTreatOrderLogs);
-        ExcelUtil<HospitalTreatOrderLogs> util = new ExcelUtil<HospitalTreatOrderLogs>(HospitalTreatOrderLogs.class);
-        return util.exportExcel(list, "治疗记录数据");
-    }
-
-    /**
-     * 获取治疗记录详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrderLogs:query')")
-    @GetMapping(value = "/{logsId}")
-    public AjaxResult getInfo(@PathVariable("logsId") Long logsId)
-    {
-        return AjaxResult.success(hospitalTreatOrderLogsService.selectHospitalTreatOrderLogsByLogsId(logsId));
-    }
-
-    /**
-     * 新增治疗记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrderLogs:add')")
-    @Log(title = "治疗记录", businessType = BusinessType.INSERT)
-    @PostMapping
-    @RepeatSubmit
-    public AjaxResult add(@RequestBody HospitalTreatOrderLogs hospitalTreatOrderLogs)
-    {
-        return toAjax(hospitalTreatOrderLogsService.insertHospitalTreatOrderLogs(hospitalTreatOrderLogs));
-    }
-
-    /**
-     * 修改治疗记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrderLogs:edit')")
-    @Log(title = "治疗记录", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalTreatOrderLogs hospitalTreatOrderLogs)
-    {
-        return toAjax(hospitalTreatOrderLogsService.updateHospitalTreatOrderLogs(hospitalTreatOrderLogs));
-    }
-
-    /**
-     * 删除治疗记录
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalTreatOrderLogs:remove')")
-    @Log(title = "治疗记录", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{logsIds}")
-    public AjaxResult remove(@PathVariable Long[] logsIds)
-    {
-        return toAjax(hospitalTreatOrderLogsService.deleteHospitalTreatOrderLogsByLogsIds(logsIds));
-    }
-}

+ 0 - 266
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalUserController.java

@@ -1,266 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.fs.common.annotation.Log;
-import com.fs.common.constant.UserConstants;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.domain.R;
-import com.fs.common.core.page.TableDataInfo;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.hospital.domain.Hospital;
-import com.fs.hospital.domain.HospitalPost;
-import com.fs.hospital.domain.HospitalRole;
-import com.fs.hospital.domain.HospitalUser;
-import com.fs.hospital.dto.UserPriceDTO;
-import com.fs.hospital.service.IHospitalPostService;
-import com.fs.hospital.service.IHospitalRoleService;
-import com.fs.hospital.service.IHospitalService;
-import com.fs.hospital.service.IHospitalUserService;
-import com.fs.hospital.vo.HospitalUserListHVO;
-import com.fs.hospital.vo.HospitalUserHVO;
-import com.fs.framework.security.LoginUser;
-import com.fs.framework.security.SecurityUtils;
-import com.fs.framework.service.TokenService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * 企业员工信息Controller
- *
- * @author fs
- * @date 2021-10-04
- */
-@RestController
-@RequestMapping("/hospital/user")
-public class HospitalUserController extends BaseController
-{
-    @Autowired
-    private IHospitalRoleService roleService;
-
-    @Autowired
-    private IHospitalPostService postService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    @Autowired
-    private IHospitalUserService hospitalUserService;
-    @Autowired
-    private IHospitalService hospitalService;
-
-    /**
-     * 获取用户列表
-     */
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalUser user)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        user.setHospitalId(loginUser.getHospital().getHospitalId());
-        startPage();
-        List<HospitalUserListHVO> list = hospitalUserService.selectHospitalUserListVO(user);
-        return getDataTable(list);
-    }
-    @GetMapping("/getUserList")
-    public R getUserList()
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        HospitalUser map = new HospitalUser();
-        map.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalUser> list = hospitalUserService.selectHospitalUserList(map);
-        return  R.ok().put("data",list);
-    }
-    @GetMapping("/getList")
-    public TableDataInfo getList(HospitalUser user)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        user.setHospitalId(loginUser.getHospital().getHospitalId());
-        startPage();
-        List<HospitalUser> list = hospitalUserService.selectHospitalUserList(user);
-        return getDataTable(list);
-    }
-
-    @Log(title = "用户管理", businessType = BusinessType.EXPORT)
-    @PreAuthorize("@ss.hasPermi('hospital:user:export')")
-    @GetMapping("/export")
-    public AjaxResult export(HospitalUser user)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        user.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalUser> list = hospitalUserService.selectHospitalUserList(user);
-        ExcelUtil<HospitalUser> util = new ExcelUtil<HospitalUser>(HospitalUser.class);
-        return util.exportExcel(list, "用户数据");
-    }
-
-
-
-    /**
-     * 根据用户编号获取详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:user:query')")
-    @GetMapping(value = { "/", "/{userId}" })
-    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
-    {
-        AjaxResult ajax = AjaxResult.success();
-        HospitalRole hospitalRoleMap=new HospitalRole();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        hospitalRoleMap.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalRole> roles = roleService.selectHospitalRoleList(hospitalRoleMap);
-
-        ajax.put("roles", HospitalUser.isAdmin(loginUser.getUser().getUserType()) ? roles : roles.stream().filter(r -> r.getRoleKey()!="admin").collect(Collectors.toList()));
-
-        HospitalPost postMap=new HospitalPost();
-        postMap.setHospitalId(loginUser.getHospital().getHospitalId());
-        ajax.put("posts", postService.selectHospitalPostList(postMap));
-        if (StringUtils.isNotNull(userId))
-        {
-            HospitalUser hospitalUser=hospitalUserService.selectHospitalUserByUserId(userId);
-            ajax.put(AjaxResult.DATA_TAG, hospitalUser);
-            ajax.put("postIds", postService.selectPostListByUserId(userId));
-            ajax.put("roleIds", roleService.selectRoleListByUserId(userId));
-        }
-        return ajax;
-    }
-
-    /**
-     * 新增用户
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:user:add')")
-    @Log(title = "用户管理", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@Validated @RequestBody HospitalUser user)
-    {
-        JSONObject jsonObject = JSON.parseObject(user.getPriceJson());
-        if (jsonObject.isEmpty()){
-            return AjaxResult.error("价格配置不能为空");
-        }
-        //判断用户数量是否已达到上线
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        Integer count=hospitalUserService.selectHospitalUserCountByHospitalId(loginUser.getHospital().getHospitalId());
-        Hospital hospital = hospitalService.selectHospitalByHospitalId(loginUser.getHospital().getHospitalId());
-
-        if(count>hospital.getLimitUserCount()){
-            return AjaxResult.error("用户数量已达到上限");
-        }
-        user.setHospitalId(loginUser.getHospital().getHospitalId());
-        if (UserConstants.NOT_UNIQUE.equals(hospitalUserService.checkUserNameUnique(user.getUserName())))
-        {
-            return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
-        }
-        user.setCreateBy(SecurityUtils.getUsername());
-        user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
-        user.setCreateTime(new Date());
-        user.setUserType("01");//一般用户
-        return toAjax(hospitalUserService.insertHospitalUser(user));
-    }
-
-    /**
-     * 修改用户
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:user:edit')")
-    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@Validated @RequestBody HospitalUser user)
-    {
-        user.setUpdateBy(SecurityUtils.getUsername());
-        return toAjax(hospitalUserService.updateHospitalUser(user));
-    }
-
-    /**
-     * 删除用户
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:user:remove')")
-    @Log(title = "用户管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{userIds}")
-    public AjaxResult remove(@PathVariable Long[] userIds)
-    {
-        return toAjax(hospitalUserService.deleteHospitalUserByUserIds(userIds));
-    }
-
-    /**
-     * 重置密码
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:user:edit')")
-    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
-    @PutMapping("/resetPwd")
-    public AjaxResult resetPwd(@RequestBody HospitalUser user)
-    {
-        return toAjax(hospitalUserService.resetUserPwdByUserId(user.getUserId(), SecurityUtils.encryptPassword(user.getPassword())));
-    }
-
-    /**
-     * 状态修改
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:user:edit')")
-    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
-    @PutMapping("/changeStatus")
-    public AjaxResult changeStatus(@RequestBody HospitalUser user)
-    {
-        //管理员的状态不能修改
-        HospitalUser hospitalUser=hospitalUserService.selectHospitalUserByUserId(user.getUserId());
-        if(hospitalUser.isAdmin()){
-            return AjaxResult.error("不能修改管理员状态");
-        }
-        user.setUpdateBy(SecurityUtils.getUsername());
-        return toAjax(hospitalUserService.updateHospitalUser(user));
-    }
-
-
-    /**
-     * 获取通讯录
-     * @param user
-     * @return
-     */
-    @GetMapping("/getAddressBookList")
-    public TableDataInfo getAddressBookList(HospitalUser user)
-    {
-        startPage();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        user.setHospitalId(loginUser.getHospital().getHospitalId());
-        List<HospitalUserHVO> list = hospitalUserService.selectMyUserList(user);
-        return getDataTable(list);
-    }
-
-
-//    @GetMapping("/getAllUserlist")
-//    public R getAllUserlist()
-//    {
-//        HospitalUser map=new HospitalUser();
-//        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-//        map.setHospitalId(loginUser.getHospital().getHospitalId());
-//        map.setStatus("1");
-//        List<HospitalUser> list = hospitalUserService.selectHospitalUserList(map);
-//        return R.ok().put("data",list);
-//    }
-
-    @GetMapping("/getUserListByDeptId")
-    public R getUserListByDeptId(HospitalUser user)
-    {
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        user.setHospitalId(loginUser.getHospital().getHospitalId());
-
-        List<HospitalUser> list = hospitalUserService.getUserListByDeptId(user);
-        return R.ok().put("data",list);
-    }
-
-    @GetMapping("/isDoctorList")
-    public R isDoctorList()
-    {
-        HospitalUser user = new HospitalUser();
-        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        user.setHospitalId(loginUser.getHospital().getHospitalId());
-        user.setIsDoctor(1);
-        List<HospitalUserListHVO> list = hospitalUserService.selectHospitalUserListVO(user);
-        return R.ok().put("data",list);
-    }
-}

+ 0 - 97
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalUserPostController.java

@@ -1,97 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.page.TableDataInfo;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.hospital.domain.HospitalUserPost;
-import com.fs.hospital.service.IHospitalUserPostService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 用户与岗位关联Controller
- *
- * @author fs
- * @date 2021-10-04
- */
-@RestController
-@RequestMapping("/hospital/hospitalUserPost")
-public class HospitalUserPostController extends BaseController
-{
-    @Autowired
-    IHospitalUserPostService hospitalUserPostService;
-
-    /**
-     * 查询用户与岗位关联列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserPost:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalUserPost hospitalUserPost)
-    {
-        startPage();
-        List<HospitalUserPost> list = hospitalUserPostService.selectHospitalUserPostList(hospitalUserPost);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出用户与岗位关联列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserPost:export')")
-    @Log(title = "用户与岗位关联", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalUserPost hospitalUserPost)
-    {
-        List<HospitalUserPost> list = hospitalUserPostService.selectHospitalUserPostList(hospitalUserPost);
-        ExcelUtil<HospitalUserPost> util = new ExcelUtil<HospitalUserPost>(HospitalUserPost.class);
-        return util.exportExcel(list, "hospitalUserPost");
-    }
-
-    /**
-     * 获取用户与岗位关联详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserPost:query')")
-    @GetMapping(value = "/{userId}")
-    public AjaxResult getInfo(@PathVariable("userId") Long userId)
-    {
-        return AjaxResult.success(hospitalUserPostService.selectHospitalUserPostByUserId(userId));
-    }
-
-    /**
-     * 新增用户与岗位关联
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserPost:add')")
-    @Log(title = "用户与岗位关联", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalUserPost hospitalUserPost)
-    {
-        return toAjax(hospitalUserPostService.insertHospitalUserPost(hospitalUserPost));
-    }
-
-    /**
-     * 修改用户与岗位关联
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserPost:edit')")
-    @Log(title = "用户与岗位关联", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalUserPost hospitalUserPost)
-    {
-        return toAjax(hospitalUserPostService.updateHospitalUserPost(hospitalUserPost));
-    }
-
-    /**
-     * 删除用户与岗位关联
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserPost:remove')")
-    @Log(title = "用户与岗位关联", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{userIds}")
-    public AjaxResult remove(@PathVariable Long[] userIds)
-    {
-        return toAjax(hospitalUserPostService.deleteHospitalUserPostByUserIds(userIds));
-    }
-}

+ 0 - 97
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalUserRoleController.java

@@ -1,97 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.page.TableDataInfo;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.hospital.domain.HospitalUserRole;
-import com.fs.hospital.service.IHospitalUserRoleService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 用户和角色关联Controller
- *
- * @author fs
- * @date 2021-10-04
- */
-@RestController
-@RequestMapping("/hospital/hospitalUserRole")
-public class HospitalUserRoleController extends BaseController
-{
-    @Autowired
-    private IHospitalUserRoleService hospitalUserRoleService;
-
-    /**
-     * 查询用户和角色关联列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserRole:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalUserRole hospitalUserRole)
-    {
-        startPage();
-        List<HospitalUserRole> list = hospitalUserRoleService.selectHospitalUserRoleList(hospitalUserRole);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出用户和角色关联列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserRole:export')")
-    @Log(title = "用户和角色关联", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalUserRole hospitalUserRole)
-    {
-        List<HospitalUserRole> list = hospitalUserRoleService.selectHospitalUserRoleList(hospitalUserRole);
-        ExcelUtil<HospitalUserRole> util = new ExcelUtil<HospitalUserRole>(HospitalUserRole.class);
-        return util.exportExcel(list, "hospitalUserRole");
-    }
-
-    /**
-     * 获取用户和角色关联详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserRole:query')")
-    @GetMapping(value = "/{userId}")
-    public AjaxResult getInfo(@PathVariable("userId") Long userId)
-    {
-        return AjaxResult.success(hospitalUserRoleService.selectHospitalUserRoleById(userId));
-    }
-
-    /**
-     * 新增用户和角色关联
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserRole:add')")
-    @Log(title = "用户和角色关联", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalUserRole hospitalUserRole)
-    {
-        return toAjax(hospitalUserRoleService.insertHospitalUserRole(hospitalUserRole));
-    }
-
-    /**
-     * 修改用户和角色关联
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserRole:edit')")
-    @Log(title = "用户和角色关联", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalUserRole hospitalUserRole)
-    {
-        return toAjax(hospitalUserRoleService.updateHospitalUserRole(hospitalUserRole));
-    }
-
-    /**
-     * 删除用户和角色关联
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalUserRole:remove')")
-    @Log(title = "用户和角色关联", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{userIds}")
-    public AjaxResult remove(@PathVariable Long[] userIds)
-    {
-        return toAjax(hospitalUserRoleService.deleteHospitalUserRoleByIds(userIds));
-    }
-}

+ 0 - 103
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/HospitalWarehouseController.java

@@ -1,103 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.enums.BusinessType;
-import com.fs.hospital.domain.HospitalWarehouse;
-import com.fs.hospital.service.IHospitalWarehouseService;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.common.core.page.TableDataInfo;
-
-/**
- * 诊所仓库Controller
- *
- * @author fs
- * @date 2024-03-12
- */
-@RestController
-@RequestMapping("/hospital/hospitalWarehouse")
-public class HospitalWarehouseController extends BaseController
-{
-    @Autowired
-    private IHospitalWarehouseService hospitalWarehouseService;
-
-    /**
-     * 查询诊所仓库列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalWarehouse:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalWarehouse hospitalWarehouse)
-    {
-        startPage();
-        List<HospitalWarehouse> list = hospitalWarehouseService.selectHospitalWarehouseList(hospitalWarehouse);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出诊所仓库列表
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalWarehouse:export')")
-    @Log(title = "诊所仓库", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(HospitalWarehouse hospitalWarehouse)
-    {
-        List<HospitalWarehouse> list = hospitalWarehouseService.selectHospitalWarehouseList(hospitalWarehouse);
-        ExcelUtil<HospitalWarehouse> util = new ExcelUtil<HospitalWarehouse>(HospitalWarehouse.class);
-        return util.exportExcel(list, "诊所仓库数据");
-    }
-
-    /**
-     * 获取诊所仓库详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalWarehouse:query')")
-    @GetMapping(value = "/{warehouseId}")
-    public AjaxResult getInfo(@PathVariable("warehouseId") Long warehouseId)
-    {
-        return AjaxResult.success(hospitalWarehouseService.selectHospitalWarehouseByWarehouseId(warehouseId));
-    }
-
-    /**
-     * 新增诊所仓库
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalWarehouse:add')")
-    @Log(title = "诊所仓库", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody HospitalWarehouse hospitalWarehouse)
-    {
-        return toAjax(hospitalWarehouseService.insertHospitalWarehouse(hospitalWarehouse));
-    }
-
-    /**
-     * 修改诊所仓库
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalWarehouse:edit')")
-    @Log(title = "诊所仓库", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody HospitalWarehouse hospitalWarehouse)
-    {
-        return toAjax(hospitalWarehouseService.updateHospitalWarehouse(hospitalWarehouse));
-    }
-
-    /**
-     * 删除诊所仓库
-     */
-    @PreAuthorize("@ss.hasPermi('hospital:hospitalWarehouse:remove')")
-    @Log(title = "诊所仓库", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{warehouseIds}")
-    public AjaxResult remove(@PathVariable Long[] warehouseIds)
-    {
-        return toAjax(hospitalWarehouseService.deleteHospitalWarehouseByWarehouseIds(warehouseIds));
-    }
-}

+ 0 - 77
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/SysDictDataController.java

@@ -1,77 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.domain.entity.SysDictData;
-import com.fs.common.core.page.TableDataInfo;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.system.service.ISysDictDataService;
-import com.fs.system.service.ISysDictTypeService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- * 数据字典信息
- *
-
- */
-@RestController
-@RequestMapping("/system/dict/data")
-public class SysDictDataController extends BaseController
-{
-    @Autowired
-    private ISysDictDataService dictDataService;
-
-    @Autowired
-    private ISysDictTypeService dictTypeService;
-
-    @PreAuthorize("@ss.hasPermi('system:dict:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(SysDictData dictData)
-    {
-        startPage();
-        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
-        return getDataTable(list);
-    }
-
-    @Log(title = "字典数据", businessType = BusinessType.EXPORT)
-    @PreAuthorize("@ss.hasPermi('system:dict:export')")
-    @GetMapping("/export")
-    public AjaxResult export(SysDictData dictData)
-    {
-        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
-        ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
-        return util.exportExcel(list, "字典数据");
-    }
-
-    /**
-     * 查询字典数据详细
-     */
-    @PreAuthorize("@ss.hasPermi('system:dict:query')")
-    @GetMapping(value = "/{dictCode}")
-    public AjaxResult getInfo(@PathVariable Long dictCode)
-    {
-        return AjaxResult.success(dictDataService.selectDictDataById(dictCode));
-    }
-
-    /**
-     * 根据字典类型查询字典数据信息
-     */
-    @GetMapping(value = "/type/{dictType}")
-    public AjaxResult dictType(@PathVariable String dictType)
-    {
-        return AjaxResult.success(dictTypeService.selectDictDataByType(dictType));
-    }
-
-
-
-
-}

+ 0 - 76
fs-hospital/src/main/java/com/fs/hospital/controller/hospital/SysDictTypeController.java

@@ -1,76 +0,0 @@
-package com.fs.hospital.controller.hospital;
-
-import com.fs.common.annotation.Log;
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.AjaxResult;
-import com.fs.common.core.domain.entity.SysDictType;
-import com.fs.common.core.page.TableDataInfo;
-import com.fs.common.enums.BusinessType;
-import com.fs.common.utils.poi.ExcelUtil;
-import com.fs.system.service.ISysDictTypeService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- * 数据字典信息
- *
-
- */
-@RestController
-@RequestMapping("/system/dict/type")
-public class SysDictTypeController extends BaseController
-{
-    @Autowired
-    private ISysDictTypeService dictTypeService;
-
-    @PreAuthorize("@ss.hasPermi('system:dict:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(SysDictType dictType)
-    {
-        startPage();
-        List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
-        return getDataTable(list);
-    }
-
-    @Log(title = "字典类型", businessType = BusinessType.EXPORT)
-    @PreAuthorize("@ss.hasPermi('system:dict:export')")
-    @GetMapping("/export")
-    public AjaxResult export(SysDictType dictType)
-    {
-        List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
-        ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
-        return util.exportExcel(list, "字典类型");
-    }
-
-    /**
-     * 查询字典类型详细
-     */
-    @PreAuthorize("@ss.hasPermi('system:dict:query')")
-    @GetMapping(value = "/{dictId}")
-    public AjaxResult getInfo(@PathVariable Long dictId)
-    {
-        return AjaxResult.success(dictTypeService.selectDictTypeById(dictId));
-    }
-
-
-
-
-
-
-
-    /**
-     * 获取字典选择框列表
-     */
-    @GetMapping("/optionselect")
-    public AjaxResult optionselect()
-    {
-        List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
-        return AjaxResult.success(dictTypes);
-    }
-}

+ 0 - 26
fs-hospital/src/main/java/com/fs/hospital/utils/JsonUtils.java

@@ -1,26 +0,0 @@
-package com.fs.hospital.utils;
-
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-
-
-public class JsonUtils {
-    private static final ObjectMapper JSON = new ObjectMapper();
-
-    static {
-        JSON.setSerializationInclusion(Include.NON_NULL);
-        JSON.configure(SerializationFeature.INDENT_OUTPUT, Boolean.TRUE);
-    }
-
-    public static String toJson(Object obj) {
-        try {
-            return JSON.writeValueAsString(obj);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-
-        return null;
-    }
-}

+ 0 - 87
fs-hospital/src/main/java/com/fs/hospital/utils/JwtUtils.java

@@ -1,87 +0,0 @@
-package com.fs.hospital.utils;
-
-import io.jsonwebtoken.Claims;
-import io.jsonwebtoken.Jwts;
-import io.jsonwebtoken.SignatureAlgorithm;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-
-import java.util.Date;
-
-/**
- * jwt工具类
-
- */
-@ConfigurationProperties(prefix = "fs.jwt")
-@Component
-public class JwtUtils {
-    private Logger logger = LoggerFactory.getLogger(getClass());
-
-
-    private String secret;
-    private long expire;
-    private String header;
-
-    /**
-     * 生成jwt token
-     */
-    public String generateToken(long userId) {
-        Date nowDate = new Date();
-        //过期时间
-        Date expireDate = new Date(nowDate.getTime() + expire * 1000);
-
-        return Jwts.builder()
-                .setHeaderParam("typ", "JWT")
-                .setSubject(userId+"")
-                .setIssuedAt(nowDate)
-                .setExpiration(expireDate)
-                .signWith(SignatureAlgorithm.HS512, secret)
-                .compact();
-    }
-
-    public Claims getClaimByToken(String token) {
-        try {
-            return Jwts.parser()
-                    .setSigningKey(secret)
-                    .parseClaimsJws(token)
-                    .getBody();
-        }catch (Exception e){
-            logger.debug("validate is token error ", e);
-            return null;
-        }
-    }
-
-    /**
-     * token是否过期
-     * @return  true:过期
-     */
-    public boolean isTokenExpired(Date expiration) {
-        return expiration.before(new Date());
-    }
-
-    public String getSecret() {
-        return secret;
-    }
-
-    public void setSecret(String secret) {
-        this.secret = secret;
-    }
-
-    public long getExpire() {
-        return expire;
-    }
-
-    public void setExpire(long expire) {
-        this.expire = expire;
-    }
-
-    public String getHeader() {
-        return header;
-    }
-
-    public void setHeader(String header) {
-        this.header = header;
-    }
-}

+ 0 - 29
fs-hospital/src/main/java/com/fs/hospital/utils/MD5PasswordEncoder.java

@@ -1,29 +0,0 @@
-package com.fs.hospital.utils;
-
-import org.springframework.security.crypto.password.PasswordEncoder;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-
-public  class MD5PasswordEncoder implements PasswordEncoder {
-    @Override
-    public String encode(CharSequence rawPassword) {
-        try {
-            MessageDigest md = MessageDigest.getInstance("MD5");
-            byte[] digest = md.digest(rawPassword.toString().getBytes());
-            StringBuilder sb = new StringBuilder();
-            for (byte b : digest) {
-                sb.append(String.format("%02x", b));
-            }
-            return sb.toString();
-        } catch (NoSuchAlgorithmException e) {
-            throw new RuntimeException("MD5 algorithm not found", e);
-        }
-    }
-
-    @Override
-    public boolean matches(CharSequence rawPassword, String encodedPassword) {
-        String rawPasswordEncoded = encode(rawPassword);
-        return rawPasswordEncoded.equals(encodedPassword);
-    }
-}

+ 0 - 36
fs-hospital/src/main/java/com/fs/hospital/utils/UserUtil.java

@@ -1,36 +0,0 @@
-package com.fs.hospital.utils;
-
-import com.fs.common.constant.HttpStatus;
-import com.fs.common.exception.ServiceException;
-import com.fs.his.domain.StoreLoginUser;
-
-import static com.fs.common.utils.SecurityUtils.getAuthentication;
-
-public class UserUtil {
-
-    public static StoreLoginUser getLoginUser()
-    {
-        try
-        {
-            return (StoreLoginUser) getAuthentication().getPrincipal();
-        }
-        catch (Exception e)
-        {
-            throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
-        }
-    }
-
-
-    public static Long getLoginUserStoreID()
-    {
-        try
-        {
-            StoreLoginUser principal = (StoreLoginUser) getAuthentication().getPrincipal();
-            return principal.getFsStore().getStoreId();
-        }
-        catch (Exception e)
-        {
-            throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
-        }
-    }
-}

+ 0 - 54
fs-hospital/src/main/java/com/fs/hospital/vo/WangUploadVO.java

@@ -1,54 +0,0 @@
-package com.fs.hospital.vo;
-
-import java.util.List;
-
-public class WangUploadVO {
-    Integer errno;
-    List<WangUploadItem> data;
-
-    public Integer getErrno() {
-        return errno;
-    }
-
-    public void setErrno(Integer errno) {
-        this.errno = errno;
-    }
-
-    public List<WangUploadItem> getData() {
-        return data;
-    }
-
-    public void setData(List<WangUploadItem> data) {
-        this.data = data;
-    }
-
-    public static class WangUploadItem{
-        String url;
-        String href="";
-        String alt="";
-
-        public String getHref() {
-            return href;
-        }
-
-        public void setHref(String href) {
-            this.href = href;
-        }
-
-        public String getAlt() {
-            return alt;
-        }
-
-        public void setAlt(String alt) {
-            this.alt = alt;
-        }
-
-        public String getUrl() {
-            return url;
-        }
-
-        public void setUrl(String url) {
-            this.url = url;
-        }
-    }
-}

+ 0 - 1
fs-hospital/src/main/resources/META-INF/spring-devtools.properties

@@ -1 +0,0 @@
-restart.include.json=/com.alibaba.fastjson.*.jar

+ 0 - 8
fs-hospital/src/main/resources/application.yml

@@ -1,8 +0,0 @@
-server:
-  # 服务器的HTTP端口,默认为8080
-  port: 8010
-
-# Spring配置
-spring:
-  profiles:
-    active: dev

+ 0 - 2
fs-hospital/src/main/resources/banner.txt

@@ -1,2 +0,0 @@
-Application Version: ${fs.version}
-Spring Boot Version: ${spring-boot.version}

+ 0 - 37
fs-hospital/src/main/resources/i18n/messages.properties

@@ -1,37 +0,0 @@
-#错误消息
-not.null=* 必须填写
-user.jcaptcha.error=验证码错误
-user.jcaptcha.expire=验证码已失效
-user.not.exists=用户不存在/密码错误
-user.password.not.match=用户不存在/密码错误
-user.password.retry.limit.count=密码输入错误{0}次
-user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定10分钟
-user.password.delete=对不起,您的账号已被删除
-user.blocked=用户已封禁,请联系管理员
-role.blocked=角色已封禁,请联系管理员
-user.logout.success=退出成功
-
-length.not.valid=长度必须在{min}到{max}个字符之间
-
-user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
-user.password.not.valid=* 5-50个字符
- 
-user.email.not.valid=邮箱格式错误
-user.mobile.phone.number.not.valid=手机号格式错误
-user.login.success=登录成功
-user.register.success=注册成功
-user.notfound=请重新登录
-user.forcelogout=管理员强制退出,请重新登录
-user.unknown.error=未知错误,请重新登录
-
-##文件上传消息
-upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
-upload.filename.exceed.length=上传的文件名最长{0}个字符
-
-##权限
-no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
-no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
-no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
-no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
-no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
-no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]

+ 0 - 93
fs-hospital/src/main/resources/logback.xml

@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
-    <!-- 日志存放路径 -->
-	<property name="log.path" value="/home/fs-hospital/logs" />
-    <!-- 日志输出格式 -->
-	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
-
-	<!-- 控制台输出 -->
-	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-		<encoder>
-			<pattern>${log.pattern}</pattern>
-		</encoder>
-	</appender>
-
-	<!-- 系统日志输出 -->
-	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
-	    <file>${log.path}/sys-info.log</file>
-        <!-- 循环政策:基于时间创建日志文件 -->
-		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 日志文件名格式 -->
-			<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 日志最大的历史 60天 -->
-			<maxHistory>60</maxHistory>
-		</rollingPolicy>
-		<encoder>
-			<pattern>${log.pattern}</pattern>
-		</encoder>
-		<filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <!-- 过滤的级别 -->
-            <level>INFO</level>
-            <!-- 匹配时的操作:接收(记录) -->
-            <onMatch>ACCEPT</onMatch>
-            <!-- 不匹配时的操作:拒绝(不记录) -->
-            <onMismatch>DENY</onMismatch>
-        </filter>
-	</appender>
-
-	<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
-	    <file>${log.path}/sys-error.log</file>
-        <!-- 循环政策:基于时间创建日志文件 -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 日志文件名格式 -->
-            <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 日志最大的历史 60天 -->
-			<maxHistory>60</maxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-        <filter class="ch.qos.logback.classic.filter.LevelFilter">
-            <!-- 过滤的级别 -->
-            <level>ERROR</level>
-			<!-- 匹配时的操作:接收(记录) -->
-            <onMatch>ACCEPT</onMatch>
-			<!-- 不匹配时的操作:拒绝(不记录) -->
-            <onMismatch>DENY</onMismatch>
-        </filter>
-    </appender>
-
-	<!-- 用户访问日志输出  -->
-    <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
-		<file>${log.path}/sys-user.log</file>
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <!-- 按天回滚 daily -->
-            <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
-            <!-- 日志最大的历史 60天 -->
-            <maxHistory>60</maxHistory>
-        </rollingPolicy>
-        <encoder>
-            <pattern>${log.pattern}</pattern>
-        </encoder>
-    </appender>
-
-	<!-- 系统模块日志级别控制  -->
-	<logger name="com.fs" level="info" />
-	<!-- Spring日志级别控制  -->
-	<logger name="org.springframework" level="warn" />
-
-	<root level="info">
-		<appender-ref ref="console" />
-	</root>
-
-	<!--系统操作日志-->
-    <root level="info">
-        <appender-ref ref="file_info" />
-        <appender-ref ref="file_error" />
-    </root>
-
-	<!--系统用户操作日志-->
-    <logger name="sys-user" level="info">
-        <appender-ref ref="sys-user"/>
-    </logger>
-</configuration>

+ 0 - 15
fs-hospital/src/main/resources/mybatis/mybatis-config.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE configuration
-PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-config.dtd">
-<configuration>
-
-	<settings>
-		<setting name="cacheEnabled"             value="true" />  <!-- 全局映射器启用缓存 -->
-		<setting name="useGeneratedKeys"         value="true" />  <!-- 允许 JDBC 支持自动生成主键 -->
-		<setting name="defaultExecutorType"      value="REUSE" /> <!-- 配置默认的执行器 -->
-		<setting name="logImpl"                  value="SLF4J" /> <!-- 指定 MyBatis 所用日志的具体实现 -->
-		 <setting name="mapUnderscoreToCamelCase" value="true"/>
-	</settings>
-
-</configuration>

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