diff --git a/.gitignore b/.gitignore index 957d4bcd..fd35dd9c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,9 +13,10 @@ hs_err_pid* .idea -**/target +**/target/ /logs.home_IS_UNDEFINED **/*.iml .gitattributes +/api/src/main/resources/application-prod.yml \ No newline at end of file diff --git a/api/src/main/java/com/wansensoft/api/ErpApplication.java b/api/src/main/java/com/wansensoft/api/ErpApplication.java index 07e7a9d6..613478da 100644 --- a/api/src/main/java/com/wansensoft/api/ErpApplication.java +++ b/api/src/main/java/com/wansensoft/api/ErpApplication.java @@ -11,10 +11,10 @@ import java.io.IOException; +@EnableScheduling @MapperScan("com.wansensoft.mappers") @ComponentScan("com.wansensoft") @SpringBootApplication -@EnableScheduling public class ErpApplication { public static void main(String[] args) throws IOException { @@ -24,4 +24,5 @@ public static void main(String[] args) throws IOException { + environment.getProperty("server.port") + "/wansenerp/doc.html"); System.out.println("您还需启动前端服务,启动命令:yarn run serve 或 npm run serve,测试用户:wansenerp,密码:123456"); } + } diff --git a/api/src/main/java/com/wansensoft/api/IncomeExpenseController.java b/api/src/main/java/com/wansensoft/api/IncomeExpenseController.java new file mode 100644 index 00000000..54a54d15 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/IncomeExpenseController.java @@ -0,0 +1,19 @@ +package com.wansensoft.api; + + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 收支项目 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/incomeExpense") +public class IncomeExpenseController { + +} diff --git a/api/src/main/java/com/wansensoft/api/LogController.java b/api/src/main/java/com/wansensoft/api/LogController.java new file mode 100644 index 00000000..feced9fa --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/LogController.java @@ -0,0 +1,43 @@ +package com.wansensoft.api; + +import com.wansensoft.entities.log.Log; +import com.wansensoft.entities.user.User; +import com.wansensoft.service.log.LogService; +import com.wansensoft.utils.BaseResponseInfo; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping(value = "/log") +public class LogController { + + private final LogService logService; + + public LogController(LogService logService) { + this.logService = logService; + } + + @GetMapping("/getAllList") + public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception { + BaseResponseInfo res = new BaseResponseInfo(); + try { + Map data = new HashMap<>(); + List dataList = logService.getLog(); + if(dataList!=null) { + data.put("logList", dataList); + } + res.code = 200; + res.data = data; + } catch(Exception e){ + res.code = 500; + res.data = "获取失败"; + } + return res; + } +} diff --git a/api/src/main/java/com/wansensoft/api/OperatorController.java b/api/src/main/java/com/wansensoft/api/OperatorController.java new file mode 100644 index 00000000..132fb3a9 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/OperatorController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 经手人表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/operator") +public class OperatorController { + +} diff --git a/api/src/main/java/com/wansensoft/api/PluginController.java b/api/src/main/java/com/wansensoft/api/PluginController.java index 58d9cbf4..2cb62487 100644 --- a/api/src/main/java/com/wansensoft/api/PluginController.java +++ b/api/src/main/java/com/wansensoft/api/PluginController.java @@ -1,11 +1,14 @@ -package com.wansensoft.api;//package com.wansensoft.erp.controller; +//package com.wansensoft.api; // -//import constants.com.wansensoft.BusinessConstants; -//import entities.datasource.com.wansensoft.User; -//import user.service.com.wansensoft.UserService; -//import utils.com.wansensoft.utils.BaseResponseInfo; -//import utils.com.wansensoft.utils.ComputerInfo; -//import utils.com.wansensoft.utils.StringUtil; +//import com.gitee.starblues.core.PluginInfo; +//import com.gitee.starblues.integration.application.PluginApplication; +//import com.gitee.starblues.integration.operator.PluginOperator; +//import com.wansensoft.entities.user.User; +//import com.wansensoft.service.user.UserService; +//import com.wansensoft.utils.BaseResponseInfo; +//import com.wansensoft.utils.ComputerInfo; +//import com.wansensoft.utils.StringUtil; +//import com.wansensoft.utils.constants.BusinessConstants; //import io.swagger.annotations.Api; //import io.swagger.annotations.ApiOperation; //import org.springframework.beans.factory.annotation.Autowired; @@ -13,29 +16,27 @@ //import org.springframework.web.bind.annotation.*; //import org.springframework.web.multipart.MultipartFile; // -//import jakarta.annotation.Resource; //import jakarta.servlet.http.HttpServletRequest; //import jakarta.servlet.http.HttpServletResponse; //import java.nio.file.Paths; //import java.util.*; // ///** -// * 插件jar 包测试功能 -// * @author jishenghua -// * @version 1.0 +// * 插件包 +// * // */ //@RestController //@RequestMapping("/plugin") //@Api(tags = {"插件管理"}) //public class PluginController { // -// @Resource -// private UserService userService; +// private final UserService userService; // // private final PluginOperator pluginOperator; // // @Autowired -// public PluginController(PluginApplication pluginApplication) { +// public PluginController(UserService userService, PluginApplication pluginApplication) { +// this.userService = userService; // this.pluginOperator = pluginApplication.getPluginOperator(); // } // /** @@ -59,7 +60,7 @@ // resList = list; // } else { // for (PluginInfo pi : list) { -// String desc = pi.getPluginDescriptor().getPluginDescription(); +// String desc = pi.getPluginDescriptor().getDescription(); // if (desc.contains(name)) { // resList.add(pi); // } @@ -82,21 +83,21 @@ // * 获取插件jar文件名 // * @return 获取插件文件名。只在生产环境显示 // */ -// @GetMapping("/files") -// @ApiOperation(value = "获取插件jar文件名") -// public Set getPluginFilePaths(){ -// try { -// User userInfo = userService.getCurrentUser(); -// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { -// return pluginOperator.getPluginFilePaths(); -// } else { -// return null; -// } -// } catch (Exception e) { -// e.printStackTrace(); -// return null; -// } -// } +//// @GetMapping("/files") +//// @ApiOperation(value = "获取插件jar文件名") +//// public Set getPluginFilePaths(){ +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// return pluginOperator.getPluginFilePaths(); +//// } else { +//// return null; +//// } +//// } catch (Exception e) { +//// e.printStackTrace(); +//// return null; +//// } +//// } // // // /** @@ -173,34 +174,34 @@ // * @param id 插件id // * @return 返回操作结果 // */ -// @PostMapping("/uninstall/{id}") -// @ApiOperation(value = "根据插件id卸载插件") -// public BaseResponseInfo uninstall(@PathVariable("id") String id){ -// BaseResponseInfo res = new BaseResponseInfo(); -// Map map = new HashMap(); -// String message = ""; -// try { -// User userInfo = userService.getCurrentUser(); -// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { -// if (pluginOperator.uninstall(id, true)) { -// message = "plugin '" + id + "' uninstall success"; -// } else { -// message = "plugin '" + id + "' uninstall failure"; -// } -// } else { -// message = "power is limit"; -// } -// map.put("message", message); -// res.code = 200; -// res.data = map; -// } catch (Exception e) { -// e.printStackTrace(); -// map.put("message", "plugin '" + id +"' uninstall failure. " + e.getMessage()); -// res.code = 500; -// res.data = map; -// } -// return res; -// } +//// @PostMapping("/uninstall/{id}") +//// @ApiOperation(value = "根据插件id卸载插件") +//// public BaseResponseInfo uninstall(@PathVariable("id") String id){ +//// BaseResponseInfo res = new BaseResponseInfo(); +//// Map map = new HashMap(); +//// String message = ""; +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// if (pluginOperator.uninstall(id, true)) { +//// message = "plugin '" + id + "' uninstall success"; +//// } else { +//// message = "plugin '" + id + "' uninstall failure"; +//// } +//// } else { +//// message = "power is limit"; +//// } +//// map.put("message", message); +//// res.code = 200; +//// res.data = map; +//// } catch (Exception e) { +//// e.printStackTrace(); +//// map.put("message", "plugin '" + id +"' uninstall failure. " + e.getMessage()); +//// res.code = 500; +//// res.data = map; +//// } +//// return res; +//// } // // // /** @@ -208,25 +209,25 @@ // * @param path 插件路径名称 // * @return 操作结果 // */ -// @PostMapping("/installByPath") -// @ApiOperation(value = "根据插件路径安装插件") -// public String install(@RequestParam("path") String path){ -// try { -// User userInfo = userService.getCurrentUser(); -// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { -// if (pluginOperator.install(Paths.get(path))) { -// return "installByPath success"; -// } else { -// return "installByPath failure"; -// } -// } else { -// return "installByPath failure"; -// } -// } catch (Exception e) { -// e.printStackTrace(); -// return "installByPath failure : " + e.getMessage(); -// } -// } +//// @PostMapping("/installByPath") +//// @ApiOperation(value = "根据插件路径安装插件") +//// public String install(@RequestParam("path") String path){ +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// if (pluginOperator.install(Paths.get(path))) { +//// return "installByPath success"; +//// } else { +//// return "installByPath failure"; +//// } +//// } else { +//// return "installByPath failure"; +//// } +//// } catch (Exception e) { +//// e.printStackTrace(); +//// return "installByPath failure : " + e.getMessage(); +//// } +//// } // // // /** @@ -234,78 +235,78 @@ // * @param file 上传文件 multipartFile // * @return 操作结果 // */ -// @PostMapping("/uploadInstallPluginJar") -// @ApiOperation(value = "上传并安装插件") -// public BaseResponseInfo install(MultipartFile file, HttpServletRequest request, HttpServletResponse response){ -// BaseResponseInfo res = new BaseResponseInfo(); -// try { -// User userInfo = userService.getCurrentUser(); -// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { -// pluginOperator.uploadPluginAndStart(file); -// res.code = 200; -// res.data = "导入成功"; -// } else { -// res.code = 500; -// res.data = "抱歉,无操作权限!"; -// } -// } catch(Exception e){ -// e.printStackTrace(); -// res.code = 500; -// res.data = "导入失败"; -// } -// return res; -// } +//// @PostMapping("/uploadInstallPluginJar") +//// @ApiOperation(value = "上传并安装插件") +//// public BaseResponseInfo install(MultipartFile file, HttpServletRequest request, HttpServletResponse response){ +//// BaseResponseInfo res = new BaseResponseInfo(); +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// pluginOperator.uploadPluginAndStart(file); +//// res.code = 200; +//// res.data = "导入成功"; +//// } else { +//// res.code = 500; +//// res.data = "抱歉,无操作权限!"; +//// } +//// } catch(Exception e){ +//// e.printStackTrace(); +//// res.code = 500; +//// res.data = "导入失败"; +//// } +//// return res; +//// } +//// +//// /** +//// * 上传插件的配置文件。注意: 该操作只适用于生产环境 +//// * @param multipartFile 上传文件 multipartFile +//// * @return 操作结果 +//// */ +//// @PostMapping("/uploadPluginConfigFile") +//// @ApiOperation(value = "上传插件的配置文件") +//// public String uploadConfig(@RequestParam("configFile") MultipartFile multipartFile){ +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// if (pluginOperator.uploadConfigFile(multipartFile)) { +//// return "uploadConfig success"; +//// } else { +//// return "uploadConfig failure"; +//// } +//// } else { +//// return "installByPath failure"; +//// } +//// } catch (Exception e) { +//// e.printStackTrace(); +//// return "uploadConfig failure : " + e.getMessage(); +//// } +//// } // -// /** -// * 上传插件的配置文件。注意: 该操作只适用于生产环境 -// * @param multipartFile 上传文件 multipartFile -// * @return 操作结果 -// */ -// @PostMapping("/uploadPluginConfigFile") -// @ApiOperation(value = "上传插件的配置文件") -// public String uploadConfig(@RequestParam("configFile") MultipartFile multipartFile){ -// try { -// User userInfo = userService.getCurrentUser(); -// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { -// if (pluginOperator.uploadConfigFile(multipartFile)) { -// return "uploadConfig success"; -// } else { -// return "uploadConfig failure"; -// } -// } else { -// return "installByPath failure"; -// } -// } catch (Exception e) { -// e.printStackTrace(); -// return "uploadConfig failure : " + e.getMessage(); -// } -// } // -// -// /** -// * 备份插件。注意: 该操作只适用于生产环境 -// * @param pluginId 插件id -// * @return 操作结果 -// */ -// @PostMapping("/back/{pluginId}") -// @ApiOperation(value = "备份插件") -// public String backupPlugin(@PathVariable("pluginId") String pluginId){ -// try { -// User userInfo = userService.getCurrentUser(); -// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { -// if (pluginOperator.backupPlugin(pluginId, "testBack")) { -// return "backupPlugin success"; -// } else { -// return "backupPlugin failure"; -// } -// } else { -// return "backupPlugin failure"; -// } -// } catch (Exception e) { -// e.printStackTrace(); -// return "backupPlugin failure : " + e.getMessage(); -// } -// } +//// /** +//// * 备份插件。注意: 该操作只适用于生产环境 +//// * @param pluginId 插件id +//// * @return 操作结果 +//// */ +//// @PostMapping("/back/{pluginId}") +//// @ApiOperation(value = "备份插件") +//// public String backupPlugin(@PathVariable("pluginId") String pluginId){ +//// try { +//// User userInfo = userService.getCurrentUser(); +//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) { +//// if (pluginOperator.backupPlugin(pluginId, "testBack")) { +//// return "backupPlugin success"; +//// } else { +//// return "backupPlugin failure"; +//// } +//// } else { +//// return "backupPlugin failure"; +//// } +//// } catch (Exception e) { +//// e.printStackTrace(); +//// return "backupPlugin failure : " + e.getMessage(); +//// } +//// } // // /** // * 获取加密后的mac diff --git a/api/src/main/java/com/wansensoft/api/ResourceController.java b/api/src/main/java/com/wansensoft/api/ResourceController.java index ef3108d5..abdbd188 100644 --- a/api/src/main/java/com/wansensoft/api/ResourceController.java +++ b/api/src/main/java/com/wansensoft/api/ResourceController.java @@ -4,11 +4,11 @@ import com.wansensoft.utils.constants.BusinessConstants; import com.wansensoft.service.CommonQueryManager; import com.wansensoft.utils.*; +import com.wansensoft.utils.enums.CodeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; -import jakarta.annotation.Resource; import jakarta.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.HashMap; @@ -19,8 +19,11 @@ @Api(tags = {"资源接口"}) public class ResourceController { - @Resource - private CommonQueryManager configResourceManager; + private final CommonQueryManager configResourceManager; + + public ResourceController(CommonQueryManager configResourceManager) { + this.configResourceManager = configResourceManager; + } @GetMapping(value = "/{apiName}/info") @ApiOperation(value = "根据id获取信息") @@ -46,7 +49,7 @@ public String getList(@PathVariable("apiName") String apiName, HttpServletRequest request)throws Exception { Map parameterMap = ParamUtils.requestToMap(request); parameterMap.put(Constants.SEARCH, search); - Map objectMap = new HashMap(); + Map objectMap = new HashMap<>(); if (pageSize != null && pageSize <= 0) { pageSize = 10; } @@ -65,6 +68,35 @@ public String getList(@PathVariable("apiName") String apiName, return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); } } +// @GetMapping(value = "/{apiName}/list") +// @ApiOperation(value = "获取信息列表") +// public String getList(@PathVariable("apiName") String apiName, +// @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, +// @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, +// @RequestParam(value = Constants.SEARCH, required = false) String search, +// HttpServletRequest request)throws Exception { +// Map parameterMap = ParamUtils.requestToMap(request); +// parameterMap.put(Constants.SEARCH, search); +// Map objectMap = new HashMap(); +// if (pageSize != null && pageSize <= 0) { +// pageSize = 10; +// } +// String offset = ParamUtils.getPageOffset(currentPage, pageSize); +// if (StringUtil.isNotEmpty(offset)) { +// parameterMap.put(Constants.OFFSET, offset); +// } +// List list = configResourceManager.select(apiName, parameterMap); +// if (list != null) { +// objectMap.put("total", configResourceManager.counts(apiName, parameterMap)); +// objectMap.put("rows", list); +// System.err.println(ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, Integer.parseInt(ErpInfo.OK.code))); +// return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, Integer.parseInt(ErpInfo.OK.code)); +// } else { +// objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER); +// objectMap.put("rows", new ArrayList()); +// return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", Integer.parseInt(ErpInfo.OK.code)); +// } +// } @PostMapping(value = "/{apiName}/add", produces = {"application/javascript", "application/json"}) @ApiOperation(value = "新增") diff --git a/api/src/main/java/com/wansensoft/api/SystemSupplierController.java b/api/src/main/java/com/wansensoft/api/SystemSupplierController.java new file mode 100644 index 00000000..f37dd430 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/SystemSupplierController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 供应商/客户信息表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sysSupplier") +public class SystemSupplierController { + +} diff --git a/api/src/main/java/com/wansensoft/api/account/AccountController.java b/api/src/main/java/com/wansensoft/api/account/AccountController.java index 35381f7f..1ea6faeb 100644 --- a/api/src/main/java/com/wansensoft/api/account/AccountController.java +++ b/api/src/main/java/com/wansensoft/api/account/AccountController.java @@ -15,7 +15,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.util.HashMap; diff --git a/api/src/main/java/com/wansensoft/api/account/AccountHeadController.java b/api/src/main/java/com/wansensoft/api/account/AccountHeadController.java index ff8727cf..a4e74fad 100644 --- a/api/src/main/java/com/wansensoft/api/account/AccountHeadController.java +++ b/api/src/main/java/com/wansensoft/api/account/AccountHeadController.java @@ -5,6 +5,7 @@ import com.wansensoft.entities.account.AccountHeadVo4Body; import com.wansensoft.entities.account.AccountHeadVo4ListEx; import com.wansensoft.service.accountHead.AccountHeadService; +import com.wansensoft.utils.Response; import com.wansensoft.utils.constants.ExceptionConstants; import com.wansensoft.utils.BaseResponseInfo; import com.wansensoft.utils.ErpInfo; diff --git a/plugins/src/main/java/com/wansensoft/plugins/config/TenantConfig.java b/api/src/main/java/com/wansensoft/api/config/MybatisPlusConfig.java similarity index 54% rename from plugins/src/main/java/com/wansensoft/plugins/config/TenantConfig.java rename to api/src/main/java/com/wansensoft/api/config/MybatisPlusConfig.java index 4ba22f89..77fa1a0e 100644 --- a/plugins/src/main/java/com/wansensoft/plugins/config/TenantConfig.java +++ b/api/src/main/java/com/wansensoft/api/config/MybatisPlusConfig.java @@ -1,14 +1,71 @@ -package com.wansensoft.plugins.config; +package com.wansensoft.api.config; -import org.mybatis.spring.mapper.MapperScannerConfigurer; +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor; +import com.wansensoft.utils.Tools; +import jakarta.servlet.http.HttpServletRequest; +import net.sf.jsqlparser.expression.Expression; +import net.sf.jsqlparser.expression.LongValue; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Service; +import org.springframework.context.annotation.Configuration; -@Service -public class TenantConfig { +@Configuration +@MapperScan("com.wansensoft.mappers") +public class MybatisPlusConfig { + + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor(HttpServletRequest request) { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + PaginationInnerInterceptor paginationInterceptor = new PaginationInnerInterceptor(); + interceptor.addInnerInterceptor(new TenantLineInnerInterceptor(new TenantLineHandler() { + @Override + public Expression getTenantId() { + String token = request.getHeader("X-Access-Token"); + Long tenantId = Tools.getTenantIdByToken(token); + if (tenantId!=0L) { + return new LongValue(tenantId); + } else { + //超管 + return null; + } + } + + // 这是 default 方法,默认返回 false 表示所有表都需要拼多租户条件 + @Override + public boolean ignoreTable(String tableName) { + //获取开启状态 + boolean res = true; + String token = request.getHeader("X-Access-Token"); + Long tenantId = Tools.getTenantIdByToken(token); + if (tenantId!=0L) { + // 这里可以判断是否过滤表 + if ("jsh_material_property".equals(tableName) || "jsh_sequence".equals(tableName) + || "jsh_user_business".equals(tableName) || "jsh_function".equals(tableName) + || "jsh_platform_config".equals(tableName) || "jsh_tenant".equals(tableName)) { + res = true; + } else { + res = false; + } + } + return res; + } + })); + + + // 如果用了分页插件注意先 add TenantLineInnerInterceptor 再 add PaginationInnerInterceptor + // 用了分页插件必须设置 MybatisConfiguration#useDeprecatedExecutor = false + interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); + return interceptor; + } // @Bean // public PaginationInnerInterceptor paginationInterceptor(HttpServletRequest request) { +// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); +// // PaginationInnerInterceptor paginationInterceptor = new PaginationInnerInterceptor(); // List sqlParserList = new ArrayList<>(); // TenantSqlParser tenantSqlParser = new TenantSqlParser(); @@ -81,12 +138,12 @@ public class TenantConfig { * {@code @MapperScan("com.wansensoft.erp.datasource.mappers*")} * 这里可以扩展,比如使用配置文件来配置扫描Mapper的路径 */ - @Bean - public MapperScannerConfigurer mapperScannerConfigurer() { - MapperScannerConfigurer scannerConfigurer = new MapperScannerConfigurer(); - scannerConfigurer.setBasePackage("com.wansensoft.erp.datasource.mappers*"); - return scannerConfigurer; - } +// @Bean +// public MapperScannerConfigurer mapperScannerConfigurer() { +// MapperScannerConfigurer scannerConfigurer = new MapperScannerConfigurer(); +// scannerConfigurer.setBasePackage("com.wansensoft.mappers*"); +// return scannerConfigurer; +// } /** * 性能分析拦截器,不建议生产使用 @@ -96,5 +153,4 @@ public MapperScannerConfigurer mapperScannerConfigurer() { // return new PerformanceInterceptor(); // } - } diff --git a/api/src/main/java/com/wansensoft/api/config/PluginConfiguration.java b/api/src/main/java/com/wansensoft/api/config/PluginConfiguration.java new file mode 100644 index 00000000..2cfe2ef3 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/config/PluginConfiguration.java @@ -0,0 +1,71 @@ +//package com.wansensoft.api.config; +// +//import com.gitee.starblues.core.RuntimeMode; +//import com.gitee.starblues.integration.DefaultIntegrationConfiguration; +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.boot.context.properties.ConfigurationProperties; +//import org.springframework.stereotype.Component; +///** +// * +// */ +//@Component +//@ConfigurationProperties(prefix = "plugin") +//public class PluginConfiguration extends DefaultIntegrationConfiguration { +// /** +// * 运行模式 +// * 开发环境: development、dev +// * 生产/部署 环境: deployment、prod +// */ +// @Value("${runMode:dev}") +// private String runMode; +// +// @Value("${pluginPath:plugins}") +// private String pluginPath; +// +// @Value("${pluginConfigFilePath:pluginConfigs}") +// private String pluginConfigFilePath; +// +// @Override +// public RuntimeMode environment() { +// return RuntimeMode.byName(runMode); +// } +// +// @Override +// public String mainPackage() { +// return null; +// } +// +// public String getRunMode() { +// return runMode; +// } +// +// public void setRunMode(String runMode) { +// this.runMode = runMode; +// } +// +// +// public String getPluginPath() { +// return pluginPath; +// } +// +// public void setPluginPath(String pluginPath) { +// this.pluginPath = pluginPath; +// } +// +// public String getPluginConfigFilePath() { +// return pluginConfigFilePath; +// } +// +// public void setPluginConfigFilePath(String pluginConfigFilePath) { +// this.pluginConfigFilePath = pluginConfigFilePath; +// } +// +// @Override +// public String toString() { +// return "PluginArgConfiguration{" + +// "runMode='" + runMode + '\'' + +// ", pluginPath='" + pluginPath + '\'' + +// ", pluginConfigFilePath='" + pluginConfigFilePath + '\'' + +// '}'; +// } +//} diff --git a/plugins/src/main/java/com/wansensoft/plugins/config/Swagger2Config.java b/api/src/main/java/com/wansensoft/api/config/Swagger2Config.java similarity index 83% rename from plugins/src/main/java/com/wansensoft/plugins/config/Swagger2Config.java rename to api/src/main/java/com/wansensoft/api/config/Swagger2Config.java index 40a98dbd..fb4dd2e8 100644 --- a/plugins/src/main/java/com/wansensoft/plugins/config/Swagger2Config.java +++ b/api/src/main/java/com/wansensoft/api/config/Swagger2Config.java @@ -1,4 +1,4 @@ -package com.wansensoft.plugins.config; +package com.wansensoft.api.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -33,11 +33,11 @@ public Docket createRestApi() { private ApiInfo apiInfo() { return new ApiInfoBuilder() - .title("华夏ERP Restful Api") - .description("华夏ERP接口描述") + .title("WanSen ERP Restful Api") + .description("WanSen ERP接口描述") .termsOfServiceUrl("http://127.0.0.1") - .contact(new Contact("jishenghua", "", "")) - .version("3.0") + .contact(new Contact("WanSen ERP", "", "")) + .version("1.0.1") .build(); } diff --git a/api/src/main/java/com/wansensoft/api/depot/DepotController.java b/api/src/main/java/com/wansensoft/api/depot/DepotController.java index 444c9c35..c2b857f1 100644 --- a/api/src/main/java/com/wansensoft/api/depot/DepotController.java +++ b/api/src/main/java/com/wansensoft/api/depot/DepotController.java @@ -10,7 +10,9 @@ import com.wansensoft.service.userBusiness.UserBusinessService; import com.wansensoft.utils.BaseResponseInfo; import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.Response; import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.enums.CodeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -22,7 +24,7 @@ import java.util.*; /** - * @author ji sheng hua 752*718*920 + * */ @RestController @RequestMapping(value = "/depot") diff --git a/api/src/main/java/com/wansensoft/api/depot/DepotHeadController.java b/api/src/main/java/com/wansensoft/api/depot/DepotHeadController.java index 91bead7c..109c8275 100644 --- a/api/src/main/java/com/wansensoft/api/depot/DepotHeadController.java +++ b/api/src/main/java/com/wansensoft/api/depot/DepotHeadController.java @@ -2,6 +2,8 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.wansensoft.dto.depot.RetailOutboundDto; import com.wansensoft.entities.depot.DepotHead; import com.wansensoft.entities.depot.DepotHeadVo4Body; import com.wansensoft.service.depot.DepotService; @@ -49,6 +51,12 @@ public DepotHeadController(DepotHeadService depotHeadService, DepotService depot this.redisService = redisService; } + @PostMapping("/getAllList") + public Response> getList(@RequestBody RetailOutboundDto retailOutboundDto){ + return Response.responseData(depotHeadService.selectByConditionDepotHead(retailOutboundDto)); + } + + /** * 批量设置状态-审核或者反审核 * @param jsonObject diff --git a/api/src/main/java/com/wansensoft/api/financial/FinancialAccountController.java b/api/src/main/java/com/wansensoft/api/financial/FinancialAccountController.java new file mode 100644 index 00000000..ab911f92 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/financial/FinancialAccountController.java @@ -0,0 +1,19 @@ +package com.wansensoft.api.financial; + + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 账户信息 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/financialAccount") +public class FinancialAccountController { + +} diff --git a/api/src/main/java/com/wansensoft/api/financial/FinancialMainController.java b/api/src/main/java/com/wansensoft/api/financial/FinancialMainController.java new file mode 100644 index 00000000..f8eeb9e3 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/financial/FinancialMainController.java @@ -0,0 +1,19 @@ +package com.wansensoft.api.financial; + + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 财务主表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/financialMain") +public class FinancialMainController { + +} diff --git a/api/src/main/java/com/wansensoft/api/financial/FinancialSubController.java b/api/src/main/java/com/wansensoft/api/financial/FinancialSubController.java new file mode 100644 index 00000000..5fcdf775 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/financial/FinancialSubController.java @@ -0,0 +1,19 @@ +package com.wansensoft.api.financial; + + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 财务子表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/financialSub") +public class FinancialSubController { + +} diff --git a/api/src/main/java/com/wansensoft/api/material/MaterialController.java b/api/src/main/java/com/wansensoft/api/material/MaterialController.java index 78f051cc..8352995c 100644 --- a/api/src/main/java/com/wansensoft/api/material/MaterialController.java +++ b/api/src/main/java/com/wansensoft/api/material/MaterialController.java @@ -638,7 +638,6 @@ public String batchSetMaterialCurrentStock(@RequestBody JSONObject jsonObject, /** * 批量更新商品信息 * @param jsonObject - * @param request * @return * @throws Exception */ diff --git a/api/src/main/java/com/wansensoft/api/person/PersonController.java b/api/src/main/java/com/wansensoft/api/person/PersonController.java index 36ea2e27..fd822efc 100644 --- a/api/src/main/java/com/wansensoft/api/person/PersonController.java +++ b/api/src/main/java/com/wansensoft/api/person/PersonController.java @@ -146,7 +146,7 @@ public JSONArray getPersonByNumType(@RequestParam("type") String typeNum, @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") public String batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request) { + HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); diff --git a/api/src/main/java/com/wansensoft/api/platformConfig/PlatformConfigController.java b/api/src/main/java/com/wansensoft/api/platformConfig/PlatformConfigController.java index 1915916b..9ee75785 100644 --- a/api/src/main/java/com/wansensoft/api/platformConfig/PlatformConfigController.java +++ b/api/src/main/java/com/wansensoft/api/platformConfig/PlatformConfigController.java @@ -97,7 +97,7 @@ public String getPlatformRegisterFlag(HttpServletRequest request) { @PostMapping(value = "/updatePlatformConfigByKey") @ApiOperation(value = "根据platformKey更新platformValue") public String updatePlatformConfigByKey(@RequestBody JSONObject object, - HttpServletRequest request) { + HttpServletRequest request)throws Exception { Map objectMap = new HashMap<>(); String platformKey = object.getString("platformKey"); String platformValue = object.getString("platformValue"); diff --git a/api/src/main/java/com/wansensoft/api/product/ProductAttributeController.java b/api/src/main/java/com/wansensoft/api/product/ProductAttributeController.java new file mode 100644 index 00000000..2abdeff2 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/product/ProductAttributeController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.product; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 产品属性表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/product-attribute") +public class ProductAttributeController { + +} diff --git a/api/src/main/java/com/wansensoft/api/product/ProductCategoryController.java b/api/src/main/java/com/wansensoft/api/product/ProductCategoryController.java new file mode 100644 index 00000000..ba774fe1 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/product/ProductCategoryController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.product; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 产品类型表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/product-category") +public class ProductCategoryController { + +} diff --git a/api/src/main/java/com/wansensoft/api/product/ProductController.java b/api/src/main/java/com/wansensoft/api/product/ProductController.java new file mode 100644 index 00000000..07a9f9db --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/product/ProductController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.product; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 产品表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/product") +public class ProductController { + +} diff --git a/api/src/main/java/com/wansensoft/api/product/ProductExtendPriceController.java b/api/src/main/java/com/wansensoft/api/product/ProductExtendPriceController.java new file mode 100644 index 00000000..9c0092ce --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/product/ProductExtendPriceController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.product; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 产品价格扩展 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/product-extend-price") +public class ProductExtendPriceController { + +} diff --git a/api/src/main/java/com/wansensoft/api/product/ProductExtendPropertyController.java b/api/src/main/java/com/wansensoft/api/product/ProductExtendPropertyController.java new file mode 100644 index 00000000..b25cc480 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/product/ProductExtendPropertyController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.product; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 产品扩展字段表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/product-extend-property") +public class ProductExtendPropertyController { + +} diff --git a/api/src/main/java/com/wansensoft/api/product/ProductInventoryCurrentController.java b/api/src/main/java/com/wansensoft/api/product/ProductInventoryCurrentController.java new file mode 100644 index 00000000..f0df596e --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/product/ProductInventoryCurrentController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.product; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 产品当前库存 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/product-inventory-current") +public class ProductInventoryCurrentController { + +} diff --git a/api/src/main/java/com/wansensoft/api/product/ProductInventoryInitialController.java b/api/src/main/java/com/wansensoft/api/product/ProductInventoryInitialController.java new file mode 100644 index 00000000..4d230eca --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/product/ProductInventoryInitialController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.product; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 产品初始库存 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/product-inventory-initial") +public class ProductInventoryInitialController { + +} diff --git a/api/src/main/java/com/wansensoft/api/product/ProductUnitController.java b/api/src/main/java/com/wansensoft/api/product/ProductUnitController.java new file mode 100644 index 00000000..09a635c3 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/product/ProductUnitController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.product; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 多单位表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/product-unit") +public class ProductUnitController { + +} diff --git a/api/src/main/java/com/wansensoft/api/role/RoleController.java b/api/src/main/java/com/wansensoft/api/role/RoleController.java index cd31b22f..97eb4620 100644 --- a/api/src/main/java/com/wansensoft/api/role/RoleController.java +++ b/api/src/main/java/com/wansensoft/api/role/RoleController.java @@ -5,6 +5,7 @@ import com.wansensoft.entities.role.Role; import com.wansensoft.service.role.RoleService; import com.wansensoft.service.userBusiness.UserBusinessService; +import com.wansensoft.service.userBusiness.UserBusinessServiceImpl; import com.wansensoft.utils.ErpInfo; import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; @@ -22,8 +23,6 @@ @RequestMapping(value = "/role") @Api(tags = {"角色管理"}) public class RoleController { - private Logger logger = LoggerFactory.getLogger(RoleController.class); - private final RoleService roleService; private final UserBusinessService userBusinessService; @@ -80,7 +79,7 @@ public List allList(HttpServletRequest request)throws Exception { @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") public String batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request) { + HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); diff --git a/api/src/main/java/com/wansensoft/api/role/SysRoleController.java b/api/src/main/java/com/wansensoft/api/role/SysRoleController.java new file mode 100644 index 00000000..8a1f02d1 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/role/SysRoleController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.role; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 角色表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sysRole") +public class SysRoleController { + +} diff --git a/api/src/main/java/com/wansensoft/api/role/SysRoleMenuRelController.java b/api/src/main/java/com/wansensoft/api/role/SysRoleMenuRelController.java new file mode 100644 index 00000000..8d72c1ed --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/role/SysRoleMenuRelController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.role; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 角色菜单关系表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sysRoleMenu") +public class SysRoleMenuRelController { + +} diff --git a/api/src/main/java/com/wansensoft/api/serialNumber/SerialNumberController.java b/api/src/main/java/com/wansensoft/api/serialNumber/SerialNumberController.java index 08745161..cc975cdc 100644 --- a/api/src/main/java/com/wansensoft/api/serialNumber/SerialNumberController.java +++ b/api/src/main/java/com/wansensoft/api/serialNumber/SerialNumberController.java @@ -8,13 +8,12 @@ import com.wansensoft.service.serialNumber.SerialNumberService; import com.wansensoft.utils.BaseResponseInfo; import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.Response; import com.wansensoft.utils.Tools; import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; import jakarta.servlet.http.HttpServletRequest; @@ -48,7 +47,7 @@ public SerialNumberController(SerialNumberService serialNumberService, DepotHead */ @PostMapping("/batAddSerialNumber") @ApiOperation(value = "批量添加序列号") - public String batAddSerialNumber(@RequestBody JSONObject jsonObject, HttpServletRequest request) { + public String batAddSerialNumber(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception{ Map objectMap = new HashMap<>(); String materialCode = jsonObject.getString("materialCode"); String serialNumberPrefix = jsonObject.getString("serialNumberPrefix"); diff --git a/api/src/main/java/com/wansensoft/api/supplier/SupplierController.java b/api/src/main/java/com/wansensoft/api/supplier/SupplierController.java index 017fcffb..340dc6c8 100644 --- a/api/src/main/java/com/wansensoft/api/supplier/SupplierController.java +++ b/api/src/main/java/com/wansensoft/api/supplier/SupplierController.java @@ -13,8 +13,6 @@ import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -207,7 +205,7 @@ public JSONArray findBySelectRetail(HttpServletRequest request) { @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") public String batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request) { + HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); diff --git a/api/src/main/java/com/wansensoft/api/system/SysConfigController.java b/api/src/main/java/com/wansensoft/api/system/SysConfigController.java new file mode 100644 index 00000000..b2bde5e1 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/system/SysConfigController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.system; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 系统参数 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sys-config") +public class SysConfigController { + +} diff --git a/api/src/main/java/com/wansensoft/api/system/SysLogController.java b/api/src/main/java/com/wansensoft/api/system/SysLogController.java new file mode 100644 index 00000000..410facea --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/system/SysLogController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.system; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 操作日志 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sys-log") +public class SysLogController { + +} diff --git a/api/src/main/java/com/wansensoft/api/system/SysMenuController.java b/api/src/main/java/com/wansensoft/api/system/SysMenuController.java new file mode 100644 index 00000000..c6112779 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/system/SysMenuController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.system; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 功能模块表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sys-menu") +public class SysMenuController { + +} diff --git a/api/src/main/java/com/wansensoft/api/system/SysMsgController.java b/api/src/main/java/com/wansensoft/api/system/SysMsgController.java new file mode 100644 index 00000000..88d055c7 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/system/SysMsgController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.system; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 消息表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sys-msg") +public class SysMsgController { + +} diff --git a/api/src/main/java/com/wansensoft/api/system/SysOrganizationController.java b/api/src/main/java/com/wansensoft/api/system/SysOrganizationController.java new file mode 100644 index 00000000..c4b7c9b8 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/system/SysOrganizationController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.system; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 机构表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sys-organization") +public class SysOrganizationController { + +} diff --git a/api/src/main/java/com/wansensoft/api/system/SysPlatformConfigController.java b/api/src/main/java/com/wansensoft/api/system/SysPlatformConfigController.java new file mode 100644 index 00000000..681508ce --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/system/SysPlatformConfigController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.system; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 平台参数 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sys-platform-config") +public class SysPlatformConfigController { + +} diff --git a/api/src/main/java/com/wansensoft/api/system/SysSerialNumberController.java b/api/src/main/java/com/wansensoft/api/system/SysSerialNumberController.java new file mode 100644 index 00000000..ee2ea359 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/system/SysSerialNumberController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.system; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 序列号表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sys-serial-number") +public class SysSerialNumberController { + +} diff --git a/api/src/main/java/com/wansensoft/api/tenant/SysTenantController.java b/api/src/main/java/com/wansensoft/api/tenant/SysTenantController.java new file mode 100644 index 00000000..7ebafe9b --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/tenant/SysTenantController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.tenant; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 租户 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sysTenant") +public class SysTenantController { + +} diff --git a/api/src/main/java/com/wansensoft/api/unit/UnitController.java b/api/src/main/java/com/wansensoft/api/unit/UnitController.java index 234b00e5..af0a04a0 100644 --- a/api/src/main/java/com/wansensoft/api/unit/UnitController.java +++ b/api/src/main/java/com/wansensoft/api/unit/UnitController.java @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.*; import jakarta.servlet.http.HttpServletRequest; + import java.util.HashMap; import java.util.List; import java.util.Map; @@ -56,7 +57,7 @@ public BaseResponseInfo getAllList(HttpServletRequest request) { @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") public String batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request) { + HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); diff --git a/api/src/main/java/com/wansensoft/api/user/SysUserBusinessController.java b/api/src/main/java/com/wansensoft/api/user/SysUserBusinessController.java new file mode 100644 index 00000000..bfd60bd6 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/user/SysUserBusinessController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.user; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 用户/角色/模块关系表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sysUserBusiness") +public class SysUserBusinessController { + +} diff --git a/api/src/main/java/com/wansensoft/api/user/SysUserController.java b/api/src/main/java/com/wansensoft/api/user/SysUserController.java new file mode 100644 index 00000000..ea0be66d --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/user/SysUserController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.user; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 用户表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/sysUser") +public class SysUserController { + +} diff --git a/api/src/main/java/com/wansensoft/api/user/UserBusinessController.java b/api/src/main/java/com/wansensoft/api/user/UserBusinessController.java index db70cf88..49505521 100644 --- a/api/src/main/java/com/wansensoft/api/user/UserBusinessController.java +++ b/api/src/main/java/com/wansensoft/api/user/UserBusinessController.java @@ -9,8 +9,6 @@ import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; import jakarta.servlet.http.HttpServletRequest; @@ -69,7 +67,7 @@ public BaseResponseInfo getBasicData(@RequestParam(value = "KeyId") String keyId @ApiOperation(value = "校验存在") public String checkIsValueExist(@RequestParam(value ="type", required = false) String type, @RequestParam(value ="keyId", required = false) String keyId, - HttpServletRequest request) { + HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); Long id = userBusinessService.checkIsValueExist(type, keyId); if(id != null) { diff --git a/api/src/main/java/com/wansensoft/api/user/UserController.java b/api/src/main/java/com/wansensoft/api/user/UserController.java index 179d37aa..fa96b706 100644 --- a/api/src/main/java/com/wansensoft/api/user/UserController.java +++ b/api/src/main/java/com/wansensoft/api/user/UserController.java @@ -6,7 +6,6 @@ import com.wansensoft.entities.tenant.Tenant; import com.wansensoft.entities.user.User; import com.wansensoft.entities.user.UserEx; -import com.wansensoft.service.log.LogService; import com.wansensoft.service.role.RoleService; import com.wansensoft.service.tenant.TenantService; import com.wansensoft.service.user.UserService; diff --git a/api/src/main/java/com/wansensoft/api/warehouse/WarehouseController.java b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseController.java new file mode 100644 index 00000000..afeddc02 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.warehouse; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 仓库表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/warehouse") +public class WarehouseController { + +} diff --git a/api/src/main/java/com/wansensoft/api/warehouse/WarehouseHeadController.java b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseHeadController.java new file mode 100644 index 00000000..d5607a5a --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseHeadController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.warehouse; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 单据主表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/warehouseHead") +public class WarehouseHeadController { + +} diff --git a/api/src/main/java/com/wansensoft/api/warehouse/WarehouseItemController.java b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseItemController.java new file mode 100644 index 00000000..2daeb025 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/warehouse/WarehouseItemController.java @@ -0,0 +1,20 @@ +package com.wansensoft.api.warehouse; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 单据子表 前端控制器 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@RestController +@RequestMapping("/warehouseItem") +public class WarehouseItemController { + +} diff --git a/api/src/main/resources/application-dev.yml b/api/src/main/resources/application-dev.yml index d955dc4f..428471f7 100644 --- a/api/src/main/resources/application-dev.yml +++ b/api/src/main/resources/application-dev.yml @@ -35,6 +35,7 @@ file: path: /opt/wansenerp/upload plugin: - runMode: prod - pluginPath: plugins - pluginConfigFilePath: pluginConfig \ No newline at end of file + runMode: dev + mainPackage: + - plugins + pluginPath: plugins \ No newline at end of file diff --git a/api/src/main/resources/application.yml b/api/src/main/resources/application.yml index 6729fce4..51ad3aad 100644 --- a/api/src/main/resources/application.yml +++ b/api/src/main/resources/application.yml @@ -34,4 +34,5 @@ mybatis-plus: #刷新mapper 调试神器 refresh-mapper: true configuration: - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl \ No newline at end of file + log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl + # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/IncomeExpenseMapper.java b/dao/src/main/java/com/wansensoft/mappers/IncomeExpenseMapper.java new file mode 100644 index 00000000..15555e02 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/IncomeExpenseMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers; + +import com.wansensoft.entities.IncomeExpense; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 收支项目 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IncomeExpenseMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/OperatorMapper.java b/dao/src/main/java/com/wansensoft/mappers/OperatorMapper.java new file mode 100644 index 00000000..f7ed32fd --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/OperatorMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers; + +import com.wansensoft.entities.Operator; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 经手人表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface OperatorMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/SystemSupplierMapper.java b/dao/src/main/java/com/wansensoft/mappers/SystemSupplierMapper.java new file mode 100644 index 00000000..d71976b5 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/SystemSupplierMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers; + +import com.wansensoft.entities.SystemSupplier; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 供应商/客户信息表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SystemSupplierMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/financial/FinancialAccountMapper.java b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialAccountMapper.java new file mode 100644 index 00000000..8b361a63 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialAccountMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.financial; + +import com.wansensoft.entities.FinancialAccount; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 账户信息 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface FinancialAccountMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/financial/FinancialMainMapper.java b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialMainMapper.java new file mode 100644 index 00000000..55ecb301 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialMainMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.financial; + +import com.wansensoft.entities.FinancialMain; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 财务主表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface FinancialMainMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/financial/FinancialSubMapper.java b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialSubMapper.java new file mode 100644 index 00000000..9e172467 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/financial/FinancialSubMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.financial; + +import com.wansensoft.entities.FinancialSub; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 财务子表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface FinancialSubMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/log/LogMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/log/LogMapperEx.java index 3bcb2691..38e01313 100644 --- a/dao/src/main/java/com/wansensoft/mappers/log/LogMapperEx.java +++ b/dao/src/main/java/com/wansensoft/mappers/log/LogMapperEx.java @@ -1,5 +1,6 @@ package com.wansensoft.mappers.log; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.wansensoft.entities.log.Log; import com.wansensoft.vo.LogVo4List; @@ -37,5 +38,6 @@ Long getCountByIpAndDate( @Param("clientIp") String clientIp, @Param("createTime") String createTime); + @InterceptorIgnore(tenantLine = "true") int insertLogWithUserId(Log log); } \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductAttributeMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductAttributeMapper.java new file mode 100644 index 00000000..d7ffe652 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductAttributeMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.product; + +import com.wansensoft.entities.ProductAttribute; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 产品属性表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ProductAttributeMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductCategoryMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductCategoryMapper.java new file mode 100644 index 00000000..9c63e08b --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductCategoryMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.product; + +import com.wansensoft.entities.ProductCategory; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 产品类型表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ProductCategoryMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPriceMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPriceMapper.java new file mode 100644 index 00000000..0b249a26 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPriceMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.product; + +import com.wansensoft.entities.ProductExtendPrice; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 产品价格扩展 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ProductExtendPriceMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPropertyMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPropertyMapper.java new file mode 100644 index 00000000..376ee41b --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPropertyMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.product; + +import com.wansensoft.entities.ProductExtendProperty; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 产品扩展字段表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ProductExtendPropertyMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryCurrentMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryCurrentMapper.java new file mode 100644 index 00000000..df1273e9 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryCurrentMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.product; + +import com.wansensoft.entities.ProductInventoryCurrent; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 产品当前库存 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ProductInventoryCurrentMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryInitialMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryInitialMapper.java new file mode 100644 index 00000000..36d71921 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryInitialMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.product; + +import com.wansensoft.entities.ProductInventoryInitial; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 产品初始库存 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ProductInventoryInitialMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductMapper.java new file mode 100644 index 00000000..2f762e77 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.product; + +import com.wansensoft.entities.Product; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 产品表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ProductMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/product/ProductUnitMapper.java b/dao/src/main/java/com/wansensoft/mappers/product/ProductUnitMapper.java new file mode 100644 index 00000000..2a9941e4 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/product/ProductUnitMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.product; + +import com.wansensoft.entities.ProductUnit; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 多单位表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ProductUnitMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/role/RoleMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/role/RoleMapperEx.java index 6a84e41a..ffb938c7 100644 --- a/dao/src/main/java/com/wansensoft/mappers/role/RoleMapperEx.java +++ b/dao/src/main/java/com/wansensoft/mappers/role/RoleMapperEx.java @@ -1,5 +1,6 @@ package com.wansensoft.mappers.role; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.wansensoft.entities.role.Role; import com.wansensoft.entities.role.RoleEx; @@ -24,6 +25,8 @@ Long countsByRole( int batchDeleteRoleByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + @InterceptorIgnore(tenantLine = "true") Role getRoleWithoutTenant( @Param("roleId") Long roleId); } \ No newline at end of file diff --git a/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMapper.java b/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMapper.java new file mode 100644 index 00000000..9d0263fd --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.role; + +import com.wansensoft.entities.SysRole; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 角色表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysRoleMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMenuRelMapper.java b/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMenuRelMapper.java new file mode 100644 index 00000000..1ffb5d40 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/role/SysRoleMenuRelMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.role; + +import com.wansensoft.entities.SysRoleMenuRel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 角色菜单关系表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysRoleMenuRelMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysConfigMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysConfigMapper.java new file mode 100644 index 00000000..bc0619d2 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysConfigMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.system; + +import com.wansensoft.entities.SysConfig; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 系统参数 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysConfigMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysLogMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysLogMapper.java new file mode 100644 index 00000000..3196f0a1 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysLogMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.system; + +import com.wansensoft.entities.SysLog; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 操作日志 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysLogMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysMenuMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysMenuMapper.java new file mode 100644 index 00000000..494b7ebe --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysMenuMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.system; + +import com.wansensoft.entities.SysMenu; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 功能模块表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysMenuMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysMsgMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysMsgMapper.java new file mode 100644 index 00000000..a10c0d80 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysMsgMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.system; + +import com.wansensoft.entities.SysMsg; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 消息表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysMsgMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysOrganizationMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysOrganizationMapper.java new file mode 100644 index 00000000..d02b298b --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysOrganizationMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.system; + +import com.wansensoft.entities.SysOrganization; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 机构表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysOrganizationMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysPlatformConfigMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysPlatformConfigMapper.java new file mode 100644 index 00000000..95e09c3e --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysPlatformConfigMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.system; + +import com.wansensoft.entities.SysPlatformConfig; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 平台参数 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysPlatformConfigMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/system/SysSerialNumberMapper.java b/dao/src/main/java/com/wansensoft/mappers/system/SysSerialNumberMapper.java new file mode 100644 index 00000000..9079e9b5 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/system/SysSerialNumberMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.system; + +import com.wansensoft.entities.SysSerialNumber; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 序列号表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysSerialNumberMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantMapper.java b/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantMapper.java new file mode 100644 index 00000000..e9088df7 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.tenant; + +import com.wansensoft.entities.SysTenant; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 租户 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysTenantMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantUserMapper.java b/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantUserMapper.java new file mode 100644 index 00000000..c8bfe1c6 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantUserMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.tenant; + +import com.wansensoft.entities.SysTenantUser; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysTenantUserMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/user/SysUserBusinessMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/SysUserBusinessMapper.java new file mode 100644 index 00000000..0ec23c88 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/user/SysUserBusinessMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.user; + +import com.wansensoft.entities.SysUserBusiness; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 用户/角色/模块关系表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysUserBusinessMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/user/SysUserMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/SysUserMapper.java new file mode 100644 index 00000000..9a853819 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/user/SysUserMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.user; + +import com.wansensoft.entities.SysUser; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 用户表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysUserMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/user/SysUserOrgRelMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/SysUserOrgRelMapper.java new file mode 100644 index 00000000..69f6219b --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/user/SysUserOrgRelMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.user; + +import com.wansensoft.entities.SysUserOrgRel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 机构用户关系表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysUserOrgRelMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/user/SysUserRoleRelMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/SysUserRoleRelMapper.java new file mode 100644 index 00000000..1b1c92f7 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/user/SysUserRoleRelMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.user; + +import com.wansensoft.entities.SysUserRoleRel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 用户角色关系表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysUserRoleRelMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/user/SysUserWarehouseRelMapper.java b/dao/src/main/java/com/wansensoft/mappers/user/SysUserWarehouseRelMapper.java new file mode 100644 index 00000000..4687b6cc --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/user/SysUserWarehouseRelMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.user; + +import com.wansensoft.entities.SysUserWarehouseRel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface SysUserWarehouseRelMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/user/UserMapperEx.java b/dao/src/main/java/com/wansensoft/mappers/user/UserMapperEx.java index 407f7caa..fb324807 100644 --- a/dao/src/main/java/com/wansensoft/mappers/user/UserMapperEx.java +++ b/dao/src/main/java/com/wansensoft/mappers/user/UserMapperEx.java @@ -1,5 +1,6 @@ package com.wansensoft.mappers.user; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.wansensoft.entities.user.User; import com.wansensoft.entities.user.UserEx; @@ -23,6 +24,7 @@ Long countsByUser( @Param("userName") String userName, @Param("loginName") String loginName); + @InterceptorIgnore(tenantLine = "true") List getUserListByUserNameOrLoginName(@Param("userName") String userName, @Param("loginName") String loginName); @@ -31,15 +33,18 @@ List getUserListByUserNameOrLoginName(@Param("userName") String userName, List getNodeTree(); List getNextNodeTree(Map parameterMap); + @InterceptorIgnore(tenantLine = "true") void disableUserByLimit(@Param("tenantId") Long tenantId); List getListByOrgaId( @Param("id") Long id, @Param("orgaId") Long orgaId); + @InterceptorIgnore(tenantLine = "true") User getUserByWeixinOpenId( @Param("weixinOpenId") String weixinOpenId); + @InterceptorIgnore(tenantLine = "true") int updateUserWithWeixinOpenId( @Param("loginName") String loginName, @Param("password") String password, diff --git a/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseHeadMapper.java b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseHeadMapper.java new file mode 100644 index 00000000..49cbad46 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseHeadMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.warehouse; + +import com.wansensoft.entities.WarehouseHead; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 单据主表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface WarehouseHeadMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseItemMapper.java b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseItemMapper.java new file mode 100644 index 00000000..e5cc8eea --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseItemMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.warehouse; + +import com.wansensoft.entities.WarehouseItem; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 单据子表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface WarehouseItemMapper extends BaseMapper { + +} diff --git a/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseMapper.java b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseMapper.java new file mode 100644 index 00000000..7eab2b75 --- /dev/null +++ b/dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseMapper.java @@ -0,0 +1,16 @@ +package com.wansensoft.mappers.warehouse; + +import com.wansensoft.entities.Warehouse; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 仓库表 Mapper 接口 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface WarehouseMapper extends BaseMapper { + +} diff --git a/dao/src/main/resources/mapper_xml/FinancialAccountMapper.xml b/dao/src/main/resources/mapper_xml/FinancialAccountMapper.xml new file mode 100644 index 00000000..65cd81f5 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/FinancialAccountMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/FinancialMainMapper.xml b/dao/src/main/resources/mapper_xml/FinancialMainMapper.xml new file mode 100644 index 00000000..8321e6bb --- /dev/null +++ b/dao/src/main/resources/mapper_xml/FinancialMainMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/FinancialSubMapper.xml b/dao/src/main/resources/mapper_xml/FinancialSubMapper.xml new file mode 100644 index 00000000..d96aaa45 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/FinancialSubMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/IncomeExpenseMapper.xml b/dao/src/main/resources/mapper_xml/IncomeExpenseMapper.xml new file mode 100644 index 00000000..bcd6d22c --- /dev/null +++ b/dao/src/main/resources/mapper_xml/IncomeExpenseMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/OperatorMapper.xml b/dao/src/main/resources/mapper_xml/OperatorMapper.xml new file mode 100644 index 00000000..deda4a95 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/OperatorMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/ProductAttributeMapper.xml b/dao/src/main/resources/mapper_xml/ProductAttributeMapper.xml new file mode 100644 index 00000000..bfa2c91d --- /dev/null +++ b/dao/src/main/resources/mapper_xml/ProductAttributeMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/ProductCategoryMapper.xml b/dao/src/main/resources/mapper_xml/ProductCategoryMapper.xml new file mode 100644 index 00000000..97405dd8 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/ProductCategoryMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/ProductExtendPriceMapper.xml b/dao/src/main/resources/mapper_xml/ProductExtendPriceMapper.xml new file mode 100644 index 00000000..fb5ea629 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/ProductExtendPriceMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/ProductExtendPropertyMapper.xml b/dao/src/main/resources/mapper_xml/ProductExtendPropertyMapper.xml new file mode 100644 index 00000000..fbb244ca --- /dev/null +++ b/dao/src/main/resources/mapper_xml/ProductExtendPropertyMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/ProductInventoryCurrentMapper.xml b/dao/src/main/resources/mapper_xml/ProductInventoryCurrentMapper.xml new file mode 100644 index 00000000..748f53a2 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/ProductInventoryCurrentMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/ProductInventoryInitialMapper.xml b/dao/src/main/resources/mapper_xml/ProductInventoryInitialMapper.xml new file mode 100644 index 00000000..c4d8d1a0 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/ProductInventoryInitialMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/ProductMapper.xml b/dao/src/main/resources/mapper_xml/ProductMapper.xml new file mode 100644 index 00000000..11567593 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/ProductMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/ProductUnitMapper.xml b/dao/src/main/resources/mapper_xml/ProductUnitMapper.xml new file mode 100644 index 00000000..1391db40 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/ProductUnitMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysConfigMapper.xml b/dao/src/main/resources/mapper_xml/SysConfigMapper.xml new file mode 100644 index 00000000..2f3d46cc --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysConfigMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysLogMapper.xml b/dao/src/main/resources/mapper_xml/SysLogMapper.xml new file mode 100644 index 00000000..89f57f47 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysLogMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysMenuMapper.xml b/dao/src/main/resources/mapper_xml/SysMenuMapper.xml new file mode 100644 index 00000000..518aea65 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysMenuMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysMsgMapper.xml b/dao/src/main/resources/mapper_xml/SysMsgMapper.xml new file mode 100644 index 00000000..e0ceec01 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysMsgMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysOrganizationMapper.xml b/dao/src/main/resources/mapper_xml/SysOrganizationMapper.xml new file mode 100644 index 00000000..35c9ce19 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysOrganizationMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysPlatformConfigMapper.xml b/dao/src/main/resources/mapper_xml/SysPlatformConfigMapper.xml new file mode 100644 index 00000000..a4bd7fd3 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysPlatformConfigMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysRoleMapper.xml b/dao/src/main/resources/mapper_xml/SysRoleMapper.xml new file mode 100644 index 00000000..b3dd33f9 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysRoleMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysRoleMenuRelMapper.xml b/dao/src/main/resources/mapper_xml/SysRoleMenuRelMapper.xml new file mode 100644 index 00000000..170adcca --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysRoleMenuRelMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysSerialNumberMapper.xml b/dao/src/main/resources/mapper_xml/SysSerialNumberMapper.xml new file mode 100644 index 00000000..fda357ff --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysSerialNumberMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysTenantMapper.xml b/dao/src/main/resources/mapper_xml/SysTenantMapper.xml new file mode 100644 index 00000000..5e8c5c03 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysTenantMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysTenantUserMapper.xml b/dao/src/main/resources/mapper_xml/SysTenantUserMapper.xml new file mode 100644 index 00000000..2594c30e --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysTenantUserMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysUserBusinessMapper.xml b/dao/src/main/resources/mapper_xml/SysUserBusinessMapper.xml new file mode 100644 index 00000000..6a13a112 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysUserBusinessMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysUserMapper.xml b/dao/src/main/resources/mapper_xml/SysUserMapper.xml new file mode 100644 index 00000000..dceb1e3f --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysUserMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysUserOrgRelMapper.xml b/dao/src/main/resources/mapper_xml/SysUserOrgRelMapper.xml new file mode 100644 index 00000000..96b30083 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysUserOrgRelMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysUserRoleRelMapper.xml b/dao/src/main/resources/mapper_xml/SysUserRoleRelMapper.xml new file mode 100644 index 00000000..9accf097 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysUserRoleRelMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SysUserWarehouseRelMapper.xml b/dao/src/main/resources/mapper_xml/SysUserWarehouseRelMapper.xml new file mode 100644 index 00000000..b5a046fc --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SysUserWarehouseRelMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/SystemSupplierMapper.xml b/dao/src/main/resources/mapper_xml/SystemSupplierMapper.xml new file mode 100644 index 00000000..fadd8ad5 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/SystemSupplierMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/WarehouseHeadMapper.xml b/dao/src/main/resources/mapper_xml/WarehouseHeadMapper.xml new file mode 100644 index 00000000..68c1bee1 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/WarehouseHeadMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/WarehouseItemMapper.xml b/dao/src/main/resources/mapper_xml/WarehouseItemMapper.xml new file mode 100644 index 00000000..f7dac3b1 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/WarehouseItemMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/dao/src/main/resources/mapper_xml/WarehouseMapper.xml b/dao/src/main/resources/mapper_xml/WarehouseMapper.xml new file mode 100644 index 00000000..a80e2ac6 --- /dev/null +++ b/dao/src/main/resources/mapper_xml/WarehouseMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/domain/src/main/java/com/wansensoft/dto/PageSizeDto.java b/domain/src/main/java/com/wansensoft/dto/PageSizeDto.java new file mode 100644 index 00000000..3ea69f94 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/dto/PageSizeDto.java @@ -0,0 +1,22 @@ +package com.wansensoft.dto; + +import lombok.Data; + +/** + * 默认分页数据传输对象,针对需要进行分页查询的请求 + * 如果需要就继承该类 + */ +@Data +public class PageSizeDto { + + /** + * 查询列表总记录数 + */ + int pageTotal = 0; + + /** + * 每页显示条数,默认10 + */ + int pageSize = 10; + +} diff --git a/domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java b/domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java new file mode 100644 index 00000000..874cc626 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java @@ -0,0 +1,53 @@ +package com.wansensoft.dto.depot; + +import com.wansensoft.dto.PageSizeDto; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 零售出库查询数据请求Dto + */ +@Data +@Builder +@EqualsAndHashCode(callSuper = true) +public class RetailOutboundDto extends PageSizeDto { + + private String type; + + private String subType; + + private String roleType; + + private String hasDebt; + + private String status; + + private String purchaseStatus; + + private String number; + + private String linkNumber; + + private String beginTime; + + private String endTime; + + private String materialParam; + + private Long organId; + + private Long creator; + + private Long depotId; + + private Long accountId; + + private String remark; + + private int offset; + + private int rows; + + private String token; +} diff --git a/domain/src/main/java/com/wansensoft/entities/FinancialAccount.java b/domain/src/main/java/com/wansensoft/entities/FinancialAccount.java new file mode 100644 index 00000000..6a3f92cd --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/FinancialAccount.java @@ -0,0 +1,106 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 账户信息 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("financial_account") +public class FinancialAccount implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 名称 + */ + private String accountName; + + /** + * 编号 + */ + private String serialNumber; + + /** + * 期初金额 + */ + private BigDecimal initialAmount; + + /** + * 当前余额 + */ + private BigDecimal currentAmount; + + /** + * 备注 + */ + private String remark; + + /** + * 启用 + */ + private Boolean status; + + /** + * 排序 + */ + private String sort; + + /** + * 是否默认 + */ + private Boolean isDefault; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/FinancialMain.java b/domain/src/main/java/com/wansensoft/entities/FinancialMain.java new file mode 100644 index 00000000..f231256d --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/FinancialMain.java @@ -0,0 +1,131 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 财务主表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("financial_main") +public class FinancialMain implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 机构id(收款/付款单位) + */ + private Long organizationId; + + /** + * 经手人id + */ + private Long handsPersonId; + + /** + * 账户(收款/付款) + */ + private Long accountId; + + /** + * 类型(支出/收入/收款/付款/转账) + */ + private String type; + + /** + * 变动金额(优惠/收款/付款/实付) + */ + private BigDecimal changePrice; + + /** + * 优惠金额 + */ + private BigDecimal discountPrice; + + /** + * 合计金额 + */ + private BigDecimal totalPrice; + + /** + * 单据编号 + */ + private String receiptNumber; + + /** + * 单据来源,0-pc,1-手机 + */ + private Boolean receiptSource; + + /** + * 单据日期 + */ + private LocalDateTime receiptTime; + + /** + * 备注 + */ + private String remark; + + /** + * 附件名称 + */ + private String fileName; + + /** + * 状态,0未审核、1已审核、9审核中 + */ + private Boolean status; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/FinancialSub.java b/domain/src/main/java/com/wansensoft/entities/FinancialSub.java new file mode 100644 index 00000000..53f5b51a --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/FinancialSub.java @@ -0,0 +1,106 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 财务子表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("financial_sub") +public class FinancialSub implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 表头Id + */ + private Long tableHeaderId; + + /** + * 账户Id + */ + private Long accountId; + + /** + * 收支项目Id + */ + private Long incomeExpenseId; + + /** + * 单据id + */ + private Long receiptId; + + /** + * 应收欠款 + */ + private BigDecimal accountsReceivable; + + /** + * 已收欠款 + */ + private BigDecimal accountsReceived; + + /** + * 单项金额 + */ + private BigDecimal singleAmount; + + /** + * 单据备注 + */ + private String remark; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/IncomeExpense.java b/domain/src/main/java/com/wansensoft/entities/IncomeExpense.java new file mode 100644 index 00000000..8e0f49e3 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/IncomeExpense.java @@ -0,0 +1,90 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 收支项目 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("income_expense") +public class IncomeExpense implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 名称 + */ + private String name; + + /** + * 类型 + */ + private String type; + + /** + * 备注 + */ + private String remark; + + /** + * 启用 + */ + private Boolean status; + + /** + * 排序 + */ + private String sort; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/Operator.java b/domain/src/main/java/com/wansensoft/entities/Operator.java new file mode 100644 index 00000000..d9f9d53e --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/Operator.java @@ -0,0 +1,85 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 经手人表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("operator") +public class Operator implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 姓名 + */ + private String name; + + /** + * 类型 + */ + private String type; + + /** + * 状态(0-启用, 1-停用) + */ + private Boolean status; + + /** + * 排序 + */ + private String sort; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/Product.java b/domain/src/main/java/com/wansensoft/entities/Product.java new file mode 100644 index 00000000..5104e866 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/Product.java @@ -0,0 +1,161 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 产品表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("product") +public class Product implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 产品类型id + */ + private Long productCategoryId; + + /** + * 名称 + */ + private String productName; + + /** + * 制造商 + */ + private String productManufacturer; + + /** + * 型号 + */ + private String productModel; + + /** + * 规格 + */ + private String productStandard; + + /** + * 颜色 + */ + private String productColor; + + /** + * 计量单位Id + */ + private Long productUnitId; + + /** + * 单位-单个 + */ + private String productUnit; + + /** + * 保质期天数 + */ + private Integer productExpiryNum; + + /** + * 图片名称 + */ + private String productImgName; + + /** + * 基础重量(kg) + */ + private BigDecimal productWeight; + + /** + * 备注 + */ + private String remark; + + /** + * 启用 0-禁用 1-启用 + */ + private Boolean status; + + /** + * 自定义1 + */ + private String otherFieldOne; + + /** + * 自定义2 + */ + private String otherFieldTwo; + + /** + * 自定义3 + */ + private String otherFieldThree; + + /** + * 是否开启序列号,0否,1是 + */ + private Boolean enableSerialNumber; + + /** + * 是否开启批号,0否,1是 + */ + private Boolean enableBatchNumber; + + /** + * 仓位货架 + */ + private String warehouseShelves; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/ProductAttribute.java b/domain/src/main/java/com/wansensoft/entities/ProductAttribute.java new file mode 100644 index 00000000..9e12595b --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/ProductAttribute.java @@ -0,0 +1,72 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 产品属性表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("product_attribute") +public class ProductAttribute implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 属性名 + */ + private String attributeName; + + /** + * 属性值 + */ + private String attributeValue; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/ProductCategory.java b/domain/src/main/java/com/wansensoft/entities/ProductCategory.java new file mode 100644 index 00000000..6b6039db --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/ProductCategory.java @@ -0,0 +1,95 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 产品类型表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("product_category") +public class ProductCategory implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 名称 + */ + private String categoryName; + + /** + * 等级 + */ + private Integer categoryLevel; + + /** + * 上级id + */ + private Long parentId; + + /** + * 显示顺序 + */ + private String sort; + + /** + * 编号 + */ + private String serialNumber; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/ProductExtendPrice.java b/domain/src/main/java/com/wansensoft/entities/ProductExtendPrice.java new file mode 100644 index 00000000..9307c3bd --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/ProductExtendPrice.java @@ -0,0 +1,111 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 产品价格扩展 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("product_extend_price") +public class ProductExtendPrice implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 商品id + */ + private Long productId; + + /** + * 商品条码 + */ + private String productBarCode; + + /** + * 商品单位 + */ + private String productUnit; + + /** + * 多属性 + */ + private String multiAttribute; + + /** + * 采购价格 + */ + private BigDecimal purchasePrice; + + /** + * 零售价格 + */ + private BigDecimal retailPrice; + + /** + * 销售价格 + */ + private BigDecimal salePrice; + + /** + * 最低售价 + */ + private BigDecimal lowPrice; + + /** + * 是否为默认单位,1是,0否 + */ + private Boolean defaultFlag; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/ProductExtendProperty.java b/domain/src/main/java/com/wansensoft/entities/ProductExtendProperty.java new file mode 100644 index 00000000..03ef28bd --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/ProductExtendProperty.java @@ -0,0 +1,80 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 产品扩展字段表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("product_extend_property") +public class ProductExtendProperty implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 原始名称 + */ + private String nativeName; + + /** + * 是否启用 + */ + private Boolean status; + + /** + * 别名 + */ + private String anotherName; + + /** + * 排序 + */ + private String sort; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/ProductInventoryCurrent.java b/domain/src/main/java/com/wansensoft/entities/ProductInventoryCurrent.java new file mode 100644 index 00000000..901ead9d --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/ProductInventoryCurrent.java @@ -0,0 +1,81 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 产品当前库存 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("product_inventory_current") +public class ProductInventoryCurrent implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 产品id + */ + private Long productId; + + /** + * 仓库id + */ + private Long warehouseId; + + /** + * 当前库存数量 + */ + private BigDecimal currentStockQuantity; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/ProductInventoryInitial.java b/domain/src/main/java/com/wansensoft/entities/ProductInventoryInitial.java new file mode 100644 index 00000000..96aaa255 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/ProductInventoryInitial.java @@ -0,0 +1,91 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 产品初始库存 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("product_inventory_initial") +public class ProductInventoryInitial implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 产品id + */ + private Long productId; + + /** + * 仓库id + */ + private Long warehouseId; + + /** + * 初始库存数量 + */ + private BigDecimal initStockQuantity; + + /** + * 最低库存数量 + */ + private BigDecimal lowStockQuantity; + + /** + * 最高库存数量 + */ + private BigDecimal highStockQuantity; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/ProductUnit.java b/domain/src/main/java/com/wansensoft/entities/ProductUnit.java new file mode 100644 index 00000000..1a2894bb --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/ProductUnit.java @@ -0,0 +1,111 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 多单位表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("product_unit") +public class ProductUnit implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 名称,支持多单位 + */ + private String name; + + /** + * 基础单位 + */ + private String basicUnit; + + /** + * 副单位 + */ + private String otherUnit; + + /** + * 副单位2 + */ + private String otherUnitTwo; + + /** + * 副单位3 + */ + private String otherUnitThree; + + /** + * 比例 + */ + private BigDecimal ratio; + + /** + * 比例2 + */ + private BigDecimal ratioTwo; + + /** + * 比例3 + */ + private BigDecimal ratioThree; + + /** + * 启用 + */ + private Boolean status; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysConfig.java b/domain/src/main/java/com/wansensoft/entities/SysConfig.java new file mode 100644 index 00000000..e11245ef --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysConfig.java @@ -0,0 +1,124 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 系统参数 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_config") +public class SysConfig implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 公司名称 + */ + private String companyName; + + /** + * 公司联系人 + */ + private String companyContact; + + /** + * 公司地址 + */ + private String companyAddress; + + /** + * 公司电话 + */ + private String companyPhone; + + /** + * 公司传真 + */ + private String companyFax; + + /** + * 公司邮编 + */ + private String companyPostCode; + + /** + * 销售协议 + */ + private String saleAgreement; + + /** + * 仓库启用标记,0未启用,1启用 + */ + private Boolean warehouseStatus; + + /** + * 客户启用标记,0未启用,1启用 + */ + private Boolean customerStatus; + + /** + * 负库存启用标记,0未启用,1启用 + */ + private Boolean minusStockStatus; + + /** + * 以销定购启用标记,0未启用,1启用 + */ + private Boolean purchaseBySaleStatus; + + /** + * 多级审核启用标记,0未启用,1启用 + */ + private Boolean multiLevelApprovalStatus; + + /** + * 流程类型,可多选 + */ + private String processType; + + /** + * 强审核启用标记,0未启用,1启用 + */ + private Boolean forceApprovalStatus; + + /** + * 更新单价启用标记,0未启用,1启用 + */ + private Boolean updateUnitPriceStatus; + + /** + * 超出关联单据启用标记,0未启用,1启用 + */ + private Boolean overLinkBillStatus; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysLog.java b/domain/src/main/java/com/wansensoft/entities/SysLog.java new file mode 100644 index 00000000..38b3cf49 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysLog.java @@ -0,0 +1,75 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 操作日志 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_log") +public class SysLog implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 用户id + */ + private Long userId; + + /** + * 操作模块名称 + */ + private String operateName; + + /** + * 客户端IP + */ + private String clientIp; + + /** + * 操作状态 0==成功,1==失败 + */ + private Integer status; + + /** + * 详情 + */ + private String content; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 创建人 + */ + private Long createBy; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysMenu.java b/domain/src/main/java/com/wansensoft/entities/SysMenu.java new file mode 100644 index 00000000..43d637f5 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysMenu.java @@ -0,0 +1,115 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 功能模块表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_menu") +public class SysMenu implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 编号 + */ + private String number; + + /** + * 名称 + */ + private String name; + + /** + * 上级编号 + */ + private String parentNumber; + + /** + * 链接 + */ + private String url; + + /** + * 组件 + */ + private String component; + + /** + * 收缩 + */ + private Boolean shrink; + + /** + * 排序 + */ + private String sort; + + /** + * 状态(0-启用,1-停用) + */ + private Boolean status; + + /** + * 类型 + */ + private String type; + + /** + * 功能按钮 + */ + private String functionButton; + + /** + * 图标 + */ + private String icon; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysMsg.java b/domain/src/main/java/com/wansensoft/entities/SysMsg.java new file mode 100644 index 00000000..33b7d21a --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysMsg.java @@ -0,0 +1,75 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 消息表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_msg") +public class SysMsg implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 消息标题 + */ + private String msgTitle; + + /** + * 消息内容 + */ + private String msgContent; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 消息类型 + */ + private String type; + + /** + * 接收人id + */ + private Long userId; + + /** + * 状态,1未读 2已读 + */ + private Boolean status; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysOrganization.java b/domain/src/main/java/com/wansensoft/entities/SysOrganization.java new file mode 100644 index 00000000..71146aa6 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysOrganization.java @@ -0,0 +1,90 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 机构表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_organization") +public class SysOrganization implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 父机构id + */ + private Long parentId; + + /** + * 机构编号 + */ + private String organizationNumber; + + /** + * 机构简称 + */ + private String organizationName; + + /** + * 备注 + */ + private String remark; + + /** + * 机构显示顺序 + */ + private String sort; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysPlatformConfig.java b/domain/src/main/java/com/wansensoft/entities/SysPlatformConfig.java new file mode 100644 index 00000000..1b7a61d3 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysPlatformConfig.java @@ -0,0 +1,67 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 平台参数 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_platform_config") +public class SysPlatformConfig implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 关键词 + */ + private String platformKey; + + /** + * 关键词名称 + */ + private String platformKeyInfo; + + /** + * 值 + */ + private String platformValue; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysRole.java b/domain/src/main/java/com/wansensoft/entities/SysRole.java new file mode 100644 index 00000000..a7809a9c --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysRole.java @@ -0,0 +1,85 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 角色表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_role") +public class SysRole implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 名称 + */ + private String name; + + /** + * 类型 + */ + private String type; + + /** + * 价格屏蔽 1-屏蔽采购价 2-屏蔽零售价 3-屏蔽销售价 + */ + private String priceLimit; + + /** + * 描述 + */ + private String description; + + /** + * 状态(0-启用,1-停用) + */ + private Boolean status; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysRoleMenuRel.java b/domain/src/main/java/com/wansensoft/entities/SysRoleMenuRel.java new file mode 100644 index 00000000..93ac592e --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysRoleMenuRel.java @@ -0,0 +1,70 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 角色菜单关系表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_role_menu_rel") +public class SysRoleMenuRel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 角色id + */ + private Long roleId; + + /** + * 菜单资源id + */ + private Long menuId; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysSerialNumber.java b/domain/src/main/java/com/wansensoft/entities/SysSerialNumber.java new file mode 100644 index 00000000..83857549 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysSerialNumber.java @@ -0,0 +1,100 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 序列号表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_serial_number") +public class SysSerialNumber implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 产品表id + */ + private Long productId; + + /** + * 仓库id + */ + private Long warehouseId; + + /** + * 序列号 + */ + private String serialNumber; + + /** + * 是否卖出,0未卖出,1卖出 + */ + private Boolean sellStatus; + + /** + * 入库单号 + */ + private String inboundNumber; + + /** + * 出库单号 + */ + private String outboundNumber; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysTenant.java b/domain/src/main/java/com/wansensoft/entities/SysTenant.java new file mode 100644 index 00000000..1e6e2312 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysTenant.java @@ -0,0 +1,80 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 租户 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_tenant") +public class SysTenant implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 租户名称 + */ + private String name; + + /** + * 用户数量限制 + */ + private Integer userNumLimit; + + /** + * 租户类型,0免费租户,1付费租户 + */ + private Boolean type; + + /** + * 启用 0-禁用 1-启用 + */ + private Boolean status; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 到期时间 + */ + private LocalDateTime expireTime; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysTenantUser.java b/domain/src/main/java/com/wansensoft/entities/SysTenantUser.java new file mode 100644 index 00000000..56567ba2 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysTenantUser.java @@ -0,0 +1,95 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_tenant_user") +public class SysTenantUser implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 姓名 + */ + private String name; + + /** + * 用户名 + */ + private String userName; + + /** + * 密码 + */ + private String password; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号 + */ + private String phoneNumber; + + /** + * 状态(0-启用,1-停用) + */ + private Integer status; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysUser.java b/domain/src/main/java/com/wansensoft/entities/SysUser.java new file mode 100644 index 00000000..481597d2 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysUser.java @@ -0,0 +1,109 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 用户表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_user") +public class SysUser implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 用户姓名--例如张三 + */ + private String username; + + /** + * 登录用户名 + */ + private String loginName; + + /** + * 登陆密码 + */ + private String password; + + /** + * 是否经理,0否,1是 + */ + private Boolean leaderFlag; + + /** + * 职位 + */ + private String position; + + /** + * 所属部门 + */ + private String department; + + /** + * 电子邮箱 + */ + private String email; + + /** + * 手机号码 + */ + private String phonenum; + + /** + * 是否为管理者 0==管理者 1==员工 + */ + private Integer ismanager; + + /** + * 是否系统自带数据 + */ + private Integer isystem; + + /** + * 状态,0:正常,1:删除,2封禁 + */ + private Integer status; + + /** + * 用户描述信息 + */ + private String description; + + /** + * 备注 + */ + private String remark; + + /** + * 微信绑定 + */ + private String weixinOpenId; + + /** + * 租户id + */ + private Long tenantId; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysUserBusiness.java b/domain/src/main/java/com/wansensoft/entities/SysUserBusiness.java new file mode 100644 index 00000000..9011b791 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysUserBusiness.java @@ -0,0 +1,64 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 用户/角色/模块关系表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_user_business") +public class SysUserBusiness implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 类别 + */ + private String type; + + /** + * 主id + */ + private String keyId; + + /** + * 值 + */ + private String value; + + /** + * 按钮权限 + */ + private String btnStr; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysUserOrgRel.java b/domain/src/main/java/com/wansensoft/entities/SysUserOrgRel.java new file mode 100644 index 00000000..28f9e3c7 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysUserOrgRel.java @@ -0,0 +1,80 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 机构用户关系表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_user_org_rel") +public class SysUserOrgRel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 机构id + */ + private Long organizationId; + + /** + * 用户id + */ + private Long userId; + + /** + * 用户在所属机构中显示顺序 + */ + private String userOrganizationSort; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysUserRoleRel.java b/domain/src/main/java/com/wansensoft/entities/SysUserRoleRel.java new file mode 100644 index 00000000..1991beda --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysUserRoleRel.java @@ -0,0 +1,70 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 用户角色关系表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_user_role_rel") +public class SysUserRoleRel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 用户id + */ + private Long userId; + + /** + * 角色id + */ + private Long roleId; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SysUserWarehouseRel.java b/domain/src/main/java/com/wansensoft/entities/SysUserWarehouseRel.java new file mode 100644 index 00000000..259da55b --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SysUserWarehouseRel.java @@ -0,0 +1,70 @@ +package com.wansensoft.entities; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("sys_user_warehouse_rel") +public class SysUserWarehouseRel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 用户id + */ + private Long userId; + + /** + * 仓库id + */ + private Long warehouseId; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/SystemSupplier.java b/domain/src/main/java/com/wansensoft/entities/SystemSupplier.java new file mode 100644 index 00000000..e6464358 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/SystemSupplier.java @@ -0,0 +1,171 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 供应商/客户信息表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("supplier") +public class SystemSupplier implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 供应商名称 + */ + private String supplierName; + + /** + * 联系人 + */ + private String contact; + + /** + * 联系电话 + */ + private String contactNumber; + + /** + * 电子邮箱 + */ + private String email; + + /** + * 备注 + */ + private String remake; + + /** + * 是否系统自带 0==系统 1==非系统 + */ + private Integer isSystem; + + /** + * 类型 + */ + private String type; + + /** + * 状态(0-启用,1-停用) + */ + private Boolean status; + + /** + * 预收款 + */ + private BigDecimal advanceReceivable; + + /** + * 期初应收 + */ + private BigDecimal beginAccountReceivable; + + /** + * 期初应付 + */ + private BigDecimal beginAccountPayment; + + /** + * 累计应收 + */ + private BigDecimal totalReceivable; + + /** + * 累计应付 + */ + private BigDecimal totalPayment; + + /** + * 传真 + */ + private String fax; + + /** + * 手机 + */ + private String phoneNumber; + + /** + * 地址 + */ + private String address; + + /** + * 纳税人识别号 + */ + private String taxNumber; + + /** + * 开户行 + */ + private String bankNumber; + + /** + * 账号 + */ + private String accountNumber; + + /** + * 税率 + */ + private BigDecimal taxRate; + + /** + * 排序 + */ + private String sort; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/Warehouse.java b/domain/src/main/java/com/wansensoft/entities/Warehouse.java new file mode 100644 index 00000000..49bdb951 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/Warehouse.java @@ -0,0 +1,116 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 仓库表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("warehouse") +public class Warehouse implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 负责人 + */ + private Long principal; + + /** + * 仓库名称 + */ + private String name; + + /** + * 仓库地址 + */ + private String address; + + /** + * 仓储费 + */ + private BigDecimal warehousPrice; + + /** + * 搬运费 + */ + private BigDecimal truckage; + + /** + * 类型 + */ + private Integer type; + + /** + * 状态(0-启用,1-停用) + */ + private Boolean status; + + /** + * 描述 + */ + private String remark; + + /** + * 排序 + */ + private String sort; + + /** + * 是否默认仓库(0-启用,1-停用) + */ + private Boolean isDefault; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/WarehouseHead.java b/domain/src/main/java/com/wansensoft/entities/WarehouseHead.java new file mode 100644 index 00000000..5b40f6f6 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/WarehouseHead.java @@ -0,0 +1,196 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 单据主表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("warehouse_head") +public class WarehouseHead implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 主类型 (出库/入库) + */ + private String type; + + /** + * 子类型(采购订单/采购退货/销售订单/组装单/拆卸单) + */ + private String subType; + + /** + * 初始票据号 + */ + private String initBillNumber; + + /** + * 票据号 + */ + private String billNumber; + + /** + * 供应商id + */ + private Long supplierId; + + /** + * 账户id + */ + private Long accountId; + + /** + * 变动金额(收款/付款) + */ + private BigDecimal changeAmount; + + /** + * 找零金额 + */ + private BigDecimal backAmount; + + /** + * 合计金额 + */ + private BigDecimal totalPrice; + + /** + * 付款类型(现金、记账等) + */ + private String payType; + + /** + * 单据类型 + */ + private String billType; + + /** + * 备注 + */ + private String remark; + + /** + * 附件名称 + */ + private String fileName; + + /** + * 业务员(可以多个) + */ + private String salesMan; + + /** + * 多账户ID列表 + */ + private String accountIdList; + + /** + * 多账户金额列表 + */ + private String accountMoneyList; + + /** + * 优惠率 + */ + private BigDecimal discount; + + /** + * 优惠金额 + */ + private BigDecimal discountMoney; + + /** + * 优惠后金额 + */ + private BigDecimal discountLastMoney; + + /** + * 销售或采购费用合计 + */ + private BigDecimal otherMoney; + + /** + * 订金 + */ + private BigDecimal deposit; + + /** + * 状态,0未审核、1已审核、2完成采购|销售、3部分采购|销售、9审核中 + */ + private Boolean status; + + /** + * 采购状态,0未采购、2完成采购、3部分采购 + */ + private Boolean purchaseStatus; + + /** + * 单据来源,0-pc,1-手机 + */ + private Boolean source; + + /** + * 关联订单号 + */ + private String correlationNumber; + + /** + * 操作时间(出/入库时间) + */ + private LocalDateTime operateTime; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/domain/src/main/java/com/wansensoft/entities/WarehouseItem.java b/domain/src/main/java/com/wansensoft/entities/WarehouseItem.java new file mode 100644 index 00000000..4769c670 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/entities/WarehouseItem.java @@ -0,0 +1,176 @@ +package com.wansensoft.entities; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *

+ * 单据子表 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("warehouse_item") +public class WarehouseItem implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + private Long id; + + /** + * 租户id + */ + private Long tenantId; + + /** + * 表头Id + */ + private Long headerId; + + /** + * 商品Id + */ + private Long productId; + + /** + * 商品扩展id + */ + private Long productExtendId; + + /** + * 商品计量单位 + */ + private String productUnit; + + /** + * 多属性 + */ + private String multiAttribute; + + /** + * 数量 + */ + private BigDecimal operNumber; + + /** + * 基础数量,如kg、瓶 + */ + private BigDecimal basicNumber; + + /** + * 单价 + */ + private BigDecimal unitPrice; + + /** + * 采购单价 + */ + private BigDecimal purchaseUnitPrice; + + /** + * 含税单价 + */ + private BigDecimal taxUnitPrice; + + /** + * 金额 + */ + private BigDecimal totalPrice; + + /** + * 备注 + */ + private String remark; + + /** + * 仓库ID + */ + private Long warehouseId; + + /** + * 调拨时,对方仓库Id + */ + private Long anotherWarehouseId; + + /** + * 税率 + */ + private BigDecimal taxRate; + + /** + * 税额 + */ + private BigDecimal taxMoney; + + /** + * 价税合计 + */ + private BigDecimal taxLastMoney; + + /** + * 商品类型 + */ + private String productType; + + /** + * 序列号列表 + */ + private String serialNumbersList; + + /** + * 批次号 + */ + private String batchNumber; + + /** + * 有效日期 + */ + private LocalDateTime effectiveDate; + + /** + * 关联明细id + */ + private Long correlationId; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 修改人 + */ + private Long updateBy; + + /** + * 删除标记,0未删除,1删除 + */ + private Boolean deleteFlag; + + +} diff --git a/middleware/pom.xml b/middleware/pom.xml index bfae7d5d..8c800cf3 100644 --- a/middleware/pom.xml +++ b/middleware/pom.xml @@ -23,5 +23,11 @@ aliyun-sdk-oss 3.16.3 + + + com.baomidou + mybatis-plus-generator + 3.5.3.1 + \ No newline at end of file diff --git a/middleware/src/main/java/com/wansensoft/middleware/Main.java b/middleware/src/main/java/com/wansensoft/middleware/Main.java deleted file mode 100644 index 3e1de444..00000000 --- a/middleware/src/main/java/com/wansensoft/middleware/Main.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.wansensoft.middleware; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/middleware/src/main/java/com/wansensoft/middleware/MpCodeQuickGeneration.java b/middleware/src/main/java/com/wansensoft/middleware/MpCodeQuickGeneration.java new file mode 100644 index 00000000..ecfd3fe5 --- /dev/null +++ b/middleware/src/main/java/com/wansensoft/middleware/MpCodeQuickGeneration.java @@ -0,0 +1,37 @@ +package com.wansensoft.middleware; + +import com.baomidou.mybatisplus.generator.FastAutoGenerator; +import com.baomidou.mybatisplus.generator.config.OutputFile; +import com.baomidou.mybatisplus.generator.config.rules.DbColumnType; +import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; + +import java.sql.Types; +import java.util.Collections; + +public class MpCodeQuickGeneration { + public static void main(String[] args) { + FastAutoGenerator.create("jdbc:mysql://localhost:3306/wansenerp2?useUnicode=true&characterEncoding=utf-8&useSSL=false", "root", "PaSsw0Rd") + .globalConfig(builder -> { + builder.author("James Zow") // 设置作者 + .enableSwagger() // 开启 swagger 模式 + .fileOverride() // 覆盖已生成文件 + .outputDir("E:\\opensource\\WansenERP\\middleware\\src\\main\\resources"); // 指定输出目录 + }) + .dataSourceConfig(builder -> builder.typeConvertHandler((globalConfig, typeRegistry, metaInfo) -> { + + return typeRegistry.getColumnType(metaInfo); + + })) + .packageConfig(builder -> { + builder.parent("com.wansensoft.mappers") // 设置父包名 + .moduleName("dao") // 设置父包模块名 + .pathInfo(Collections.singletonMap(OutputFile.xml, "E:\\opensource\\WansenERP\\middleware\\src\\main\\resources")); // 设置mapperXml生成路径 + }) + .strategyConfig(builder -> { + builder.addInclude("product_attribute") // 设置需要生成的表名 + .addTablePrefix("t_", "c_"); // 设置过滤表前缀 + }) + .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板 + .execute(); + } +} \ No newline at end of file diff --git a/plugins/pom.xml b/plugins/pom.xml index b432fe83..f77a113c 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -23,6 +23,12 @@ utils 1.0-SNAPSHOT + + + + + + diff --git a/plugins/src/main/java/com/wansensoft/plugins/config/CodeGeneration.java b/plugins/src/main/java/com/wansensoft/plugins/config/CodeGeneration.java new file mode 100644 index 00000000..50db03a6 --- /dev/null +++ b/plugins/src/main/java/com/wansensoft/plugins/config/CodeGeneration.java @@ -0,0 +1,5 @@ +package com.wansensoft.plugins.config; + +public class CodeGeneration { + +} diff --git a/service/src/main/java/com/wansensoft/service/CommonService.java b/service/src/main/java/com/wansensoft/service/CommonService.java index 66f5133b..a9a4eed9 100644 --- a/service/src/main/java/com/wansensoft/service/CommonService.java +++ b/service/src/main/java/com/wansensoft/service/CommonService.java @@ -77,10 +77,6 @@ public Long getUserId(HttpServletRequest request) { return userId; } - public Role getRoleWithoutTenant(Long roleId) { - return roleMapperEx.getRoleWithoutTenant(roleId); - } - public Material getMaterial(long id) { Material result=null; try{ diff --git a/service/src/main/java/com/wansensoft/service/IIncomeExpenseService.java b/service/src/main/java/com/wansensoft/service/IIncomeExpenseService.java new file mode 100644 index 00000000..c3722725 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/IIncomeExpenseService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service; + +import com.wansensoft.entities.IncomeExpense; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 收支项目 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IIncomeExpenseService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/IOperatorService.java b/service/src/main/java/com/wansensoft/service/IOperatorService.java new file mode 100644 index 00000000..7b8ae561 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/IOperatorService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service; + +import com.wansensoft.entities.Operator; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 经手人表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IOperatorService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/ISystemSupplierService.java b/service/src/main/java/com/wansensoft/service/ISystemSupplierService.java new file mode 100644 index 00000000..83cb31a6 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/ISystemSupplierService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service; + +import com.wansensoft.entities.SystemSupplier; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 供应商/客户信息表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISystemSupplierService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/IncomeExpenseServiceImpl.java b/service/src/main/java/com/wansensoft/service/IncomeExpenseServiceImpl.java new file mode 100644 index 00000000..cf5cd056 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/IncomeExpenseServiceImpl.java @@ -0,0 +1,19 @@ +package com.wansensoft.service; + +import com.wansensoft.entities.IncomeExpense; +import com.wansensoft.mappers.IncomeExpenseMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 收支项目 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class IncomeExpenseServiceImpl extends ServiceImpl implements IIncomeExpenseService { + +} diff --git a/service/src/main/java/com/wansensoft/service/OperatorServiceImpl.java b/service/src/main/java/com/wansensoft/service/OperatorServiceImpl.java new file mode 100644 index 00000000..2e2a4215 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/OperatorServiceImpl.java @@ -0,0 +1,19 @@ +package com.wansensoft.service; + +import com.wansensoft.entities.Operator; +import com.wansensoft.mappers.OperatorMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 经手人表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class OperatorServiceImpl extends ServiceImpl implements IOperatorService { + +} diff --git a/service/src/main/java/com/wansensoft/service/SystemSupplierServiceImpl.java b/service/src/main/java/com/wansensoft/service/SystemSupplierServiceImpl.java new file mode 100644 index 00000000..b60d2c9f --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/SystemSupplierServiceImpl.java @@ -0,0 +1,19 @@ +package com.wansensoft.service; + +import com.wansensoft.entities.SystemSupplier; +import com.wansensoft.mappers.SystemSupplierMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 供应商/客户信息表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SystemSupplierServiceImpl extends ServiceImpl implements ISystemSupplierService { + +} diff --git a/service/src/main/java/com/wansensoft/service/depot/DepotService.java b/service/src/main/java/com/wansensoft/service/depot/DepotService.java index bb8ee4f7..4f2ddd7a 100644 --- a/service/src/main/java/com/wansensoft/service/depot/DepotService.java +++ b/service/src/main/java/com/wansensoft/service/depot/DepotService.java @@ -48,4 +48,6 @@ public interface DepotService extends IService { String findDepotStrByCurrentUser(); int batchSetStatus(Boolean status, String ids); + + JSONArray findDepotByCurrentUserTest(String userId); } diff --git a/service/src/main/java/com/wansensoft/service/depot/DepotServiceImpl.java b/service/src/main/java/com/wansensoft/service/depot/DepotServiceImpl.java index 98885ce8..c3d24dd1 100644 --- a/service/src/main/java/com/wansensoft/service/depot/DepotServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/depot/DepotServiceImpl.java @@ -347,6 +347,46 @@ public JSONArray findDepotByCurrentUser() { return arr; } + public JSONArray findDepotByCurrentUserTest(String userId) { + JSONArray arr = new JSONArray(); + String type = "UserDepot"; + List dataList = findUserDepot(); + //开始拼接json数据 + if (null != dataList) { + boolean depotFlag = systemConfigService.getDepotFlag(); + if(depotFlag) { + List list = userBusinessService.getBasicData(userId, type); + if(list!=null && !list.isEmpty()) { + String depotStr = list.get(0).getValue(); + if(StringUtil.isNotEmpty(depotStr)){ + depotStr = depotStr.replaceAll("\\[", "").replaceAll("]", ","); + String[] depotArr = depotStr.split(","); + for (Depot depot : dataList) { + for(String depotId: depotArr) { + if(depot.getId() == Long.parseLong(depotId)){ + JSONObject item = new JSONObject(); + item.put("id", depot.getId()); + item.put("depotName", depot.getName()); + item.put("isDefault", depot.getIsDefault()); + arr.add(item); + } + } + } + } + } + } else { + for (Depot depot : dataList) { + JSONObject item = new JSONObject(); + item.put("id", depot.getId()); + item.put("depotName", depot.getName()); + item.put("isDefault", depot.getIsDefault()); + arr.add(item); + } + } + } + return arr; + } + /** * 当前用户有权限使用的仓库列表的id,用逗号隔开 * @return diff --git a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java index 33f1e410..b93c6438 100644 --- a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java +++ b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java @@ -1,7 +1,9 @@ package com.wansensoft.service.depotHead; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; +import com.wansensoft.dto.depot.RetailOutboundDto; import com.wansensoft.entities.depot.DepotHead; import com.wansensoft.vo.DepotHeadVo4InDetail; import com.wansensoft.vo.DepotHeadVo4InOutMCount; @@ -125,4 +127,6 @@ int debtListCount(Long organId, String materialParam, String number, String begi String roleType, String status); String getBillCategory(String subType); -} + + List selectByConditionDepotHead(RetailOutboundDto retailOutboundDto); +} \ No newline at end of file diff --git a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java index 7bbfdcc8..469a33bf 100644 --- a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java @@ -2,6 +2,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wansensoft.dto.depot.RetailOutboundDto; import com.wansensoft.entities.account.AccountItem; import com.wansensoft.entities.depot.DepotHead; import com.wansensoft.entities.depot.DepotHeadExample; @@ -13,6 +14,7 @@ import com.wansensoft.mappers.depot.DepotHeadMapper; import com.wansensoft.mappers.depot.DepotHeadMapperEx; import com.wansensoft.mappers.depot.DepotItemMapperEx; +import com.wansensoft.mappers.user.UserMapper; import com.wansensoft.service.CommonService; import com.wansensoft.service.account.AccountService; import com.wansensoft.service.depot.DepotService; @@ -249,12 +251,7 @@ public String[] getDepotArray(String subType) { return depotArray; } - /** - * 根据角色类型获取操作员数组 - * @param roleType - * @return - * @throws Exception - */ + @Override public String[] getCreatorArray(String roleType) { String creator = getCreatorByRoleType(roleType); String [] creatorArray=null; @@ -297,12 +294,7 @@ public String[] getOrganArray(String subType, String purchaseStatus) { return organArray; } - /** - * 根据角色类型获取操作员 - * @param roleType - * @return - * @throws Exception - */ + @Override public String getCreatorByRoleType(String roleType) { String creator = ""; User user = userService.getCurrentUser(); @@ -1303,4 +1295,69 @@ public String getBillCategory(String subType) { return "buy"; } } + + @Override + public List selectByConditionDepotHead(RetailOutboundDto retailOutboundDto) { + if (retailOutboundDto == null) { + return null; + } + + List resList = new ArrayList<>(); + try{ + String depotIds = String.valueOf(depotService.findDepotByCurrentUserTest(String.valueOf(retailOutboundDto.getCreator()))); + String [] depotArray=depotIds.split(","); + String [] creatorArray = getCreatorArray(retailOutboundDto.getRoleType()); + String beginTime = Tools.parseDayToTime(retailOutboundDto.getBeginTime(), BusinessConstants.DAY_FIRST_TIME); + String endTime = Tools.parseDayToTime(retailOutboundDto.getEndTime(), BusinessConstants.DAY_LAST_TIME); + List list = depotHeadMapperEx + .debtList(retailOutboundDto.getOrganId(), creatorArray, retailOutboundDto.getStatus(), retailOutboundDto.getNumber(), + beginTime, endTime, retailOutboundDto.getMaterialParam(), depotArray, retailOutboundDto.getOffset(), retailOutboundDto.getRows()); + if (null != list) { + List idList = new ArrayList<>(); + for (DepotHeadVo4List dh : list) { + idList.add(dh.getId()); + } + //通过批量查询去构造map + Map materialsListMap = findMaterialsListMapByHeaderIdList(idList); + for (DepotHeadVo4List dh : list) { + if(dh.getChangeAmount() != null) { + dh.setChangeAmount(dh.getChangeAmount().abs()); + } + if(dh.getTotalPrice() != null) { + dh.setTotalPrice(dh.getTotalPrice().abs()); + } + if(dh.getDeposit() == null) { + dh.setDeposit(BigDecimal.ZERO); + } + if(dh.getOperTime() != null) { + dh.setOperTimeStr(Tools.getCenternTime(dh.getOperTime())); + } + BigDecimal discountLastMoney = dh.getDiscountLastMoney()!=null?dh.getDiscountLastMoney():BigDecimal.ZERO; + BigDecimal otherMoney = dh.getOtherMoney()!=null?dh.getOtherMoney():BigDecimal.ZERO; + BigDecimal deposit = dh.getDeposit()!=null?dh.getDeposit():BigDecimal.ZERO; + BigDecimal changeAmount = dh.getChangeAmount()!=null?dh.getChangeAmount().abs():BigDecimal.ZERO; + //本单欠款(如果退货则为负数) + dh.setNeedDebt(discountLastMoney.add(otherMoney).subtract(deposit.add(changeAmount))); + if(BusinessConstants.SUB_TYPE_PURCHASE_RETURN.equals(dh.getSubType()) || BusinessConstants.SUB_TYPE_SALES_RETURN.equals(dh.getSubType())) { + dh.setNeedDebt(BigDecimal.ZERO.subtract(dh.getNeedDebt())); + } + BigDecimal needDebt = dh.getNeedDebt()!=null?dh.getNeedDebt():BigDecimal.ZERO; + BigDecimal finishDebt = commonService.getEachAmountByBillId(dh.getId()); + finishDebt = finishDebt!=null?finishDebt:BigDecimal.ZERO; + //已收欠款 + dh.setFinishDebt(finishDebt); + //待收欠款 + dh.setDebt(needDebt.subtract(finishDebt)); + //商品信息简述 + if(materialsListMap!=null) { + dh.setMaterialsList(materialsListMap.get(dh.getId())); + } + resList.add(dh); + } + } + }catch(Exception e){ + JshException.readFail(logger, e); + } + return resList; + } } diff --git a/service/src/main/java/com/wansensoft/service/financial/FinancialAccountServiceImpl.java b/service/src/main/java/com/wansensoft/service/financial/FinancialAccountServiceImpl.java new file mode 100644 index 00000000..24842b67 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/financial/FinancialAccountServiceImpl.java @@ -0,0 +1,19 @@ +package com.wansensoft.service.financial; + +import com.wansensoft.entities.FinancialAccount; +import com.wansensoft.mappers.financial.FinancialAccountMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 账户信息 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class FinancialAccountServiceImpl extends ServiceImpl implements IFinancialAccountService { + +} diff --git a/service/src/main/java/com/wansensoft/service/financial/FinancialMainServiceImpl.java b/service/src/main/java/com/wansensoft/service/financial/FinancialMainServiceImpl.java new file mode 100644 index 00000000..2c790023 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/financial/FinancialMainServiceImpl.java @@ -0,0 +1,19 @@ +package com.wansensoft.service.financial; + +import com.wansensoft.entities.FinancialMain; +import com.wansensoft.mappers.financial.FinancialMainMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 财务主表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class FinancialMainServiceImpl extends ServiceImpl implements IFinancialMainService { + +} diff --git a/service/src/main/java/com/wansensoft/service/financial/FinancialSubServiceImpl.java b/service/src/main/java/com/wansensoft/service/financial/FinancialSubServiceImpl.java new file mode 100644 index 00000000..769a5e03 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/financial/FinancialSubServiceImpl.java @@ -0,0 +1,19 @@ +package com.wansensoft.service.financial; + +import com.wansensoft.entities.FinancialSub; +import com.wansensoft.mappers.financial.FinancialSubMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 财务子表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class FinancialSubServiceImpl extends ServiceImpl implements IFinancialSubService { + +} diff --git a/service/src/main/java/com/wansensoft/service/financial/IFinancialAccountService.java b/service/src/main/java/com/wansensoft/service/financial/IFinancialAccountService.java new file mode 100644 index 00000000..c83afaf4 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/financial/IFinancialAccountService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.financial; + +import com.wansensoft.entities.FinancialAccount; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 账户信息 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IFinancialAccountService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/financial/IFinancialMainService.java b/service/src/main/java/com/wansensoft/service/financial/IFinancialMainService.java new file mode 100644 index 00000000..189297ee --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/financial/IFinancialMainService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.financial; + +import com.wansensoft.entities.FinancialMain; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 财务主表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IFinancialMainService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/financial/IFinancialSubService.java b/service/src/main/java/com/wansensoft/service/financial/IFinancialSubService.java new file mode 100644 index 00000000..b38f279c --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/financial/IFinancialSubService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.financial; + +import com.wansensoft.entities.FinancialSub; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 财务子表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IFinancialSubService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/IProductAttributeService.java b/service/src/main/java/com/wansensoft/service/product/IProductAttributeService.java new file mode 100644 index 00000000..c5f9f16f --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/IProductAttributeService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.product; + +import com.wansensoft.entities.ProductAttribute; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 产品属性表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IProductAttributeService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/IProductCategoryService.java b/service/src/main/java/com/wansensoft/service/product/IProductCategoryService.java new file mode 100644 index 00000000..1e02a785 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/IProductCategoryService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.product; + +import com.wansensoft.entities.ProductCategory; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 产品类型表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IProductCategoryService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/IProductExtendPriceService.java b/service/src/main/java/com/wansensoft/service/product/IProductExtendPriceService.java new file mode 100644 index 00000000..fe87850d --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/IProductExtendPriceService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.product; + +import com.wansensoft.entities.ProductExtendPrice; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 产品价格扩展 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IProductExtendPriceService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/IProductExtendPropertyService.java b/service/src/main/java/com/wansensoft/service/product/IProductExtendPropertyService.java new file mode 100644 index 00000000..cf644a70 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/IProductExtendPropertyService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.product; + +import com.wansensoft.entities.ProductExtendProperty; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 产品扩展字段表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IProductExtendPropertyService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/IProductInventoryCurrentService.java b/service/src/main/java/com/wansensoft/service/product/IProductInventoryCurrentService.java new file mode 100644 index 00000000..0fc3f347 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/IProductInventoryCurrentService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.product; + +import com.wansensoft.entities.ProductInventoryCurrent; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 产品当前库存 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IProductInventoryCurrentService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/IProductInventoryInitialService.java b/service/src/main/java/com/wansensoft/service/product/IProductInventoryInitialService.java new file mode 100644 index 00000000..bb178baa --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/IProductInventoryInitialService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.product; + +import com.wansensoft.entities.ProductInventoryInitial; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 产品初始库存 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IProductInventoryInitialService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/IProductService.java b/service/src/main/java/com/wansensoft/service/product/IProductService.java new file mode 100644 index 00000000..463b98a8 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/IProductService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.product; + +import com.wansensoft.entities.Product; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 产品表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IProductService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/IProductUnitService.java b/service/src/main/java/com/wansensoft/service/product/IProductUnitService.java new file mode 100644 index 00000000..2ef5bc6f --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/IProductUnitService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.product; + +import com.wansensoft.entities.ProductUnit; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 多单位表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IProductUnitService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductAttributeServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductAttributeServiceImpl.java new file mode 100644 index 00000000..8cda6451 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductAttributeServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.product.impl; + +import com.wansensoft.service.product.IProductAttributeService; +import com.wansensoft.entities.ProductAttribute; +import com.wansensoft.mappers.product.ProductAttributeMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 产品属性表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class ProductAttributeServiceImpl extends ServiceImpl implements IProductAttributeService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductCategoryServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductCategoryServiceImpl.java new file mode 100644 index 00000000..fe88d44b --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductCategoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.product.impl; + +import com.wansensoft.service.product.IProductCategoryService; +import com.wansensoft.entities.ProductCategory; +import com.wansensoft.mappers.product.ProductCategoryMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 产品类型表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class ProductCategoryServiceImpl extends ServiceImpl implements IProductCategoryService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPriceServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPriceServiceImpl.java new file mode 100644 index 00000000..aa063152 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPriceServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.product.impl; + +import com.wansensoft.service.product.IProductExtendPriceService; +import com.wansensoft.entities.ProductExtendPrice; +import com.wansensoft.mappers.product.ProductExtendPriceMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 产品价格扩展 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class ProductExtendPriceServiceImpl extends ServiceImpl implements IProductExtendPriceService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPropertyServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPropertyServiceImpl.java new file mode 100644 index 00000000..d12301a5 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPropertyServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.product.impl; + +import com.wansensoft.service.product.IProductExtendPropertyService; +import com.wansensoft.entities.ProductExtendProperty; +import com.wansensoft.mappers.product.ProductExtendPropertyMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 产品扩展字段表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class ProductExtendPropertyServiceImpl extends ServiceImpl implements IProductExtendPropertyService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryCurrentServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryCurrentServiceImpl.java new file mode 100644 index 00000000..d294218a --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryCurrentServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.product.impl; + +import com.wansensoft.service.product.IProductInventoryCurrentService; +import com.wansensoft.entities.ProductInventoryCurrent; +import com.wansensoft.mappers.product.ProductInventoryCurrentMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 产品当前库存 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class ProductInventoryCurrentServiceImpl extends ServiceImpl implements IProductInventoryCurrentService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryInitialServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryInitialServiceImpl.java new file mode 100644 index 00000000..e8603396 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryInitialServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.product.impl; + +import com.wansensoft.service.product.IProductInventoryInitialService; +import com.wansensoft.entities.ProductInventoryInitial; +import com.wansensoft.mappers.product.ProductInventoryInitialMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 产品初始库存 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class ProductInventoryInitialServiceImpl extends ServiceImpl implements IProductInventoryInitialService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductServiceImpl.java new file mode 100644 index 00000000..0fb8d4fa --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.product.impl; + +import com.wansensoft.service.product.IProductService; +import com.wansensoft.entities.Product; +import com.wansensoft.mappers.product.ProductMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 产品表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class ProductServiceImpl extends ServiceImpl implements IProductService { + +} diff --git a/service/src/main/java/com/wansensoft/service/product/impl/ProductUnitServiceImpl.java b/service/src/main/java/com/wansensoft/service/product/impl/ProductUnitServiceImpl.java new file mode 100644 index 00000000..bda19603 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/product/impl/ProductUnitServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.product.impl; + +import com.wansensoft.service.product.IProductUnitService; +import com.wansensoft.entities.ProductUnit; +import com.wansensoft.mappers.product.ProductUnitMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 多单位表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class ProductUnitServiceImpl extends ServiceImpl implements IProductUnitService { + +} diff --git a/service/src/main/java/com/wansensoft/service/role/ISysRoleMenuRelService.java b/service/src/main/java/com/wansensoft/service/role/ISysRoleMenuRelService.java new file mode 100644 index 00000000..75fe761d --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/role/ISysRoleMenuRelService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.role; + +import com.wansensoft.entities.SysRoleMenuRel; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 角色菜单关系表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysRoleMenuRelService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/role/ISysRoleService.java b/service/src/main/java/com/wansensoft/service/role/ISysRoleService.java new file mode 100644 index 00000000..eddef6e4 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/role/ISysRoleService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.role; + +import com.wansensoft.entities.SysRole; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 角色表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysRoleService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/role/SysRoleMenuRelServiceImpl.java b/service/src/main/java/com/wansensoft/service/role/SysRoleMenuRelServiceImpl.java new file mode 100644 index 00000000..c1924b3f --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/role/SysRoleMenuRelServiceImpl.java @@ -0,0 +1,19 @@ +package com.wansensoft.service.role; + +import com.wansensoft.entities.SysRoleMenuRel; +import com.wansensoft.mappers.role.SysRoleMenuRelMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 角色菜单关系表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysRoleMenuRelServiceImpl extends ServiceImpl implements ISysRoleMenuRelService { + +} diff --git a/service/src/main/java/com/wansensoft/service/role/SysRoleServiceImpl.java b/service/src/main/java/com/wansensoft/service/role/SysRoleServiceImpl.java new file mode 100644 index 00000000..dec316ec --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/role/SysRoleServiceImpl.java @@ -0,0 +1,19 @@ +package com.wansensoft.service.role; + +import com.wansensoft.entities.SysRole; +import com.wansensoft.mappers.role.SysRoleMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 角色表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysRoleServiceImpl extends ServiceImpl implements ISysRoleService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/ISysConfigService.java b/service/src/main/java/com/wansensoft/service/system/ISysConfigService.java new file mode 100644 index 00000000..e8a9527a --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/ISysConfigService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.system; + +import com.wansensoft.entities.SysConfig; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 系统参数 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysConfigService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/ISysLogService.java b/service/src/main/java/com/wansensoft/service/system/ISysLogService.java new file mode 100644 index 00000000..ddf73ed3 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/ISysLogService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.system; + +import com.wansensoft.entities.SysLog; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 操作日志 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysLogService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/ISysMenuService.java b/service/src/main/java/com/wansensoft/service/system/ISysMenuService.java new file mode 100644 index 00000000..35d82369 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/ISysMenuService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.system; + +import com.wansensoft.entities.SysMenu; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 功能模块表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysMenuService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/ISysMsgService.java b/service/src/main/java/com/wansensoft/service/system/ISysMsgService.java new file mode 100644 index 00000000..17c9f321 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/ISysMsgService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.system; + +import com.wansensoft.entities.SysMsg; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 消息表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysMsgService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/ISysOrganizationService.java b/service/src/main/java/com/wansensoft/service/system/ISysOrganizationService.java new file mode 100644 index 00000000..dd4bb5e8 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/ISysOrganizationService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.system; + +import com.wansensoft.entities.SysOrganization; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 机构表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysOrganizationService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/ISysPlatformConfigService.java b/service/src/main/java/com/wansensoft/service/system/ISysPlatformConfigService.java new file mode 100644 index 00000000..34541cc8 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/ISysPlatformConfigService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.system; + +import com.wansensoft.entities.SysPlatformConfig; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 平台参数 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysPlatformConfigService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/ISysSerialNumberService.java b/service/src/main/java/com/wansensoft/service/system/ISysSerialNumberService.java new file mode 100644 index 00000000..d9b5d0e5 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/ISysSerialNumberService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.system; + +import com.wansensoft.entities.SysSerialNumber; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 序列号表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysSerialNumberService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysConfigServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysConfigServiceImpl.java new file mode 100644 index 00000000..4852383e --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysConfigServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.system.impl; + +import com.wansensoft.service.system.ISysConfigService; +import com.wansensoft.entities.SysConfig; +import com.wansensoft.mappers.system.SysConfigMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 系统参数 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysConfigServiceImpl extends ServiceImpl implements ISysConfigService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysLogServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysLogServiceImpl.java new file mode 100644 index 00000000..8b14721f --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysLogServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.system.impl; + +import com.wansensoft.service.system.ISysLogService; +import com.wansensoft.entities.SysLog; +import com.wansensoft.mappers.system.SysLogMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 操作日志 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysLogServiceImpl extends ServiceImpl implements ISysLogService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysMenuServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysMenuServiceImpl.java new file mode 100644 index 00000000..a02f7611 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysMenuServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.system.impl; + +import com.wansensoft.service.system.ISysMenuService; +import com.wansensoft.entities.SysMenu; +import com.wansensoft.mappers.system.SysMenuMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 功能模块表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysMenuServiceImpl extends ServiceImpl implements ISysMenuService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysMsgServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysMsgServiceImpl.java new file mode 100644 index 00000000..5f0728b2 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysMsgServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.system.impl; + +import com.wansensoft.service.system.ISysMsgService; +import com.wansensoft.entities.SysMsg; +import com.wansensoft.mappers.system.SysMsgMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 消息表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysMsgServiceImpl extends ServiceImpl implements ISysMsgService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysOrganizationServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysOrganizationServiceImpl.java new file mode 100644 index 00000000..7d2f530e --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysOrganizationServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.system.impl; + +import com.wansensoft.service.system.ISysOrganizationService; +import com.wansensoft.entities.SysOrganization; +import com.wansensoft.mappers.system.SysOrganizationMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 机构表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysOrganizationServiceImpl extends ServiceImpl implements ISysOrganizationService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysPlatformConfigServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysPlatformConfigServiceImpl.java new file mode 100644 index 00000000..f40e006d --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysPlatformConfigServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.system.impl; + +import com.wansensoft.service.system.ISysPlatformConfigService; +import com.wansensoft.entities.SysPlatformConfig; +import com.wansensoft.mappers.system.SysPlatformConfigMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 平台参数 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysPlatformConfigServiceImpl extends ServiceImpl implements ISysPlatformConfigService { + +} diff --git a/service/src/main/java/com/wansensoft/service/system/impl/SysSerialNumberServiceImpl.java b/service/src/main/java/com/wansensoft/service/system/impl/SysSerialNumberServiceImpl.java new file mode 100644 index 00000000..2ac65da3 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/system/impl/SysSerialNumberServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.system.impl; + +import com.wansensoft.service.system.ISysSerialNumberService; +import com.wansensoft.entities.SysSerialNumber; +import com.wansensoft.mappers.system.SysSerialNumberMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 序列号表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysSerialNumberServiceImpl extends ServiceImpl implements ISysSerialNumberService { + +} diff --git a/service/src/main/java/com/wansensoft/service/tenant/ISysTenantService.java b/service/src/main/java/com/wansensoft/service/tenant/ISysTenantService.java new file mode 100644 index 00000000..86f29946 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/tenant/ISysTenantService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.tenant; + +import com.wansensoft.entities.SysTenant; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 租户 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysTenantService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/tenant/ISysTenantUserService.java b/service/src/main/java/com/wansensoft/service/tenant/ISysTenantUserService.java new file mode 100644 index 00000000..415c1ab0 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/tenant/ISysTenantUserService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.tenant; + +import com.wansensoft.entities.SysTenantUser; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysTenantUserService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantServiceImpl.java b/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantServiceImpl.java new file mode 100644 index 00000000..925ef101 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.tenant.impl; + +import com.wansensoft.service.tenant.ISysTenantService; +import com.wansensoft.entities.SysTenant; +import com.wansensoft.mappers.tenant.SysTenantMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 租户 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysTenantServiceImpl extends ServiceImpl implements ISysTenantService { + +} diff --git a/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantUserServiceImpl.java b/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantUserServiceImpl.java new file mode 100644 index 00000000..d81ea292 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantUserServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.tenant.impl; + +import com.wansensoft.service.tenant.ISysTenantUserService; +import com.wansensoft.entities.SysTenantUser; +import com.wansensoft.mappers.tenant.SysTenantUserMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysTenantUserServiceImpl extends ServiceImpl implements ISysTenantUserService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/ISysUserBusinessService.java b/service/src/main/java/com/wansensoft/service/user/ISysUserBusinessService.java new file mode 100644 index 00000000..1895ce32 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/ISysUserBusinessService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.user; + +import com.wansensoft.entities.SysUserBusiness; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 用户/角色/模块关系表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysUserBusinessService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/ISysUserOrgRelService.java b/service/src/main/java/com/wansensoft/service/user/ISysUserOrgRelService.java new file mode 100644 index 00000000..5c3a7128 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/ISysUserOrgRelService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.user; + +import com.wansensoft.entities.SysUserOrgRel; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 机构用户关系表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysUserOrgRelService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/ISysUserRoleRelService.java b/service/src/main/java/com/wansensoft/service/user/ISysUserRoleRelService.java new file mode 100644 index 00000000..18255005 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/ISysUserRoleRelService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.user; + +import com.wansensoft.entities.SysUserRoleRel; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 用户角色关系表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysUserRoleRelService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/ISysUserService.java b/service/src/main/java/com/wansensoft/service/user/ISysUserService.java new file mode 100644 index 00000000..6667570d --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/ISysUserService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.user; + +import com.wansensoft.entities.SysUser; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 用户表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysUserService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/ISysUserWarehouseRelService.java b/service/src/main/java/com/wansensoft/service/user/ISysUserWarehouseRelService.java new file mode 100644 index 00000000..afac8540 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/ISysUserWarehouseRelService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.user; + +import com.wansensoft.entities.SysUserWarehouseRel; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface ISysUserWarehouseRelService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/UserServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/UserServiceImpl.java index 3fcb3c3c..0ed59b52 100644 --- a/service/src/main/java/com/wansensoft/service/user/UserServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/user/UserServiceImpl.java @@ -9,6 +9,8 @@ import com.wansensoft.entities.user.UserBusiness; import com.wansensoft.entities.user.UserEx; import com.wansensoft.entities.user.UserExample; +import com.wansensoft.mappers.role.RoleMapper; +import com.wansensoft.mappers.role.RoleMapperEx; import com.wansensoft.mappers.user.UserMapper; import com.wansensoft.mappers.user.UserMapperEx; import com.wansensoft.service.CommonService; @@ -17,13 +19,13 @@ import com.wansensoft.service.orgaUserRel.OrgaUserRelService; import com.wansensoft.service.platformConfig.PlatformConfigService; import com.wansensoft.service.redis.RedisService; -import com.wansensoft.service.role.RoleService; import com.wansensoft.service.tenant.TenantService; import com.wansensoft.service.userBusiness.UserBusinessService; import com.wansensoft.utils.HttpClient; import com.wansensoft.utils.ExceptionCodeConstants; import com.wansensoft.utils.StringUtil; import com.wansensoft.utils.Tools; +import com.wansensoft.utils.redis.RedisUtil; import com.wansensoft.vo.TreeNodeEx; import org.springframework.util.StringUtils; import com.alibaba.fastjson.JSONArray; @@ -53,19 +55,20 @@ public class UserServiceImpl extends ServiceImpl implements Us private final LogService logService; private final TenantService tenantService; private final UserBusinessService userBusinessService; - private final CommonService commonService; private final FunctionService functionService; private final PlatformConfigService platformConfigService; private final RedisService redisService; - public UserServiceImpl(UserMapper userMapper, UserMapperEx userMapperEx, OrgaUserRelService orgaUserRelService, LogService logService, TenantService tenantService, UserBusinessService userBusinessService, CommonService commonService, FunctionService functionService, PlatformConfigService platformConfigService, RedisService redisService) { + private final RoleMapperEx roleMapperEx; + + public UserServiceImpl(UserMapper userMapper, UserMapperEx userMapperEx, OrgaUserRelService orgaUserRelService, LogService logService, TenantService tenantService, UserBusinessService userBusinessService, FunctionService functionService, PlatformConfigService platformConfigService, RedisService redisService, RoleMapperEx roleMapperEx) { this.userMapper = userMapper; this.userMapperEx = userMapperEx; this.orgaUserRelService = orgaUserRelService; this.logService = logService; this.tenantService = tenantService; this.userBusinessService = userBusinessService; - this.commonService = commonService; + this.roleMapperEx = roleMapperEx; this.functionService = functionService; this.platformConfigService = platformConfigService; this.redisService = redisService; @@ -762,13 +765,13 @@ public List getOrganizationUserTree() { */ @Transactional(value = "transactionManager", rollbackFor = Exception.class) public Role getRoleTypeByUserId(long userId) { - Role role = new Role(); + List list = userBusinessService.getBasicData(String.valueOf(userId), "UserRole"); + String roleId = "null"; UserBusiness ub = null; if(!list.isEmpty()) { ub = list.get(0); String values = ub.getValue(); - String roleId = null; if(values!=null) { values = values.replaceAll("\\[\\]",",").replace("[","").replace("]",""); } @@ -776,8 +779,8 @@ public Role getRoleTypeByUserId(long userId) { if(valueArray.length>0) { roleId = valueArray[0]; } - role = commonService.getRoleWithoutTenant(Long.parseLong(roleId)); } + Role role = roleMapperEx.getRoleWithoutTenant(Long.valueOf(roleId)); return role; } diff --git a/service/src/main/java/com/wansensoft/service/user/impl/SysUserBusinessServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/impl/SysUserBusinessServiceImpl.java new file mode 100644 index 00000000..e32608dd --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/impl/SysUserBusinessServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.user.impl; + +import com.wansensoft.entities.SysUserBusiness; +import com.wansensoft.mappers.user.SysUserBusinessMapper; +import com.wansensoft.service.user.ISysUserBusinessService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 用户/角色/模块关系表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysUserBusinessServiceImpl extends ServiceImpl implements ISysUserBusinessService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/impl/SysUserOrgRelServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/impl/SysUserOrgRelServiceImpl.java new file mode 100644 index 00000000..61eb317b --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/impl/SysUserOrgRelServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.user.impl; + +import com.wansensoft.entities.SysUserOrgRel; +import com.wansensoft.mappers.user.SysUserOrgRelMapper; +import com.wansensoft.service.user.ISysUserOrgRelService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 机构用户关系表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysUserOrgRelServiceImpl extends ServiceImpl implements ISysUserOrgRelService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/impl/SysUserRoleRelServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/impl/SysUserRoleRelServiceImpl.java new file mode 100644 index 00000000..f19296d4 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/impl/SysUserRoleRelServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.user.impl; + +import com.wansensoft.entities.SysUserRoleRel; +import com.wansensoft.mappers.user.SysUserRoleRelMapper; +import com.wansensoft.service.user.ISysUserRoleRelService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 用户角色关系表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysUserRoleRelServiceImpl extends ServiceImpl implements ISysUserRoleRelService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/impl/SysUserServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/impl/SysUserServiceImpl.java new file mode 100644 index 00000000..741050c4 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/impl/SysUserServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.user.impl; + +import com.wansensoft.entities.SysUser; +import com.wansensoft.mappers.user.SysUserMapper; +import com.wansensoft.service.user.ISysUserService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 用户表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysUserServiceImpl extends ServiceImpl implements ISysUserService { + +} diff --git a/service/src/main/java/com/wansensoft/service/user/impl/SysUserWarehouseRelServiceImpl.java b/service/src/main/java/com/wansensoft/service/user/impl/SysUserWarehouseRelServiceImpl.java new file mode 100644 index 00000000..99bd1687 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/user/impl/SysUserWarehouseRelServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.user.impl; + +import com.wansensoft.entities.SysUserWarehouseRel; +import com.wansensoft.mappers.user.SysUserWarehouseRelMapper; +import com.wansensoft.service.user.ISysUserWarehouseRelService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class SysUserWarehouseRelServiceImpl extends ServiceImpl implements ISysUserWarehouseRelService { + +} diff --git a/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseHeadService.java b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseHeadService.java new file mode 100644 index 00000000..71735ce5 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseHeadService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.warehouse; + +import com.wansensoft.entities.WarehouseHead; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 单据主表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IWarehouseHeadService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseItemService.java b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseItemService.java new file mode 100644 index 00000000..f2cef037 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseItemService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.warehouse; + +import com.wansensoft.entities.WarehouseItem; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 单据子表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IWarehouseItemService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseService.java b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseService.java new file mode 100644 index 00000000..23be2a9a --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/warehouse/IWarehouseService.java @@ -0,0 +1,16 @@ +package com.wansensoft.service.warehouse; + +import com.wansensoft.entities.Warehouse; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 仓库表 服务类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +public interface IWarehouseService extends IService { + +} diff --git a/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseHeadServiceImpl.java b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseHeadServiceImpl.java new file mode 100644 index 00000000..fc3b0e16 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseHeadServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.warehouse.impl; + +import com.wansensoft.service.warehouse.IWarehouseHeadService; +import com.wansensoft.entities.WarehouseHead; +import com.wansensoft.mappers.warehouse.WarehouseHeadMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 单据主表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class WarehouseHeadServiceImpl extends ServiceImpl implements IWarehouseHeadService { + +} diff --git a/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseItemServiceImpl.java b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseItemServiceImpl.java new file mode 100644 index 00000000..155cf634 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseItemServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.warehouse.impl; + +import com.wansensoft.service.warehouse.IWarehouseItemService; +import com.wansensoft.entities.WarehouseItem; +import com.wansensoft.mappers.warehouse.WarehouseItemMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 单据子表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class WarehouseItemServiceImpl extends ServiceImpl implements IWarehouseItemService { + +} diff --git a/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseServiceImpl.java b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseServiceImpl.java new file mode 100644 index 00000000..03110eb1 --- /dev/null +++ b/service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseServiceImpl.java @@ -0,0 +1,20 @@ +package com.wansensoft.service.warehouse.impl; + +import com.wansensoft.service.warehouse.IWarehouseService; +import com.wansensoft.entities.Warehouse; +import com.wansensoft.mappers.warehouse.WarehouseMapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 仓库表 服务实现类 + *

+ * + * @author James Zow + * @since 2023-09-05 + */ +@Service +public class WarehouseServiceImpl extends ServiceImpl implements IWarehouseService { + +} diff --git a/utils/src/main/java/com/wansensoft/utils/AnnotationUtils.java b/utils/src/main/java/com/wansensoft/utils/AnnotationUtils.java index 4640d4d3..5be90600 100644 --- a/utils/src/main/java/com/wansensoft/utils/AnnotationUtils.java +++ b/utils/src/main/java/com/wansensoft/utils/AnnotationUtils.java @@ -4,7 +4,7 @@ import java.lang.annotation.Documented; /** - * @author jishenghua qq752718920 2018-10-7 15:26:27 + * */ public class AnnotationUtils { public static A getAnnotation(Class cls, Class annotationClass) { diff --git a/utils/src/main/java/com/wansensoft/utils/JsonUtils.java b/utils/src/main/java/com/wansensoft/utils/JsonUtils.java deleted file mode 100644 index 84943da6..00000000 --- a/utils/src/main/java/com/wansensoft/utils/JsonUtils.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.wansensoft.utils; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - -/** - * Created by jishenghua 2018-5-11 09:48:08 - * - * @author jishenghua - */ -public class JsonUtils { - - public static JSONObject ok(){ - JSONObject obj = new JSONObject(); - JSONObject tmp = new JSONObject(); - tmp.put("message", "成功"); - obj.put("code", 200); - obj.put("data", tmp); - return obj; - } - -} diff --git a/utils/src/main/java/com/wansensoft/utils/ParamUtils.java b/utils/src/main/java/com/wansensoft/utils/ParamUtils.java index a8ff3832..a3855b3f 100644 --- a/utils/src/main/java/com/wansensoft/utils/ParamUtils.java +++ b/utils/src/main/java/com/wansensoft/utils/ParamUtils.java @@ -15,7 +15,7 @@ public static String getPageOffset(Integer currentPage, Integer pageSize) { if (offset <= 0) { return "0"; } else { - return new StringBuffer().append(offset).toString(); + return String.valueOf(offset); } } return null; diff --git a/utils/src/main/java/com/wansensoft/utils/Response.java b/utils/src/main/java/com/wansensoft/utils/Response.java new file mode 100644 index 00000000..9d968b88 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/Response.java @@ -0,0 +1,80 @@ +package com.wansensoft.utils; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.wansensoft.utils.enums.CodeEnum; + +import java.io.Serial; +import java.io.Serializable; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Response implements Serializable { + + @Serial + private static final long serialVersionUID = 793034041048451317L; + + private String msg; + + private String code; + + private T data; + + public static Response success() { + return responseMsg(CodeEnum.SUCCESS); + } + + public static Response fail() { + return responseMsg(CodeEnum.ERROR); + } + + public static Response responseMsg(CodeEnum codeEnum) { + Response baseResponse = new Response(); + baseResponse.setCode(codeEnum.getCode()); + baseResponse.setMsg(codeEnum.getMsg()); + return baseResponse; + } + + public static Response responseMsg(String code, String msg) { + Response baseResponse = new Response(); + baseResponse.setCode(code); + baseResponse.setMsg(msg); + return baseResponse; + } + + public static Response responseData(T data) { + Response baseResponse = new Response(); + baseResponse.setCode(CodeEnum.SUCCESS.getCode()); + baseResponse.setData(data); + return baseResponse; + } + + public static Response responseData(String code, T data) { + Response baseResponse = new Response(); + baseResponse.setCode(code); + baseResponse.setData(data); + return baseResponse; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/ResponseCode.java b/utils/src/main/java/com/wansensoft/utils/ResponseCode.java index 5fc3e4a9..fe75d4e7 100644 --- a/utils/src/main/java/com/wansensoft/utils/ResponseCode.java +++ b/utils/src/main/java/com/wansensoft/utils/ResponseCode.java @@ -3,22 +3,18 @@ import com.alibaba.fastjson.annotation.JSONCreator; import com.alibaba.fastjson.annotation.JSONField; -/** - * @author jishenghua qq752718920 2018-10-7 15:26:27 - */ + public class ResponseCode { public final int code; public final Object data; - /** - * - * @param code - * @param data - */ + + + @JSONCreator public ResponseCode(@JSONField(name = "code") int code, @JSONField(name = "data")Object data) { this.code = code; this.data = data; } -} \ No newline at end of file +} diff --git a/utils/src/main/java/com/wansensoft/utils/ResponseJsonUtil.java b/utils/src/main/java/com/wansensoft/utils/ResponseJsonUtil.java index f9fa8748..d6de6ce8 100644 --- a/utils/src/main/java/com/wansensoft/utils/ResponseJsonUtil.java +++ b/utils/src/main/java/com/wansensoft/utils/ResponseJsonUtil.java @@ -17,9 +17,8 @@ public class ResponseJsonUtil { FORMAT.setTimeZone(TimeZone.getTimeZone("GMT+8")); } - /** - * 响应过滤器 - */ + + public static final class ResponseFilter extends ExtJsonUtils.ExtFilter implements ValueFilter { @Override public Object process(Object object, String name, Object value) { @@ -33,11 +32,7 @@ public Object process(Object object, String name, Object value) { } } - /** - * - * @param responseCode - * @return - */ + public static String backJson4HttpApi(ResponseCode responseCode) { if (responseCode != null) { String result = JSON.toJSONString(responseCode, new ResponseFilter(), @@ -49,11 +44,8 @@ public static String backJson4HttpApi(ResponseCode responseCode) { return null; } - /** - * 验证失败的json串 - * @param code - * @return - */ + + public static String backJson4VerifyFailure(int code) { Map map = new HashMap(); map.put("message", "未通过验证"); @@ -62,11 +54,8 @@ public static String backJson4VerifyFailure(int code) { SerializerFeature.WriteNonStringKeyAsString); } - /** - * 成功的json串 - * @param responseCode - * @return - */ + + public static String backJson(ResponseCode responseCode) { if (responseCode != null) { return JSON.toJSONString(responseCode, new ResponseFilter(), diff --git a/utils/src/main/java/com/wansensoft/utils/enums/CodeEnum.java b/utils/src/main/java/com/wansensoft/utils/enums/CodeEnum.java new file mode 100644 index 00000000..c15e62c9 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/enums/CodeEnum.java @@ -0,0 +1,46 @@ +package com.wansensoft.utils.enums; + +public enum CodeEnum { + + // 一级基本宏观状态码 + SUCCESS("A0000", "系统执行成功"), + ERROR("B0001", "系统执行出错"), + // 用户类代码 + REGISTER_SUCCESS("A0001", "用户注册成功"), + USER_EXISTS("A0011", "用户名已存在"), + USER_LOGOUT("A0012", "账户注销成功"), + QUERY_DATA_EMPTY("A0404", "查询数据不存在"), + PARAMETER_NULL("C0001","请求必填参数为空"), + NOT_PERMISSION("D0000", "没有权限"); + + /** + * 响应状态码 + */ + private String code; + + /** + * 响应提示 + */ + private String msg; + + CodeEnum(String code, String msg) { + this.code = code; + this.msg = msg; + } + + public void setCode(String code) { + this.code = code; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/redis/FastJson2JsonRedisSerializer.java b/utils/src/main/java/com/wansensoft/utils/redis/FastJson2JsonRedisSerializer.java new file mode 100644 index 00000000..5c96dd04 --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/redis/FastJson2JsonRedisSerializer.java @@ -0,0 +1,57 @@ +package com.wansensoft.utils.redis; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.parser.ParserConfig; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.type.TypeFactory; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.SerializationException; +import org.springframework.util.Assert; + +import java.nio.charset.Charset; + +public class FastJson2JsonRedisSerializer implements RedisSerializer { + + private ObjectMapper objectMapper = new ObjectMapper(); + public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); + + private Class clazz; + + static { + ParserConfig.getGlobalInstance().setAutoTypeSupport(true); + //如果遇到反序列化autoType is not support错误,请添加并修改一下包名到bean文件路径 + // ParserConfig.getGlobalInstance().addAccept("com.xxxxx.xxx"); + // 或者全局配置 + ParserConfig.getGlobalInstance().setAutoTypeSupport(true); + } + public FastJson2JsonRedisSerializer(Class clazz) { + super(); + this.clazz = clazz; + } + + public byte[] serialize(T t) throws SerializationException { + if (t == null) { + return new byte[0]; + } + return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET); + } + + public T deserialize(byte[] bytes) throws SerializationException { + if (bytes == null || bytes.length <= 0) { + return null; + } + String str = new String(bytes, DEFAULT_CHARSET); + + return JSON.parseObject(str, clazz); + } + public void setObjectMapper(ObjectMapper objectMapper) { + Assert.notNull(objectMapper, "'objectMapper' must not be null"); + this.objectMapper = objectMapper; + } + + protected JavaType getJavaType(Class clazz) { + return TypeFactory.defaultInstance().constructType(clazz); + } +} diff --git a/utils/src/main/java/com/wansensoft/utils/redis/RedisConfig.java b/utils/src/main/java/com/wansensoft/utils/redis/RedisConfig.java new file mode 100644 index 00000000..9919802f --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/redis/RedisConfig.java @@ -0,0 +1,40 @@ +package com.wansensoft.utils.redis; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +@Configuration +@EnableCaching +public class RedisConfig extends CachingConfigurerSupport { + + @Bean + public RedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate<>(); + template.setConnectionFactory(connectionFactory); + + //使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值 + //Jackson2JsonRedisSerializer serializer = new Jackson2JsonRedisSerializer(Object.class); + //使用Fastjson2JsonRedisSerializer来序列化和反序列化redis的value值 + FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class); + + ObjectMapper mapper = new ObjectMapper(); + mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); + serializer.setObjectMapper(mapper); + + template.setValueSerializer(serializer); + //使用StringRedisSerializer来序列化和反序列化redis的key值 + template.setKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + return template; + } + +} diff --git a/utils/src/main/java/com/wansensoft/utils/redis/RedisUtil.java b/utils/src/main/java/com/wansensoft/utils/redis/RedisUtil.java new file mode 100644 index 00000000..b582b77d --- /dev/null +++ b/utils/src/main/java/com/wansensoft/utils/redis/RedisUtil.java @@ -0,0 +1,569 @@ +package com.wansensoft.utils.redis; + +import jakarta.annotation.Resource; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +@Component +public class RedisUtil { + + @Resource + private RedisTemplate redisTemplate; + + /** + * 指定缓存失效时间 + * + * @param key 键 + * @param time 时间(秒) + * @return + */ + public boolean expire(String key, long time) { + try { + if (time > 0) { + redisTemplate.expire(key, time, TimeUnit.SECONDS); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 根据key 获取过期时间 + * + * @param key 键 不能为null + * @return 时间(秒) 返回0代表为永久有效 + */ + public long getExpire(String key) { + return redisTemplate.getExpire(key, TimeUnit.SECONDS); + } + + /** + * 判断key是否存在 + * + * @param key 键 + * @return true 存在 false不存在 + */ + public boolean hasKey(String key) { + try { + return redisTemplate.hasKey(key); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 删除缓存 + * + * @param key 可以传一个值 或多个 + */ + @SuppressWarnings("unchecked") + public void del(String... key) { + if (key != null && key.length > 0) { + if (key.length == 1) { + redisTemplate.delete(key[0]); + } else { + redisTemplate.delete((Collection) CollectionUtils.arrayToList(key)); + } + } + } + + // ============================String============================= + /** + * 普通缓存获取 + * + * @param key 键 + * @return 值 + */ + public Object get(String key) { + return key == null ? null : redisTemplate.opsForValue().get(key); + } + + public String getString(String key) { + return key == null ? null : String.valueOf(redisTemplate.opsForValue().get(key)); + } + + /** + * 普通缓存放入 + * + * @param key 键 + * @param value 值 + * @return true成功 false失败 + */ + public boolean set(String key, Object value) { + try { + redisTemplate.opsForValue().set(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + + } + + /** + * 普通缓存放入并设置时间 + * + * @param key 键 + * @param value 值 + * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期 + * @return true成功 false 失败 + */ + public boolean set(String key, Object value, long time) { + try { + if (time > 0) { + redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); + } else { + set(key, value); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 递增 + * + * @param key 键 + * @return + */ + public long incr(String key, long delta) { + if (delta < 0) { + throw new RuntimeException("递增因子必须大于0"); + } + return redisTemplate.opsForValue().increment(key, delta); + } + + /** + * 递减 + * + * @param key 键 + * @return + */ + public long decr(String key, long delta) { + if (delta < 0) { + throw new RuntimeException("递减因子必须大于0"); + } + return redisTemplate.opsForValue().increment(key, -delta); + } + + // ================================Map================================= + /** + * HashGet + * + * @param key 键 不能为null + * @param item 项 不能为null + * @return 值 + */ + public Object hget(String key, String item) { + return redisTemplate.opsForHash().get(key, item); + } + + /** + * 获取hashKey对应的所有键值 + * + * @param key 键 + * @return 对应的多个键值 + */ + public Map hmget(String key) { + return redisTemplate.opsForHash().entries(key); + } + + /** + * HashSet + * + * @param key 键 + * @param map 对应多个键值 + * @return true 成功 false 失败 + */ + public boolean hmset(String key, Map map) { + try { + redisTemplate.opsForHash().putAll(key, map); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * HashSet 并设置时间 + * + * @param key 键 + * @param map 对应多个键值 + * @param time 时间(秒) + * @return true成功 false失败 + */ + public boolean hmset(String key, Map map, long time) { + try { + redisTemplate.opsForHash().putAll(key, map); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 向一张hash表中放入数据,如果不存在将创建 + * + * @param key 键 + * @param item 项 + * @param value 值 + * @return true 成功 false失败 + */ + public boolean hset(String key, String item, Object value) { + try { + redisTemplate.opsForHash().put(key, item, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 向一张hash表中放入数据,如果不存在将创建 + * + * @param key 键 + * @param item 项 + * @param value 值 + * @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间 + * @return true 成功 false失败 + */ + public boolean hset(String key, String item, Object value, long time) { + try { + redisTemplate.opsForHash().put(key, item, value); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 删除hash表中的值 + * + * @param key 键 不能为null + * @param item 项 可以使多个 不能为null + */ + public void hdel(String key, Object... item) { + redisTemplate.opsForHash().delete(key, item); + } + + /** + * 判断hash表中是否有该项的值 + * + * @param key 键 不能为null + * @param item 项 不能为null + * @return true 存在 false不存在 + */ + public boolean hHasKey(String key, String item) { + return redisTemplate.opsForHash().hasKey(key, item); + } + + /** + * hash递增 如果不存在,就会创建一个 并把新增后的值返回 + * + * @param key 键 + * @param item 项 + * @param by 要增加几(大于0) + * @return + */ + public double hincr(String key, String item, double by) { + return redisTemplate.opsForHash().increment(key, item, by); + } + + /** + * hash递减 + * + * @param key 键 + * @param item 项 + * @param by 要减少记(小于0) + * @return + */ + public double hdecr(String key, String item, double by) { + return redisTemplate.opsForHash().increment(key, item, -by); + } + + // ============================set============================= + /** + * 根据key获取Set中的所有值 + * + * @param key 键 + * @return + */ + public Set sGet(String key) { + try { + return redisTemplate.opsForSet().members(key); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 根据value从一个set中查询,是否存在 + * + * @param key 键 + * @param value 值 + * @return true 存在 false不存在 + */ + public boolean sHasKey(String key, Object value) { + try { + return redisTemplate.opsForSet().isMember(key, value); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将数据放入set缓存 + * + * @param key 键 + * @param values 值 可以是多个 + * @return 成功个数 + */ + public long sSet(String key, Object... values) { + try { + return redisTemplate.opsForSet().add(key, values); + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 将set数据放入缓存 + * + * @param key 键 + * @param time 时间(秒) + * @param values 值 可以是多个 + * @return 成功个数 + */ + public long sSetAndTime(String key, long time, Object... values) { + try { + Long count = redisTemplate.opsForSet().add(key, values); + if (time > 0) { + expire(key, time); + } + return count; + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 获取set缓存的长度 + * + * @param key 键 + * @return + */ + public long sGetSetSize(String key) { + try { + return redisTemplate.opsForSet().size(key); + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 移除值为value的 + * + * @param key 键 + * @param values 值 可以是多个 + * @return 移除的个数 + */ + public long setRemove(String key, Object... values) { + try { + Long count = redisTemplate.opsForSet().remove(key, values); + return count; + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + // ===============================list================================= + + /** + * 获取list缓存的内容 + * + * @param key 键 + * @param start 开始 + * @param end 结束 0 到 -1代表所有值 + * @return + */ + public List lGet(String key, long start, long end) { + try { + return redisTemplate.opsForList().range(key, start, end); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 获取list缓存的长度 + * + * @param key 键 + * @return + */ + public long lGetListSize(String key) { + try { + return redisTemplate.opsForList().size(key); + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 通过索引 获取list中的值 + * + * @param key 键 + * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推 + * @return + */ + public Object lGetIndex(String key, long index) { + try { + return redisTemplate.opsForList().index(key, index); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 将list放入缓存 + * + * @param key 键 + * @param value 值 + * @return + */ + public boolean lSet(String key, Object value) { + try { + redisTemplate.opsForList().rightPush(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将list放入缓存 + * + * @param key 键 + * @param value 值 + * @param time 时间(秒) + * @return + */ + public boolean lSet(String key, Object value, long time) { + try { + redisTemplate.opsForList().rightPush(key, value); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将list放入缓存 + * + * @param key 键 + * @param value 值 + * @param time 时间(秒) + * @return + */ + public boolean lSet(String key, List value) { + try { + redisTemplate.opsForList().rightPushAll(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将list放入缓存 + * + * @param key 键 + * @param value 值 + * @param time 时间(秒) + * @return + */ + public boolean lSet(String key, List value, long time) { + try { + redisTemplate.opsForList().rightPushAll(key, value); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 根据索引修改list中的某条数据 + * + * @param key 键 + * @param index 索引 + * @param value 值 + * @return + */ + public boolean lUpdateIndex(String key, long index, Object value) { + try { + redisTemplate.opsForList().set(key, index, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 移除N个值为value + * + * @param key 键 + * @param count + * @param value 值 + * @return 移除的个数 + */ + public long lRemove(String key, long count, Object value) { + try { + Long remove = redisTemplate.opsForList().remove(key, count, value); + return remove; + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + +}