dev-1
parent
3bb6b71a99
commit
7d880faa7f
|
@ -0,0 +1,28 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-common-goods</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- MuYu Common Core-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -60,9 +60,9 @@ public class TokenService {
|
||||||
Map<String, Object> rspMap = new HashMap<String, Object>();
|
Map<String, Object> rspMap = new HashMap<String, Object>();
|
||||||
rspMap.put("access_token", JwtUtils.createToken(claimsMap));
|
rspMap.put("access_token", JwtUtils.createToken(claimsMap));
|
||||||
rspMap.put("expires_in", expireTime);
|
rspMap.put("expires_in", expireTime);
|
||||||
|
System.out.println(token);
|
||||||
return rspMap;
|
return rspMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户身份信息
|
* 获取用户身份信息
|
||||||
*
|
*
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<module>muyu-common-datascope</module>
|
<module>muyu-common-datascope</module>
|
||||||
<module>muyu-common-datasource</module>
|
<module>muyu-common-datasource</module>
|
||||||
<module>muyu-common-system</module>
|
<module>muyu-common-system</module>
|
||||||
|
<module>muyu-common-goods</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>muyu-common</artifactId>
|
<artifactId>muyu-common</artifactId>
|
||||||
|
|
|
@ -16,25 +16,46 @@
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- 通用 -->
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>muyu-common-core</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- 导入 -->
|
|
||||||
<!-- 导入 -->
|
<!-- SpringCloud Alibaba Nacos Config -->
|
||||||
<!-- 导入 -->
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Sentinel -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot Actuator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Swagger UI -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>${swagger.fox.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Mysql Connector -->
|
<!-- Mysql Connector -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mysql</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- common redis -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>muyu-common-redis</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- MuYu Common DataSource -->
|
<!-- MuYu Common DataSource -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
|
@ -47,17 +68,18 @@
|
||||||
<artifactId>muyu-common-datascope</artifactId>
|
<artifactId>muyu-common-datascope</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- common swagger -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>muyu-common-swagger</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common Log -->
|
<!-- MuYu Common Log -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>muyu-common-log</artifactId>
|
<artifactId>muyu-common-log</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-swagger</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -84,5 +106,4 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -5,14 +5,13 @@ import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
||||||
|
|
||||||
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
|
|
||||||
@EnableCustomConfig
|
@EnableCustomConfig
|
||||||
@EnableCustomSwagger2
|
@EnableCustomSwagger2
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients
|
||||||
public class MuYuGoodsAppliction {
|
@SpringBootApplication
|
||||||
|
public class MuYuGoodsApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(MuYuGoodsAppliction.class);
|
SpringApplication.run(MuYuGoodsApplication.class,args);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,98 +0,0 @@
|
||||||
package com.muyu.goods.controller;
|
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
|
||||||
import com.muyu.common.log.annotation.Log;
|
|
||||||
import com.muyu.common.log.enums.BusinessType;
|
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
|
||||||
import com.muyu.goods.domain.Admin;
|
|
||||||
import com.muyu.goods.service.IAdminService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试信息Controller
|
|
||||||
*
|
|
||||||
* @author muyu
|
|
||||||
* @date 2024-04-21
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/admin")
|
|
||||||
public class AdminController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IAdminService adminService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询测试信息列表
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("goods:admin:list")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public Result<TableDataInfo<Admin>> list(Admin admin)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<Admin> list = adminService.selectAdminList(admin);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出测试信息列表
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("goods:admin:export")
|
|
||||||
@Log(title = "测试信息", businessType = BusinessType.EXPORT)
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, Admin admin)
|
|
||||||
{
|
|
||||||
List<Admin> list = adminService.selectAdminList(admin);
|
|
||||||
ExcelUtil<Admin> util = new ExcelUtil<Admin>(Admin.class);
|
|
||||||
util.exportExcel(response, list, "测试信息数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取测试信息详细信息
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("goods:admin:query")
|
|
||||||
@GetMapping(value = "/{id}")
|
|
||||||
public Result getInfo(@PathVariable("id") Long id)
|
|
||||||
{
|
|
||||||
return success(adminService.selectAdminById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增测试信息
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("goods:admin:add")
|
|
||||||
@Log(title = "测试信息", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public Result add(@RequestBody Admin admin)
|
|
||||||
{
|
|
||||||
return toAjax(adminService.insertAdmin(admin));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改测试信息
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("goods:admin:edit")
|
|
||||||
@Log(title = "测试信息", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public Result edit(@RequestBody Admin admin)
|
|
||||||
{
|
|
||||||
return toAjax(adminService.updateAdmin(admin));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除测试信息
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("goods:admin:remove")
|
|
||||||
@Log(title = "测试信息", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{ids}")
|
|
||||||
public Result remove(@PathVariable Long[] ids)
|
|
||||||
{
|
|
||||||
return toAjax(adminService.deleteAdminByIds(ids));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
package com.muyu.goods.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
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.muyu.common.log.annotation.Log;
|
||||||
|
import com.muyu.common.log.enums.BusinessType;
|
||||||
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.muyu.goods.domain.Config;
|
||||||
|
import com.muyu.goods.service.IConfigService;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 引擎Controller
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-05-04
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/config")
|
||||||
|
public class ConfigController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IConfigService configService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询引擎列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:config:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<TableDataInfo<Config>> list(Config config)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<Config> list = configService.selectConfigList(config);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出引擎列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:config:export")
|
||||||
|
@Log(title = "引擎", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, Config config)
|
||||||
|
{
|
||||||
|
List<Config> list = configService.selectConfigList(config);
|
||||||
|
ExcelUtil<Config> util = new ExcelUtil<Config>(Config.class);
|
||||||
|
util.exportExcel(response, list, "引擎数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取引擎详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:config:query")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public Result getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(configService.selectConfigById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增引擎
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:config:add")
|
||||||
|
@Log(title = "引擎", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public Result add(@RequestBody Config config)
|
||||||
|
{
|
||||||
|
return toAjax(configService.insertConfig(config));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改引擎
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:config:edit")
|
||||||
|
@Log(title = "引擎", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public Result edit(@RequestBody Config config)
|
||||||
|
{
|
||||||
|
return toAjax(configService.updateConfig(config));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除引擎
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("system:config:remove")
|
||||||
|
@Log(title = "引擎", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public Result remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(configService.deleteConfigByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.muyu.goods.controller;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.goods.domain.Cope;
|
||||||
|
import com.muyu.goods.service.CopeService;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cope")
|
||||||
|
public class CopeController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private CopeService service;
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public Result<List<Cope>> list() {
|
||||||
|
return success(service.list());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,114 @@
|
||||||
|
package com.muyu.goods.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
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.muyu.common.log.annotation.Log;
|
||||||
|
import com.muyu.common.log.enums.BusinessType;
|
||||||
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.muyu.goods.domain.RuleEngine;
|
||||||
|
import com.muyu.goods.service.IRuleEngineService;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则引擎Controller
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-05-02
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/engine")
|
||||||
|
public class RuleEngineController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IRuleEngineService ruleEngineService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询规则引擎列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("goods:engine:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<TableDataInfo<RuleEngine>> list(RuleEngine ruleEngine)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<RuleEngine> list = ruleEngineService.selectRuleEngineList(ruleEngine);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出规则引擎列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("goods:engine:export")
|
||||||
|
@Log(title = "规则引擎", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, RuleEngine ruleEngine)
|
||||||
|
{
|
||||||
|
List<RuleEngine> list = ruleEngineService.selectRuleEngineList(ruleEngine);
|
||||||
|
ExcelUtil<RuleEngine> util = new ExcelUtil<RuleEngine>(RuleEngine.class);
|
||||||
|
util.exportExcel(response, list, "规则引擎数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取规则引擎详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("goods:engine:query")
|
||||||
|
@GetMapping(value = "/{ruleId}")
|
||||||
|
public Result getInfo(@PathVariable("ruleId") Long ruleId)
|
||||||
|
{
|
||||||
|
return success(ruleEngineService.selectRuleEngineByRuleId(ruleId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增规则引擎
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("goods:engine:add")
|
||||||
|
@Log(title = "规则引擎", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public Result add(@RequestBody RuleEngine ruleEngine)
|
||||||
|
{
|
||||||
|
return toAjax(ruleEngineService.insertRuleEngine(ruleEngine));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改规则引擎
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("goods:engine:edit")
|
||||||
|
@Log(title = "规则引擎", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public Result edit(@RequestBody RuleEngine ruleEngine)
|
||||||
|
{
|
||||||
|
return toAjax(ruleEngineService.updateRuleEngine(ruleEngine));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除规则引擎
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("goods:engine:remove")
|
||||||
|
@Log(title = "规则引擎", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ruleIds}")
|
||||||
|
public Result remove(@PathVariable Long[] ruleIds)
|
||||||
|
{
|
||||||
|
return toAjax(ruleEngineService.deleteRuleEngineByRuleIds(ruleIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则描述
|
||||||
|
* @param ruleId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/description/{ruleId}")
|
||||||
|
public Result<String> description(@PathVariable Integer ruleId){
|
||||||
|
return success(ruleEngineService.description(ruleId));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,93 +0,0 @@
|
||||||
package com.muyu.goods.domain;
|
|
||||||
|
|
||||||
import com.muyu.common.core.annotation.Excel;
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试信息对象 admin
|
|
||||||
*
|
|
||||||
* @author muyu
|
|
||||||
* @date 2024-04-21
|
|
||||||
*/
|
|
||||||
public class Admin extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 主键 */
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/** 用户名 */
|
|
||||||
@Excel(name = "用户名")
|
|
||||||
private String username;
|
|
||||||
|
|
||||||
/** 密码 */
|
|
||||||
@Excel(name = "密码")
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
/** 号码 */
|
|
||||||
@Excel(name = "号码")
|
|
||||||
private String tel;
|
|
||||||
|
|
||||||
/** 角色 */
|
|
||||||
@Excel(name = "角色")
|
|
||||||
private Long typeId;
|
|
||||||
|
|
||||||
public void setId(Long id)
|
|
||||||
{
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId()
|
|
||||||
{
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public void setUsername(String username)
|
|
||||||
{
|
|
||||||
this.username = username;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUsername()
|
|
||||||
{
|
|
||||||
return username;
|
|
||||||
}
|
|
||||||
public void setPassword(String password)
|
|
||||||
{
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPassword()
|
|
||||||
{
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
public void setTel(String tel)
|
|
||||||
{
|
|
||||||
this.tel = tel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTel()
|
|
||||||
{
|
|
||||||
return tel;
|
|
||||||
}
|
|
||||||
public void setTypeId(Long typeId)
|
|
||||||
{
|
|
||||||
this.typeId = typeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getTypeId()
|
|
||||||
{
|
|
||||||
return typeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("id", getId())
|
|
||||||
.append("username", getUsername())
|
|
||||||
.append("password", getPassword())
|
|
||||||
.append("tel", getTel())
|
|
||||||
.append("typeId", getTypeId())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
package com.muyu.goods.domain;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 引擎对象 config
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-05-04
|
||||||
|
*/
|
||||||
|
public class Config extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 编号 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 版本编码 */
|
||||||
|
@Excel(name = "版本编码")
|
||||||
|
private String versionCode;
|
||||||
|
|
||||||
|
/** 规则内容 */
|
||||||
|
@Excel(name = "规则内容")
|
||||||
|
private String ruleContent;
|
||||||
|
|
||||||
|
/** 维护编号 */
|
||||||
|
@Excel(name = "维护编号")
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setVersionCode(String versionCode)
|
||||||
|
{
|
||||||
|
this.versionCode = versionCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersionCode()
|
||||||
|
{
|
||||||
|
return versionCode;
|
||||||
|
}
|
||||||
|
public void setRuleContent(String ruleContent)
|
||||||
|
{
|
||||||
|
this.ruleContent = ruleContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleContent()
|
||||||
|
{
|
||||||
|
return ruleContent;
|
||||||
|
}
|
||||||
|
public void setRuleId(Long ruleId)
|
||||||
|
{
|
||||||
|
this.ruleId = ruleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRuleId()
|
||||||
|
{
|
||||||
|
return ruleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("versionCode", getVersionCode())
|
||||||
|
.append("ruleContent", getRuleContent())
|
||||||
|
.append("ruleId", getRuleId())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.muyu.goods.domain;
|
||||||
|
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Cope extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
*命名
|
||||||
|
*/
|
||||||
|
private String val;
|
||||||
|
/**
|
||||||
|
*内容
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,136 @@
|
||||||
|
package com.muyu.goods.domain;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则引擎对象 rule_engine
|
||||||
|
*
|
||||||
|
* @author goods
|
||||||
|
* @date 2024-05-02
|
||||||
|
*/
|
||||||
|
public class RuleEngine extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
/** 规则名称 */
|
||||||
|
@Excel(name = "规则名称")
|
||||||
|
private String ruleName;
|
||||||
|
|
||||||
|
/** 引擎编码 */
|
||||||
|
@Excel(name = "引擎编码")
|
||||||
|
private String ruleCode;
|
||||||
|
|
||||||
|
/** 规则级别 */
|
||||||
|
@Excel(name = "规则级别")
|
||||||
|
private String ruleLevel;
|
||||||
|
|
||||||
|
/** 规则类型 */
|
||||||
|
@Excel(name = "规则类型")
|
||||||
|
private String ruleType;
|
||||||
|
|
||||||
|
/** 是否激活 */
|
||||||
|
@Excel(name = "是否激活")
|
||||||
|
private String ruleIsActivate;
|
||||||
|
|
||||||
|
/** 规则状态 */
|
||||||
|
@Excel(name = "规则状态")
|
||||||
|
private String ruleStatus;
|
||||||
|
|
||||||
|
/** 规则描述 */
|
||||||
|
@Excel(name = "规则描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
public void setRuleId(Long ruleId)
|
||||||
|
{
|
||||||
|
this.ruleId = ruleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRuleId()
|
||||||
|
{
|
||||||
|
return ruleId;
|
||||||
|
}
|
||||||
|
public void setRuleName(String ruleName)
|
||||||
|
{
|
||||||
|
this.ruleName = ruleName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleName()
|
||||||
|
{
|
||||||
|
return ruleName;
|
||||||
|
}
|
||||||
|
public void setRuleCode(String ruleCode)
|
||||||
|
{
|
||||||
|
this.ruleCode = ruleCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleCode()
|
||||||
|
{
|
||||||
|
return ruleCode;
|
||||||
|
}
|
||||||
|
public void setRuleLevel(String ruleLevel)
|
||||||
|
{
|
||||||
|
this.ruleLevel = ruleLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleLevel()
|
||||||
|
{
|
||||||
|
return ruleLevel;
|
||||||
|
}
|
||||||
|
public void setRuleType(String ruleType)
|
||||||
|
{
|
||||||
|
this.ruleType = ruleType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleType()
|
||||||
|
{
|
||||||
|
return ruleType;
|
||||||
|
}
|
||||||
|
public void setRuleIsActivate(String ruleIsActivate)
|
||||||
|
{
|
||||||
|
this.ruleIsActivate = ruleIsActivate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleIsActivate()
|
||||||
|
{
|
||||||
|
return ruleIsActivate;
|
||||||
|
}
|
||||||
|
public void setRuleStatus(String ruleStatus)
|
||||||
|
{
|
||||||
|
this.ruleStatus = ruleStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleStatus()
|
||||||
|
{
|
||||||
|
return ruleStatus;
|
||||||
|
}
|
||||||
|
public void setDescription(String description)
|
||||||
|
{
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription()
|
||||||
|
{
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("ruleId", getRuleId())
|
||||||
|
.append("ruleName", getRuleName())
|
||||||
|
.append("ruleCode", getRuleCode())
|
||||||
|
.append("ruleLevel", getRuleLevel())
|
||||||
|
.append("ruleType", getRuleType())
|
||||||
|
.append("ruleIsActivate", getRuleIsActivate())
|
||||||
|
.append("ruleStatus", getRuleStatus())
|
||||||
|
.append("description", getDescription())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,64 +0,0 @@
|
||||||
package com.muyu.goods.mapper;
|
|
||||||
|
|
||||||
import com.muyu.goods.domain.Admin;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试信息Mapper接口
|
|
||||||
*
|
|
||||||
* @author muyu
|
|
||||||
* @date 2024-04-21
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface AdminMapper
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询测试信息
|
|
||||||
*
|
|
||||||
* @param id 测试信息主键
|
|
||||||
* @return 测试信息
|
|
||||||
*/
|
|
||||||
public Admin selectAdminById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询测试信息列表
|
|
||||||
*
|
|
||||||
* @param admin 测试信息
|
|
||||||
* @return 测试信息集合
|
|
||||||
*/
|
|
||||||
public List<Admin> selectAdminList(Admin admin);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增测试信息
|
|
||||||
*
|
|
||||||
* @param admin 测试信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertAdmin(Admin admin);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改测试信息
|
|
||||||
*
|
|
||||||
* @param admin 测试信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateAdmin(Admin admin);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除测试信息
|
|
||||||
*
|
|
||||||
* @param id 测试信息主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteAdminById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除测试信息
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的数据主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteAdminByIds(Long[] ids);
|
|
||||||
}
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.muyu.goods.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.muyu.goods.domain.Config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 引擎Mapper接口
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-05-04
|
||||||
|
*/
|
||||||
|
public interface ConfigMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询引擎
|
||||||
|
*
|
||||||
|
* @param id 引擎主键
|
||||||
|
* @return 引擎
|
||||||
|
*/
|
||||||
|
public Config selectConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询引擎列表
|
||||||
|
*
|
||||||
|
* @param config 引擎
|
||||||
|
* @return 引擎集合
|
||||||
|
*/
|
||||||
|
public List<Config> selectConfigList(Config config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增引擎
|
||||||
|
*
|
||||||
|
* @param config 引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertConfig(Config config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改引擎
|
||||||
|
*
|
||||||
|
* @param config 引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateConfig(Config config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除引擎
|
||||||
|
*
|
||||||
|
* @param id 引擎主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除引擎
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteConfigByIds(Long[] ids);
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.muyu.goods.mapper;
|
||||||
|
|
||||||
|
import com.muyu.goods.domain.Cope;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CopeMapper {
|
||||||
|
List<Cope> list();
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.muyu.goods.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.muyu.goods.domain.RuleEngine;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则引擎Mapper接口
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-05-02
|
||||||
|
*/
|
||||||
|
public interface RuleEngineMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleId 规则引擎主键
|
||||||
|
* @return 规则引擎
|
||||||
|
*/
|
||||||
|
public RuleEngine selectRuleEngineByRuleId(Long ruleId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询规则引擎列表
|
||||||
|
*
|
||||||
|
* @param ruleEngine 规则引擎
|
||||||
|
* @return 规则引擎集合
|
||||||
|
*/
|
||||||
|
public List<RuleEngine> selectRuleEngineList(RuleEngine ruleEngine);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleEngine 规则引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertRuleEngine(RuleEngine ruleEngine);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleEngine 规则引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateRuleEngine(RuleEngine ruleEngine);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleId 规则引擎主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRuleEngineByRuleId(Long ruleId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRuleEngineByRuleIds(Long[] ruleIds);
|
||||||
|
|
||||||
|
String description(@Param("ruleId") Integer ruleId);
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.muyu.goods.service;
|
||||||
|
|
||||||
|
import com.muyu.goods.domain.Cope;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CopeService {
|
||||||
|
List<Cope> list();
|
||||||
|
}
|
|
@ -1,62 +0,0 @@
|
||||||
package com.muyu.goods.service;
|
|
||||||
|
|
||||||
import com.muyu.goods.domain.Admin;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试信息Service接口
|
|
||||||
*
|
|
||||||
* @author muyu
|
|
||||||
* @date 2024-04-21
|
|
||||||
*/
|
|
||||||
public interface IAdminService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 查询测试信息
|
|
||||||
*
|
|
||||||
* @param id 测试信息主键
|
|
||||||
* @return 测试信息
|
|
||||||
*/
|
|
||||||
public Admin selectAdminById(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询测试信息列表
|
|
||||||
*
|
|
||||||
* @param admin 测试信息
|
|
||||||
* @return 测试信息集合
|
|
||||||
*/
|
|
||||||
public List<Admin> selectAdminList(Admin admin);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增测试信息
|
|
||||||
*
|
|
||||||
* @param admin 测试信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int insertAdmin(Admin admin);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改测试信息
|
|
||||||
*
|
|
||||||
* @param admin 测试信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateAdmin(Admin admin);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除测试信息
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的测试信息主键集合
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteAdminByIds(Long[] ids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除测试信息信息
|
|
||||||
*
|
|
||||||
* @param id 测试信息主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int deleteAdminById(Long id);
|
|
||||||
}
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.muyu.goods.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.muyu.goods.domain.Config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 引擎Service接口
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-05-04
|
||||||
|
*/
|
||||||
|
public interface IConfigService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询引擎
|
||||||
|
*
|
||||||
|
* @param id 引擎主键
|
||||||
|
* @return 引擎
|
||||||
|
*/
|
||||||
|
public Config selectConfigById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询引擎列表
|
||||||
|
*
|
||||||
|
* @param config 引擎
|
||||||
|
* @return 引擎集合
|
||||||
|
*/
|
||||||
|
public List<Config> selectConfigList(Config config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增引擎
|
||||||
|
*
|
||||||
|
* @param config 引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertConfig(Config config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改引擎
|
||||||
|
*
|
||||||
|
* @param config 引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateConfig(Config config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除引擎
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的引擎主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteConfigByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除引擎信息
|
||||||
|
*
|
||||||
|
* @param id 引擎主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteConfigById(Long id);
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.muyu.goods.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.muyu.goods.domain.RuleEngine;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则引擎Service接口
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-05-02
|
||||||
|
*/
|
||||||
|
public interface IRuleEngineService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleId 规则引擎主键
|
||||||
|
* @return 规则引擎
|
||||||
|
*/
|
||||||
|
public RuleEngine selectRuleEngineByRuleId(Long ruleId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询规则引擎列表
|
||||||
|
*
|
||||||
|
* @param ruleEngine 规则引擎
|
||||||
|
* @return 规则引擎集合
|
||||||
|
*/
|
||||||
|
public List<RuleEngine> selectRuleEngineList(RuleEngine ruleEngine);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleEngine 规则引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertRuleEngine(RuleEngine ruleEngine);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleEngine 规则引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateRuleEngine(RuleEngine ruleEngine);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleIds 需要删除的规则引擎主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRuleEngineByRuleIds(Long[] ruleIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除规则引擎信息
|
||||||
|
*
|
||||||
|
* @param ruleId 规则引擎主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRuleEngineByRuleId(Long ruleId);
|
||||||
|
|
||||||
|
String description(Integer ruleId);
|
||||||
|
}
|
|
@ -1,94 +0,0 @@
|
||||||
package com.muyu.goods.service.impl;
|
|
||||||
|
|
||||||
import com.muyu.goods.domain.Admin;
|
|
||||||
import com.muyu.goods.mapper.AdminMapper;
|
|
||||||
import com.muyu.goods.service.IAdminService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试信息Service业务层处理
|
|
||||||
*
|
|
||||||
* @author muyu
|
|
||||||
* @date 2024-04-21
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class AdminServiceImpl implements IAdminService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private AdminMapper adminMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询测试信息
|
|
||||||
*
|
|
||||||
* @param id 测试信息主键
|
|
||||||
* @return 测试信息
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Admin selectAdminById(Long id)
|
|
||||||
{
|
|
||||||
return adminMapper.selectAdminById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询测试信息列表
|
|
||||||
*
|
|
||||||
* @param admin 测试信息
|
|
||||||
* @return 测试信息
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<Admin> selectAdminList(Admin admin)
|
|
||||||
{
|
|
||||||
return adminMapper.selectAdminList(admin);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增测试信息
|
|
||||||
*
|
|
||||||
* @param admin 测试信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertAdmin(Admin admin)
|
|
||||||
{
|
|
||||||
return adminMapper.insertAdmin(admin);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改测试信息
|
|
||||||
*
|
|
||||||
* @param admin 测试信息
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateAdmin(Admin admin)
|
|
||||||
{
|
|
||||||
return adminMapper.updateAdmin(admin);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除测试信息
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的测试信息主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteAdminByIds(Long[] ids)
|
|
||||||
{
|
|
||||||
return adminMapper.deleteAdminByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除测试信息信息
|
|
||||||
*
|
|
||||||
* @param id 测试信息主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteAdminById(Long id)
|
|
||||||
{
|
|
||||||
return adminMapper.deleteAdminById(id);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.muyu.goods.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.muyu.goods.mapper.ConfigMapper;
|
||||||
|
import com.muyu.goods.domain.Config;
|
||||||
|
import com.muyu.goods.service.IConfigService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 引擎Service业务层处理
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-05-04
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ConfigServiceImpl implements IConfigService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ConfigMapper configMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询引擎
|
||||||
|
*
|
||||||
|
* @param id 引擎主键
|
||||||
|
* @return 引擎
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Config selectConfigById(Long id)
|
||||||
|
{
|
||||||
|
return configMapper.selectConfigById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询引擎列表
|
||||||
|
*
|
||||||
|
* @param config 引擎
|
||||||
|
* @return 引擎
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Config> selectConfigList(Config config)
|
||||||
|
{
|
||||||
|
return configMapper.selectConfigList(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增引擎
|
||||||
|
*
|
||||||
|
* @param config 引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertConfig(Config config)
|
||||||
|
{
|
||||||
|
return configMapper.insertConfig(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改引擎
|
||||||
|
*
|
||||||
|
* @param config 引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateConfig(Config config)
|
||||||
|
{
|
||||||
|
return configMapper.updateConfig(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除引擎
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的引擎主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteConfigByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return configMapper.deleteConfigByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除引擎信息
|
||||||
|
*
|
||||||
|
* @param id 引擎主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteConfigById(Long id)
|
||||||
|
{
|
||||||
|
return configMapper.deleteConfigById(id);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.muyu.goods.service.impl;
|
||||||
|
|
||||||
|
import com.muyu.goods.domain.Cope;
|
||||||
|
import com.muyu.goods.mapper.CopeMapper;
|
||||||
|
import com.muyu.goods.service.CopeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CopeServiceImpl implements CopeService {
|
||||||
|
@Autowired
|
||||||
|
private CopeMapper mapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Cope> list() {
|
||||||
|
return mapper.list();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.muyu.goods.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.muyu.goods.mapper.RuleEngineMapper;
|
||||||
|
import com.muyu.goods.domain.RuleEngine;
|
||||||
|
import com.muyu.goods.service.IRuleEngineService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则引擎Service业务层处理
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
* @date 2024-05-02
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class RuleEngineServiceImpl implements IRuleEngineService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private RuleEngineMapper ruleEngineMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleId 规则引擎主键
|
||||||
|
* @return 规则引擎
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public RuleEngine selectRuleEngineByRuleId(Long ruleId)
|
||||||
|
{
|
||||||
|
return ruleEngineMapper.selectRuleEngineByRuleId(ruleId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询规则引擎列表
|
||||||
|
*
|
||||||
|
* @param ruleEngine 规则引擎
|
||||||
|
* @return 规则引擎
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<RuleEngine> selectRuleEngineList(RuleEngine ruleEngine)
|
||||||
|
{
|
||||||
|
return ruleEngineMapper.selectRuleEngineList(ruleEngine);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleEngine 规则引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertRuleEngine(RuleEngine ruleEngine)
|
||||||
|
{
|
||||||
|
return ruleEngineMapper.insertRuleEngine(ruleEngine);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleEngine 规则引擎
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateRuleEngine(RuleEngine ruleEngine)
|
||||||
|
{
|
||||||
|
return ruleEngineMapper.updateRuleEngine(ruleEngine);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除规则引擎
|
||||||
|
*
|
||||||
|
* @param ruleIds 需要删除的规则引擎主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteRuleEngineByRuleIds(Long[] ruleIds)
|
||||||
|
{
|
||||||
|
return ruleEngineMapper.deleteRuleEngineByRuleIds(ruleIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除规则引擎信息
|
||||||
|
*
|
||||||
|
* @param ruleId 规则引擎主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteRuleEngineByRuleId(Long ruleId)
|
||||||
|
{
|
||||||
|
return ruleEngineMapper.deleteRuleEngineByRuleId(ruleId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String description(Integer ruleId) {
|
||||||
|
return ruleEngineMapper.description(ruleId);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
public class yes {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("yes");
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
# Tomcat
|
# Tomcat
|
||||||
server:
|
server:
|
||||||
port: 9502
|
port: 9501
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
|
@ -1,71 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.muyu.goods.mapper.AdminMapper">
|
|
||||||
|
|
||||||
<resultMap type="com.muyu.goods.domain.Admin" id="AdminResult">
|
|
||||||
<result property="id" column="id" />
|
|
||||||
<result property="username" column="username" />
|
|
||||||
<result property="password" column="password" />
|
|
||||||
<result property="tel" column="tel" />
|
|
||||||
<result property="typeId" column="type_id" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectAdminVo">
|
|
||||||
select id, username, password, tel, type_id from admin
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="selectAdminList" parameterType="com.muyu.goods.domain.Admin" resultMap="AdminResult">
|
|
||||||
<include refid="selectAdminVo"/>
|
|
||||||
<where>
|
|
||||||
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
|
|
||||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
|
||||||
<if test="tel != null and tel != ''"> and tel = #{tel}</if>
|
|
||||||
<if test="typeId != null "> and type_id = #{typeId}</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectAdminById" parameterType="Long" resultMap="AdminResult">
|
|
||||||
<include refid="selectAdminVo"/>
|
|
||||||
where id = #{id}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertAdmin" parameterType="com.muyu.goods.domain.Admin" useGeneratedKeys="true" keyProperty="id">
|
|
||||||
insert into admin
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="username != null">username,</if>
|
|
||||||
<if test="password != null">password,</if>
|
|
||||||
<if test="tel != null">tel,</if>
|
|
||||||
<if test="typeId != null">type_id,</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="username != null">#{username},</if>
|
|
||||||
<if test="password != null">#{password},</if>
|
|
||||||
<if test="tel != null">#{tel},</if>
|
|
||||||
<if test="typeId != null">#{typeId},</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="updateAdmin" parameterType="com.muyu.goods.domain.Admin">
|
|
||||||
update admin
|
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
|
||||||
<if test="username != null">username = #{username},</if>
|
|
||||||
<if test="password != null">password = #{password},</if>
|
|
||||||
<if test="tel != null">tel = #{tel},</if>
|
|
||||||
<if test="typeId != null">type_id = #{typeId},</if>
|
|
||||||
</trim>
|
|
||||||
where id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="deleteAdminById" parameterType="Long">
|
|
||||||
delete from admin where id = #{id}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="deleteAdminByIds" parameterType="String">
|
|
||||||
delete from admin where id in
|
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
||||||
#{id}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
</mapper>
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.muyu.goods.mapper.ConfigMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.goods.domain.Config" id="ConfigResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="versionCode" column="version_code" />
|
||||||
|
<result property="ruleContent" column="rule_content" />
|
||||||
|
<result property="ruleId" column="rule_id" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectConfigVo">
|
||||||
|
select id, version_code, rule_content, rule_id from config
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectConfigList" parameterType="com.muyu.goods.domain.Config" resultMap="ConfigResult">
|
||||||
|
<include refid="selectConfigVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="versionCode != null and versionCode != ''"> and version_code = #{versionCode}</if>
|
||||||
|
<if test="ruleContent != null and ruleContent != ''"> and rule_content = #{ruleContent}</if>
|
||||||
|
<if test="ruleId != null "> and rule_id = #{ruleId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectConfigById" parameterType="Long" resultMap="ConfigResult">
|
||||||
|
<include refid="selectConfigVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertConfig" parameterType="com.muyu.goods.domain.Config" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into config
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="versionCode != null">version_code,</if>
|
||||||
|
<if test="ruleContent != null">rule_content,</if>
|
||||||
|
<if test="ruleId != null">rule_id,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="versionCode != null">#{versionCode},</if>
|
||||||
|
<if test="ruleContent != null">#{ruleContent},</if>
|
||||||
|
<if test="ruleId != null">#{ruleId},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateConfig" parameterType="com.muyu.goods.domain.Config">
|
||||||
|
update config
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="versionCode != null">version_code = #{versionCode},</if>
|
||||||
|
<if test="ruleContent != null">rule_content = #{ruleContent},</if>
|
||||||
|
<if test="ruleId != null">rule_id = #{ruleId},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteConfigById" parameterType="Long">
|
||||||
|
delete from config where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteConfigByIds" parameterType="String">
|
||||||
|
delete from config where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.muyu.goods.mapper.CopeMapper">
|
||||||
|
|
||||||
|
<select id="list" resultType="com.muyu.goods.domain.Cope">
|
||||||
|
select *
|
||||||
|
from cope
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,92 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.muyu.goods.mapper.RuleEngineMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.goods.domain.RuleEngine" id="RuleEngineResult">
|
||||||
|
<result property="ruleId" column="rule_id" />
|
||||||
|
<result property="ruleName" column="rule_name" />
|
||||||
|
<result property="ruleCode" column="rule_code" />
|
||||||
|
<result property="ruleLevel" column="rule_level" />
|
||||||
|
<result property="ruleType" column="rule_type" />
|
||||||
|
<result property="ruleIsActivate" column="rule_is_activate" />
|
||||||
|
<result property="ruleStatus" column="rule_status" />
|
||||||
|
<result property="description" column="description" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectRuleEngineVo">
|
||||||
|
select rule_id, rule_name, rule_code, rule_level, rule_type, rule_is_activate, rule_status, description, remark from rule_engine
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectRuleEngineList" parameterType="com.muyu.goods.domain.RuleEngine" resultMap="RuleEngineResult">
|
||||||
|
<include refid="selectRuleEngineVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="ruleName != null and ruleName != ''"> and rule_name like concat('%', #{ruleName}, '%')</if>
|
||||||
|
<if test="ruleLevel != null and ruleLevel != ''"> and rule_level = #{ruleLevel}</if>
|
||||||
|
<if test="ruleType != null and ruleType != ''"> and rule_type = #{ruleType}</if>
|
||||||
|
<if test="ruleIsActivate != null and ruleIsActivate != ''"> and rule_is_activate = #{ruleIsActivate}</if>
|
||||||
|
<if test="ruleStatus != null and ruleStatus != ''"> and rule_status = #{ruleStatus}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRuleEngineByRuleId" parameterType="Long" resultMap="RuleEngineResult">
|
||||||
|
<include refid="selectRuleEngineVo"/>
|
||||||
|
where rule_id = #{ruleId}
|
||||||
|
</select>
|
||||||
|
<select id="description" resultType="java.lang.String">
|
||||||
|
select description
|
||||||
|
from rule_engine where rule_id = #{ruleId};
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertRuleEngine" parameterType="com.muyu.goods.domain.RuleEngine" useGeneratedKeys="true" keyProperty="ruleId">
|
||||||
|
insert into rule_engine
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="ruleName != null">rule_name,</if>
|
||||||
|
<if test="ruleCode != null">rule_code,</if>
|
||||||
|
<if test="ruleLevel != null">rule_level,</if>
|
||||||
|
<if test="ruleType != null">rule_type,</if>
|
||||||
|
<if test="ruleIsActivate != null">rule_is_activate,</if>
|
||||||
|
<if test="ruleStatus != null">rule_status,</if>
|
||||||
|
<if test="description != null">description,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="ruleName != null">#{ruleName},</if>
|
||||||
|
<if test="ruleCode != null">#{ruleCode},</if>
|
||||||
|
<if test="ruleLevel != null">#{ruleLevel},</if>
|
||||||
|
<if test="ruleType != null">#{ruleType},</if>
|
||||||
|
<if test="ruleIsActivate != null">#{ruleIsActivate},</if>
|
||||||
|
<if test="ruleStatus != null">#{ruleStatus},</if>
|
||||||
|
<if test="description != null">#{description},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateRuleEngine" parameterType="com.muyu.goods.domain.RuleEngine">
|
||||||
|
update rule_engine
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="ruleName != null">rule_name = #{ruleName},</if>
|
||||||
|
<if test="ruleCode != null">rule_code = #{ruleCode},</if>
|
||||||
|
<if test="ruleLevel != null">rule_level = #{ruleLevel},</if>
|
||||||
|
<if test="ruleType != null">rule_type = #{ruleType},</if>
|
||||||
|
<if test="ruleIsActivate != null">rule_is_activate = #{ruleIsActivate},</if>
|
||||||
|
<if test="ruleStatus != null">rule_status = #{ruleStatus},</if>
|
||||||
|
<if test="description != null">description = #{description},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
</trim>
|
||||||
|
where rule_id = #{ruleId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteRuleEngineByRuleId" parameterType="Long">
|
||||||
|
delete from rule_engine where rule_id = #{ruleId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteRuleEngineByRuleIds" parameterType="String">
|
||||||
|
delete from rule_engine where rule_id in
|
||||||
|
<foreach item="ruleId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{ruleId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -2,9 +2,9 @@ package com.muyu.system.controller;
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
|
||||||
import com.muyu.system.domain.*;
|
import com.muyu.system.domain.*;
|
||||||
import com.muyu.system.domain.table.TableParams;
|
import com.muyu.system.domain.table.TableShow;
|
||||||
|
import com.muyu.system.domain.table.ToTalNum;
|
||||||
import com.muyu.system.domain.vo.DeptVO;
|
import com.muyu.system.domain.vo.DeptVO;
|
||||||
import com.muyu.system.domain.vo.FrimaryVo;
|
import com.muyu.system.domain.vo.FrimaryVo;
|
||||||
import com.muyu.system.domain.vo.SysUserVo;
|
import com.muyu.system.domain.vo.SysUserVo;
|
||||||
|
@ -12,14 +12,10 @@ import com.muyu.system.domain.vo.TableVo;
|
||||||
import com.muyu.system.service.AccreditService;
|
import com.muyu.system.service.AccreditService;
|
||||||
import com.muyu.system.service.SysDeptService;
|
import com.muyu.system.service.SysDeptService;
|
||||||
import com.muyu.system.service.SysUserService;
|
import com.muyu.system.service.SysUserService;
|
||||||
import io.swagger.models.auth.In;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.bouncycastle.pqc.crypto.newhope.NHSecretKeyProcessor;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.imageio.ImageTranscoder;
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -80,6 +76,16 @@ public class AccreditController extends BaseController {
|
||||||
return error("连接失败");
|
return error("连接失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 测试
|
||||||
|
@PostMapping("/selJDBCStream2")
|
||||||
|
public Result selJDBCStream2(@RequestBody DataAccess dataAccess){
|
||||||
|
Integer id = service.selJDBCStream2(dataAccess);
|
||||||
|
if (id>0){
|
||||||
|
return success("连接成功");
|
||||||
|
}else{
|
||||||
|
return error("连接失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取表详情
|
* 获取表详情
|
||||||
|
@ -222,7 +228,7 @@ public class AccreditController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/updateMiddle")
|
@PostMapping("/updateMiddle")
|
||||||
public Result updateMiddle(@RequestParam Integer mid,@RequestParam Integer statusId){
|
public Result updateMiddle(@RequestParam Integer mid,@RequestParam String statusId){
|
||||||
Integer id = service.updateMiddle(mid,statusId);
|
Integer id = service.updateMiddle(mid,statusId);
|
||||||
if (id>0){
|
if (id>0){
|
||||||
return success("修改完成");
|
return success("修改完成");
|
||||||
|
@ -238,7 +244,7 @@ public class AccreditController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/updateUserMiddle")
|
@PostMapping("/updateUserMiddle")
|
||||||
public Result updateUserMiddle(@RequestParam Integer mid,@RequestParam Integer statusId){
|
public Result updateUserMiddle(@RequestParam Integer mid,@RequestParam String statusId){
|
||||||
Integer id = service.updateUserMiddle(mid,statusId);
|
Integer id = service.updateUserMiddle(mid,statusId);
|
||||||
if (id>0){
|
if (id>0){
|
||||||
return success("修改完成");
|
return success("修改完成");
|
||||||
|
@ -247,6 +253,27 @@ public class AccreditController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据
|
||||||
|
* @param tableName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("selectShow")
|
||||||
|
public Result<List<TableShow>> selectShow(@RequestParam String tableName){
|
||||||
|
List<TableShow> list = service.selectShow(tableName);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看整体
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("selTotalNum")
|
||||||
|
public Result<ToTalNum> selTotalNum() {
|
||||||
|
ToTalNum toTalNum = service.selTotalNum();
|
||||||
|
return success(toTalNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class Middle {
|
||||||
/**
|
/**
|
||||||
* 权限
|
* 权限
|
||||||
*/
|
*/
|
||||||
private Integer statusId;
|
private String statusId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门ID
|
* 部门ID
|
||||||
|
|
|
@ -51,5 +51,5 @@ public class UserMiddle {
|
||||||
/**
|
/**
|
||||||
* 状态
|
* 状态
|
||||||
*/
|
*/
|
||||||
private Integer statusId;
|
private String statusId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.muyu.system.domain.table;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TableShow {
|
||||||
|
/**
|
||||||
|
* 属于
|
||||||
|
*/
|
||||||
|
private String keysed;
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 内容
|
||||||
|
*/
|
||||||
|
private Object val;
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.muyu.system.domain.table;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ToTalNum {
|
||||||
|
/**
|
||||||
|
* 接入数量
|
||||||
|
*/
|
||||||
|
private Integer switchOns;
|
||||||
|
/**
|
||||||
|
*资产模型
|
||||||
|
*/
|
||||||
|
private Integer assetsNum;
|
||||||
|
/**
|
||||||
|
* 字段模型
|
||||||
|
*/
|
||||||
|
private Integer fieldsNum;
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package com.muyu.system.mapper;
|
||||||
|
|
||||||
import com.muyu.system.domain.*;
|
import com.muyu.system.domain.*;
|
||||||
import com.muyu.system.domain.table.TableParams;
|
import com.muyu.system.domain.table.TableParams;
|
||||||
|
import com.muyu.system.domain.table.TableShow;
|
||||||
import com.muyu.system.domain.vo.FrimaryVo;
|
import com.muyu.system.domain.vo.FrimaryVo;
|
||||||
import com.muyu.system.domain.vo.TableVo;
|
import com.muyu.system.domain.vo.TableVo;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
@ -52,11 +53,22 @@ public interface AccreditMapper {
|
||||||
|
|
||||||
List<UserMiddle> listUserMiddle2(@Param("databaseName") String databaseName);
|
List<UserMiddle> listUserMiddle2(@Param("databaseName") String databaseName);
|
||||||
|
|
||||||
Integer updateMiddle(@Param("mid") Integer mid, @Param("statusId") Integer statusId);
|
Integer updateMiddle(@Param("mid") Integer mid, @Param("statusId") String statusId);
|
||||||
|
|
||||||
Integer updateUserMiddle(@Param("mid") Integer mid, @Param("statusId") Integer statusId);
|
Integer updateUserMiddle(@Param("mid") Integer mid, @Param("statusId") String statusId);
|
||||||
|
|
||||||
|
|
||||||
List<Middle> listMiddle2(@Param("databaseName") String databaseName);
|
List<Middle> listMiddle2(@Param("databaseName") String databaseName);
|
||||||
|
|
||||||
|
void indexTableShow(@Param("s") String s, @Param("columnClassName") String columnClassName, @Param("val") String val);
|
||||||
|
|
||||||
|
void deleteTableShow(@Param("name") String name);
|
||||||
|
|
||||||
|
List<TableShow> selectShow(@Param("tableName") String tableName);
|
||||||
|
|
||||||
|
Integer selectOneFrimary();
|
||||||
|
|
||||||
|
Integer selectOneTableListNum();
|
||||||
|
|
||||||
|
List<TableList> selectTableList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ package com.muyu.system.service;
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.system.domain.*;
|
import com.muyu.system.domain.*;
|
||||||
import com.muyu.system.domain.table.TableParams;
|
import com.muyu.system.domain.table.TableShow;
|
||||||
|
import com.muyu.system.domain.table.ToTalNum;
|
||||||
import com.muyu.system.domain.vo.FrimaryVo;
|
import com.muyu.system.domain.vo.FrimaryVo;
|
||||||
import com.muyu.system.domain.vo.TableVo;
|
import com.muyu.system.domain.vo.TableVo;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
@ -41,8 +41,13 @@ public interface AccreditService {
|
||||||
|
|
||||||
List<UserMiddle> listUserMiddle2(String databaseName);
|
List<UserMiddle> listUserMiddle2(String databaseName);
|
||||||
|
|
||||||
Integer updateMiddle(Integer mid, Integer statusId);
|
Integer updateMiddle(Integer mid, String statusId);
|
||||||
|
|
||||||
Integer updateUserMiddle(Integer mid, Integer statusId);
|
Integer updateUserMiddle(Integer mid, String statusId);
|
||||||
|
|
||||||
|
List<TableShow> selectShow( String tableName);
|
||||||
|
|
||||||
|
Integer selJDBCStream2(DataAccess dataAccess);
|
||||||
|
|
||||||
|
ToTalNum selTotalNum();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package com.muyu.system.service.impl;
|
package com.muyu.system.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.system.domain.*;
|
import com.muyu.system.domain.*;
|
||||||
import com.muyu.system.domain.table.TableParams;
|
import com.muyu.system.domain.table.TableShow;
|
||||||
|
import com.muyu.system.domain.table.ToTalNum;
|
||||||
import com.muyu.system.domain.vo.FrimaryVo;
|
import com.muyu.system.domain.vo.FrimaryVo;
|
||||||
import com.muyu.system.domain.vo.TableVo;
|
import com.muyu.system.domain.vo.TableVo;
|
||||||
import com.muyu.system.mapper.AccreditMapper;
|
import com.muyu.system.mapper.AccreditMapper;
|
||||||
|
@ -12,8 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.beans.Transient;
|
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -75,6 +75,7 @@ public class AccreditServiceImpl implements AccreditService {
|
||||||
System.out.println("只读"+rsd.isReadOnly(i+1));
|
System.out.println("只读"+rsd.isReadOnly(i+1));
|
||||||
System.out.println("是可写的"+rsd.isWritable(i+1));
|
System.out.println("是可写的"+rsd.isWritable(i+1));
|
||||||
System.out.println("注解"+columnComments.get(rsd.getColumnName(i+1)));
|
System.out.println("注解"+columnComments.get(rsd.getColumnName(i+1)));
|
||||||
|
System.out.println("val"+columnComments.keySet());
|
||||||
ListStructure listStructure = new ListStructure();
|
ListStructure listStructure = new ListStructure();
|
||||||
//获取数据库名
|
//获取数据库名
|
||||||
listStructure.setCatalogName(rsd.getCatalogName(i+1));
|
listStructure.setCatalogName(rsd.getCatalogName(i+1));
|
||||||
|
@ -139,7 +140,6 @@ public class AccreditServiceImpl implements AccreditService {
|
||||||
//加载数据库驱动
|
//加载数据库驱动
|
||||||
Class<?> aClass = Class.forName("com.mysql.cj.jdbc.Driver");
|
Class<?> aClass = Class.forName("com.mysql.cj.jdbc.Driver");
|
||||||
Driver driver = (Driver) aClass.newInstance();
|
Driver driver = (Driver) aClass.newInstance();
|
||||||
|
|
||||||
//获取数据库连接
|
//获取数据库连接
|
||||||
Connection connection = DriverManager.getConnection("jdbc:mysql://" + dataAccess.getHost() + ":"+ dataAccess.getPort() +"/"+ dataAccess.getDatabaseName() +"?serverTimezone=UTC",dataAccess.getUsername(),dataAccess.getPassword());
|
Connection connection = DriverManager.getConnection("jdbc:mysql://" + dataAccess.getHost() + ":"+ dataAccess.getPort() +"/"+ dataAccess.getDatabaseName() +"?serverTimezone=UTC",dataAccess.getUsername(),dataAccess.getPassword());
|
||||||
System.out.println(driver);
|
System.out.println(driver);
|
||||||
|
@ -147,12 +147,67 @@ public class AccreditServiceImpl implements AccreditService {
|
||||||
id = 1;
|
id = 1;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
id = 0;
|
id = 0;
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
}
|
||||||
System.out.println();
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selJDBCStream2(DataAccess dataAccess) {
|
||||||
|
Integer id = 0;
|
||||||
|
List<String> stringList = new ArrayList<>();
|
||||||
|
// 连接数据
|
||||||
|
// try {
|
||||||
|
// Class<?> aClass = Class.forName("com.mysql.cj.jdbc.Driver");
|
||||||
|
// Driver driver = (Driver) aClass.newInstance();
|
||||||
|
//// //获取数据库连接
|
||||||
|
// Connection connection = DriverManager.getConnection("jdbc:mysql://" + dataAccess.getHost() + ":" + dataAccess.getPort() + "/" + dataAccess.getDatabaseName() + "?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8", dataAccess.getUsername(), dataAccess.getPassword());
|
||||||
|
//// //获取数据库名
|
||||||
|
//// //获取数据库的元数据
|
||||||
|
// DatabaseMetaData metaData = connection.getMetaData();
|
||||||
|
// //获取全部表名
|
||||||
|
// Statement statement = connection.createStatement();
|
||||||
|
// ResultSet rst = statement.executeQuery("select TABLE_NAME from INFORMATION_SCHEMA.Tables where table_schema = '" + dataAccess.getDatabaseName() + "'");
|
||||||
|
// mapper.deleteTableShow(dataAccess.getName());
|
||||||
|
// while (rst.next()) {
|
||||||
|
// stringList.add(rst.getString(1));
|
||||||
|
// }
|
||||||
|
// for (String s : stringList) {
|
||||||
|
// // 执行查询
|
||||||
|
// ResultSet rs = statement.executeQuery("select * from " + s);
|
||||||
|
// PreparedStatement pst = connection.prepareCall("select * from " + s);
|
||||||
|
// ResultSetMetaData rsd = pst.getMetaData();
|
||||||
|
// // 获取查询的结果集
|
||||||
|
// ResultSetMetaData md = rs.getMetaData();
|
||||||
|
// System.out.println(md);
|
||||||
|
// int columnCount = md.getColumnCount();
|
||||||
|
// System.out.println(columnCount);
|
||||||
|
// //获取结果集的元数据
|
||||||
|
// //遍历结果集
|
||||||
|
// while (rs.next()) {
|
||||||
|
// for (int i = 1; i <= columnCount; i++) {
|
||||||
|
// //获取列名
|
||||||
|
// String fields = md.getColumnName(i);
|
||||||
|
// System.out.println(fields);
|
||||||
|
// //获取表名
|
||||||
|
// String tableName = md.getTableName(i);
|
||||||
|
// System.out.println(tableName);
|
||||||
|
// //获取字段值
|
||||||
|
// Object val = rs.getObject(i);
|
||||||
|
// System.out.println(val);
|
||||||
|
// //获取java映射字段类型
|
||||||
|
// String columnClassName = md.getColumnClassName(i);
|
||||||
|
// mapper.indexTableShow(dataAccess.getName() + "." + tableName + "." + fields, columnClassName, val.toString());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// id =1;
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// id = 0;
|
||||||
|
// }
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FrimaryVo> selectFrimary() {
|
public List<FrimaryVo> selectFrimary() {
|
||||||
List<FrimaryVo> list = mapper.selectFrimary();
|
List<FrimaryVo> list = mapper.selectFrimary();
|
||||||
|
@ -184,15 +239,37 @@ public class AccreditServiceImpl implements AccreditService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer updateMiddle(Integer mid, Integer statusId) {
|
public Integer updateMiddle(Integer mid, String statusId) {
|
||||||
return mapper.updateMiddle(mid,statusId);
|
return mapper.updateMiddle(mid,statusId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer updateUserMiddle(Integer mid, Integer statusId) {
|
public Integer updateUserMiddle(Integer mid, String statusId) {
|
||||||
return mapper.updateUserMiddle(mid,statusId);
|
return mapper.updateUserMiddle(mid,statusId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TableShow> selectShow(String tableName) {
|
||||||
|
List<TableShow> showList = mapper.selectShow(tableName);
|
||||||
|
return showList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ToTalNum selTotalNum() {
|
||||||
|
Integer fieldsNum = 0;
|
||||||
|
ToTalNum toTalNum = new ToTalNum();
|
||||||
|
Integer switchOns = mapper.selectOneFrimary();
|
||||||
|
Integer assetsNum = mapper.selectOneTableListNum();
|
||||||
|
List<TableList> tableListList = mapper.selectTableList();
|
||||||
|
for (TableList tableList : tableListList) {
|
||||||
|
fieldsNum += tableList.getDataTotal();
|
||||||
|
}
|
||||||
|
toTalNum.setSwitchOns(switchOns);
|
||||||
|
toTalNum.setAssetsNum(assetsNum);
|
||||||
|
toTalNum.setFieldsNum(fieldsNum);
|
||||||
|
return toTalNum;
|
||||||
|
}
|
||||||
|
|
||||||
//获取字段注解
|
//获取字段注解
|
||||||
private Map<String,String> getColumnComments(DatabaseMetaData metaData,String typeName){
|
private Map<String,String> getColumnComments(DatabaseMetaData metaData,String typeName){
|
||||||
Map<String,String> columnComents = new HashMap<>();
|
Map<String,String> columnComents = new HashMap<>();
|
||||||
|
|
|
@ -185,14 +185,8 @@ public class DataAccessServiceImpl implements IDataAccessService
|
||||||
dataAccessMapper.deleteFrimary(dataAccess);
|
dataAccessMapper.deleteFrimary(dataAccess);
|
||||||
dataAccessMapper.indexFrimary(dataAccess, num, i);
|
dataAccessMapper.indexFrimary(dataAccess, num, i);
|
||||||
rst.close();
|
rst.close();
|
||||||
} catch (SQLException e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
return 0;
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
} catch (InstantiationException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}, threadPoolExecutor);
|
}, threadPoolExecutor);
|
||||||
|
@ -276,7 +270,6 @@ public class DataAccessServiceImpl implements IDataAccessService
|
||||||
PreparedStatement pst = connection.prepareCall("select * from " + s);
|
PreparedStatement pst = connection.prepareCall("select * from " + s);
|
||||||
ResultSetMetaData rsd = pst.getMetaData();
|
ResultSetMetaData rsd = pst.getMetaData();
|
||||||
//获取元数据
|
//获取元数据
|
||||||
DatabaseMetaData metaData1 = connection.getMetaData();
|
|
||||||
Map<String, String> columnComments = getColumnComments(metaData, s);
|
Map<String, String> columnComments = getColumnComments(metaData, s);
|
||||||
//添加数据结构
|
//添加数据结构
|
||||||
for (int i = 0; i < rsd.getColumnCount(); i++) {
|
for (int i = 0; i < rsd.getColumnCount(); i++) {
|
||||||
|
@ -307,8 +300,7 @@ public class DataAccessServiceImpl implements IDataAccessService
|
||||||
listStructure.setCatalogName(rsd.getCatalogName(i + 1));
|
listStructure.setCatalogName(rsd.getCatalogName(i + 1));
|
||||||
//获取表名
|
//获取表名
|
||||||
listStructure.setTableName(rsd.getTableName(i + 1));
|
listStructure.setTableName(rsd.getTableName(i + 1));
|
||||||
//获取java类型
|
|
||||||
listStructure.setColumnLassName(rsd.getColumnClassName(i + 1));
|
|
||||||
//获取映射类型
|
//获取映射类型
|
||||||
listStructure.setColumnTypeName(rsd.getColumnTypeName(i + 1));
|
listStructure.setColumnTypeName(rsd.getColumnTypeName(i + 1));
|
||||||
//获取字段名称
|
//获取字段名称
|
||||||
|
@ -333,10 +325,64 @@ public class DataAccessServiceImpl implements IDataAccessService
|
||||||
return 1;
|
return 1;
|
||||||
}, threadPoolExecutor);
|
}, threadPoolExecutor);
|
||||||
|
|
||||||
System.out.println(completable1.join());
|
CompletableFuture<Integer> completable4 = CompletableFuture.supplyAsync(() -> {
|
||||||
System.out.println(completable2.join());
|
// 连接数据
|
||||||
System.out.println(completable3.join());
|
try {
|
||||||
if (completable1.join()+completable2.join()+completable3.join() == 3){
|
// //获取数据库连接
|
||||||
|
Connection connection = DriverManager.getConnection("jdbc:mysql://" + dataAccess.getHost() + ":" + dataAccess.getPort() + "/" + dataAccess.getDatabaseName() + "?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8", dataAccess.getUsername(), dataAccess.getPassword());
|
||||||
|
// //获取数据库名
|
||||||
|
// //获取数据库的元数据
|
||||||
|
DatabaseMetaData metaData = connection.getMetaData();
|
||||||
|
//获取全部表名
|
||||||
|
Statement statement = connection.createStatement();
|
||||||
|
ResultSet rst = statement.executeQuery("select TABLE_NAME from INFORMATION_SCHEMA.Tables where table_schema = '" + dataAccess.getDatabaseName() + "'");
|
||||||
|
accreditMapper.deleteTableShow(dataAccess.getName());
|
||||||
|
//所有表名
|
||||||
|
ArrayList<String> strings = new ArrayList<>();
|
||||||
|
while (rst.next()) {
|
||||||
|
strings.add(rst.getString(1));
|
||||||
|
System.out.println(rst.getString(1));
|
||||||
|
}
|
||||||
|
System.out.println(strings);
|
||||||
|
for (String string : strings) {
|
||||||
|
// 执行查询
|
||||||
|
ResultSet rs = statement.executeQuery("select * from " + string);
|
||||||
|
// 获取查询的结果集
|
||||||
|
ResultSetMetaData md = rs.getMetaData();
|
||||||
|
System.out.println(md);
|
||||||
|
int columnCount = md.getColumnCount();
|
||||||
|
System.out.println(columnCount);
|
||||||
|
//获取结果集的元数据
|
||||||
|
//遍历结果集
|
||||||
|
while (rs.next()){
|
||||||
|
//遍历每一列
|
||||||
|
for (int i = 1; i <= columnCount; i++) {
|
||||||
|
// 获取列名
|
||||||
|
String columnName = md.getColumnName(i);
|
||||||
|
System.out.println(columnName);
|
||||||
|
//获取表名
|
||||||
|
String tableName = md.getTableName(i);
|
||||||
|
System.out.println(tableName);
|
||||||
|
//字段值
|
||||||
|
Object val = rs.getObject(i);
|
||||||
|
System.out.println(val);
|
||||||
|
//字段类型
|
||||||
|
String columnClassName = md.getColumnClassName(i);
|
||||||
|
accreditMapper.indexTableShow(dataAccess.getName()+"."+tableName+"."+columnName,columnClassName,val.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}, threadPoolExecutor);
|
||||||
|
|
||||||
|
System.out.println("completable1:"+completable1.join());
|
||||||
|
System.out.println("completable2:"+completable2.join());
|
||||||
|
System.out.println("completable3:"+completable3.join());
|
||||||
|
System.out.println("completable4:"+completable4.join());
|
||||||
|
if (completable1.join()+completable2.join()+completable3.join()+ completable4.join() == 4){
|
||||||
id = 1;
|
id = 1;
|
||||||
}else{
|
}else{
|
||||||
id = 0;
|
id = 0;
|
||||||
|
|
|
@ -11,6 +11,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
insert into list_structure (catalog_name,table_name,column_lass_name,column_type_name,column_name,precisions,scale,is_null,schema_name,column_comments)
|
insert into list_structure (catalog_name,table_name,column_lass_name,column_type_name,column_name,precisions,scale,is_null,schema_name,column_comments)
|
||||||
values (#{catalogName},#{tableName},#{columnLassName},#{columnTypeName},#{columnName},#{precisions},#{scale},#{isNull},#{schemaName},#{columnComments});
|
values (#{catalogName},#{tableName},#{columnLassName},#{columnTypeName},#{columnName},#{precisions},#{scale},#{isNull},#{schemaName},#{columnComments});
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="indexTableShow">
|
||||||
|
insert into table_show (keysed,type,val)
|
||||||
|
values (#{s},#{columnClassName},#{val});
|
||||||
|
</insert>
|
||||||
<update id="updateListStructure">
|
<update id="updateListStructure">
|
||||||
update list_structure
|
update list_structure
|
||||||
set yes_or_no = #{yesOrNo},
|
set yes_or_no = #{yesOrNo},
|
||||||
|
@ -46,6 +50,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from tableList
|
from tableList
|
||||||
where name = #{s} and database_name = #{databaseName};
|
where name = #{s} and database_name = #{databaseName};
|
||||||
</delete>
|
</delete>
|
||||||
|
<delete id="deleteTableShow">
|
||||||
|
delete
|
||||||
|
from table_show
|
||||||
|
where keysed like concat(#{name},"%");
|
||||||
|
</delete>
|
||||||
<select id="selectTableXml" resultType="com.muyu.system.domain.vo.TableVo">
|
<select id="selectTableXml" resultType="com.muyu.system.domain.vo.TableVo">
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM information_schema.columns
|
FROM information_schema.columns
|
||||||
|
@ -95,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from list_structure where catalog_name = #{catalogName} and table_name = #{tableName} and column_name = #{columnName};
|
from list_structure where catalog_name = #{catalogName} and table_name = #{tableName} and column_name = #{columnName};
|
||||||
</select>
|
</select>
|
||||||
<select id="listMiddle" resultType="com.muyu.system.domain.Middle">
|
<select id="listMiddle" resultType="com.muyu.system.domain.Middle">
|
||||||
select m.mid,m.id,m.database_name,m.table_name,d.*
|
select m.mid,m.id,m.database_name,m.table_name,m.status_id,d.*
|
||||||
from middle m
|
from middle m
|
||||||
left join sys_dept d on m.dept_id = d.dept_id
|
left join sys_dept d on m.dept_id = d.dept_id
|
||||||
where database_name = #{databaseName} and table_name = #{tableName};
|
where database_name = #{databaseName} and table_name = #{tableName};
|
||||||
|
@ -113,10 +122,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where database_name = #{databaseName}
|
where database_name = #{databaseName}
|
||||||
</select>
|
</select>
|
||||||
<select id="listMiddle2" resultType="com.muyu.system.domain.Middle">
|
<select id="listMiddle2" resultType="com.muyu.system.domain.Middle">
|
||||||
select m.mid,m.id,m.database_name,m.table_name,d.*
|
select m.mid,m.id,m.database_name,m.table_name,m.status_id,d.*
|
||||||
from middle m
|
from middle m
|
||||||
left join sys_dept d on m.dept_id = d.dept_id
|
left join sys_dept d on m.dept_id = d.dept_id
|
||||||
where database_name = #{databaseName}
|
where database_name = #{databaseName}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectShow" resultType="com.muyu.system.domain.table.TableShow">
|
||||||
|
select *
|
||||||
|
from table_show where keysed like concat('%',#{tableName},'%')
|
||||||
|
</select>
|
||||||
|
<select id="selectOneFrimary" resultType="java.lang.Integer">
|
||||||
|
select count(id)
|
||||||
|
from frimary
|
||||||
|
</select>
|
||||||
|
<select id="selectOneTableListNum" resultType="java.lang.Integer">
|
||||||
|
select count(id)
|
||||||
|
from tableList;
|
||||||
|
</select>
|
||||||
|
<select id="selectTableList" resultType="com.muyu.system.domain.TableList">
|
||||||
|
select *
|
||||||
|
from tableList
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -101,11 +101,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertMiddle">
|
<insert id="insertMiddle">
|
||||||
insert into middle (id,dept_id,database_name,table_name,status_id)
|
insert into middle (id,dept_id,database_name,table_name,status_id)
|
||||||
values (#{id},#{deptId},#{databaseName},#{tableName},0);
|
values (#{id},#{deptId},#{databaseName},#{tableName},'N');
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertUserMiddle">
|
<insert id="insertUserMiddle">
|
||||||
insert into user_maiddle (id,user_id,database_name,table_name,status_id)
|
insert into user_maiddle (id,user_id,database_name,table_name,status_id)
|
||||||
values (#{id},#{userId},#{databaseName},#{tableName},0);
|
values (#{id},#{userId},#{databaseName},#{tableName},'N');
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="indexFrimary">
|
<insert id="indexFrimary">
|
||||||
insert into frimary (id,name,systemName,databaseName,tableNameNum,dataTotal)
|
insert into frimary (id,name,systemName,databaseName,tableNameNum,dataTotal)
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
<module>muyu-job</module>
|
<module>muyu-job</module>
|
||||||
<module>muyu-file</module>
|
<module>muyu-file</module>
|
||||||
<module>muyu-goods</module>
|
<module>muyu-goods</module>
|
||||||
|
<module>muyu-goods</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>muyu-modules</artifactId>
|
<artifactId>muyu-modules</artifactId>
|
||||||
|
|
Loading…
Reference in New Issue