diff --git a/pom.xml b/pom.xml index 75ca6cb..162f36e 100644 --- a/pom.xml +++ b/pom.xml @@ -2,15 +2,15 @@ - 4.0.0 - + 4.0.0 + com.ruoyi ruoyi 3.8.5 管理系统 - + 3.8.5 UTF-8 @@ -31,7 +31,7 @@ 2.3 0.9.1 - + @@ -197,7 +197,6 @@ 3.4.2 - diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-dev.yml similarity index 65% rename from ruoyi-admin/src/main/resources/application-druid.yml rename to ruoyi-admin/src/main/resources/application-dev.yml index 7cb8fa0..191d629 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -1,14 +1,36 @@ -# 数据源配置 +# Spring配置 数据源配置 spring: + # redis 配置 + redis: + # 地址 + host: 192.168.10.136 + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 13 + # 密码 + password: wjcy@123456 + # 连接超时时间 + timeout: 10s + lettuce: + pool: + # 连接池中的最小空闲连接 + min-idle: 0 + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池的最大数据库连接数 + max-active: 8 + # #连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1ms datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver druid: # 主库数据源 master: - url: jdbc:mysql://192.168.124.67:3306/dba?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: dba - password: 123456 + url: jdbc:mysql://192.168.10.136:3306/wjcy_new?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: wjcy@123456 # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml new file mode 100644 index 0000000..191d629 --- /dev/null +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -0,0 +1,79 @@ +# Spring配置 数据源配置 +spring: + # redis 配置 + redis: + # 地址 + host: 192.168.10.136 + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 13 + # 密码 + password: wjcy@123456 + # 连接超时时间 + timeout: 10s + lettuce: + pool: + # 连接池中的最小空闲连接 + min-idle: 0 + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池的最大数据库连接数 + max-active: 8 + # #连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1ms + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + druid: + # 主库数据源 + master: + url: jdbc:mysql://192.168.10.136:3306/wjcy_new?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: wjcy@123456 + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: false + url: + username: + password: + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: ruoyi + login-password: 123456 + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/application-test.yml b/ruoyi-admin/src/main/resources/application-test.yml new file mode 100644 index 0000000..191d629 --- /dev/null +++ b/ruoyi-admin/src/main/resources/application-test.yml @@ -0,0 +1,79 @@ +# Spring配置 数据源配置 +spring: + # redis 配置 + redis: + # 地址 + host: 192.168.10.136 + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 13 + # 密码 + password: wjcy@123456 + # 连接超时时间 + timeout: 10s + lettuce: + pool: + # 连接池中的最小空闲连接 + min-idle: 0 + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池的最大数据库连接数 + max-active: 8 + # #连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1ms + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + druid: + # 主库数据源 + master: + url: jdbc:mysql://192.168.10.136:3306/wjcy_new?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: wjcy@123456 + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: false + url: + username: + password: + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: ruoyi + login-password: 123456 + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index b841603..bebed19 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -54,7 +54,7 @@ spring: # 国际化资源文件路径 basename: i18n/messages profiles: - active: druid + active: dev # 文件上传 servlet: multipart: @@ -70,13 +70,13 @@ spring: # redis 配置 redis: # 地址 - host: 192.168.124.67 + host: 192.168.10.136 # 端口,默认为6379 port: 6379 # 数据库索引 - database: 0 + database: 13 # 密码 - password: 123456 + password: wjcy@123456 # 连接超时时间 timeout: 10s lettuce: diff --git a/ruoyi-business/pom.xml b/ruoyi-business/pom.xml index db4d1fa..596d0b5 100644 --- a/ruoyi-business/pom.xml +++ b/ruoyi-business/pom.xml @@ -23,6 +23,24 @@ ruoyi-common + + io.springfox + springfox-swagger-ui + 2.9.2 + + + + io.springfox + springfox-swagger2 + 2.9.2 + + + org.slf4j + slf4j-api + + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/ApplyController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/ApplyController.java new file mode 100644 index 0000000..973eed3 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/controller/ApplyController.java @@ -0,0 +1,116 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +import com.ruoyi.business.domain.Rebot; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.business.domain.Apply; +import com.ruoyi.business.service.IApplyService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 应用信息管理Controller + * + * @author LiuChengRan + * @date 2024-06-13 + */ +@Api(tags = "应用信息管理接口") +@RestController +@RequestMapping("/business/ctApply") +public class ApplyController extends BaseController { + @Autowired + private IApplyService applyService; + + /** + * 同步应用数据 + */ + @ApiOperation(value = "同步应用数据", httpMethod = "POST", response = Rebot.class) + @PostMapping("/syn") + public AjaxResult syn(Apply apply) { + applyService.syn(apply); + return AjaxResult.success(); + } + + + /** + * 查询应用信息管理列表 + */ + @ApiOperation(value = "查询应用信息管理列表", httpMethod = "GET", response = Apply.class) + @GetMapping("/list") + public TableDataInfo list(Apply apply) { + startPage(); + List list = applyService.list(apply); + return getDataTable(list); + } + + /** + * 导出应用信息管理列表 + */ + @ApiOperation(value = "导出应用信息管理列表", httpMethod = "POST") + @Log(title = "应用信息管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Apply apply) { + List list = applyService.list(apply); + ExcelUtil util = new ExcelUtil(Apply.class); + util.exportExcel(response, list, "应用信息管理数据"); + } + + /** + * 获取应用信息管理详细信息 + */ + @ApiOperation(value = "获取应用信息管理详细信息", httpMethod = "GET", response = Apply.class) + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(applyService.getById(id)); + } + + /** + * 新增应用信息管理 + */ + @ApiOperation(value = "新增应用信息管理", httpMethod = "POST") + @Log(title = "应用信息管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Apply apply) { + return toAjax(applyService.save(apply)); + } + + /** + * 修改应用信息管理 + */ + @ApiOperation(value = "修改应用信息管理", httpMethod = "PUT") + @Log(title = "应用信息管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Apply apply) { + return toAjax(applyService.updateById(apply)); + } + + /** + * 删除应用信息管理 + */ + @ApiOperation(value = "删除应用信息管理", httpMethod = "DELETE") + @Log(title = "应用信息管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(applyService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessSurveyController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessSurveyController.java deleted file mode 100644 index febed77..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessSurveyController.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.ruoyi.business.controller; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import com.alibaba.fastjson2.JSONArray; -import com.alibaba.fastjson2.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.ruoyi.business.domain.BusinessTemplate; -import com.ruoyi.business.domain.BusinessTemplateProp; -import com.ruoyi.business.domain.BusinessTemplatePropValue; -import com.ruoyi.business.service.IBusinessTemplatePropService; -import com.ruoyi.business.service.IBusinessTemplateService; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.business.domain.BusinessSurvey; -import com.ruoyi.business.service.IBusinessSurveyService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import java.util.Arrays; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import com.ruoyi.common.core.page.TableDataInfo; - -/** - * 调查问卷管理Controller - * - * @author ruoyi - * @date 2024-04-01 - */ -@RestController -@RequestMapping("/business/survey") -public class BusinessSurveyController extends BaseController -{ - @Autowired - private IBusinessSurveyService businessSurveyService; - - - /** - * 获取问卷属性 - */ - @GetMapping("/listBySurveyId") - public AjaxResult listBySurveyId(String surveyId) { - return businessSurveyService.listBySurveyId(surveyId); - } - - - - /** - * 查询调查问卷管理列表 - */ - @PreAuthorize("@ss.hasPermi('business:survey:list')") - @GetMapping("/list") - public TableDataInfo list(BusinessSurvey businessSurvey) - { - startPage(); - List list = businessSurveyService.lambdaQuery() - .eq(StringUtils.isNotEmpty(businessSurvey.getTitle()),BusinessSurvey::getTitle,businessSurvey.getTitle()) - .eq(StringUtils.isNotBlank(businessSurvey.getOpen()),BusinessSurvey::getOpen,businessSurvey.getOpen()).list(); - return getDataTable(list); - } - - /** - * 导出调查问卷管理列表 - */ - @PreAuthorize("@ss.hasPermi('business:survey:export')") - @Log(title = "调查问卷管理", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, BusinessSurvey businessSurvey) - { - List list = businessSurveyService.list(); - ExcelUtil util = new ExcelUtil(BusinessSurvey.class); - util.exportExcel(response, list, "调查问卷管理数据"); - } - - /** - * 获取调查问卷管理详细信息 - */ - @PreAuthorize("@ss.hasPermi('business:survey:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(businessSurveyService.getById(id)); - } - @Autowired - private IBusinessTemplateService businessTemplateService; - /** - * 新增调查问卷管理 - */ - @PreAuthorize("@ss.hasPermi('business:survey:add')") - @Log(title = "调查问卷管理", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody BusinessSurvey businessSurvey) - { - BusinessTemplate one = businessTemplateService.lambdaQuery().eq(BusinessTemplate::getId, businessSurvey.getTempId()).one(); - businessSurvey.setTempName(one.getTitle()); - return toAjax(businessSurveyService.save(businessSurvey)); - } - - /** - * 修改调查问卷管理 - */ - @PreAuthorize("@ss.hasPermi('business:survey:edit')") - @Log(title = "调查问卷管理", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody BusinessSurvey businessSurvey) - { - BusinessTemplate one = businessTemplateService.lambdaQuery().eq(BusinessTemplate::getId, businessSurvey.getTempId()).one(); - businessSurvey.setTempName(one.getTitle()); - return toAjax(businessSurveyService.updateById(businessSurvey)); - } - - /** - * 删除调查问卷管理 - */ - @PreAuthorize("@ss.hasPermi('business:survey:remove')") - @Log(title = "调查问卷管理", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(businessSurveyService.removeByIds(Arrays.asList(ids))); - } -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplateController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplateController.java deleted file mode 100644 index 7c3373b..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplateController.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.ruoyi.business.controller; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.ruoyi.business.domain.BusinessSurvey; -import com.ruoyi.business.service.IBusinessSurveyService; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.business.domain.BusinessTemplate; -import com.ruoyi.business.service.IBusinessTemplateService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import java.util.Arrays; -import com.ruoyi.common.core.page.TableDataInfo; - -/** - * 模版管理Controller - * - * @author ruoyi - * @date 2024-03-31 - */ -@RestController -@RequestMapping("/business/template") -public class BusinessTemplateController extends BaseController -{ - @Autowired - private IBusinessTemplateService businessTemplateService; - - /** - * 查询模版管理列表 - */ - @PreAuthorize("@ss.hasPermi('business:template:list')") - @GetMapping("/list") - public TableDataInfo list(BusinessTemplate businessTemplate) - { - startPage(); - LambdaQueryWrapper like = new LambdaQueryWrapper() - .eq(StringUtils.isNotBlank( businessTemplate.getOpen()),BusinessTemplate::getOpen, businessTemplate.getOpen()) - .like(StringUtils.isNotBlank(businessTemplate.getTitle()), BusinessTemplate::getTitle, businessTemplate.getTitle()); - if(businessTemplate.getCreateBy() != null){ - logger.debug("SecurityUtils.getUsername():{}",SecurityUtils.getUsername()); - like.eq(BusinessTemplate::getCreateBy, SecurityUtils.getUsername()); - } - List list = businessTemplateService.list(like); - return getDataTable(list); - } - - /** - * 查询模版管理列表 - */ - @PreAuthorize("@ss.hasPermi('business:template:list')") - @GetMapping("/listAll") - public AjaxResult listAll(BusinessTemplate businessTemplate) - { - List list = businessTemplateService.list( - new LambdaQueryWrapper().eq(BusinessTemplate::getCreateBy,SecurityUtils.getUsername()) - .eq(StringUtils.isNotBlank(businessTemplate.getId()),BusinessTemplate::getId,businessTemplate.getId()) - ); - return AjaxResult.success(list); - } - - /** - * 导出模版管理列表 - */ - @PreAuthorize("@ss.hasPermi('business:template:export')") - @Log(title = "模版管理", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, BusinessTemplate businessTemplate) - { - List list = businessTemplateService.list(); - ExcelUtil util = new ExcelUtil(BusinessTemplate.class); - util.exportExcel(response, list, "模版管理数据"); - } - - /** - * 获取模版管理详细信息 - */ - @PreAuthorize("@ss.hasPermi('business:template:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(businessTemplateService.getById(id)); - } - - - /** - * 新增模版管理 - */ - @PreAuthorize("@ss.hasPermi('business:template:add')") - @Log(title = "模版管理", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody BusinessTemplate businessTemplate) - { - return toAjax(businessTemplateService.save(businessTemplate)); - } - - @Autowired - private IBusinessSurveyService businessSurveyService; - /** - * 修改模版管理 - */ - @PreAuthorize("@ss.hasPermi('business:template:edit')") - @Log(title = "模版管理", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody BusinessTemplate businessTemplate) - { - BusinessSurvey businessSurvey = new BusinessSurvey(); - businessSurvey.setTempName(businessTemplate.getTitle()); - businessSurveyService.lambdaUpdate().eq(BusinessSurvey::getTempId, businessTemplate.getId()).update(businessSurvey); - return toAjax(businessTemplateService.updateById(businessTemplate)); - } - - /** - * 删除模版管理 - */ - @PreAuthorize("@ss.hasPermi('business:template:remove')") - @Log(title = "模版管理", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(businessTemplateService.removeByIds(Arrays.asList(ids))); - } -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropController.java deleted file mode 100644 index 47c35b6..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropController.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.ruoyi.business.controller; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import com.alibaba.fastjson2.JSON; -import com.alibaba.fastjson2.JSONArray; -import com.alibaba.fastjson2.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.ruoyi.business.domain.BusinessTemplatePropValue; -import com.ruoyi.business.service.IBusinessTemplatePropValueService; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.business.domain.BusinessTemplateProp; -import com.ruoyi.business.service.IBusinessTemplatePropService; -import com.ruoyi.common.utils.poi.ExcelUtil; - -import java.util.Arrays; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import com.ruoyi.common.core.page.TableDataInfo; - -/** - * 模版属性Controller - * - * @author ruoyi - * @date 2024-03-31 - */ -@RestController -@RequestMapping("/business/templateProp") -public class BusinessTemplatePropController extends BaseController { - @Autowired - private IBusinessTemplatePropService businessTemplatePropService; - - @Autowired - private IBusinessTemplatePropValueService businessTemplatePropValueService; - - - /** - * 查询模版属性列表 - */ - @PreAuthorize("@ss.hasPermi('business:templateProp:list')") - @GetMapping("/list") - public TableDataInfo list(BusinessTemplateProp businessTemplateProp) { - startPage(); - List list = businessTemplatePropService.list(new LambdaQueryWrapper() - .eq(StringUtils.isNotBlank(businessTemplateProp.getCompType()),BusinessTemplateProp::getCompType,businessTemplateProp.getCompType()) - .eq(StringUtils.isNotBlank(businessTemplateProp.getFieldName()),BusinessTemplateProp::getFieldName,businessTemplateProp.getFieldName()) - .eq(StringUtils.isNotBlank(businessTemplateProp.getId()),BusinessTemplateProp::getId,businessTemplateProp.getId()) - .eq(BusinessTemplateProp::getTempId,businessTemplateProp.getTempId()) - ); - return getDataTable(list); - } - - /** - * 导出模版属性列表 - */ - @PreAuthorize("@ss.hasPermi('business:templateProp:export')") - @Log(title = "模版属性" , businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, BusinessTemplateProp businessTemplateProp) { - List list = businessTemplatePropService.list(); - ExcelUtil util = new ExcelUtil(BusinessTemplateProp.class); - util.exportExcel(response, list, "模版属性数据"); - } - - /** - * 获取模版属性详细信息 - */ - @PreAuthorize("@ss.hasPermi('business:templateProp:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(businessTemplatePropService.getById(id)); - } - - /** - * 新增模版属性 - */ - @PreAuthorize("@ss.hasPermi('business:templateProp:add')") - @Log(title = "模版属性" , businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody BusinessTemplateProp businessTemplateProp) { - return toAjax(businessTemplatePropService.save(businessTemplateProp)); - } - - /** - * 修改模版属性 - */ - @PreAuthorize("@ss.hasPermi('business:templateProp:edit')") - @Log(title = "模版属性" , businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody BusinessTemplateProp businessTemplateProp) { - return toAjax(businessTemplatePropService.updateById(businessTemplateProp)); - } - - /** - * 删除模版属性 - */ - @PreAuthorize("@ss.hasPermi('business:templateProp:remove')") - @Log(title = "模版属性" , businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) { - return toAjax(businessTemplatePropService.removeByIds(Arrays.asList(ids))); - } -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropValueController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropValueController.java deleted file mode 100644 index 73205c8..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/controller/BusinessTemplatePropValueController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.ruoyi.business.controller; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.business.domain.BusinessTemplatePropValue; -import com.ruoyi.business.service.IBusinessTemplatePropValueService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import java.util.Arrays; -import java.util.Map; - -import com.ruoyi.common.core.page.TableDataInfo; - -/** - * 模版属性值Controller - * - * @author ruoyi - * @date 2024-03-31 - */ -@RestController -@RequestMapping("/business/templatePropValue") -public class BusinessTemplatePropValueController extends BaseController -{ - @Autowired - private IBusinessTemplatePropValueService businessTemplatePropValueService; - - /** - * 查询模版属性值列表 - */ - @PreAuthorize("@ss.hasPermi('business:templatePropValue:list')") - @GetMapping("/list") - public TableDataInfo list(BusinessTemplatePropValue businessTemplatePropValue) - { - startPage(); - List list = businessTemplatePropValueService.list(); - return getDataTable(list); - } - - /** - * 统计问卷 - */ - @GetMapping("/countGroup") - public AjaxResult countGroup(String surveyId) - { - Object o = businessTemplatePropValueService.countGroup(surveyId); - return AjaxResult.success(o); - } - - /** - * 导出模版属性值列表 - */ - @PreAuthorize("@ss.hasPermi('business:templatePropValue:export')") - @Log(title = "模版属性值", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, BusinessTemplatePropValue businessTemplatePropValue) - { - List list = businessTemplatePropValueService.list(); - ExcelUtil util = new ExcelUtil(BusinessTemplatePropValue.class); - util.exportExcel(response, list, "模版属性值数据"); - } - - /** - * 获取模版属性值详细信息 - */ - @PreAuthorize("@ss.hasPermi('business:templatePropValue:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(businessTemplatePropValueService.getById(id)); - } - - /** - * 新增模版属性值 - */ - @PreAuthorize("@ss.hasPermi('business:templatePropValue:add')") - @Log(title = "模版属性值", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody BusinessTemplatePropValue businessTemplatePropValue) - { - return toAjax(businessTemplatePropValueService.save(businessTemplatePropValue)); - } - - - /** - * 新增模版属性值 - */ - @Log(title = "模版属性值", businessType = BusinessType.INSERT) - @PostMapping("/addList") - public AjaxResult addList(@RequestBody Map data) - { - return toAjax(businessTemplatePropValueService.addList(data)); - } - - /** - * 修改模版属性值 - */ - @PreAuthorize("@ss.hasPermi('business:templatePropValue:edit')") - @Log(title = "模版属性值", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody BusinessTemplatePropValue businessTemplatePropValue) - { - return toAjax(businessTemplatePropValueService.updateById(businessTemplatePropValue)); - } - - /** - * 删除模版属性值 - */ - @PreAuthorize("@ss.hasPermi('business:templatePropValue:remove')") - @Log(title = "模版属性值", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(businessTemplatePropValueService.removeByIds(Arrays.asList(ids))); - } -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/controller/RebotController.java b/ruoyi-business/src/main/java/com/ruoyi/business/controller/RebotController.java new file mode 100644 index 0000000..e7b953f --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/controller/RebotController.java @@ -0,0 +1,114 @@ +package com.ruoyi.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.business.domain.Rebot; +import com.ruoyi.business.service.IRebotService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 机器人管理Controller + * + * @author LiuChengRan + * @date 2024-06-13 + */ +@Api(tags = "机器人管理接口") +@RestController +@RequestMapping("/business/ctRebot") +public class RebotController extends BaseController { + @Autowired + private IRebotService rebotService; + + /** + * 同步机器人数据 + */ + @ApiOperation(value = "同步机器人数据", httpMethod = "POST", response = Rebot.class) + @PostMapping("/syn") + public AjaxResult syn(Rebot rebot) { + rebotService.syn(rebot); + return AjaxResult.success(); + } + + /** + * 查询机器人管理列表 + */ + @ApiOperation(value = "查询机器人管理列表", httpMethod = "GET", response = Rebot.class) + @GetMapping("/list") + public TableDataInfo list(Rebot rebot) { + startPage(); + List list = rebotService.list(rebot); + return getDataTable(list); + } + + /** + * 导出机器人管理列表 + */ + @ApiOperation(value = "导出机器人管理列表", httpMethod = "POST") + @Log(title = "机器人管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Rebot rebot) { + List list = rebotService.list(rebot); + ExcelUtil util = new ExcelUtil(Rebot.class); + util.exportExcel(response, list, "机器人管理数据"); + } + + /** + * 获取机器人管理详细信息 + */ + @ApiOperation(value = "获取机器人管理详细信息", httpMethod = "GET", response = Rebot.class) + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(rebotService.getById(id)); + } + + /** + * 新增机器人管理 + */ + @ApiOperation(value = "新增机器人管理", httpMethod = "POST") + @Log(title = "机器人管理", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Rebot rebot) { + return toAjax(rebotService.save(rebot)); + } + + /** + * 修改机器人管理 + */ + @ApiOperation(value = "修改机器人管理", httpMethod = "PUT") + @Log(title = "机器人管理", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Rebot rebot) { + return toAjax(rebotService.updateById(rebot)); + } + + /** + * 删除机器人管理 + */ + @ApiOperation(value = "删除机器人管理", httpMethod = "DELETE") + @Log(title = "机器人管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(rebotService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/Apply.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/Apply.java new file mode 100644 index 0000000..3a53611 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/Apply.java @@ -0,0 +1,120 @@ +package com.ruoyi.business.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.baomidou.mybatisplus.annotation.*; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import lombok.Data; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.NoArgsConstructor; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.IdType; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 应用信息管理对象 ct_apply + * + * @author LiuChengRan + * @date 2024-06-13 + */ +@Data +@Builder(toBuilder = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value="Apply",description = "应用信息管理") +@TableName(value = "ct_apply") +public class Apply extends BaseEntity +{ + @TableField(exist = false) + private static final long serialVersionUID = 1L; + /** 应用所有者名称 */ + @Excel(name = "应用所有者名称") + @ApiModelProperty(name="ownerName",value = "应用所有者名称") + private String ownerName; + /** 应用所有者账号 */ + @Excel(name = "应用所有者账号") + @ApiModelProperty(name="ownerAccount",value = "应用所有者账号") + private String ownerAccount; + /** 所有者id */ + @Excel(name = "所有者id") + @ApiModelProperty(name="ownerId",value = "所有者id") + private String ownerId; + /** appid */ + @Excel(name = "appid") + @ApiModelProperty(name="appId",value = "appid") + private String appId; + /** 应用名称 */ + @Excel(name = "应用名称") + @ApiModelProperty(name="appName",value = "应用名称") + private String appName; + /** 应用类型名称 */ + @Excel(name = "应用类型名称") + @ApiModelProperty(name="appTypeName",value = "应用类型名称") + private String appTypeName; + /** 应用类型枚举(app:应用 activity:指令) */ + @Excel(name = "应用类型枚举", readConverterExp = "a=pp:应用,a=ctivity:指令") + @ApiModelProperty(name="appType",value = "应用类型枚举") + private String appType; + /** 应用创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "应用创建时间", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty(name="appCreateTime",value = "应用创建时间") + private Date appCreateTime; + /** 应用修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "应用修改时间", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty(name="appUpdateTime",value = "应用修改时间") + private Date appUpdateTime; + /** 版本,值内容:未发版、版本 */ + @Excel(name = "版本,值内容:未发版、版本") + @ApiModelProperty(name="version",value = "版本,值内容:未发版、版本") + private String version; + /** 是否支持应用参数 */ + @Excel(name = "是否支持应用参数") + @ApiModelProperty(name="supportParam",value = "是否支持应用参数") + private Integer supportParam; + /** icon图下载地址 */ + @Excel(name = "icon图下载地址") + @ApiModelProperty(name="icon",value = "icon图下载地址") + private String icon; + /** 预计人工耗时 */ + @Excel(name = "预计人工耗时") + @ApiModelProperty(name="manualTime",value = "预计人工耗时") + private String manualTime; + /** 所属公司 */ + @Excel(name = "所属公司") + @ApiModelProperty(name="deptId",value = "所属公司") + private Long deptId; + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("ownerName", getOwnerName()) + .append("ownerAccount", getOwnerAccount()) + .append("ownerId", getOwnerId()) + .append("appId", getAppId()) + .append("appName", getAppName()) + .append("appTypeName", getAppTypeName()) + .append("appType", getAppType()) + .append("appCreateTime", getAppCreateTime()) + .append("appUpdateTime", getAppUpdateTime()) + .append("version", getVersion()) + .append("supportParam", getSupportParam()) + .append("icon", getIcon()) + .append("manualTime", getManualTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("deleted", getDeleted()) + .toString(); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessSurvey.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessSurvey.java deleted file mode 100644 index 2d11671..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessSurvey.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ruoyi.business.domain; - -import lombok.Data; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; - -import java.util.ArrayList; - -/** - * 调查问卷管理对象 business_survey - * - * @author ruoyi - * @date 2024-04-01 - */ -@Data -public class BusinessSurvey extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - - - /** 问卷名称 */ - @Excel(name = "问卷名称") - private String title; - - - /** 问卷描述 */ - @Excel(name = "问卷描述") - private String context; - - - /** 模板id */ - @Excel(name = "模板id") - private String tempId; - - - /** 模板名称 */ - @Excel(name = "模板名称") - private String tempName; - - - /** 是否开放 */ - @Excel(name = "是否开放") - private String open; - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("title", getTitle()) - .append("context", getContext()) - .append("tempId", getTempId()) - .append("open", getOpen()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("deleted", getDeleted()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplate.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplate.java deleted file mode 100644 index 004332e..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplate.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.ruoyi.business.domain; - -import lombok.Data; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 模版管理对象 business_template - * - * @author ruoyi - * @date 2024-03-31 - */ -@Data -public class BusinessTemplate extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 标题 */ - @Excel(name = "标题") - private String title; - - - /** 内容 */ - @Excel(name = "内容") - private String context; - - - /** 是否开放 */ - @Excel(name = "是否开放") - private String open; - - - public void setTitle(String title) - { - this.title = title; - } - - public String getTitle() - { - return title; - } - public void setContext(String context) - { - this.context = context; - } - - public String getContext() - { - return context; - } - public void setOpen(String open) - { - this.open = open; - } - - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("title", getTitle()) - .append("context", getContext()) - .append("open", getOpen()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplateProp.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplateProp.java deleted file mode 100644 index b1f8e3a..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplateProp.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.ruoyi.business.domain; - -import com.alibaba.fastjson2.JSON; -import com.baomidou.mybatisplus.annotation.TableField; -import lombok.Data; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 模版属性对象 business_template_prop - * - * @author ruoyi - * @date 2024-03-31 - */ -@Data -public class BusinessTemplateProp extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - - /** 标题 */ - @Excel(name = "标题") - private String title; - - - /** 组件类型(0单选框 1多选框) */ - @Excel(name = "组件类型", readConverterExp = "0=单选框,1=多选框") - private String compType; - - - /** 字段名 */ - @Excel(name = "字段名") - private String fieldName; - - - /** 占位提示 */ - @Excel(name = "占位提示") - private String placPrompt; - - - /** 默认值 */ - @Excel(name = "默认值") - private String defaultValue; - - - /** 可选值 */ - @Excel(name = "可选值") - private String optionalValue; - - /** 可选值数组 */ - @Excel(name = "可选值数组") - @TableField(exist = false) - private List> optionalValues = new ArrayList>(); - - /** 是否开放 */ - @Excel(name = "是否开放") - private String open; - - - /** 模版id */ - @Excel(name = "模版id") - private Long tempId; - - /** 排序 */ - @Excel(name = "排序") - private Integer sort; - - public void setTitle(String title) - { - this.title = title; - } - - public String getTitle() - { - return title; - } - public void setCompType(String compType) - { - this.compType = compType; - } - - public String getCompType() - { - return compType; - } - public void setFieldName(String fieldName) - { - this.fieldName = fieldName; - } - - public String getFieldName() - { - return fieldName; - } - public void setPlacPrompt(String placPrompt) - { - this.placPrompt = placPrompt; - } - - public String getPlacPrompt() - { - return placPrompt; - } - public void setDefaultValue(String defaultValue) - { - this.defaultValue = defaultValue; - } - - public String getDefaultValue() - { - return defaultValue; - } - public void setOptionalValue(String optionalValue) - { - if(StringUtils.isNotBlank(optionalValue)){ - String[] split = optionalValue.split("\\|"); - - for (String s : split) { - Map dataMap = new HashMap<>(); - String[] value = s.split(","); - dataMap.put("key",value[0]); - dataMap.put("value",value[1]); - this.optionalValues.add(dataMap); - } - - } - this.optionalValue = optionalValue; - } - - public String getOptionalValue() - { - return optionalValue; - } - public void setOpen(String open) - { - this.open = open; - } - - public String getOpen() - { - return open; - } - public void setTempId(Long tempId) - { - this.tempId = tempId; - } - - public Long getTempId() - { - return tempId; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("title", getTitle()) - .append("compType", getCompType()) - .append("fieldName", getFieldName()) - .append("placPrompt", getPlacPrompt()) - .append("defaultValue", getDefaultValue()) - .append("optionalValue", getOptionalValue()) - .append("open", getOpen()) - .append("tempId", getTempId()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("deleted", getDeleted()) - .append("remark", getRemark()) - .toString(); - } - -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplatePropValue.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplatePropValue.java deleted file mode 100644 index 6c08563..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BusinessTemplatePropValue.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.ruoyi.business.domain; - -import lombok.Data; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; - -/** - * 模版属性值对象 business_template_prop_value - * - * @author ruoyi - * @date 2024-03-31 - */ -@Data -public class BusinessTemplatePropValue extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - - - /** 字段id */ - @Excel(name = "字段id") - private String propId; - - - /** 字段名称 */ - @Excel(name = "字段名称") - private String propName; - - - /** 字段类型 */ - @Excel(name = "字段类型") - private String propType; - - /** 值键 */ - @Excel(name = "值键") - private String valueKey; - - - /** 值描述 */ - @Excel(name = "值描述") - private String valueText; - - - /** 原值对象 */ - @Excel(name = "原值对象") - private String valueSources; - - - /** 试卷id */ - @Excel(name = "试卷id") - private String surveyId; - - - - - - public void setPropId(String propId) - { - this.propId = propId; - } - - public String getPropId() - { - return propId; - } - public void setPropName(String propName) - { - this.propName = propName; - } - - public String getPropName() - { - return propName; - } - public void setValueKey(String valueKey) - { - this.valueKey = valueKey; - } - - public String getValueKey() - { - return valueKey; - } - public void setValueText(String valueText) - { - this.valueText = valueText; - } - - public String getValueText() - { - return valueText; - } - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("propId", getPropId()) - .append("propName", getPropName()) - .append("valueKey", getValueKey()) - .append("valueText", getValueText()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("deleted", getDeleted()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/Rebot.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/Rebot.java new file mode 100644 index 0000000..f4fdb0a --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/Rebot.java @@ -0,0 +1,95 @@ +package com.ruoyi.business.domain; + + +import com.baomidou.mybatisplus.annotation.*; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import lombok.Data; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.NoArgsConstructor; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.IdType; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 机器人管理对象 ct_rebot + * + * @author LiuChengRan + * @date 2024-06-14 + */ +@Data +@Builder(toBuilder = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value="Rebot",description = "机器人管理") +@TableName(value = "ct_rebot") +public class Rebot extends BaseEntity +{ + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + + + /** 机器人名称 */ + @Excel(name = "机器人名称") + @ApiModelProperty(name="robotClientName",value = "机器人名称") + private String robotClientName; + + /** 机器人Uuid信息 */ + @Excel(name = "机器人Uuid信息") + @ApiModelProperty(name="robotClientUuid",value = "机器人Uuid信息") + private String robotClientUuid; + + + /** 运行状态(waiting:等待调度 running:任务运行中 finish:任务运行结束 stopping:任务正在停止 stopped:已结束 error:异常) */ + @Excel(name = "运行状态", readConverterExp = "w=aiting:等待调度,r=unning:任务运行中,f=inish:任务运行结束,s=topping:任务正在停止,s=topped:已结束,e=rror:异常") + @ApiModelProperty(name="status",value = "运行状态") + private String status; + + /** 描述 */ + @Excel(name = "描述") + @ApiModelProperty(name="description",value = "描述") + private String description; + + /** 客户端系统账号 */ + @Excel(name = "客户端系统账号") + @ApiModelProperty(name="windowsAccount",value = "客户端系统账号") + private String windowsAccount; + + /** 客户端ip */ + @Excel(name = "客户端ip") + @ApiModelProperty(name="clientIp",value = "客户端ip") + private String clientIp; + + /** 部门id */ + @Excel(name = "部门id") + @ApiModelProperty(name="deptId",value = "部门id") + private Long deptId; + + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("robotClientName", getRobotClientName()) + .append("robotClientUuid", getRobotClientUuid()) + .append("status", getStatus()) + .append("description", getDescription()) + .append("windowsAccount", getWindowsAccount()) + .append("clientIp", getClientIp()) + .append("deptId", getDeptId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("deleted", getDeleted()) + .toString(); + } +} \ No newline at end of file diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/bo/ListApplyBO.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/bo/ListApplyBO.java new file mode 100644 index 0000000..c3af1da --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/bo/ListApplyBO.java @@ -0,0 +1,121 @@ +package com.ruoyi.business.domain.bo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 应用信息管理对象 ct_apply + * + * @author LiuChengRan + * @date 2024-06-13 + */ +@Data +@Builder(toBuilder = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value="ListApplyVO",description = "应用信息管理") +public class ListApplyBO extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + @ApiModelProperty(name = "page", value = "第几页") + private Integer page; + + @ApiModelProperty(name = "size", value = "页大小") + private Integer size; + + /** 应用所有者名称 */ + @Excel(name = "应用所有者名称") + @ApiModelProperty(name="ownerName",value = "应用所有者名称") + private String ownerName; + /** 应用所有者账号 */ + @Excel(name = "应用所有者账号") + @ApiModelProperty(name="ownerAccount",value = "应用所有者账号") + private String ownerAccount; + /** 所有者id */ + @Excel(name = "所有者id") + @ApiModelProperty(name="ownerId",value = "所有者id") + private String ownerId; + /** appid */ + @Excel(name = "appid") + @ApiModelProperty(name="appId",value = "appid") + private String appId; + /** 应用名称 */ + @Excel(name = "应用名称") + @ApiModelProperty(name="appName",value = "应用名称") + private String appName; + /** 应用类型名称 */ + @Excel(name = "应用类型名称") + @ApiModelProperty(name="appTypeName",value = "应用类型名称") + private String appTypeName; + /** 应用类型枚举(app:应用 activity:指令) */ + @Excel(name = "应用类型枚举", readConverterExp = "a=pp:应用,a=ctivity:指令") + @ApiModelProperty(name="appType",value = "应用类型枚举") + private String appType; + /** 应用创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "应用创建时间", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty(name="appCreateTime",value = "应用创建时间") + private Date appCreateTime; + /** 应用修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "应用修改时间", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty(name="appUpdateTime",value = "应用修改时间") + private Date appUpdateTime; + /** 版本,值内容:未发版、版本 */ + @Excel(name = "版本,值内容:未发版、版本") + @ApiModelProperty(name="version",value = "版本,值内容:未发版、版本") + private String version; + /** 是否支持应用参数 */ + @Excel(name = "是否支持应用参数") + @ApiModelProperty(name="supportParam",value = "是否支持应用参数") + private Integer supportParam; + /** icon图下载地址 */ + @Excel(name = "icon图下载地址") + @ApiModelProperty(name="icon",value = "icon图下载地址") + private String icon; + /** 预计人工耗时 */ + @Excel(name = "预计人工耗时") + @ApiModelProperty(name="manualTime",value = "预计人工耗时") + private String manualTime; + /** 所属公司 */ + @Excel(name = "所属公司") + @ApiModelProperty(name="deptId",value = "所属公司") + private Long deptId; + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("ownerName", getOwnerName()) + .append("ownerAccount", getOwnerAccount()) + .append("ownerId", getOwnerId()) + .append("appId", getAppId()) + .append("appName", getAppName()) + .append("appTypeName", getAppTypeName()) + .append("appType", getAppType()) + .append("appCreateTime", getAppCreateTime()) + .append("appUpdateTime", getAppUpdateTime()) + .append("version", getVersion()) + .append("supportParam", getSupportParam()) + .append("icon", getIcon()) + .append("manualTime", getManualTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("deleted", getDeleted()) + .toString(); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/bo/ListRebotBO.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/bo/ListRebotBO.java new file mode 100644 index 0000000..3fb9da3 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/bo/ListRebotBO.java @@ -0,0 +1,47 @@ +package com.ruoyi.business.domain.bo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.io.Serializable; + +/** + * 机器人查询参数 + * + * @author LiuChengRan + * @date 2024-06-13 + */ +@Data +@Builder(toBuilder = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "ListRebotBO", description = "机器人查询参数") +public class ListRebotBO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(name = "status", value = "机器人状态") + private String status; + + @ApiModelProperty(name = "key", value = "关键字模糊搜索") + private String key; + + @ApiModelProperty(name = "robotClientGroupUuid", value = "robotClientGroupUuid") + private String robotClientGroupUuid; + + @ApiModelProperty(name = "page", value = "第几页") + private Integer page; + + @ApiModelProperty(name = "size", value = "页大小") + private Integer size; + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/vo/ListApplyVO.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/vo/ListApplyVO.java new file mode 100644 index 0000000..f4acf15 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/vo/ListApplyVO.java @@ -0,0 +1,116 @@ +package com.ruoyi.business.domain.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 应用信息管理对象 ct_apply + * + * @author LiuChengRan + * @date 2024-06-13 + */ +@Data +@Builder(toBuilder = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value="ListApplyVO",description = "应用信息管理") +public class ListApplyVO extends BaseEntity +{ + private static final long serialVersionUID = 1L; + /** 应用所有者名称 */ + @Excel(name = "应用所有者名称") + @ApiModelProperty(name="ownerName",value = "应用所有者名称") + private String ownerName; + /** 应用所有者账号 */ + @Excel(name = "应用所有者账号") + @ApiModelProperty(name="ownerAccount",value = "应用所有者账号") + private String ownerAccount; + /** 所有者id */ + @Excel(name = "所有者id") + @ApiModelProperty(name="ownerId",value = "所有者id") + private String ownerId; + /** appid */ + @Excel(name = "appid") + @ApiModelProperty(name="appId",value = "appid") + private String appId; + /** 应用名称 */ + @Excel(name = "应用名称") + @ApiModelProperty(name="appName",value = "应用名称") + private String appName; + /** 应用类型名称 */ + @Excel(name = "应用类型名称") + @ApiModelProperty(name="appTypeName",value = "应用类型名称") + private String appTypeName; + /** 应用类型枚举(app:应用 activity:指令) */ + @Excel(name = "应用类型枚举", readConverterExp = "a=pp:应用,a=ctivity:指令") + @ApiModelProperty(name="appType",value = "应用类型枚举") + private String appType; + /** 应用创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "应用创建时间", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty(name="appCreateTime",value = "应用创建时间") + private Date appCreateTime; + /** 应用修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "应用修改时间", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty(name="appUpdateTime",value = "应用修改时间") + private Date appUpdateTime; + /** 版本,值内容:未发版、版本 */ + @Excel(name = "版本,值内容:未发版、版本") + @ApiModelProperty(name="version",value = "版本,值内容:未发版、版本") + private String version; + /** 是否支持应用参数 */ + @Excel(name = "是否支持应用参数") + @ApiModelProperty(name="supportParam",value = "是否支持应用参数") + private Integer supportParam; + /** icon图下载地址 */ + @Excel(name = "icon图下载地址") + @ApiModelProperty(name="icon",value = "icon图下载地址") + private String icon; + /** 预计人工耗时 */ + @Excel(name = "预计人工耗时") + @ApiModelProperty(name="manualTime",value = "预计人工耗时") + private String manualTime; + /** 所属公司 */ + @Excel(name = "所属公司") + @ApiModelProperty(name="deptId",value = "所属公司") + private Long deptId; + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("ownerName", getOwnerName()) + .append("ownerAccount", getOwnerAccount()) + .append("ownerId", getOwnerId()) + .append("appId", getAppId()) + .append("appName", getAppName()) + .append("appTypeName", getAppTypeName()) + .append("appType", getAppType()) + .append("appCreateTime", getAppCreateTime()) + .append("appUpdateTime", getAppUpdateTime()) + .append("version", getVersion()) + .append("supportParam", getSupportParam()) + .append("icon", getIcon()) + .append("manualTime", getManualTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("deleted", getDeleted()) + .toString(); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/vo/ListRebotVO.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/vo/ListRebotVO.java new file mode 100644 index 0000000..2ffaf5d --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/vo/ListRebotVO.java @@ -0,0 +1,83 @@ +package com.ruoyi.business.domain.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 机器人管理对象 ct_rebot + * + * @author LiuChengRan + * @date 2024-06-13 + */ +@Data +@Builder(toBuilder = true) +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "ListRebotVo", description = "机器人管理") +public class ListRebotVO extends BaseEntity { + + private static final long serialVersionUID = 1L; + + + /** 机器人名称 */ + @Excel(name = "机器人名称") + @ApiModelProperty(name="robotClientName",value = "机器人名称") + private String robotClientName; + + /** 机器人Uuid信息 */ + @Excel(name = "机器人Uuid信息") + @ApiModelProperty(name="robotClientUuid",value = "机器人Uuid信息") + private String robotClientUuid; + + + /** 运行状态(waiting:等待调度 running:任务运行中 finish:任务运行结束 stopping:任务正在停止 stopped:已结束 error:异常) */ + @Excel(name = "运行状态", readConverterExp = "w=aiting:等待调度,r=unning:任务运行中,f=inish:任务运行结束,s=topping:任务正在停止,s=topped:已结束,e=rror:异常") + @ApiModelProperty(name="status",value = "运行状态") + private String status; + + /** 描述 */ + @Excel(name = "描述") + @ApiModelProperty(name="description",value = "描述") + private String description; + + /** 客户端系统账号 */ + @Excel(name = "客户端系统账号") + @ApiModelProperty(name="windowsAccount",value = "客户端系统账号") + private String windowsAccount; + + /** 客户端ip */ + @Excel(name = "客户端ip") + @ApiModelProperty(name="clientIp",value = "客户端ip") + private String clientIp; + + /** 部门id */ + @Excel(name = "部门id") + @ApiModelProperty(name="deptId",value = "部门id") + private Long deptId; + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("robotClientUuid", getRobotClientUuid()) + .append("status", getStatus()) + .append("description", getDescription()) + .append("clientIp", getClientIp()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("deleted", getDeleted()) + .toString(); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/ApplyMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/ApplyMapper.java new file mode 100644 index 0000000..c0af6f6 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/ApplyMapper.java @@ -0,0 +1,24 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.business.domain.Apply; + +/** + * 应用信息管理Mapper接口 + * + * @author LiuChengRan + * @date 2024-06-13 + */ +public interface ApplyMapper extends BaseMapper +{ + + /** + * 查询应用信息管理列表 + * + * @param apply 应用信息管理 + * @return 应用信息管理集合 + */ + List selectApplyList(Apply apply); + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessSurveyMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessSurveyMapper.java deleted file mode 100644 index 84296ce..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessSurveyMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ruoyi.business.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ruoyi.business.domain.BusinessSurvey; - -/** - * 调查问卷管理Mapper接口 - * - * @author ruoyi - * @date 2024-04-01 - */ -public interface BusinessSurveyMapper extends BaseMapper -{ - -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplateMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplateMapper.java deleted file mode 100644 index c6c907f..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplateMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ruoyi.business.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ruoyi.business.domain.BusinessTemplate; - -/** - * 模版管理Mapper接口 - * - * @author ruoyi - * @date 2024-03-31 - */ -public interface BusinessTemplateMapper extends BaseMapper -{ - -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropMapper.java deleted file mode 100644 index bc58dab..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ruoyi.business.mapper; - -import java.util.List; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ruoyi.business.domain.BusinessTemplateProp; - -/** - * 模版属性Mapper接口 - * - * @author ruoyi - * @date 2024-03-31 - */ -public interface BusinessTemplatePropMapper extends BaseMapper -{ - -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropValueMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropValueMapper.java deleted file mode 100644 index 7bf8d14..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BusinessTemplatePropValueMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.ruoyi.business.mapper; - -import java.util.List; -import java.util.Map; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.ruoyi.business.domain.BusinessTemplatePropValue; -import org.apache.ibatis.annotations.Param; - -/** - * 模版属性值Mapper接口 - * - * @author ruoyi - * @date 2024-03-31 - */ -public interface BusinessTemplatePropValueMapper extends BaseMapper -{ - /** - * 获取统计数据 - * @param surveyId - */ - List> countGroup(@Param("surveyId") String surveyId, @Param("propId") String propId); -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/RebotMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/RebotMapper.java new file mode 100644 index 0000000..4bb6a4a --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/RebotMapper.java @@ -0,0 +1,25 @@ +package com.ruoyi.business.mapper; + +import java.util.List; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.business.domain.Rebot; + +/** + * 机器人管理Mapper接口 + * + * @author LiuChengRan + * @date 2024-06-13 + */ +public interface RebotMapper extends BaseMapper +{ + + + /** + * 查询机器人管理列表 + * + * @param rebot 机器人管理 + * @return 机器人管理集合 + */ + List selectRebotList(Rebot rebot); + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IApplyService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IApplyService.java new file mode 100644 index 0000000..1742379 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/IApplyService.java @@ -0,0 +1,29 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.Apply; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.business.domain.Rebot; + +/** + * 应用信息管理Service接口 + * + * @author LiuChengRan + * @date 2024-06-13 + */ +public interface IApplyService extends IService +{ + /** + * 同步机器人数据 + * @return + */ + void syn(Apply apply); + /** + * 查询应用信息管理列表 + * + * @param apply 应用信息管理 + * @return 应用信息管理集合 + */ + List list(Apply apply); + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessSurveyService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessSurveyService.java deleted file mode 100644 index 44df001..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessSurveyService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.ruoyi.business.service; - -import java.util.List; -import com.ruoyi.business.domain.BusinessSurvey; -import com.baomidou.mybatisplus.extension.service.IService; -import com.ruoyi.common.core.domain.AjaxResult; - -/** - * 调查问卷管理Service接口 - * - * @author ruoyi - * @date 2024-04-01 - */ -public interface IBusinessSurveyService extends IService -{ - - /** - * 根据试卷获取题目 - * @param surveyId - */ - AjaxResult listBySurveyId(String surveyId); -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropService.java deleted file mode 100644 index ca64766..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropService.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.ruoyi.business.service; - -import java.util.List; -import com.ruoyi.business.domain.BusinessTemplateProp; -import com.baomidou.mybatisplus.extension.service.IService; -/** - * 模版属性Service接口 - * - * @author ruoyi - * @date 2024-03-31 - */ -public interface IBusinessTemplatePropService extends IService -{ - -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropValueService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropValueService.java deleted file mode 100644 index 702b92a..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplatePropValueService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.ruoyi.business.service; - -import java.util.List; -import java.util.Map; - -import com.ruoyi.business.domain.BusinessTemplatePropValue; -import com.baomidou.mybatisplus.extension.service.IService; -/** - * 模版属性值Service接口 - * - * @author ruoyi - * @date 2024-03-31 - */ -public interface IBusinessTemplatePropValueService extends IService -{ - - /** - *获取统计数据 - * @param tempId - */ - Object countGroup(String tempId); - /** - * 批量写入值 - * @param data - * @return - */ - boolean addList(Map data); -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplateService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplateService.java deleted file mode 100644 index 5efca6d..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBusinessTemplateService.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.ruoyi.business.service; - -import java.util.List; -import com.ruoyi.business.domain.BusinessTemplate; -import com.baomidou.mybatisplus.extension.service.IService; -/** - * 模版管理Service接口 - * - * @author ruoyi - * @date 2024-03-31 - */ -public interface IBusinessTemplateService extends IService -{ - -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IRebotService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IRebotService.java new file mode 100644 index 0000000..716df27 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/IRebotService.java @@ -0,0 +1,29 @@ +package com.ruoyi.business.service; + +import java.util.List; +import com.ruoyi.business.domain.Rebot; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 机器人管理Service接口 + * + * @author LiuChengRan + * @date 2024-06-13 + */ +public interface IRebotService extends IService +{ + + /** + * 同步机器人数据 + * @return + */ + void syn(Rebot rebot); + /** + * 查询机器人管理列表 + * + * @param rebot 机器人管理 + * @return 机器人管理集合 + */ + List list(Rebot rebot); + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ApplyServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ApplyServiceImpl.java new file mode 100644 index 0000000..73e1c5a --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/ApplyServiceImpl.java @@ -0,0 +1,89 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.ruoyi.business.domain.Rebot; +import com.ruoyi.business.domain.bo.ListApplyBO; +import com.ruoyi.business.domain.bo.ListRebotBO; +import com.ruoyi.business.domain.vo.ListApplyVO; +import com.ruoyi.business.domain.vo.ListRebotVO; +import com.ruoyi.business.util.YinDaoHttpUtils; +import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.bean.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.ApplyMapper; +import com.ruoyi.business.domain.Apply; +import com.ruoyi.business.service.IApplyService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.transaction.annotation.Transactional; + +/** + * 应用信息管理Service业务层处理 + * + * @author LiuChengRan + * @date 2024-06-13 + */ +@Service +public class ApplyServiceImpl extends ServiceImpl implements IApplyService +{ + + + /** + * 同步机器人数据 + * + * @return + */ + @Override + @DataScope(deptAlias = "d", userAlias = "u") + @Transactional + public void syn(Apply entity) { + ListApplyBO listApplyBO = new ListApplyBO(); + listApplyBO.setPage(1); + listApplyBO.setSize(10000); + List applyList = baseMapper.selectApplyList(new Apply()); + Map> applyMap = applyList.stream().collect(Collectors.groupingBy(Apply::getAppId)); + + List listApplyVOList = YinDaoHttpUtils.listApp(listApplyBO); + // 获取客户端名称集合 + List appIdList = listApplyVOList.stream().map(ListApplyVO::getAppId).collect(Collectors.toList()); + this.remove(new LambdaUpdateWrapper().notIn(Apply::getAppId, appIdList).eq(Apply::getDeptId, SecurityUtils.getDeptId())); + listApplyVOList.forEach(listRebotVO -> { + // 数据库里是否存在 + List applys = applyMap.get(listRebotVO.getAppId()); + if (null == applys) { + Apply newApply = new Apply(); + BeanUtils.copyBeanProp(newApply, listRebotVO); + newApply.setAppCreateTime(listRebotVO.getAppCreateTime()); + newApply.setAppUpdateTime(listRebotVO.getAppUpdateTime()); + newApply.setDeptId(SecurityUtils.getDeptId()); + save(newApply); + } else { + Apply apply = applys.get(0); + Apply newApply =new Apply(); + BeanUtils.copyBeanProp(newApply, listRebotVO); + newApply.setAppCreateTime(listRebotVO.getAppCreateTime()); + newApply.setAppUpdateTime(listRebotVO.getAppUpdateTime()); + newApply.setId(apply.getId()); + newApply.setDeptId(SecurityUtils.getDeptId()); + updateById(newApply); + } + }); + } + /** + * 查询应用信息管理列表 + * + * @param apply 应用信息管理 + * @return 应用信息管理 + */ + @Override + public List list(Apply apply) + { + return baseMapper.selectApplyList(apply); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessSurveyServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessSurveyServiceImpl.java deleted file mode 100644 index 9bfbd9d..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessSurveyServiceImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.ruoyi.business.service.impl; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import com.alibaba.fastjson2.JSONArray; -import com.alibaba.fastjson2.JSONObject; -import com.ruoyi.business.domain.BusinessTemplateProp; -import com.ruoyi.business.domain.BusinessTemplatePropValue; -import com.ruoyi.business.mapper.BusinessTemplatePropMapper; -import com.ruoyi.business.mapper.BusinessTemplatePropValueMapper; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.SecurityUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.business.mapper.BusinessSurveyMapper; -import com.ruoyi.business.domain.BusinessSurvey; -import com.ruoyi.business.service.IBusinessSurveyService; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * 调查问卷管理Service业务层处理 - * - * @author ruoyi - * @date 2024-04-01 - */ -@Service -public class BusinessSurveyServiceImpl extends ServiceImpl implements IBusinessSurveyService -{ - @Autowired - private BusinessTemplatePropMapper businessTemplatePropMapper; -@Autowired - private BusinessTemplatePropValueMapper businessTemplatePropValueMapper; - - /** - * 根据试卷获取题目 - * @param surveyId - * @return - */ - @Override - public AjaxResult listBySurveyId(String surveyId) { - BusinessSurvey businessSurvey = baseMapper.selectOne(new LambdaQueryWrapper().eq(BusinessSurvey::getId, surveyId)); - - List list = businessTemplatePropMapper.selectList(new LambdaQueryWrapper() - .eq(BusinessTemplateProp::getTempId, businessSurvey.getTempId()) - .orderByDesc(BusinessTemplateProp::getSort)); - - JSONObject jsonObject = new JSONObject(); - list.forEach(e -> { - BusinessTemplatePropValue one = businessTemplatePropValueMapper.selectOne(new LambdaQueryWrapper() - .eq(BusinessTemplatePropValue::getPropId, e.getId()) - .eq(BusinessTemplatePropValue::getSurveyId, surveyId) - .eq(BusinessTemplatePropValue::getCreateBy, SecurityUtils.getUsername())); - if (e.getCompType().equals("0")) { - jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); - } - if (e.getCompType().equals("1")) { - String valueSources = Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources(); - if(null != valueSources){ - List collect = Stream.of(valueSources.substring(1, valueSources.length() - 1).split(", ")).collect(Collectors.toList()); - jsonObject.put(e.getId(),collect); - }else{ - jsonObject.put(e.getId(),new ArrayList<>()); - } - } - if (e.getCompType().equals("2")) { - jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); - } - if (e.getCompType().equals("3")) { - jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); - } - if (e.getCompType().equals("4")) { - jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); - } - if (e.getCompType().equals("5")) { - jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); - } - if (e.getCompType().equals("6")) { - jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); - } - if (e.getCompType().equals("7")) { - jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); - } - if (e.getCompType().equals("8")) { - jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); - } - if (e.getCompType().equals("9")) { - jsonObject.put(e.getId(), Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources() == null ? new JSONArray() : Optional.ofNullable(one).orElse(new BusinessTemplatePropValue()).getValueSources()); - } - }); - AjaxResult success = AjaxResult.success(list); - success.put("form" , jsonObject); - return success; - - } -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropServiceImpl.java deleted file mode 100644 index abb5a99..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.ruoyi.business.service.impl; - -import java.util.List; -import com.ruoyi.common.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.business.mapper.BusinessTemplatePropMapper; -import com.ruoyi.business.domain.BusinessTemplateProp; -import com.ruoyi.business.service.IBusinessTemplatePropService; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * 模版属性Service业务层处理 - * - * @author ruoyi - * @date 2024-03-31 - */ -@Service -public class BusinessTemplatePropServiceImpl extends ServiceImpl implements IBusinessTemplatePropService -{ - @Autowired - private BusinessTemplatePropMapper businessTemplatePropMapper; - - -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropValueServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropValueServiceImpl.java deleted file mode 100644 index a673410..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplatePropValueServiceImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.ruoyi.business.service.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - -import com.alibaba.fastjson2.JSONArray; -import com.alibaba.fastjson2.JSONObject; -import com.ruoyi.business.domain.BusinessSurvey; -import com.ruoyi.business.domain.BusinessTemplate; -import com.ruoyi.business.domain.BusinessTemplateProp; -import com.ruoyi.business.mapper.BusinessSurveyMapper; -import com.ruoyi.business.mapper.BusinessTemplatePropMapper; -import com.ruoyi.business.service.IBusinessSurveyService; -import com.ruoyi.business.service.IBusinessTemplatePropService; -import com.ruoyi.business.service.IBusinessTemplateService; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.business.mapper.BusinessTemplatePropValueMapper; -import com.ruoyi.business.domain.BusinessTemplatePropValue; -import com.ruoyi.business.service.IBusinessTemplatePropValueService; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * 模版属性值Service业务层处理 - * - * @author ruoyi - * @date 2024-03-31 - */ -@Service -public class BusinessTemplatePropValueServiceImpl extends ServiceImpl implements IBusinessTemplatePropValueService { - @Autowired - private BusinessTemplatePropValueMapper businessTemplatePropValueMapper; - - @Autowired - private IBusinessTemplateService businessTemplateService; - - @Autowired - private IBusinessTemplatePropService businessTemplatePropService; - - @Autowired - private IBusinessSurveyService businessSurveyService; - - - /** - * 获取统计数据 - * - * @param surveyId - * @return - */ - @Override - public Object countGroup(String surveyId) { - BusinessSurvey businessSurvey = businessSurveyService.lambdaQuery().eq(BusinessSurvey::getId, surveyId).one(); - - BusinessTemplate businessTemplate = businessTemplateService.lambdaQuery().eq(BusinessTemplate::getId, businessSurvey.getTempId()).one(); - - List businessTemplateProps = businessTemplatePropService.lambdaQuery() - .eq(BusinessTemplateProp::getTempId, businessTemplate.getId()).in(BusinessTemplateProp::getCompType, new String[]{"0" , "1" , "6"}).list(); - - JSONObject map = new JSONObject(); - List> list = new ArrayList<>(); - businessTemplateProps.forEach(e -> { - List> countList = businessTemplatePropValueMapper.countGroup(surveyId, e.getId()); - map.put(e.getTitle(), countList); - }); - - return map; - } - - /** - * 批量写入值 - * - * @param data - * @return - */ - @Override - public boolean addList(Map data) { - - // 试卷id - String surveyId = data.get("surveyId").toString(); - data.remove("surveyId"); - List datas = new ArrayList<>(); - data.forEach((k, v) -> { - BusinessTemplatePropValue businessTemplatePropValue = new BusinessTemplatePropValue(); - BusinessTemplateProp businessTemplateProp = businessTemplatePropService.getById(k); - List businessTemplatePropValues = businessTemplatePropValueMapper.selectList(new LambdaQueryWrapper() - .eq(BusinessTemplatePropValue::getPropId, k).eq(BusinessTemplatePropValue::getCreateBy, SecurityUtils.getUsername())); - - businessTemplatePropValues.forEach(e -> { - if (e.getPropId().equals(k)) { - businessTemplatePropValue.setId(e.getId()); - } - }); - businessTemplatePropValue.setPropName(businessTemplateProp.getFieldName()); - businessTemplatePropValue.setPropType(businessTemplateProp.getCompType()); - businessTemplatePropValue.setPropId(k); - businessTemplatePropValue.setValueKey(v.toString()); - if (businessTemplateProp.getCompType().equals("0")) { - String optionalValue = businessTemplateProp.getOptionalValue(); - String[] split = optionalValue.split("\\|"); - for (String v1 : split) { - String[] v2 = v1.split(","); - if (v2[0].equals(v)) { - businessTemplatePropValue.setValueText(v2[1]); - } - } - businessTemplatePropValue.setValueSources(v.toString()); - } else if (businessTemplateProp.getCompType().equals("1")) { - String optionalValue = businessTemplateProp.getOptionalValue(); - String[] split = optionalValue.split("\\|"); - StringBuilder sb = new StringBuilder(); - - for (String v1 : split) { - String[] v2 = v1.split(","); - if (((ArrayList) v).contains(v2[0])) { - sb.append(v2[1]).append(","); - } - } - businessTemplatePropValue.setValueText(sb.substring(0, sb.length() - 1)); - businessTemplatePropValue.setValueSources(v.toString()); - } else if (businessTemplateProp.getCompType().equals("6")) { - String optionalValue = businessTemplateProp.getOptionalValue(); - String[] split = optionalValue.split("\\|"); - StringBuilder sb = new StringBuilder(); - - for (String v1 : split) { - String[] v2 = v1.split(","); - if (v.equals(v2[0])) { - sb.append(v2[1]).append(","); - } - } - businessTemplatePropValue.setValueText(sb.substring(0, sb.length() - 1)); - businessTemplatePropValue.setValueSources(v.toString()); - } else { - businessTemplatePropValue.setValueText(v.toString()); - businessTemplatePropValue.setValueSources(v.toString()); - } - businessTemplatePropValue.setSurveyId(surveyId); - datas.add(businessTemplatePropValue); - }); - - return saveOrUpdateBatch(datas); - } -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplateServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplateServiceImpl.java deleted file mode 100644 index 41294b4..0000000 --- a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BusinessTemplateServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.ruoyi.business.service.impl; - -import java.util.List; -import com.ruoyi.common.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.business.mapper.BusinessTemplateMapper; -import com.ruoyi.business.domain.BusinessTemplate; -import com.ruoyi.business.service.IBusinessTemplateService; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * 模版管理Service业务层处理 - * - * @author ruoyi - * @date 2024-03-31 - */ -@Service -public class BusinessTemplateServiceImpl extends ServiceImpl implements IBusinessTemplateService -{ - @Autowired - private BusinessTemplateMapper businessTemplateMapper; - - -} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/RebotServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/RebotServiceImpl.java new file mode 100644 index 0000000..5909100 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/RebotServiceImpl.java @@ -0,0 +1,84 @@ +package com.ruoyi.business.service.impl; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.ruoyi.business.domain.bo.ListRebotBO; +import com.ruoyi.business.domain.vo.ListRebotVO; +import com.ruoyi.business.util.YinDaoHttpUtils; +import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.utils.SecurityUtils; +import org.springframework.stereotype.Service; +import com.ruoyi.business.mapper.RebotMapper; +import com.ruoyi.business.domain.Rebot; +import com.ruoyi.business.service.IRebotService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.transaction.annotation.Transactional; + +/** + * 机器人管理Service业务层处理 + * + * @author LiuChengRan + * @date 2024-06-13 + */ +@Service +public class RebotServiceImpl extends ServiceImpl implements IRebotService { + + + /** + * 同步机器人数据 + * + * @return + */ + @Override + @DataScope(deptAlias = "d", userAlias = "u") + @Transactional + public void syn(Rebot entity) { + ListRebotBO listRebotBO = new ListRebotBO(); + listRebotBO.setPage(1); + listRebotBO.setSize(10000); + List rebotsList = baseMapper.selectRebotList(new Rebot()); + Map> rebotMap = rebotsList.stream().collect(Collectors.groupingBy(Rebot::getRobotClientName)); + + List listRebotVoList = YinDaoHttpUtils.listRebot(listRebotBO); + // 获取客户端名称集合 + List clientNameList = listRebotVoList.stream().map(ListRebotVO::getRobotClientName).collect(Collectors.toList()); + this.remove(new LambdaUpdateWrapper().notIn(Rebot::getRobotClientName, clientNameList).eq(Rebot::getDeptId, SecurityUtils.getDeptId())); + listRebotVoList.forEach(listRebotVO -> { + // 数据库里是否存在 + List rebots = rebotMap.get(listRebotVO.getRobotClientName()); + if (null == rebots) { + Rebot rebot = new Rebot(); + rebot.setStatus(listRebotVO.getStatus()); + rebot.setRobotClientUuid(listRebotVO.getRobotClientUuid()); + rebot.setRobotClientName(listRebotVO.getRobotClientName()); + rebot.setWindowsAccount(listRebotVO.getWindowsAccount()); + rebot.setClientIp(listRebotVO.getClientIp()); + rebot.setDeptId(SecurityUtils.getDeptId()); + save(rebot); + } else { + Rebot rebot = rebots.get(0); + rebot.setStatus(listRebotVO.getStatus()); + rebot.setRobotClientUuid(listRebotVO.getRobotClientUuid()); + rebot.setRobotClientName(listRebotVO.getRobotClientName()); + rebot.setWindowsAccount(listRebotVO.getWindowsAccount()); + rebot.setClientIp(listRebotVO.getClientIp()); + rebot.setDeptId(SecurityUtils.getDeptId()); + updateById(rebot); + } + }); + } + + /** + * 查询机器人管理列表 + * + * @param rebot 机器人管理 + * @return 机器人管理 + */ + @Override + public List list(Rebot rebot) { + return baseMapper.selectRebotList(rebot); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/util/YinDaoHttpUtils.java b/ruoyi-business/src/main/java/com/ruoyi/business/util/YinDaoHttpUtils.java new file mode 100644 index 0000000..b450c37 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/util/YinDaoHttpUtils.java @@ -0,0 +1,130 @@ +package com.ruoyi.business.util; + +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson2.JSON; +import com.ruoyi.business.domain.bo.ListApplyBO; +import com.ruoyi.business.domain.bo.ListRebotBO; +import com.ruoyi.business.domain.vo.ListApplyVO; +import com.ruoyi.business.domain.vo.ListRebotVO; +import com.ruoyi.business.yddoman.BaseDTO; +import com.ruoyi.business.yddoman.CreateTokenDTO; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.http.HttpClientUtil; +import lombok.extern.slf4j.Slf4j; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 影刀请求工具类 + * + * @author #author# + */ +@Slf4j +public class YinDaoHttpUtils { + + + // 请求前缀 + private static final String REQUEST_PREFIX = "https://api.winrobot360.com/oapi"; + // 获取token + private static final String CREATE_TOKEN = REQUEST_PREFIX + "/token/v2/token/create"; + // 查询机器人列表 + private static final String CLIENT_LIST = REQUEST_PREFIX + "/dispatch/v2/client/list"; + // 查询应用列表 + private static final String APP_LIST = REQUEST_PREFIX + "/app/open/query/list"; + + + /** + * 查询机器人列表 + */ + public static List listApp(ListApplyBO ListApplyBO) { + Map data = new HashMap<>(); + data.put("page", ListApplyBO.getPage().toString()); + data.put("size", ListApplyBO.getSize().toString()); + BaseDTO baseDTO = sendPost(APP_LIST, data); + return JSON.parseArray(baseDTO.getData().toString(), ListApplyVO.class); + } + + /** + * 查询机器人列表 + */ + public static List listRebot(ListRebotBO listRebotBO) { + Map data = new HashMap<>(); + data.put("page", listRebotBO.getPage().toString()); + data.put("size", listRebotBO.getSize().toString()); +// data.put("status", listRebotBO.getStatus()); +// data.put("key", listRebotBO.getKey()); +// data.put("robotClientUuid", "176befff-0dc4-4df1-badf-346305c28ae8"); + BaseDTO baseDTO = sendGet(CLIENT_LIST, data); + return JSON.parseArray(baseDTO.getData().toString(), ListRebotVO.class); + } + + + /** + * 统一get请求 + * + * @param map + */ + private static BaseDTO sendGet(String url, Map map) { + Map newMap = new HashMap<>(); + // 写死 + newMap.put("accessKeyId", "hVYUk1yCZ3RX6f9q@platform"); + newMap.put("accessKeySecret", "CKaVmug0TcPYhf1nGUjASyveN2s6dpFR"); + Map headMap = new HashMap<>(); + headMap.put("Authorization", "Bearer " + getToken(newMap)); + headMap.put("Content-Type", "application/json"); + String returnStr = HttpClientUtil.postJson(url, headMap, JSONUtil.toJsonStr(map), "utf-8"); + BaseDTO baseDTO = JSON.parseObject(returnStr, BaseDTO.class); + if (!baseDTO.getSuccess()) { + throw new ServiceException("请求影刀接口失败,状态码为" + baseDTO.getCode() + "原因是:" + baseDTO.getMsg()); + } + return baseDTO; + } + + + /** + * 统一post请求 + * + * @param map + */ + private static BaseDTO sendPost(String url, Map map) { + Map tokenMap = new HashMap<>(); + // 写死 + tokenMap.put("accessKeyId", "hVYUk1yCZ3RX6f9q@platform"); + tokenMap.put("accessKeySecret", "CKaVmug0TcPYhf1nGUjASyveN2s6dpFR"); + Map headMap = new HashMap<>(); + headMap.put("Accept", "application/json"); + headMap.put("Content-Type", "application/json;charset=utf-8"); + headMap.put("authorization", "Bearer " + getToken(tokenMap)); + + String returnStr = HttpClientUtil.postJson(url, headMap, JSONUtil.toJsonStr(map), "utf-8"); + if (StringUtils.isEmpty(returnStr)) { + throw new ServiceException("请求影刀接口失败"); + } + BaseDTO baseDTO = JSON.parseObject(returnStr, BaseDTO.class); + if (!baseDTO.getSuccess()) { + throw new ServiceException("请求影刀接口失败,状态码为" + baseDTO.getCode() + "原因是:" + baseDTO.getMsg()); + } + return baseDTO; + } + + /** + * 获取token + * + * @param map accessKeyId accessKeySecret + * @return + */ + private static String getToken(Map map) { + String s = HttpClientUtil.getHttp(CREATE_TOKEN, map); + BaseDTO baseDTO = JSON.parseObject(s, BaseDTO.class); + if (!baseDTO.getSuccess()) { + throw new ServiceException("获取影刀token失败!"); + } + Object data = baseDTO.getData(); + CreateTokenDTO createTokenDTO = JSON.parseObject(data.toString(), CreateTokenDTO.class); + return createTokenDTO.getAccessToken(); + } + +} \ No newline at end of file diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/yddoman/BaseDTO.java b/ruoyi-business/src/main/java/com/ruoyi/business/yddoman/BaseDTO.java new file mode 100644 index 0000000..82110ba --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/yddoman/BaseDTO.java @@ -0,0 +1,19 @@ +package com.ruoyi.business.yddoman; + +import lombok.Data; + +/** + * 影刀统一响应父类 + * + * @author #author# + */ +@Data +public class BaseDTO +{ + + private Integer code; + private Boolean success; + private String msg; + private Object data; + +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/yddoman/CreateTokenDTO.java b/ruoyi-business/src/main/java/com/ruoyi/business/yddoman/CreateTokenDTO.java new file mode 100644 index 0000000..60f8a31 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/yddoman/CreateTokenDTO.java @@ -0,0 +1,17 @@ +package com.ruoyi.business.yddoman; + +import lombok.Data; + +/** + * 创建token + * + * @author #author# + */ +@Data +public class CreateTokenDTO +{ + + private String accessToken; + private String expiresIn; + +} diff --git a/ruoyi-business/src/main/resources/mapper/business/ApplyMapper.xml b/ruoyi-business/src/main/resources/mapper/business/ApplyMapper.xml new file mode 100644 index 0000000..0a2cacb --- /dev/null +++ b/ruoyi-business/src/main/resources/mapper/business/ApplyMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select + id, + owner_name, + owner_account, + owner_id, + app_id, + app_name, + app_type_name, + app_type, + app_create_time, + app_update_time, + version, + support_param, + icon, + manual_time, + create_by, + create_time, + update_by, + update_time, + remark, + deleted + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/mapper/business/BusinessSurveyMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BusinessSurveyMapper.xml deleted file mode 100644 index 5acaf12..0000000 --- a/ruoyi-business/src/main/resources/mapper/business/BusinessSurveyMapper.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - select id, title, context, temp_id, open, create_by, create_time, update_by, update_time, deleted, remark from business_survey - - - - - - - - insert into business_survey - - title, - context, - temp_id, - open, - create_by, - create_time, - update_by, - update_time, - deleted, - remark, - - - #{title}, - #{context}, - #{tempId}, - #{open}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - #{deleted}, - #{remark}, - - - - - update business_survey - - title = #{title}, - context = #{context}, - temp_id = #{tempId}, - open = #{open}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - deleted = #{deleted}, - remark = #{remark}, - - where id = #{id} - - - - delete from business_survey where id = #{id} - - - - delete from business_survey where id in - - #{id} - - - \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/mapper/business/BusinessTemplateMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BusinessTemplateMapper.xml deleted file mode 100644 index 9322834..0000000 --- a/ruoyi-business/src/main/resources/mapper/business/BusinessTemplateMapper.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - select id, title, context, open, create_by, create_time, update_by, update_time, deleted, remark from business_template - - - - - - - - insert into business_template - - title, - context, - open, - create_by, - create_time, - update_by, - update_time, - deleted, - remark, - - - #{title}, - #{context}, - #{open}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - #{deleted}, - #{remark}, - - - - - update business_template - - title = #{title}, - context = #{context}, - open = #{open}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - deleted = #{deleted}, - remark = #{remark}, - - where id = #{id} - - - - delete from business_template where id = #{id} - - - - delete from business_template where id in - - #{id} - - - \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropMapper.xml deleted file mode 100644 index 29ae31b..0000000 --- a/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropMapper.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - select id, title, comp_type, field_name, plac_prompt, default_value, optional_value, open, temp_id, create_by, create_time, update_by, update_time, deleted, remark from business_template_prop - - - - - - - - insert into business_template_prop - - title, - comp_type, - field_name, - plac_prompt, - default_value, - optional_value, - open, - temp_id, - create_by, - create_time, - update_by, - update_time, - deleted, - remark, - - - #{title}, - #{compType}, - #{fieldName}, - #{placPrompt}, - #{defaultValue}, - #{optionalValue}, - #{open}, - #{tempId}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - #{deleted}, - #{remark}, - - - - - update business_template_prop - - title = #{title}, - comp_type = #{compType}, - field_name = #{fieldName}, - plac_prompt = #{placPrompt}, - default_value = #{defaultValue}, - optional_value = #{optionalValue}, - open = #{open}, - temp_id = #{tempId}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - deleted = #{deleted}, - remark = #{remark}, - - where id = #{id} - - - - delete from business_template_prop where id = #{id} - - - - delete from business_template_prop where id in - - #{id} - - - \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropValueMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropValueMapper.xml deleted file mode 100644 index 1c39d13..0000000 --- a/ruoyi-business/src/main/resources/mapper/business/BusinessTemplatePropValueMapper.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - select id, prop_id, prop_name, value_key, value_text, temp_id, create_by, create_time, update_by, update_time, deleted, remark from business_template_prop_value - - - - - - - - - - - insert into business_template_prop_value - - prop_id, - prop_name, - value_key, - value_text, - temp_id, - create_by, - create_time, - update_by, - update_time, - deleted, - remark, - - - #{propId}, - #{propName}, - #{valueKey}, - #{valueText}, - #{tempId}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - #{deleted}, - #{remark}, - - - - - update business_template_prop_value - - prop_id = #{propId}, - prop_name = #{propName}, - value_key = #{valueKey}, - value_text = #{valueText}, - temp_id = #{tempId}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - deleted = #{deleted}, - remark = #{remark}, - - where id = #{id} - - - - delete from business_template_prop_value where id = #{id} - - - - delete from business_template_prop_value where id in - - #{id} - - - \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/mapper/business/RebotMapper.xml b/ruoyi-business/src/main/resources/mapper/business/RebotMapper.xml new file mode 100644 index 0000000..98501f1 --- /dev/null +++ b/ruoyi-business/src/main/resources/mapper/business/RebotMapper.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select + rebot.id, + rebot.robot_client_name, + rebot.robot_client_uuid, + rebot.status, + rebot.description, + rebot.windows_account, + rebot.client_ip, + rebot.dept_id, + rebot.create_by, + rebot.create_time, + rebot.update_by, + rebot.update_time, + rebot.remark, + rebot.deleted + + + + + \ No newline at end of file diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 6eadd0b..783feac 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -132,17 +132,38 @@ javax.servlet-api + + + cn.hutool + hutool-all + 5.3.4 + + + + org.apache.httpcomponents + httpclient + 4.5.12 + + + org.jodd + jodd-core + 3.7.1 + + com.baomidou mybatis-plus-boot-starter 3.4.2 + org.projectlombok lombok 1.18.10 + + \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java index fac4a44..5c89812 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java @@ -1,9 +1,13 @@ package com.ruoyi.common.constant; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + /** * 代码生成通用常量 * - * @author #author# + * @author */ public class GenConstants { @@ -45,15 +49,20 @@ public class GenConstants "bit", "bigint", "float", "double", "decimal" }; /** 页面不需要编辑字段 */ - public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" }; + public static final String[] COLUMNNAME_NOT_EDIT = { "id","uuid", "create_by", "create_time","update_by","update_time", "deleted" }; + + /** 页面不需要新增字段 */ + public static final String[] COLUMNNAME_NOT_INSERT = { "id","uuid", "create_by", "create_time","update_by","update_time", "deleted" }; /** 页面不需要显示的列表字段 */ - public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by", - "update_time" }; + public static final String[] COLUMNNAME_NOT_LIST = { "id","uuid", "deleted" }; /** 页面不需要查询字段 */ - public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by", - "update_time", "remark" }; + public static final String[] COLUMNNAME_NOT_QUERY = { "id","uuid", "create_by", "create_time", "update_by", + "update_time", "remark" , "deleted"}; + + // 排除固定字段cud默认选中状态 +// private final static List NOT_CRUD_COLUMN = Stream.of("id","uuid","create_by","create_time","update_by","update_time","deleted").collect(Collectors.toList()); /** Entity基类字段 */ public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" }; @@ -114,4 +123,7 @@ public class GenConstants /** 需要 */ public static final String REQUIRE = "1"; + + /** 不需要 */ + public static final String NO_REQUIRE = "0"; } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/handler/MyMetaObjectHandler.java b/ruoyi-common/src/main/java/com/ruoyi/common/handler/MyMetaObjectHandler.java index 1d0368c..49a5f5d 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/handler/MyMetaObjectHandler.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/handler/MyMetaObjectHandler.java @@ -20,7 +20,6 @@ public class MyMetaObjectHandler implements MetaObjectHandler { @Override public void insertFill(MetaObject metaObject) { - log.info("start insert fill ...."); Object createBy = metaObject.getValue("createBy"); // String uuid = UUID.randomUUID().toString(); // this.strictInsertFill(metaObject, "id", String.class, uuid); // 起始版本 3.3.0(推荐使用) @@ -38,7 +37,6 @@ public class MyMetaObjectHandler implements MetaObjectHandler { @Override public void updateFill(MetaObject metaObject) { - log.info("start update fill ...."); Object updateBy = metaObject.getValue("updateBy"); if (StringUtils.isNull(updateBy) || updateBy.equals("")) { this.strictInsertFill(metaObject, "updateBy", String.class, SecurityUtils.getUsername()); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpClientUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpClientUtil.java new file mode 100644 index 0000000..e27ae10 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpClientUtil.java @@ -0,0 +1,358 @@ +package com.ruoyi.common.utils.http; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.map.MapUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +/** + * @author rch + * @date 2022-06-22 + */ +public class HttpClientUtil { + + private static final Logger log = LoggerFactory.getLogger(HttpClientUtil.class); + public static String postJson(String url, String body, String charset) { + + String result = null; + if (null == charset) { + charset = "UTF-8"; + } + CloseableHttpClient httpClient = null; + HttpPost httpPost = null; + try { + httpClient = HttpConnectionManager.getInstance().getHttpClient(); + httpPost = new HttpPost(url); + + // 设置连接超时,设置读取超时 + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(3000) + .setSocketTimeout(3000) + .build(); + httpPost.setConfig(requestConfig); + + httpPost.setHeader("Accept", "application/json"); + httpPost.setHeader("Content-Type", "application/json;charset=utf-8"); + + // 设置参数 + StringEntity se = new StringEntity(body, "UTF-8"); + httpPost.setEntity(se); + HttpResponse response = httpClient.execute(httpPost); + if (response != null) { + HttpEntity resEntity = response.getEntity(); + if (resEntity != null) { + result = EntityUtils.toString(resEntity, charset); + } + } + } catch (Exception ex) { + ex.printStackTrace(); + log.error(ex.getMessage()); + } + + return result; + } + + + public static String postJson(String url, Map heards, String body, String charset) { + + String result = null; + if (null == charset) { + charset = "UTF-8"; + } + CloseableHttpClient httpClient = null; + HttpPost httpPost = null; + try { + httpClient = HttpConnectionManager.getInstance().getHttpClient(); + httpPost = new HttpPost(url); + + // 设置连接超时,设置读取超时 + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(3000) + .setSocketTimeout(3000) + .build(); + httpPost.setConfig(requestConfig); + + for (Map.Entry heard:heards.entrySet()) { + httpPost.setHeader(heard.getKey(), heard.getValue().toString()); + } + + // 设置参数 + StringEntity se = new StringEntity(body, "UTF-8"); + httpPost.setEntity(se); + HttpResponse response = httpClient.execute(httpPost); + if (response != null) { + HttpEntity resEntity = response.getEntity(); + if (resEntity != null) { + result = EntityUtils.toString(resEntity, charset); + } + } + } catch (Exception ex) { + ex.printStackTrace(); + log.error(ex.getMessage()); + } + + return result; + } + + + /** + * 发送 POST 请求(HTTP),K-V形式 + * + * @param apiUrl + * API接口URL + * @param params + * 参数map + * @return + */ + public static String doPostHttp(String apiUrl, Map params) { + CloseableHttpClient httpClient = HttpClients.createDefault(); + String httpStr = null; + HttpPost httpPost = new HttpPost(apiUrl); + CloseableHttpResponse response = null; + + try { + // 设置连接超时,设置读取超时 + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(10000) + .setSocketTimeout(10000) + .build(); + httpPost.setConfig(requestConfig); + httpPost.setHeader("Accept", "application/json"); + httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded"); + + List pairList = new ArrayList<>(params.size()); + for (Entry entry : params.entrySet()) { + NameValuePair pair = new BasicNameValuePair(entry.getKey(), Convert.toStr(entry.getValue())); + pairList.add(pair); + } + httpPost.setEntity(new UrlEncodedFormEntity(pairList, Charset.forName("UTF-8"))); + response = httpClient.execute(httpPost); +// System.out.println("http==response.toString():" + response.toString()); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage()); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage()); + } + } + } + return httpStr; + } + + /** + * 发送 GET 请求(HTTP),K-V形式 + * + * @param apiUrl + * API接口URL + * @param params + * 参数map + * @return + */ + public static String getHttp(String apiUrl,Map params){ + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + String result = ""; + try { + String url = apiUrl; + if(MapUtil.isNotEmpty(params)){ + String paramsStr = ""; + for (String key : params.keySet()) { + if(ObjectUtil.isNotEmpty(params.get(key))){ + if(StrUtil.isNotEmpty(paramsStr)){ + paramsStr += "&" + key + "=" + params.get(key); + }else{ + paramsStr += key + "=" + params.get(key); + } + } + } + if(StrUtil.isNotEmpty(paramsStr)){ + url += "?" + paramsStr; + } + } + httpClient = HttpClients.createDefault(); + System.out.println("url:" + url); + HttpGet httpGet = new HttpGet(url); + // 设置连接超时,设置读取超时 + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(5000) + .setSocketTimeout(5000) + .build(); + httpGet.setConfig(requestConfig); + response = httpClient.execute(httpGet); + HttpEntity entity = response.getEntity(); + result = EntityUtils.toString(entity, "UTF-8"); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage()); + } finally { + if (response != null) { + try { + response.close(); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage()); + } + } + if (httpClient != null) { + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage()); + } + } + } + return result; + } + + + + /** + * 发送 GET 请求(HTTP) + * + * @param apiUrl + * API接口URL + * @return + */ + public static String getUrlHttp(String apiUrl){ + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + String result = ""; + try { + String url = apiUrl; + httpClient = HttpClients.createDefault(); + System.out.println("url:" + url); + HttpGet httpGet = new HttpGet(url); + // 设置连接超时,设置读取超时 + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(5000) + .setSocketTimeout(5000) + .build(); + httpGet.setConfig(requestConfig); + response = httpClient.execute(httpGet); + HttpEntity entity = response.getEntity(); + result = EntityUtils.toString(entity, "UTF-8"); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage()); + } finally { + if (response != null) { + try { + response.close(); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage()); + } + } + if (httpClient != null) { + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage()); + } + } + } + return result; + } + + /** + * 发送 POST 请求(HTTP),K-V形式 + * + * @param apiUrl + * API接口URL + * @param params + * 参数map + * @return + */ + public static String postHttp(String apiUrl,Map params){ + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + String result = ""; + try { + String url = apiUrl; + httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(url); + // 设置连接超时,设置读取超时 + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(5000) + .setSocketTimeout(5000) + .build(); + httpPost.setConfig(requestConfig); + if(MapUtil.isNotEmpty(params)){ + StringEntity se = new StringEntity(JSONUtil.toJsonStr(params), "UTF-8"); + se.setContentType("application/json"); + httpPost.setEntity(se); + } + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + result = EntityUtils.toString(entity, "UTF-8"); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage()); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage()); + } + } + if (httpClient != null) { + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage()); + } + } + } + return result; + } + + + public static void main(String[] args) { + String url = "http://kjw.utest6.com/forcol/a"; + Map params = new HashMap<>(16); + params.put("page",1); + params.put("pageSize",10000); + params.put("beginTime","2022-04-01 21:00:00"); + + String result = postHttp(url,params); + System.out.println(result); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpConnectionManager.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpConnectionManager.java new file mode 100644 index 0000000..efa2fce --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpConnectionManager.java @@ -0,0 +1,57 @@ +package com.ruoyi.common.utils.http; + + +import org.apache.http.config.Registry; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.LayeredConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.springframework.stereotype.Component; + +import javax.net.ssl.SSLContext; +import java.security.NoSuchAlgorithmException; + +@Component +public class HttpConnectionManager { + + private PoolingHttpClientConnectionManager cm = null; + + private static HttpConnectionManager connectionManager; + + public static HttpConnectionManager getInstance() { + if (connectionManager == null) { + synchronized (HttpConnectionManager.class) { + if (connectionManager == null) { + connectionManager = new HttpConnectionManager(); + connectionManager.init(); + } + } + } + return connectionManager; + } + + private void init() { + LayeredConnectionSocketFactory sslsf = null; + try { + sslsf = new SSLConnectionSocketFactory(SSLContext.getDefault()); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + + Registry socketFactoryRegistry = RegistryBuilder. create() + .register("https", sslsf).register("http", new PlainConnectionSocketFactory()).build(); + cm = new PoolingHttpClientConnectionManager(socketFactoryRegistry); + cm.setMaxTotal(200); + cm.setDefaultMaxPerRoute(20); + } + + public CloseableHttpClient getHttpClient() { + CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(cm).build(); + + return httpClient; + } +} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java index e5edcee..a6bc1e4 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java @@ -1,6 +1,7 @@ package com.ruoyi.generator.util; import java.util.Arrays; + import org.apache.commons.lang3.RegExUtils; import com.ruoyi.common.constant.GenConstants; import com.ruoyi.common.utils.StringUtils; @@ -10,21 +11,19 @@ import com.ruoyi.generator.domain.GenTableColumn; /** * 代码生成器 工具类 - * + * * @author zhihuiwuliu */ -public class GenUtils -{ +public class GenUtils { /** * 初始化表信息 */ - public static void initTable(GenTable genTable, String operName) - { + public static void initTable(GenTable genTable, String operName) { genTable.setClassName(convertClassName(genTable.getTableName())); genTable.setPackageName(GenConfig.getPackageName()); genTable.setModuleName(getModuleName(GenConfig.getPackageName())); - genTable.setBusinessName(getBusinessName(genTable.getTableName())); - genTable.setFunctionName(replaceText(genTable.getTableComment())); + genTable.setBusinessName(StringUtils.toCamelCase(genTable.getTableName())); + genTable.setFunctionName(replaceText(genTable.getTableComment()).concat("管理")); genTable.setFunctionAuthor(GenConfig.getAuthor()); genTable.setCreateBy(operName); } @@ -32,8 +31,7 @@ public class GenUtils /** * 初始化列属性字段 */ - public static void initColumnField(GenTableColumn column, GenTable table) - { + public static void initColumnField(GenTableColumn column, GenTable table) { String dataType = getDbType(column.getColumnType()); String columnName = column.getColumnName(); column.setTableId(table.getTableId()); @@ -44,112 +42,102 @@ public class GenUtils column.setJavaType(GenConstants.TYPE_STRING); column.setQueryType(GenConstants.QUERY_EQ); - if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) - { + if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) { // 字符串长度超过500设置为文本域 Integer columnLength = getColumnLength(column.getColumnType()); String htmlType = columnLength >= 500 || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType) ? GenConstants.HTML_TEXTAREA : GenConstants.HTML_INPUT; column.setHtmlType(htmlType); - } - else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) - { + } else if (arraysContains(GenConstants.COLUMNTYPE_TIME, dataType)) { column.setJavaType(GenConstants.TYPE_DATE); column.setHtmlType(GenConstants.HTML_DATETIME); - } - else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) - { + } else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) { column.setHtmlType(GenConstants.HTML_INPUT); // 如果是浮点型 统一用BigDecimal String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ","); - if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) - { + if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) { column.setJavaType(GenConstants.TYPE_BIGDECIMAL); } // 如果是整形 - else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) - { + else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) { column.setJavaType(GenConstants.TYPE_INTEGER); } // 长整形 - else - { + else { column.setJavaType(GenConstants.TYPE_LONG); } } - // 插入字段(默认所有字段都需要插入) - column.setIsInsert(GenConstants.REQUIRE); - + // 插入字段 + if (!arraysContains(GenConstants.COLUMNNAME_NOT_INSERT, columnName)) { + column.setIsInsert(GenConstants.REQUIRE); + }else{ + column.setIsInsert(GenConstants.NO_REQUIRE); + } // 编辑字段 - if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName) && !column.isPk()) - { + if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName)) { column.setIsEdit(GenConstants.REQUIRE); + }else{ + column.setIsEdit(GenConstants.NO_REQUIRE); } // 列表字段 - if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName) && !column.isPk()) - { + if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName)) { column.setIsList(GenConstants.REQUIRE); + }else{ + column.setIsList(GenConstants.NO_REQUIRE); } // 查询字段 - if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName) && !column.isPk()) - { + if (!arraysContains(GenConstants.COLUMNNAME_NOT_QUERY, columnName)) { column.setIsQuery(GenConstants.REQUIRE); + }else{ + column.setIsQuery(GenConstants.NO_REQUIRE); } // 查询字段类型 - if (StringUtils.endsWithIgnoreCase(columnName, "name")) - { + if (StringUtils.endsWithIgnoreCase(columnName, "name")) { column.setQueryType(GenConstants.QUERY_LIKE); } // 状态字段设置单选框 - if (StringUtils.endsWithIgnoreCase(columnName, "status")) - { + if (StringUtils.endsWithIgnoreCase(columnName, "status")) { column.setHtmlType(GenConstants.HTML_RADIO); } // 类型&性别字段设置下拉框 else if (StringUtils.endsWithIgnoreCase(columnName, "type") - || StringUtils.endsWithIgnoreCase(columnName, "sex")) - { + || StringUtils.endsWithIgnoreCase(columnName, "sex")) { column.setHtmlType(GenConstants.HTML_SELECT); } // 图片字段设置图片上传控件 - else if (StringUtils.endsWithIgnoreCase(columnName, "image")) - { + else if (StringUtils.endsWithIgnoreCase(columnName, "image")) { column.setHtmlType(GenConstants.HTML_IMAGE_UPLOAD); } // 文件字段设置文件上传控件 - else if (StringUtils.endsWithIgnoreCase(columnName, "file")) - { + else if (StringUtils.endsWithIgnoreCase(columnName, "file")) { column.setHtmlType(GenConstants.HTML_FILE_UPLOAD); } // 内容字段设置富文本控件 - else if (StringUtils.endsWithIgnoreCase(columnName, "content")) - { + else if (StringUtils.endsWithIgnoreCase(columnName, "content")) { column.setHtmlType(GenConstants.HTML_EDITOR); } } /** * 校验数组是否包含指定值 - * - * @param arr 数组 + * + * @param arr 数组 * @param targetValue 值 * @return 是否包含 */ - public static boolean arraysContains(String[] arr, String targetValue) - { + public static boolean arraysContains(String[] arr, String targetValue) { return Arrays.asList(arr).contains(targetValue); } /** * 获取模块名 - * + * * @param packageName 包名 * @return 模块名 */ - public static String getModuleName(String packageName) - { + public static String getModuleName(String packageName) { int lastIndex = packageName.lastIndexOf("."); int nameLength = packageName.length(); return StringUtils.substring(packageName, lastIndex + 1, nameLength); @@ -157,12 +145,11 @@ public class GenUtils /** * 获取业务名 - * + * * @param tableName 表名 * @return 业务名 */ - public static String getBusinessName(String tableName) - { + public static String getBusinessName(String tableName) { int lastIndex = tableName.lastIndexOf("_"); int nameLength = tableName.length(); return StringUtils.substring(tableName, lastIndex + 1, nameLength); @@ -170,16 +157,14 @@ public class GenUtils /** * 表名转换成Java类名 - * + * * @param tableName 表名称 * @return 类名 */ - public static String convertClassName(String tableName) - { + public static String convertClassName(String tableName) { boolean autoRemovePre = GenConfig.getAutoRemovePre(); String tablePrefix = GenConfig.getTablePrefix(); - if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) - { + if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) { String[] searchList = StringUtils.split(tablePrefix, ","); tableName = replaceFirst(tableName, searchList); } @@ -188,18 +173,15 @@ public class GenUtils /** * 批量替换前缀 - * + * * @param replacementm 替换值 - * @param searchList 替换列表 + * @param searchList 替换列表 * @return */ - public static String replaceFirst(String replacementm, String[] searchList) - { + public static String replaceFirst(String replacementm, String[] searchList) { String text = replacementm; - for (String searchString : searchList) - { - if (replacementm.startsWith(searchString)) - { + for (String searchString : searchList) { + if (replacementm.startsWith(searchString)) { text = replacementm.replaceFirst(searchString, ""); break; } @@ -209,48 +191,39 @@ public class GenUtils /** * 关键字替换 - * + * * @param text 需要被替换的名字 * @return 替换后的名字 */ - public static String replaceText(String text) - { + public static String replaceText(String text) { return RegExUtils.replaceAll(text, "(?:表|智慧物流数据中心)", ""); } /** * 获取数据库类型字段 - * + * * @param columnType 列类型 * @return 截取后的列类型 */ - public static String getDbType(String columnType) - { - if (StringUtils.indexOf(columnType, "(") > 0) - { + public static String getDbType(String columnType) { + if (StringUtils.indexOf(columnType, "(") > 0) { return StringUtils.substringBefore(columnType, "("); - } - else - { + } else { return columnType; } } /** * 获取字段长度 - * + * * @param columnType 列类型 * @return 截取后的列类型 */ - public static Integer getColumnLength(String columnType) - { - if (StringUtils.indexOf(columnType, "(") > 0) - { + public static Integer getColumnLength(String columnType) { + if (StringUtils.indexOf(columnType, "(") > 0) { String length = StringUtils.substringBetween(columnType, "(", ")"); return Integer.valueOf(length); - } - else - { + } else { return 0; } } diff --git a/ruoyi-generator/src/main/resources/generator.yml b/ruoyi-generator/src/main/resources/generator.yml index 69a13cf..7612fac 100644 --- a/ruoyi-generator/src/main/resources/generator.yml +++ b/ruoyi-generator/src/main/resources/generator.yml @@ -1,10 +1,10 @@ # 代码生成 -gen: +gen: # 作者 - author: ruoyi + author: LiuChengRan # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool packageName: com.ruoyi.business # 自动去除表前缀,默认是false - autoRemovePre: false + autoRemovePre: true # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) - tablePrefix: sys_ \ No newline at end of file + tablePrefix: sys_,ct_ diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml index 11b2b96..66109de 100644 --- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml +++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -28,23 +28,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column - + - + - + insert into gen_table_column ( table_id, @@ -88,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sysdate() ) - + update gen_table_column @@ -111,14 +111,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from gen_table_column where table_id in + delete from gen_table_column where table_id in #{tableId} - + - delete from gen_table_column where column_id in + delete from gen_table_column where column_id in #{item.columnId} diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml index b605e90..9431d2e 100644 --- a/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml +++ b/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml @@ -73,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + order by create_time desc