正在显示
91 个修改的文件
包含
1746 行增加
和
1886 行删除
Luhui.iml
已删除
100644 → 0
| @@ -46,39 +46,15 @@ | @@ -46,39 +46,15 @@ | ||
| 46 | <artifactId>lh-quartz</artifactId> | 46 | <artifactId>lh-quartz</artifactId> |
| 47 | </dependency> | 47 | </dependency> |
| 48 | <!-- 文档 --> | 48 | <!-- 文档 --> |
| 49 | - <dependency > | ||
| 50 | - <groupId>io.springfox</groupId> | ||
| 51 | - <artifactId>springfox-swagger2</artifactId> | ||
| 52 | - <version>${swagger.version}</version> | ||
| 53 | - <exclusions> | ||
| 54 | - <exclusion> | ||
| 55 | - <groupId>io.swagger</groupId> | ||
| 56 | - <artifactId>swagger-models</artifactId> | ||
| 57 | - </exclusion> | ||
| 58 | - <exclusion> | ||
| 59 | - <groupId>com.google.guava</groupId> | ||
| 60 | - <artifactId>guava</artifactId> | ||
| 61 | - </exclusion> | ||
| 62 | - </exclusions> | ||
| 63 | - </dependency> | ||
| 64 | - <!--https://mvnrepository.com/artifact/io.swagger/swagger-models--> | ||
| 65 | - <dependency> | ||
| 66 | - <groupId>io.swagger</groupId> | ||
| 67 | - <artifactId>swagger-models</artifactId> | ||
| 68 | - <version>${swagger-models.version}</version> | ||
| 69 | - </dependency> | ||
| 70 | <dependency> | 49 | <dependency> |
| 71 | - <groupId>io.springfox</groupId> | ||
| 72 | - <artifactId>springfox-swagger-ui</artifactId> | ||
| 73 | - <version>${swagger.version}</version> | 50 | + <groupId>com.zhonglai.luhui</groupId> |
| 51 | + <artifactId>lh-common-swagger</artifactId> | ||
| 74 | </dependency> | 52 | </dependency> |
| 75 | - <!--<!– https://mvnrepository.com/artifact/com.github.xiaoymin/swagger-bootstrap-ui –>--> | 53 | + <!-- 防火墙 --> |
| 76 | <dependency> | 54 | <dependency> |
| 77 | - <groupId>com.github.xiaoymin</groupId> | ||
| 78 | - <artifactId>swagger-bootstrap-ui</artifactId> | ||
| 79 | - <version>${swagger-ui.version}</version> | 55 | + <groupId>com.zhonglai.luhui</groupId> |
| 56 | + <artifactId>lh-common-firewall</artifactId> | ||
| 80 | </dependency> | 57 | </dependency> |
| 81 | - | ||
| 82 | <dependency> | 58 | <dependency> |
| 83 | <groupId>org.aspectj</groupId> | 59 | <groupId>org.aspectj</groupId> |
| 84 | <artifactId>aspectjweaver</artifactId> | 60 | <artifactId>aspectjweaver</artifactId> |
| @@ -101,6 +77,14 @@ | @@ -101,6 +77,14 @@ | ||
| 101 | <groupId>com.sun.mail</groupId> | 77 | <groupId>com.sun.mail</groupId> |
| 102 | <artifactId>javax.mail</artifactId> | 78 | <artifactId>javax.mail</artifactId> |
| 103 | </dependency> | 79 | </dependency> |
| 80 | + <dependency> | ||
| 81 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 82 | + <artifactId>lh-public-dao</artifactId> | ||
| 83 | + </dependency> | ||
| 84 | + <dependency> | ||
| 85 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 86 | + <artifactId>lh-jar-action</artifactId> | ||
| 87 | + </dependency> | ||
| 104 | </dependencies> | 88 | </dependencies> |
| 105 | 89 | ||
| 106 | <build> | 90 | <build> |
| @@ -9,12 +9,15 @@ import org.springframework.context.annotation.ComponentScan; | @@ -9,12 +9,15 @@ import org.springframework.context.annotation.ComponentScan; | ||
| 9 | "com.ruoyi.common", | 9 | "com.ruoyi.common", |
| 10 | "com.ruoyi.system", | 10 | "com.ruoyi.system", |
| 11 | "com.ruoyi.framework", | 11 | "com.ruoyi.framework", |
| 12 | - "com.ruoyi.generator", | ||
| 13 | "com.ruoyi.quartz", | 12 | "com.ruoyi.quartz", |
| 14 | - "com.zhonglai.luhui.admin.config", | ||
| 15 | - "com.zhonglai.luhui.admin.service", | ||
| 16 | - "com.zhonglai.luhui.admin.task", | ||
| 17 | - "com.zhonglai.luhui.admin.controller", | 13 | + "com.ruoyi.generator", |
| 14 | + "com.zhonglai.luhui.datasource", | ||
| 15 | + "com.zhonglai.luhui.dao", | ||
| 16 | + "com.zhonglai.luhui.sys", | ||
| 17 | + "com.zhonglai.luhui.redis", | ||
| 18 | + "com.zhonglai.luhui.security", | ||
| 19 | + "com.zhonglai.luhui.firewall", | ||
| 20 | + "com.zhonglai.luhui.admin", | ||
| 18 | "com.zhonglai.luhui.mqtt.comm.service.redis", | 21 | "com.zhonglai.luhui.mqtt.comm.service.redis", |
| 19 | "com.zhonglai.luhui.mqtt.service.db.mode" | 22 | "com.zhonglai.luhui.mqtt.service.db.mode" |
| 20 | }) | 23 | }) |
| @@ -4,10 +4,10 @@ import com.google.code.kaptcha.Producer; | @@ -4,10 +4,10 @@ import com.google.code.kaptcha.Producer; | ||
| 4 | import com.ruoyi.common.config.RuoYiConfig; | 4 | import com.ruoyi.common.config.RuoYiConfig; |
| 5 | import com.ruoyi.common.constant.Constants; | 5 | import com.ruoyi.common.constant.Constants; |
| 6 | import com.ruoyi.common.core.domain.AjaxResult; | 6 | import com.ruoyi.common.core.domain.AjaxResult; |
| 7 | -import com.ruoyi.common.core.redis.RedisCache; | ||
| 8 | import com.ruoyi.common.utils.sign.Base64; | 7 | import com.ruoyi.common.utils.sign.Base64; |
| 9 | import com.ruoyi.common.utils.uuid.IdUtils; | 8 | import com.ruoyi.common.utils.uuid.IdUtils; |
| 10 | -import com.ruoyi.system.service.ISysConfigService; | 9 | +import com.zhonglai.luhui.redis.service.RedisCache; |
| 10 | +import com.zhonglai.luhui.sys.service.ISysConfigService; | ||
| 11 | import io.swagger.annotations.Api; | 11 | import io.swagger.annotations.Api; |
| 12 | import io.swagger.annotations.ApiOperation; | 12 | import io.swagger.annotations.ApiOperation; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -3,19 +3,17 @@ package com.zhonglai.luhui.admin.controller.iot; | @@ -3,19 +3,17 @@ package com.zhonglai.luhui.admin.controller.iot; | ||
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | import com.ruoyi.common.annotation.Log; | 5 | import com.ruoyi.common.annotation.Log; |
| 6 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 7 | import com.ruoyi.common.core.domain.AjaxResult; | 6 | import com.ruoyi.common.core.domain.AjaxResult; |
| 8 | import com.ruoyi.common.core.page.TableDataInfo; | 7 | import com.ruoyi.common.core.page.TableDataInfo; |
| 9 | import com.ruoyi.common.enums.BusinessType; | 8 | import com.ruoyi.common.enums.BusinessType; |
| 10 | import com.ruoyi.common.utils.StringUtils; | 9 | import com.ruoyi.common.utils.StringUtils; |
| 11 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 12 | -import com.ruoyi.system.domain.IotAlert; | ||
| 13 | -import com.ruoyi.system.service.IIotAlertService; | 10 | +import com.ruoyi.system.domain.iot.IotAlert; |
| 11 | +import com.ruoyi.system.service.iot.IIotAlertService; | ||
| 14 | import com.zhonglai.luhui.admin.dto.AlarmActionConfig; | 12 | import com.zhonglai.luhui.admin.dto.AlarmActionConfig; |
| 15 | import com.zhonglai.luhui.admin.dto.AlarmTriggersConfig; | 13 | import com.zhonglai.luhui.admin.dto.AlarmTriggersConfig; |
| 14 | +import com.zhonglai.luhui.action.BaseController; | ||
| 15 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 16 | import io.swagger.annotations.Api; | 16 | import io.swagger.annotations.Api; |
| 17 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 18 | -import io.swagger.annotations.ApiImplicitParams; | ||
| 19 | import io.swagger.annotations.ApiOperation; | 17 | import io.swagger.annotations.ApiOperation; |
| 20 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 21 | import org.springframework.security.access.prepost.PreAuthorize; | 19 | import org.springframework.security.access.prepost.PreAuthorize; |
| 1 | package com.zhonglai.luhui.admin.controller.iot; | 1 | package com.zhonglai.luhui.admin.controller.iot; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.Log; | 3 | import com.ruoyi.common.annotation.Log; |
| 4 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 5 | import com.ruoyi.common.core.domain.AjaxResult; | 4 | import com.ruoyi.common.core.domain.AjaxResult; |
| 6 | import com.ruoyi.common.core.page.TableDataInfo; | 5 | import com.ruoyi.common.core.page.TableDataInfo; |
| 7 | import com.ruoyi.common.enums.BusinessType; | 6 | import com.ruoyi.common.enums.BusinessType; |
| 8 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 9 | -import com.ruoyi.system.domain.IotAlertLog; | ||
| 10 | -import com.ruoyi.system.service.IIotAlertLogService; | 7 | +import com.ruoyi.system.domain.iot.IotAlertLog; |
| 8 | +import com.ruoyi.system.service.iot.IIotAlertLogService; | ||
| 9 | +import com.zhonglai.luhui.action.BaseController; | ||
| 10 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 11 | import io.swagger.annotations.Api; | 11 | import io.swagger.annotations.Api; |
| 12 | import io.swagger.annotations.ApiOperation; | 12 | import io.swagger.annotations.ApiOperation; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -3,10 +3,10 @@ package com.zhonglai.luhui.admin.controller.iot; | @@ -3,10 +3,10 @@ package com.zhonglai.luhui.admin.controller.iot; | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import javax.servlet.http.HttpServletResponse; | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | 5 | ||
| 6 | -import com.ruoyi.common.core.domain.Message; | ||
| 7 | import com.ruoyi.common.utils.DateUtils; | 6 | import com.ruoyi.common.utils.DateUtils; |
| 8 | -import com.ruoyi.system.domain.IotProduct; | ||
| 9 | -import com.ruoyi.system.service.IIotProductService; | 7 | +import com.zhonglai.luhui.action.BaseController; |
| 8 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 9 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 10 | import io.swagger.annotations.Api; | 10 | import io.swagger.annotations.Api; |
| 11 | import io.swagger.annotations.ApiOperation; | 11 | import io.swagger.annotations.ApiOperation; |
| 12 | import org.springframework.security.access.prepost.PreAuthorize; | 12 | import org.springframework.security.access.prepost.PreAuthorize; |
| @@ -20,12 +20,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -20,12 +20,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 20 | import org.springframework.web.bind.annotation.RequestMapping; | 20 | import org.springframework.web.bind.annotation.RequestMapping; |
| 21 | import org.springframework.web.bind.annotation.RestController; | 21 | import org.springframework.web.bind.annotation.RestController; |
| 22 | import com.ruoyi.common.annotation.Log; | 22 | import com.ruoyi.common.annotation.Log; |
| 23 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 24 | import com.ruoyi.common.core.domain.AjaxResult; | 23 | import com.ruoyi.common.core.domain.AjaxResult; |
| 25 | import com.ruoyi.common.enums.BusinessType; | 24 | import com.ruoyi.common.enums.BusinessType; |
| 26 | -import com.ruoyi.system.domain.IotDevice; | ||
| 27 | -import com.ruoyi.system.service.IIotDeviceService; | ||
| 28 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 25 | +import com.ruoyi.system.domain.iot.IotDevice; |
| 26 | +import com.ruoyi.system.service.iot.IIotDeviceService; | ||
| 29 | import com.ruoyi.common.core.page.TableDataInfo; | 27 | import com.ruoyi.common.core.page.TableDataInfo; |
| 30 | 28 | ||
| 31 | /** | 29 | /** |
| @@ -88,7 +86,7 @@ public class IotDeviceController extends BaseController | @@ -88,7 +86,7 @@ public class IotDeviceController extends BaseController | ||
| 88 | @PostMapping("add") | 86 | @PostMapping("add") |
| 89 | public AjaxResult add(@RequestBody IotDevice iotDevice) | 87 | public AjaxResult add(@RequestBody IotDevice iotDevice) |
| 90 | { | 88 | { |
| 91 | - iotDevice.setCreate_by(getUsername()); | 89 | + iotDevice.setCreate_by(SecurityUtils.getUsername()); |
| 92 | iotDevice.setUpdate_time(DateUtils.getNowTimeMilly()); | 90 | iotDevice.setUpdate_time(DateUtils.getNowTimeMilly()); |
| 93 | return toAjax(iotDeviceService.insertIotDevice(iotDevice)); | 91 | return toAjax(iotDeviceService.insertIotDevice(iotDevice)); |
| 94 | } | 92 | } |
| @@ -102,7 +100,7 @@ public class IotDeviceController extends BaseController | @@ -102,7 +100,7 @@ public class IotDeviceController extends BaseController | ||
| 102 | @PutMapping("edit") | 100 | @PutMapping("edit") |
| 103 | public AjaxResult edit(@RequestBody IotDevice iotDevice) | 101 | public AjaxResult edit(@RequestBody IotDevice iotDevice) |
| 104 | { | 102 | { |
| 105 | - iotDevice.setUpdate_by(getUsername()); | 103 | + iotDevice.setUpdate_by(SecurityUtils.getUsername()); |
| 106 | iotDevice.setUpdate_time(DateUtils.getNowTimeMilly()); | 104 | iotDevice.setUpdate_time(DateUtils.getNowTimeMilly()); |
| 107 | return toAjax(iotDeviceService.updateIotDevice(iotDevice)); | 105 | return toAjax(iotDeviceService.updateIotDevice(iotDevice)); |
| 108 | } | 106 | } |
| @@ -3,6 +3,8 @@ package com.zhonglai.luhui.admin.controller.iot; | @@ -3,6 +3,8 @@ package com.zhonglai.luhui.admin.controller.iot; | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import javax.servlet.http.HttpServletResponse; | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | 5 | ||
| 6 | +import com.zhonglai.luhui.action.BaseController; | ||
| 7 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 6 | import io.swagger.annotations.Api; | 8 | import io.swagger.annotations.Api; |
| 7 | import io.swagger.annotations.ApiOperation; | 9 | import io.swagger.annotations.ApiOperation; |
| 8 | import org.springframework.security.access.prepost.PreAuthorize; | 10 | import org.springframework.security.access.prepost.PreAuthorize; |
| @@ -16,12 +18,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -16,12 +18,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 16 | import org.springframework.web.bind.annotation.RequestMapping; | 18 | import org.springframework.web.bind.annotation.RequestMapping; |
| 17 | import org.springframework.web.bind.annotation.RestController; | 19 | import org.springframework.web.bind.annotation.RestController; |
| 18 | import com.ruoyi.common.annotation.Log; | 20 | import com.ruoyi.common.annotation.Log; |
| 19 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 20 | import com.ruoyi.common.core.domain.AjaxResult; | 21 | import com.ruoyi.common.core.domain.AjaxResult; |
| 21 | import com.ruoyi.common.enums.BusinessType; | 22 | import com.ruoyi.common.enums.BusinessType; |
| 22 | -import com.ruoyi.system.domain.IotPermission; | ||
| 23 | -import com.ruoyi.system.service.IIotPermissionService; | ||
| 24 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 23 | +import com.ruoyi.system.domain.iot.IotPermission; |
| 24 | +import com.ruoyi.system.service.iot.IIotPermissionService; | ||
| 25 | import com.ruoyi.common.core.page.TableDataInfo; | 25 | import com.ruoyi.common.core.page.TableDataInfo; |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| @@ -3,6 +3,8 @@ package com.zhonglai.luhui.admin.controller.iot; | @@ -3,6 +3,8 @@ package com.zhonglai.luhui.admin.controller.iot; | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import javax.servlet.http.HttpServletResponse; | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | 5 | ||
| 6 | +import com.zhonglai.luhui.action.BaseController; | ||
| 7 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 6 | import io.swagger.annotations.Api; | 8 | import io.swagger.annotations.Api; |
| 7 | import io.swagger.annotations.ApiOperation; | 9 | import io.swagger.annotations.ApiOperation; |
| 8 | import org.springframework.security.access.prepost.PreAuthorize; | 10 | import org.springframework.security.access.prepost.PreAuthorize; |
| @@ -16,12 +18,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -16,12 +18,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 16 | import org.springframework.web.bind.annotation.RequestMapping; | 18 | import org.springframework.web.bind.annotation.RequestMapping; |
| 17 | import org.springframework.web.bind.annotation.RestController; | 19 | import org.springframework.web.bind.annotation.RestController; |
| 18 | import com.ruoyi.common.annotation.Log; | 20 | import com.ruoyi.common.annotation.Log; |
| 19 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 20 | import com.ruoyi.common.core.domain.AjaxResult; | 21 | import com.ruoyi.common.core.domain.AjaxResult; |
| 21 | import com.ruoyi.common.enums.BusinessType; | 22 | import com.ruoyi.common.enums.BusinessType; |
| 22 | -import com.ruoyi.system.domain.IotProduct; | ||
| 23 | -import com.ruoyi.system.service.IIotProductService; | ||
| 24 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 23 | +import com.ruoyi.system.domain.iot.IotProduct; |
| 24 | +import com.ruoyi.system.service.iot.IIotProductService; | ||
| 25 | import com.ruoyi.common.core.page.TableDataInfo; | 25 | import com.ruoyi.common.core.page.TableDataInfo; |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| @@ -3,7 +3,8 @@ package com.zhonglai.luhui.admin.controller.iot; | @@ -3,7 +3,8 @@ package com.zhonglai.luhui.admin.controller.iot; | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import javax.servlet.http.HttpServletResponse; | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | 5 | ||
| 6 | -import com.ruoyi.common.core.redis.RedisCache; | 6 | +import com.zhonglai.luhui.action.BaseController; |
| 7 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 7 | import com.ruoyi.common.utils.DateUtils; | 8 | import com.ruoyi.common.utils.DateUtils; |
| 8 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 10 | import io.swagger.annotations.ApiOperation; |
| @@ -18,12 +19,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -18,12 +19,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 18 | import org.springframework.web.bind.annotation.RequestMapping; | 19 | import org.springframework.web.bind.annotation.RequestMapping; |
| 19 | import org.springframework.web.bind.annotation.RestController; | 20 | import org.springframework.web.bind.annotation.RestController; |
| 20 | import com.ruoyi.common.annotation.Log; | 21 | import com.ruoyi.common.annotation.Log; |
| 21 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 22 | import com.ruoyi.common.core.domain.AjaxResult; | 22 | import com.ruoyi.common.core.domain.AjaxResult; |
| 23 | import com.ruoyi.common.enums.BusinessType; | 23 | import com.ruoyi.common.enums.BusinessType; |
| 24 | -import com.ruoyi.system.domain.IotProductTranslate; | ||
| 25 | -import com.ruoyi.system.service.IIotProductTranslateService; | ||
| 26 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 24 | +import com.ruoyi.system.domain.iot.IotProductTranslate; |
| 25 | +import com.ruoyi.system.service.iot.IIotProductTranslateService; | ||
| 27 | import com.ruoyi.common.core.page.TableDataInfo; | 26 | import com.ruoyi.common.core.page.TableDataInfo; |
| 28 | 27 | ||
| 29 | /** | 28 | /** |
| @@ -3,6 +3,8 @@ package com.zhonglai.luhui.admin.controller.iot; | @@ -3,6 +3,8 @@ package com.zhonglai.luhui.admin.controller.iot; | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import javax.servlet.http.HttpServletResponse; | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | 5 | ||
| 6 | +import com.zhonglai.luhui.action.BaseController; | ||
| 7 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 6 | import com.ruoyi.common.utils.DateUtils; | 8 | import com.ruoyi.common.utils.DateUtils; |
| 7 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| 8 | import io.swagger.annotations.ApiOperation; | 10 | import io.swagger.annotations.ApiOperation; |
| @@ -17,12 +19,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -17,12 +19,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 17 | import org.springframework.web.bind.annotation.RequestMapping; | 19 | import org.springframework.web.bind.annotation.RequestMapping; |
| 18 | import org.springframework.web.bind.annotation.RestController; | 20 | import org.springframework.web.bind.annotation.RestController; |
| 19 | import com.ruoyi.common.annotation.Log; | 21 | import com.ruoyi.common.annotation.Log; |
| 20 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 21 | import com.ruoyi.common.core.domain.AjaxResult; | 22 | import com.ruoyi.common.core.domain.AjaxResult; |
| 22 | import com.ruoyi.common.enums.BusinessType; | 23 | import com.ruoyi.common.enums.BusinessType; |
| 23 | -import com.ruoyi.system.domain.IotRole; | ||
| 24 | -import com.ruoyi.system.service.IIotRoleService; | ||
| 25 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 24 | +import com.ruoyi.system.domain.iot.IotRole; |
| 25 | +import com.ruoyi.system.service.iot.IIotRoleService; | ||
| 26 | import com.ruoyi.common.core.page.TableDataInfo; | 26 | import com.ruoyi.common.core.page.TableDataInfo; |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| @@ -3,8 +3,9 @@ package com.zhonglai.luhui.admin.controller.iot; | @@ -3,8 +3,9 @@ package com.zhonglai.luhui.admin.controller.iot; | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import javax.servlet.http.HttpServletResponse; | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | 5 | ||
| 6 | +import com.zhonglai.luhui.action.BaseController; | ||
| 7 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 6 | import com.ruoyi.common.utils.DateUtils; | 8 | import com.ruoyi.common.utils.DateUtils; |
| 7 | -import com.ruoyi.system.service.IIotProductTranslateService; | ||
| 8 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiOperation; | 10 | import io.swagger.annotations.ApiOperation; |
| 10 | import org.springframework.security.access.prepost.PreAuthorize; | 11 | import org.springframework.security.access.prepost.PreAuthorize; |
| @@ -18,12 +19,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -18,12 +19,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 18 | import org.springframework.web.bind.annotation.RequestMapping; | 19 | import org.springframework.web.bind.annotation.RequestMapping; |
| 19 | import org.springframework.web.bind.annotation.RestController; | 20 | import org.springframework.web.bind.annotation.RestController; |
| 20 | import com.ruoyi.common.annotation.Log; | 21 | import com.ruoyi.common.annotation.Log; |
| 21 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 22 | import com.ruoyi.common.core.domain.AjaxResult; | 22 | import com.ruoyi.common.core.domain.AjaxResult; |
| 23 | import com.ruoyi.common.enums.BusinessType; | 23 | import com.ruoyi.common.enums.BusinessType; |
| 24 | -import com.ruoyi.system.domain.IotTerminal; | ||
| 25 | -import com.ruoyi.system.service.IIotTerminalService; | ||
| 26 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 24 | +import com.ruoyi.system.domain.iot.IotTerminal; |
| 25 | +import com.ruoyi.system.service.iot.IIotTerminalService; | ||
| 27 | import com.ruoyi.common.core.page.TableDataInfo; | 26 | import com.ruoyi.common.core.page.TableDataInfo; |
| 28 | 27 | ||
| 29 | /** | 28 | /** |
| @@ -3,11 +3,14 @@ package com.zhonglai.luhui.admin.controller.iot; | @@ -3,11 +3,14 @@ package com.zhonglai.luhui.admin.controller.iot; | ||
| 3 | import java.util.*; | 3 | import java.util.*; |
| 4 | import javax.servlet.http.HttpServletResponse; | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | 5 | ||
| 6 | +import com.zhonglai.luhui.action.BaseController; | ||
| 7 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 8 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 6 | import com.alibaba.fastjson.JSON; | 9 | import com.alibaba.fastjson.JSON; |
| 7 | import com.alibaba.fastjson.JSONObject; | 10 | import com.alibaba.fastjson.JSONObject; |
| 8 | import com.ruoyi.system.domain.DistributionCurrencyModel; | 11 | import com.ruoyi.system.domain.DistributionCurrencyModel; |
| 9 | -import com.ruoyi.system.domain.IotProduct; | ||
| 10 | -import com.ruoyi.system.service.IIotProductService; | 12 | +import com.ruoyi.system.domain.iot.IotProduct; |
| 13 | +import com.ruoyi.system.service.iot.IIotProductService; | ||
| 11 | import com.zhonglai.luhui.admin.dto.IotThingsModelAddApi; | 14 | import com.zhonglai.luhui.admin.dto.IotThingsModelAddApi; |
| 12 | import com.zhonglai.luhui.mqtt.comm.dto.thingsmodels.ThingsModelItemBase; | 15 | import com.zhonglai.luhui.mqtt.comm.dto.thingsmodels.ThingsModelItemBase; |
| 13 | import com.zhonglai.luhui.mqtt.comm.dto.thingsmodels.specs.*; | 16 | import com.zhonglai.luhui.mqtt.comm.dto.thingsmodels.specs.*; |
| @@ -26,12 +29,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -26,12 +29,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 26 | import org.springframework.web.bind.annotation.RequestMapping; | 29 | import org.springframework.web.bind.annotation.RequestMapping; |
| 27 | import org.springframework.web.bind.annotation.RestController; | 30 | import org.springframework.web.bind.annotation.RestController; |
| 28 | import com.ruoyi.common.annotation.Log; | 31 | import com.ruoyi.common.annotation.Log; |
| 29 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 30 | import com.ruoyi.common.core.domain.AjaxResult; | 32 | import com.ruoyi.common.core.domain.AjaxResult; |
| 31 | import com.ruoyi.common.enums.BusinessType; | 33 | import com.ruoyi.common.enums.BusinessType; |
| 32 | -import com.ruoyi.system.domain.IotThingsModel; | ||
| 33 | -import com.ruoyi.system.service.IIotThingsModelService; | ||
| 34 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 34 | +import com.ruoyi.system.domain.iot.IotThingsModel; |
| 35 | +import com.ruoyi.system.service.iot.IIotThingsModelService; | ||
| 35 | import com.ruoyi.common.core.page.TableDataInfo; | 36 | import com.ruoyi.common.core.page.TableDataInfo; |
| 36 | 37 | ||
| 37 | /** | 38 | /** |
| @@ -101,7 +102,7 @@ public class IotThingsModelController extends BaseController | @@ -101,7 +102,7 @@ public class IotThingsModelController extends BaseController | ||
| 101 | public AjaxResult add(@RequestBody IotThingsModelAddApi iotThingsModelAddApi) | 102 | public AjaxResult add(@RequestBody IotThingsModelAddApi iotThingsModelAddApi) |
| 102 | { | 103 | { |
| 103 | IotThingsModel iotThingsModel = iotThingsModelAddApi.getIotThingsModel(); | 104 | IotThingsModel iotThingsModel = iotThingsModelAddApi.getIotThingsModel(); |
| 104 | - iotThingsModel.setCreate_by(getUsername()); | 105 | + iotThingsModel.setCreate_by(SecurityUtils.getUsername()); |
| 105 | ThingsModelItemBase thingsModelItemBase = null; | 106 | ThingsModelItemBase thingsModelItemBase = null; |
| 106 | switch (iotThingsModel.getData_type()) | 107 | switch (iotThingsModel.getData_type()) |
| 107 | { | 108 | { |
| @@ -150,7 +151,7 @@ public class IotThingsModelController extends BaseController | @@ -150,7 +151,7 @@ public class IotThingsModelController extends BaseController | ||
| 150 | public AjaxResult edit(@RequestBody IotThingsModelAddApi iotThingsModelAddApi) | 151 | public AjaxResult edit(@RequestBody IotThingsModelAddApi iotThingsModelAddApi) |
| 151 | { | 152 | { |
| 152 | IotThingsModel iotThingsModel = iotThingsModelAddApi.getIotThingsModel(); | 153 | IotThingsModel iotThingsModel = iotThingsModelAddApi.getIotThingsModel(); |
| 153 | - iotThingsModel.setCreate_by(getUsername()); | 154 | + iotThingsModel.setCreate_by(SecurityUtils.getUsername()); |
| 154 | ThingsModelItemBase thingsModelItemBase = null; | 155 | ThingsModelItemBase thingsModelItemBase = null; |
| 155 | switch (iotThingsModel.getData_type()) | 156 | switch (iotThingsModel.getData_type()) |
| 156 | { | 157 | { |
lh-admin/src/main/java/com/zhonglai/luhui/admin/controller/iot/IotThingsModelTemplateController.java
| @@ -4,11 +4,12 @@ import java.util.Date; | @@ -4,11 +4,12 @@ import java.util.Date; | ||
| 4 | import java.util.List; | 4 | import java.util.List; |
| 5 | import javax.servlet.http.HttpServletResponse; | 5 | import javax.servlet.http.HttpServletResponse; |
| 6 | 6 | ||
| 7 | +import com.zhonglai.luhui.action.BaseController; | ||
| 8 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 9 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 7 | import com.alibaba.fastjson.JSON; | 10 | import com.alibaba.fastjson.JSON; |
| 8 | import com.alibaba.fastjson.JSONObject; | 11 | import com.alibaba.fastjson.JSONObject; |
| 9 | -import com.ruoyi.system.domain.IotProduct; | ||
| 10 | -import com.ruoyi.system.domain.IotThingsModel; | ||
| 11 | -import com.ruoyi.system.service.IIotProductService; | 12 | +import com.ruoyi.system.service.iot.IIotProductService; |
| 12 | import com.zhonglai.luhui.admin.dto.IotThingsModelAddApi; | 13 | import com.zhonglai.luhui.admin.dto.IotThingsModelAddApi; |
| 13 | import com.zhonglai.luhui.mqtt.comm.dto.thingsmodels.ThingsModelItemBase; | 14 | import com.zhonglai.luhui.mqtt.comm.dto.thingsmodels.ThingsModelItemBase; |
| 14 | import com.zhonglai.luhui.mqtt.comm.dto.thingsmodels.specs.*; | 15 | import com.zhonglai.luhui.mqtt.comm.dto.thingsmodels.specs.*; |
| @@ -25,12 +26,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -25,12 +26,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 25 | import org.springframework.web.bind.annotation.RequestMapping; | 26 | import org.springframework.web.bind.annotation.RequestMapping; |
| 26 | import org.springframework.web.bind.annotation.RestController; | 27 | import org.springframework.web.bind.annotation.RestController; |
| 27 | import com.ruoyi.common.annotation.Log; | 28 | import com.ruoyi.common.annotation.Log; |
| 28 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 29 | import com.ruoyi.common.core.domain.AjaxResult; | 29 | import com.ruoyi.common.core.domain.AjaxResult; |
| 30 | import com.ruoyi.common.enums.BusinessType; | 30 | import com.ruoyi.common.enums.BusinessType; |
| 31 | -import com.ruoyi.system.domain.IotThingsModelTemplate; | ||
| 32 | -import com.ruoyi.system.service.IIotThingsModelTemplateService; | ||
| 33 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 31 | +import com.ruoyi.system.domain.iot.IotThingsModelTemplate; |
| 32 | +import com.ruoyi.system.service.iot.IIotThingsModelTemplateService; | ||
| 34 | import com.ruoyi.common.core.page.TableDataInfo; | 33 | import com.ruoyi.common.core.page.TableDataInfo; |
| 35 | 34 | ||
| 36 | /** | 35 | /** |
| @@ -98,7 +97,7 @@ public class IotThingsModelTemplateController extends BaseController | @@ -98,7 +97,7 @@ public class IotThingsModelTemplateController extends BaseController | ||
| 98 | public AjaxResult add(@RequestBody IotThingsModelAddApi iotThingsModelAddApi) | 97 | public AjaxResult add(@RequestBody IotThingsModelAddApi iotThingsModelAddApi) |
| 99 | { | 98 | { |
| 100 | IotThingsModelTemplate iotThingsModel = JSONObject.parseObject(JSONObject.toJSONString(iotThingsModelAddApi.getIotThingsModel()),IotThingsModelTemplate.class); | 99 | IotThingsModelTemplate iotThingsModel = JSONObject.parseObject(JSONObject.toJSONString(iotThingsModelAddApi.getIotThingsModel()),IotThingsModelTemplate.class); |
| 101 | - iotThingsModel.setCreate_by(getUsername()); | 100 | + iotThingsModel.setCreate_by(SecurityUtils.getUsername()); |
| 102 | ThingsModelItemBase thingsModelItemBase = null; | 101 | ThingsModelItemBase thingsModelItemBase = null; |
| 103 | switch (iotThingsModel.getData_type()) | 102 | switch (iotThingsModel.getData_type()) |
| 104 | { | 103 | { |
| @@ -144,7 +143,7 @@ public class IotThingsModelTemplateController extends BaseController | @@ -144,7 +143,7 @@ public class IotThingsModelTemplateController extends BaseController | ||
| 144 | public AjaxResult edit(@RequestBody IotThingsModelAddApi iotThingsModelAddApi) | 143 | public AjaxResult edit(@RequestBody IotThingsModelAddApi iotThingsModelAddApi) |
| 145 | { | 144 | { |
| 146 | IotThingsModelTemplate iotThingsModel = JSONObject.parseObject(JSONObject.toJSONString(iotThingsModelAddApi.getIotThingsModel()),IotThingsModelTemplate.class); | 145 | IotThingsModelTemplate iotThingsModel = JSONObject.parseObject(JSONObject.toJSONString(iotThingsModelAddApi.getIotThingsModel()),IotThingsModelTemplate.class); |
| 147 | - iotThingsModel.setCreate_by(getUsername()); | 146 | + iotThingsModel.setCreate_by(SecurityUtils.getUsername()); |
| 148 | ThingsModelItemBase thingsModelItemBase = null; | 147 | ThingsModelItemBase thingsModelItemBase = null; |
| 149 | switch (iotThingsModel.getData_type()) | 148 | switch (iotThingsModel.getData_type()) |
| 150 | { | 149 | { |
| 1 | -package com.zhonglai.luhui.admin.controller.monitor; import com.ruoyi.common.annotation.Log;import com.ruoyi.common.core.controller.BaseController;import com.ruoyi.common.core.domain.AjaxResult;import com.ruoyi.common.core.page.TableDataInfo;import com.ruoyi.common.enums.BusinessType;import com.ruoyi.common.utils.poi.ExcelUtil;import com.ruoyi.system.domain.SysLogininfor;import com.ruoyi.system.service.ISysLogininforService;import io.swagger.annotations.Api;import io.swagger.annotations.ApiImplicitParam;import io.swagger.annotations.ApiOperation;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.security.access.prepost.PreAuthorize;import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse;import java.util.List; /** * 系统访问记录 * * @author ruoyi */@Api(tags = "系统访问记录")@RestController@RequestMapping("/monitor/logininfor")public class SysLogininforController extends BaseController{ @Autowired private ISysLogininforService logininforService; @ApiOperation("列表") @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") @GetMapping("/list") public TableDataInfo list(SysLogininfor logininfor) { startPage(); List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); return getDataTable(list); } @ApiOperation("导入") @Log(title = "登录日志", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") @PostMapping("/export") public void export(HttpServletResponse response, SysLogininfor logininfor) { List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class); util.exportExcel(response, list, "登录日志"); } @ApiOperation("删除") @ApiImplicitParam(name = "infoIds", value = "id集合", dataType = "Long[]", dataTypeClass = Long[].class) @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") @Log(title = "登录日志", businessType = BusinessType.DELETE) @DeleteMapping("/{infoIds}") public AjaxResult remove(@PathVariable Long[] infoIds) { return toAjax(logininforService.deleteLogininforByIds(infoIds)); } @ApiOperation("清除") @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") @Log(title = "登录日志", businessType = BusinessType.CLEAN) @DeleteMapping("/clean") public AjaxResult clean() { logininforService.cleanLogininfor(); return AjaxResult.success(); }} | ||
| 1 | +package com.zhonglai.luhui.admin.controller.monitor; import com.zhonglai.luhui.action.BaseController;import com.zhonglai.luhui.sys.service.ISysLogininforService;import com.zhonglai.luhui.sys.utils.ExcelUtil;import com.ruoyi.common.annotation.Log;import com.ruoyi.common.core.domain.AjaxResult;import com.ruoyi.common.core.page.TableDataInfo;import com.ruoyi.common.enums.BusinessType;import com.ruoyi.system.domain.sys.SysLogininfor;import io.swagger.annotations.Api;import io.swagger.annotations.ApiImplicitParam;import io.swagger.annotations.ApiOperation;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.security.access.prepost.PreAuthorize;import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse;import java.util.List; /** * 系统访问记录 * * @author ruoyi */@Api(tags = "系统访问记录")@RestController@RequestMapping("/monitor/logininfor")public class SysLogininforController extends BaseController{ @Autowired private ISysLogininforService logininforService; @ApiOperation("列表") @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") @GetMapping("/list") public TableDataInfo list(SysLogininfor logininfor) { startPage(); List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); return getDataTable(list); } @ApiOperation("导入") @Log(title = "登录日志", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") @PostMapping("/export") public void export(HttpServletResponse response, SysLogininfor logininfor) { List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class); util.exportExcel(response, list, "登录日志"); } @ApiOperation("删除") @ApiImplicitParam(name = "infoIds", value = "id集合", dataType = "Long[]", dataTypeClass = Long[].class) @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") @Log(title = "登录日志", businessType = BusinessType.DELETE) @DeleteMapping("/{infoIds}") public AjaxResult remove(@PathVariable Long[] infoIds) { return toAjax(logininforService.deleteLogininforByIds(infoIds)); } @ApiOperation("清除") @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") @Log(title = "登录日志", businessType = BusinessType.CLEAN) @DeleteMapping("/clean") public AjaxResult clean() { logininforService.cleanLogininfor(); return AjaxResult.success(); }} |
| 1 | package com.zhonglai.luhui.admin.controller.monitor; | 1 | package com.zhonglai.luhui.admin.controller.monitor; |
| 2 | 2 | ||
| 3 | +import com.zhonglai.luhui.action.BaseController; | ||
| 4 | +import com.zhonglai.luhui.sys.service.ISysOperLogService; | ||
| 5 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 3 | import com.ruoyi.common.annotation.Log; | 6 | import com.ruoyi.common.annotation.Log; |
| 4 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 5 | import com.ruoyi.common.core.domain.AjaxResult; | 7 | import com.ruoyi.common.core.domain.AjaxResult; |
| 6 | import com.ruoyi.common.core.page.TableDataInfo; | 8 | import com.ruoyi.common.core.page.TableDataInfo; |
| 7 | import com.ruoyi.common.enums.BusinessType; | 9 | import com.ruoyi.common.enums.BusinessType; |
| 8 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 9 | -import com.ruoyi.system.domain.SysOperLog; | ||
| 10 | -import com.ruoyi.system.service.ISysOperLogService; | 10 | +import com.ruoyi.system.domain.sys.SysOperLog; |
| 11 | import io.swagger.annotations.Api; | 11 | import io.swagger.annotations.Api; |
| 12 | import io.swagger.annotations.ApiImplicitParam; | 12 | import io.swagger.annotations.ApiImplicitParam; |
| 13 | import io.swagger.annotations.ApiImplicitParams; | 13 | import io.swagger.annotations.ApiImplicitParams; |
| @@ -2,15 +2,15 @@ package com.zhonglai.luhui.admin.controller.monitor; | @@ -2,15 +2,15 @@ package com.zhonglai.luhui.admin.controller.monitor; | ||
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.Log; | 3 | import com.ruoyi.common.annotation.Log; |
| 4 | import com.ruoyi.common.constant.Constants; | 4 | import com.ruoyi.common.constant.Constants; |
| 5 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 6 | import com.ruoyi.common.core.domain.AjaxResult; | 5 | import com.ruoyi.common.core.domain.AjaxResult; |
| 7 | -import com.ruoyi.system.login.dto.SysLoginUser; | ||
| 8 | import com.ruoyi.common.core.page.TableDataInfo; | 6 | import com.ruoyi.common.core.page.TableDataInfo; |
| 9 | -import com.ruoyi.common.core.redis.RedisCache; | ||
| 10 | import com.ruoyi.common.enums.BusinessType; | 7 | import com.ruoyi.common.enums.BusinessType; |
| 11 | import com.ruoyi.common.utils.StringUtils; | 8 | import com.ruoyi.common.utils.StringUtils; |
| 12 | -import com.ruoyi.system.domain.SysUserOnline; | ||
| 13 | -import com.ruoyi.framework.web.service.ISysUserOnlineService; | 9 | +import com.ruoyi.system.domain.sys.SysUserOnline; |
| 10 | +import com.zhonglai.luhui.security.service.ISysUserOnlineService; | ||
| 11 | +import com.zhonglai.luhui.redis.service.RedisCache; | ||
| 12 | +import com.zhonglai.luhui.action.BaseController; | ||
| 13 | +import com.zhonglai.luhui.security.dto.SysLoginUser; | ||
| 14 | import io.swagger.annotations.Api; | 14 | import io.swagger.annotations.Api; |
| 15 | import io.swagger.annotations.ApiImplicitParam; | 15 | import io.swagger.annotations.ApiImplicitParam; |
| 16 | import io.swagger.annotations.ApiImplicitParams; | 16 | import io.swagger.annotations.ApiImplicitParams; |
| 1 | package com.zhonglai.luhui.admin.controller.system; | 1 | package com.zhonglai.luhui.admin.controller.system; |
| 2 | 2 | ||
| 3 | +import com.zhonglai.luhui.action.BaseController; | ||
| 4 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 5 | +import com.zhonglai.luhui.sys.service.ISysConfigService; | ||
| 6 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 3 | import com.ruoyi.common.annotation.Log; | 7 | import com.ruoyi.common.annotation.Log; |
| 4 | import com.ruoyi.system.domain.entity.UserConstants; | 8 | import com.ruoyi.system.domain.entity.UserConstants; |
| 5 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 6 | import com.ruoyi.common.core.domain.AjaxResult; | 9 | import com.ruoyi.common.core.domain.AjaxResult; |
| 7 | import com.ruoyi.common.core.page.TableDataInfo; | 10 | import com.ruoyi.common.core.page.TableDataInfo; |
| 8 | import com.ruoyi.common.enums.BusinessType; | 11 | import com.ruoyi.common.enums.BusinessType; |
| 9 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 10 | -import com.ruoyi.system.domain.SysConfig; | ||
| 11 | -import com.ruoyi.system.service.ISysConfigService; | 12 | +import com.ruoyi.system.domain.sys.SysConfig; |
| 12 | import io.swagger.annotations.Api; | 13 | import io.swagger.annotations.Api; |
| 13 | import io.swagger.annotations.ApiImplicitParam; | 14 | import io.swagger.annotations.ApiImplicitParam; |
| 14 | import io.swagger.annotations.ApiImplicitParams; | 15 | import io.swagger.annotations.ApiImplicitParams; |
| @@ -98,7 +99,7 @@ public class SysConfigController extends BaseController | @@ -98,7 +99,7 @@ public class SysConfigController extends BaseController | ||
| 98 | { | 99 | { |
| 99 | return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); | 100 | return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| 100 | } | 101 | } |
| 101 | - config.setCreateBy(getUsername()); | 102 | + config.setCreateBy(SecurityUtils.getUsername()); |
| 102 | return toAjax(configService.insertConfig(config)); | 103 | return toAjax(configService.insertConfig(config)); |
| 103 | } | 104 | } |
| 104 | 105 | ||
| @@ -115,7 +116,7 @@ public class SysConfigController extends BaseController | @@ -115,7 +116,7 @@ public class SysConfigController extends BaseController | ||
| 115 | { | 116 | { |
| 116 | return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); | 117 | return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); |
| 117 | } | 118 | } |
| 118 | - config.setUpdateBy(getUsername()); | 119 | + config.setUpdateBy(SecurityUtils.getUsername()); |
| 119 | return toAjax(configService.updateConfig(config)); | 120 | return toAjax(configService.updateConfig(config)); |
| 120 | } | 121 | } |
| 121 | 122 |
| @@ -2,12 +2,14 @@ package com.zhonglai.luhui.admin.controller.system; | @@ -2,12 +2,14 @@ package com.zhonglai.luhui.admin.controller.system; | ||
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.Log; | 3 | import com.ruoyi.common.annotation.Log; |
| 4 | import com.ruoyi.system.domain.entity.UserConstants; | 4 | import com.ruoyi.system.domain.entity.UserConstants; |
| 5 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 6 | import com.ruoyi.common.core.domain.AjaxResult; | 5 | import com.ruoyi.common.core.domain.AjaxResult; |
| 7 | import com.ruoyi.system.domain.entity.SysDept; | 6 | import com.ruoyi.system.domain.entity.SysDept; |
| 8 | import com.ruoyi.common.enums.BusinessType; | 7 | import com.ruoyi.common.enums.BusinessType; |
| 9 | import com.ruoyi.common.utils.StringUtils; | 8 | import com.ruoyi.common.utils.StringUtils; |
| 10 | -import com.ruoyi.system.service.ISysDeptService; | 9 | +import com.zhonglai.luhui.action.BaseController; |
| 10 | +import com.zhonglai.luhui.security.service.SecurityService; | ||
| 11 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 12 | +import com.zhonglai.luhui.sys.service.ISysDeptService; | ||
| 11 | import io.swagger.annotations.Api; | 13 | import io.swagger.annotations.Api; |
| 12 | import io.swagger.annotations.ApiImplicitParam; | 14 | import io.swagger.annotations.ApiImplicitParam; |
| 13 | import io.swagger.annotations.ApiImplicitParams; | 15 | import io.swagger.annotations.ApiImplicitParams; |
| @@ -34,6 +36,8 @@ public class SysDeptController extends BaseController | @@ -34,6 +36,8 @@ public class SysDeptController extends BaseController | ||
| 34 | @Autowired | 36 | @Autowired |
| 35 | private ISysDeptService deptService; | 37 | private ISysDeptService deptService; |
| 36 | 38 | ||
| 39 | + @Autowired | ||
| 40 | + private SecurityService securityService; | ||
| 37 | /** | 41 | /** |
| 38 | * 获取部门列表 | 42 | * 获取部门列表 |
| 39 | */ | 43 | */ |
| @@ -82,7 +86,7 @@ public class SysDeptController extends BaseController | @@ -82,7 +86,7 @@ public class SysDeptController extends BaseController | ||
| 82 | @GetMapping(value = "/{deptId}") | 86 | @GetMapping(value = "/{deptId}") |
| 83 | public AjaxResult getInfo(@PathVariable Long deptId) | 87 | public AjaxResult getInfo(@PathVariable Long deptId) |
| 84 | { | 88 | { |
| 85 | - deptService.checkDeptDataScope(deptId); | 89 | + securityService.checkDeptDataScope(deptId); |
| 86 | return AjaxResult.success(deptService.selectDeptById(deptId)); | 90 | return AjaxResult.success(deptService.selectDeptById(deptId)); |
| 87 | } | 91 | } |
| 88 | 92 | ||
| @@ -94,7 +98,7 @@ public class SysDeptController extends BaseController | @@ -94,7 +98,7 @@ public class SysDeptController extends BaseController | ||
| 94 | public AjaxResult treeselect(SysDept dept) | 98 | public AjaxResult treeselect(SysDept dept) |
| 95 | { | 99 | { |
| 96 | List<SysDept> depts = deptService.selectDeptList(dept); | 100 | List<SysDept> depts = deptService.selectDeptList(dept); |
| 97 | - return AjaxResult.success(deptService.buildDeptTreeSelect(depts)); | 101 | + return AjaxResult.success(securityService.buildDeptTreeSelect(depts)); |
| 98 | } | 102 | } |
| 99 | 103 | ||
| 100 | /** | 104 | /** |
| @@ -110,7 +114,7 @@ public class SysDeptController extends BaseController | @@ -110,7 +114,7 @@ public class SysDeptController extends BaseController | ||
| 110 | List<SysDept> depts = deptService.selectDeptList(new SysDept()); | 114 | List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
| 111 | AjaxResult ajax = AjaxResult.success(); | 115 | AjaxResult ajax = AjaxResult.success(); |
| 112 | ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); | 116 | ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); |
| 113 | - ajax.put("depts", deptService.buildDeptTreeSelect(depts)); | 117 | + ajax.put("depts", securityService.buildDeptTreeSelect(depts)); |
| 114 | return ajax; | 118 | return ajax; |
| 115 | } | 119 | } |
| 116 | 120 | ||
| @@ -127,7 +131,7 @@ public class SysDeptController extends BaseController | @@ -127,7 +131,7 @@ public class SysDeptController extends BaseController | ||
| 127 | { | 131 | { |
| 128 | return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); | 132 | return AjaxResult.error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| 129 | } | 133 | } |
| 130 | - dept.setCreateBy(getUsername()); | 134 | + dept.setCreateBy(SecurityUtils.getUsername()); |
| 131 | return toAjax(deptService.insertDept(dept)); | 135 | return toAjax(deptService.insertDept(dept)); |
| 132 | } | 136 | } |
| 133 | 137 | ||
| @@ -141,7 +145,7 @@ public class SysDeptController extends BaseController | @@ -141,7 +145,7 @@ public class SysDeptController extends BaseController | ||
| 141 | public AjaxResult edit(@Validated @RequestBody SysDept dept) | 145 | public AjaxResult edit(@Validated @RequestBody SysDept dept) |
| 142 | { | 146 | { |
| 143 | Long deptId = dept.getDeptId(); | 147 | Long deptId = dept.getDeptId(); |
| 144 | - deptService.checkDeptDataScope(deptId); | 148 | + securityService.checkDeptDataScope(deptId); |
| 145 | if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) | 149 | if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) |
| 146 | { | 150 | { |
| 147 | return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); | 151 | return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| @@ -154,7 +158,7 @@ public class SysDeptController extends BaseController | @@ -154,7 +158,7 @@ public class SysDeptController extends BaseController | ||
| 154 | { | 158 | { |
| 155 | return AjaxResult.error("该部门包含未停用的子部门!"); | 159 | return AjaxResult.error("该部门包含未停用的子部门!"); |
| 156 | } | 160 | } |
| 157 | - dept.setUpdateBy(getUsername()); | 161 | + dept.setUpdateBy(SecurityUtils.getUsername()); |
| 158 | return toAjax(deptService.updateDept(dept)); | 162 | return toAjax(deptService.updateDept(dept)); |
| 159 | } | 163 | } |
| 160 | 164 | ||
| @@ -178,7 +182,7 @@ public class SysDeptController extends BaseController | @@ -178,7 +182,7 @@ public class SysDeptController extends BaseController | ||
| 178 | { | 182 | { |
| 179 | return AjaxResult.error("部门存在用户,不允许删除"); | 183 | return AjaxResult.error("部门存在用户,不允许删除"); |
| 180 | } | 184 | } |
| 181 | - deptService.checkDeptDataScope(deptId); | 185 | + securityService.checkDeptDataScope(deptId); |
| 182 | return toAjax(deptService.deleteDeptById(deptId)); | 186 | return toAjax(deptService.deleteDeptById(deptId)); |
| 183 | } | 187 | } |
| 184 | } | 188 | } |
| 1 | package com.zhonglai.luhui.admin.controller.system; | 1 | package com.zhonglai.luhui.admin.controller.system; |
| 2 | 2 | ||
| 3 | +import com.zhonglai.luhui.action.BaseController; | ||
| 4 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 5 | +import com.zhonglai.luhui.sys.service.ISysDictDataService; | ||
| 6 | +import com.zhonglai.luhui.sys.service.ISysDictTypeService; | ||
| 7 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 3 | import com.ruoyi.common.annotation.Log; | 8 | import com.ruoyi.common.annotation.Log; |
| 4 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 5 | import com.ruoyi.common.core.domain.AjaxResult; | 9 | import com.ruoyi.common.core.domain.AjaxResult; |
| 6 | import com.ruoyi.system.domain.entity.SysDictData; | 10 | import com.ruoyi.system.domain.entity.SysDictData; |
| 7 | import com.ruoyi.common.core.page.TableDataInfo; | 11 | import com.ruoyi.common.core.page.TableDataInfo; |
| 8 | import com.ruoyi.common.enums.BusinessType; | 12 | import com.ruoyi.common.enums.BusinessType; |
| 9 | import com.ruoyi.common.utils.StringUtils; | 13 | import com.ruoyi.common.utils.StringUtils; |
| 10 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 11 | -import com.ruoyi.system.service.ISysDictDataService; | ||
| 12 | -import com.ruoyi.system.service.ISysDictTypeService; | ||
| 13 | import io.swagger.annotations.Api; | 14 | import io.swagger.annotations.Api; |
| 14 | import io.swagger.annotations.ApiImplicitParam; | 15 | import io.swagger.annotations.ApiImplicitParam; |
| 15 | import io.swagger.annotations.ApiImplicitParams; | 16 | import io.swagger.annotations.ApiImplicitParams; |
| @@ -101,7 +102,7 @@ public class SysDictDataController extends BaseController | @@ -101,7 +102,7 @@ public class SysDictDataController extends BaseController | ||
| 101 | @PostMapping | 102 | @PostMapping |
| 102 | public AjaxResult add(@Validated @RequestBody SysDictData dict) | 103 | public AjaxResult add(@Validated @RequestBody SysDictData dict) |
| 103 | { | 104 | { |
| 104 | - dict.setCreateBy(getUsername()); | 105 | + dict.setCreateBy(SecurityUtils.getUsername()); |
| 105 | return toAjax(dictDataService.insertDictData(dict)); | 106 | return toAjax(dictDataService.insertDictData(dict)); |
| 106 | } | 107 | } |
| 107 | 108 | ||
| @@ -114,7 +115,7 @@ public class SysDictDataController extends BaseController | @@ -114,7 +115,7 @@ public class SysDictDataController extends BaseController | ||
| 114 | @PutMapping | 115 | @PutMapping |
| 115 | public AjaxResult edit(@Validated @RequestBody SysDictData dict) | 116 | public AjaxResult edit(@Validated @RequestBody SysDictData dict) |
| 116 | { | 117 | { |
| 117 | - dict.setUpdateBy(getUsername()); | 118 | + dict.setUpdateBy(SecurityUtils.getUsername()); |
| 118 | return toAjax(dictDataService.updateDictData(dict)); | 119 | return toAjax(dictDataService.updateDictData(dict)); |
| 119 | } | 120 | } |
| 120 | 121 |
| 1 | package com.zhonglai.luhui.admin.controller.system; | 1 | package com.zhonglai.luhui.admin.controller.system; |
| 2 | 2 | ||
| 3 | +import com.zhonglai.luhui.action.BaseController; | ||
| 4 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 5 | +import com.zhonglai.luhui.sys.service.ISysDictTypeService; | ||
| 6 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 3 | import com.ruoyi.common.annotation.Log; | 7 | import com.ruoyi.common.annotation.Log; |
| 4 | import com.ruoyi.system.domain.entity.UserConstants; | 8 | import com.ruoyi.system.domain.entity.UserConstants; |
| 5 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 6 | import com.ruoyi.common.core.domain.AjaxResult; | 9 | import com.ruoyi.common.core.domain.AjaxResult; |
| 7 | import com.ruoyi.system.domain.entity.SysDictType; | 10 | import com.ruoyi.system.domain.entity.SysDictType; |
| 8 | import com.ruoyi.common.core.page.TableDataInfo; | 11 | import com.ruoyi.common.core.page.TableDataInfo; |
| 9 | import com.ruoyi.common.enums.BusinessType; | 12 | import com.ruoyi.common.enums.BusinessType; |
| 10 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 11 | -import com.ruoyi.system.service.ISysDictTypeService; | ||
| 12 | import io.swagger.annotations.Api; | 13 | import io.swagger.annotations.Api; |
| 13 | import io.swagger.annotations.ApiOperation; | 14 | import io.swagger.annotations.ApiOperation; |
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -77,7 +78,7 @@ public class SysDictTypeController extends BaseController | @@ -77,7 +78,7 @@ public class SysDictTypeController extends BaseController | ||
| 77 | { | 78 | { |
| 78 | return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); | 79 | return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| 79 | } | 80 | } |
| 80 | - dict.setCreateBy(getUsername()); | 81 | + dict.setCreateBy(SecurityUtils.getUsername()); |
| 81 | return toAjax(dictTypeService.insertDictType(dict)); | 82 | return toAjax(dictTypeService.insertDictType(dict)); |
| 82 | } | 83 | } |
| 83 | 84 | ||
| @@ -94,7 +95,7 @@ public class SysDictTypeController extends BaseController | @@ -94,7 +95,7 @@ public class SysDictTypeController extends BaseController | ||
| 94 | { | 95 | { |
| 95 | return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); | 96 | return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); |
| 96 | } | 97 | } |
| 97 | - dict.setUpdateBy(getUsername()); | 98 | + dict.setUpdateBy(SecurityUtils.getUsername()); |
| 98 | return toAjax(dictTypeService.updateDictType(dict)); | 99 | return toAjax(dictTypeService.updateDictType(dict)); |
| 99 | } | 100 | } |
| 100 | 101 |
| 1 | package com.zhonglai.luhui.admin.controller.system; | 1 | package com.zhonglai.luhui.admin.controller.system; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.constant.Constants; | 3 | import com.ruoyi.common.constant.Constants; |
| 4 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 5 | import com.ruoyi.common.core.domain.AjaxResult; | 4 | import com.ruoyi.common.core.domain.AjaxResult; |
| 6 | import com.ruoyi.system.domain.entity.SysMenu; | 5 | import com.ruoyi.system.domain.entity.SysMenu; |
| 7 | import com.ruoyi.system.domain.entity.SysUser; | 6 | import com.ruoyi.system.domain.entity.SysUser; |
| 8 | -import com.ruoyi.system.login.service.LoginService; | ||
| 9 | import com.zhonglai.luhui.admin.model.LoginBody; | 7 | import com.zhonglai.luhui.admin.model.LoginBody; |
| 10 | -import com.ruoyi.common.utils.SecurityUtils; | ||
| 11 | -import com.zhonglai.luhui.admin.service.SysLoginService; | ||
| 12 | import com.zhonglai.luhui.admin.service.SysPermissionService; | 8 | import com.zhonglai.luhui.admin.service.SysPermissionService; |
| 13 | -import com.ruoyi.system.service.ISysMenuService; | 9 | +import com.zhonglai.luhui.action.BaseController; |
| 10 | +import com.zhonglai.luhui.security.service.LoginService; | ||
| 11 | +import com.zhonglai.luhui.security.service.SecurityService; | ||
| 12 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 13 | +import com.zhonglai.luhui.sys.service.ISysMenuService; | ||
| 14 | import io.swagger.annotations.Api; | 14 | import io.swagger.annotations.Api; |
| 15 | import io.swagger.annotations.ApiOperation; | 15 | import io.swagger.annotations.ApiOperation; |
| 16 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -40,6 +40,8 @@ public class SysLoginController extends BaseController | @@ -40,6 +40,8 @@ public class SysLoginController extends BaseController | ||
| 40 | @Autowired | 40 | @Autowired |
| 41 | private SysPermissionService permissionService; | 41 | private SysPermissionService permissionService; |
| 42 | 42 | ||
| 43 | + @Autowired | ||
| 44 | + private SecurityService securityService; | ||
| 43 | @ApiOperation("登录方法") | 45 | @ApiOperation("登录方法") |
| 44 | @PostMapping("/login") | 46 | @PostMapping("/login") |
| 45 | public AjaxResult login(@RequestBody LoginBody loginBody) | 47 | public AjaxResult login(@RequestBody LoginBody loginBody) |
| @@ -83,7 +85,7 @@ public class SysLoginController extends BaseController | @@ -83,7 +85,7 @@ public class SysLoginController extends BaseController | ||
| 83 | public AjaxResult getRouters() | 85 | public AjaxResult getRouters() |
| 84 | { | 86 | { |
| 85 | Long userId = SecurityUtils.getUserId(); | 87 | Long userId = SecurityUtils.getUserId(); |
| 86 | - List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); | 88 | + List<SysMenu> menus = securityService.selectMenuTreeByUserId(userId); |
| 87 | return AjaxResult.success(menuService.buildMenus(menus)); | 89 | return AjaxResult.success(menuService.buildMenus(menus)); |
| 88 | } | 90 | } |
| 89 | } | 91 | } |
| @@ -2,12 +2,14 @@ package com.zhonglai.luhui.admin.controller.system; | @@ -2,12 +2,14 @@ package com.zhonglai.luhui.admin.controller.system; | ||
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.Log; | 3 | import com.ruoyi.common.annotation.Log; |
| 4 | import com.ruoyi.system.domain.entity.UserConstants; | 4 | import com.ruoyi.system.domain.entity.UserConstants; |
| 5 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 6 | import com.ruoyi.common.core.domain.AjaxResult; | 5 | import com.ruoyi.common.core.domain.AjaxResult; |
| 7 | import com.ruoyi.system.domain.entity.SysMenu; | 6 | import com.ruoyi.system.domain.entity.SysMenu; |
| 8 | import com.ruoyi.common.enums.BusinessType; | 7 | import com.ruoyi.common.enums.BusinessType; |
| 9 | import com.ruoyi.common.utils.StringUtils; | 8 | import com.ruoyi.common.utils.StringUtils; |
| 10 | -import com.ruoyi.system.service.ISysMenuService; | 9 | +import com.zhonglai.luhui.action.BaseController; |
| 10 | +import com.zhonglai.luhui.security.service.SecurityService; | ||
| 11 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 12 | +import com.zhonglai.luhui.sys.service.ISysMenuService; | ||
| 11 | import io.swagger.annotations.Api; | 13 | import io.swagger.annotations.Api; |
| 12 | import io.swagger.annotations.ApiOperation; | 14 | import io.swagger.annotations.ApiOperation; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -30,6 +32,8 @@ public class SysMenuController extends BaseController | @@ -30,6 +32,8 @@ public class SysMenuController extends BaseController | ||
| 30 | @Autowired | 32 | @Autowired |
| 31 | private ISysMenuService menuService; | 33 | private ISysMenuService menuService; |
| 32 | 34 | ||
| 35 | + @Autowired | ||
| 36 | + private SecurityService securityService; | ||
| 33 | /** | 37 | /** |
| 34 | * 获取菜单列表 | 38 | * 获取菜单列表 |
| 35 | */ | 39 | */ |
| @@ -38,7 +42,7 @@ public class SysMenuController extends BaseController | @@ -38,7 +42,7 @@ public class SysMenuController extends BaseController | ||
| 38 | @GetMapping("/list") | 42 | @GetMapping("/list") |
| 39 | public AjaxResult list(SysMenu menu) | 43 | public AjaxResult list(SysMenu menu) |
| 40 | { | 44 | { |
| 41 | - List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); | 45 | + List<SysMenu> menus = menuService.selectMenuList(menu, SecurityUtils.getUserId()); |
| 42 | return AjaxResult.success(menus); | 46 | return AjaxResult.success(menus); |
| 43 | } | 47 | } |
| 44 | 48 | ||
| @@ -60,8 +64,8 @@ public class SysMenuController extends BaseController | @@ -60,8 +64,8 @@ public class SysMenuController extends BaseController | ||
| 60 | @GetMapping("/treeselect") | 64 | @GetMapping("/treeselect") |
| 61 | public AjaxResult treeselect(SysMenu menu) | 65 | public AjaxResult treeselect(SysMenu menu) |
| 62 | { | 66 | { |
| 63 | - List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); | ||
| 64 | - return AjaxResult.success(menuService.buildMenuTreeSelect(menus)); | 67 | + List<SysMenu> menus = menuService.selectMenuList(menu, SecurityUtils.getUserId()); |
| 68 | + return AjaxResult.success(securityService.buildMenuTreeSelect(menus)); | ||
| 65 | } | 69 | } |
| 66 | 70 | ||
| 67 | /** | 71 | /** |
| @@ -71,10 +75,10 @@ public class SysMenuController extends BaseController | @@ -71,10 +75,10 @@ public class SysMenuController extends BaseController | ||
| 71 | @GetMapping(value = "/roleMenuTreeselect/{roleId}") | 75 | @GetMapping(value = "/roleMenuTreeselect/{roleId}") |
| 72 | public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) | 76 | public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) |
| 73 | { | 77 | { |
| 74 | - List<SysMenu> menus = menuService.selectMenuList(getUserId()); | 78 | + List<SysMenu> menus = menuService.selectMenuList(SecurityUtils.getUserId()); |
| 75 | AjaxResult ajax = AjaxResult.success(); | 79 | AjaxResult ajax = AjaxResult.success(); |
| 76 | ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); | 80 | ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); |
| 77 | - ajax.put("menus", menuService.buildMenuTreeSelect(menus)); | 81 | + ajax.put("menus", securityService.buildMenuTreeSelect(menus)); |
| 78 | return ajax; | 82 | return ajax; |
| 79 | } | 83 | } |
| 80 | 84 | ||
| @@ -95,7 +99,7 @@ public class SysMenuController extends BaseController | @@ -95,7 +99,7 @@ public class SysMenuController extends BaseController | ||
| 95 | { | 99 | { |
| 96 | return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); | 100 | return AjaxResult.error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头"); |
| 97 | } | 101 | } |
| 98 | - menu.setCreateBy(getUsername()); | 102 | + menu.setCreateBy(SecurityUtils.getUsername()); |
| 99 | return toAjax(menuService.insertMenu(menu)); | 103 | return toAjax(menuService.insertMenu(menu)); |
| 100 | } | 104 | } |
| 101 | 105 | ||
| @@ -120,7 +124,7 @@ public class SysMenuController extends BaseController | @@ -120,7 +124,7 @@ public class SysMenuController extends BaseController | ||
| 120 | { | 124 | { |
| 121 | return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); | 125 | return AjaxResult.error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己"); |
| 122 | } | 126 | } |
| 123 | - menu.setUpdateBy(getUsername()); | 127 | + menu.setUpdateBy(SecurityUtils.getUsername()); |
| 124 | return toAjax(menuService.updateMenu(menu)); | 128 | return toAjax(menuService.updateMenu(menu)); |
| 125 | } | 129 | } |
| 126 | 130 |
| 1 | package com.zhonglai.luhui.admin.controller.system; | 1 | package com.zhonglai.luhui.admin.controller.system; |
| 2 | 2 | ||
| 3 | +import com.zhonglai.luhui.action.BaseController; | ||
| 3 | import com.ruoyi.common.annotation.Log; | 4 | import com.ruoyi.common.annotation.Log; |
| 4 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 5 | import com.ruoyi.common.core.domain.AjaxResult; | 5 | import com.ruoyi.common.core.domain.AjaxResult; |
| 6 | import com.ruoyi.common.core.page.TableDataInfo; | 6 | import com.ruoyi.common.core.page.TableDataInfo; |
| 7 | import com.ruoyi.common.enums.BusinessType; | 7 | import com.ruoyi.common.enums.BusinessType; |
| 8 | -import com.ruoyi.system.domain.SysNotice; | ||
| 9 | -import com.ruoyi.system.service.ISysNoticeService; | 8 | +import com.ruoyi.system.domain.sys.SysNotice; |
| 9 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 10 | +import com.zhonglai.luhui.sys.service.ISysNoticeService; | ||
| 10 | import io.swagger.annotations.Api; | 11 | import io.swagger.annotations.Api; |
| 11 | import io.swagger.annotations.ApiOperation; | 12 | import io.swagger.annotations.ApiOperation; |
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -62,7 +63,7 @@ public class SysNoticeController extends BaseController | @@ -62,7 +63,7 @@ public class SysNoticeController extends BaseController | ||
| 62 | @PostMapping | 63 | @PostMapping |
| 63 | public AjaxResult add(@Validated @RequestBody SysNotice notice) | 64 | public AjaxResult add(@Validated @RequestBody SysNotice notice) |
| 64 | { | 65 | { |
| 65 | - notice.setCreateBy(getUsername()); | 66 | + notice.setCreateBy(SecurityUtils.getUsername()); |
| 66 | return toAjax(noticeService.insertNotice(notice)); | 67 | return toAjax(noticeService.insertNotice(notice)); |
| 67 | } | 68 | } |
| 68 | 69 | ||
| @@ -75,7 +76,7 @@ public class SysNoticeController extends BaseController | @@ -75,7 +76,7 @@ public class SysNoticeController extends BaseController | ||
| 75 | @PutMapping | 76 | @PutMapping |
| 76 | public AjaxResult edit(@Validated @RequestBody SysNotice notice) | 77 | public AjaxResult edit(@Validated @RequestBody SysNotice notice) |
| 77 | { | 78 | { |
| 78 | - notice.setUpdateBy(getUsername()); | 79 | + notice.setUpdateBy(SecurityUtils.getUsername()); |
| 79 | return toAjax(noticeService.updateNotice(notice)); | 80 | return toAjax(noticeService.updateNotice(notice)); |
| 80 | } | 81 | } |
| 81 | 82 |
| 1 | package com.zhonglai.luhui.admin.controller.system; | 1 | package com.zhonglai.luhui.admin.controller.system; |
| 2 | 2 | ||
| 3 | +import com.zhonglai.luhui.action.BaseController; | ||
| 4 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 5 | +import com.zhonglai.luhui.sys.service.ISysPostService; | ||
| 6 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 3 | import com.ruoyi.common.annotation.Log; | 7 | import com.ruoyi.common.annotation.Log; |
| 4 | import com.ruoyi.system.domain.entity.UserConstants; | 8 | import com.ruoyi.system.domain.entity.UserConstants; |
| 5 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 6 | import com.ruoyi.common.core.domain.AjaxResult; | 9 | import com.ruoyi.common.core.domain.AjaxResult; |
| 7 | import com.ruoyi.common.core.page.TableDataInfo; | 10 | import com.ruoyi.common.core.page.TableDataInfo; |
| 8 | import com.ruoyi.common.enums.BusinessType; | 11 | import com.ruoyi.common.enums.BusinessType; |
| 9 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 10 | -import com.ruoyi.system.domain.SysPost; | ||
| 11 | -import com.ruoyi.system.service.ISysPostService; | 12 | +import com.ruoyi.system.domain.sys.SysPost; |
| 12 | import io.swagger.annotations.Api; | 13 | import io.swagger.annotations.Api; |
| 13 | import io.swagger.annotations.ApiOperation; | 14 | import io.swagger.annotations.ApiOperation; |
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -84,7 +85,7 @@ public class SysPostController extends BaseController | @@ -84,7 +85,7 @@ public class SysPostController extends BaseController | ||
| 84 | { | 85 | { |
| 85 | return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); | 86 | return AjaxResult.error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
| 86 | } | 87 | } |
| 87 | - post.setCreateBy(getUsername()); | 88 | + post.setCreateBy(SecurityUtils.getUsername()); |
| 88 | return toAjax(postService.insertPost(post)); | 89 | return toAjax(postService.insertPost(post)); |
| 89 | } | 90 | } |
| 90 | 91 | ||
| @@ -105,7 +106,7 @@ public class SysPostController extends BaseController | @@ -105,7 +106,7 @@ public class SysPostController extends BaseController | ||
| 105 | { | 106 | { |
| 106 | return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); | 107 | return AjaxResult.error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在"); |
| 107 | } | 108 | } |
| 108 | - post.setUpdateBy(getUsername()); | 109 | + post.setUpdateBy(SecurityUtils.getUsername()); |
| 109 | return toAjax(postService.updatePost(post)); | 110 | return toAjax(postService.updatePost(post)); |
| 110 | } | 111 | } |
| 111 | 112 |
| @@ -3,16 +3,17 @@ package com.zhonglai.luhui.admin.controller.system; | @@ -3,16 +3,17 @@ package com.zhonglai.luhui.admin.controller.system; | ||
| 3 | import com.ruoyi.common.annotation.Log; | 3 | import com.ruoyi.common.annotation.Log; |
| 4 | import com.ruoyi.common.config.RuoYiConfig; | 4 | import com.ruoyi.common.config.RuoYiConfig; |
| 5 | import com.ruoyi.system.domain.entity.UserConstants; | 5 | import com.ruoyi.system.domain.entity.UserConstants; |
| 6 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 7 | import com.ruoyi.common.core.domain.AjaxResult; | 6 | import com.ruoyi.common.core.domain.AjaxResult; |
| 8 | import com.ruoyi.system.domain.entity.SysUser; | 7 | import com.ruoyi.system.domain.entity.SysUser; |
| 9 | -import com.ruoyi.system.login.dto.SysLoginUser; | ||
| 10 | import com.ruoyi.common.enums.BusinessType; | 8 | import com.ruoyi.common.enums.BusinessType; |
| 11 | -import com.ruoyi.common.utils.SecurityUtils; | ||
| 12 | import com.ruoyi.common.utils.StringUtils; | 9 | import com.ruoyi.common.utils.StringUtils; |
| 13 | import com.ruoyi.common.utils.file.FileUploadUtils; | 10 | import com.ruoyi.common.utils.file.FileUploadUtils; |
| 14 | -import com.ruoyi.system.login.service.TokenService; | ||
| 15 | -import com.ruoyi.system.service.ISysUserService; | 11 | +import com.zhonglai.luhui.action.BaseController; |
| 12 | +import com.zhonglai.luhui.security.controller.LoginBaseController; | ||
| 13 | +import com.zhonglai.luhui.security.dto.SysLoginUser; | ||
| 14 | +import com.zhonglai.luhui.security.service.TokenService; | ||
| 15 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 16 | +import com.zhonglai.luhui.sys.service.ISysUserService; | ||
| 16 | import io.swagger.annotations.Api; | 17 | import io.swagger.annotations.Api; |
| 17 | import io.swagger.annotations.ApiOperation; | 18 | import io.swagger.annotations.ApiOperation; |
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -44,7 +45,7 @@ public class SysProfileController extends BaseController | @@ -44,7 +45,7 @@ public class SysProfileController extends BaseController | ||
| 44 | @GetMapping | 45 | @GetMapping |
| 45 | public AjaxResult profile() | 46 | public AjaxResult profile() |
| 46 | { | 47 | { |
| 47 | - SysLoginUser loginUser = (SysLoginUser) getLoginUser(); | 48 | + SysLoginUser loginUser = (SysLoginUser) LoginBaseController.getLoginUser(); |
| 48 | SysUser user = loginUser.getUser(); | 49 | SysUser user = loginUser.getUser(); |
| 49 | AjaxResult ajax = AjaxResult.success(user); | 50 | AjaxResult ajax = AjaxResult.success(user); |
| 50 | ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername())); | 51 | ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername())); |
| @@ -60,7 +61,7 @@ public class SysProfileController extends BaseController | @@ -60,7 +61,7 @@ public class SysProfileController extends BaseController | ||
| 60 | @PutMapping | 61 | @PutMapping |
| 61 | public AjaxResult updateProfile(@RequestBody SysUser user) | 62 | public AjaxResult updateProfile(@RequestBody SysUser user) |
| 62 | { | 63 | { |
| 63 | - SysLoginUser loginUser = (SysLoginUser) getLoginUser(); | 64 | + SysLoginUser loginUser = (SysLoginUser) LoginBaseController.getLoginUser(); |
| 64 | SysUser sysUser = loginUser.getUser(); | 65 | SysUser sysUser = loginUser.getUser(); |
| 65 | user.setUserName(sysUser.getUserName()); | 66 | user.setUserName(sysUser.getUserName()); |
| 66 | if (StringUtils.isNotEmpty(user.getPhonenumber()) | 67 | if (StringUtils.isNotEmpty(user.getPhonenumber()) |
| @@ -96,7 +97,7 @@ public class SysProfileController extends BaseController | @@ -96,7 +97,7 @@ public class SysProfileController extends BaseController | ||
| 96 | @PutMapping("/updatePwd") | 97 | @PutMapping("/updatePwd") |
| 97 | public AjaxResult updatePwd(String oldPassword, String newPassword) | 98 | public AjaxResult updatePwd(String oldPassword, String newPassword) |
| 98 | { | 99 | { |
| 99 | - SysLoginUser loginUser = (SysLoginUser) getLoginUser(); | 100 | + SysLoginUser loginUser = (SysLoginUser) LoginBaseController.getLoginUser(); |
| 100 | String userName = loginUser.getUsername(); | 101 | String userName = loginUser.getUsername(); |
| 101 | String password = loginUser.getPassword(); | 102 | String password = loginUser.getPassword(); |
| 102 | if (!SecurityUtils.matchesPassword(oldPassword, password)) | 103 | if (!SecurityUtils.matchesPassword(oldPassword, password)) |
| @@ -127,7 +128,7 @@ public class SysProfileController extends BaseController | @@ -127,7 +128,7 @@ public class SysProfileController extends BaseController | ||
| 127 | { | 128 | { |
| 128 | if (!file.isEmpty()) | 129 | if (!file.isEmpty()) |
| 129 | { | 130 | { |
| 130 | - SysLoginUser loginUser = (SysLoginUser) getLoginUser(); | 131 | + SysLoginUser loginUser = (SysLoginUser) LoginBaseController.getLoginUser(); |
| 131 | String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file); | 132 | String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file); |
| 132 | if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) | 133 | if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) |
| 133 | { | 134 | { |
| 1 | package com.zhonglai.luhui.admin.controller.system; | 1 | package com.zhonglai.luhui.admin.controller.system; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.common.core.controller.BaseController; | 3 | +import com.zhonglai.luhui.action.BaseController; |
| 4 | import com.ruoyi.common.core.domain.AjaxResult; | 4 | import com.ruoyi.common.core.domain.AjaxResult; |
| 5 | import com.zhonglai.luhui.admin.model.RegisterBody; | 5 | import com.zhonglai.luhui.admin.model.RegisterBody; |
| 6 | import com.ruoyi.common.utils.StringUtils; | 6 | import com.ruoyi.common.utils.StringUtils; |
| 7 | import com.zhonglai.luhui.admin.service.SysLoginService; | 7 | import com.zhonglai.luhui.admin.service.SysLoginService; |
| 8 | import com.zhonglai.luhui.admin.service.SysRegisterService; | 8 | import com.zhonglai.luhui.admin.service.SysRegisterService; |
| 9 | -import com.ruoyi.system.service.ISysConfigService; | 9 | +import com.zhonglai.luhui.sys.service.ISysConfigService; |
| 10 | import io.swagger.annotations.Api; | 10 | import io.swagger.annotations.Api; |
| 11 | import io.swagger.annotations.ApiOperation; | 11 | import io.swagger.annotations.ApiOperation; |
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -2,20 +2,22 @@ package com.zhonglai.luhui.admin.controller.system; | @@ -2,20 +2,22 @@ package com.zhonglai.luhui.admin.controller.system; | ||
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.Log; | 3 | import com.ruoyi.common.annotation.Log; |
| 4 | import com.ruoyi.system.domain.entity.UserConstants; | 4 | import com.ruoyi.system.domain.entity.UserConstants; |
| 5 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 6 | import com.ruoyi.common.core.domain.AjaxResult; | 5 | import com.ruoyi.common.core.domain.AjaxResult; |
| 7 | import com.ruoyi.system.domain.entity.SysRole; | 6 | import com.ruoyi.system.domain.entity.SysRole; |
| 8 | import com.ruoyi.system.domain.entity.SysUser; | 7 | import com.ruoyi.system.domain.entity.SysUser; |
| 9 | -import com.ruoyi.system.login.dto.SysLoginUser; | ||
| 10 | import com.ruoyi.common.core.page.TableDataInfo; | 8 | import com.ruoyi.common.core.page.TableDataInfo; |
| 11 | import com.ruoyi.common.enums.BusinessType; | 9 | import com.ruoyi.common.enums.BusinessType; |
| 12 | import com.ruoyi.common.utils.StringUtils; | 10 | import com.ruoyi.common.utils.StringUtils; |
| 13 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 11 | +import com.zhonglai.luhui.action.BaseController; |
| 14 | import com.zhonglai.luhui.admin.service.SysPermissionService; | 12 | import com.zhonglai.luhui.admin.service.SysPermissionService; |
| 15 | -import com.ruoyi.system.login.service.TokenService; | ||
| 16 | -import com.ruoyi.system.domain.SysUserRole; | ||
| 17 | -import com.ruoyi.system.service.ISysRoleService; | ||
| 18 | -import com.ruoyi.system.service.ISysUserService; | 13 | +import com.ruoyi.system.domain.sys.SysUserRole; |
| 14 | +import com.zhonglai.luhui.security.controller.LoginBaseController; | ||
| 15 | +import com.zhonglai.luhui.security.dto.SysLoginUser; | ||
| 16 | +import com.zhonglai.luhui.security.service.SecurityService; | ||
| 17 | +import com.zhonglai.luhui.security.service.TokenService; | ||
| 18 | +import com.zhonglai.luhui.sys.service.ISysRoleService; | ||
| 19 | +import com.zhonglai.luhui.sys.service.ISysUserService; | ||
| 20 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 19 | import io.swagger.annotations.Api; | 21 | import io.swagger.annotations.Api; |
| 20 | import io.swagger.annotations.ApiOperation; | 22 | import io.swagger.annotations.ApiOperation; |
| 21 | import org.springframework.beans.factory.annotation.Autowired; | 23 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -48,6 +50,10 @@ public class SysRoleController extends BaseController | @@ -48,6 +50,10 @@ public class SysRoleController extends BaseController | ||
| 48 | @Autowired | 50 | @Autowired |
| 49 | private ISysUserService userService; | 51 | private ISysUserService userService; |
| 50 | 52 | ||
| 53 | + @Autowired | ||
| 54 | + private SecurityService securityService; | ||
| 55 | + | ||
| 56 | + | ||
| 51 | @ApiOperation("列表") | 57 | @ApiOperation("列表") |
| 52 | @PreAuthorize("@ss.hasPermi('system:role:list')") | 58 | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| 53 | @GetMapping("/list") | 59 | @GetMapping("/list") |
| @@ -77,7 +83,7 @@ public class SysRoleController extends BaseController | @@ -77,7 +83,7 @@ public class SysRoleController extends BaseController | ||
| 77 | @GetMapping(value = "/{roleId}") | 83 | @GetMapping(value = "/{roleId}") |
| 78 | public AjaxResult getInfo(@PathVariable Long roleId) | 84 | public AjaxResult getInfo(@PathVariable Long roleId) |
| 79 | { | 85 | { |
| 80 | - roleService.checkRoleDataScope(roleId); | 86 | + securityService.checkRoleDataScope(roleId); |
| 81 | return AjaxResult.success(roleService.selectRoleById(roleId)); | 87 | return AjaxResult.success(roleService.selectRoleById(roleId)); |
| 82 | } | 88 | } |
| 83 | 89 | ||
| @@ -98,7 +104,7 @@ public class SysRoleController extends BaseController | @@ -98,7 +104,7 @@ public class SysRoleController extends BaseController | ||
| 98 | { | 104 | { |
| 99 | return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); | 105 | return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); |
| 100 | } | 106 | } |
| 101 | - role.setCreateBy(getUsername()); | 107 | + role.setCreateBy(LoginBaseController.getUsername()); |
| 102 | return toAjax(roleService.insertRole(role)); | 108 | return toAjax(roleService.insertRole(role)); |
| 103 | 109 | ||
| 104 | } | 110 | } |
| @@ -113,7 +119,7 @@ public class SysRoleController extends BaseController | @@ -113,7 +119,7 @@ public class SysRoleController extends BaseController | ||
| 113 | public AjaxResult edit(@Validated @RequestBody SysRole role) | 119 | public AjaxResult edit(@Validated @RequestBody SysRole role) |
| 114 | { | 120 | { |
| 115 | roleService.checkRoleAllowed(role); | 121 | roleService.checkRoleAllowed(role); |
| 116 | - roleService.checkRoleDataScope(role.getRoleId()); | 122 | + securityService.checkRoleDataScope(role.getRoleId()); |
| 117 | if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) | 123 | if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) |
| 118 | { | 124 | { |
| 119 | return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); | 125 | return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); |
| @@ -122,12 +128,12 @@ public class SysRoleController extends BaseController | @@ -122,12 +128,12 @@ public class SysRoleController extends BaseController | ||
| 122 | { | 128 | { |
| 123 | return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); | 129 | return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); |
| 124 | } | 130 | } |
| 125 | - role.setUpdateBy(getUsername()); | 131 | + role.setUpdateBy(LoginBaseController.getUsername()); |
| 126 | 132 | ||
| 127 | if (roleService.updateRole(role) > 0) | 133 | if (roleService.updateRole(role) > 0) |
| 128 | { | 134 | { |
| 129 | // 更新缓存用户权限 | 135 | // 更新缓存用户权限 |
| 130 | - SysLoginUser loginUser = (SysLoginUser) getLoginUser(); | 136 | + SysLoginUser loginUser = (SysLoginUser) LoginBaseController.getLoginUser(); |
| 131 | if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) | 137 | if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) |
| 132 | { | 138 | { |
| 133 | loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser())); | 139 | loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser())); |
| @@ -149,7 +155,7 @@ public class SysRoleController extends BaseController | @@ -149,7 +155,7 @@ public class SysRoleController extends BaseController | ||
| 149 | public AjaxResult dataScope(@RequestBody SysRole role) | 155 | public AjaxResult dataScope(@RequestBody SysRole role) |
| 150 | { | 156 | { |
| 151 | roleService.checkRoleAllowed(role); | 157 | roleService.checkRoleAllowed(role); |
| 152 | - roleService.checkRoleDataScope(role.getRoleId()); | 158 | + securityService.checkRoleDataScope(role.getRoleId()); |
| 153 | return toAjax(roleService.authDataScope(role)); | 159 | return toAjax(roleService.authDataScope(role)); |
| 154 | } | 160 | } |
| 155 | 161 | ||
| @@ -163,8 +169,8 @@ public class SysRoleController extends BaseController | @@ -163,8 +169,8 @@ public class SysRoleController extends BaseController | ||
| 163 | public AjaxResult changeStatus(@RequestBody SysRole role) | 169 | public AjaxResult changeStatus(@RequestBody SysRole role) |
| 164 | { | 170 | { |
| 165 | roleService.checkRoleAllowed(role); | 171 | roleService.checkRoleAllowed(role); |
| 166 | - roleService.checkRoleDataScope(role.getRoleId()); | ||
| 167 | - role.setUpdateBy(getUsername()); | 172 | + securityService.checkRoleDataScope(role.getRoleId()); |
| 173 | + role.setUpdateBy(LoginBaseController.getUsername()); | ||
| 168 | return toAjax(roleService.updateRoleStatus(role)); | 174 | return toAjax(roleService.updateRoleStatus(role)); |
| 169 | } | 175 | } |
| 170 | 176 | ||
| @@ -177,7 +183,7 @@ public class SysRoleController extends BaseController | @@ -177,7 +183,7 @@ public class SysRoleController extends BaseController | ||
| 177 | @DeleteMapping("/{roleIds}") | 183 | @DeleteMapping("/{roleIds}") |
| 178 | public AjaxResult remove(@PathVariable Long[] roleIds) | 184 | public AjaxResult remove(@PathVariable Long[] roleIds) |
| 179 | { | 185 | { |
| 180 | - return toAjax(roleService.deleteRoleByIds(roleIds)); | 186 | + return toAjax(securityService.deleteRoleByIds(roleIds)); |
| 181 | } | 187 | } |
| 182 | 188 | ||
| 183 | /** | 189 | /** |
| @@ -250,7 +256,7 @@ public class SysRoleController extends BaseController | @@ -250,7 +256,7 @@ public class SysRoleController extends BaseController | ||
| 250 | @PutMapping("/authUser/selectAll") | 256 | @PutMapping("/authUser/selectAll") |
| 251 | public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) | 257 | public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) |
| 252 | { | 258 | { |
| 253 | - roleService.checkRoleDataScope(roleId); | 259 | + securityService.checkRoleDataScope(roleId); |
| 254 | return toAjax(roleService.insertAuthUsers(roleId, userIds)); | 260 | return toAjax(roleService.insertAuthUsers(roleId, userIds)); |
| 255 | } | 261 | } |
| 256 | } | 262 | } |
| @@ -2,18 +2,19 @@ package com.zhonglai.luhui.admin.controller.system; | @@ -2,18 +2,19 @@ package com.zhonglai.luhui.admin.controller.system; | ||
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.Log; | 3 | import com.ruoyi.common.annotation.Log; |
| 4 | import com.ruoyi.system.domain.entity.UserConstants; | 4 | import com.ruoyi.system.domain.entity.UserConstants; |
| 5 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 6 | import com.ruoyi.common.core.domain.AjaxResult; | 5 | import com.ruoyi.common.core.domain.AjaxResult; |
| 7 | import com.ruoyi.system.domain.entity.SysRole; | 6 | import com.ruoyi.system.domain.entity.SysRole; |
| 8 | import com.ruoyi.system.domain.entity.SysUser; | 7 | import com.ruoyi.system.domain.entity.SysUser; |
| 9 | import com.ruoyi.common.core.page.TableDataInfo; | 8 | import com.ruoyi.common.core.page.TableDataInfo; |
| 10 | import com.ruoyi.common.enums.BusinessType; | 9 | import com.ruoyi.common.enums.BusinessType; |
| 11 | -import com.ruoyi.common.utils.SecurityUtils; | ||
| 12 | import com.ruoyi.common.utils.StringUtils; | 10 | import com.ruoyi.common.utils.StringUtils; |
| 13 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 14 | -import com.ruoyi.system.service.ISysPostService; | ||
| 15 | -import com.ruoyi.system.service.ISysRoleService; | ||
| 16 | -import com.ruoyi.system.service.ISysUserService; | 11 | +import com.zhonglai.luhui.action.BaseController; |
| 12 | +import com.zhonglai.luhui.security.service.SecurityService; | ||
| 13 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 14 | +import com.zhonglai.luhui.sys.service.ISysPostService; | ||
| 15 | +import com.zhonglai.luhui.sys.service.ISysRoleService; | ||
| 16 | +import com.zhonglai.luhui.sys.service.ISysUserService; | ||
| 17 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 17 | import io.swagger.annotations.Api; | 18 | import io.swagger.annotations.Api; |
| 18 | import io.swagger.annotations.ApiOperation; | 19 | import io.swagger.annotations.ApiOperation; |
| 19 | import org.apache.commons.lang3.ArrayUtils; | 20 | import org.apache.commons.lang3.ArrayUtils; |
| @@ -46,6 +47,8 @@ public class SysUserController extends BaseController | @@ -46,6 +47,8 @@ public class SysUserController extends BaseController | ||
| 46 | @Autowired | 47 | @Autowired |
| 47 | private ISysPostService postService; | 48 | private ISysPostService postService; |
| 48 | 49 | ||
| 50 | + @Autowired | ||
| 51 | + private SecurityService securityService; | ||
| 49 | /** | 52 | /** |
| 50 | * 获取用户列表 | 53 | * 获取用户列表 |
| 51 | */ | 54 | */ |
| @@ -78,8 +81,8 @@ public class SysUserController extends BaseController | @@ -78,8 +81,8 @@ public class SysUserController extends BaseController | ||
| 78 | { | 81 | { |
| 79 | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); | 82 | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| 80 | List<SysUser> userList = util.importExcel(file.getInputStream()); | 83 | List<SysUser> userList = util.importExcel(file.getInputStream()); |
| 81 | - String operName = getUsername(); | ||
| 82 | - String message = userService.importUser(userList, updateSupport, operName); | 84 | + String operName = SecurityUtils.getUsername(); |
| 85 | + String message = securityService.importUser(userList, updateSupport, operName); | ||
| 83 | return AjaxResult.success(message); | 86 | return AjaxResult.success(message); |
| 84 | } | 87 | } |
| 85 | 88 | ||
| @@ -99,7 +102,7 @@ public class SysUserController extends BaseController | @@ -99,7 +102,7 @@ public class SysUserController extends BaseController | ||
| 99 | @GetMapping(value = { "/", "/{userId}" }) | 102 | @GetMapping(value = { "/", "/{userId}" }) |
| 100 | public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) | 103 | public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) |
| 101 | { | 104 | { |
| 102 | - userService.checkUserDataScope(userId); | 105 | + securityService.checkUserDataScope(userId); |
| 103 | AjaxResult ajax = AjaxResult.success(); | 106 | AjaxResult ajax = AjaxResult.success(); |
| 104 | List<SysRole> roles = roleService.selectRoleAll(); | 107 | List<SysRole> roles = roleService.selectRoleAll(); |
| 105 | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); | 108 | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| @@ -137,7 +140,7 @@ public class SysUserController extends BaseController | @@ -137,7 +140,7 @@ public class SysUserController extends BaseController | ||
| 137 | { | 140 | { |
| 138 | return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); | 141 | return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
| 139 | } | 142 | } |
| 140 | - user.setCreateBy(getUsername()); | 143 | + user.setCreateBy(SecurityUtils.getUsername()); |
| 141 | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); | 144 | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| 142 | return toAjax(userService.insertUser(user)); | 145 | return toAjax(userService.insertUser(user)); |
| 143 | } | 146 | } |
| @@ -152,7 +155,7 @@ public class SysUserController extends BaseController | @@ -152,7 +155,7 @@ public class SysUserController extends BaseController | ||
| 152 | public AjaxResult edit(@Validated @RequestBody SysUser user) | 155 | public AjaxResult edit(@Validated @RequestBody SysUser user) |
| 153 | { | 156 | { |
| 154 | userService.checkUserAllowed(user); | 157 | userService.checkUserAllowed(user); |
| 155 | - userService.checkUserDataScope(user.getUserId()); | 158 | + securityService.checkUserDataScope(user.getUserId()); |
| 156 | if (StringUtils.isNotEmpty(user.getPhonenumber()) | 159 | if (StringUtils.isNotEmpty(user.getPhonenumber()) |
| 157 | && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) | 160 | && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) |
| 158 | { | 161 | { |
| @@ -163,7 +166,7 @@ public class SysUserController extends BaseController | @@ -163,7 +166,7 @@ public class SysUserController extends BaseController | ||
| 163 | { | 166 | { |
| 164 | return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); | 167 | return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
| 165 | } | 168 | } |
| 166 | - user.setUpdateBy(getUsername()); | 169 | + user.setUpdateBy(SecurityUtils.getUsername()); |
| 167 | return toAjax(userService.updateUser(user)); | 170 | return toAjax(userService.updateUser(user)); |
| 168 | } | 171 | } |
| 169 | 172 | ||
| @@ -176,11 +179,11 @@ public class SysUserController extends BaseController | @@ -176,11 +179,11 @@ public class SysUserController extends BaseController | ||
| 176 | @DeleteMapping("/{userIds}") | 179 | @DeleteMapping("/{userIds}") |
| 177 | public AjaxResult remove(@PathVariable Long[] userIds) | 180 | public AjaxResult remove(@PathVariable Long[] userIds) |
| 178 | { | 181 | { |
| 179 | - if (ArrayUtils.contains(userIds, getUserId())) | 182 | + if (ArrayUtils.contains(userIds, SecurityUtils.getUserId())) |
| 180 | { | 183 | { |
| 181 | return error("当前用户不能删除"); | 184 | return error("当前用户不能删除"); |
| 182 | } | 185 | } |
| 183 | - return toAjax(userService.deleteUserByIds(userIds)); | 186 | + return toAjax(securityService.deleteUserByIds(userIds)); |
| 184 | } | 187 | } |
| 185 | 188 | ||
| 186 | /** | 189 | /** |
| @@ -193,9 +196,9 @@ public class SysUserController extends BaseController | @@ -193,9 +196,9 @@ public class SysUserController extends BaseController | ||
| 193 | public AjaxResult resetPwd(@RequestBody SysUser user) | 196 | public AjaxResult resetPwd(@RequestBody SysUser user) |
| 194 | { | 197 | { |
| 195 | userService.checkUserAllowed(user); | 198 | userService.checkUserAllowed(user); |
| 196 | - userService.checkUserDataScope(user.getUserId()); | 199 | + securityService.checkUserDataScope(user.getUserId()); |
| 197 | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); | 200 | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| 198 | - user.setUpdateBy(getUsername()); | 201 | + user.setUpdateBy(SecurityUtils.getUsername()); |
| 199 | return toAjax(userService.resetPwd(user)); | 202 | return toAjax(userService.resetPwd(user)); |
| 200 | } | 203 | } |
| 201 | 204 | ||
| @@ -209,8 +212,8 @@ public class SysUserController extends BaseController | @@ -209,8 +212,8 @@ public class SysUserController extends BaseController | ||
| 209 | public AjaxResult changeStatus(@RequestBody SysUser user) | 212 | public AjaxResult changeStatus(@RequestBody SysUser user) |
| 210 | { | 213 | { |
| 211 | userService.checkUserAllowed(user); | 214 | userService.checkUserAllowed(user); |
| 212 | - userService.checkUserDataScope(user.getUserId()); | ||
| 213 | - user.setUpdateBy(getUsername()); | 215 | + securityService.checkUserDataScope(user.getUserId()); |
| 216 | + user.setUpdateBy(SecurityUtils.getUsername()); | ||
| 214 | return toAjax(userService.updateUserStatus(user)); | 217 | return toAjax(userService.updateUserStatus(user)); |
| 215 | } | 218 | } |
| 216 | 219 | ||
| @@ -239,7 +242,7 @@ public class SysUserController extends BaseController | @@ -239,7 +242,7 @@ public class SysUserController extends BaseController | ||
| 239 | @PutMapping("/authRole") | 242 | @PutMapping("/authRole") |
| 240 | public AjaxResult insertAuthRole(Long userId, Long[] roleIds) | 243 | public AjaxResult insertAuthRole(Long userId, Long[] roleIds) |
| 241 | { | 244 | { |
| 242 | - userService.checkUserDataScope(userId); | 245 | + securityService.checkUserDataScope(userId); |
| 243 | userService.insertUserAuth(userId, roleIds); | 246 | userService.insertUserAuth(userId, roleIds); |
| 244 | return success(); | 247 | return success(); |
| 245 | } | 248 | } |
| @@ -3,6 +3,8 @@ package com.zhonglai.luhui.admin.controller.user; | @@ -3,6 +3,8 @@ package com.zhonglai.luhui.admin.controller.user; | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import javax.servlet.http.HttpServletResponse; | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | 5 | ||
| 6 | +import com.zhonglai.luhui.action.BaseController; | ||
| 7 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 6 | import io.swagger.annotations.Api; | 8 | import io.swagger.annotations.Api; |
| 7 | import io.swagger.annotations.ApiOperation; | 9 | import io.swagger.annotations.ApiOperation; |
| 8 | import org.springframework.security.access.prepost.PreAuthorize; | 10 | import org.springframework.security.access.prepost.PreAuthorize; |
| @@ -16,12 +18,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -16,12 +18,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 16 | import org.springframework.web.bind.annotation.RequestMapping; | 18 | import org.springframework.web.bind.annotation.RequestMapping; |
| 17 | import org.springframework.web.bind.annotation.RestController; | 19 | import org.springframework.web.bind.annotation.RestController; |
| 18 | import com.ruoyi.common.annotation.Log; | 20 | import com.ruoyi.common.annotation.Log; |
| 19 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 20 | import com.ruoyi.common.core.domain.AjaxResult; | 21 | import com.ruoyi.common.core.domain.AjaxResult; |
| 21 | import com.ruoyi.common.enums.BusinessType; | 22 | import com.ruoyi.common.enums.BusinessType; |
| 22 | -import com.ruoyi.system.domain.UserTerminalGroup; | ||
| 23 | -import com.ruoyi.system.service.IUserTerminalGroupService; | ||
| 24 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 23 | +import com.ruoyi.system.domain.user.UserTerminalGroup; |
| 24 | +import com.ruoyi.system.service.user.IUserTerminalGroupService; | ||
| 25 | import com.ruoyi.common.core.page.TableDataInfo; | 25 | import com.ruoyi.common.core.page.TableDataInfo; |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| @@ -3,6 +3,8 @@ package com.zhonglai.luhui.admin.controller.user; | @@ -3,6 +3,8 @@ package com.zhonglai.luhui.admin.controller.user; | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import javax.servlet.http.HttpServletResponse; | 4 | import javax.servlet.http.HttpServletResponse; |
| 5 | 5 | ||
| 6 | +import com.zhonglai.luhui.action.BaseController; | ||
| 7 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 6 | import io.swagger.annotations.Api; | 8 | import io.swagger.annotations.Api; |
| 7 | import io.swagger.annotations.ApiOperation; | 9 | import io.swagger.annotations.ApiOperation; |
| 8 | import org.springframework.security.access.prepost.PreAuthorize; | 10 | import org.springframework.security.access.prepost.PreAuthorize; |
| @@ -16,12 +18,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -16,12 +18,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 16 | import org.springframework.web.bind.annotation.RequestMapping; | 18 | import org.springframework.web.bind.annotation.RequestMapping; |
| 17 | import org.springframework.web.bind.annotation.RestController; | 19 | import org.springframework.web.bind.annotation.RestController; |
| 18 | import com.ruoyi.common.annotation.Log; | 20 | import com.ruoyi.common.annotation.Log; |
| 19 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 20 | import com.ruoyi.common.core.domain.AjaxResult; | 21 | import com.ruoyi.common.core.domain.AjaxResult; |
| 21 | import com.ruoyi.common.enums.BusinessType; | 22 | import com.ruoyi.common.enums.BusinessType; |
| 22 | -import com.ruoyi.system.domain.UserTerminalGroupRelation; | ||
| 23 | -import com.ruoyi.system.service.IUserTerminalGroupRelationService; | ||
| 24 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 23 | +import com.ruoyi.system.domain.user.UserTerminalGroupRelation; |
| 24 | +import com.ruoyi.system.service.user.IUserTerminalGroupRelationService; | ||
| 25 | import com.ruoyi.common.core.page.TableDataInfo; | 25 | import com.ruoyi.common.core.page.TableDataInfo; |
| 26 | 26 | ||
| 27 | /** | 27 | /** |
| 1 | package com.zhonglai.luhui.admin.dto; | 1 | package com.zhonglai.luhui.admin.dto; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.system.domain.IotThingsModel; | 3 | +import com.ruoyi.system.domain.iot.IotThingsModel; |
| 4 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
| 5 | import io.swagger.annotations.ApiModelProperty; | 5 | import io.swagger.annotations.ApiModelProperty; |
| 6 | 6 |
| 1 | package com.zhonglai.luhui.admin.dto; | 1 | package com.zhonglai.luhui.admin.dto; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.system.domain.IotThingsModel; | 3 | +import com.ruoyi.system.domain.iot.IotThingsModel; |
| 4 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
| 5 | import io.swagger.annotations.ApiModelProperty; | 5 | import io.swagger.annotations.ApiModelProperty; |
| 6 | 6 |
| 1 | package com.zhonglai.luhui.admin.dto; | 1 | package com.zhonglai.luhui.admin.dto; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -import com.ruoyi.system.domain.IotThingsModel; | 4 | +import com.ruoyi.system.domain.iot.IotThingsModel; |
| 5 | import io.swagger.annotations.ApiModel; | 5 | import io.swagger.annotations.ApiModel; |
| 6 | import io.swagger.annotations.ApiModelProperty; | 6 | import io.swagger.annotations.ApiModelProperty; |
| 7 | 7 |
| 1 | package com.zhonglai.luhui.admin.service; | 1 | package com.zhonglai.luhui.admin.service; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.DataScope; | 3 | import com.ruoyi.common.annotation.DataScope; |
| 4 | -import com.ruoyi.common.core.domain.BaseLoginUser; | ||
| 5 | -import com.ruoyi.system.domain.tool.BaseEntity; | 4 | +import com.ruoyi.common.tool.BaseEntity; |
| 6 | import com.ruoyi.system.domain.entity.SysRole; | 5 | import com.ruoyi.system.domain.entity.SysRole; |
| 7 | import com.ruoyi.system.domain.entity.SysUser; | 6 | import com.ruoyi.system.domain.entity.SysUser; |
| 8 | -import com.ruoyi.common.utils.SecurityUtils; | ||
| 9 | import com.ruoyi.common.utils.StringUtils; | 7 | import com.ruoyi.common.utils.StringUtils; |
| 8 | +import com.zhonglai.luhui.security.dto.BaseLoginUser; | ||
| 9 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 10 | import org.aspectj.lang.JoinPoint; | 10 | import org.aspectj.lang.JoinPoint; |
| 11 | import org.aspectj.lang.annotation.Aspect; | 11 | import org.aspectj.lang.annotation.Aspect; |
| 12 | import org.aspectj.lang.annotation.Before; | 12 | import org.aspectj.lang.annotation.Before; |
| 1 | package com.zhonglai.luhui.admin.service; | 1 | package com.zhonglai.luhui.admin.service; |
| 2 | 2 | ||
| 3 | import com.ruoyi.system.domain.entity.SysRole; | 3 | import com.ruoyi.system.domain.entity.SysRole; |
| 4 | -import com.ruoyi.system.login.dto.SysLoginUser; | ||
| 5 | -import com.ruoyi.common.utils.SecurityUtils; | ||
| 6 | import com.ruoyi.common.utils.StringUtils; | 4 | import com.ruoyi.common.utils.StringUtils; |
| 5 | +import com.zhonglai.luhui.security.dto.SysLoginUser; | ||
| 6 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 7 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
| 8 | import org.springframework.util.CollectionUtils; | 8 | import org.springframework.util.CollectionUtils; |
| 9 | 9 |
| 1 | package com.zhonglai.luhui.admin.service; | 1 | package com.zhonglai.luhui.admin.service; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.system.login.service.TokenService; | ||
| 4 | -import com.ruoyi.system.service.ISysConfigService; | 3 | +import com.zhonglai.luhui.security.service.TokenService; |
| 4 | +import com.zhonglai.luhui.sys.service.ISysConfigService; | ||
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | import org.springframework.security.authentication.AuthenticationManager; | 6 | import org.springframework.security.authentication.AuthenticationManager; |
| 7 | import org.springframework.stereotype.Component; | 7 | import org.springframework.stereotype.Component; |
| 1 | package com.zhonglai.luhui.admin.service; | 1 | package com.zhonglai.luhui.admin.service; |
| 2 | 2 | ||
| 3 | import com.ruoyi.system.domain.entity.SysUser; | 3 | import com.ruoyi.system.domain.entity.SysUser; |
| 4 | -import com.ruoyi.system.service.ISysMenuService; | ||
| 5 | -import com.ruoyi.system.service.ISysRoleService; | 4 | +import com.zhonglai.luhui.sys.service.ISysMenuService; |
| 5 | +import com.zhonglai.luhui.sys.service.ISysRoleService; | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Component; | 7 | import org.springframework.stereotype.Component; |
| 8 | 8 |
| @@ -3,18 +3,18 @@ package com.zhonglai.luhui.admin.service; | @@ -3,18 +3,18 @@ package com.zhonglai.luhui.admin.service; | ||
| 3 | import com.ruoyi.common.constant.Constants; | 3 | import com.ruoyi.common.constant.Constants; |
| 4 | import com.ruoyi.system.domain.entity.UserConstants; | 4 | import com.ruoyi.system.domain.entity.UserConstants; |
| 5 | import com.ruoyi.system.domain.entity.SysUser; | 5 | import com.ruoyi.system.domain.entity.SysUser; |
| 6 | -import com.ruoyi.system.domain.tool.SysLogininforType; | 6 | +import com.ruoyi.common.tool.SysLogininforType; |
| 7 | import com.zhonglai.luhui.admin.model.RegisterBody; | 7 | import com.zhonglai.luhui.admin.model.RegisterBody; |
| 8 | -import com.ruoyi.common.core.redis.RedisCache; | ||
| 9 | import com.ruoyi.common.exception.user.CaptchaException; | 8 | import com.ruoyi.common.exception.user.CaptchaException; |
| 10 | import com.ruoyi.common.exception.user.CaptchaExpireException; | 9 | import com.ruoyi.common.exception.user.CaptchaExpireException; |
| 11 | import com.ruoyi.common.utils.MessageUtils; | 10 | import com.ruoyi.common.utils.MessageUtils; |
| 12 | -import com.ruoyi.common.utils.SecurityUtils; | ||
| 13 | import com.ruoyi.common.utils.StringUtils; | 11 | import com.ruoyi.common.utils.StringUtils; |
| 14 | -import com.ruoyi.system.login.manager.AsyncManager; | ||
| 15 | -import com.ruoyi.system.login.manager.factory.AsyncFactory; | ||
| 16 | -import com.ruoyi.system.service.ISysConfigService; | ||
| 17 | -import com.ruoyi.system.service.ISysUserService; | 12 | +import com.zhonglai.luhui.redis.service.RedisCache; |
| 13 | +import com.zhonglai.luhui.security.manager.AsyncManager; | ||
| 14 | +import com.zhonglai.luhui.security.manager.factory.AsyncFactory; | ||
| 15 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 16 | +import com.zhonglai.luhui.sys.service.ISysConfigService; | ||
| 17 | +import com.zhonglai.luhui.sys.service.ISysUserService; | ||
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | import org.springframework.stereotype.Component; | 19 | import org.springframework.stereotype.Component; |
| 20 | 20 |
| 1 | package com.zhonglai.luhui.admin.service; | 1 | package com.zhonglai.luhui.admin.service; |
| 2 | 2 | ||
| 3 | import com.ruoyi.system.domain.entity.SysUser; | 3 | import com.ruoyi.system.domain.entity.SysUser; |
| 4 | -import com.ruoyi.system.login.dto.SysLoginUser; | ||
| 5 | import com.ruoyi.common.enums.UserStatus; | 4 | import com.ruoyi.common.enums.UserStatus; |
| 6 | import com.ruoyi.common.exception.ServiceException; | 5 | import com.ruoyi.common.exception.ServiceException; |
| 7 | import com.ruoyi.common.utils.StringUtils; | 6 | import com.ruoyi.common.utils.StringUtils; |
| 8 | -import com.ruoyi.system.service.ISysUserService; | 7 | +import com.zhonglai.luhui.security.dto.SysLoginUser; |
| 8 | +import com.zhonglai.luhui.sys.service.ISysUserService; | ||
| 9 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
| 10 | import org.slf4j.LoggerFactory; | 10 | import org.slf4j.LoggerFactory; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 1 | package com.zhonglai.luhui.admin.service; | 1 | package com.zhonglai.luhui.admin.service; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.common.core.domain.BaseLoginUser; | ||
| 4 | -import com.ruoyi.framework.web.service.ISysUserOnlineService; | ||
| 5 | -import com.ruoyi.system.login.dto.SysLoginUser; | 3 | +import com.zhonglai.luhui.security.service.ISysUserOnlineService; |
| 6 | import com.ruoyi.common.utils.StringUtils; | 4 | import com.ruoyi.common.utils.StringUtils; |
| 7 | -import com.ruoyi.system.domain.SysUserOnline; | 5 | +import com.ruoyi.system.domain.sys.SysUserOnline; |
| 6 | +import com.zhonglai.luhui.security.dto.BaseLoginUser; | ||
| 7 | +import com.zhonglai.luhui.security.dto.SysLoginUser; | ||
| 8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 1 | package com.zhonglai.luhui.admin.task; | 1 | package com.zhonglai.luhui.admin.task; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.utils.DateUtils; | 3 | import com.ruoyi.common.utils.DateUtils; |
| 4 | -import com.ruoyi.system.domain.IotDevice; | ||
| 5 | -import com.ruoyi.system.service.PublicService; | 4 | +import com.zhonglai.luhui.dao.service.PublicService; |
| 6 | import org.slf4j.Logger; | 5 | import org.slf4j.Logger; |
| 7 | import org.slf4j.LoggerFactory; | 6 | import org.slf4j.LoggerFactory; |
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 1 | -# 项目相关配置 jhlt: # 名称 name: zhonglai # 版本 version: 3.8.2 # 版权年份 copyrightYear: 2022 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: D:/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数组计算 char 字符验证 captchaType: math # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 8080 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.ruoyi: debug org.springframework: warn # Spring配置 spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: druid # 文件上传 servlet: multipart: # 单个文件大小 max-file-size: 10MB # 设置总上传的文件大小 max-request-size: 20MB # 服务模块 devtools: restart: # 热部署开关 enabled: true # redis 配置 redis: # 地址 host: 47.112.163.61 # 端口,默认为6379 port: 9527 # 数据库索引 database: 1 # 密码 password: Luhui586 # 连接超时时间 timeout: 10s lettuce: pool: # 连接池中的最小空闲连接 min-idle: 0 # 连接池中的最大空闲连接 max-idle: 8 # 连接池的最大数据库连接数 max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # token配置 token: # 令牌自定义标识 header: Authorization # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) expireTime: 1440 rediskey: lh-admin # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 pagehelper: helperDialect: mysql supportMethodsArguments: true params: count=countSql # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /dev-api # 防止XSS攻击 xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* mqtt: client: device_life: 180 sys: ## // 对于登录login 注册register 验证码captchaImage 允许匿名访问 antMatchers: /login,/register,/captchaImage,/getCacheObject,/v2/api-docs,/tool/gen/generatorCodeFromDb # NameServer地址 rocketmq: name-server: 47.115.144.179:9876 # 默认的消息组 producer: group: deviceCommand send-message-timeout: 30000 send-topic: lh-mqtt-service-deviceCommand-test send-tags: 1 | ||
| 1 | +# 项目相关配置 jhlt: # 名称 name: zhonglai # 版本 version: 3.8.2 # 版权年份 copyrightYear: 2022 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: D:/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数组计算 char 字符验证 captchaType: math # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 8080 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.ruoyi: debug org.springframework: warn # Spring配置 spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: druid # 文件上传 servlet: multipart: # 单个文件大小 max-file-size: 10MB # 设置总上传的文件大小 max-request-size: 20MB # 服务模块 devtools: restart: # 热部署开关 enabled: true # redis 配置 redis: # 地址 host: 47.112.163.61 # 端口,默认为6379 port: 9527 # 数据库索引 database: 1 # 密码 password: Luhui586 # 连接超时时间 timeout: 10s lettuce: pool: # 连接池中的最小空闲连接 min-idle: 0 # 连接池中的最大空闲连接 max-idle: 8 # 连接池的最大数据库连接数 max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # token配置 token: # 令牌自定义标识 header: Authorization # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) expireTime: 1440 rediskey: lh-admin # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain, # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 pagehelper: helperDialect: mysql supportMethodsArguments: true params: count=countSql # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /dev-api # 防止XSS攻击 xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* mqtt: client: device_life: 180 sys: ## // 对于登录login 注册register 验证码captchaImage 允许匿名访问 antMatchers: /login,/register,/captchaImage,/getCacheObject,/v2/api-docs,/tool/gen/generatorCodeFromDb # NameServer地址 rocketmq: name-server: 47.115.144.179:9876 # 默认的消息组 producer: group: deviceCommand send-message-timeout: 30000 send-topic: lh-mqtt-service-deviceCommand-test send-tags: 1 |
lh-afms/pom.xml
已删除
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| 3 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 4 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| 5 | - <modelVersion>4.0.0</modelVersion> | ||
| 6 | - <parent> | ||
| 7 | - <groupId>com.zhonglai.luhui</groupId> | ||
| 8 | - <artifactId>Luhui</artifactId> | ||
| 9 | - <version>1.0-SNAPSHOT</version> | ||
| 10 | - </parent> | ||
| 11 | - | ||
| 12 | - <artifactId>lh-afms</artifactId> | ||
| 13 | - | ||
| 14 | - <properties> | ||
| 15 | - <maven.compiler.source>8</maven.compiler.source> | ||
| 16 | - <maven.compiler.target>8</maven.compiler.target> | ||
| 17 | - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| 18 | - </properties> | ||
| 19 | - | ||
| 20 | - <dependencies> | ||
| 21 | - <!-- spring-boot-devtools --> | ||
| 22 | - <dependency> | ||
| 23 | - <groupId>org.springframework.boot</groupId> | ||
| 24 | - <artifactId>spring-boot-devtools</artifactId> | ||
| 25 | - <optional>true</optional> <!-- 表示依赖不会传递 --> | ||
| 26 | - </dependency> | ||
| 27 | - | ||
| 28 | - <!-- Mysql驱动包 --> | ||
| 29 | - <dependency> | ||
| 30 | - <groupId>mysql</groupId> | ||
| 31 | - <artifactId>mysql-connector-java</artifactId> | ||
| 32 | - </dependency> | ||
| 33 | - | ||
| 34 | - <!-- 核心模块--> | ||
| 35 | - <dependency> | ||
| 36 | - <groupId>com.zhonglai.luhui</groupId> | ||
| 37 | - <artifactId>ruoyi-framework</artifactId> | ||
| 38 | - </dependency> | ||
| 39 | - <!-- 文档 --> | ||
| 40 | - <dependency > | ||
| 41 | - <groupId>io.springfox</groupId> | ||
| 42 | - <artifactId>springfox-swagger2</artifactId> | ||
| 43 | - <version>${swagger.version}</version> | ||
| 44 | - <exclusions> | ||
| 45 | - <exclusion> | ||
| 46 | - <groupId>io.swagger</groupId> | ||
| 47 | - <artifactId>swagger-models</artifactId> | ||
| 48 | - </exclusion> | ||
| 49 | - <exclusion> | ||
| 50 | - <groupId>com.google.guava</groupId> | ||
| 51 | - <artifactId>guava</artifactId> | ||
| 52 | - </exclusion> | ||
| 53 | - </exclusions> | ||
| 54 | - </dependency> | ||
| 55 | - <!--https://mvnrepository.com/artifact/io.swagger/swagger-models--> | ||
| 56 | - <dependency> | ||
| 57 | - <groupId>io.swagger</groupId> | ||
| 58 | - <artifactId>swagger-models</artifactId> | ||
| 59 | - <version>${swagger-models.version}</version> | ||
| 60 | - </dependency> | ||
| 61 | - <dependency> | ||
| 62 | - <groupId>io.springfox</groupId> | ||
| 63 | - <artifactId>springfox-swagger-ui</artifactId> | ||
| 64 | - <version>${swagger.version}</version> | ||
| 65 | - </dependency> | ||
| 66 | - <!--<!– https://mvnrepository.com/artifact/com.github.xiaoymin/swagger-bootstrap-ui –>--> | ||
| 67 | - <dependency> | ||
| 68 | - <groupId>com.github.xiaoymin</groupId> | ||
| 69 | - <artifactId>swagger-bootstrap-ui</artifactId> | ||
| 70 | - <version>${swagger-ui.version}</version> | ||
| 71 | - </dependency> | ||
| 72 | - | ||
| 73 | - <dependency> | ||
| 74 | - <groupId>com.theokanning.openai-gpt3-java</groupId> | ||
| 75 | - <artifactId>service</artifactId> | ||
| 76 | - <version>0.10.0</version> | ||
| 77 | - <exclusions> | ||
| 78 | - <exclusion> | ||
| 79 | - <groupId>com.squareup.okhttp3</groupId> | ||
| 80 | - <artifactId>okhttp</artifactId> | ||
| 81 | - </exclusion> | ||
| 82 | - </exclusions> | ||
| 83 | - </dependency> | ||
| 84 | - <dependency> | ||
| 85 | - <groupId>com.squareup.okhttp3</groupId> | ||
| 86 | - <artifactId>okhttp</artifactId> | ||
| 87 | - <version>4.10.0</version> | ||
| 88 | - </dependency> | ||
| 89 | - | ||
| 90 | - <dependency> | ||
| 91 | - <groupId>com.zhonglai.luhui</groupId> | ||
| 92 | - <artifactId>ruoyi-system</artifactId> | ||
| 93 | - </dependency> | ||
| 94 | - | ||
| 95 | - <dependency> | ||
| 96 | - <groupId>cn.hutool</groupId> | ||
| 97 | - <artifactId>hutool-all</artifactId> | ||
| 98 | - </dependency> | ||
| 99 | - </dependencies> | ||
| 100 | -</project> |
| 1 | -# 项目相关配置 jhlt: # 名称 name: zhonglai # 版本 version: 3.8.2 # 版权年份 copyrightYear: 2022 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: D:/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数组计算 char 字符验证 captchaType: math # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 18081 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.ruoyi: debug org.springframework: warn # Spring配置 spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: druid # 文件上传 servlet: multipart: # 单个文件大小 max-file-size: 10MB # 设置总上传的文件大小 max-request-size: 20MB # 服务模块 devtools: restart: # 热部署开关 enabled: true # redis 配置 redis: # 地址 host: 47.112.163.61 # 端口,默认为6379 port: 9527 # 数据库索引 database: 1 # 密码 password: Luhui586 # 连接超时时间 timeout: 10s lettuce: pool: # 连接池中的最小空闲连接 min-idle: 0 # 连接池中的最大空闲连接 max-idle: 8 # 连接池的最大数据库连接数 max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # token配置 token: # 令牌自定义标识 header: Authorization # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) expireTime: 1440 rediskey: lh-afms # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 pagehelper: helperDialect: mysql supportMethodsArguments: true params: count=countSql # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /dev-api # 防止XSS攻击 xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* mqtt: client: device_life: 180 sys: ## // 对于登录login 注册register 验证码captchaImage 允许匿名访问 antMatchers: /login/ApiLogin/* # NameServer地址 rocketmq: name-server: 47.115.144.179:9876 # 默认的消息组 producer: group: deviceCommand send-message-timeout: 30000 send-topic: lh-api-test send-tags: 1 |
| 1 | package com.zhonglai.luhui.alarm; | 1 | package com.zhonglai.luhui.alarm; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.framework.aspectj.LogAspect; | ||
| 4 | -import com.ruoyi.framework.aspectj.RateLimiterAspect; | ||
| 5 | -import com.ruoyi.framework.config.*; | ||
| 6 | -import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; | ||
| 7 | -import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl; | ||
| 8 | -import com.ruoyi.system.login.service.LoginService; | ||
| 9 | -import com.ruoyi.system.login.service.TokenService; | ||
| 10 | -import com.ruoyi.system.service.impl.SysConfigServiceImpl; | ||
| 11 | -import com.ruoyi.system.service.impl.SysDictTypeServiceImpl; | ||
| 12 | -import com.ruoyi.system.service.impl.SysUserServiceImpl; | ||
| 13 | import org.springframework.boot.SpringApplication; | 3 | import org.springframework.boot.SpringApplication; |
| 14 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 15 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; | 5 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| @@ -20,11 +10,11 @@ import org.springframework.context.annotation.FilterType; | @@ -20,11 +10,11 @@ import org.springframework.context.annotation.FilterType; | ||
| 20 | "com.ruoyi.common", | 10 | "com.ruoyi.common", |
| 21 | "com.ruoyi.system", | 11 | "com.ruoyi.system", |
| 22 | "com.ruoyi.framework", | 12 | "com.ruoyi.framework", |
| 23 | -}, | ||
| 24 | - excludeFilters = {@ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE,classes = {LogAspect.class, | ||
| 25 | - RateLimiterAspect.class, LoginService.class, TokenService.class, FilterConfig.class, JwtAuthenticationTokenFilter.class, | ||
| 26 | - SysConfigServiceImpl.class, SysDictTypeServiceImpl.class, SysUserServiceImpl.class,SecurityConfig.class, LogoutSuccessHandlerImpl.class | ||
| 27 | - })} | 13 | +} |
| 14 | +// excludeFilters = {@ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE,classes = {LogAspect.class, | ||
| 15 | +// RateLimiterAspect.class, LoginService.class, TokenService.class, FilterConfig.class, JwtAuthenticationTokenFilter.class, | ||
| 16 | +// SysConfigServiceImpl.class, SysDictTypeServiceImpl.class, SysUserServiceImpl.class,SecurityConfig.class, LogoutSuccessHandlerImpl.class | ||
| 17 | +// })} | ||
| 28 | 18 | ||
| 29 | ) | 19 | ) |
| 30 | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) | 20 | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) |
| @@ -85,6 +85,18 @@ | @@ -85,6 +85,18 @@ | ||
| 85 | <groupId>org.aspectj</groupId> | 85 | <groupId>org.aspectj</groupId> |
| 86 | <artifactId>aspectjrt</artifactId> | 86 | <artifactId>aspectjrt</artifactId> |
| 87 | </dependency> | 87 | </dependency> |
| 88 | + <dependency> | ||
| 89 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 90 | + <artifactId>ruoyi-common-security</artifactId> | ||
| 91 | + </dependency> | ||
| 92 | + <dependency> | ||
| 93 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 94 | + <artifactId>lh-jar-action</artifactId> | ||
| 95 | + </dependency> | ||
| 96 | + <dependency> | ||
| 97 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 98 | + <artifactId>lh-jar-sys-service</artifactId> | ||
| 99 | + </dependency> | ||
| 88 | </dependencies> | 100 | </dependencies> |
| 89 | 101 | ||
| 90 | <build> | 102 | <build> |
| 1 | package com.zhonglai.luhui.api.controller.iot; | 1 | package com.zhonglai.luhui.api.controller.iot; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.annotation.Log; | 3 | import com.ruoyi.common.annotation.Log; |
| 4 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 5 | import com.ruoyi.common.core.domain.AjaxResult; | 4 | import com.ruoyi.common.core.domain.AjaxResult; |
| 6 | import com.ruoyi.common.core.page.TableDataInfo; | 5 | import com.ruoyi.common.core.page.TableDataInfo; |
| 7 | import com.ruoyi.common.enums.BusinessType; | 6 | import com.ruoyi.common.enums.BusinessType; |
| 8 | import com.ruoyi.common.utils.DateUtils; | 7 | import com.ruoyi.common.utils.DateUtils; |
| 9 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 10 | -import com.ruoyi.system.domain.IotTerminal; | ||
| 11 | -import com.ruoyi.system.domain.UserTerminalGroupRelation; | ||
| 12 | -import com.ruoyi.system.service.IIotTerminalService; | ||
| 13 | -import com.ruoyi.system.service.IUserTerminalGroupRelationService; | 8 | +import com.ruoyi.system.domain.iot.IotTerminal; |
| 9 | +import com.ruoyi.system.domain.user.UserTerminalGroupRelation; | ||
| 10 | +import com.ruoyi.system.service.iot.IIotTerminalService; | ||
| 11 | +import com.ruoyi.system.service.user.IUserTerminalGroupRelationService; | ||
| 12 | +import com.zhonglai.luhui.action.BaseController; | ||
| 13 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 14 | import io.swagger.annotations.Api; | 14 | import io.swagger.annotations.Api; |
| 15 | import io.swagger.annotations.ApiImplicitParam; | 15 | import io.swagger.annotations.ApiImplicitParam; |
| 16 | import io.swagger.annotations.ApiImplicitParams; | 16 | import io.swagger.annotations.ApiImplicitParams; |
| 17 | import io.swagger.annotations.ApiOperation; | 17 | import io.swagger.annotations.ApiOperation; |
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | -import org.springframework.security.access.prepost.PreAuthorize; | ||
| 20 | import org.springframework.web.bind.annotation.*; | 19 | import org.springframework.web.bind.annotation.*; |
| 21 | -import org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor; | ||
| 22 | 20 | ||
| 23 | -import javax.servlet.http.HttpServletResponse; | ||
| 24 | import java.util.List; | 21 | import java.util.List; |
| 25 | 22 | ||
| 26 | /** | 23 | /** |
| @@ -45,7 +42,7 @@ public class IotTerminalController extends BaseController | @@ -45,7 +42,7 @@ public class IotTerminalController extends BaseController | ||
| 45 | { | 42 | { |
| 46 | startPage(); | 43 | startPage(); |
| 47 | UserTerminalGroupRelation userTerminalGroupRelation = new UserTerminalGroupRelation(); | 44 | UserTerminalGroupRelation userTerminalGroupRelation = new UserTerminalGroupRelation(); |
| 48 | - userTerminalGroupRelation.setUser_info_id(getUserId().intValue()); | 45 | + userTerminalGroupRelation.setUser_info_id(SecurityUtils.getUserId().intValue()); |
| 49 | iotTerminal.setUserTerminalGroupRelation(userTerminalGroupRelation); | 46 | iotTerminal.setUserTerminalGroupRelation(userTerminalGroupRelation); |
| 50 | List<IotTerminal> list = iotTerminalService.selectIotTerminalListByUserId(iotTerminal); | 47 | List<IotTerminal> list = iotTerminalService.selectIotTerminalListByUserId(iotTerminal); |
| 51 | return getDataTable(list); | 48 | return getDataTable(list); |
| @@ -93,7 +90,7 @@ public class IotTerminalController extends BaseController | @@ -93,7 +90,7 @@ public class IotTerminalController extends BaseController | ||
| 93 | @PostMapping("/groupTerminal") | 90 | @PostMapping("/groupTerminal") |
| 94 | public AjaxResult groupTerminal(Integer iot_terminal_group_id,@RequestBody List<String> ids) | 91 | public AjaxResult groupTerminal(Integer iot_terminal_group_id,@RequestBody List<String> ids) |
| 95 | { | 92 | { |
| 96 | - Integer userid= getUserId().intValue(); | 93 | + Integer userid= SecurityUtils.getUserId().intValue(); |
| 97 | 94 | ||
| 98 | List<UserTerminalGroupRelation> list = userTerminalGroupRelationService.selectListByTerminalIds(ids.toArray(new String[ids.size()])); | 95 | List<UserTerminalGroupRelation> list = userTerminalGroupRelationService.selectListByTerminalIds(ids.toArray(new String[ids.size()])); |
| 99 | if( null != list && list.size() != 0) //判断是否有权限删除 | 96 | if( null != list && list.size() != 0) //判断是否有权限删除 |
| 1 | package com.zhonglai.luhui.api.controller.login; | 1 | package com.zhonglai.luhui.api.controller.login; |
| 2 | 2 | ||
| 3 | import com.ruoyi.common.constant.Constants; | 3 | import com.ruoyi.common.constant.Constants; |
| 4 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 5 | import com.ruoyi.common.core.domain.AjaxResult; | 4 | import com.ruoyi.common.core.domain.AjaxResult; |
| 6 | import com.ruoyi.common.utils.StringUtils; | 5 | import com.ruoyi.common.utils.StringUtils; |
| 7 | -import com.ruoyi.system.login.service.LoginService; | 6 | +import com.zhonglai.luhui.action.BaseController; |
| 7 | +import com.zhonglai.luhui.security.service.LoginService; | ||
| 8 | import io.swagger.annotations.Api; | 8 | import io.swagger.annotations.Api; |
| 9 | import io.swagger.annotations.ApiImplicitParam; | 9 | import io.swagger.annotations.ApiImplicitParam; |
| 10 | import io.swagger.annotations.ApiImplicitParams; | 10 | import io.swagger.annotations.ApiImplicitParams; |
| @@ -15,8 +15,6 @@ import org.springframework.web.bind.annotation.RequestHeader; | @@ -15,8 +15,6 @@ import org.springframework.web.bind.annotation.RequestHeader; | ||
| 15 | import org.springframework.web.bind.annotation.RequestMapping; | 15 | import org.springframework.web.bind.annotation.RequestMapping; |
| 16 | import org.springframework.web.bind.annotation.RestController; | 16 | import org.springframework.web.bind.annotation.RestController; |
| 17 | 17 | ||
| 18 | -import javax.servlet.http.HttpServletRequest; | ||
| 19 | - | ||
| 20 | @Api(tags = "登陆") | 18 | @Api(tags = "登陆") |
| 21 | @RestController | 19 | @RestController |
| 22 | @RequestMapping("/login/ApiLogin") | 20 | @RequestMapping("/login/ApiLogin") |
| 1 | package com.zhonglai.luhui.api.controller.user; | 1 | package com.zhonglai.luhui.api.controller.user; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | -import javax.servlet.http.HttpServletResponse; | ||
| 5 | 4 | ||
| 6 | import com.ruoyi.common.utils.DateUtils; | 5 | import com.ruoyi.common.utils.DateUtils; |
| 6 | +import com.zhonglai.luhui.action.BaseController; | ||
| 7 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 7 | import io.swagger.annotations.Api; | 8 | import io.swagger.annotations.Api; |
| 8 | import io.swagger.annotations.ApiImplicitParam; | 9 | import io.swagger.annotations.ApiImplicitParam; |
| 9 | import io.swagger.annotations.ApiImplicitParams; | 10 | import io.swagger.annotations.ApiImplicitParams; |
| 10 | import io.swagger.annotations.ApiOperation; | 11 | import io.swagger.annotations.ApiOperation; |
| 11 | -import org.springframework.security.access.prepost.PreAuthorize; | ||
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.web.bind.annotation.GetMapping; | 13 | import org.springframework.web.bind.annotation.GetMapping; |
| 14 | import org.springframework.web.bind.annotation.PostMapping; | 14 | import org.springframework.web.bind.annotation.PostMapping; |
| @@ -19,12 +19,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -19,12 +19,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 19 | import org.springframework.web.bind.annotation.RequestMapping; | 19 | import org.springframework.web.bind.annotation.RequestMapping; |
| 20 | import org.springframework.web.bind.annotation.RestController; | 20 | import org.springframework.web.bind.annotation.RestController; |
| 21 | import com.ruoyi.common.annotation.Log; | 21 | import com.ruoyi.common.annotation.Log; |
| 22 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 23 | import com.ruoyi.common.core.domain.AjaxResult; | 22 | import com.ruoyi.common.core.domain.AjaxResult; |
| 24 | import com.ruoyi.common.enums.BusinessType; | 23 | import com.ruoyi.common.enums.BusinessType; |
| 25 | -import com.ruoyi.system.domain.UserTerminalGroup; | ||
| 26 | -import com.ruoyi.system.service.IUserTerminalGroupService; | ||
| 27 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 24 | +import com.ruoyi.system.domain.user.UserTerminalGroup; |
| 25 | +import com.ruoyi.system.service.user.IUserTerminalGroupService; | ||
| 28 | import com.ruoyi.common.core.page.TableDataInfo; | 26 | import com.ruoyi.common.core.page.TableDataInfo; |
| 29 | 27 | ||
| 30 | /** | 28 | /** |
| @@ -48,7 +46,7 @@ public class UserTerminalGroupController extends BaseController | @@ -48,7 +46,7 @@ public class UserTerminalGroupController extends BaseController | ||
| 48 | @GetMapping("/list") | 46 | @GetMapping("/list") |
| 49 | public TableDataInfo list(UserTerminalGroup userTerminalGroup) | 47 | public TableDataInfo list(UserTerminalGroup userTerminalGroup) |
| 50 | { | 48 | { |
| 51 | - userTerminalGroup.setUser_info_id(getUserId().intValue()); | 49 | + userTerminalGroup.setUser_info_id(SecurityUtils.getUserId().intValue()); |
| 52 | startPage(); | 50 | startPage(); |
| 53 | List<UserTerminalGroup> list = userTerminalGroupService.selectUserTerminalGroupList(userTerminalGroup); | 51 | List<UserTerminalGroup> list = userTerminalGroupService.selectUserTerminalGroupList(userTerminalGroup); |
| 54 | return getDataTable(list); | 52 | return getDataTable(list); |
| @@ -73,7 +71,7 @@ public class UserTerminalGroupController extends BaseController | @@ -73,7 +71,7 @@ public class UserTerminalGroupController extends BaseController | ||
| 73 | @PostMapping | 71 | @PostMapping |
| 74 | public AjaxResult add(@RequestBody UserTerminalGroup userTerminalGroup) | 72 | public AjaxResult add(@RequestBody UserTerminalGroup userTerminalGroup) |
| 75 | { | 73 | { |
| 76 | - userTerminalGroup.setUser_info_id(getUserId().intValue()); | 74 | + userTerminalGroup.setUser_info_id(SecurityUtils.getUserId().intValue()); |
| 77 | userTerminalGroup.setCreate_time(DateUtils.getNowTimeMilly()); | 75 | userTerminalGroup.setCreate_time(DateUtils.getNowTimeMilly()); |
| 78 | return toAjax(userTerminalGroupService.insertUserTerminalGroup(userTerminalGroup)); | 76 | return toAjax(userTerminalGroupService.insertUserTerminalGroup(userTerminalGroup)); |
| 79 | } | 77 | } |
lh-api/src/main/java/com/zhonglai/luhui/api/controller/user/UserTerminalGroupRelationController.java
| @@ -5,14 +5,14 @@ import java.util.List; | @@ -5,14 +5,14 @@ import java.util.List; | ||
| 5 | import java.util.Map; | 5 | import java.util.Map; |
| 6 | import javax.servlet.http.HttpServletResponse; | 6 | import javax.servlet.http.HttpServletResponse; |
| 7 | 7 | ||
| 8 | -import com.alibaba.fastjson.JSON; | ||
| 9 | -import com.alibaba.fastjson.JSONObject; | ||
| 10 | import com.ruoyi.common.utils.StringUtils; | 8 | import com.ruoyi.common.utils.StringUtils; |
| 11 | import com.ruoyi.common.utils.bean.BeanUtils; | 9 | import com.ruoyi.common.utils.bean.BeanUtils; |
| 12 | -import com.ruoyi.system.service.PublicService; | 10 | +import com.zhonglai.luhui.action.BaseController; |
| 11 | +import com.zhonglai.luhui.dao.service.PublicService; | ||
| 12 | +import com.zhonglai.luhui.security.utils.SecurityUtils; | ||
| 13 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 13 | import io.swagger.annotations.Api; | 14 | import io.swagger.annotations.Api; |
| 14 | import io.swagger.annotations.ApiOperation; | 15 | import io.swagger.annotations.ApiOperation; |
| 15 | -import org.springframework.security.access.prepost.PreAuthorize; | ||
| 16 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | import org.springframework.web.bind.annotation.GetMapping; | 17 | import org.springframework.web.bind.annotation.GetMapping; |
| 18 | import org.springframework.web.bind.annotation.PostMapping; | 18 | import org.springframework.web.bind.annotation.PostMapping; |
| @@ -23,12 +23,10 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -23,12 +23,10 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 23 | import org.springframework.web.bind.annotation.RequestMapping; | 23 | import org.springframework.web.bind.annotation.RequestMapping; |
| 24 | import org.springframework.web.bind.annotation.RestController; | 24 | import org.springframework.web.bind.annotation.RestController; |
| 25 | import com.ruoyi.common.annotation.Log; | 25 | import com.ruoyi.common.annotation.Log; |
| 26 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 27 | import com.ruoyi.common.core.domain.AjaxResult; | 26 | import com.ruoyi.common.core.domain.AjaxResult; |
| 28 | import com.ruoyi.common.enums.BusinessType; | 27 | import com.ruoyi.common.enums.BusinessType; |
| 29 | -import com.ruoyi.system.domain.UserTerminalGroupRelation; | ||
| 30 | -import com.ruoyi.system.service.IUserTerminalGroupRelationService; | ||
| 31 | -import com.ruoyi.common.utils.poi.ExcelUtil; | 28 | +import com.ruoyi.system.domain.user.UserTerminalGroupRelation; |
| 29 | +import com.ruoyi.system.service.user.IUserTerminalGroupRelationService; | ||
| 32 | import com.ruoyi.common.core.page.TableDataInfo; | 30 | import com.ruoyi.common.core.page.TableDataInfo; |
| 33 | 31 | ||
| 34 | /** | 32 | /** |
| @@ -54,7 +52,7 @@ public class UserTerminalGroupRelationController extends BaseController | @@ -54,7 +52,7 @@ public class UserTerminalGroupRelationController extends BaseController | ||
| 54 | @GetMapping("/list") | 52 | @GetMapping("/list") |
| 55 | public TableDataInfo list(UserTerminalGroupRelation userTerminalGroupRelation) | 53 | public TableDataInfo list(UserTerminalGroupRelation userTerminalGroupRelation) |
| 56 | { | 54 | { |
| 57 | - userTerminalGroupRelation.setUser_info_id(getUserId().intValue()); | 55 | + userTerminalGroupRelation.setUser_info_id(SecurityUtils.getUserId().intValue()); |
| 58 | startPage(); | 56 | startPage(); |
| 59 | List<UserTerminalGroupRelation> list = userTerminalGroupRelationService.selectUserTerminalGroupRelationList(userTerminalGroupRelation); | 57 | List<UserTerminalGroupRelation> list = userTerminalGroupRelationService.selectUserTerminalGroupRelationList(userTerminalGroupRelation); |
| 60 | return getDataTable(list); | 58 | return getDataTable(list); |
| @@ -64,7 +62,7 @@ public class UserTerminalGroupRelationController extends BaseController | @@ -64,7 +62,7 @@ public class UserTerminalGroupRelationController extends BaseController | ||
| 64 | @GetMapping("/unGrouplist/{product_id}") | 62 | @GetMapping("/unGrouplist/{product_id}") |
| 65 | public AjaxResult unGrouplist(@PathVariable Integer product_id) | 63 | public AjaxResult unGrouplist(@PathVariable Integer product_id) |
| 66 | { | 64 | { |
| 67 | - List<Map<String,Object>> list = publicService.getObjectListBySQL("SELECT a.*,b.`name` FROM `user_terminal_group_relation` a LEFT JOIN `iot_terminal` b ON a.`iot_terminal_id`=b.`id` WHERE a.user_info_id="+getUserId().intValue()+" AND a.iot_terminal_group_id IS NULL AND b.`product_id`="+product_id); | 65 | + List<Map<String,Object>> list = publicService.getObjectListBySQL("SELECT a.*,b.`name` FROM `user_terminal_group_relation` a LEFT JOIN `iot_terminal` b ON a.`iot_terminal_id`=b.`id` WHERE a.user_info_id="+SecurityUtils.getUserId().intValue()+" AND a.iot_terminal_group_id IS NULL AND b.`product_id`="+product_id); |
| 68 | return AjaxResult.success(list); | 66 | return AjaxResult.success(list); |
| 69 | } | 67 | } |
| 70 | 68 | ||
| @@ -81,7 +79,7 @@ public class UserTerminalGroupRelationController extends BaseController | @@ -81,7 +79,7 @@ public class UserTerminalGroupRelationController extends BaseController | ||
| 81 | { | 79 | { |
| 82 | stringBuffer.append(" AND b.product_id="+product_id); | 80 | stringBuffer.append(" AND b.product_id="+product_id); |
| 83 | } | 81 | } |
| 84 | - List<Map<String,Object>> list = publicService.getObjectListBySQL("SELECT b.* FROM `user_terminal_group_relation` a LEFT JOIN `iot_terminal` b ON a.`iot_terminal_id`=b.`id` WHERE a.user_info_id="+getUserId().intValue()+stringBuffer); | 82 | + List<Map<String,Object>> list = publicService.getObjectListBySQL("SELECT b.* FROM `user_terminal_group_relation` a LEFT JOIN `iot_terminal` b ON a.`iot_terminal_id`=b.`id` WHERE a.user_info_id="+SecurityUtils.getUserId().intValue()+stringBuffer); |
| 85 | return AjaxResult.success(list); | 83 | return AjaxResult.success(list); |
| 86 | } | 84 | } |
| 87 | 85 | ||
| @@ -123,7 +121,7 @@ public class UserTerminalGroupRelationController extends BaseController | @@ -123,7 +121,7 @@ public class UserTerminalGroupRelationController extends BaseController | ||
| 123 | } | 121 | } |
| 124 | List<UserTerminalGroupRelation> list = new ArrayList<>(); | 122 | List<UserTerminalGroupRelation> list = new ArrayList<>(); |
| 125 | String[] is = iotTerminalIds.split(","); | 123 | String[] is = iotTerminalIds.split(","); |
| 126 | - Integer userid = getUserId().intValue(); | 124 | + Integer userid = SecurityUtils.getUserId().intValue(); |
| 127 | for(String iotTerminalId:is) | 125 | for(String iotTerminalId:is) |
| 128 | { | 126 | { |
| 129 | UserTerminalGroupRelation newuserTerminalGroupRelation = new UserTerminalGroupRelation(); | 127 | UserTerminalGroupRelation newuserTerminalGroupRelation = new UserTerminalGroupRelation(); |
| @@ -148,7 +146,7 @@ public class UserTerminalGroupRelationController extends BaseController | @@ -148,7 +146,7 @@ public class UserTerminalGroupRelationController extends BaseController | ||
| 148 | { | 146 | { |
| 149 | return AjaxResult.error("终端id必填"); | 147 | return AjaxResult.error("终端id必填"); |
| 150 | } | 148 | } |
| 151 | - int i = publicService.updateBySql("UPDATE `user_terminal_group_relation` SET iot_terminal_group_id="+userTerminalGroupRelation.getIot_terminal_group_id()+",iot_terminal_group_name='"+userTerminalGroupRelation.getIot_terminal_group_name()+"' WHERE iot_terminal_id IN('"+iotTerminalIds.replace(",","','")+"') and user_info_id="+getUserId().intValue()); | 149 | + int i = publicService.updateBySql("UPDATE `user_terminal_group_relation` SET iot_terminal_group_id="+userTerminalGroupRelation.getIot_terminal_group_id()+",iot_terminal_group_name='"+userTerminalGroupRelation.getIot_terminal_group_name()+"' WHERE iot_terminal_id IN('"+iotTerminalIds.replace(",","','")+"') and user_info_id="+SecurityUtils.getUserId().intValue()); |
| 152 | return toAjax(i); | 150 | return toAjax(i); |
| 153 | } | 151 | } |
| 154 | 152 |
| 1 | package com.zhonglai.luhui.api.service; | 1 | package com.zhonglai.luhui.api.service; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.common.enums.UserStatus; | ||
| 4 | import com.ruoyi.common.exception.ServiceException; | 3 | import com.ruoyi.common.exception.ServiceException; |
| 5 | import com.ruoyi.common.utils.StringUtils; | 4 | import com.ruoyi.common.utils.StringUtils; |
| 6 | -import com.ruoyi.system.login.dto.ApiLoginUser; | ||
| 7 | -import com.ruoyi.system.login.dto.Yu2leUserInfo; | ||
| 8 | -import com.ruoyi.system.login.dto.Yu2leUserLogin; | ||
| 9 | -import com.ruoyi.system.service.PublicService; | 5 | +import com.zhonglai.luhui.dao.service.PublicService; |
| 6 | +import com.zhonglai.luhui.security.dto.ApiLoginUser; | ||
| 7 | +import com.zhonglai.luhui.security.dto.Yu2leUserInfo; | ||
| 8 | +import com.zhonglai.luhui.security.dto.Yu2leUserLogin; | ||
| 10 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
| 11 | import org.slf4j.LoggerFactory; | 10 | import org.slf4j.LoggerFactory; |
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 1 | package com.zhonglai.luhui.backups.task; | 1 | package com.zhonglai.luhui.backups.task; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.common.utils.StringUtils; | ||
| 4 | -import com.ruoyi.system.service.PublicService; | ||
| 5 | -import org.apache.commons.lang3.ArrayUtils; | 3 | +import com.zhonglai.luhui.dao.service.PublicService; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 4 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.context.annotation.Configuration; | 5 | import org.springframework.context.annotation.Configuration; |
| 8 | import org.springframework.scheduling.annotation.EnableScheduling; | 6 | import org.springframework.scheduling.annotation.EnableScheduling; |
| @@ -28,6 +28,14 @@ | @@ -28,6 +28,14 @@ | ||
| 28 | <groupId>com.zhonglai.luhui</groupId> | 28 | <groupId>com.zhonglai.luhui</groupId> |
| 29 | <artifactId>ruoyi-common</artifactId> | 29 | <artifactId>ruoyi-common</artifactId> |
| 30 | </dependency> | 30 | </dependency> |
| 31 | + <dependency> | ||
| 32 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 33 | + <artifactId>ruoyi-common-redis</artifactId> | ||
| 34 | + </dependency> | ||
| 35 | + <dependency> | ||
| 36 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 37 | + <artifactId>lh-domain</artifactId> | ||
| 38 | + </dependency> | ||
| 31 | </dependencies> | 39 | </dependencies> |
| 32 | 40 | ||
| 33 | </project> | 41 | </project> |
| @@ -3,10 +3,10 @@ package com.zhonglai.luhui.central.control; | @@ -3,10 +3,10 @@ package com.zhonglai.luhui.central.control; | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | import com.ruoyi.common.core.domain.Message; | 4 | import com.ruoyi.common.core.domain.Message; |
| 5 | import com.ruoyi.common.core.domain.MessageCode; | 5 | import com.ruoyi.common.core.domain.MessageCode; |
| 6 | -import com.ruoyi.common.core.redis.RedisCache; | ||
| 7 | import com.ruoyi.common.utils.StringUtils; | 6 | import com.ruoyi.common.utils.StringUtils; |
| 8 | import com.ruoyi.common.utils.html.HttpUtils; | 7 | import com.ruoyi.common.utils.html.HttpUtils; |
| 9 | -import com.ruoyi.system.domain.IotDevice; | 8 | +import com.ruoyi.system.domain.iot.IotDevice; |
| 9 | +import com.zhonglai.luhui.redis.service.RedisCache; | ||
| 10 | import okhttp3.Response; | 10 | import okhttp3.Response; |
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
| @@ -86,7 +86,6 @@ | @@ -86,7 +86,6 @@ | ||
| 86 | <dependency> | 86 | <dependency> |
| 87 | <groupId>com.squareup.okhttp3</groupId> | 87 | <groupId>com.squareup.okhttp3</groupId> |
| 88 | <artifactId>okhttp</artifactId> | 88 | <artifactId>okhttp</artifactId> |
| 89 | - <version>4.10.0</version> | ||
| 90 | </dependency> | 89 | </dependency> |
| 91 | <!-- 阿里JSON解析器 --> | 90 | <!-- 阿里JSON解析器 --> |
| 92 | <dependency> | 91 | <dependency> |
| 1 | +package com.zhonglai.luhui.sse; | ||
| 2 | + | ||
| 3 | +import okio.BufferedSource; | ||
| 4 | + | ||
| 5 | +import java.io.IOException; | ||
| 6 | + | ||
| 7 | + public class ResponseBodyReader { | ||
| 8 | + private final BufferedSource source; | ||
| 9 | + | ||
| 10 | + public ResponseBodyReader(BufferedSource source) { | ||
| 11 | + this.source = source; | ||
| 12 | + } | ||
| 13 | + | ||
| 14 | + public boolean hasNextEvent() throws IOException { | ||
| 15 | + // 判断是否还有下一个SSE事件 | ||
| 16 | + return !source.exhausted(); | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + public ServerSentEvent nextEvent() throws IOException { | ||
| 20 | + // 读取下一个SSE事件 | ||
| 21 | + String id = null; | ||
| 22 | + String event = null; | ||
| 23 | + String data = null; | ||
| 24 | + | ||
| 25 | + while (true) { | ||
| 26 | + String line = source.readUtf8LineStrict(); | ||
| 27 | + if (line.isEmpty()) { | ||
| 28 | + break; // SSE事件结束 | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + if (line.startsWith("id:")) { | ||
| 32 | + id = line.substring(3).trim(); | ||
| 33 | + } else if (line.startsWith("event:")) { | ||
| 34 | + event = line.substring(6).trim(); | ||
| 35 | + } else if (line.startsWith("data:")) { | ||
| 36 | + data = line.substring(5).trim(); | ||
| 37 | + } | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + return new ServerSentEvent(id, event, data); | ||
| 41 | + } | ||
| 42 | +} |
| 1 | +package com.zhonglai.luhui.sse; | ||
| 2 | + | ||
| 3 | +public class ServerSentEvent { | ||
| 4 | + private final String id; | ||
| 5 | + private final String event; | ||
| 6 | + private final String data; | ||
| 7 | + | ||
| 8 | + public ServerSentEvent(String id, String event, String data) { | ||
| 9 | + this.id = id; | ||
| 10 | + this.event = event; | ||
| 11 | + this.data = data; | ||
| 12 | + } | ||
| 13 | + | ||
| 14 | + public String getId() { | ||
| 15 | + return id; | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + public String getEvent() { | ||
| 19 | + return event; | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + public String getData() { | ||
| 23 | + return data; | ||
| 24 | + } | ||
| 25 | +} |
lh-modules/lh-afms/afms.sql
0 → 100644
| 1 | +/* | ||
| 2 | +SQLyog Ultimate v11.24 (32 bit) | ||
| 3 | +MySQL - 5.7.41 : Database - lh-afms | ||
| 4 | +********************************************************************* | ||
| 5 | +*/ | ||
| 6 | + | ||
| 7 | +/*!40101 SET NAMES utf8 */; | ||
| 8 | + | ||
| 9 | +/*!40101 SET SQL_MODE=''*/; | ||
| 10 | + | ||
| 11 | +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | ||
| 12 | +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
| 13 | +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
| 14 | +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
| 15 | +CREATE DATABASE /*!32312 IF NOT EXISTS*/`lh-afms` /*!40100 DEFAULT CHARACTER SET utf8 */; | ||
| 16 | + | ||
| 17 | +USE `lh-afms`; | ||
| 18 | + | ||
| 19 | +/*Table structure for table `afms_basic_aquatic` */ | ||
| 20 | + | ||
| 21 | +DROP TABLE IF EXISTS `afms_basic_aquatic`; | ||
| 22 | + | ||
| 23 | +CREATE TABLE `afms_basic_aquatic` ( | ||
| 24 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 25 | + `name` varchar(255) NOT NULL COMMENT '动保名称', | ||
| 26 | + `category` varchar(255) NOT NULL COMMENT '类别', | ||
| 27 | + `brand` varchar(255) NOT NULL COMMENT '品牌', | ||
| 28 | + `measurement_unit_id` int(11) NOT NULL COMMENT '计量单位ID', | ||
| 29 | + `specification_unit` varchar(255) NOT NULL COMMENT '规格单位', | ||
| 30 | + `supplier` varchar(255) NOT NULL COMMENT '供应商', | ||
| 31 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 32 | + `supplier_id` int(11) NOT NULL COMMENT '供应商ID', | ||
| 33 | + PRIMARY KEY (`id`), | ||
| 34 | + KEY `measurement_unit_id` (`measurement_unit_id`), | ||
| 35 | + KEY `FK_afms_basic_aquatic_supplier` (`supplier_id`), | ||
| 36 | + CONSTRAINT `FK_afms_basic_aquatic_supplier` FOREIGN KEY (`supplier_id`) REFERENCES `afms_basic_supplier` (`id`), | ||
| 37 | + CONSTRAINT `afms_basic_aquatic_ibfk_1` FOREIGN KEY (`measurement_unit_id`) REFERENCES `afms_basic_measurement_unit` (`id`) | ||
| 38 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-动保信息管理'; | ||
| 39 | + | ||
| 40 | +/*Data for the table `afms_basic_aquatic` */ | ||
| 41 | + | ||
| 42 | +/*Table structure for table `afms_basic_brand` */ | ||
| 43 | + | ||
| 44 | +DROP TABLE IF EXISTS `afms_basic_brand`; | ||
| 45 | + | ||
| 46 | +CREATE TABLE `afms_basic_brand` ( | ||
| 47 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 48 | + `NAME` varchar(255) NOT NULL COMMENT '名称', | ||
| 49 | + `description` text NOT NULL COMMENT '描述', | ||
| 50 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 51 | + PRIMARY KEY (`id`) | ||
| 52 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-品牌信息管理'; | ||
| 53 | + | ||
| 54 | +/*Data for the table `afms_basic_brand` */ | ||
| 55 | + | ||
| 56 | +/*Table structure for table `afms_basic_category` */ | ||
| 57 | + | ||
| 58 | +DROP TABLE IF EXISTS `afms_basic_category`; | ||
| 59 | + | ||
| 60 | +CREATE TABLE `afms_basic_category` ( | ||
| 61 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 62 | + `NAME` varchar(255) NOT NULL COMMENT '名称', | ||
| 63 | + `description` text NOT NULL COMMENT '描述', | ||
| 64 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 65 | + PRIMARY KEY (`id`) | ||
| 66 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-品类信息管理'; | ||
| 67 | + | ||
| 68 | +/*Data for the table `afms_basic_category` */ | ||
| 69 | + | ||
| 70 | +/*Table structure for table `afms_basic_customer` */ | ||
| 71 | + | ||
| 72 | +DROP TABLE IF EXISTS `afms_basic_customer`; | ||
| 73 | + | ||
| 74 | +CREATE TABLE `afms_basic_customer` ( | ||
| 75 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 76 | + `name` varchar(255) NOT NULL COMMENT '客户名称', | ||
| 77 | + `customer_type_id` int(11) NOT NULL COMMENT '客户类型ID', | ||
| 78 | + `contact_person` varchar(255) NOT NULL COMMENT '联系人', | ||
| 79 | + `contact_phone` varchar(255) NOT NULL COMMENT '联系电话', | ||
| 80 | + `contact_address` varchar(255) NOT NULL COMMENT '联系地址', | ||
| 81 | + `taxpayer_identification_number` varchar(255) NOT NULL COMMENT '纳税人识别号', | ||
| 82 | + `bank` varchar(255) NOT NULL COMMENT '开户行', | ||
| 83 | + `account_name` varchar(255) NOT NULL COMMENT '用户名', | ||
| 84 | + `account_number` varchar(255) NOT NULL COMMENT '账号', | ||
| 85 | + `business_license` varchar(255) NOT NULL COMMENT '营业执照', | ||
| 86 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 87 | + PRIMARY KEY (`id`), | ||
| 88 | + KEY `customer_type_id` (`customer_type_id`), | ||
| 89 | + CONSTRAINT `afms_basic_customer_ibfk_1` FOREIGN KEY (`customer_type_id`) REFERENCES `afms_basic_customer_type` (`id`) | ||
| 90 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-客户信息管理'; | ||
| 91 | + | ||
| 92 | +/*Data for the table `afms_basic_customer` */ | ||
| 93 | + | ||
| 94 | +/*Table structure for table `afms_basic_customer_type` */ | ||
| 95 | + | ||
| 96 | +DROP TABLE IF EXISTS `afms_basic_customer_type`; | ||
| 97 | + | ||
| 98 | +CREATE TABLE `afms_basic_customer_type` ( | ||
| 99 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 100 | + `NAME` varchar(255) NOT NULL COMMENT '名称', | ||
| 101 | + `description` text NOT NULL COMMENT '描述', | ||
| 102 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 103 | + PRIMARY KEY (`id`) | ||
| 104 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-客户类型信息管理'; | ||
| 105 | + | ||
| 106 | +/*Data for the table `afms_basic_customer_type` */ | ||
| 107 | + | ||
| 108 | +/*Table structure for table `afms_basic_feed` */ | ||
| 109 | + | ||
| 110 | +DROP TABLE IF EXISTS `afms_basic_feed`; | ||
| 111 | + | ||
| 112 | +CREATE TABLE `afms_basic_feed` ( | ||
| 113 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 114 | + `name` varchar(255) NOT NULL COMMENT '饲料名称', | ||
| 115 | + `brand_id` int(11) NOT NULL COMMENT '品牌ID', | ||
| 116 | + `category_id` int(11) NOT NULL COMMENT '品类ID', | ||
| 117 | + `specification_unit` varchar(255) NOT NULL COMMENT '规格单位(kg/包)', | ||
| 118 | + `supplier` varchar(255) NOT NULL COMMENT '供应商', | ||
| 119 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 120 | + `supplier_id` int(11) NOT NULL COMMENT '供应商ID', | ||
| 121 | + PRIMARY KEY (`id`), | ||
| 122 | + KEY `brand_id` (`brand_id`), | ||
| 123 | + KEY `category_id` (`category_id`), | ||
| 124 | + KEY `FK_afms_basic_feed_supplier` (`supplier_id`), | ||
| 125 | + CONSTRAINT `FK_afms_basic_feed_supplier` FOREIGN KEY (`supplier_id`) REFERENCES `afms_basic_supplier` (`id`), | ||
| 126 | + CONSTRAINT `afms_basic_feed_ibfk_1` FOREIGN KEY (`brand_id`) REFERENCES `afms_basic_brand` (`id`), | ||
| 127 | + CONSTRAINT `afms_basic_feed_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `afms_basic_category` (`id`) | ||
| 128 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-饲料信息管理'; | ||
| 129 | + | ||
| 130 | +/*Data for the table `afms_basic_feed` */ | ||
| 131 | + | ||
| 132 | +/*Table structure for table `afms_basic_fry` */ | ||
| 133 | + | ||
| 134 | +DROP TABLE IF EXISTS `afms_basic_fry`; | ||
| 135 | + | ||
| 136 | +CREATE TABLE `afms_basic_fry` ( | ||
| 137 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 138 | + `name` varchar(255) NOT NULL COMMENT '苗种名称', | ||
| 139 | + `species_id` int(11) NOT NULL COMMENT '养殖品种ID', | ||
| 140 | + `category` enum('鱼苗','虾苗','螺苗','鱼卵') NOT NULL COMMENT '类别', | ||
| 141 | + `quantity_unit` enum('尾','万尾','粒') NOT NULL COMMENT '数量单位', | ||
| 142 | + `specification_unit` varchar(255) NOT NULL COMMENT '规格单位', | ||
| 143 | + `supplier` varchar(255) NOT NULL COMMENT '供应商', | ||
| 144 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 145 | + `supplier_id` int(11) NOT NULL COMMENT '供应商ID', | ||
| 146 | + PRIMARY KEY (`id`), | ||
| 147 | + KEY `species_id` (`species_id`), | ||
| 148 | + KEY `FK_afms_basic_fry_supplier` (`supplier_id`), | ||
| 149 | + CONSTRAINT `FK_afms_basic_fry_supplier` FOREIGN KEY (`supplier_id`) REFERENCES `afms_basic_supplier` (`id`), | ||
| 150 | + CONSTRAINT `afms_basic_fry_ibfk_1` FOREIGN KEY (`species_id`) REFERENCES `afms_basic_species` (`id`) | ||
| 151 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-苗种信息管理'; | ||
| 152 | + | ||
| 153 | +/*Data for the table `afms_basic_fry` */ | ||
| 154 | + | ||
| 155 | +/*Table structure for table `afms_basic_measurement_unit` */ | ||
| 156 | + | ||
| 157 | +DROP TABLE IF EXISTS `afms_basic_measurement_unit`; | ||
| 158 | + | ||
| 159 | +CREATE TABLE `afms_basic_measurement_unit` ( | ||
| 160 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 161 | + `name` varchar(255) NOT NULL COMMENT '名称', | ||
| 162 | + `description` text NOT NULL COMMENT '描述', | ||
| 163 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 164 | + PRIMARY KEY (`id`) | ||
| 165 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-计量单位信息管理'; | ||
| 166 | + | ||
| 167 | +/*Data for the table `afms_basic_measurement_unit` */ | ||
| 168 | + | ||
| 169 | +/*Table structure for table `afms_basic_pond` */ | ||
| 170 | + | ||
| 171 | +DROP TABLE IF EXISTS `afms_basic_pond`; | ||
| 172 | + | ||
| 173 | +CREATE TABLE `afms_basic_pond` ( | ||
| 174 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 175 | + `user_id` int(11) NOT NULL COMMENT '用户ID', | ||
| 176 | + `name` varchar(255) NOT NULL COMMENT '塘口名称', | ||
| 177 | + `person_in_charge` varchar(255) NOT NULL COMMENT '负责人', | ||
| 178 | + `species_ids` varchar(255) NOT NULL COMMENT '养殖品种ID集合(以英文逗号分割)', | ||
| 179 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 180 | + PRIMARY KEY (`id`) | ||
| 181 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-塘口信息管理'; | ||
| 182 | + | ||
| 183 | +/*Data for the table `afms_basic_pond` */ | ||
| 184 | + | ||
| 185 | +/*Table structure for table `afms_basic_species` */ | ||
| 186 | + | ||
| 187 | +DROP TABLE IF EXISTS `afms_basic_species`; | ||
| 188 | + | ||
| 189 | +CREATE TABLE `afms_basic_species` ( | ||
| 190 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 191 | + `name` varchar(255) NOT NULL COMMENT '品种名称', | ||
| 192 | + `water_type` enum('淡水','海水') NOT NULL COMMENT '水体类型', | ||
| 193 | + `weight_unit` enum('斤','kg','g') NOT NULL COMMENT '重量单位', | ||
| 194 | + `quantity_unit` enum('尾','粒') NOT NULL COMMENT '数量单位', | ||
| 195 | + `specification_unit` varchar(255) NOT NULL COMMENT '规格单位', | ||
| 196 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 197 | + PRIMARY KEY (`id`) | ||
| 198 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-养殖品种管理'; | ||
| 199 | + | ||
| 200 | +/*Data for the table `afms_basic_species` */ | ||
| 201 | + | ||
| 202 | +/*Table structure for table `afms_basic_supplier` */ | ||
| 203 | + | ||
| 204 | +DROP TABLE IF EXISTS `afms_basic_supplier`; | ||
| 205 | + | ||
| 206 | +CREATE TABLE `afms_basic_supplier` ( | ||
| 207 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 208 | + `name` varchar(255) NOT NULL COMMENT '供应商名称', | ||
| 209 | + `supplier_type_id` int(11) NOT NULL COMMENT '供应商类型ID', | ||
| 210 | + `contact_person` varchar(255) NOT NULL COMMENT '联系人', | ||
| 211 | + `contact_phone` varchar(255) NOT NULL COMMENT '联系电话', | ||
| 212 | + `contact_address` varchar(255) NOT NULL COMMENT '联系地址', | ||
| 213 | + `taxpayer_identification_number` varchar(255) NOT NULL COMMENT '纳税人识别号', | ||
| 214 | + `bank` varchar(255) NOT NULL COMMENT '开户行', | ||
| 215 | + `account_name` varchar(255) NOT NULL COMMENT '用户名', | ||
| 216 | + `account_number` varchar(255) NOT NULL COMMENT '账号', | ||
| 217 | + `business_license` varchar(255) NOT NULL COMMENT '营业执照', | ||
| 218 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 219 | + PRIMARY KEY (`id`), | ||
| 220 | + KEY `supplier_type_id` (`supplier_type_id`), | ||
| 221 | + CONSTRAINT `afms_basic_supplier_ibfk_1` FOREIGN KEY (`supplier_type_id`) REFERENCES `afms_basic_supplier_type` (`id`) | ||
| 222 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-供应商信息管理'; | ||
| 223 | + | ||
| 224 | +/*Data for the table `afms_basic_supplier` */ | ||
| 225 | + | ||
| 226 | +/*Table structure for table `afms_basic_supplier_type` */ | ||
| 227 | + | ||
| 228 | +DROP TABLE IF EXISTS `afms_basic_supplier_type`; | ||
| 229 | + | ||
| 230 | +CREATE TABLE `afms_basic_supplier_type` ( | ||
| 231 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 232 | + `NAME` varchar(255) NOT NULL COMMENT '名称', | ||
| 233 | + `description` text NOT NULL COMMENT '描述', | ||
| 234 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 235 | + PRIMARY KEY (`id`) | ||
| 236 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基础信息管理-供应商类型信息管理'; | ||
| 237 | + | ||
| 238 | +/*Data for the table `afms_basic_supplier_type` */ | ||
| 239 | + | ||
| 240 | +/*Table structure for table `afms_cost_expense` */ | ||
| 241 | + | ||
| 242 | +DROP TABLE IF EXISTS `afms_cost_expense`; | ||
| 243 | + | ||
| 244 | +CREATE TABLE `afms_cost_expense` ( | ||
| 245 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 246 | + `date` date NOT NULL COMMENT '时间', | ||
| 247 | + `category` varchar(255) NOT NULL COMMENT '类别', | ||
| 248 | + `cost` decimal(10,2) NOT NULL COMMENT '费用', | ||
| 249 | + `remarks` text COMMENT '备注', | ||
| 250 | + PRIMARY KEY (`id`) | ||
| 251 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='成本与收益- 成本模块'; | ||
| 252 | + | ||
| 253 | +/*Data for the table `afms_cost_expense` */ | ||
| 254 | + | ||
| 255 | +/*Table structure for table `afms_data_loss` */ | ||
| 256 | + | ||
| 257 | +DROP TABLE IF EXISTS `afms_data_loss`; | ||
| 258 | + | ||
| 259 | +CREATE TABLE `afms_data_loss` ( | ||
| 260 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 261 | + `loss_record_time` datetime NOT NULL COMMENT '损失记录时间', | ||
| 262 | + `pond_id` int(11) NOT NULL COMMENT '塘口ID', | ||
| 263 | + `species` varchar(255) NOT NULL COMMENT '养殖品种', | ||
| 264 | + `loss_count` int(11) NOT NULL COMMENT '损失数量', | ||
| 265 | + `loss_weight` decimal(10,2) NOT NULL COMMENT '损失重量', | ||
| 266 | + `loss_specification` decimal(6,2) NOT NULL COMMENT '损失规格', | ||
| 267 | + `estimated_reason` varchar(255) NOT NULL COMMENT '预估原因', | ||
| 268 | + `image_path` varchar(255) DEFAULT NULL COMMENT '图片', | ||
| 269 | + PRIMARY KEY (`id`), | ||
| 270 | + KEY `pond_id` (`pond_id`), | ||
| 271 | + CONSTRAINT `afms_data_loss_ibfk_1` FOREIGN KEY (`pond_id`) REFERENCES `afms_basic_pond` (`id`) | ||
| 272 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
| 273 | + | ||
| 274 | +/*Data for the table `afms_data_loss` */ | ||
| 275 | + | ||
| 276 | +/*Table structure for table `afms_data_medicine` */ | ||
| 277 | + | ||
| 278 | +DROP TABLE IF EXISTS `afms_data_medicine`; | ||
| 279 | + | ||
| 280 | +CREATE TABLE `afms_data_medicine` ( | ||
| 281 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 282 | + `feeding_start_time` datetime NOT NULL COMMENT '投喂开始时间', | ||
| 283 | + `pond_id` int(11) NOT NULL COMMENT '塘口ID', | ||
| 284 | + `medicine_name` varchar(255) NOT NULL COMMENT '动保', | ||
| 285 | + `medicine_amount` decimal(10,2) NOT NULL COMMENT '动保使用量', | ||
| 286 | + `unit` varchar(255) NOT NULL COMMENT '计量单位', | ||
| 287 | + `reason` varchar(255) NOT NULL COMMENT '用药原因', | ||
| 288 | + PRIMARY KEY (`id`), | ||
| 289 | + KEY `pond_id` (`pond_id`), | ||
| 290 | + CONSTRAINT `afms_data_medicine_ibfk_1` FOREIGN KEY (`pond_id`) REFERENCES `afms_basic_pond` (`id`) | ||
| 291 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
| 292 | + | ||
| 293 | +/*Data for the table `afms_data_medicine` */ | ||
| 294 | + | ||
| 295 | +/*Table structure for table `afms_data_sampling` */ | ||
| 296 | + | ||
| 297 | +DROP TABLE IF EXISTS `afms_data_sampling`; | ||
| 298 | + | ||
| 299 | +CREATE TABLE `afms_data_sampling` ( | ||
| 300 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 301 | + `sampling_time` datetime NOT NULL COMMENT '采样时间', | ||
| 302 | + `pond_id` int(11) NOT NULL COMMENT '塘口ID', | ||
| 303 | + `species` varchar(255) NOT NULL COMMENT '养殖品种', | ||
| 304 | + `sample_count` int(11) NOT NULL COMMENT '样本数量', | ||
| 305 | + `sample_weight` decimal(10,2) NOT NULL COMMENT '样本重量', | ||
| 306 | + `average_length` decimal(6,2) NOT NULL COMMENT '平均体长', | ||
| 307 | + `average_specification` decimal(6,2) NOT NULL COMMENT '平均规格', | ||
| 308 | + `estimated_pond_weight` decimal(10,2) NOT NULL COMMENT '预估存塘重量', | ||
| 309 | + `image_path` varchar(255) DEFAULT NULL COMMENT '图片', | ||
| 310 | + PRIMARY KEY (`id`), | ||
| 311 | + KEY `pond_id` (`pond_id`), | ||
| 312 | + CONSTRAINT `afms_data_sampling_ibfk_1` FOREIGN KEY (`pond_id`) REFERENCES `afms_basic_pond` (`id`) | ||
| 313 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
| 314 | + | ||
| 315 | +/*Data for the table `afms_data_sampling` */ | ||
| 316 | + | ||
| 317 | +/*Table structure for table `afms_data_water_quality` */ | ||
| 318 | + | ||
| 319 | +DROP TABLE IF EXISTS `afms_data_water_quality`; | ||
| 320 | + | ||
| 321 | +CREATE TABLE `afms_data_water_quality` ( | ||
| 322 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 323 | + `test_time` datetime NOT NULL COMMENT '检测时间', | ||
| 324 | + `pond_id` int(11) NOT NULL COMMENT '塘口ID', | ||
| 325 | + `weather` varchar(255) NOT NULL COMMENT '天气', | ||
| 326 | + `water_temperature` decimal(5,2) NOT NULL COMMENT '水温(℃)', | ||
| 327 | + `dissolved_oxygen` decimal(5,2) NOT NULL COMMENT '溶氧(mg/L)', | ||
| 328 | + `pH` decimal(5,2) NOT NULL COMMENT '酸碱度(pH)', | ||
| 329 | + `ammonia_nitrogen` decimal(5,2) NOT NULL COMMENT '氨氮(ppm)', | ||
| 330 | + `nitrite` decimal(5,2) NOT NULL COMMENT '亚硝酸盐(ppm)', | ||
| 331 | + `salinity` decimal(5,2) NOT NULL COMMENT '盐度', | ||
| 332 | + `total_alkalinity` decimal(5,2) NOT NULL COMMENT '总碱度', | ||
| 333 | + `total_hardness` decimal(5,2) NOT NULL COMMENT '总硬度', | ||
| 334 | + PRIMARY KEY (`id`), | ||
| 335 | + KEY `pond_id` (`pond_id`), | ||
| 336 | + CONSTRAINT `afms_data_water_quality_ibfk_1` FOREIGN KEY (`pond_id`) REFERENCES `afms_basic_pond` (`id`) | ||
| 337 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
| 338 | + | ||
| 339 | +/*Data for the table `afms_data_water_quality` */ | ||
| 340 | + | ||
| 341 | +/*Table structure for table `afms_inventory_feed_purchase` */ | ||
| 342 | + | ||
| 343 | +DROP TABLE IF EXISTS `afms_inventory_feed_purchase`; | ||
| 344 | + | ||
| 345 | +CREATE TABLE `afms_inventory_feed_purchase` ( | ||
| 346 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 347 | + `feed_id` int(11) NOT NULL COMMENT '饲料ID(关联饲料表)', | ||
| 348 | + `purchase_time` datetime NOT NULL COMMENT '进货时间', | ||
| 349 | + `weight` decimal(10,2) NOT NULL COMMENT '重量(kg)', | ||
| 350 | + `unit_price` decimal(10,2) NOT NULL COMMENT '单价(元)', | ||
| 351 | + `total_price` decimal(10,2) NOT NULL COMMENT '总价(元)', | ||
| 352 | + PRIMARY KEY (`id`), | ||
| 353 | + KEY `feed_id` (`feed_id`), | ||
| 354 | + CONSTRAINT `afms_inventory_feed_purchase_ibfk_1` FOREIGN KEY (`feed_id`) REFERENCES `afms_basic_feed` (`id`) | ||
| 355 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='进货模块-饲料进货'; | ||
| 356 | + | ||
| 357 | +/*Data for the table `afms_inventory_feed_purchase` */ | ||
| 358 | + | ||
| 359 | +/*Table structure for table `afms_inventory_feed_stock` */ | ||
| 360 | + | ||
| 361 | +DROP TABLE IF EXISTS `afms_inventory_feed_stock`; | ||
| 362 | + | ||
| 363 | +CREATE TABLE `afms_inventory_feed_stock` ( | ||
| 364 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 365 | + `feed_id` int(11) NOT NULL COMMENT '饲料ID(关联饲料信息表)', | ||
| 366 | + `stock` int(11) NOT NULL COMMENT '库存', | ||
| 367 | + `weight` decimal(10,2) NOT NULL COMMENT '重量(kg)', | ||
| 368 | + `unit_price` decimal(10,2) NOT NULL COMMENT '单价(元)', | ||
| 369 | + `total_price` decimal(10,2) NOT NULL COMMENT '总价(元)', | ||
| 370 | + PRIMARY KEY (`id`), | ||
| 371 | + KEY `feed_id` (`feed_id`), | ||
| 372 | + CONSTRAINT `afms_inventory_feed_stock_ibfk_1` FOREIGN KEY (`feed_id`) REFERENCES `afms_basic_feed` (`id`) | ||
| 373 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='库存模块- 饲料库存'; | ||
| 374 | + | ||
| 375 | +/*Data for the table `afms_inventory_feed_stock` */ | ||
| 376 | + | ||
| 377 | +/*Table structure for table `afms_inventory_medicine_purchase` */ | ||
| 378 | + | ||
| 379 | +DROP TABLE IF EXISTS `afms_inventory_medicine_purchase`; | ||
| 380 | + | ||
| 381 | +CREATE TABLE `afms_inventory_medicine_purchase` ( | ||
| 382 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 383 | + `medicine_id` int(11) NOT NULL COMMENT '动保ID(关联动保表)', | ||
| 384 | + `purchase_time` datetime NOT NULL COMMENT '进货时间', | ||
| 385 | + `quantity` int(11) NOT NULL COMMENT '数量', | ||
| 386 | + `unit_price` decimal(10,2) NOT NULL COMMENT '单价(元)', | ||
| 387 | + `total_price` decimal(10,2) NOT NULL COMMENT '总价(元)', | ||
| 388 | + PRIMARY KEY (`id`), | ||
| 389 | + KEY `medicine_id` (`medicine_id`), | ||
| 390 | + CONSTRAINT `afms_inventory_medicine_purchase_ibfk_1` FOREIGN KEY (`medicine_id`) REFERENCES `afms_basic_aquatic` (`id`) | ||
| 391 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='进货模块-动保进货'; | ||
| 392 | + | ||
| 393 | +/*Data for the table `afms_inventory_medicine_purchase` */ | ||
| 394 | + | ||
| 395 | +/*Table structure for table `afms_inventory_medicine_stock` */ | ||
| 396 | + | ||
| 397 | +DROP TABLE IF EXISTS `afms_inventory_medicine_stock`; | ||
| 398 | + | ||
| 399 | +CREATE TABLE `afms_inventory_medicine_stock` ( | ||
| 400 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 401 | + `medicine_id` int(11) NOT NULL COMMENT '动保ID(关联动保信息表)', | ||
| 402 | + `stock` int(11) NOT NULL COMMENT '库存', | ||
| 403 | + `weight` decimal(10,2) NOT NULL COMMENT '重量(kg)', | ||
| 404 | + `unit_price` decimal(10,2) NOT NULL COMMENT '单价(元)', | ||
| 405 | + `total_price` decimal(10,2) NOT NULL COMMENT '总价(元)', | ||
| 406 | + PRIMARY KEY (`id`), | ||
| 407 | + KEY `medicine_id` (`medicine_id`), | ||
| 408 | + CONSTRAINT `afms_inventory_medicine_stock_ibfk_1` FOREIGN KEY (`medicine_id`) REFERENCES `afms_basic_aquatic` (`id`) | ||
| 409 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='库存模块-动保库存'; | ||
| 410 | + | ||
| 411 | +/*Data for the table `afms_inventory_medicine_stock` */ | ||
| 412 | + | ||
| 413 | +/*Table structure for table `afms_inventory_seed_purchase` */ | ||
| 414 | + | ||
| 415 | +DROP TABLE IF EXISTS `afms_inventory_seed_purchase`; | ||
| 416 | + | ||
| 417 | +CREATE TABLE `afms_inventory_seed_purchase` ( | ||
| 418 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 419 | + `seed_id` int(11) NOT NULL COMMENT '苗种ID(关联苗种表)', | ||
| 420 | + `purchase_time` datetime NOT NULL COMMENT '进货时间', | ||
| 421 | + `quantity` int(11) NOT NULL COMMENT '数量', | ||
| 422 | + `unit_price` decimal(10,2) NOT NULL COMMENT '单价(元)', | ||
| 423 | + `total_price` decimal(10,2) NOT NULL COMMENT '总价(元)', | ||
| 424 | + PRIMARY KEY (`id`), | ||
| 425 | + KEY `seed_id` (`seed_id`), | ||
| 426 | + CONSTRAINT `afms_inventory_seed_purchase_ibfk_1` FOREIGN KEY (`seed_id`) REFERENCES `afms_basic_fry` (`id`) | ||
| 427 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='进货模块- 苗种进货'; | ||
| 428 | + | ||
| 429 | +/*Data for the table `afms_inventory_seed_purchase` */ | ||
| 430 | + | ||
| 431 | +/*Table structure for table `afms_inventory_seed_stock` */ | ||
| 432 | + | ||
| 433 | +DROP TABLE IF EXISTS `afms_inventory_seed_stock`; | ||
| 434 | + | ||
| 435 | +CREATE TABLE `afms_inventory_seed_stock` ( | ||
| 436 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 437 | + `seed_id` int(11) NOT NULL COMMENT '苗种ID(关联苗种信息表)', | ||
| 438 | + `stock` int(11) NOT NULL COMMENT '库存', | ||
| 439 | + `weight` decimal(10,2) NOT NULL COMMENT '重量(kg)', | ||
| 440 | + `unit_price` decimal(10,2) NOT NULL COMMENT '单价(元)', | ||
| 441 | + `total_price` decimal(10,2) NOT NULL COMMENT '总价(元)', | ||
| 442 | + PRIMARY KEY (`id`), | ||
| 443 | + KEY `seed_id` (`seed_id`), | ||
| 444 | + CONSTRAINT `afms_inventory_seed_stock_ibfk_1` FOREIGN KEY (`seed_id`) REFERENCES `afms_basic_fry` (`id`) | ||
| 445 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='库存模块-苗种库存'; | ||
| 446 | + | ||
| 447 | +/*Data for the table `afms_inventory_seed_stock` */ | ||
| 448 | + | ||
| 449 | +/*Table structure for table `afms_operation_draining` */ | ||
| 450 | + | ||
| 451 | +DROP TABLE IF EXISTS `afms_operation_draining`; | ||
| 452 | + | ||
| 453 | +CREATE TABLE `afms_operation_draining` ( | ||
| 454 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 455 | + `draining_date` datetime NOT NULL COMMENT '清塘时间', | ||
| 456 | + `pond_id` int(11) NOT NULL COMMENT '塘口ID', | ||
| 457 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 458 | + PRIMARY KEY (`id`), | ||
| 459 | + KEY `pond_id` (`pond_id`), | ||
| 460 | + CONSTRAINT `afms_operation_draining_ibfk_1` FOREIGN KEY (`pond_id`) REFERENCES `afms_basic_pond` (`id`) | ||
| 461 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='养殖操作-清塘模块'; | ||
| 462 | + | ||
| 463 | +/*Data for the table `afms_operation_draining` */ | ||
| 464 | + | ||
| 465 | +/*Table structure for table `afms_operation_feed` */ | ||
| 466 | + | ||
| 467 | +DROP TABLE IF EXISTS `afms_operation_feed`; | ||
| 468 | + | ||
| 469 | +CREATE TABLE `afms_operation_feed` ( | ||
| 470 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 471 | + `start_time` datetime NOT NULL COMMENT '开始时间', | ||
| 472 | + `end_time` datetime NOT NULL COMMENT '结束时间', | ||
| 473 | + `meal_count` int(11) NOT NULL COMMENT '餐数', | ||
| 474 | + `pond_id` int(11) NOT NULL COMMENT '塘口ID', | ||
| 475 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 476 | + PRIMARY KEY (`id`), | ||
| 477 | + KEY `pond_id` (`pond_id`), | ||
| 478 | + CONSTRAINT `afms_operation_feed_ibfk_1` FOREIGN KEY (`pond_id`) REFERENCES `afms_basic_pond` (`id`) | ||
| 479 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='养殖操作-饲料投喂模块'; | ||
| 480 | + | ||
| 481 | +/*Data for the table `afms_operation_feed` */ | ||
| 482 | + | ||
| 483 | +/*Table structure for table `afms_operation_feed_details` */ | ||
| 484 | + | ||
| 485 | +DROP TABLE IF EXISTS `afms_operation_feed_details`; | ||
| 486 | + | ||
| 487 | +CREATE TABLE `afms_operation_feed_details` ( | ||
| 488 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 489 | + `feed_record_id` int(11) NOT NULL COMMENT '饲料投喂记录ID', | ||
| 490 | + `feed_id` int(11) NOT NULL COMMENT '饲料ID', | ||
| 491 | + `feed_amount` float NOT NULL COMMENT '投放量/Kg', | ||
| 492 | + PRIMARY KEY (`id`), | ||
| 493 | + KEY `feed_record_id` (`feed_record_id`), | ||
| 494 | + KEY `feed_id` (`feed_id`), | ||
| 495 | + CONSTRAINT `afms_operation_feed_details_ibfk_1` FOREIGN KEY (`feed_record_id`) REFERENCES `afms_operation_feed` (`id`), | ||
| 496 | + CONSTRAINT `afms_operation_feed_details_ibfk_2` FOREIGN KEY (`feed_id`) REFERENCES `afms_basic_feed` (`id`) | ||
| 497 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='养殖操作-饲料投喂模块明细'; | ||
| 498 | + | ||
| 499 | +/*Data for the table `afms_operation_feed_details` */ | ||
| 500 | + | ||
| 501 | +/*Table structure for table `afms_operation_seed_stock` */ | ||
| 502 | + | ||
| 503 | +DROP TABLE IF EXISTS `afms_operation_seed_stock`; | ||
| 504 | + | ||
| 505 | +CREATE TABLE `afms_operation_seed_stock` ( | ||
| 506 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 507 | + `stocking_date` datetime NOT NULL COMMENT '投放时间', | ||
| 508 | + `pond_id` int(11) NOT NULL COMMENT '塘口ID', | ||
| 509 | + `fry_id` int(11) NOT NULL COMMENT '投放苗种ID', | ||
| 510 | + `quantity` float NOT NULL COMMENT '数量', | ||
| 511 | + `specification` varchar(255) NOT NULL COMMENT '规格', | ||
| 512 | + `unit_price` float NOT NULL COMMENT '单价(元)', | ||
| 513 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 514 | + PRIMARY KEY (`id`), | ||
| 515 | + KEY `pond_id` (`pond_id`), | ||
| 516 | + KEY `fry_id` (`fry_id`), | ||
| 517 | + CONSTRAINT `afms_operation_seed_stock_ibfk_1` FOREIGN KEY (`pond_id`) REFERENCES `afms_basic_pond` (`id`), | ||
| 518 | + CONSTRAINT `afms_operation_seed_stock_ibfk_2` FOREIGN KEY (`fry_id`) REFERENCES `afms_basic_fry` (`id`) | ||
| 519 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='养殖操作-投放模块'; | ||
| 520 | + | ||
| 521 | +/*Data for the table `afms_operation_seed_stock` */ | ||
| 522 | + | ||
| 523 | +/*Table structure for table `afms_operation_transfer` */ | ||
| 524 | + | ||
| 525 | +DROP TABLE IF EXISTS `afms_operation_transfer`; | ||
| 526 | + | ||
| 527 | +CREATE TABLE `afms_operation_transfer` ( | ||
| 528 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 529 | + `transfer_date` datetime NOT NULL COMMENT '搬塘时间', | ||
| 530 | + `pond_id` int(11) NOT NULL COMMENT '塘口ID', | ||
| 531 | + `species_id` int(11) NOT NULL COMMENT '养殖品种ID', | ||
| 532 | + `quantity` float NOT NULL COMMENT '搬出数量', | ||
| 533 | + `weight` float NOT NULL COMMENT '搬出重量', | ||
| 534 | + `unit_price` float NOT NULL COMMENT '单价', | ||
| 535 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 536 | + PRIMARY KEY (`id`), | ||
| 537 | + KEY `pond_id` (`pond_id`), | ||
| 538 | + KEY `species_id` (`species_id`), | ||
| 539 | + CONSTRAINT `afms_operation_transfer_ibfk_1` FOREIGN KEY (`pond_id`) REFERENCES `afms_basic_pond` (`id`), | ||
| 540 | + CONSTRAINT `afms_operation_transfer_ibfk_2` FOREIGN KEY (`species_id`) REFERENCES `afms_basic_species` (`id`) | ||
| 541 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='养殖操作-搬塘模块'; | ||
| 542 | + | ||
| 543 | +/*Data for the table `afms_operation_transfer` */ | ||
| 544 | + | ||
| 545 | +/*Table structure for table `afms_operation_transfer_details` */ | ||
| 546 | + | ||
| 547 | +DROP TABLE IF EXISTS `afms_operation_transfer_details`; | ||
| 548 | + | ||
| 549 | +CREATE TABLE `afms_operation_transfer_details` ( | ||
| 550 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 551 | + `transfer_id` int(11) NOT NULL COMMENT '搬塘记录ID', | ||
| 552 | + `target_pond_id` int(11) NOT NULL COMMENT '转入塘口ID', | ||
| 553 | + `quantity` float NOT NULL COMMENT '转入数量', | ||
| 554 | + `weight` float NOT NULL COMMENT '转入重量', | ||
| 555 | + PRIMARY KEY (`id`), | ||
| 556 | + KEY `transfer_id` (`transfer_id`), | ||
| 557 | + KEY `target_pond_id` (`target_pond_id`), | ||
| 558 | + CONSTRAINT `afms_operation_transfer_details_ibfk_1` FOREIGN KEY (`transfer_id`) REFERENCES `afms_operation_transfer` (`id`), | ||
| 559 | + CONSTRAINT `afms_operation_transfer_details_ibfk_2` FOREIGN KEY (`target_pond_id`) REFERENCES `afms_basic_pond` (`id`) | ||
| 560 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='养殖操作-搬塘模块明细'; | ||
| 561 | + | ||
| 562 | +/*Data for the table `afms_operation_transfer_details` */ | ||
| 563 | + | ||
| 564 | +/*Table structure for table `afms_operation_water_change` */ | ||
| 565 | + | ||
| 566 | +DROP TABLE IF EXISTS `afms_operation_water_change`; | ||
| 567 | + | ||
| 568 | +CREATE TABLE `afms_operation_water_change` ( | ||
| 569 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 570 | + `record_date` datetime NOT NULL COMMENT '换水记录时间', | ||
| 571 | + `pond_id` int(11) NOT NULL COMMENT '塘口ID', | ||
| 572 | + `inflow` float NOT NULL COMMENT '进水量(立方米)', | ||
| 573 | + `outflow` float NOT NULL COMMENT '出水量(立方米)', | ||
| 574 | + `photo` varchar(255) NOT NULL COMMENT '照片', | ||
| 575 | + `create_time` datetime NOT NULL COMMENT '创建时间', | ||
| 576 | + PRIMARY KEY (`id`), | ||
| 577 | + KEY `pond_id` (`pond_id`), | ||
| 578 | + CONSTRAINT `afms_operation_water_change_ibfk_1` FOREIGN KEY (`pond_id`) REFERENCES `afms_basic_pond` (`id`) | ||
| 579 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='养殖操作-换水模块'; | ||
| 580 | + | ||
| 581 | +/*Data for the table `afms_operation_water_change` */ | ||
| 582 | + | ||
| 583 | +/*Table structure for table `afms_revenue_harvest` */ | ||
| 584 | + | ||
| 585 | +DROP TABLE IF EXISTS `afms_revenue_harvest`; | ||
| 586 | + | ||
| 587 | +CREATE TABLE `afms_revenue_harvest` ( | ||
| 588 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 589 | + `harvest_date` date NOT NULL COMMENT '收获时间', | ||
| 590 | + `pond_id` int(11) NOT NULL COMMENT '塘口(关联塘口信息表)', | ||
| 591 | + `species_id` int(11) NOT NULL COMMENT '养殖品种', | ||
| 592 | + `customer` varchar(255) NOT NULL COMMENT '客户', | ||
| 593 | + `total_weight` decimal(10,2) NOT NULL COMMENT '收货总重量/斤', | ||
| 594 | + `total_price` decimal(10,2) NOT NULL COMMENT '收获总价格/元', | ||
| 595 | + `labor_cost` decimal(10,2) NOT NULL COMMENT '人工成本/元', | ||
| 596 | + `transportation_cost` decimal(10,2) NOT NULL COMMENT '运输成本/元', | ||
| 597 | + PRIMARY KEY (`id`), | ||
| 598 | + KEY `pond_id` (`pond_id`), | ||
| 599 | + KEY `species_id` (`species_id`), | ||
| 600 | + CONSTRAINT `afms_revenue_harvest_ibfk_1` FOREIGN KEY (`pond_id`) REFERENCES `afms_basic_pond` (`id`), | ||
| 601 | + CONSTRAINT `afms_revenue_harvest_ibfk_2` FOREIGN KEY (`species_id`) REFERENCES `afms_basic_species` (`id`) | ||
| 602 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='成本与收益- 收获模块'; | ||
| 603 | + | ||
| 604 | +/*Data for the table `afms_revenue_harvest` */ | ||
| 605 | + | ||
| 606 | +/*Table structure for table `afms_revenue_harvest_detail` */ | ||
| 607 | + | ||
| 608 | +DROP TABLE IF EXISTS `afms_revenue_harvest_detail`; | ||
| 609 | + | ||
| 610 | +CREATE TABLE `afms_revenue_harvest_detail` ( | ||
| 611 | + `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| 612 | + `harvest_id` int(11) NOT NULL COMMENT '收获(关联收获表)', | ||
| 613 | + `specification_range` varchar(255) NOT NULL COMMENT '规格范围(xx~xx)', | ||
| 614 | + `unit_price` decimal(10,2) NOT NULL COMMENT '单价/元', | ||
| 615 | + `weight` decimal(10,2) NOT NULL COMMENT '重量/斤', | ||
| 616 | + `quantity` int(11) NOT NULL COMMENT '收获数量/尾', | ||
| 617 | + `harvest_value` decimal(10,2) NOT NULL COMMENT '收获产值/元', | ||
| 618 | + PRIMARY KEY (`id`), | ||
| 619 | + KEY `harvest_id` (`harvest_id`), | ||
| 620 | + CONSTRAINT `afms_revenue_harvest_detail_ibfk_1` FOREIGN KEY (`harvest_id`) REFERENCES `afms_revenue_harvest` (`id`) | ||
| 621 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='成本与收益- 收获模块明细'; | ||
| 622 | + | ||
| 623 | +/*Data for the table `afms_revenue_harvest_detail` */ | ||
| 624 | + | ||
| 625 | +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | ||
| 626 | +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
| 627 | +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | ||
| 628 | +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
lh-modules/lh-afms/pom.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| 5 | + <modelVersion>4.0.0</modelVersion> | ||
| 6 | + <parent> | ||
| 7 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 8 | + <artifactId>lh-modules</artifactId> | ||
| 9 | + <version>1.0-SNAPSHOT</version> | ||
| 10 | + </parent> | ||
| 11 | + | ||
| 12 | + <artifactId>lh-afms</artifactId> | ||
| 13 | + | ||
| 14 | + <properties> | ||
| 15 | + <maven.compiler.source>8</maven.compiler.source> | ||
| 16 | + <maven.compiler.target>8</maven.compiler.target> | ||
| 17 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| 18 | + </properties> | ||
| 19 | + | ||
| 20 | + <dependencies> | ||
| 21 | + <!-- 核心模块--> | ||
| 22 | + <dependency> | ||
| 23 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 24 | + <artifactId>ruoyi-framework</artifactId> | ||
| 25 | + </dependency> | ||
| 26 | + <!-- 代码生成模块--> | ||
| 27 | + <dependency> | ||
| 28 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 29 | + <artifactId>ruoyi-generator</artifactId> | ||
| 30 | + </dependency> | ||
| 31 | + <dependency> | ||
| 32 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 33 | + <artifactId>lh-jar-sys-service</artifactId> | ||
| 34 | + </dependency> | ||
| 35 | + <dependency> | ||
| 36 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 37 | + <artifactId>lh-common-swagger</artifactId> | ||
| 38 | + </dependency> | ||
| 39 | +<!-- <dependency>--> | ||
| 40 | +<!-- <groupId>com.zhonglai.luhui</groupId>--> | ||
| 41 | +<!-- <artifactId>ruoyi-common-security</artifactId>--> | ||
| 42 | +<!-- </dependency>--> | ||
| 43 | + <dependency> | ||
| 44 | + <groupId>org.aspectj</groupId> | ||
| 45 | + <artifactId>aspectjweaver</artifactId> | ||
| 46 | + </dependency> | ||
| 47 | + <dependency> | ||
| 48 | + <groupId>org.aspectj</groupId> | ||
| 49 | + <artifactId>aspectjrt</artifactId> | ||
| 50 | + </dependency> | ||
| 51 | + | ||
| 52 | + </dependencies> | ||
| 53 | +</project> |
| @@ -7,10 +7,13 @@ import org.springframework.context.annotation.ComponentScan; | @@ -7,10 +7,13 @@ import org.springframework.context.annotation.ComponentScan; | ||
| 7 | 7 | ||
| 8 | @ComponentScan(basePackages = { | 8 | @ComponentScan(basePackages = { |
| 9 | "com.ruoyi.common", | 9 | "com.ruoyi.common", |
| 10 | - "com.ruoyi.system", | ||
| 11 | "com.ruoyi.framework", | 10 | "com.ruoyi.framework", |
| 12 | - "com.zhonglai.luhui.afms.config", | ||
| 13 | - "com.zhonglai.luhui.afms.controller", | 11 | + "com.ruoyi.generator", |
| 12 | + "com.zhonglai.luhui.datasource", | ||
| 13 | + "com.zhonglai.luhui.dao", | ||
| 14 | + "com.zhonglai.luhui.sys", | ||
| 15 | + "com.zhonglai.luhui.redis", | ||
| 16 | + "com.zhonglai.luhui.afms", | ||
| 14 | }) | 17 | }) |
| 15 | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) | 18 | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) |
| 16 | public class LhAfmsApplication { | 19 | public class LhAfmsApplication { |
| @@ -39,7 +39,7 @@ public class SwaggerConfig { | @@ -39,7 +39,7 @@ public class SwaggerConfig { | ||
| 39 | // 用ApiInfoBuilder进行定制 | 39 | // 用ApiInfoBuilder进行定制 |
| 40 | return new ApiInfoBuilder() | 40 | return new ApiInfoBuilder() |
| 41 | // 设置标题 | 41 | // 设置标题 |
| 42 | - .title("标题:后台管理员端") | 42 | + .title("标题:养殖管理系统") |
| 43 | // 描述 | 43 | // 描述 |
| 44 | .description("描述:用于通过mqtt发送指令控制PC端操作") | 44 | .description("描述:用于通过mqtt发送指令控制PC端操作") |
| 45 | // 作者信息 | 45 | // 作者信息 |
| 1 | +package com.zhonglai.luhui.afms.controller.admin; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import javax.servlet.http.HttpServletResponse; | ||
| 5 | + | ||
| 6 | +import com.zhonglai.luhui.action.BaseController; | ||
| 7 | +import com.zhonglai.luhui.sys.utils.ExcelUtil; | ||
| 8 | +import io.swagger.annotations.Api; | ||
| 9 | +import io.swagger.annotations.ApiOperation; | ||
| 10 | +//import org.springframework.security.access.prepost.PreAuthorize; | ||
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 12 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 13 | +import org.springframework.web.bind.annotation.PostMapping; | ||
| 14 | +import org.springframework.web.bind.annotation.PutMapping; | ||
| 15 | +import org.springframework.web.bind.annotation.DeleteMapping; | ||
| 16 | +import org.springframework.web.bind.annotation.PathVariable; | ||
| 17 | +import org.springframework.web.bind.annotation.RequestBody; | ||
| 18 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 19 | +import org.springframework.web.bind.annotation.RestController; | ||
| 20 | +import com.ruoyi.common.annotation.Log; | ||
| 21 | +import com.ruoyi.common.core.domain.AjaxResult; | ||
| 22 | +import com.ruoyi.common.enums.BusinessType; | ||
| 23 | +import com.zhonglai.luhui.afms.domain.AfmsBasicAquatic; | ||
| 24 | +import com.zhonglai.luhui.afms.service.IAfmsBasicAquaticService; | ||
| 25 | +import com.ruoyi.common.core.page.TableDataInfo; | ||
| 26 | + | ||
| 27 | +/** | ||
| 28 | + * 基础信息管理-动保信息管理Controller | ||
| 29 | + * | ||
| 30 | + * @author 钟来 | ||
| 31 | + * @date 2023-05-19 | ||
| 32 | + */ | ||
| 33 | +@Api(tags = "基础信息管理-动保信息管理") | ||
| 34 | +@RestController | ||
| 35 | +@RequestMapping("/admin/afms/AfmsBasicAquatic") | ||
| 36 | +public class AfmsBasicAquaticController extends BaseController | ||
| 37 | +{ | ||
| 38 | + @Autowired | ||
| 39 | + private IAfmsBasicAquaticService afmsBasicAquaticService; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 查询基础信息管理-动保信息管理列表 | ||
| 43 | + */ | ||
| 44 | + @ApiOperation("查询基础信息管理-动保信息管理列表") | ||
| 45 | +// @PreAuthorize("@ss.hasPermi('afms:AfmsBasicAquatic:list')") | ||
| 46 | + @GetMapping("/list") | ||
| 47 | + public TableDataInfo list(AfmsBasicAquatic afmsBasicAquatic) | ||
| 48 | + { | ||
| 49 | + startPage(); | ||
| 50 | + List<AfmsBasicAquatic> list = afmsBasicAquaticService.selectAfmsBasicAquaticList(afmsBasicAquatic); | ||
| 51 | + return getDataTable(list); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 导出基础信息管理-动保信息管理列表 | ||
| 56 | + */ | ||
| 57 | + @ApiOperation("导出基础信息管理-动保信息管理列表") | ||
| 58 | +// @PreAuthorize("@ss.hasPermi('afms:AfmsBasicAquatic:export')") | ||
| 59 | + @Log(title = "基础信息管理-动保信息管理", businessType = BusinessType.EXPORT) | ||
| 60 | + @PostMapping("/export") | ||
| 61 | + public void export(HttpServletResponse response, AfmsBasicAquatic afmsBasicAquatic) | ||
| 62 | + { | ||
| 63 | + List<AfmsBasicAquatic> list = afmsBasicAquaticService.selectAfmsBasicAquaticList(afmsBasicAquatic); | ||
| 64 | + ExcelUtil<AfmsBasicAquatic> util = new ExcelUtil<AfmsBasicAquatic>(AfmsBasicAquatic.class); | ||
| 65 | + util.exportExcel(response, list, "基础信息管理-动保信息管理数据"); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + /** | ||
| 69 | + * 获取基础信息管理-动保信息管理详细信息 | ||
| 70 | + */ | ||
| 71 | + @ApiOperation("获取基础信息管理-动保信息管理详细信息") | ||
| 72 | +// @PreAuthorize("@ss.hasPermi('afms:AfmsBasicAquatic:query')") | ||
| 73 | + @GetMapping(value = "/{id}") | ||
| 74 | + public AjaxResult getInfo(@PathVariable("id") Integer id) | ||
| 75 | + { | ||
| 76 | + return AjaxResult.success(afmsBasicAquaticService.selectAfmsBasicAquaticById(id)); | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + /** | ||
| 80 | + * 新增基础信息管理-动保信息管理 | ||
| 81 | + */ | ||
| 82 | + @ApiOperation("新增基础信息管理-动保信息管理") | ||
| 83 | +// @PreAuthorize("@ss.hasPermi('afms:AfmsBasicAquatic:add')") | ||
| 84 | + @Log(title = "基础信息管理-动保信息管理", businessType = BusinessType.INSERT) | ||
| 85 | + @PostMapping | ||
| 86 | + public AjaxResult add(@RequestBody AfmsBasicAquatic afmsBasicAquatic) | ||
| 87 | + { | ||
| 88 | + return toAjax(afmsBasicAquaticService.insertAfmsBasicAquatic(afmsBasicAquatic)); | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + /** | ||
| 92 | + * 修改基础信息管理-动保信息管理 | ||
| 93 | + */ | ||
| 94 | + @ApiOperation("修改基础信息管理-动保信息管理") | ||
| 95 | +// @PreAuthorize("@ss.hasPermi('afms:AfmsBasicAquatic:edit')") | ||
| 96 | + @Log(title = "基础信息管理-动保信息管理", businessType = BusinessType.UPDATE) | ||
| 97 | + @PutMapping | ||
| 98 | + public AjaxResult edit(@RequestBody AfmsBasicAquatic afmsBasicAquatic) | ||
| 99 | + { | ||
| 100 | + return toAjax(afmsBasicAquaticService.updateAfmsBasicAquatic(afmsBasicAquatic)); | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + /** | ||
| 104 | + * 删除基础信息管理-动保信息管理 | ||
| 105 | + */ | ||
| 106 | + @ApiOperation("删除基础信息管理-动保信息管理") | ||
| 107 | +// @PreAuthorize("@ss.hasPermi('afms:AfmsBasicAquatic:remove')") | ||
| 108 | + @Log(title = "基础信息管理-动保信息管理", businessType = BusinessType.DELETE) | ||
| 109 | + @DeleteMapping("/{ids}") | ||
| 110 | + public AjaxResult remove(@PathVariable Integer[] ids) | ||
| 111 | + { | ||
| 112 | + return toAjax(afmsBasicAquaticService.deleteAfmsBasicAquaticByIds(ids)); | ||
| 113 | + } | ||
| 114 | +} |
| 1 | +package com.zhonglai.luhui.afms.domain; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.common.annotation.Excel; | ||
| 4 | +import com.ruoyi.common.tool.BaseEntity; | ||
| 5 | +import io.swagger.annotations.ApiModel; | ||
| 6 | +import io.swagger.annotations.ApiModelProperty; | ||
| 7 | +import com.ruoyi.common.annotation.PublicSQLConfig; | ||
| 8 | +import org.apache.commons.lang3.builder.ToStringBuilder; | ||
| 9 | +import org.apache.commons.lang3.builder.ToStringStyle; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 基础信息管理-动保信息管理对象 afms_basic_aquatic | ||
| 13 | + * | ||
| 14 | + * @author 钟来 | ||
| 15 | + * @date 2023-05-19 | ||
| 16 | + */ | ||
| 17 | +@ApiModel("基础信息管理-动保信息管理") | ||
| 18 | +public class AfmsBasicAquatic extends BaseEntity | ||
| 19 | +{ | ||
| 20 | + @PublicSQLConfig(isSelect=false) | ||
| 21 | + private static final long serialVersionUID = 1L; | ||
| 22 | + | ||
| 23 | + /** */ | ||
| 24 | + @ApiModelProperty("") | ||
| 25 | + private Integer id; | ||
| 26 | + | ||
| 27 | + /** 动保名称 */ | ||
| 28 | + @ApiModelProperty("动保名称") | ||
| 29 | + private String name; | ||
| 30 | + | ||
| 31 | + /** 类别 */ | ||
| 32 | + @ApiModelProperty("类别") | ||
| 33 | + private String category; | ||
| 34 | + | ||
| 35 | + /** 品牌 */ | ||
| 36 | + @ApiModelProperty("品牌") | ||
| 37 | + private String brand; | ||
| 38 | + | ||
| 39 | + /** 计量单位ID */ | ||
| 40 | + @ApiModelProperty("计量单位ID") | ||
| 41 | + private Integer measurement_unit_id; | ||
| 42 | + | ||
| 43 | + /** 规格单位 */ | ||
| 44 | + @ApiModelProperty("规格单位") | ||
| 45 | + private String specification_unit; | ||
| 46 | + | ||
| 47 | + /** 供应商 */ | ||
| 48 | + @ApiModelProperty("供应商") | ||
| 49 | + private String supplier; | ||
| 50 | + | ||
| 51 | + /** 创建时间 */ | ||
| 52 | + @ApiModelProperty("创建时间") | ||
| 53 | + private java.util.Date create_time; | ||
| 54 | + | ||
| 55 | + /** 供应商ID */ | ||
| 56 | + @ApiModelProperty("供应商ID") | ||
| 57 | + private Integer supplier_id; | ||
| 58 | + | ||
| 59 | + public void setId(Integer id) | ||
| 60 | + { | ||
| 61 | + this.id = id; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + public Integer getId() | ||
| 65 | + { | ||
| 66 | + return id; | ||
| 67 | + } | ||
| 68 | + public void setName(String name) | ||
| 69 | + { | ||
| 70 | + this.name = name; | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + public String getName() | ||
| 74 | + { | ||
| 75 | + return name; | ||
| 76 | + } | ||
| 77 | + public void setCategory(String category) | ||
| 78 | + { | ||
| 79 | + this.category = category; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + public String getCategory() | ||
| 83 | + { | ||
| 84 | + return category; | ||
| 85 | + } | ||
| 86 | + public void setBrand(String brand) | ||
| 87 | + { | ||
| 88 | + this.brand = brand; | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + public String getBrand() | ||
| 92 | + { | ||
| 93 | + return brand; | ||
| 94 | + } | ||
| 95 | + public void setMeasurement_unit_id(Integer measurement_unit_id) | ||
| 96 | + { | ||
| 97 | + this.measurement_unit_id = measurement_unit_id; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + public Integer getMeasurement_unit_id() | ||
| 101 | + { | ||
| 102 | + return measurement_unit_id; | ||
| 103 | + } | ||
| 104 | + public void setSpecification_unit(String specification_unit) | ||
| 105 | + { | ||
| 106 | + this.specification_unit = specification_unit; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + public String getSpecification_unit() | ||
| 110 | + { | ||
| 111 | + return specification_unit; | ||
| 112 | + } | ||
| 113 | + public void setSupplier(String supplier) | ||
| 114 | + { | ||
| 115 | + this.supplier = supplier; | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + public String getSupplier() | ||
| 119 | + { | ||
| 120 | + return supplier; | ||
| 121 | + } | ||
| 122 | + public void setCreate_time(java.util.Date create_time) | ||
| 123 | + { | ||
| 124 | + this.create_time = create_time; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + public java.util.Date getCreate_time() | ||
| 128 | + { | ||
| 129 | + return create_time; | ||
| 130 | + } | ||
| 131 | + public void setSupplier_id(Integer supplier_id) | ||
| 132 | + { | ||
| 133 | + this.supplier_id = supplier_id; | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + public Integer getSupplier_id() | ||
| 137 | + { | ||
| 138 | + return supplier_id; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + @Override | ||
| 142 | + public String toString() { | ||
| 143 | + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) | ||
| 144 | + .append("id", getId()) | ||
| 145 | + .append("name", getName()) | ||
| 146 | + .append("category", getCategory()) | ||
| 147 | + .append("brand", getBrand()) | ||
| 148 | + .append("measurement_unit_id", getMeasurement_unit_id()) | ||
| 149 | + .append("specification_unit", getSpecification_unit()) | ||
| 150 | + .append("supplier", getSupplier()) | ||
| 151 | + .append("create_time", getCreate_time()) | ||
| 152 | + .append("supplier_id", getSupplier_id()) | ||
| 153 | + .toString(); | ||
| 154 | + } | ||
| 155 | +} |
lh-modules/lh-afms/src/main/java/com/zhonglai/luhui/afms/mapper/AfmsBasicAquaticMapper.java
0 → 100644
| 1 | +package com.zhonglai.luhui.afms.mapper; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import com.zhonglai.luhui.afms.domain.AfmsBasicAquatic; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 基础信息管理-动保信息管理Mapper接口 | ||
| 8 | + * | ||
| 9 | + * @author 钟来 | ||
| 10 | + * @date 2023-05-19 | ||
| 11 | + */ | ||
| 12 | +public interface AfmsBasicAquaticMapper | ||
| 13 | +{ | ||
| 14 | + /** | ||
| 15 | + * 查询基础信息管理-动保信息管理 | ||
| 16 | + * | ||
| 17 | + * @param id 基础信息管理-动保信息管理主键 | ||
| 18 | + * @return 基础信息管理-动保信息管理 | ||
| 19 | + */ | ||
| 20 | + public AfmsBasicAquatic selectAfmsBasicAquaticById(Integer id); | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 查询基础信息管理-动保信息管理列表 | ||
| 24 | + * | ||
| 25 | + * @param afmsBasicAquatic 基础信息管理-动保信息管理 | ||
| 26 | + * @return 基础信息管理-动保信息管理集合 | ||
| 27 | + */ | ||
| 28 | + public List<AfmsBasicAquatic> selectAfmsBasicAquaticList(AfmsBasicAquatic afmsBasicAquatic); | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 新增基础信息管理-动保信息管理 | ||
| 32 | + * | ||
| 33 | + * @param afmsBasicAquatic 基础信息管理-动保信息管理 | ||
| 34 | + * @return 结果 | ||
| 35 | + */ | ||
| 36 | + public int insertAfmsBasicAquatic(AfmsBasicAquatic afmsBasicAquatic); | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 修改基础信息管理-动保信息管理 | ||
| 40 | + * | ||
| 41 | + * @param afmsBasicAquatic 基础信息管理-动保信息管理 | ||
| 42 | + * @return 结果 | ||
| 43 | + */ | ||
| 44 | + public int updateAfmsBasicAquatic(AfmsBasicAquatic afmsBasicAquatic); | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 删除基础信息管理-动保信息管理 | ||
| 48 | + * | ||
| 49 | + * @param id 基础信息管理-动保信息管理主键 | ||
| 50 | + * @return 结果 | ||
| 51 | + */ | ||
| 52 | + public int deleteAfmsBasicAquaticById(Integer id); | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 批量删除基础信息管理-动保信息管理 | ||
| 56 | + * | ||
| 57 | + * @param ids 需要删除的数据主键集合 | ||
| 58 | + * @return 结果 | ||
| 59 | + */ | ||
| 60 | + public int deleteAfmsBasicAquaticByIds(Integer[] ids); | ||
| 61 | +} |
lh-modules/lh-afms/src/main/java/com/zhonglai/luhui/afms/service/AfmsDetailsServiceImpl.java
0 → 100644
| 1 | +//package com.zhonglai.luhui.afms.service; | ||
| 2 | +// | ||
| 3 | +//import com.zhonglai.luhui.dao.service.PublicService; | ||
| 4 | +//import org.slf4j.Logger; | ||
| 5 | +//import org.slf4j.LoggerFactory; | ||
| 6 | +//import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +//import org.springframework.security.core.userdetails.UserDetails; | ||
| 8 | +//import org.springframework.security.core.userdetails.UserDetailsService; | ||
| 9 | +//import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| 10 | +// | ||
| 11 | +//public class AfmsDetailsServiceImpl implements UserDetailsService { | ||
| 12 | +// private static final Logger log = LoggerFactory.getLogger(AfmsDetailsServiceImpl.class); | ||
| 13 | +// @Autowired | ||
| 14 | +// private PublicService publicService; | ||
| 15 | +// @Override | ||
| 16 | +// public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { | ||
| 17 | +// return null; | ||
| 18 | +// } | ||
| 19 | +//} |
lh-modules/lh-afms/src/main/java/com/zhonglai/luhui/afms/service/IAfmsBasicAquaticService.java
0 → 100644
| 1 | +package com.zhonglai.luhui.afms.service; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import com.zhonglai.luhui.afms.domain.AfmsBasicAquatic; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 基础信息管理-动保信息管理Service接口 | ||
| 8 | + * | ||
| 9 | + * @author 钟来 | ||
| 10 | + * @date 2023-05-19 | ||
| 11 | + */ | ||
| 12 | +public interface IAfmsBasicAquaticService | ||
| 13 | +{ | ||
| 14 | + /** | ||
| 15 | + * 查询基础信息管理-动保信息管理 | ||
| 16 | + * | ||
| 17 | + * @param id 基础信息管理-动保信息管理主键 | ||
| 18 | + * @return 基础信息管理-动保信息管理 | ||
| 19 | + */ | ||
| 20 | + public AfmsBasicAquatic selectAfmsBasicAquaticById(Integer id); | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 查询基础信息管理-动保信息管理列表 | ||
| 24 | + * | ||
| 25 | + * @param afmsBasicAquatic 基础信息管理-动保信息管理 | ||
| 26 | + * @return 基础信息管理-动保信息管理集合 | ||
| 27 | + */ | ||
| 28 | + public List<AfmsBasicAquatic> selectAfmsBasicAquaticList(AfmsBasicAquatic afmsBasicAquatic); | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 新增基础信息管理-动保信息管理 | ||
| 32 | + * | ||
| 33 | + * @param afmsBasicAquatic 基础信息管理-动保信息管理 | ||
| 34 | + * @return 结果 | ||
| 35 | + */ | ||
| 36 | + public int insertAfmsBasicAquatic(AfmsBasicAquatic afmsBasicAquatic); | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 修改基础信息管理-动保信息管理 | ||
| 40 | + * | ||
| 41 | + * @param afmsBasicAquatic 基础信息管理-动保信息管理 | ||
| 42 | + * @return 结果 | ||
| 43 | + */ | ||
| 44 | + public int updateAfmsBasicAquatic(AfmsBasicAquatic afmsBasicAquatic); | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 批量删除基础信息管理-动保信息管理 | ||
| 48 | + * | ||
| 49 | + * @param ids 需要删除的基础信息管理-动保信息管理主键集合 | ||
| 50 | + * @return 结果 | ||
| 51 | + */ | ||
| 52 | + public int deleteAfmsBasicAquaticByIds(Integer[] ids); | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 删除基础信息管理-动保信息管理信息 | ||
| 56 | + * | ||
| 57 | + * @param id 基础信息管理-动保信息管理主键 | ||
| 58 | + * @return 结果 | ||
| 59 | + */ | ||
| 60 | + public int deleteAfmsBasicAquaticById(Integer id); | ||
| 61 | +} |
| 1 | +package com.zhonglai.luhui.afms.service.impl; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 5 | +import org.springframework.stereotype.Service; | ||
| 6 | +import com.zhonglai.luhui.afms.mapper.AfmsBasicAquaticMapper; | ||
| 7 | +import com.zhonglai.luhui.afms.domain.AfmsBasicAquatic; | ||
| 8 | +import com.zhonglai.luhui.afms.service.IAfmsBasicAquaticService; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 基础信息管理-动保信息管理Service业务层处理 | ||
| 12 | + * | ||
| 13 | + * @author 钟来 | ||
| 14 | + * @date 2023-05-19 | ||
| 15 | + */ | ||
| 16 | +@Service | ||
| 17 | +public class AfmsBasicAquaticServiceImpl implements IAfmsBasicAquaticService | ||
| 18 | +{ | ||
| 19 | + @Autowired | ||
| 20 | + private AfmsBasicAquaticMapper afmsBasicAquaticMapper; | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 查询基础信息管理-动保信息管理 | ||
| 24 | + * | ||
| 25 | + * @param id 基础信息管理-动保信息管理主键 | ||
| 26 | + * @return 基础信息管理-动保信息管理 | ||
| 27 | + */ | ||
| 28 | + @Override | ||
| 29 | + public AfmsBasicAquatic selectAfmsBasicAquaticById(Integer id) | ||
| 30 | + { | ||
| 31 | + return afmsBasicAquaticMapper.selectAfmsBasicAquaticById(id); | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * 查询基础信息管理-动保信息管理列表 | ||
| 36 | + * | ||
| 37 | + * @param afmsBasicAquatic 基础信息管理-动保信息管理 | ||
| 38 | + * @return 基础信息管理-动保信息管理 | ||
| 39 | + */ | ||
| 40 | + @Override | ||
| 41 | + public List<AfmsBasicAquatic> selectAfmsBasicAquaticList(AfmsBasicAquatic afmsBasicAquatic) | ||
| 42 | + { | ||
| 43 | + return afmsBasicAquaticMapper.selectAfmsBasicAquaticList(afmsBasicAquatic); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 新增基础信息管理-动保信息管理 | ||
| 48 | + * | ||
| 49 | + * @param afmsBasicAquatic 基础信息管理-动保信息管理 | ||
| 50 | + * @return 结果 | ||
| 51 | + */ | ||
| 52 | + @Override | ||
| 53 | + public int insertAfmsBasicAquatic(AfmsBasicAquatic afmsBasicAquatic) | ||
| 54 | + { | ||
| 55 | + return afmsBasicAquaticMapper.insertAfmsBasicAquatic(afmsBasicAquatic); | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * 修改基础信息管理-动保信息管理 | ||
| 60 | + * | ||
| 61 | + * @param afmsBasicAquatic 基础信息管理-动保信息管理 | ||
| 62 | + * @return 结果 | ||
| 63 | + */ | ||
| 64 | + @Override | ||
| 65 | + public int updateAfmsBasicAquatic(AfmsBasicAquatic afmsBasicAquatic) | ||
| 66 | + { | ||
| 67 | + return afmsBasicAquaticMapper.updateAfmsBasicAquatic(afmsBasicAquatic); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + /** | ||
| 71 | + * 批量删除基础信息管理-动保信息管理 | ||
| 72 | + * | ||
| 73 | + * @param ids 需要删除的基础信息管理-动保信息管理主键 | ||
| 74 | + * @return 结果 | ||
| 75 | + */ | ||
| 76 | + @Override | ||
| 77 | + public int deleteAfmsBasicAquaticByIds(Integer[] ids) | ||
| 78 | + { | ||
| 79 | + return afmsBasicAquaticMapper.deleteAfmsBasicAquaticByIds(ids); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + /** | ||
| 83 | + * 删除基础信息管理-动保信息管理信息 | ||
| 84 | + * | ||
| 85 | + * @param id 基础信息管理-动保信息管理主键 | ||
| 86 | + * @return 结果 | ||
| 87 | + */ | ||
| 88 | + @Override | ||
| 89 | + public int deleteAfmsBasicAquaticById(Integer id) | ||
| 90 | + { | ||
| 91 | + return afmsBasicAquaticMapper.deleteAfmsBasicAquaticById(id); | ||
| 92 | + } | ||
| 93 | +} |
| @@ -6,16 +6,16 @@ spring: | @@ -6,16 +6,16 @@ spring: | ||
| 6 | druid: | 6 | druid: |
| 7 | # 主库数据源 | 7 | # 主库数据源 |
| 8 | master: | 8 | master: |
| 9 | - url: jdbc:mysql://119.23.218.181:3306/lh-afms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | ||
| 10 | - username: root | 9 | + url: jdbc:mysql://rm-wz9740un21f09iokuao.mysql.rds.aliyuncs.com:3306/mqtt_broker?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| 10 | + username: luhui | ||
| 11 | password: Luhui586 | 11 | password: Luhui586 |
| 12 | # 从库数据源 | 12 | # 从库数据源 |
| 13 | slave: | 13 | slave: |
| 14 | # 从数据源开关/默认关闭 | 14 | # 从数据源开关/默认关闭 |
| 15 | - enabled: false | ||
| 16 | - url: | ||
| 17 | - username: | ||
| 18 | - password: | 15 | + enabled: true |
| 16 | + url: jdbc:mysql://119.23.218.181:3306/lh-afms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | ||
| 17 | + username: luhui | ||
| 18 | + password: Luhui586 | ||
| 19 | # 初始连接数 | 19 | # 初始连接数 |
| 20 | initialSize: 5 | 20 | initialSize: 5 |
| 21 | # 最小连接池数量 | 21 | # 最小连接池数量 |
| 1 | +# 项目相关配置 jhlt: # 名称 name: zhonglai # 版本 version: 3.8.2 # 版权年份 copyrightYear: 2022 # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数组计算 char 字符验证 captchaType: math # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 port: 8060 servlet: # 应用的访问路径 context-path: / tomcat: # tomcat的URI编码 uri-encoding: UTF-8 # 连接数满后的排队数,默认为100 accept-count: 1000 threads: # tomcat最大线程数,默认为200 max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 # 日志配置 logging: level: com.ruoyi: debug org.springframework: warn # Spring配置 spring: # 资源信息 messages: # 国际化资源文件路径 basename: i18n/messages profiles: active: druid # 文件上传 servlet: multipart: # 单个文件大小 max-file-size: 10MB # 设置总上传的文件大小 max-request-size: 20MB # 服务模块 devtools: restart: # 热部署开关 enabled: true # redis 配置 redis: # 地址 host: 47.112.163.61 # 端口,默认为6379 port: 9527 # 数据库索引 database: 1 # 密码 password: Luhui586 # 连接超时时间 timeout: 10s lettuce: pool: # 连接池中的最小空闲连接 min-idle: 0 # 连接池中的最大空闲连接 max-idle: 8 # 连接池的最大数据库连接数 max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # token配置 token: # 令牌自定义标识 header: Authorization # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) expireTime: 1440 rediskey: lh-afms # MyBatis配置 mybatis: # 搜索指定包别名 typeAliasesPackage: com.ruoyi.**.domain # 配置mapper的扫描,找到所有的mapper.xml映射文件 mapperLocations: classpath*:mapper/**/*Mapper.xml # 加载全局的配置文件 configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 pagehelper: helperDialect: mysql supportMethodsArguments: true params: count=countSql # Swagger配置 swagger: # 是否开启swagger enabled: true # 请求前缀 pathMapping: /dev-api # 防止XSS攻击 xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* sys: ## // 对于登录login 注册register 验证码captchaImage 允许匿名访问 antMatchers: /tool/gen/* |
| 1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | +<!DOCTYPE mapper | ||
| 3 | +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | +<mapper namespace="com.zhonglai.luhui.afms.mapper.AfmsBasicAquaticMapper"> | ||
| 6 | + | ||
| 7 | + <resultMap type="AfmsBasicAquatic" id="AfmsBasicAquaticResult"> | ||
| 8 | + <result property="id" column="id" /> | ||
| 9 | + <result property="name" column="name" /> | ||
| 10 | + <result property="category" column="category" /> | ||
| 11 | + <result property="brand" column="brand" /> | ||
| 12 | + <result property="measurement_unit_id" column="measurement_unit_id" /> | ||
| 13 | + <result property="specification_unit" column="specification_unit" /> | ||
| 14 | + <result property="supplier" column="supplier" /> | ||
| 15 | + <result property="create_time" column="create_time" /> | ||
| 16 | + <result property="supplier_id" column="supplier_id" /> | ||
| 17 | + </resultMap> | ||
| 18 | + | ||
| 19 | + <sql id="selectAfmsBasicAquaticVo"> | ||
| 20 | + select `id`, `name`, `category`, `brand`, `measurement_unit_id`, `specification_unit`, `supplier`, `create_time`, `supplier_id` from afms_basic_aquatic | ||
| 21 | + </sql> | ||
| 22 | + | ||
| 23 | + <select id="selectAfmsBasicAquaticList" parameterType="AfmsBasicAquatic" resultMap="AfmsBasicAquaticResult"> | ||
| 24 | + <include refid="selectAfmsBasicAquaticVo"/> | ||
| 25 | + <where> | ||
| 26 | + </where> | ||
| 27 | + </select> | ||
| 28 | + | ||
| 29 | + <select id="selectAfmsBasicAquaticById" parameterType="Integer" resultMap="AfmsBasicAquaticResult"> | ||
| 30 | + <include refid="selectAfmsBasicAquaticVo"/> | ||
| 31 | + where id = #{id} | ||
| 32 | + </select> | ||
| 33 | + | ||
| 34 | + <insert id="insertAfmsBasicAquatic" parameterType="AfmsBasicAquatic" useGeneratedKeys="true" keyProperty="id"> | ||
| 35 | + insert into afms_basic_aquatic | ||
| 36 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
| 37 | + <if test="name != null and name != ''">name,</if> | ||
| 38 | + <if test="category != null and category != ''">category,</if> | ||
| 39 | + <if test="brand != null and brand != ''">brand,</if> | ||
| 40 | + <if test="measurement_unit_id != null">measurement_unit_id,</if> | ||
| 41 | + <if test="specification_unit != null and specification_unit != ''">specification_unit,</if> | ||
| 42 | + <if test="supplier != null and supplier != ''">supplier,</if> | ||
| 43 | + <if test="create_time != null">create_time,</if> | ||
| 44 | + <if test="supplier_id != null">supplier_id,</if> | ||
| 45 | + </trim> | ||
| 46 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
| 47 | + <if test="name != null and name != ''">#{name},</if> | ||
| 48 | + <if test="category != null and category != ''">#{category},</if> | ||
| 49 | + <if test="brand != null and brand != ''">#{brand},</if> | ||
| 50 | + <if test="measurement_unit_id != null">#{measurement_unit_id},</if> | ||
| 51 | + <if test="specification_unit != null and specification_unit != ''">#{specification_unit},</if> | ||
| 52 | + <if test="supplier != null and supplier != ''">#{supplier},</if> | ||
| 53 | + <if test="create_time != null">#{create_time},</if> | ||
| 54 | + <if test="supplier_id != null">#{supplier_id},</if> | ||
| 55 | + </trim> | ||
| 56 | + </insert> | ||
| 57 | + | ||
| 58 | + <update id="updateAfmsBasicAquatic" parameterType="AfmsBasicAquatic"> | ||
| 59 | + update afms_basic_aquatic | ||
| 60 | + <trim prefix="SET" suffixOverrides=","> | ||
| 61 | + <if test="name != null and name != ''">name = #{name},</if> | ||
| 62 | + <if test="category != null and category != ''">category = #{category},</if> | ||
| 63 | + <if test="brand != null and brand != ''">brand = #{brand},</if> | ||
| 64 | + <if test="measurement_unit_id != null">measurement_unit_id = #{measurement_unit_id},</if> | ||
| 65 | + <if test="specification_unit != null and specification_unit != ''">specification_unit = #{specification_unit},</if> | ||
| 66 | + <if test="supplier != null and supplier != ''">supplier = #{supplier},</if> | ||
| 67 | + <if test="create_time != null">create_time = #{create_time},</if> | ||
| 68 | + <if test="supplier_id != null">supplier_id = #{supplier_id},</if> | ||
| 69 | + </trim> | ||
| 70 | + where id = #{id} | ||
| 71 | + </update> | ||
| 72 | + | ||
| 73 | + <delete id="deleteAfmsBasicAquaticById" parameterType="Integer"> | ||
| 74 | + delete from afms_basic_aquatic where id = #{id} | ||
| 75 | + </delete> | ||
| 76 | + | ||
| 77 | + <delete id="deleteAfmsBasicAquaticByIds" parameterType="String"> | ||
| 78 | + delete from afms_basic_aquatic where id in | ||
| 79 | + <foreach item="id" collection="array" open="(" separator="," close=")"> | ||
| 80 | + #{id} | ||
| 81 | + </foreach> | ||
| 82 | + </delete> | ||
| 83 | +</mapper> |
| @@ -8,22 +8,24 @@ | @@ -8,22 +8,24 @@ | ||
| 8 | <artifactId>Luhui</artifactId> | 8 | <artifactId>Luhui</artifactId> |
| 9 | <version>1.0-SNAPSHOT</version> | 9 | <version>1.0-SNAPSHOT</version> |
| 10 | <modules> | 10 | <modules> |
| 11 | - <module>ruoyi-system</module> | ||
| 12 | - <module>ruoyi-generator</module> | ||
| 13 | <module>ruoyi-framework</module> | 11 | <module>ruoyi-framework</module> |
| 14 | - <module>ruoyi-common</module> | ||
| 15 | <module>lh-admin</module> | 12 | <module>lh-admin</module> |
| 16 | <module>lh-mqtt-service</module> | 13 | <module>lh-mqtt-service</module> |
| 17 | - <module>lh-domain</module> | ||
| 18 | <module>lh-api</module> | 14 | <module>lh-api</module> |
| 19 | <module>lh-central-control</module> | 15 | <module>lh-central-control</module> |
| 20 | <module>lh-backups</module> | 16 | <module>lh-backups</module> |
| 21 | <module>lh-alarm</module> | 17 | <module>lh-alarm</module> |
| 22 | - <module>lh-openai</module> | ||
| 23 | <module>lh-log</module> | 18 | <module>lh-log</module> |
| 24 | - <module>lh-quartz</module> | ||
| 25 | <module>lh-chatgpt-api</module> | 19 | <module>lh-chatgpt-api</module> |
| 26 | - <module>lh-afms</module> | 20 | + <module>lh-common</module> |
| 21 | + <module>lh-jar</module> | ||
| 22 | + <module>lh-jar/lh-jar-sys-service</module> | ||
| 23 | + <module>lh-modules</module> | ||
| 24 | + <module>lh-common/lh-common-swagger</module> | ||
| 25 | + <module>lh-common/lh-common-firewall</module> | ||
| 26 | + <module>lh-jar/lh-jar-action</module> | ||
| 27 | + <module>lh-jar/lh-jar-chatgpt</module> | ||
| 28 | + <module>lh-jar/lh-jar-rocketmq</module> | ||
| 27 | </modules> | 29 | </modules> |
| 28 | 30 | ||
| 29 | <packaging>pom</packaging> | 31 | <packaging>pom</packaging> |
| @@ -53,7 +55,7 @@ | @@ -53,7 +55,7 @@ | ||
| 53 | <lombok.version>1.18.12</lombok.version> | 55 | <lombok.version>1.18.12</lombok.version> |
| 54 | <commons-text.version>1.8</commons-text.version> | 56 | <commons-text.version>1.8</commons-text.version> |
| 55 | <zxing.version>3.4.0</zxing.version> | 57 | <zxing.version>3.4.0</zxing.version> |
| 56 | - <okhttp.version>3.3.1</okhttp.version> | 58 | + <okhttp.version>3.14.9</okhttp.version> |
| 57 | <tkmapper.version>4.2.1</tkmapper.version> | 59 | <tkmapper.version>4.2.1</tkmapper.version> |
| 58 | <shiro.version>1.10.1</shiro.version> | 60 | <shiro.version>1.10.1</shiro.version> |
| 59 | </properties> | 61 | </properties> |
| @@ -239,6 +241,85 @@ | @@ -239,6 +241,85 @@ | ||
| 239 | <version>${ruoyi.version}</version> | 241 | <version>${ruoyi.version}</version> |
| 240 | </dependency> | 242 | </dependency> |
| 241 | 243 | ||
| 244 | + <!-- poi --> | ||
| 245 | + <dependency> | ||
| 246 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 247 | + <artifactId>lh-common-poi</artifactId> | ||
| 248 | + <version>${ruoyi.version}</version> | ||
| 249 | + </dependency> | ||
| 250 | + | ||
| 251 | + | ||
| 252 | + <!-- 公用dao趁层 --> | ||
| 253 | + <dependency> | ||
| 254 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 255 | + <artifactId>lh-public-dao</artifactId> | ||
| 256 | + <version>${ruoyi.version}</version> | ||
| 257 | + </dependency> | ||
| 258 | + | ||
| 259 | + <!-- 数据连接 --> | ||
| 260 | + <dependency> | ||
| 261 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 262 | + <artifactId>lh-common-datasource</artifactId> | ||
| 263 | + <version>${ruoyi.version}</version> | ||
| 264 | + </dependency> | ||
| 265 | + | ||
| 266 | + <!-- 系统服务 --> | ||
| 267 | + <dependency> | ||
| 268 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 269 | + <artifactId>lh-jar-sys-service</artifactId> | ||
| 270 | + <version>${ruoyi.version}</version> | ||
| 271 | + </dependency> | ||
| 272 | + | ||
| 273 | + <!-- redis --> | ||
| 274 | + <dependency> | ||
| 275 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 276 | + <artifactId>ruoyi-common-redis</artifactId> | ||
| 277 | + <version>${ruoyi.version}</version> | ||
| 278 | + </dependency> | ||
| 279 | + | ||
| 280 | + | ||
| 281 | + <!-- rocketmq --> | ||
| 282 | + <dependency> | ||
| 283 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 284 | + <artifactId>lh-jar-rocketmq</artifactId> | ||
| 285 | + <version>${ruoyi.version}</version> | ||
| 286 | + </dependency> | ||
| 287 | + | ||
| 288 | + <!-- 权限 --> | ||
| 289 | + <dependency> | ||
| 290 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 291 | + <artifactId>ruoyi-common-security</artifactId> | ||
| 292 | + <version>${ruoyi.version}</version> | ||
| 293 | + </dependency> | ||
| 294 | + | ||
| 295 | + <!-- 文档 --> | ||
| 296 | + <dependency> | ||
| 297 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 298 | + <artifactId>lh-common-swagger</artifactId> | ||
| 299 | + <version>${ruoyi.version}</version> | ||
| 300 | + </dependency> | ||
| 301 | + | ||
| 302 | + <!-- 防火墙 --> | ||
| 303 | + <dependency> | ||
| 304 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 305 | + <artifactId>lh-common-firewall</artifactId> | ||
| 306 | + <version>${ruoyi.version}</version> | ||
| 307 | + </dependency> | ||
| 308 | + | ||
| 309 | + <!-- action --> | ||
| 310 | + <dependency> | ||
| 311 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 312 | + <artifactId>lh-jar-action</artifactId> | ||
| 313 | + <version>${ruoyi.version}</version> | ||
| 314 | + </dependency> | ||
| 315 | + | ||
| 316 | + <!-- chatgpt --> | ||
| 317 | + <dependency> | ||
| 318 | + <groupId>com.zhonglai.luhui</groupId> | ||
| 319 | + <artifactId>lh-jar-chatgpt</artifactId> | ||
| 320 | + <version>${ruoyi.version}</version> | ||
| 321 | + </dependency> | ||
| 322 | + | ||
| 242 | <!-- 支持data --> | 323 | <!-- 支持data --> |
| 243 | <dependency> | 324 | <dependency> |
| 244 | <groupId>org.projectlombok</groupId> | 325 | <groupId>org.projectlombok</groupId> |
| @@ -380,6 +461,12 @@ | @@ -380,6 +461,12 @@ | ||
| 380 | <artifactId>javax.mail</artifactId> | 461 | <artifactId>javax.mail</artifactId> |
| 381 | <version>1.6.2</version> | 462 | <version>1.6.2</version> |
| 382 | </dependency> | 463 | </dependency> |
| 464 | + | ||
| 465 | + <dependency> | ||
| 466 | + <groupId>com.unfbx</groupId> | ||
| 467 | + <artifactId>chatgpt-java</artifactId> | ||
| 468 | + <version>1.0.12</version> | ||
| 469 | + </dependency> | ||
| 383 | </dependencies> | 470 | </dependencies> |
| 384 | 471 | ||
| 385 | 472 |
ruoyi-common/pom.xml
已删除
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| 3 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| 4 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| 5 | - <parent> | ||
| 6 | - <artifactId>Luhui</artifactId> | ||
| 7 | - <groupId>com.zhonglai.luhui</groupId> | ||
| 8 | - <version>1.0-SNAPSHOT</version> | ||
| 9 | - </parent> | ||
| 10 | - <modelVersion>4.0.0</modelVersion> | ||
| 11 | - | ||
| 12 | - <artifactId>ruoyi-common</artifactId> | ||
| 13 | - | ||
| 14 | - <description> | ||
| 15 | - common通用工具 | ||
| 16 | - </description> | ||
| 17 | - | ||
| 18 | - <dependencies> | ||
| 19 | - | ||
| 20 | - <!-- 模型--> | ||
| 21 | - <dependency> | ||
| 22 | - <groupId>com.zhonglai.luhui</groupId> | ||
| 23 | - <artifactId>lh-domain</artifactId> | ||
| 24 | - </dependency> | ||
| 25 | - | ||
| 26 | - <!-- Spring框架基本的核心工具 --> | ||
| 27 | - <dependency> | ||
| 28 | - <groupId>org.springframework</groupId> | ||
| 29 | - <artifactId>spring-context-support</artifactId> | ||
| 30 | - </dependency> | ||
| 31 | - | ||
| 32 | - <!-- SpringWeb模块 --> | ||
| 33 | - <dependency> | ||
| 34 | - <groupId>org.springframework</groupId> | ||
| 35 | - <artifactId>spring-web</artifactId> | ||
| 36 | - </dependency> | ||
| 37 | - | ||
| 38 | - <!-- spring security 安全认证 --> | ||
| 39 | - <dependency> | ||
| 40 | - <groupId>org.springframework.boot</groupId> | ||
| 41 | - <artifactId>spring-boot-starter-security</artifactId> | ||
| 42 | - </dependency> | ||
| 43 | - | ||
| 44 | - <!-- pagehelper 分页插件 --> | ||
| 45 | - <dependency> | ||
| 46 | - <groupId>com.github.pagehelper</groupId> | ||
| 47 | - <artifactId>pagehelper-spring-boot-starter</artifactId> | ||
| 48 | - </dependency> | ||
| 49 | - | ||
| 50 | - <!-- 自定义验证注解 --> | ||
| 51 | - <dependency> | ||
| 52 | - <groupId>org.springframework.boot</groupId> | ||
| 53 | - <artifactId>spring-boot-starter-validation</artifactId> | ||
| 54 | - </dependency> | ||
| 55 | - | ||
| 56 | - <!--常用工具类 --> | ||
| 57 | - <dependency> | ||
| 58 | - <groupId>org.apache.commons</groupId> | ||
| 59 | - <artifactId>commons-lang3</artifactId> | ||
| 60 | - </dependency> | ||
| 61 | - | ||
| 62 | - <!-- JSON工具类 --> | ||
| 63 | - <dependency> | ||
| 64 | - <groupId>com.fasterxml.jackson.core</groupId> | ||
| 65 | - <artifactId>jackson-databind</artifactId> | ||
| 66 | - </dependency> | ||
| 67 | - | ||
| 68 | - <!-- 阿里JSON解析器 --> | ||
| 69 | - <dependency> | ||
| 70 | - <groupId>com.alibaba</groupId> | ||
| 71 | - <artifactId>fastjson</artifactId> | ||
| 72 | - </dependency> | ||
| 73 | - | ||
| 74 | - <!-- io常用工具类 --> | ||
| 75 | - <dependency> | ||
| 76 | - <groupId>commons-io</groupId> | ||
| 77 | - <artifactId>commons-io</artifactId> | ||
| 78 | - </dependency> | ||
| 79 | - | ||
| 80 | - <!-- 文件上传工具类 --> | ||
| 81 | - <dependency> | ||
| 82 | - <groupId>commons-fileupload</groupId> | ||
| 83 | - <artifactId>commons-fileupload</artifactId> | ||
| 84 | - </dependency> | ||
| 85 | - | ||
| 86 | - <!-- excel工具 --> | ||
| 87 | - <dependency> | ||
| 88 | - <groupId>org.apache.poi</groupId> | ||
| 89 | - <artifactId>poi-ooxml</artifactId> | ||
| 90 | - </dependency> | ||
| 91 | - | ||
| 92 | - <!-- yml解析器 --> | ||
| 93 | - <dependency> | ||
| 94 | - <groupId>org.yaml</groupId> | ||
| 95 | - <artifactId>snakeyaml</artifactId> | ||
| 96 | - </dependency> | ||
| 97 | - | ||
| 98 | - <!-- Token生成与解析--> | ||
| 99 | - <dependency> | ||
| 100 | - <groupId>io.jsonwebtoken</groupId> | ||
| 101 | - <artifactId>jjwt</artifactId> | ||
| 102 | - </dependency> | ||
| 103 | - | ||
| 104 | - <!-- Jaxb --> | ||
| 105 | - <dependency> | ||
| 106 | - <groupId>javax.xml.bind</groupId> | ||
| 107 | - <artifactId>jaxb-api</artifactId> | ||
| 108 | - </dependency> | ||
| 109 | - | ||
| 110 | - <!-- redis 缓存操作 --> | ||
| 111 | - <dependency> | ||
| 112 | - <groupId>org.springframework.boot</groupId> | ||
| 113 | - <artifactId>spring-boot-starter-data-redis</artifactId> | ||
| 114 | - <exclusions> | ||
| 115 | - <exclusion> | ||
| 116 | - <groupId>io.lettuce</groupId> | ||
| 117 | - <artifactId>lettuce-core</artifactId> | ||
| 118 | - </exclusion> | ||
| 119 | - </exclusions> | ||
| 120 | - </dependency> | ||
| 121 | - <dependency> | ||
| 122 | - <groupId>redis.clients</groupId> | ||
| 123 | - <artifactId>jedis</artifactId> | ||
| 124 | - </dependency> | ||
| 125 | - | ||
| 126 | - <!-- pool 对象池 --> | ||
| 127 | - <dependency> | ||
| 128 | - <groupId>org.apache.commons</groupId> | ||
| 129 | - <artifactId>commons-pool2</artifactId> | ||
| 130 | - </dependency> | ||
| 131 | - | ||
| 132 | - <!-- 解析客户端操作系统、浏览器等 --> | ||
| 133 | - <dependency> | ||
| 134 | - <groupId>eu.bitwalker</groupId> | ||
| 135 | - <artifactId>UserAgentUtils</artifactId> | ||
| 136 | - </dependency> | ||
| 137 | - | ||
| 138 | - <!-- servlet包 --> | ||
| 139 | - <dependency> | ||
| 140 | - <groupId>javax.servlet</groupId> | ||
| 141 | - <artifactId>javax.servlet-api</artifactId> | ||
| 142 | - </dependency> | ||
| 143 | - | ||
| 144 | - <dependency> | ||
| 145 | - <groupId>com.google.guava</groupId> | ||
| 146 | - <artifactId>guava</artifactId> | ||
| 147 | - <version>20.0</version> | ||
| 148 | - </dependency> | ||
| 149 | - | ||
| 150 | - <!-- 支持data --> | ||
| 151 | - <dependency> | ||
| 152 | - <groupId>org.projectlombok</groupId> | ||
| 153 | - <artifactId>lombok</artifactId> | ||
| 154 | - </dependency> | ||
| 155 | - | ||
| 156 | - <dependency> | ||
| 157 | - <groupId>org.apache.commons</groupId> | ||
| 158 | - <artifactId>commons-text</artifactId> | ||
| 159 | - </dependency> | ||
| 160 | - | ||
| 161 | - <dependency> | ||
| 162 | - <groupId>com.google.zxing</groupId> | ||
| 163 | - <artifactId>javase</artifactId> | ||
| 164 | - </dependency> | ||
| 165 | - <dependency> | ||
| 166 | - <groupId>com.google.zxing</groupId> | ||
| 167 | - <artifactId>core</artifactId> | ||
| 168 | - </dependency> | ||
| 169 | - | ||
| 170 | - <dependency> | ||
| 171 | - <groupId>com.squareup.okhttp3</groupId> | ||
| 172 | - <artifactId>okhttp</artifactId> | ||
| 173 | - </dependency> | ||
| 174 | - | ||
| 175 | - <!-- 自定义验证注解 --> | ||
| 176 | - <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation --> | ||
| 177 | - <dependency> | ||
| 178 | - <groupId>org.springframework.boot</groupId> | ||
| 179 | - <artifactId>spring-boot-starter-validation</artifactId> | ||
| 180 | - </dependency> | ||
| 181 | - | ||
| 182 | - <dependency> | ||
| 183 | - <groupId>org.jboss.logging</groupId> | ||
| 184 | - <artifactId>jboss-logging</artifactId> | ||
| 185 | - <version>3.4.3.Final</version> | ||
| 186 | - </dependency> | ||
| 187 | - <dependency> | ||
| 188 | - <groupId>jakarta.validation</groupId> | ||
| 189 | - <artifactId>jakarta.validation-api</artifactId> | ||
| 190 | - <version>2.0.2</version> | ||
| 191 | - </dependency> | ||
| 192 | - | ||
| 193 | - <dependency> | ||
| 194 | - <groupId>com.google.code.gson</groupId> | ||
| 195 | - <artifactId>gson</artifactId> | ||
| 196 | - </dependency> | ||
| 197 | - </dependencies> | ||
| 198 | -</project> |
| 1 | -package com.ruoyi.common.annotation; | ||
| 2 | - | ||
| 3 | -import java.lang.annotation.*; | ||
| 4 | - | ||
| 5 | -/** | ||
| 6 | - * 数据权限过滤注解 | ||
| 7 | - * | ||
| 8 | - * @author ruoyi | ||
| 9 | - */ | ||
| 10 | -@Target(ElementType.METHOD) | ||
| 11 | -@Retention(RetentionPolicy.RUNTIME) | ||
| 12 | -@Documented | ||
| 13 | -public @interface DataScope | ||
| 14 | -{ | ||
| 15 | - /** | ||
| 16 | - * 部门表的别名 | ||
| 17 | - */ | ||
| 18 | - public String deptAlias() default ""; | ||
| 19 | - | ||
| 20 | - /** | ||
| 21 | - * 用户表的别名 | ||
| 22 | - */ | ||
| 23 | - public String userAlias() default ""; | ||
| 24 | -} |
| 1 | -package com.ruoyi.common.annotation; | ||
| 2 | - | ||
| 3 | -import com.ruoyi.common.enums.DataSourceType; | ||
| 4 | - | ||
| 5 | -import java.lang.annotation.*; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * 自定义多数据源切换注解 | ||
| 9 | - * | ||
| 10 | - * 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准 | ||
| 11 | - * | ||
| 12 | - * @author ruoyi | ||
| 13 | - */ | ||
| 14 | -@Target({ ElementType.METHOD, ElementType.TYPE }) | ||
| 15 | -@Retention(RetentionPolicy.RUNTIME) | ||
| 16 | -@Documented | ||
| 17 | -@Inherited | ||
| 18 | -public @interface DataSource | ||
| 19 | -{ | ||
| 20 | - /** | ||
| 21 | - * 切换数据源名称 | ||
| 22 | - */ | ||
| 23 | - public DataSourceType value() default DataSourceType.MASTER; | ||
| 24 | -} |
| 1 | -package com.ruoyi.common.annotation; | ||
| 2 | - | ||
| 3 | -import com.ruoyi.common.utils.poi.ExcelHandlerAdapter; | ||
| 4 | - | ||
| 5 | -import java.lang.annotation.ElementType; | ||
| 6 | -import java.lang.annotation.Retention; | ||
| 7 | -import java.lang.annotation.RetentionPolicy; | ||
| 8 | -import java.lang.annotation.Target; | ||
| 9 | -import java.math.BigDecimal; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * 自定义导出Excel数据注解 | ||
| 13 | - * | ||
| 14 | - * @author ruoyi | ||
| 15 | - */ | ||
| 16 | -@Retention(RetentionPolicy.RUNTIME) | ||
| 17 | -@Target(ElementType.FIELD) | ||
| 18 | -public @interface Excel | ||
| 19 | -{ | ||
| 20 | - /** | ||
| 21 | - * 导出时在excel中排序 | ||
| 22 | - */ | ||
| 23 | - public int sort() default Integer.MAX_VALUE; | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 导出到Excel中的名字. | ||
| 27 | - */ | ||
| 28 | - public String name() default ""; | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 日期格式, 如: yyyy-MM-dd | ||
| 32 | - */ | ||
| 33 | - public String dateFormat() default ""; | ||
| 34 | - | ||
| 35 | - /** | ||
| 36 | - * 如果是字典类型,请设置字典的type值 (如: sys_user_sex) | ||
| 37 | - */ | ||
| 38 | - public String dictType() default ""; | ||
| 39 | - | ||
| 40 | - /** | ||
| 41 | - * 读取内容转表达式 (如: 0=男,1=女,2=未知) | ||
| 42 | - */ | ||
| 43 | - public String readConverterExp() default ""; | ||
| 44 | - | ||
| 45 | - /** | ||
| 46 | - * 分隔符,读取字符串组内容 | ||
| 47 | - */ | ||
| 48 | - public String separator() default ","; | ||
| 49 | - | ||
| 50 | - /** | ||
| 51 | - * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化) | ||
| 52 | - */ | ||
| 53 | - public int scale() default -1; | ||
| 54 | - | ||
| 55 | - /** | ||
| 56 | - * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN | ||
| 57 | - */ | ||
| 58 | - public int roundingMode() default BigDecimal.ROUND_HALF_EVEN; | ||
| 59 | - | ||
| 60 | - /** | ||
| 61 | - * 导出类型(0数字 1字符串) | ||
| 62 | - */ | ||
| 63 | - public ColumnType cellType() default ColumnType.STRING; | ||
| 64 | - | ||
| 65 | - /** | ||
| 66 | - * 导出时在excel中每个列的高度 单位为字符 | ||
| 67 | - */ | ||
| 68 | - public double height() default 14; | ||
| 69 | - | ||
| 70 | - /** | ||
| 71 | - * 导出时在excel中每个列的宽 单位为字符 | ||
| 72 | - */ | ||
| 73 | - public double width() default 16; | ||
| 74 | - | ||
| 75 | - /** | ||
| 76 | - * 文字后缀,如% 90 变成90% | ||
| 77 | - */ | ||
| 78 | - public String suffix() default ""; | ||
| 79 | - | ||
| 80 | - /** | ||
| 81 | - * 当值为空时,字段的默认值 | ||
| 82 | - */ | ||
| 83 | - public String defaultValue() default ""; | ||
| 84 | - | ||
| 85 | - /** | ||
| 86 | - * 提示信息 | ||
| 87 | - */ | ||
| 88 | - public String prompt() default ""; | ||
| 89 | - | ||
| 90 | - /** | ||
| 91 | - * 设置只能选择不能输入的列内容. | ||
| 92 | - */ | ||
| 93 | - public String[] combo() default {}; | ||
| 94 | - | ||
| 95 | - /** | ||
| 96 | - * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写. | ||
| 97 | - */ | ||
| 98 | - public boolean isExport() default true; | ||
| 99 | - | ||
| 100 | - /** | ||
| 101 | - * 另一个类中的属性名称,支持多级获取,以小数点隔开 | ||
| 102 | - */ | ||
| 103 | - public String targetAttr() default ""; | ||
| 104 | - | ||
| 105 | - /** | ||
| 106 | - * 是否自动统计数据,在最后追加一行统计数据总和 | ||
| 107 | - */ | ||
| 108 | - public boolean isStatistics() default false; | ||
| 109 | - | ||
| 110 | - /** | ||
| 111 | - * 导出字段对齐方式(0:默认;1:靠左;2:居中;3:靠右) | ||
| 112 | - */ | ||
| 113 | - public Align align() default Align.AUTO; | ||
| 114 | - | ||
| 115 | - /** | ||
| 116 | - * 自定义数据处理器 | ||
| 117 | - */ | ||
| 118 | - public Class<?> handler() default ExcelHandlerAdapter.class; | ||
| 119 | - | ||
| 120 | - /** | ||
| 121 | - * 自定义数据处理器参数 | ||
| 122 | - */ | ||
| 123 | - public String[] args() default {}; | ||
| 124 | - | ||
| 125 | - public enum Align | ||
| 126 | - { | ||
| 127 | - AUTO(0), LEFT(1), CENTER(2), RIGHT(3); | ||
| 128 | - private final int value; | ||
| 129 | - | ||
| 130 | - Align(int value) | ||
| 131 | - { | ||
| 132 | - this.value = value; | ||
| 133 | - } | ||
| 134 | - | ||
| 135 | - public int value() | ||
| 136 | - { | ||
| 137 | - return this.value; | ||
| 138 | - } | ||
| 139 | - } | ||
| 140 | - | ||
| 141 | - /** | ||
| 142 | - * 字段类型(0:导出导入;1:仅导出;2:仅导入) | ||
| 143 | - */ | ||
| 144 | - Type type() default Type.ALL; | ||
| 145 | - | ||
| 146 | - public enum Type | ||
| 147 | - { | ||
| 148 | - ALL(0), EXPORT(1), IMPORT(2); | ||
| 149 | - private final int value; | ||
| 150 | - | ||
| 151 | - Type(int value) | ||
| 152 | - { | ||
| 153 | - this.value = value; | ||
| 154 | - } | ||
| 155 | - | ||
| 156 | - public int value() | ||
| 157 | - { | ||
| 158 | - return this.value; | ||
| 159 | - } | ||
| 160 | - } | ||
| 161 | - | ||
| 162 | - public enum ColumnType | ||
| 163 | - { | ||
| 164 | - NUMERIC(0), STRING(1), IMAGE(2); | ||
| 165 | - private final int value; | ||
| 166 | - | ||
| 167 | - ColumnType(int value) | ||
| 168 | - { | ||
| 169 | - this.value = value; | ||
| 170 | - } | ||
| 171 | - | ||
| 172 | - public int value() | ||
| 173 | - { | ||
| 174 | - return this.value; | ||
| 175 | - } | ||
| 176 | - } | ||
| 177 | -} |
| 1 | -package com.ruoyi.common.annotation; | ||
| 2 | - | ||
| 3 | -import java.lang.annotation.ElementType; | ||
| 4 | -import java.lang.annotation.Retention; | ||
| 5 | -import java.lang.annotation.RetentionPolicy; | ||
| 6 | -import java.lang.annotation.Target; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * Excel注解集 | ||
| 10 | - * | ||
| 11 | - * @author ruoyi | ||
| 12 | - */ | ||
| 13 | -@Target(ElementType.FIELD) | ||
| 14 | -@Retention(RetentionPolicy.RUNTIME) | ||
| 15 | -public @interface Excels | ||
| 16 | -{ | ||
| 17 | - public Excel[] value(); | ||
| 18 | -} |
| 1 | -package com.ruoyi.common.annotation; | ||
| 2 | - | ||
| 3 | -import com.ruoyi.common.enums.BusinessType; | ||
| 4 | -import com.ruoyi.common.enums.OperatorType; | ||
| 5 | - | ||
| 6 | -import java.lang.annotation.*; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * 自定义操作日志记录注解 | ||
| 10 | - * | ||
| 11 | - * @author ruoyi | ||
| 12 | - * | ||
| 13 | - */ | ||
| 14 | -@Target({ ElementType.PARAMETER, ElementType.METHOD }) | ||
| 15 | -@Retention(RetentionPolicy.RUNTIME) | ||
| 16 | -@Documented | ||
| 17 | -public @interface Log | ||
| 18 | -{ | ||
| 19 | - /** | ||
| 20 | - * 模块 | ||
| 21 | - */ | ||
| 22 | - public String title() default ""; | ||
| 23 | - | ||
| 24 | - /** | ||
| 25 | - * 功能 | ||
| 26 | - */ | ||
| 27 | - public BusinessType businessType() default BusinessType.OTHER; | ||
| 28 | - | ||
| 29 | - /** | ||
| 30 | - * 操作人类别 | ||
| 31 | - */ | ||
| 32 | - public OperatorType operatorType() default OperatorType.MANAGE; | ||
| 33 | - | ||
| 34 | - /** | ||
| 35 | - * 是否保存请求的参数 | ||
| 36 | - */ | ||
| 37 | - public boolean isSaveRequestData() default true; | ||
| 38 | - | ||
| 39 | - /** | ||
| 40 | - * 是否保存响应的参数 | ||
| 41 | - */ | ||
| 42 | - public boolean isSaveResponseData() default true; | ||
| 43 | -} |
| 1 | -package com.ruoyi.common.annotation; | ||
| 2 | - | ||
| 3 | -import com.ruoyi.common.constant.Constants; | ||
| 4 | -import com.ruoyi.common.enums.LimitType; | ||
| 5 | - | ||
| 6 | -import java.lang.annotation.*; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * 限流注解 | ||
| 10 | - * | ||
| 11 | - * @author ruoyi | ||
| 12 | - */ | ||
| 13 | -@Target(ElementType.METHOD) | ||
| 14 | -@Retention(RetentionPolicy.RUNTIME) | ||
| 15 | -@Documented | ||
| 16 | -public @interface RateLimiter | ||
| 17 | -{ | ||
| 18 | - /** | ||
| 19 | - * 限流key | ||
| 20 | - */ | ||
| 21 | - public String key() default Constants.RATE_LIMIT_KEY; | ||
| 22 | - | ||
| 23 | - /** | ||
| 24 | - * 限流时间,单位秒 | ||
| 25 | - */ | ||
| 26 | - public int time() default 60; | ||
| 27 | - | ||
| 28 | - /** | ||
| 29 | - * 限流次数 | ||
| 30 | - */ | ||
| 31 | - public int count() default 100; | ||
| 32 | - | ||
| 33 | - /** | ||
| 34 | - * 限流类型 | ||
| 35 | - */ | ||
| 36 | - public LimitType limitType() default LimitType.DEFAULT; | ||
| 37 | -} |
| 1 | -package com.ruoyi.common.annotation; | ||
| 2 | - | ||
| 3 | -import java.lang.annotation.*; | ||
| 4 | - | ||
| 5 | -/** | ||
| 6 | - * 自定义注解防止表单重复提交 | ||
| 7 | - * | ||
| 8 | - * @author ruoyi | ||
| 9 | - * | ||
| 10 | - */ | ||
| 11 | -@Inherited | ||
| 12 | -@Target(ElementType.METHOD) | ||
| 13 | -@Retention(RetentionPolicy.RUNTIME) | ||
| 14 | -@Documented | ||
| 15 | -public @interface RepeatSubmit | ||
| 16 | -{ | ||
| 17 | - /** | ||
| 18 | - * 间隔时间(ms),小于此时间视为重复提交 | ||
| 19 | - */ | ||
| 20 | - public int interval() default 5000; | ||
| 21 | - | ||
| 22 | - /** | ||
| 23 | - * 提示消息 | ||
| 24 | - */ | ||
| 25 | - public String message() default "不允许重复提交,请稍候再试"; | ||
| 26 | -} |
| 1 | -package com.ruoyi.common.config; | ||
| 2 | - | ||
| 3 | -import org.springframework.boot.context.properties.ConfigurationProperties; | ||
| 4 | -import org.springframework.stereotype.Component; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * 读取项目相关配置 | ||
| 8 | - * | ||
| 9 | - * @author ruoyi | ||
| 10 | - */ | ||
| 11 | -@Component | ||
| 12 | -@ConfigurationProperties(prefix = "jhlt") | ||
| 13 | -public class RuoYiConfig | ||
| 14 | -{ | ||
| 15 | - /** 项目名称 */ | ||
| 16 | - private String name; | ||
| 17 | - | ||
| 18 | - /** 版本 */ | ||
| 19 | - private String version; | ||
| 20 | - | ||
| 21 | - /** 版权年份 */ | ||
| 22 | - private String copyrightYear; | ||
| 23 | - | ||
| 24 | - /** 实例演示开关 */ | ||
| 25 | - private boolean demoEnabled; | ||
| 26 | - | ||
| 27 | - /** 上传路径 */ | ||
| 28 | - private static String profile; | ||
| 29 | - | ||
| 30 | - /** 获取地址开关 */ | ||
| 31 | - private static boolean addressEnabled; | ||
| 32 | - | ||
| 33 | - /** 验证码类型 */ | ||
| 34 | - private static String captchaType; | ||
| 35 | - | ||
| 36 | - /** root */ | ||
| 37 | - private static String root; | ||
| 38 | - | ||
| 39 | - public static String getRoot() { | ||
| 40 | - return root; | ||
| 41 | - } | ||
| 42 | - | ||
| 43 | - public static void setRoot(String root) { | ||
| 44 | - RuoYiConfig.root = root; | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - public String getName() | ||
| 48 | - { | ||
| 49 | - return name; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public void setName(String name) | ||
| 53 | - { | ||
| 54 | - this.name = name; | ||
| 55 | - } | ||
| 56 | - | ||
| 57 | - public String getVersion() | ||
| 58 | - { | ||
| 59 | - return version; | ||
| 60 | - } | ||
| 61 | - | ||
| 62 | - public void setVersion(String version) | ||
| 63 | - { | ||
| 64 | - this.version = version; | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - public String getCopyrightYear() | ||
| 68 | - { | ||
| 69 | - return copyrightYear; | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - public void setCopyrightYear(String copyrightYear) | ||
| 73 | - { | ||
| 74 | - this.copyrightYear = copyrightYear; | ||
| 75 | - } | ||
| 76 | - | ||
| 77 | - public boolean isDemoEnabled() | ||
| 78 | - { | ||
| 79 | - return demoEnabled; | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - public void setDemoEnabled(boolean demoEnabled) | ||
| 83 | - { | ||
| 84 | - this.demoEnabled = demoEnabled; | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - public static String getProfile() | ||
| 88 | - { | ||
| 89 | - return profile; | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | - public void setProfile(String profile) | ||
| 93 | - { | ||
| 94 | - RuoYiConfig.profile = profile; | ||
| 95 | - } | ||
| 96 | - | ||
| 97 | - public static boolean isAddressEnabled() | ||
| 98 | - { | ||
| 99 | - return addressEnabled; | ||
| 100 | - } | ||
| 101 | - | ||
| 102 | - public void setAddressEnabled(boolean addressEnabled) | ||
| 103 | - { | ||
| 104 | - RuoYiConfig.addressEnabled = addressEnabled; | ||
| 105 | - } | ||
| 106 | - | ||
| 107 | - public static String getCaptchaType() { | ||
| 108 | - return captchaType; | ||
| 109 | - } | ||
| 110 | - | ||
| 111 | - public void setCaptchaType(String captchaType) { | ||
| 112 | - RuoYiConfig.captchaType = captchaType; | ||
| 113 | - } | ||
| 114 | - | ||
| 115 | - /** | ||
| 116 | - * 获取导入上传路径 | ||
| 117 | - */ | ||
| 118 | - public static String getImportPath() | ||
| 119 | - { | ||
| 120 | - return getProfile() + "/import"; | ||
| 121 | - } | ||
| 122 | - | ||
| 123 | - /** | ||
| 124 | - * 获取头像上传路径 | ||
| 125 | - */ | ||
| 126 | - public static String getAvatarPath() | ||
| 127 | - { | ||
| 128 | - return getProfile() + "/avatar"; | ||
| 129 | - } | ||
| 130 | - | ||
| 131 | - /** | ||
| 132 | - * 获取下载路径 | ||
| 133 | - */ | ||
| 134 | - public static String getDownloadPath() | ||
| 135 | - { | ||
| 136 | - return getProfile() + "/download/"; | ||
| 137 | - } | ||
| 138 | - | ||
| 139 | - /** | ||
| 140 | - * 获取上传路径 | ||
| 141 | - */ | ||
| 142 | - public static String getUploadPath() | ||
| 143 | - { | ||
| 144 | - return getProfile() + "/upload"; | ||
| 145 | - } | ||
| 146 | -} |
| 1 | -package com.ruoyi.common.constant; | ||
| 2 | - | ||
| 3 | -import io.jsonwebtoken.Claims; | ||
| 4 | - | ||
| 5 | -/** | ||
| 6 | - * 通用常量信息 | ||
| 7 | - * | ||
| 8 | - * @author ruoyi | ||
| 9 | - */ | ||
| 10 | -public class Constants | ||
| 11 | -{ | ||
| 12 | - /** | ||
| 13 | - * UTF-8 字符集 | ||
| 14 | - */ | ||
| 15 | - public static final String UTF8 = "UTF-8"; | ||
| 16 | - | ||
| 17 | - /** | ||
| 18 | - * GBK 字符集 | ||
| 19 | - */ | ||
| 20 | - public static final String GBK = "GBK"; | ||
| 21 | - | ||
| 22 | - /** | ||
| 23 | - * http请求 | ||
| 24 | - */ | ||
| 25 | - public static final String HTTP = "http://"; | ||
| 26 | - | ||
| 27 | - /** | ||
| 28 | - * https请求 | ||
| 29 | - */ | ||
| 30 | - public static final String HTTPS = "https://"; | ||
| 31 | - | ||
| 32 | - /** | ||
| 33 | - * 通用成功标识 | ||
| 34 | - */ | ||
| 35 | - public static final String SUCCESS = "0"; | ||
| 36 | - | ||
| 37 | - /** | ||
| 38 | - * 通用失败标识 | ||
| 39 | - */ | ||
| 40 | - public static final String FAIL = "1"; | ||
| 41 | - | ||
| 42 | - /** | ||
| 43 | - * 登录成功 | ||
| 44 | - */ | ||
| 45 | - public static final String LOGIN_SUCCESS = "Success"; | ||
| 46 | - | ||
| 47 | - /** | ||
| 48 | - * 注销 | ||
| 49 | - */ | ||
| 50 | - public static final String LOGOUT = "Logout"; | ||
| 51 | - | ||
| 52 | - /** | ||
| 53 | - * 注册 | ||
| 54 | - */ | ||
| 55 | - public static final String REGISTER = "Register"; | ||
| 56 | - | ||
| 57 | - /** | ||
| 58 | - * 登录失败 | ||
| 59 | - */ | ||
| 60 | - public static final String LOGIN_FAIL = "Error"; | ||
| 61 | - | ||
| 62 | - /** | ||
| 63 | - * 验证码 redis key | ||
| 64 | - */ | ||
| 65 | - public static final String CAPTCHA_CODE_KEY = "captcha_codes:"; | ||
| 66 | - | ||
| 67 | - /** | ||
| 68 | - * 登录用户 redis key | ||
| 69 | - */ | ||
| 70 | - public static final String LOGIN_TOKEN_KEY = "login_tokens:"; | ||
| 71 | - | ||
| 72 | - /** | ||
| 73 | - * 防重提交 redis key | ||
| 74 | - */ | ||
| 75 | - public static final String REPEAT_SUBMIT_KEY = "repeat_submit:"; | ||
| 76 | - | ||
| 77 | - /** | ||
| 78 | - * 限流 redis key | ||
| 79 | - */ | ||
| 80 | - public static final String RATE_LIMIT_KEY = "rate_limit:"; | ||
| 81 | - | ||
| 82 | - /** | ||
| 83 | - * 验证码有效期(分钟) | ||
| 84 | - */ | ||
| 85 | - public static final Integer CAPTCHA_EXPIRATION = 2; | ||
| 86 | - | ||
| 87 | - /** | ||
| 88 | - * 令牌 | ||
| 89 | - */ | ||
| 90 | - public static final String TOKEN = "token"; | ||
| 91 | - | ||
| 92 | - /** | ||
| 93 | - * 令牌前缀 | ||
| 94 | - */ | ||
| 95 | - public static final String TOKEN_PREFIX = "Bearer "; | ||
| 96 | - | ||
| 97 | - /** | ||
| 98 | - * 令牌前缀 | ||
| 99 | - */ | ||
| 100 | - public static final String LOGIN_USER_KEY = "login_user_key"; | ||
| 101 | - | ||
| 102 | - /** | ||
| 103 | - * 用户ID | ||
| 104 | - */ | ||
| 105 | - public static final String JWT_USERID = "userid"; | ||
| 106 | - | ||
| 107 | - /** | ||
| 108 | - * 用户名称 | ||
| 109 | - */ | ||
| 110 | - public static final String JWT_USERNAME = Claims.SUBJECT; | ||
| 111 | - | ||
| 112 | - /** | ||
| 113 | - * 用户头像 | ||
| 114 | - */ | ||
| 115 | - public static final String JWT_AVATAR = "avatar"; | ||
| 116 | - | ||
| 117 | - /** | ||
| 118 | - * 创建时间 | ||
| 119 | - */ | ||
| 120 | - public static final String JWT_CREATED = "created"; | ||
| 121 | - | ||
| 122 | - /** | ||
| 123 | - * 用户权限 | ||
| 124 | - */ | ||
| 125 | - public static final String JWT_AUTHORITIES = "authorities"; | ||
| 126 | - | ||
| 127 | - /** | ||
| 128 | - * 参数管理 cache key | ||
| 129 | - */ | ||
| 130 | - public static final String SYS_CONFIG_KEY = "sys_config:"; | ||
| 131 | - | ||
| 132 | - /** | ||
| 133 | - * 字典管理 cache key | ||
| 134 | - */ | ||
| 135 | - public static final String SYS_DICT_KEY = "sys_dict:"; | ||
| 136 | - | ||
| 137 | - /** | ||
| 138 | - * 资源映射路径 前缀 | ||
| 139 | - */ | ||
| 140 | - public static final String RESOURCE_PREFIX = "/profile"; | ||
| 141 | - | ||
| 142 | - /** | ||
| 143 | - * 资源映射路径 前缀 | ||
| 144 | - */ | ||
| 145 | - public static final String ROOT = "/**"; | ||
| 146 | - | ||
| 147 | - /** | ||
| 148 | - * RMI 远程方法调用 | ||
| 149 | - */ | ||
| 150 | - public static final String LOOKUP_RMI = "rmi:"; | ||
| 151 | - | ||
| 152 | - /** | ||
| 153 | - * LDAP 远程方法调用 | ||
| 154 | - */ | ||
| 155 | - public static final String LOOKUP_LDAP = "ldap:"; | ||
| 156 | - | ||
| 157 | - /** | ||
| 158 | - * LDAPS 远程方法调用 | ||
| 159 | - */ | ||
| 160 | - public static final String LOOKUP_LDAPS = "ldaps:"; | ||
| 161 | - | ||
| 162 | - /** | ||
| 163 | - * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) | ||
| 164 | - */ | ||
| 165 | - public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" }; | ||
| 166 | - | ||
| 167 | - /** | ||
| 168 | - * 定时任务违规的字符 | ||
| 169 | - */ | ||
| 170 | - public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", | ||
| 171 | - "org.springframework", "org.apache", "com.ruoyi.common.utils.file" }; | ||
| 172 | -} |
| 1 | -package com.ruoyi.common.constant; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * 代码生成通用常量 | ||
| 5 | - * | ||
| 6 | - * @author ruoyi | ||
| 7 | - */ | ||
| 8 | -public class GenConstants | ||
| 9 | -{ | ||
| 10 | - /** 单表(增删改查) */ | ||
| 11 | - public static final String TPL_CRUD = "crud"; | ||
| 12 | - | ||
| 13 | - /** 树表(增删改查) */ | ||
| 14 | - public static final String TPL_TREE = "tree"; | ||
| 15 | - | ||
| 16 | - /** 主子表(增删改查) */ | ||
| 17 | - public static final String TPL_SUB = "sub"; | ||
| 18 | - | ||
| 19 | - /** 树编码字段 */ | ||
| 20 | - public static final String TREE_CODE = "treeCode"; | ||
| 21 | - | ||
| 22 | - /** 树父编码字段 */ | ||
| 23 | - public static final String TREE_PARENT_CODE = "treeParentCode"; | ||
| 24 | - | ||
| 25 | - /** 树名称字段 */ | ||
| 26 | - public static final String TREE_NAME = "treeName"; | ||
| 27 | - | ||
| 28 | - /** 上级菜单ID字段 */ | ||
| 29 | - public static final String PARENT_MENU_ID = "parentMenuId"; | ||
| 30 | - | ||
| 31 | - /** 上级菜单名称字段 */ | ||
| 32 | - public static final String PARENT_MENU_NAME = "parentMenuName"; | ||
| 33 | - | ||
| 34 | - /** 数据库字符串类型 */ | ||
| 35 | - public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" }; | ||
| 36 | - | ||
| 37 | - /** 数据库文本类型 */ | ||
| 38 | - public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" }; | ||
| 39 | - | ||
| 40 | - /** 数据库时间类型 */ | ||
| 41 | - public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" }; | ||
| 42 | - | ||
| 43 | - /** 数据库数字类型 */ | ||
| 44 | - public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer", | ||
| 45 | - "bit", "bigint", "float", "double", "decimal" }; | ||
| 46 | - | ||
| 47 | - /** 页面不需要编辑字段 */ | ||
| 48 | - public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" }; | ||
| 49 | - | ||
| 50 | - /** 页面不需要显示的列表字段 */ | ||
| 51 | - public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by", | ||
| 52 | - "update_time" }; | ||
| 53 | - | ||
| 54 | - /** 页面不需要查询字段 */ | ||
| 55 | - public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by", | ||
| 56 | - "update_time", "remark" }; | ||
| 57 | - | ||
| 58 | - /** Entity基类字段 */ | ||
| 59 | - public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" }; | ||
| 60 | - | ||
| 61 | - /** Tree基类字段 */ | ||
| 62 | - public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" }; | ||
| 63 | - | ||
| 64 | - /** 文本框 */ | ||
| 65 | - public static final String HTML_INPUT = "input"; | ||
| 66 | - | ||
| 67 | - /** 文本域 */ | ||
| 68 | - public static final String HTML_TEXTAREA = "textarea"; | ||
| 69 | - | ||
| 70 | - /** 下拉框 */ | ||
| 71 | - public static final String HTML_SELECT = "select"; | ||
| 72 | - | ||
| 73 | - /** 单选框 */ | ||
| 74 | - public static final String HTML_RADIO = "radio"; | ||
| 75 | - | ||
| 76 | - /** 复选框 */ | ||
| 77 | - public static final String HTML_CHECKBOX = "checkbox"; | ||
| 78 | - | ||
| 79 | - /** 日期控件 */ | ||
| 80 | - public static final String HTML_DATETIME = "datetime"; | ||
| 81 | - | ||
| 82 | - /** 图片上传控件 */ | ||
| 83 | - public static final String HTML_IMAGE_UPLOAD = "imageUpload"; | ||
| 84 | - | ||
| 85 | - /** 文件上传控件 */ | ||
| 86 | - public static final String HTML_FILE_UPLOAD = "fileUpload"; | ||
| 87 | - | ||
| 88 | - /** 富文本控件 */ | ||
| 89 | - public static final String HTML_EDITOR = "editor"; | ||
| 90 | - | ||
| 91 | - /** 字符串类型 */ | ||
| 92 | - public static final String TYPE_STRING = "String"; | ||
| 93 | - | ||
| 94 | - /** 整型 */ | ||
| 95 | - public static final String TYPE_INTEGER = "Integer"; | ||
| 96 | - | ||
| 97 | - /** 长整型 */ | ||
| 98 | - public static final String TYPE_LONG = "Long"; | ||
| 99 | - | ||
| 100 | - /** 浮点型 */ | ||
| 101 | - public static final String TYPE_DOUBLE = "Double"; | ||
| 102 | - | ||
| 103 | - /** 高精度计算类型 */ | ||
| 104 | - public static final String TYPE_BIGDECIMAL = "BigDecimal"; | ||
| 105 | - | ||
| 106 | - /** 时间类型 */ | ||
| 107 | - public static final String TYPE_DATE = "Date"; | ||
| 108 | - | ||
| 109 | - /** 模糊查询 */ | ||
| 110 | - public static final String QUERY_LIKE = "LIKE"; | ||
| 111 | - | ||
| 112 | - /** 相等查询 */ | ||
| 113 | - public static final String QUERY_EQ = "EQ"; | ||
| 114 | - | ||
| 115 | - /** 需要 */ | ||
| 116 | - public static final String REQUIRE = "1"; | ||
| 117 | -} |
| 1 | -package com.ruoyi.common.constant; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * 返回状态码 | ||
| 5 | - * | ||
| 6 | - * @author ruoyi | ||
| 7 | - */ | ||
| 8 | -public class HttpStatus | ||
| 9 | -{ | ||
| 10 | - /** | ||
| 11 | - * 操作成功 | ||
| 12 | - */ | ||
| 13 | - public static final int SUCCESS = 200; | ||
| 14 | - | ||
| 15 | - /** | ||
| 16 | - * 对象创建成功 | ||
| 17 | - */ | ||
| 18 | - public static final int CREATED = 201; | ||
| 19 | - | ||
| 20 | - /** | ||
| 21 | - * 请求已经被接受 | ||
| 22 | - */ | ||
| 23 | - public static final int ACCEPTED = 202; | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 操作已经执行成功,但是没有返回数据 | ||
| 27 | - */ | ||
| 28 | - public static final int NO_CONTENT = 204; | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 资源已被移除 | ||
| 32 | - */ | ||
| 33 | - public static final int MOVED_PERM = 301; | ||
| 34 | - | ||
| 35 | - /** | ||
| 36 | - * 重定向 | ||
| 37 | - */ | ||
| 38 | - public static final int SEE_OTHER = 303; | ||
| 39 | - | ||
| 40 | - /** | ||
| 41 | - * 资源没有被修改 | ||
| 42 | - */ | ||
| 43 | - public static final int NOT_MODIFIED = 304; | ||
| 44 | - | ||
| 45 | - /** | ||
| 46 | - * 参数列表错误(缺少,格式不匹配) | ||
| 47 | - */ | ||
| 48 | - public static final int BAD_REQUEST = 400; | ||
| 49 | - | ||
| 50 | - /** | ||
| 51 | - * 未授权 | ||
| 52 | - */ | ||
| 53 | - public static final int UNAUTHORIZED = 401; | ||
| 54 | - | ||
| 55 | - /** | ||
| 56 | - * 访问受限,授权过期 | ||
| 57 | - */ | ||
| 58 | - public static final int FORBIDDEN = 403; | ||
| 59 | - | ||
| 60 | - /** | ||
| 61 | - * 资源,服务未找到 | ||
| 62 | - */ | ||
| 63 | - public static final int NOT_FOUND = 404; | ||
| 64 | - | ||
| 65 | - /** | ||
| 66 | - * 不允许的http方法 | ||
| 67 | - */ | ||
| 68 | - public static final int BAD_METHOD = 405; | ||
| 69 | - | ||
| 70 | - /** | ||
| 71 | - * 资源冲突,或者资源被锁 | ||
| 72 | - */ | ||
| 73 | - public static final int CONFLICT = 409; | ||
| 74 | - | ||
| 75 | - /** | ||
| 76 | - * 不支持的数据,媒体类型 | ||
| 77 | - */ | ||
| 78 | - public static final int UNSUPPORTED_TYPE = 415; | ||
| 79 | - | ||
| 80 | - /** | ||
| 81 | - * 系统内部错误 | ||
| 82 | - */ | ||
| 83 | - public static final int ERROR = 500; | ||
| 84 | - | ||
| 85 | - /** | ||
| 86 | - * 接口未实现 | ||
| 87 | - */ | ||
| 88 | - public static final int NOT_IMPLEMENTED = 501; | ||
| 89 | -} |
| 1 | -package com.ruoyi.common.constant; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * 任务调度通用常量 | ||
| 5 | - * | ||
| 6 | - * @author ruoyi | ||
| 7 | - */ | ||
| 8 | -public class ScheduleConstants | ||
| 9 | -{ | ||
| 10 | - public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME"; | ||
| 11 | - | ||
| 12 | - /** 执行目标key */ | ||
| 13 | - public static final String TASK_PROPERTIES = "TASK_PROPERTIES"; | ||
| 14 | - | ||
| 15 | - /** 默认 */ | ||
| 16 | - public static final String MISFIRE_DEFAULT = "0"; | ||
| 17 | - | ||
| 18 | - /** 立即触发执行 */ | ||
| 19 | - public static final String MISFIRE_IGNORE_MISFIRES = "1"; | ||
| 20 | - | ||
| 21 | - /** 触发一次执行 */ | ||
| 22 | - public static final String MISFIRE_FIRE_AND_PROCEED = "2"; | ||
| 23 | - | ||
| 24 | - /** 不触发立即执行 */ | ||
| 25 | - public static final String MISFIRE_DO_NOTHING = "3"; | ||
| 26 | - | ||
| 27 | - public enum Status | ||
| 28 | - { | ||
| 29 | - /** | ||
| 30 | - * 正常 | ||
| 31 | - */ | ||
| 32 | - NORMAL("0"), | ||
| 33 | - /** | ||
| 34 | - * 暂停 | ||
| 35 | - */ | ||
| 36 | - PAUSE("1"); | ||
| 37 | - | ||
| 38 | - private String value; | ||
| 39 | - | ||
| 40 | - private Status(String value) | ||
| 41 | - { | ||
| 42 | - this.value = value; | ||
| 43 | - } | ||
| 44 | - | ||
| 45 | - public String getValue() | ||
| 46 | - { | ||
| 47 | - return value; | ||
| 48 | - } | ||
| 49 | - } | ||
| 50 | -} |
| 1 | -package com.ruoyi.common.core.controller; | ||
| 2 | - | ||
| 3 | -import com.github.pagehelper.PageHelper; | ||
| 4 | -import com.github.pagehelper.PageInfo; | ||
| 5 | -import com.ruoyi.common.constant.HttpStatus; | ||
| 6 | -import com.ruoyi.common.core.domain.AjaxResult; | ||
| 7 | -import com.ruoyi.common.core.domain.BaseLoginUser; | ||
| 8 | -import com.ruoyi.common.core.page.PageDomain; | ||
| 9 | -import com.ruoyi.common.core.page.TableDataInfo; | ||
| 10 | -import com.ruoyi.common.core.page.TableSupport; | ||
| 11 | -import com.ruoyi.common.utils.DateUtils; | ||
| 12 | -import com.ruoyi.common.utils.PageUtils; | ||
| 13 | -import com.ruoyi.common.utils.SecurityUtils; | ||
| 14 | -import com.ruoyi.common.utils.StringUtils; | ||
| 15 | -import com.ruoyi.common.utils.sql.SqlUtil; | ||
| 16 | -import org.slf4j.Logger; | ||
| 17 | -import org.slf4j.LoggerFactory; | ||
| 18 | -import org.springframework.web.bind.WebDataBinder; | ||
| 19 | -import org.springframework.web.bind.annotation.InitBinder; | ||
| 20 | - | ||
| 21 | -import java.beans.PropertyEditorSupport; | ||
| 22 | -import java.util.Date; | ||
| 23 | -import java.util.List; | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * web层通用数据处理 | ||
| 27 | - * | ||
| 28 | - * @author ruoyi | ||
| 29 | - */ | ||
| 30 | -public class BaseController | ||
| 31 | -{ | ||
| 32 | - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 33 | - | ||
| 34 | - /** | ||
| 35 | - * 将前台传递过来的日期格式的字符串,自动转化为Date类型 | ||
| 36 | - */ | ||
| 37 | - @InitBinder | ||
| 38 | - public void initBinder(WebDataBinder binder) | ||
| 39 | - { | ||
| 40 | - // Date 类型转换 | ||
| 41 | - binder.registerCustomEditor(Date.class, new PropertyEditorSupport() | ||
| 42 | - { | ||
| 43 | - @Override | ||
| 44 | - public void setAsText(String text) | ||
| 45 | - { | ||
| 46 | - setValue(DateUtils.parseDate(text)); | ||
| 47 | - } | ||
| 48 | - }); | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - /** | ||
| 52 | - * 设置请求分页数据 | ||
| 53 | - */ | ||
| 54 | - protected void startPage() | ||
| 55 | - { | ||
| 56 | - PageUtils.startPage(); | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - /** | ||
| 60 | - * 设置请求排序数据 | ||
| 61 | - */ | ||
| 62 | - protected void startOrderBy() | ||
| 63 | - { | ||
| 64 | - PageDomain pageDomain = TableSupport.buildPageRequest(); | ||
| 65 | - if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) | ||
| 66 | - { | ||
| 67 | - String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); | ||
| 68 | - PageHelper.orderBy(orderBy); | ||
| 69 | - } | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - /** | ||
| 73 | - * 清理分页的线程变量 | ||
| 74 | - */ | ||
| 75 | - protected void clearPage() | ||
| 76 | - { | ||
| 77 | - PageUtils.clearPage(); | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | - /** | ||
| 81 | - * 响应请求分页数据 | ||
| 82 | - */ | ||
| 83 | - @SuppressWarnings({ "rawtypes", "unchecked" }) | ||
| 84 | - protected TableDataInfo getDataTable(List<?> list) | ||
| 85 | - { | ||
| 86 | - TableDataInfo rspData = new TableDataInfo(); | ||
| 87 | - rspData.setCode(HttpStatus.SUCCESS); | ||
| 88 | - rspData.setMsg("查询成功"); | ||
| 89 | - rspData.setRows(list); | ||
| 90 | - rspData.setTotal(new PageInfo(list).getTotal()); | ||
| 91 | - return rspData; | ||
| 92 | - } | ||
| 93 | - | ||
| 94 | - /** | ||
| 95 | - * 返回成功 | ||
| 96 | - */ | ||
| 97 | - public AjaxResult success() | ||
| 98 | - { | ||
| 99 | - return AjaxResult.success(); | ||
| 100 | - } | ||
| 101 | - | ||
| 102 | - /** | ||
| 103 | - * 返回失败消息 | ||
| 104 | - */ | ||
| 105 | - public AjaxResult error() | ||
| 106 | - { | ||
| 107 | - return AjaxResult.error(); | ||
| 108 | - } | ||
| 109 | - | ||
| 110 | - /** | ||
| 111 | - * 返回成功消息 | ||
| 112 | - */ | ||
| 113 | - public AjaxResult success(String message) | ||
| 114 | - { | ||
| 115 | - return AjaxResult.success(message); | ||
| 116 | - } | ||
| 117 | - | ||
| 118 | - /** | ||
| 119 | - * 返回失败消息 | ||
| 120 | - */ | ||
| 121 | - public AjaxResult error(String message) | ||
| 122 | - { | ||
| 123 | - return AjaxResult.error(message); | ||
| 124 | - } | ||
| 125 | - | ||
| 126 | - /** | ||
| 127 | - * 响应返回结果 | ||
| 128 | - * | ||
| 129 | - * @param rows 影响行数 | ||
| 130 | - * @return 操作结果 | ||
| 131 | - */ | ||
| 132 | - protected AjaxResult toAjax(int rows) | ||
| 133 | - { | ||
| 134 | - return rows > 0 ? AjaxResult.success() : AjaxResult.error(); | ||
| 135 | - } | ||
| 136 | - | ||
| 137 | - /** | ||
| 138 | - * 响应返回结果 | ||
| 139 | - * | ||
| 140 | - * @param result 结果 | ||
| 141 | - * @return 操作结果 | ||
| 142 | - */ | ||
| 143 | - protected AjaxResult toAjax(boolean result) | ||
| 144 | - { | ||
| 145 | - return result ? success() : error(); | ||
| 146 | - } | ||
| 147 | - | ||
| 148 | - /** | ||
| 149 | - * 页面跳转 | ||
| 150 | - */ | ||
| 151 | - public String redirect(String url) | ||
| 152 | - { | ||
| 153 | - return StringUtils.format("redirect:{}", url); | ||
| 154 | - } | ||
| 155 | - | ||
| 156 | - /** | ||
| 157 | - * 获取用户缓存信息 | ||
| 158 | - */ | ||
| 159 | - public BaseLoginUser getLoginUser() | ||
| 160 | - { | ||
| 161 | - return SecurityUtils.getLoginUser(); | ||
| 162 | - } | ||
| 163 | - | ||
| 164 | - /** | ||
| 165 | - * 获取登录用户id | ||
| 166 | - */ | ||
| 167 | - public Long getUserId() | ||
| 168 | - { | ||
| 169 | - return getLoginUser().getUserId(); | ||
| 170 | - } | ||
| 171 | - | ||
| 172 | - | ||
| 173 | - /** | ||
| 174 | - * 获取登录用户名 | ||
| 175 | - */ | ||
| 176 | - public String getUsername() | ||
| 177 | - { | ||
| 178 | - return getLoginUser().getUsername(); | ||
| 179 | - } | ||
| 180 | -} |
| 1 | -package com.ruoyi.common.core.domain; | ||
| 2 | - | ||
| 3 | -import com.ruoyi.common.constant.HttpStatus; | ||
| 4 | -import com.ruoyi.common.utils.StringUtils; | ||
| 5 | - | ||
| 6 | -import java.util.HashMap; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * 操作消息提醒 | ||
| 10 | - * | ||
| 11 | - * @author ruoyi | ||
| 12 | - */ | ||
| 13 | -public class AjaxResult extends HashMap<String, Object> | ||
| 14 | -{ | ||
| 15 | - private static final long serialVersionUID = 1L; | ||
| 16 | - | ||
| 17 | - /** 状态码 */ | ||
| 18 | - public static final String CODE_TAG = "code"; | ||
| 19 | - | ||
| 20 | - /** 返回内容 */ | ||
| 21 | - public static final String MSG_TAG = "msg"; | ||
| 22 | - | ||
| 23 | - /** 数据对象 */ | ||
| 24 | - public static final String DATA_TAG = "data"; | ||
| 25 | - | ||
| 26 | - /** | ||
| 27 | - * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 | ||
| 28 | - */ | ||
| 29 | - public AjaxResult() | ||
| 30 | - { | ||
| 31 | - } | ||
| 32 | - | ||
| 33 | - /** | ||
| 34 | - * 初始化一个新创建的 AjaxResult 对象 | ||
| 35 | - * | ||
| 36 | - * @param code 状态码 | ||
| 37 | - * @param msg 返回内容 | ||
| 38 | - */ | ||
| 39 | - public AjaxResult(int code, String msg) | ||
| 40 | - { | ||
| 41 | - super.put(CODE_TAG, code); | ||
| 42 | - super.put(MSG_TAG, msg); | ||
| 43 | - } | ||
| 44 | - | ||
| 45 | - /** | ||
| 46 | - * 初始化一个新创建的 AjaxResult 对象 | ||
| 47 | - * | ||
| 48 | - * @param code 状态码 | ||
| 49 | - * @param msg 返回内容 | ||
| 50 | - * @param data 数据对象 | ||
| 51 | - */ | ||
| 52 | - public AjaxResult(int code, String msg, Object data) | ||
| 53 | - { | ||
| 54 | - super.put(CODE_TAG, code); | ||
| 55 | - super.put(MSG_TAG, msg); | ||
| 56 | - if (StringUtils.isNotNull(data)) | ||
| 57 | - { | ||
| 58 | - super.put(DATA_TAG, data); | ||
| 59 | - } | ||
| 60 | - } | ||
| 61 | - | ||
| 62 | - /** | ||
| 63 | - * 返回成功消息 | ||
| 64 | - * | ||
| 65 | - * @return 成功消息 | ||
| 66 | - */ | ||
| 67 | - public static AjaxResult success() | ||
| 68 | - { | ||
| 69 | - return AjaxResult.success("操作成功"); | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - /** | ||
| 73 | - * 返回成功数据 | ||
| 74 | - * | ||
| 75 | - * @return 成功消息 | ||
| 76 | - */ | ||
| 77 | - public static AjaxResult success(Object data) | ||
| 78 | - { | ||
| 79 | - return AjaxResult.success("操作成功", data); | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - /** | ||
| 83 | - * 返回成功消息 | ||
| 84 | - * | ||
| 85 | - * @param msg 返回内容 | ||
| 86 | - * @return 成功消息 | ||
| 87 | - */ | ||
| 88 | - public static AjaxResult success(String msg) | ||
| 89 | - { | ||
| 90 | - return AjaxResult.success(msg, null); | ||
| 91 | - } | ||
| 92 | - | ||
| 93 | - /** | ||
| 94 | - * 返回成功消息 | ||
| 95 | - * | ||
| 96 | - * @param msg 返回内容 | ||
| 97 | - * @param data 数据对象 | ||
| 98 | - * @return 成功消息 | ||
| 99 | - */ | ||
| 100 | - public static AjaxResult success(String msg, Object data) | ||
| 101 | - { | ||
| 102 | - return new AjaxResult(HttpStatus.SUCCESS, msg, data); | ||
| 103 | - } | ||
| 104 | - | ||
| 105 | - /** | ||
| 106 | - * 返回错误消息 | ||
| 107 | - * | ||
| 108 | - * @return | ||
| 109 | - */ | ||
| 110 | - public static AjaxResult error() | ||
| 111 | - { | ||
| 112 | - return AjaxResult.error("操作失败"); | ||
| 113 | - } | ||
| 114 | - | ||
| 115 | - /** | ||
| 116 | - * 返回错误消息 | ||
| 117 | - * | ||
| 118 | - * @param msg 返回内容 | ||
| 119 | - * @return 警告消息 | ||
| 120 | - */ | ||
| 121 | - public static AjaxResult error(String msg) | ||
| 122 | - { | ||
| 123 | - return AjaxResult.error(msg, null); | ||
| 124 | - } | ||
| 125 | - | ||
| 126 | - /** | ||
| 127 | - * 返回错误消息 | ||
| 128 | - * | ||
| 129 | - * @param msg 返回内容 | ||
| 130 | - * @param data 数据对象 | ||
| 131 | - * @return 警告消息 | ||
| 132 | - */ | ||
| 133 | - public static AjaxResult error(String msg, Object data) | ||
| 134 | - { | ||
| 135 | - return new AjaxResult(HttpStatus.ERROR, msg, data); | ||
| 136 | - } | ||
| 137 | - | ||
| 138 | - /** | ||
| 139 | - * 返回错误消息 | ||
| 140 | - * | ||
| 141 | - * @param code 状态码 | ||
| 142 | - * @param msg 返回内容 | ||
| 143 | - * @return 警告消息 | ||
| 144 | - */ | ||
| 145 | - public static AjaxResult error(int code, String msg) | ||
| 146 | - { | ||
| 147 | - return new AjaxResult(code, msg, null); | ||
| 148 | - } | ||
| 149 | - | ||
| 150 | - /** | ||
| 151 | - * 方便链式调用 | ||
| 152 | - * | ||
| 153 | - * @param key 键 | ||
| 154 | - * @param value 值 | ||
| 155 | - * @return 数据对象 | ||
| 156 | - */ | ||
| 157 | - @Override | ||
| 158 | - public AjaxResult put(String key, Object value) | ||
| 159 | - { | ||
| 160 | - super.put(key, value); | ||
| 161 | - return this; | ||
| 162 | - } | ||
| 163 | -} |
-
请 注册 或 登录 后发表评论