From c6667e0e3ac42f628bc87b0fbfed5f5c1d0a1a6e Mon Sep 17 00:00:00 2001 From: jameszow Date: Mon, 4 Sep 2023 20:20:05 +0800 Subject: [PATCH 01/10] Api controller change --- .gitignore | 3 +- .../com/wansensoft/api/LogController.java | 43 +++++++++ .../com/wansensoft/api/MybatisPlusConfig.java | 24 +++++ .../wansensoft/api/ResourceController.java | 90 ++++++++++++------- .../api/account/AccountController.java | 15 ++-- .../api/account/AccountHeadController.java | 10 +-- .../wansensoft/api/depot/DepotController.java | 18 ++-- .../api/depot/DepotHeadController.java | 21 +++-- .../api/depot/DepotItemController.java | 7 +- .../api/function/FunctionController.java | 5 +- .../api/inOutItem/InOutItemController.java | 10 +-- .../api/material/MaterialController.java | 38 ++++---- .../api/person/PersonController.java | 9 +- .../PlatformConfigController.java | 9 +- .../wansensoft/api/role/RoleController.java | 11 +-- .../serialNumber/SerialNumberController.java | 12 ++- .../api/supplier/SupplierController.java | 15 ++-- .../api/tenant/TenantController.java | 8 +- .../wansensoft/api/unit/UnitController.java | 11 +-- .../api/user/UserBusinessController.java | 13 ++- .../wansensoft/api/user/UserController.java | 30 +++---- .../java/com/wansensoft/dto/PageSizeDto.java | 22 +++++ .../dto/depot/RetailOutboundDto.java | 51 +++++++++++ middleware/pom.xml | 6 ++ .../java/com/wansensoft/middleware/Main.java | 7 -- .../middleware/MpCodeQuickGeneration.java | 37 ++++++++ .../service/depotHead/DepotHeadService.java | 6 +- .../depotHead/DepotHeadServiceImpl.java | 67 ++++++++++++++ .../com/wansensoft/utils/AnnotationUtils.java | 2 +- .../java/com/wansensoft/utils/ErpInfo.java | 26 +++--- .../java/com/wansensoft/utils/ParamUtils.java | 2 +- .../java/com/wansensoft/utils/Response.java | 80 +++++++++++++++++ .../com/wansensoft/utils/ResponseCode.java | 14 ++- .../wansensoft/utils/ResponseJsonUtil.java | 25 ++---- .../com/wansensoft/utils/enums/CodeEnum.java | 46 ++++++++++ 35 files changed, 585 insertions(+), 208 deletions(-) create mode 100644 api/src/main/java/com/wansensoft/api/LogController.java create mode 100644 api/src/main/java/com/wansensoft/api/MybatisPlusConfig.java create mode 100644 domain/src/main/java/com/wansensoft/dto/PageSizeDto.java create mode 100644 domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java delete mode 100644 middleware/src/main/java/com/wansensoft/middleware/Main.java create mode 100644 middleware/src/main/java/com/wansensoft/middleware/MpCodeQuickGeneration.java create mode 100644 utils/src/main/java/com/wansensoft/utils/Response.java create mode 100644 utils/src/main/java/com/wansensoft/utils/enums/CodeEnum.java 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/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/MybatisPlusConfig.java b/api/src/main/java/com/wansensoft/api/MybatisPlusConfig.java new file mode 100644 index 00000000..b14ec5e7 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/MybatisPlusConfig.java @@ -0,0 +1,24 @@ +package com.wansensoft.api; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@MapperScan("com.wansensoft.mappers") +public class MybatisPlusConfig { + + /** + * 添加分页插件 + */ + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); + return interceptor; + } +} diff --git a/api/src/main/java/com/wansensoft/api/ResourceController.java b/api/src/main/java/com/wansensoft/api/ResourceController.java index ef3108d5..03d08fd3 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,34 +19,37 @@ @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获取信息") - public String getList(@PathVariable("apiName") String apiName, + public Response> getList(@PathVariable("apiName") String apiName, @RequestParam("id") Long id, HttpServletRequest request) throws Exception { Object obj = configResourceManager.selectOne(apiName, id); Map objectMap = new HashMap(); if(obj != null) { objectMap.put("info", obj); - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @GetMapping(value = "/{apiName}/list") @ApiOperation(value = "获取信息列表") - public String getList(@PathVariable("apiName") String apiName, + public Response 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(); + Map objectMap = new HashMap<>(); if (pageSize != null && pageSize <= 0) { pageSize = 10; } @@ -58,77 +61,104 @@ public String getList(@PathVariable("apiName") String apiName, if (list != null) { objectMap.put("total", configResourceManager.counts(apiName, parameterMap)); objectMap.put("rows", list); - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER); objectMap.put("rows", new ArrayList()); - return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); + return Response.responseMsg(CodeEnum.QUERY_DATA_EMPTY); } } +// @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 = "新增") - public String addResource(@PathVariable("apiName") String apiName, + public Response addResource(@PathVariable("apiName") String apiName, @RequestBody JSONObject obj, HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); int insert = configResourceManager.insert(apiName, obj, request); if(insert > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else if(insert == -1) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + return Response.responseMsg(ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @PutMapping(value = "/{apiName}/update", produces = {"application/javascript", "application/json"}) @ApiOperation(value = "修改") - public String updateResource(@PathVariable("apiName") String apiName, + public Response updateResource(@PathVariable("apiName") String apiName, @RequestBody JSONObject obj, HttpServletRequest request)throws Exception { - Map objectMap = new HashMap(); int update = configResourceManager.update(apiName, obj, request); if(update > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else if(update == -1) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + return Response.responseMsg(ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @DeleteMapping(value = "/{apiName}/delete", produces = {"application/javascript", "application/json"}) @ApiOperation(value = "删除") - public String deleteResource(@PathVariable("apiName") String apiName, + public Response deleteResource(@PathVariable("apiName") String apiName, @RequestParam("id") Long id, HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); int delete = configResourceManager.delete(apiName, id, request); if(delete > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else if(delete == -1) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + return Response.responseMsg(ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @DeleteMapping(value = "/{apiName}/deleteBatch", produces = {"application/javascript", "application/json"}) @ApiOperation(value = "批量删除") - public String batchDeleteResource(@PathVariable("apiName") String apiName, + public Response batchDeleteResource(@PathVariable("apiName") String apiName, @RequestParam("ids") String ids, HttpServletRequest request)throws Exception { - Map objectMap = new HashMap(); int delete = configResourceManager.deleteBatch(apiName, ids, request); if(delete > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else if(delete == -1) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + return Response.responseMsg(ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @GetMapping(value = "/{apiName}/checkIsNameExist") @ApiOperation(value = "检查名称是否存在") - public String checkIsNameExist(@PathVariable("apiName") String apiName, + public Response> checkIsNameExist(@PathVariable("apiName") String apiName, @RequestParam Long id, @RequestParam(value ="name", required = false) String name, HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); @@ -138,7 +168,7 @@ public String checkIsNameExist(@PathVariable("apiName") String apiName, } else { objectMap.put("status", false); } - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } 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..157ca5f9 100644 --- a/api/src/main/java/com/wansensoft/api/account/AccountController.java +++ b/api/src/main/java/com/wansensoft/api/account/AccountController.java @@ -7,7 +7,8 @@ import com.wansensoft.service.systemConfig.SystemConfigService; import com.wansensoft.utils.BaseResponseInfo; import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.Response; +import com.wansensoft.utils.enums.CodeEnum; import com.wansensoft.vo.AccountVo4InOutList; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -153,15 +154,15 @@ public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Intege */ @PostMapping(value = "/updateIsDefault") @ApiOperation(value = "更新默认账户") - public String updateIsDefault(@RequestBody JSONObject object, + public Response updateIsDefault(@RequestBody JSONObject object, HttpServletRequest request) throws Exception{ Long accountId = object.getLong("id"); Map objectMap = new HashMap<>(); int res = accountService.updateIsDefault(accountId); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseData(CodeEnum.ERROR); } } @@ -196,16 +197,16 @@ public BaseResponseInfo getStatistics(@RequestParam("name") String name, */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public String batchSetStatus(@RequestBody JSONObject jsonObject, + public Response batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = accountService.batchSetStatus(status, ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseData(CodeEnum.ERROR); } } } 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..e91afdf5 100644 --- a/api/src/main/java/com/wansensoft/api/account/AccountHeadController.java +++ b/api/src/main/java/com/wansensoft/api/account/AccountHeadController.java @@ -5,10 +5,10 @@ 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; -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; @@ -37,16 +37,16 @@ public class AccountHeadController { */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态-审核或者反审核") - public String batchSetStatus(@RequestBody JSONObject jsonObject, + public Response batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request) throws Exception{ Map objectMap = new HashMap<>(); String status = jsonObject.getString("status"); String ids = jsonObject.getString("ids"); int res = accountHeadService.batchSetStatus(status, ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseData(CodeEnum.ERROR); } } 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..c36f7598 100644 --- a/api/src/main/java/com/wansensoft/api/depot/DepotController.java +++ b/api/src/main/java/com/wansensoft/api/depot/DepotController.java @@ -9,8 +9,8 @@ import com.wansensoft.service.material.MaterialService; import com.wansensoft.service.userBusiness.UserBusinessService; import com.wansensoft.utils.BaseResponseInfo; -import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.Response; +import com.wansensoft.utils.enums.CodeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -22,7 +22,7 @@ import java.util.*; /** - * @author ji sheng hua 752*718*920 + * */ @RestController @RequestMapping(value = "/depot") @@ -142,15 +142,15 @@ public BaseResponseInfo findDepotByCurrentUser(HttpServletRequest request) throw */ @PostMapping(value = "/updateIsDefault") @ApiOperation(value = "更新默认仓库") - public String updateIsDefault(@RequestBody JSONObject object, + public Response updateIsDefault(@RequestBody JSONObject object, HttpServletRequest request) throws Exception{ Long depotId = object.getLong("id"); Map objectMap = new HashMap<>(); int res = depotService.updateIsDefault(depotId); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseData(CodeEnum.ERROR); } } @@ -203,16 +203,16 @@ public BaseResponseInfo getAllList(@RequestParam("mId") Long mId, */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public String batchSetStatus(@RequestBody JSONObject jsonObject, + public Response batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = depotService.batchSetStatus(status, ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseData(CodeEnum.ERROR); } } } 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..e9aba4a0 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; @@ -11,6 +13,7 @@ import com.wansensoft.utils.constants.ExceptionConstants; import com.wansensoft.service.redis.RedisService; import com.wansensoft.utils.*; +import com.wansensoft.utils.enums.CodeEnum; import com.wansensoft.vo.DepotHeadVo4InDetail; import com.wansensoft.vo.DepotHeadVo4InOutMCount; import com.wansensoft.vo.DepotHeadVo4List; @@ -49,6 +52,12 @@ public DepotHeadController(DepotHeadService depotHeadService, DepotService depot this.redisService = redisService; } + @GetMapping("/getAllList") + public Response> getList(@ModelAttribute RetailOutboundDto retailOutboundDto){ + return Response.responseData(depotHeadService.selectByConditionDepotHead(retailOutboundDto)); + } + + /** * 批量设置状态-审核或者反审核 * @param jsonObject @@ -57,16 +66,16 @@ public DepotHeadController(DepotHeadService depotHeadService, DepotService depot */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态-审核或者反审核") - public String batchSetStatus(@RequestBody JSONObject jsonObject, + public Response batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request) throws Exception{ Map objectMap = new HashMap<>(); String status = jsonObject.getString("status"); String ids = jsonObject.getString("ids"); int res = depotHeadService.batchSetStatus(status, ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseData(CodeEnum.ERROR); } } @@ -501,7 +510,7 @@ public BaseResponseInfo getCreatorByRoleType(HttpServletRequest request) { */ @GetMapping(value = "/debtList") @ApiOperation(value = "查询存在欠款的单据") - public String debtList(@RequestParam(value = Constants.SEARCH, required = false) String search, + public Response debtList(@RequestParam(value = Constants.SEARCH, required = false) String search, @RequestParam("currentPage") Integer currentPage, @RequestParam("pageSize") Integer pageSize, HttpServletRequest request)throws Exception { @@ -520,11 +529,11 @@ public String debtList(@RequestParam(value = Constants.SEARCH, required = false) if (list != null) { objectMap.put("rows", list); objectMap.put("total", total); - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { objectMap.put("rows", new ArrayList<>()); objectMap.put("total", 0); - return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); + return Response.responseData(objectMap); } } } diff --git a/api/src/main/java/com/wansensoft/api/depot/DepotItemController.java b/api/src/main/java/com/wansensoft/api/depot/DepotItemController.java index 5b02a93b..104ae84e 100644 --- a/api/src/main/java/com/wansensoft/api/depot/DepotItemController.java +++ b/api/src/main/java/com/wansensoft/api/depot/DepotItemController.java @@ -19,6 +19,7 @@ import com.wansensoft.utils.constants.ExceptionConstants; import com.wansensoft.plugins.exception.BusinessRunTimeException; import com.wansensoft.utils.*; +import com.wansensoft.utils.enums.CodeEnum; import com.wansensoft.vo.DepotItemStockWarningCount; import com.wansensoft.vo.DepotItemVoBatchNumberList; import io.swagger.annotations.Api; @@ -86,7 +87,7 @@ public DepotItemController(DepotHeadService depotHeadService, DepotItemService d */ @GetMapping(value = "/findDetailByDepotIdsAndMaterialId") @ApiOperation(value = "根据仓库和商品查询单据列表") - public String findDetailByDepotIdsAndMaterialId( + public Response findDetailByDepotIdsAndMaterialId( @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, @RequestParam(value = "depotIds",required = false) String depotIds, @@ -130,12 +131,12 @@ public String findDetailByDepotIdsAndMaterialId( if (list == null) { objectMap.put("rows", new ArrayList()); objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER); - return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); + return Response.responseMsg(CodeEnum.QUERY_DATA_EMPTY); } objectMap.put("rows", dataArray); objectMap.put("total", depotItemService.findDetailByDepotIdsAndMaterialIdCount(depotIds, forceFlag, sku, batchNumber, StringUtil.toNull(number), beginTime, endTime, mId)); - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } /** diff --git a/api/src/main/java/com/wansensoft/api/function/FunctionController.java b/api/src/main/java/com/wansensoft/api/function/FunctionController.java index f71aff99..66214cb2 100644 --- a/api/src/main/java/com/wansensoft/api/function/FunctionController.java +++ b/api/src/main/java/com/wansensoft/api/function/FunctionController.java @@ -13,6 +13,7 @@ import com.wansensoft.utils.StringUtil; import com.wansensoft.utils.Tools; import com.wansensoft.utils.*; +import com.wansensoft.utils.enums.CodeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -46,7 +47,7 @@ public FunctionController(FunctionService functionService, UserBusinessService u @GetMapping(value = "/checkIsNumberExist") @ApiOperation(value = "检查编号是否存在") - public String checkIsNumberExist(@RequestParam Long id, + public Response> checkIsNumberExist(@RequestParam Long id, @RequestParam(value ="number", required = false) String number, HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); @@ -56,7 +57,7 @@ public String checkIsNumberExist(@RequestParam Long id, } else { objectMap.put("status", false); } - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } /** diff --git a/api/src/main/java/com/wansensoft/api/inOutItem/InOutItemController.java b/api/src/main/java/com/wansensoft/api/inOutItem/InOutItemController.java index a2de78c1..f8e6f0fe 100644 --- a/api/src/main/java/com/wansensoft/api/inOutItem/InOutItemController.java +++ b/api/src/main/java/com/wansensoft/api/inOutItem/InOutItemController.java @@ -5,7 +5,7 @@ import com.wansensoft.entities.inOutItem.InOutItem; import com.wansensoft.service.inOutItem.InOutItemService; import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.Response; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -67,16 +67,16 @@ public String findBySelect(@RequestParam("type") String type, HttpServletRequest */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public String batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request)throws Exception { + public Response batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = inOutItemService.batchSetStatus(status, ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseData(objectMap); } } } 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..5a24aae9 100644 --- a/api/src/main/java/com/wansensoft/api/material/MaterialController.java +++ b/api/src/main/java/com/wansensoft/api/material/MaterialController.java @@ -11,8 +11,8 @@ import com.wansensoft.service.unit.UnitService; import com.wansensoft.utils.BaseResponseInfo; import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.Response; import com.wansensoft.utils.StringUtil; -import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -72,12 +72,12 @@ public MaterialController(MaterialService materialService, DepotItemService depo */ @GetMapping(value = "/checkIsExist") @ApiOperation(value = "检查商品是否存在") - public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name, - @RequestParam("model") String model, @RequestParam("color") String color, - @RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs, - @RequestParam("otherField1") String otherField1, @RequestParam("otherField2") String otherField2, - @RequestParam("otherField3") String otherField3, @RequestParam("unit") String unit,@RequestParam("unitId") Long unitId, - HttpServletRequest request)throws Exception { + public Response> checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name, + @RequestParam("model") String model, @RequestParam("color") String color, + @RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs, + @RequestParam("otherField1") String otherField1, @RequestParam("otherField2") String otherField2, + @RequestParam("otherField3") String otherField3, @RequestParam("unit") String unit, @RequestParam("unitId") Long unitId, + HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); int exist = materialService.checkIsExist(id, name, StringUtil.toNull(model), StringUtil.toNull(color), StringUtil.toNull(standard), StringUtil.toNull(mfrs), StringUtil.toNull(otherField1), @@ -87,7 +87,7 @@ public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") St } else { objectMap.put("status", false); } - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } /** @@ -99,16 +99,16 @@ public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") St */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态-启用或者禁用") - public String batchSetStatus(@RequestBody JSONObject jsonObject, + public Response batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = materialService.batchSetStatus(status, ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseData(objectMap); } } @@ -623,35 +623,31 @@ public BaseResponseInfo getListWithStock(@RequestParam("currentPage") Integer cu */ @PostMapping(value = "/batchSetMaterialCurrentStock") @ApiOperation(value = "批量设置商品当前的实时库存(按每个仓库)") - public String batchSetMaterialCurrentStock(@RequestBody JSONObject jsonObject, + public Response batchSetMaterialCurrentStock(@RequestBody JSONObject jsonObject, HttpServletRequest request) { String ids = jsonObject.getString("ids"); - Map objectMap = new HashMap<>(); int res = materialService.batchSetMaterialCurrentStock(ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } /** * 批量更新商品信息 * @param jsonObject - * @param request * @return * @throws Exception */ @PostMapping(value = "/batchUpdate") @ApiOperation(value = "批量更新商品信息") - public String batchUpdate(@RequestBody JSONObject jsonObject, - HttpServletRequest request) { - Map objectMap = new HashMap<>(); + public Response batchUpdate(@RequestBody JSONObject jsonObject) { int res = materialService.batchUpdate(jsonObject); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } } 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..312fc81e 100644 --- a/api/src/main/java/com/wansensoft/api/person/PersonController.java +++ b/api/src/main/java/com/wansensoft/api/person/PersonController.java @@ -5,8 +5,7 @@ import com.wansensoft.entities.person.Person; import com.wansensoft.service.person.PersonService; import com.wansensoft.utils.BaseResponseInfo; -import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.Response; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -145,16 +144,16 @@ public JSONArray getPersonByNumType(@RequestParam("type") String typeNum, */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public String batchSetStatus(@RequestBody JSONObject jsonObject, + public Response batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request) { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = personService.batchSetStatus(status, ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseData(objectMap); } } } 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..8b13b932 100644 --- a/api/src/main/java/com/wansensoft/api/platformConfig/PlatformConfigController.java +++ b/api/src/main/java/com/wansensoft/api/platformConfig/PlatformConfigController.java @@ -4,8 +4,7 @@ import com.wansensoft.entities.platformConfig.PlatformConfig; import com.wansensoft.service.platformConfig.PlatformConfigService; import com.wansensoft.utils.BaseResponseInfo; -import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.Response; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -96,16 +95,16 @@ public String getPlatformRegisterFlag(HttpServletRequest request) { */ @PostMapping(value = "/updatePlatformConfigByKey") @ApiOperation(value = "根据platformKey更新platformValue") - public String updatePlatformConfigByKey(@RequestBody JSONObject object, + public Response updatePlatformConfigByKey(@RequestBody JSONObject object, HttpServletRequest request) { Map objectMap = new HashMap<>(); String platformKey = object.getString("platformKey"); String platformValue = object.getString("platformValue"); int res = platformConfigService.updatePlatformConfigByKey(platformKey, platformValue); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseData(objectMap); } } 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..45c42bfc 100644 --- a/api/src/main/java/com/wansensoft/api/role/RoleController.java +++ b/api/src/main/java/com/wansensoft/api/role/RoleController.java @@ -5,8 +5,7 @@ import com.wansensoft.entities.role.Role; import com.wansensoft.service.role.RoleService; import com.wansensoft.service.userBusiness.UserBusinessService; -import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.Response; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -22,8 +21,6 @@ @RequestMapping(value = "/role") @Api(tags = {"角色管理"}) public class RoleController { - private Logger logger = LoggerFactory.getLogger(RoleController.class); - private final RoleService roleService; private final UserBusinessService userBusinessService; @@ -79,16 +76,16 @@ public List allList(HttpServletRequest request)throws Exception { */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public String batchSetStatus(@RequestBody JSONObject jsonObject, + public Response batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request) { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = roleService.batchSetStatus(status, ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseData(objectMap); } } } 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..b2267602 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,11 @@ 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 +46,7 @@ public SerialNumberController(SerialNumberService serialNumberService, DepotHead */ @PostMapping("/batAddSerialNumber") @ApiOperation(value = "批量添加序列号") - public String batAddSerialNumber(@RequestBody JSONObject jsonObject, HttpServletRequest request) { + public Response batAddSerialNumber(@RequestBody JSONObject jsonObject, HttpServletRequest request) { Map objectMap = new HashMap<>(); String materialCode = jsonObject.getString("materialCode"); String serialNumberPrefix = jsonObject.getString("serialNumberPrefix"); @@ -56,11 +54,11 @@ public String batAddSerialNumber(@RequestBody JSONObject jsonObject, HttpServlet String remark = jsonObject.getString("remark"); int insert = serialNumberService.batAddSerialNumber(materialCode,serialNumberPrefix,batAddTotal,remark); if(insert > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else if(insert == -1) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + return Response.responseMsg(ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } 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..ba650422 100644 --- a/api/src/main/java/com/wansensoft/api/supplier/SupplierController.java +++ b/api/src/main/java/com/wansensoft/api/supplier/SupplierController.java @@ -10,11 +10,9 @@ import com.wansensoft.utils.BaseResponseInfo; import com.wansensoft.utils.ErpInfo; import com.wansensoft.utils.ExcelUtils; -import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.Response; 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; @@ -47,7 +45,7 @@ public SupplierController(SupplierService supplierService, UserBusinessService u @GetMapping(value = "/checkIsNameAndTypeExist") @ApiOperation(value = "检查名称和类型是否存在") - public String checkIsNameAndTypeExist(@RequestParam Long id, + public Response > checkIsNameAndTypeExist(@RequestParam Long id, @RequestParam(value ="name", required = false) String name, @RequestParam(value ="type") String type, HttpServletRequest request)throws Exception { @@ -58,7 +56,7 @@ public String checkIsNameAndTypeExist(@RequestParam Long id, } else { objectMap.put("status", false); } - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } /** @@ -206,16 +204,15 @@ public JSONArray findBySelectRetail(HttpServletRequest request) { */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public String batchSetStatus(@RequestBody JSONObject jsonObject, + public Response batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request) { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); - Map objectMap = new HashMap<>(); int res = supplierService.batchSetStatus(status, ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } diff --git a/api/src/main/java/com/wansensoft/api/tenant/TenantController.java b/api/src/main/java/com/wansensoft/api/tenant/TenantController.java index 1c7ee3b2..053aa5fe 100644 --- a/api/src/main/java/com/wansensoft/api/tenant/TenantController.java +++ b/api/src/main/java/com/wansensoft/api/tenant/TenantController.java @@ -3,7 +3,7 @@ import com.alibaba.fastjson.JSONObject; import com.wansensoft.service.tenant.TenantService; import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.Response; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; @@ -30,16 +30,16 @@ public TenantController(TenantService tenantService) { */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public String batchSetStatus(@RequestBody JSONObject jsonObject, + public Response batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = tenantService.batchSetStatus(status, ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } } 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..ef06968b 100644 --- a/api/src/main/java/com/wansensoft/api/unit/UnitController.java +++ b/api/src/main/java/com/wansensoft/api/unit/UnitController.java @@ -5,15 +5,13 @@ import com.wansensoft.service.unit.UnitService; import com.wansensoft.utils.BaseResponseInfo; import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.Response; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import jakarta.servlet.http.HttpServletRequest; -import java.util.HashMap; import java.util.List; -import java.util.Map; @RestController @RequestMapping(value = "/unit") @@ -55,16 +53,15 @@ public BaseResponseInfo getAllList(HttpServletRequest request) { */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public String batchSetStatus(@RequestBody JSONObject jsonObject, + public Response batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request) { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); - Map objectMap = new HashMap<>(); int res = unitService.batchSetStatus(status, ids); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } } 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..4c956aa5 100644 --- a/api/src/main/java/com/wansensoft/api/user/UserBusinessController.java +++ b/api/src/main/java/com/wansensoft/api/user/UserBusinessController.java @@ -5,12 +5,9 @@ import com.wansensoft.service.user.UserService; import com.wansensoft.service.userBusiness.UserBusinessService; import com.wansensoft.utils.BaseResponseInfo; -import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.ResponseJsonUtil; +import com.wansensoft.utils.Response; 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; @@ -67,9 +64,9 @@ public BaseResponseInfo getBasicData(@RequestParam(value = "KeyId") String keyId */ @GetMapping(value = "/checkIsValueExist") @ApiOperation(value = "校验存在") - public String checkIsValueExist(@RequestParam(value ="type", required = false) String type, - @RequestParam(value ="keyId", required = false) String keyId, - HttpServletRequest request) { + public Response checkIsValueExist(@RequestParam(value ="type", required = false) String type, + @RequestParam(value ="keyId", required = false) String keyId, + HttpServletRequest request) { Map objectMap = new HashMap(); Long id = userBusinessService.checkIsValueExist(type, keyId); if(id != null) { @@ -77,7 +74,7 @@ public String checkIsValueExist(@RequestParam(value ="type", required = false) S } else { objectMap.put("id", null); } - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseData(objectMap); } /** 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..f34c8d15 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; @@ -97,17 +96,15 @@ public BaseResponseInfo weixinLogin(@RequestBody JSONObject jsonObject, @PostMapping(value = "/weixinBind") @ApiOperation(value = "绑定微信") - public String weixinBind(@RequestBody JSONObject jsonObject, - HttpServletRequest request)throws Exception { - Map objectMap = new HashMap<>(); + public Response weixinBind(@RequestBody JSONObject jsonObject) { String loginName = jsonObject.getString("loginName"); String password = jsonObject.getString("password"); String weixinCode = jsonObject.getString("weixinCode"); int res = userService.weixinBind(loginName, password, weixinCode); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @@ -147,7 +144,7 @@ public BaseResponseInfo logout(HttpServletRequest request, HttpServletResponse r @PostMapping(value = "/resetPwd") @ApiOperation(value = "重置密码") - public String resetPwd(@RequestBody JSONObject jsonObject, + public Response resetPwd(@RequestBody JSONObject jsonObject, HttpServletRequest request) throws Exception { Map objectMap = new HashMap<>(); Long id = jsonObject.getLong("id"); @@ -155,15 +152,15 @@ public String resetPwd(@RequestBody JSONObject jsonObject, String md5Pwd = Tools.md5Encryp(password); int update = userService.resetPwd(md5Pwd, id); if(update > 0) { - return ResponseJsonUtil.returnJson(objectMap, SUCCESS, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ERROR, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @PutMapping(value = "/updatePwd") @ApiOperation(value = "更新密码") - public String updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { + public Response updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Integer flag = 0; Map objectMap = new HashMap(); try { @@ -183,15 +180,15 @@ public String updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest r } objectMap.put("status", flag); if(flag > 0) { - return ResponseJsonUtil.returnJson(objectMap, info, ErpInfo.OK.code); + return Response.responseData(info); } else { - return ResponseJsonUtil.returnJson(objectMap, ERROR, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } catch (Exception e) { logger.error(">>>>>>>>>>>>>修改用户ID为 : " + jsonObject.getLong("userId") + "密码信息失败", e); flag = 3; objectMap.put("status", flag); - return ResponseJsonUtil.returnJson(objectMap, ERROR, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @@ -399,16 +396,15 @@ public BaseResponseInfo randomImage(HttpServletResponse response,@PathVariable S */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public String batchSetStatus(@RequestBody JSONObject jsonObject, + public Response batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Byte status = jsonObject.getByte("status"); String ids = jsonObject.getString("ids"); - Map objectMap = new HashMap<>(); int res = userService.batchSetStatus(status, ids, request); if(res > 0) { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); + return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); } else { - return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } 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..ccc652c1 --- /dev/null +++ b/domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java @@ -0,0 +1,51 @@ +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; +} 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/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..047895ae 100644 --- a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.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.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; @@ -1303,4 +1305,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 = depotService.findDepotStrByCurrentUser(); + 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/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/ErpInfo.java b/utils/src/main/java/com/wansensoft/utils/ErpInfo.java index 0785c539..cb255485 100644 --- a/utils/src/main/java/com/wansensoft/utils/ErpInfo.java +++ b/utils/src/main/java/com/wansensoft/utils/ErpInfo.java @@ -5,21 +5,21 @@ */ public enum ErpInfo { //通过构造传递参数 - OK(200, "成功"), - BAD_REQUEST(400, "请求错误或参数错误"), - UNAUTHORIZED(401, "未认证用户"), - INVALID_VERIFY_CODE(461, "错误的验证码"), - ERROR(500, "服务内部错误"), - WARING_MSG(201, "提醒信息"), - REDIRECT(301, "session失效,重定向"), - FORWARD_REDIRECT(302, "转发请求session失效"), - FORWARD_FAILED(303, "转发请求失败!"), - TEST_USER(-1, "演示用户禁止操作"); + OK("200", "成功"), + BAD_REQUEST("400", "请求错误或参数错误"), + UNAUTHORIZED("401", "未认证用户"), + INVALID_VERIFY_CODE("461", "错误的验证码"), + ERROR("500", "服务内部错误"), + WARING_MSG("201", "提醒信息"), + REDIRECT("301", "session失效,重定向"), + FORWARD_REDIRECT("302", "转发请求session失效"), + FORWARD_FAILED("303", "转发请求失败!"), + TEST_USER("-1", "演示用户禁止操作"); - public final int code; + public final String code; public final String name; - public int getCode() { + public String getCode() { return code; } @@ -30,7 +30,7 @@ public String getName() { /** * 定义枚举构造函数 */ - ErpInfo(int code, String name) { + ErpInfo(String code, String name) { this.code = code; this.name = name; } 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; + } +} From 422550a21ab77fe4906f8878a09bfc9e8383a2ef Mon Sep 17 00:00:00 2001 From: jameszow Date: Tue, 5 Sep 2023 20:38:34 +0800 Subject: [PATCH 02/10] add new mapper and xml in code --- .../api/IncomeExpenseController.java | 19 + .../wansensoft/api/OperatorController.java | 20 + .../api/SystemSupplierController.java | 20 + .../financial/FinancialAccountController.java | 19 + .../financial/FinancialMainController.java | 19 + .../api/financial/FinancialSubController.java | 19 + .../product/ProductAttributeController.java | 20 + .../product/ProductCategoryController.java | 20 + .../api/product/ProductController.java | 20 + .../product/ProductExtendPriceController.java | 20 + .../ProductExtendPropertyController.java | 20 + .../ProductInventoryCurrentController.java | 20 + .../ProductInventoryInitialController.java | 20 + .../api/product/ProductUnitController.java | 20 + .../api/role/SysRoleController.java | 20 + .../api/role/SysRoleMenuRelController.java | 20 + .../api/system/SysConfigController.java | 20 + .../api/system/SysLogController.java | 20 + .../api/system/SysMenuController.java | 20 + .../api/system/SysMsgController.java | 20 + .../api/system/SysOrganizationController.java | 20 + .../system/SysPlatformConfigController.java | 20 + .../api/system/SysSerialNumberController.java | 20 + .../api/tenant/SysTenantController.java | 20 + .../api/user/SysUserBusinessController.java | 20 + .../api/user/SysUserController.java | 20 + .../api/warehouse/WarehouseController.java | 20 + .../warehouse/WarehouseHeadController.java | 20 + .../warehouse/WarehouseItemController.java | 20 + .../mappers/IncomeExpenseMapper.java | 16 + .../wansensoft/mappers/OperatorMapper.java | 16 + .../mappers/SystemSupplierMapper.java | 16 + .../financial/FinancialAccountMapper.java | 16 + .../financial/FinancialMainMapper.java | 16 + .../mappers/financial/FinancialSubMapper.java | 16 + .../product/ProductAttributeMapper.java | 16 + .../product/ProductCategoryMapper.java | 16 + .../product/ProductExtendPriceMapper.java | 16 + .../product/ProductExtendPropertyMapper.java | 16 + .../ProductInventoryCurrentMapper.java | 16 + .../ProductInventoryInitialMapper.java | 16 + .../mappers/product/ProductMapper.java | 16 + .../mappers/product/ProductUnitMapper.java | 16 + .../mappers/role/SysRoleMapper.java | 16 + .../mappers/role/SysRoleMenuRelMapper.java | 16 + .../mappers/system/SysConfigMapper.java | 16 + .../mappers/system/SysLogMapper.java | 16 + .../mappers/system/SysMenuMapper.java | 16 + .../mappers/system/SysMsgMapper.java | 16 + .../mappers/system/SysOrganizationMapper.java | 16 + .../system/SysPlatformConfigMapper.java | 16 + .../mappers/system/SysSerialNumberMapper.java | 16 + .../mappers/tenant/SysTenantMapper.java | 16 + .../mappers/tenant/SysTenantUserMapper.java | 16 + .../mappers/user/SysUserBusinessMapper.java | 16 + .../mappers/user/SysUserMapper.java | 16 + .../mappers/user/SysUserOrgRelMapper.java | 16 + .../mappers/user/SysUserRoleRelMapper.java | 16 + .../user/SysUserWarehouseRelMapper.java | 16 + .../warehouse/WarehouseHeadMapper.java | 16 + .../warehouse/WarehouseItemMapper.java | 16 + .../mappers/warehouse/WarehouseMapper.java | 16 + .../mapper_xml/FinancialAccountMapper.xml | 5 + .../mapper_xml/FinancialMainMapper.xml | 5 + .../mapper_xml/FinancialSubMapper.xml | 5 + .../mapper_xml/IncomeExpenseMapper.xml | 5 + .../resources/mapper_xml/OperatorMapper.xml | 5 + .../mapper_xml/ProductAttributeMapper.xml | 5 + .../mapper_xml/ProductCategoryMapper.xml | 5 + .../mapper_xml/ProductExtendPriceMapper.xml | 5 + .../ProductExtendPropertyMapper.xml | 5 + .../ProductInventoryCurrentMapper.xml | 5 + .../ProductInventoryInitialMapper.xml | 5 + .../resources/mapper_xml/ProductMapper.xml | 5 + .../mapper_xml/ProductUnitMapper.xml | 5 + .../resources/mapper_xml/SysConfigMapper.xml | 5 + .../resources/mapper_xml/SysLogMapper.xml | 5 + .../resources/mapper_xml/SysMenuMapper.xml | 5 + .../resources/mapper_xml/SysMsgMapper.xml | 5 + .../mapper_xml/SysOrganizationMapper.xml | 5 + .../mapper_xml/SysPlatformConfigMapper.xml | 5 + .../resources/mapper_xml/SysRoleMapper.xml | 5 + .../mapper_xml/SysRoleMenuRelMapper.xml | 5 + .../mapper_xml/SysSerialNumberMapper.xml | 5 + .../resources/mapper_xml/SysTenantMapper.xml | 5 + .../mapper_xml/SysTenantUserMapper.xml | 5 + .../mapper_xml/SysUserBusinessMapper.xml | 5 + .../resources/mapper_xml/SysUserMapper.xml | 5 + .../mapper_xml/SysUserOrgRelMapper.xml | 5 + .../mapper_xml/SysUserRoleRelMapper.xml | 5 + .../mapper_xml/SysUserWarehouseRelMapper.xml | 5 + .../mapper_xml/SystemSupplierMapper.xml | 5 + .../mapper_xml/WarehouseHeadMapper.xml | 5 + .../mapper_xml/WarehouseItemMapper.xml | 5 + .../resources/mapper_xml/WarehouseMapper.xml | 5 + .../wansensoft/entities/FinancialAccount.java | 106 ++++ .../wansensoft/entities/FinancialMain.java | 131 ++++ .../com/wansensoft/entities/FinancialSub.java | 106 ++++ .../wansensoft/entities/IncomeExpense.java | 90 +++ .../com/wansensoft/entities/Operator.java | 85 +++ .../java/com/wansensoft/entities/Product.java | 161 +++++ .../wansensoft/entities/ProductAttribute.java | 72 +++ .../wansensoft/entities/ProductCategory.java | 95 +++ .../entities/ProductExtendPrice.java | 111 ++++ .../entities/ProductExtendProperty.java | 80 +++ .../entities/ProductInventoryCurrent.java | 81 +++ .../entities/ProductInventoryInitial.java | 91 +++ .../com/wansensoft/entities/ProductUnit.java | 111 ++++ .../com/wansensoft/entities/SysConfig.java | 124 ++++ .../java/com/wansensoft/entities/SysLog.java | 75 +++ .../java/com/wansensoft/entities/SysMenu.java | 115 ++++ .../java/com/wansensoft/entities/SysMsg.java | 75 +++ .../wansensoft/entities/SysOrganization.java | 90 +++ .../entities/SysPlatformConfig.java | 67 +++ .../java/com/wansensoft/entities/SysRole.java | 85 +++ .../wansensoft/entities/SysRoleMenuRel.java | 70 +++ .../wansensoft/entities/SysSerialNumber.java | 100 +++ .../com/wansensoft/entities/SysTenant.java | 80 +++ .../wansensoft/entities/SysTenantUser.java | 95 +++ .../java/com/wansensoft/entities/SysUser.java | 109 ++++ .../wansensoft/entities/SysUserBusiness.java | 64 ++ .../wansensoft/entities/SysUserOrgRel.java | 80 +++ .../wansensoft/entities/SysUserRoleRel.java | 70 +++ .../entities/SysUserWarehouseRel.java | 70 +++ .../wansensoft/entities/SystemSupplier.java | 171 ++++++ .../com/wansensoft/entities/Warehouse.java | 116 ++++ .../wansensoft/entities/WarehouseHead.java | 196 ++++++ .../wansensoft/entities/WarehouseItem.java | 176 ++++++ .../plugins/config/CodeGeneration.java | 5 + .../service/IIncomeExpenseService.java | 16 + .../wansensoft/service/IOperatorService.java | 16 + .../service/ISystemSupplierService.java | 16 + .../service/IncomeExpenseServiceImpl.java | 19 + .../service/OperatorServiceImpl.java | 19 + .../service/SystemSupplierServiceImpl.java | 19 + .../FinancialAccountServiceImpl.java | 19 + .../financial/FinancialMainServiceImpl.java | 19 + .../financial/FinancialSubServiceImpl.java | 19 + .../financial/IFinancialAccountService.java | 16 + .../financial/IFinancialMainService.java | 16 + .../financial/IFinancialSubService.java | 16 + .../product/IProductAttributeService.java | 16 + .../product/IProductCategoryService.java | 16 + .../product/IProductExtendPriceService.java | 16 + .../IProductExtendPropertyService.java | 16 + .../IProductInventoryCurrentService.java | 16 + .../IProductInventoryInitialService.java | 16 + .../service/product/IProductService.java | 16 + .../service/product/IProductUnitService.java | 16 + .../impl/ProductAttributeServiceImpl.java | 20 + .../impl/ProductCategoryServiceImpl.java | 20 + .../impl/ProductExtendPriceServiceImpl.java | 20 + .../ProductExtendPropertyServiceImpl.java | 20 + .../ProductInventoryCurrentServiceImpl.java | 20 + .../ProductInventoryInitialServiceImpl.java | 20 + .../product/impl/ProductServiceImpl.java | 20 + .../product/impl/ProductUnitServiceImpl.java | 20 + .../service/role/ISysRoleMenuRelService.java | 16 + .../service/role/ISysRoleService.java | 16 + .../role/SysRoleMenuRelServiceImpl.java | 19 + .../service/role/SysRoleServiceImpl.java | 19 + .../service/system/ISysConfigService.java | 16 + .../service/system/ISysLogService.java | 16 + .../service/system/ISysMenuService.java | 16 + .../service/system/ISysMsgService.java | 16 + .../system/ISysOrganizationService.java | 16 + .../system/ISysPlatformConfigService.java | 16 + .../system/ISysSerialNumberService.java | 16 + .../system/impl/SysConfigServiceImpl.java | 20 + .../system/impl/SysLogServiceImpl.java | 20 + .../system/impl/SysMenuServiceImpl.java | 20 + .../system/impl/SysMsgServiceImpl.java | 20 + .../impl/SysOrganizationServiceImpl.java | 20 + .../impl/SysPlatformConfigServiceImpl.java | 20 + .../impl/SysSerialNumberServiceImpl.java | 20 + .../service/tenant/ISysTenantService.java | 16 + .../service/tenant/ISysTenantUserService.java | 16 + .../tenant/impl/SysTenantServiceImpl.java | 20 + .../tenant/impl/SysTenantUserServiceImpl.java | 20 + .../service/user/ISysUserBusinessService.java | 16 + .../service/user/ISysUserOrgRelService.java | 16 + .../service/user/ISysUserRoleRelService.java | 16 + .../service/user/ISysUserService.java | 16 + .../user/ISysUserWarehouseRelService.java | 16 + .../user/impl/SysUserBusinessServiceImpl.java | 20 + .../user/impl/SysUserOrgRelServiceImpl.java | 20 + .../user/impl/SysUserRoleRelServiceImpl.java | 20 + .../service/user/impl/SysUserServiceImpl.java | 20 + .../impl/SysUserWarehouseRelServiceImpl.java | 20 + .../warehouse/IWarehouseHeadService.java | 16 + .../warehouse/IWarehouseItemService.java | 16 + .../service/warehouse/IWarehouseService.java | 16 + .../impl/WarehouseHeadServiceImpl.java | 20 + .../impl/WarehouseItemServiceImpl.java | 20 + .../warehouse/impl/WarehouseServiceImpl.java | 20 + .../redis/FastJson2JsonRedisSerializer.java | 57 ++ .../wansensoft/utils/redis/RedisConfig.java | 40 ++ .../com/wansensoft/utils/redis/RedisUtil.java | 569 ++++++++++++++++++ 198 files changed, 6468 insertions(+) create mode 100644 api/src/main/java/com/wansensoft/api/IncomeExpenseController.java create mode 100644 api/src/main/java/com/wansensoft/api/OperatorController.java create mode 100644 api/src/main/java/com/wansensoft/api/SystemSupplierController.java create mode 100644 api/src/main/java/com/wansensoft/api/financial/FinancialAccountController.java create mode 100644 api/src/main/java/com/wansensoft/api/financial/FinancialMainController.java create mode 100644 api/src/main/java/com/wansensoft/api/financial/FinancialSubController.java create mode 100644 api/src/main/java/com/wansensoft/api/product/ProductAttributeController.java create mode 100644 api/src/main/java/com/wansensoft/api/product/ProductCategoryController.java create mode 100644 api/src/main/java/com/wansensoft/api/product/ProductController.java create mode 100644 api/src/main/java/com/wansensoft/api/product/ProductExtendPriceController.java create mode 100644 api/src/main/java/com/wansensoft/api/product/ProductExtendPropertyController.java create mode 100644 api/src/main/java/com/wansensoft/api/product/ProductInventoryCurrentController.java create mode 100644 api/src/main/java/com/wansensoft/api/product/ProductInventoryInitialController.java create mode 100644 api/src/main/java/com/wansensoft/api/product/ProductUnitController.java create mode 100644 api/src/main/java/com/wansensoft/api/role/SysRoleController.java create mode 100644 api/src/main/java/com/wansensoft/api/role/SysRoleMenuRelController.java create mode 100644 api/src/main/java/com/wansensoft/api/system/SysConfigController.java create mode 100644 api/src/main/java/com/wansensoft/api/system/SysLogController.java create mode 100644 api/src/main/java/com/wansensoft/api/system/SysMenuController.java create mode 100644 api/src/main/java/com/wansensoft/api/system/SysMsgController.java create mode 100644 api/src/main/java/com/wansensoft/api/system/SysOrganizationController.java create mode 100644 api/src/main/java/com/wansensoft/api/system/SysPlatformConfigController.java create mode 100644 api/src/main/java/com/wansensoft/api/system/SysSerialNumberController.java create mode 100644 api/src/main/java/com/wansensoft/api/tenant/SysTenantController.java create mode 100644 api/src/main/java/com/wansensoft/api/user/SysUserBusinessController.java create mode 100644 api/src/main/java/com/wansensoft/api/user/SysUserController.java create mode 100644 api/src/main/java/com/wansensoft/api/warehouse/WarehouseController.java create mode 100644 api/src/main/java/com/wansensoft/api/warehouse/WarehouseHeadController.java create mode 100644 api/src/main/java/com/wansensoft/api/warehouse/WarehouseItemController.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/IncomeExpenseMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/OperatorMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/SystemSupplierMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/financial/FinancialAccountMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/financial/FinancialMainMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/financial/FinancialSubMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/product/ProductAttributeMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/product/ProductCategoryMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPriceMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/product/ProductExtendPropertyMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryCurrentMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/product/ProductInventoryInitialMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/product/ProductMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/product/ProductUnitMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/role/SysRoleMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/role/SysRoleMenuRelMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/system/SysConfigMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/system/SysLogMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/system/SysMenuMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/system/SysMsgMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/system/SysOrganizationMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/system/SysPlatformConfigMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/system/SysSerialNumberMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/tenant/SysTenantUserMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/user/SysUserBusinessMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/user/SysUserMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/user/SysUserOrgRelMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/user/SysUserRoleRelMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/user/SysUserWarehouseRelMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseHeadMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseItemMapper.java create mode 100644 dao/src/main/java/com/wansensoft/mappers/warehouse/WarehouseMapper.java create mode 100644 dao/src/main/resources/mapper_xml/FinancialAccountMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/FinancialMainMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/FinancialSubMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/IncomeExpenseMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/OperatorMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/ProductAttributeMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/ProductCategoryMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/ProductExtendPriceMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/ProductExtendPropertyMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/ProductInventoryCurrentMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/ProductInventoryInitialMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/ProductMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/ProductUnitMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysConfigMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysLogMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysMenuMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysMsgMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysOrganizationMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysPlatformConfigMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysRoleMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysRoleMenuRelMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysSerialNumberMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysTenantMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysTenantUserMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysUserBusinessMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysUserMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysUserOrgRelMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysUserRoleRelMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SysUserWarehouseRelMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/SystemSupplierMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/WarehouseHeadMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/WarehouseItemMapper.xml create mode 100644 dao/src/main/resources/mapper_xml/WarehouseMapper.xml create mode 100644 domain/src/main/java/com/wansensoft/entities/FinancialAccount.java create mode 100644 domain/src/main/java/com/wansensoft/entities/FinancialMain.java create mode 100644 domain/src/main/java/com/wansensoft/entities/FinancialSub.java create mode 100644 domain/src/main/java/com/wansensoft/entities/IncomeExpense.java create mode 100644 domain/src/main/java/com/wansensoft/entities/Operator.java create mode 100644 domain/src/main/java/com/wansensoft/entities/Product.java create mode 100644 domain/src/main/java/com/wansensoft/entities/ProductAttribute.java create mode 100644 domain/src/main/java/com/wansensoft/entities/ProductCategory.java create mode 100644 domain/src/main/java/com/wansensoft/entities/ProductExtendPrice.java create mode 100644 domain/src/main/java/com/wansensoft/entities/ProductExtendProperty.java create mode 100644 domain/src/main/java/com/wansensoft/entities/ProductInventoryCurrent.java create mode 100644 domain/src/main/java/com/wansensoft/entities/ProductInventoryInitial.java create mode 100644 domain/src/main/java/com/wansensoft/entities/ProductUnit.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysConfig.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysLog.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysMenu.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysMsg.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysOrganization.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysPlatformConfig.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysRole.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysRoleMenuRel.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysSerialNumber.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysTenant.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysTenantUser.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysUser.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysUserBusiness.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysUserOrgRel.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysUserRoleRel.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SysUserWarehouseRel.java create mode 100644 domain/src/main/java/com/wansensoft/entities/SystemSupplier.java create mode 100644 domain/src/main/java/com/wansensoft/entities/Warehouse.java create mode 100644 domain/src/main/java/com/wansensoft/entities/WarehouseHead.java create mode 100644 domain/src/main/java/com/wansensoft/entities/WarehouseItem.java create mode 100644 plugins/src/main/java/com/wansensoft/plugins/config/CodeGeneration.java create mode 100644 service/src/main/java/com/wansensoft/service/IIncomeExpenseService.java create mode 100644 service/src/main/java/com/wansensoft/service/IOperatorService.java create mode 100644 service/src/main/java/com/wansensoft/service/ISystemSupplierService.java create mode 100644 service/src/main/java/com/wansensoft/service/IncomeExpenseServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/OperatorServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/SystemSupplierServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/financial/FinancialAccountServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/financial/FinancialMainServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/financial/FinancialSubServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/financial/IFinancialAccountService.java create mode 100644 service/src/main/java/com/wansensoft/service/financial/IFinancialMainService.java create mode 100644 service/src/main/java/com/wansensoft/service/financial/IFinancialSubService.java create mode 100644 service/src/main/java/com/wansensoft/service/product/IProductAttributeService.java create mode 100644 service/src/main/java/com/wansensoft/service/product/IProductCategoryService.java create mode 100644 service/src/main/java/com/wansensoft/service/product/IProductExtendPriceService.java create mode 100644 service/src/main/java/com/wansensoft/service/product/IProductExtendPropertyService.java create mode 100644 service/src/main/java/com/wansensoft/service/product/IProductInventoryCurrentService.java create mode 100644 service/src/main/java/com/wansensoft/service/product/IProductInventoryInitialService.java create mode 100644 service/src/main/java/com/wansensoft/service/product/IProductService.java create mode 100644 service/src/main/java/com/wansensoft/service/product/IProductUnitService.java create mode 100644 service/src/main/java/com/wansensoft/service/product/impl/ProductAttributeServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/product/impl/ProductCategoryServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPriceServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/product/impl/ProductExtendPropertyServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryCurrentServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/product/impl/ProductInventoryInitialServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/product/impl/ProductServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/product/impl/ProductUnitServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/role/ISysRoleMenuRelService.java create mode 100644 service/src/main/java/com/wansensoft/service/role/ISysRoleService.java create mode 100644 service/src/main/java/com/wansensoft/service/role/SysRoleMenuRelServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/role/SysRoleServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/system/ISysConfigService.java create mode 100644 service/src/main/java/com/wansensoft/service/system/ISysLogService.java create mode 100644 service/src/main/java/com/wansensoft/service/system/ISysMenuService.java create mode 100644 service/src/main/java/com/wansensoft/service/system/ISysMsgService.java create mode 100644 service/src/main/java/com/wansensoft/service/system/ISysOrganizationService.java create mode 100644 service/src/main/java/com/wansensoft/service/system/ISysPlatformConfigService.java create mode 100644 service/src/main/java/com/wansensoft/service/system/ISysSerialNumberService.java create mode 100644 service/src/main/java/com/wansensoft/service/system/impl/SysConfigServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/system/impl/SysLogServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/system/impl/SysMenuServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/system/impl/SysMsgServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/system/impl/SysOrganizationServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/system/impl/SysPlatformConfigServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/system/impl/SysSerialNumberServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/tenant/ISysTenantService.java create mode 100644 service/src/main/java/com/wansensoft/service/tenant/ISysTenantUserService.java create mode 100644 service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/tenant/impl/SysTenantUserServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/user/ISysUserBusinessService.java create mode 100644 service/src/main/java/com/wansensoft/service/user/ISysUserOrgRelService.java create mode 100644 service/src/main/java/com/wansensoft/service/user/ISysUserRoleRelService.java create mode 100644 service/src/main/java/com/wansensoft/service/user/ISysUserService.java create mode 100644 service/src/main/java/com/wansensoft/service/user/ISysUserWarehouseRelService.java create mode 100644 service/src/main/java/com/wansensoft/service/user/impl/SysUserBusinessServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/user/impl/SysUserOrgRelServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/user/impl/SysUserRoleRelServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/user/impl/SysUserServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/user/impl/SysUserWarehouseRelServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/warehouse/IWarehouseHeadService.java create mode 100644 service/src/main/java/com/wansensoft/service/warehouse/IWarehouseItemService.java create mode 100644 service/src/main/java/com/wansensoft/service/warehouse/IWarehouseService.java create mode 100644 service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseHeadServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseItemServiceImpl.java create mode 100644 service/src/main/java/com/wansensoft/service/warehouse/impl/WarehouseServiceImpl.java create mode 100644 utils/src/main/java/com/wansensoft/utils/redis/FastJson2JsonRedisSerializer.java create mode 100644 utils/src/main/java/com/wansensoft/utils/redis/RedisConfig.java create mode 100644 utils/src/main/java/com/wansensoft/utils/redis/RedisUtil.java 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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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; + } + } + +} From ebff67d7c3ff9e1275c017413156761c9eac99c8 Mon Sep 17 00:00:00 2001 From: jameszow Date: Tue, 5 Sep 2023 20:38:56 +0800 Subject: [PATCH 03/10] update depot head code --- .../com/wansensoft/api/ErpApplication.java | 5 +-- .../api/depot/DepotHeadController.java | 4 +- .../dto/depot/RetailOutboundDto.java | 2 + .../plugins/config}/MybatisPlusConfig.java | 2 +- .../service/depot/DepotService.java | 2 + .../service/depot/DepotServiceImpl.java | 40 +++++++++++++++++++ .../service/depotHead/DepotHeadService.java | 2 + .../depotHead/DepotHeadServiceImpl.java | 40 ++++++++++++++++--- .../service/user/UserServiceImpl.java | 7 +++- 9 files changed, 90 insertions(+), 14 deletions(-) rename {api/src/main/java/com/wansensoft/api => plugins/src/main/java/com/wansensoft/plugins/config}/MybatisPlusConfig.java (95%) diff --git a/api/src/main/java/com/wansensoft/api/ErpApplication.java b/api/src/main/java/com/wansensoft/api/ErpApplication.java index 07e7a9d6..9f8973ec 100644 --- a/api/src/main/java/com/wansensoft/api/ErpApplication.java +++ b/api/src/main/java/com/wansensoft/api/ErpApplication.java @@ -11,10 +11,9 @@ import java.io.IOException; -@MapperScan("com.wansensoft.mappers") -@ComponentScan("com.wansensoft") -@SpringBootApplication @EnableScheduling +@MapperScan("com.wansensoft.mappers") +@SpringBootApplication(scanBasePackages = {"com.wansensoft"}) public class ErpApplication { public static void main(String[] args) throws IOException { 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 e9aba4a0..96d6ea82 100644 --- a/api/src/main/java/com/wansensoft/api/depot/DepotHeadController.java +++ b/api/src/main/java/com/wansensoft/api/depot/DepotHeadController.java @@ -52,8 +52,8 @@ public DepotHeadController(DepotHeadService depotHeadService, DepotService depot this.redisService = redisService; } - @GetMapping("/getAllList") - public Response> getList(@ModelAttribute RetailOutboundDto retailOutboundDto){ + @PostMapping("/getAllList") + public Response> getList(@RequestBody RetailOutboundDto retailOutboundDto){ return Response.responseData(depotHeadService.selectByConditionDepotHead(retailOutboundDto)); } diff --git a/domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java b/domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java index ccc652c1..874cc626 100644 --- a/domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java +++ b/domain/src/main/java/com/wansensoft/dto/depot/RetailOutboundDto.java @@ -48,4 +48,6 @@ public class RetailOutboundDto extends PageSizeDto { private int offset; private int rows; + + private String token; } diff --git a/api/src/main/java/com/wansensoft/api/MybatisPlusConfig.java b/plugins/src/main/java/com/wansensoft/plugins/config/MybatisPlusConfig.java similarity index 95% rename from api/src/main/java/com/wansensoft/api/MybatisPlusConfig.java rename to plugins/src/main/java/com/wansensoft/plugins/config/MybatisPlusConfig.java index b14ec5e7..c569e127 100644 --- a/api/src/main/java/com/wansensoft/api/MybatisPlusConfig.java +++ b/plugins/src/main/java/com/wansensoft/plugins/config/MybatisPlusConfig.java @@ -1,4 +1,4 @@ -package com.wansensoft.api; +package com.wansensoft.plugins.config; import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer; 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 b93c6438..4c0245ec 100644 --- a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java +++ b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java @@ -129,4 +129,6 @@ int debtListCount(Long organId, String materialParam, String number, String begi String getBillCategory(String subType); List selectByConditionDepotHead(RetailOutboundDto retailOutboundDto); + + String getCreatorByRoleType(String roleType, String userId); } \ 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 047895ae..f7f86dc2 100644 --- a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java @@ -1,7 +1,6 @@ package com.wansensoft.service.depotHead; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.wansensoft.dto.depot.RetailOutboundDto; import com.wansensoft.entities.account.AccountItem; @@ -15,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; @@ -65,7 +65,9 @@ public class DepotHeadServiceImpl extends ServiceImpl selectByConditionDepotHead(RetailOutboundDto retai List resList = new ArrayList<>(); try{ - String depotIds = depotService.findDepotStrByCurrentUser(); + String depotIds = String.valueOf(depotService.findDepotByCurrentUserTest(String.valueOf(retailOutboundDto.getCreator()))); String [] depotArray=depotIds.split(","); - String [] creatorArray = getCreatorArray(retailOutboundDto.getRoleType()); + String [] creatorArray = getCreatorArray(retailOutboundDto.getRoleType(), String.valueOf(retailOutboundDto.getCreator())); String beginTime = Tools.parseDayToTime(retailOutboundDto.getBeginTime(), BusinessConstants.DAY_FIRST_TIME); String endTime = Tools.parseDayToTime(retailOutboundDto.getEndTime(), BusinessConstants.DAY_LAST_TIME); List list = depotHeadMapperEx 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..06cb8d85 100644 --- a/service/src/main/java/com/wansensoft/service/user/UserServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/user/UserServiceImpl.java @@ -17,13 +17,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; @@ -58,7 +58,9 @@ public class UserServiceImpl extends ServiceImpl implements Us 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 RedisUtil redisUtil; + + public UserServiceImpl(UserMapper userMapper, UserMapperEx userMapperEx, OrgaUserRelService orgaUserRelService, LogService logService, TenantService tenantService, UserBusinessService userBusinessService, CommonService commonService, FunctionService functionService, PlatformConfigService platformConfigService, RedisService redisService, RedisUtil redisUtil) { this.userMapper = userMapper; this.userMapperEx = userMapperEx; this.orgaUserRelService = orgaUserRelService; @@ -69,6 +71,7 @@ public UserServiceImpl(UserMapper userMapper, UserMapperEx userMapperEx, OrgaUse this.functionService = functionService; this.platformConfigService = platformConfigService; this.redisService = redisService; + this.redisUtil = redisUtil; } public User getUser(long id) { From 027b04e16781b2a2c691495ab44185da0bad360d Mon Sep 17 00:00:00 2001 From: jameszow Date: Wed, 6 Sep 2023 00:29:09 +0800 Subject: [PATCH 04/10] ingore Swagger and config --- .../com/wansensoft/api/PluginController.java | 295 +++++++++--------- .../plugins/config/MybatisPlusConfig.java | 24 -- .../plugins/config/Swagger2Config.java | 44 --- .../plugins/config/TenantConfig.java | 100 ------ .../java/com/wansensoft/utils/JsonUtils.java | 22 -- 5 files changed, 148 insertions(+), 337 deletions(-) delete mode 100644 plugins/src/main/java/com/wansensoft/plugins/config/MybatisPlusConfig.java delete mode 100644 plugins/src/main/java/com/wansensoft/plugins/config/Swagger2Config.java delete mode 100644 plugins/src/main/java/com/wansensoft/plugins/config/TenantConfig.java delete mode 100644 utils/src/main/java/com/wansensoft/utils/JsonUtils.java 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/plugins/src/main/java/com/wansensoft/plugins/config/MybatisPlusConfig.java b/plugins/src/main/java/com/wansensoft/plugins/config/MybatisPlusConfig.java deleted file mode 100644 index c569e127..00000000 --- a/plugins/src/main/java/com/wansensoft/plugins/config/MybatisPlusConfig.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.wansensoft.plugins.config; - -import com.baomidou.mybatisplus.annotation.DbType; -import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer; -import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; -import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -@MapperScan("com.wansensoft.mappers") -public class MybatisPlusConfig { - - /** - * 添加分页插件 - */ - @Bean - public MybatisPlusInterceptor mybatisPlusInterceptor() { - MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); - interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); - return interceptor; - } -} diff --git a/plugins/src/main/java/com/wansensoft/plugins/config/Swagger2Config.java b/plugins/src/main/java/com/wansensoft/plugins/config/Swagger2Config.java deleted file mode 100644 index 40a98dbd..00000000 --- a/plugins/src/main/java/com/wansensoft/plugins/config/Swagger2Config.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.wansensoft.plugins.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.service.ApiInfo; -import springfox.documentation.service.Contact; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -/** - * 插件集成配置 - * - * @author jishenghua - * @version 1.0 - */ -@Configuration -@EnableSwagger2 -public class Swagger2Config { - - @Bean - public Docket createRestApi() { - return new Docket(DocumentationType.SWAGGER_2) - .apiInfo(this.apiInfo()) - .select() - .apis(RequestHandlerSelectors.any()) - .paths(PathSelectors.any()) - .build(); - } - - private ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("华夏ERP Restful Api") - .description("华夏ERP接口描述") - .termsOfServiceUrl("http://127.0.0.1") - .contact(new Contact("jishenghua", "", "")) - .version("3.0") - .build(); - } - -} diff --git a/plugins/src/main/java/com/wansensoft/plugins/config/TenantConfig.java b/plugins/src/main/java/com/wansensoft/plugins/config/TenantConfig.java deleted file mode 100644 index 4ba22f89..00000000 --- a/plugins/src/main/java/com/wansensoft/plugins/config/TenantConfig.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.wansensoft.plugins.config; - -import org.mybatis.spring.mapper.MapperScannerConfigurer; -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Service; - -@Service -public class TenantConfig { - -// @Bean -// public PaginationInnerInterceptor paginationInterceptor(HttpServletRequest request) { -// PaginationInnerInterceptor paginationInterceptor = new PaginationInnerInterceptor(); -// List sqlParserList = new ArrayList<>(); -// TenantSqlParser tenantSqlParser = new TenantSqlParser(); -// tenantSqlParser.setTenantHandler(new TenantHandler() { -// @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; -// } -// } -// -// @Override -// public String getTenantIdColumn() { -// return "tenant_id"; -// } -// -// @Override -// public boolean doTableFilter(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; -// } -// }); -// -// sqlParserList.add(tenantSqlParser); -// paginationInterceptor.setSqlParserList(sqlParserList); -// paginationInterceptor.setSqlParserFilter(new ISqlParserFilter() { -// @Override -// public boolean doFilter(MetaObject metaObject) { -// MappedStatement ms = SqlParserHelper.getMappedStatement(metaObject); -// // 过滤自定义查询此时无租户信息约束出现 -// if ("com.jsh.erp.datasource.mappers.UserMapperEx.getUserByWeixinOpenId".equals(ms.getId())) { -// return true; -// } else if ("com.jsh.erp.datasource.mappers.UserMapperEx.updateUserWithWeixinOpenId".equals(ms.getId())) { -// return true; -// } else if ("com.jsh.erp.datasource.mappers.UserMapperEx.getUserListByUserNameOrLoginName".equals(ms.getId())) { -// return true; -// } else if ("com.jsh.erp.datasource.mappers.UserMapperEx.disableUserByLimit".equals(ms.getId())) { -// return true; -// } else if ("com.jsh.erp.datasource.mappers.RoleMapperEx.getRoleWithoutTenant".equals(ms.getId())) { -// return true; -// } else if ("com.jsh.erp.datasource.mappers.LogMapperEx.insertLogWithUserId".equals(ms.getId())) { -// return true; -// } -// return false; -// } -// }); -// return paginationInterceptor; -// } - - /** - * 相当于顶部的: - * {@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 PerformanceInterceptor performanceInterceptor(){ -// return new PerformanceInterceptor(); -// } - - -} 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; - } - -} From 989a0fad361b51b0fb3a1058790f912db46657aa Mon Sep 17 00:00:00 2001 From: jameszow Date: Wed, 6 Sep 2023 00:29:53 +0800 Subject: [PATCH 05/10] add @InterceptorIgnore(tenantLine = "true") fix #30 --- .../main/java/com/wansensoft/mappers/log/LogMapperEx.java | 2 ++ .../main/java/com/wansensoft/mappers/role/RoleMapperEx.java | 3 +++ .../main/java/com/wansensoft/mappers/user/UserMapperEx.java | 5 +++++ 3 files changed, 10 insertions(+) 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/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/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, From b00489205d60643a9a9015520ecd482e26a93e4e Mon Sep 17 00:00:00 2001 From: jameszow Date: Wed, 6 Sep 2023 00:30:11 +0800 Subject: [PATCH 06/10] cancel spring-brick jar --- plugins/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) 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 + + + + + + From ec201d6c98416228a30ce66b1cfa1977c4ac02eb Mon Sep 17 00:00:00 2001 From: jameszow Date: Wed, 6 Sep 2023 00:30:23 +0800 Subject: [PATCH 07/10] cancel plugin config --- api/src/main/resources/application-dev.yml | 7 ++++--- api/src/main/resources/application.yml | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) 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 From 819a4ef49485bb3f0614f5e7ef06fdad9765144b Mon Sep 17 00:00:00 2001 From: jameszow Date: Wed, 6 Sep 2023 00:30:41 +0800 Subject: [PATCH 08/10] Fixed response data --- .../wansensoft/api/ResourceController.java | 50 ++++++++++--------- .../api/account/AccountController.java | 16 +++--- .../api/account/AccountHeadController.java | 9 ++-- .../wansensoft/api/depot/DepotController.java | 14 +++--- .../api/depot/DepotHeadController.java | 13 +++-- .../api/depot/DepotItemController.java | 7 ++- .../api/function/FunctionController.java | 5 +- .../api/inOutItem/InOutItemController.java | 10 ++-- .../api/material/MaterialController.java | 37 +++++++------- .../api/person/PersonController.java | 11 ++-- .../PlatformConfigController.java | 11 ++-- .../wansensoft/api/role/RoleController.java | 12 +++-- .../serialNumber/SerialNumberController.java | 9 ++-- .../api/supplier/SupplierController.java | 15 +++--- .../api/tenant/TenantController.java | 8 +-- .../wansensoft/api/unit/UnitController.java | 14 ++++-- .../api/user/UserBusinessController.java | 11 ++-- .../wansensoft/api/user/UserController.java | 29 ++++++----- .../com/wansensoft/service/CommonService.java | 4 -- .../service/depotHead/DepotHeadService.java | 2 - .../depotHead/DepotHeadServiceImpl.java | 44 ++-------------- .../service/user/UserServiceImpl.java | 16 +++--- .../java/com/wansensoft/utils/ErpInfo.java | 26 +++++----- 23 files changed, 173 insertions(+), 200 deletions(-) diff --git a/api/src/main/java/com/wansensoft/api/ResourceController.java b/api/src/main/java/com/wansensoft/api/ResourceController.java index 03d08fd3..abdbd188 100644 --- a/api/src/main/java/com/wansensoft/api/ResourceController.java +++ b/api/src/main/java/com/wansensoft/api/ResourceController.java @@ -27,22 +27,22 @@ public ResourceController(CommonQueryManager configResourceManager) { @GetMapping(value = "/{apiName}/info") @ApiOperation(value = "根据id获取信息") - public Response> getList(@PathVariable("apiName") String apiName, + public String getList(@PathVariable("apiName") String apiName, @RequestParam("id") Long id, HttpServletRequest request) throws Exception { Object obj = configResourceManager.selectOne(apiName, id); Map objectMap = new HashMap(); if(obj != null) { objectMap.put("info", obj); - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @GetMapping(value = "/{apiName}/list") @ApiOperation(value = "获取信息列表") - public Response getList(@PathVariable("apiName") String apiName, + 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, @@ -61,11 +61,11 @@ public Response getList(@PathVariable("apiName") String apiName, if (list != null) { objectMap.put("total", configResourceManager.counts(apiName, parameterMap)); objectMap.put("rows", list); - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER); objectMap.put("rows", new ArrayList()); - return Response.responseMsg(CodeEnum.QUERY_DATA_EMPTY); + return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); } } // @GetMapping(value = "/{apiName}/list") @@ -100,65 +100,67 @@ public Response getList(@PathVariable("apiName") String apiName, @PostMapping(value = "/{apiName}/add", produces = {"application/javascript", "application/json"}) @ApiOperation(value = "新增") - public Response addResource(@PathVariable("apiName") String apiName, + public String addResource(@PathVariable("apiName") String apiName, @RequestBody JSONObject obj, HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); int insert = configResourceManager.insert(apiName, obj, request); if(insert > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else if(insert == -1) { - return Response.responseMsg(ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @PutMapping(value = "/{apiName}/update", produces = {"application/javascript", "application/json"}) @ApiOperation(value = "修改") - public Response updateResource(@PathVariable("apiName") String apiName, + public String updateResource(@PathVariable("apiName") String apiName, @RequestBody JSONObject obj, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); int update = configResourceManager.update(apiName, obj, request); if(update > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else if(update == -1) { - return Response.responseMsg(ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @DeleteMapping(value = "/{apiName}/delete", produces = {"application/javascript", "application/json"}) @ApiOperation(value = "删除") - public Response deleteResource(@PathVariable("apiName") String apiName, + public String deleteResource(@PathVariable("apiName") String apiName, @RequestParam("id") Long id, HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); int delete = configResourceManager.delete(apiName, id, request); if(delete > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else if(delete == -1) { - return Response.responseMsg(ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @DeleteMapping(value = "/{apiName}/deleteBatch", produces = {"application/javascript", "application/json"}) @ApiOperation(value = "批量删除") - public Response batchDeleteResource(@PathVariable("apiName") String apiName, + public String batchDeleteResource(@PathVariable("apiName") String apiName, @RequestParam("ids") String ids, HttpServletRequest request)throws Exception { + Map objectMap = new HashMap(); int delete = configResourceManager.deleteBatch(apiName, ids, request); if(delete > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else if(delete == -1) { - return Response.responseMsg(ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @GetMapping(value = "/{apiName}/checkIsNameExist") @ApiOperation(value = "检查名称是否存在") - public Response> checkIsNameExist(@PathVariable("apiName") String apiName, + public String checkIsNameExist(@PathVariable("apiName") String apiName, @RequestParam Long id, @RequestParam(value ="name", required = false) String name, HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); @@ -168,7 +170,7 @@ public Response> checkIsNameExist(@PathVariable("apiName") S } else { objectMap.put("status", false); } - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } 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 157ca5f9..1ea6faeb 100644 --- a/api/src/main/java/com/wansensoft/api/account/AccountController.java +++ b/api/src/main/java/com/wansensoft/api/account/AccountController.java @@ -7,8 +7,7 @@ import com.wansensoft.service.systemConfig.SystemConfigService; import com.wansensoft.utils.BaseResponseInfo; import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.Response; -import com.wansensoft.utils.enums.CodeEnum; +import com.wansensoft.utils.ResponseJsonUtil; import com.wansensoft.vo.AccountVo4InOutList; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -16,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; @@ -154,15 +152,15 @@ public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Intege */ @PostMapping(value = "/updateIsDefault") @ApiOperation(value = "更新默认账户") - public Response updateIsDefault(@RequestBody JSONObject object, + public String updateIsDefault(@RequestBody JSONObject object, HttpServletRequest request) throws Exception{ Long accountId = object.getLong("id"); Map objectMap = new HashMap<>(); int res = accountService.updateIsDefault(accountId); if(res > 0) { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseData(CodeEnum.ERROR); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @@ -197,16 +195,16 @@ public BaseResponseInfo getStatistics(@RequestParam("name") String name, */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, + public String batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = accountService.batchSetStatus(status, ids); if(res > 0) { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseData(CodeEnum.ERROR); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } } 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 e91afdf5..a4e74fad 100644 --- a/api/src/main/java/com/wansensoft/api/account/AccountHeadController.java +++ b/api/src/main/java/com/wansensoft/api/account/AccountHeadController.java @@ -8,7 +8,8 @@ import com.wansensoft.utils.Response; import com.wansensoft.utils.constants.ExceptionConstants; import com.wansensoft.utils.BaseResponseInfo; -import com.wansensoft.utils.enums.CodeEnum; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -37,16 +38,16 @@ public class AccountHeadController { */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态-审核或者反审核") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, + public String batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request) throws Exception{ Map objectMap = new HashMap<>(); String status = jsonObject.getString("status"); String ids = jsonObject.getString("ids"); int res = accountHeadService.batchSetStatus(status, ids); if(res > 0) { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseData(CodeEnum.ERROR); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } 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 c36f7598..c2b857f1 100644 --- a/api/src/main/java/com/wansensoft/api/depot/DepotController.java +++ b/api/src/main/java/com/wansensoft/api/depot/DepotController.java @@ -9,7 +9,9 @@ import com.wansensoft.service.material.MaterialService; 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; @@ -142,15 +144,15 @@ public BaseResponseInfo findDepotByCurrentUser(HttpServletRequest request) throw */ @PostMapping(value = "/updateIsDefault") @ApiOperation(value = "更新默认仓库") - public Response updateIsDefault(@RequestBody JSONObject object, + public String updateIsDefault(@RequestBody JSONObject object, HttpServletRequest request) throws Exception{ Long depotId = object.getLong("id"); Map objectMap = new HashMap<>(); int res = depotService.updateIsDefault(depotId); if(res > 0) { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseData(CodeEnum.ERROR); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @@ -203,16 +205,16 @@ public BaseResponseInfo getAllList(@RequestParam("mId") Long mId, */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, + public String batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = depotService.batchSetStatus(status, ids); if(res > 0) { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseData(CodeEnum.ERROR); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } } 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 96d6ea82..109c8275 100644 --- a/api/src/main/java/com/wansensoft/api/depot/DepotHeadController.java +++ b/api/src/main/java/com/wansensoft/api/depot/DepotHeadController.java @@ -13,7 +13,6 @@ import com.wansensoft.utils.constants.ExceptionConstants; import com.wansensoft.service.redis.RedisService; import com.wansensoft.utils.*; -import com.wansensoft.utils.enums.CodeEnum; import com.wansensoft.vo.DepotHeadVo4InDetail; import com.wansensoft.vo.DepotHeadVo4InOutMCount; import com.wansensoft.vo.DepotHeadVo4List; @@ -66,16 +65,16 @@ public Response> getList(@RequestBody RetailOutboundDto r */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态-审核或者反审核") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, + public String batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request) throws Exception{ Map objectMap = new HashMap<>(); String status = jsonObject.getString("status"); String ids = jsonObject.getString("ids"); int res = depotHeadService.batchSetStatus(status, ids); if(res > 0) { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseData(CodeEnum.ERROR); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @@ -510,7 +509,7 @@ public BaseResponseInfo getCreatorByRoleType(HttpServletRequest request) { */ @GetMapping(value = "/debtList") @ApiOperation(value = "查询存在欠款的单据") - public Response debtList(@RequestParam(value = Constants.SEARCH, required = false) String search, + public String debtList(@RequestParam(value = Constants.SEARCH, required = false) String search, @RequestParam("currentPage") Integer currentPage, @RequestParam("pageSize") Integer pageSize, HttpServletRequest request)throws Exception { @@ -529,11 +528,11 @@ public Response debtList(@RequestParam(value = Constants.SEARCH, required = fals if (list != null) { objectMap.put("rows", list); objectMap.put("total", total); - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { objectMap.put("rows", new ArrayList<>()); objectMap.put("total", 0); - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); } } } diff --git a/api/src/main/java/com/wansensoft/api/depot/DepotItemController.java b/api/src/main/java/com/wansensoft/api/depot/DepotItemController.java index 104ae84e..5b02a93b 100644 --- a/api/src/main/java/com/wansensoft/api/depot/DepotItemController.java +++ b/api/src/main/java/com/wansensoft/api/depot/DepotItemController.java @@ -19,7 +19,6 @@ import com.wansensoft.utils.constants.ExceptionConstants; import com.wansensoft.plugins.exception.BusinessRunTimeException; import com.wansensoft.utils.*; -import com.wansensoft.utils.enums.CodeEnum; import com.wansensoft.vo.DepotItemStockWarningCount; import com.wansensoft.vo.DepotItemVoBatchNumberList; import io.swagger.annotations.Api; @@ -87,7 +86,7 @@ public DepotItemController(DepotHeadService depotHeadService, DepotItemService d */ @GetMapping(value = "/findDetailByDepotIdsAndMaterialId") @ApiOperation(value = "根据仓库和商品查询单据列表") - public Response findDetailByDepotIdsAndMaterialId( + public String findDetailByDepotIdsAndMaterialId( @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize, @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage, @RequestParam(value = "depotIds",required = false) String depotIds, @@ -131,12 +130,12 @@ public Response findDetailByDepotIdsAndMaterialId( if (list == null) { objectMap.put("rows", new ArrayList()); objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER); - return Response.responseMsg(CodeEnum.QUERY_DATA_EMPTY); + return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code); } objectMap.put("rows", dataArray); objectMap.put("total", depotItemService.findDetailByDepotIdsAndMaterialIdCount(depotIds, forceFlag, sku, batchNumber, StringUtil.toNull(number), beginTime, endTime, mId)); - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } /** diff --git a/api/src/main/java/com/wansensoft/api/function/FunctionController.java b/api/src/main/java/com/wansensoft/api/function/FunctionController.java index 66214cb2..f71aff99 100644 --- a/api/src/main/java/com/wansensoft/api/function/FunctionController.java +++ b/api/src/main/java/com/wansensoft/api/function/FunctionController.java @@ -13,7 +13,6 @@ import com.wansensoft.utils.StringUtil; import com.wansensoft.utils.Tools; import com.wansensoft.utils.*; -import com.wansensoft.utils.enums.CodeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -47,7 +46,7 @@ public FunctionController(FunctionService functionService, UserBusinessService u @GetMapping(value = "/checkIsNumberExist") @ApiOperation(value = "检查编号是否存在") - public Response> checkIsNumberExist(@RequestParam Long id, + public String checkIsNumberExist(@RequestParam Long id, @RequestParam(value ="number", required = false) String number, HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); @@ -57,7 +56,7 @@ public Response> checkIsNumberExist(@RequestParam Long id, } else { objectMap.put("status", false); } - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } /** diff --git a/api/src/main/java/com/wansensoft/api/inOutItem/InOutItemController.java b/api/src/main/java/com/wansensoft/api/inOutItem/InOutItemController.java index f8e6f0fe..a2de78c1 100644 --- a/api/src/main/java/com/wansensoft/api/inOutItem/InOutItemController.java +++ b/api/src/main/java/com/wansensoft/api/inOutItem/InOutItemController.java @@ -5,7 +5,7 @@ import com.wansensoft.entities.inOutItem.InOutItem; import com.wansensoft.service.inOutItem.InOutItemService; import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.Response; +import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -67,16 +67,16 @@ public String findBySelect(@RequestParam("type") String type, HttpServletRequest */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request)throws Exception { + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = inOutItemService.batchSetStatus(status, ids); if(res > 0) { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } } 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 5a24aae9..8352995c 100644 --- a/api/src/main/java/com/wansensoft/api/material/MaterialController.java +++ b/api/src/main/java/com/wansensoft/api/material/MaterialController.java @@ -11,8 +11,8 @@ import com.wansensoft.service.unit.UnitService; import com.wansensoft.utils.BaseResponseInfo; import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.Response; import com.wansensoft.utils.StringUtil; +import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -72,12 +72,12 @@ public MaterialController(MaterialService materialService, DepotItemService depo */ @GetMapping(value = "/checkIsExist") @ApiOperation(value = "检查商品是否存在") - public Response> checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name, - @RequestParam("model") String model, @RequestParam("color") String color, - @RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs, - @RequestParam("otherField1") String otherField1, @RequestParam("otherField2") String otherField2, - @RequestParam("otherField3") String otherField3, @RequestParam("unit") String unit, @RequestParam("unitId") Long unitId, - HttpServletRequest request)throws Exception { + public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name, + @RequestParam("model") String model, @RequestParam("color") String color, + @RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs, + @RequestParam("otherField1") String otherField1, @RequestParam("otherField2") String otherField2, + @RequestParam("otherField3") String otherField3, @RequestParam("unit") String unit,@RequestParam("unitId") Long unitId, + HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); int exist = materialService.checkIsExist(id, name, StringUtil.toNull(model), StringUtil.toNull(color), StringUtil.toNull(standard), StringUtil.toNull(mfrs), StringUtil.toNull(otherField1), @@ -87,7 +87,7 @@ public Response> checkIsExist(@RequestParam("id") Long id, @ } else { objectMap.put("status", false); } - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } /** @@ -99,16 +99,16 @@ public Response> checkIsExist(@RequestParam("id") Long id, @ */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态-启用或者禁用") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, + public String batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = materialService.batchSetStatus(status, ids); if(res > 0) { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @@ -623,14 +623,15 @@ public BaseResponseInfo getListWithStock(@RequestParam("currentPage") Integer cu */ @PostMapping(value = "/batchSetMaterialCurrentStock") @ApiOperation(value = "批量设置商品当前的实时库存(按每个仓库)") - public Response batchSetMaterialCurrentStock(@RequestBody JSONObject jsonObject, + public String batchSetMaterialCurrentStock(@RequestBody JSONObject jsonObject, HttpServletRequest request) { String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); int res = materialService.batchSetMaterialCurrentStock(ids); if(res > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @@ -642,12 +643,14 @@ public Response batchSetMaterialCurrentStock(@RequestBody JSONObject jsonObject, */ @PostMapping(value = "/batchUpdate") @ApiOperation(value = "批量更新商品信息") - public Response batchUpdate(@RequestBody JSONObject jsonObject) { + public String batchUpdate(@RequestBody JSONObject jsonObject, + HttpServletRequest request) { + Map objectMap = new HashMap<>(); int res = materialService.batchUpdate(jsonObject); if(res > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } } 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 312fc81e..fd822efc 100644 --- a/api/src/main/java/com/wansensoft/api/person/PersonController.java +++ b/api/src/main/java/com/wansensoft/api/person/PersonController.java @@ -5,7 +5,8 @@ import com.wansensoft.entities.person.Person; import com.wansensoft.service.person.PersonService; import com.wansensoft.utils.BaseResponseInfo; -import com.wansensoft.utils.Response; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -144,16 +145,16 @@ public JSONArray getPersonByNumType(@RequestParam("type") String typeNum, */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request) { + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = personService.batchSetStatus(status, ids); if(res > 0) { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } } 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 8b13b932..9ee75785 100644 --- a/api/src/main/java/com/wansensoft/api/platformConfig/PlatformConfigController.java +++ b/api/src/main/java/com/wansensoft/api/platformConfig/PlatformConfigController.java @@ -4,7 +4,8 @@ import com.wansensoft.entities.platformConfig.PlatformConfig; import com.wansensoft.service.platformConfig.PlatformConfigService; import com.wansensoft.utils.BaseResponseInfo; -import com.wansensoft.utils.Response; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -95,16 +96,16 @@ public String getPlatformRegisterFlag(HttpServletRequest request) { */ @PostMapping(value = "/updatePlatformConfigByKey") @ApiOperation(value = "根据platformKey更新platformValue") - public Response updatePlatformConfigByKey(@RequestBody JSONObject object, - HttpServletRequest request) { + public String updatePlatformConfigByKey(@RequestBody JSONObject object, + HttpServletRequest request)throws Exception { Map objectMap = new HashMap<>(); String platformKey = object.getString("platformKey"); String platformValue = object.getString("platformValue"); int res = platformConfigService.updatePlatformConfigByKey(platformKey, platformValue); if(res > 0) { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } 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 45c42bfc..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,7 +5,9 @@ import com.wansensoft.entities.role.Role; import com.wansensoft.service.role.RoleService; import com.wansensoft.service.userBusiness.UserBusinessService; -import com.wansensoft.utils.Response; +import com.wansensoft.service.userBusiness.UserBusinessServiceImpl; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -76,16 +78,16 @@ public List allList(HttpServletRequest request)throws Exception { */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request) { + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = roleService.batchSetStatus(status, ids); if(res > 0) { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } } 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 b2267602..cc975cdc 100644 --- a/api/src/main/java/com/wansensoft/api/serialNumber/SerialNumberController.java +++ b/api/src/main/java/com/wansensoft/api/serialNumber/SerialNumberController.java @@ -10,6 +10,7 @@ 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; @@ -46,7 +47,7 @@ public SerialNumberController(SerialNumberService serialNumberService, DepotHead */ @PostMapping("/batAddSerialNumber") @ApiOperation(value = "批量添加序列号") - public Response 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"); @@ -54,11 +55,11 @@ public Response batAddSerialNumber(@RequestBody JSONObject jsonObject, HttpServl String remark = jsonObject.getString("remark"); int insert = serialNumberService.batAddSerialNumber(materialCode,serialNumberPrefix,batAddTotal,remark); if(insert > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else if(insert == -1) { - return Response.responseMsg(ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.TEST_USER.name, ErpInfo.TEST_USER.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } 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 ba650422..340dc6c8 100644 --- a/api/src/main/java/com/wansensoft/api/supplier/SupplierController.java +++ b/api/src/main/java/com/wansensoft/api/supplier/SupplierController.java @@ -10,7 +10,7 @@ import com.wansensoft.utils.BaseResponseInfo; import com.wansensoft.utils.ErpInfo; import com.wansensoft.utils.ExcelUtils; -import com.wansensoft.utils.Response; +import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; @@ -45,7 +45,7 @@ public SupplierController(SupplierService supplierService, UserBusinessService u @GetMapping(value = "/checkIsNameAndTypeExist") @ApiOperation(value = "检查名称和类型是否存在") - public Response > checkIsNameAndTypeExist(@RequestParam Long id, + public String checkIsNameAndTypeExist(@RequestParam Long id, @RequestParam(value ="name", required = false) String name, @RequestParam(value ="type") String type, HttpServletRequest request)throws Exception { @@ -56,7 +56,7 @@ public Response > checkIsNameAndTypeExist(@RequestParam Long } else { objectMap.put("status", false); } - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } /** @@ -204,15 +204,16 @@ public JSONArray findBySelectRetail(HttpServletRequest request) { */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request) { + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); int res = supplierService.batchSetStatus(status, ids); if(res > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } diff --git a/api/src/main/java/com/wansensoft/api/tenant/TenantController.java b/api/src/main/java/com/wansensoft/api/tenant/TenantController.java index 053aa5fe..1c7ee3b2 100644 --- a/api/src/main/java/com/wansensoft/api/tenant/TenantController.java +++ b/api/src/main/java/com/wansensoft/api/tenant/TenantController.java @@ -3,7 +3,7 @@ import com.alibaba.fastjson.JSONObject; import com.wansensoft.service.tenant.TenantService; import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.Response; +import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; @@ -30,16 +30,16 @@ public TenantController(TenantService tenantService) { */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, + public String batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); Map objectMap = new HashMap<>(); int res = tenantService.batchSetStatus(status, ids); if(res > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } } 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 ef06968b..af0a04a0 100644 --- a/api/src/main/java/com/wansensoft/api/unit/UnitController.java +++ b/api/src/main/java/com/wansensoft/api/unit/UnitController.java @@ -5,13 +5,16 @@ import com.wansensoft.service.unit.UnitService; import com.wansensoft.utils.BaseResponseInfo; import com.wansensoft.utils.ErpInfo; -import com.wansensoft.utils.Response; +import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import jakarta.servlet.http.HttpServletRequest; + +import java.util.HashMap; import java.util.List; +import java.util.Map; @RestController @RequestMapping(value = "/unit") @@ -53,15 +56,16 @@ public BaseResponseInfo getAllList(HttpServletRequest request) { */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, - HttpServletRequest request) { + public String batchSetStatus(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { Boolean status = jsonObject.getBoolean("status"); String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); int res = unitService.batchSetStatus(status, ids); if(res > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } } 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 4c956aa5..49505521 100644 --- a/api/src/main/java/com/wansensoft/api/user/UserBusinessController.java +++ b/api/src/main/java/com/wansensoft/api/user/UserBusinessController.java @@ -5,7 +5,8 @@ import com.wansensoft.service.user.UserService; import com.wansensoft.service.userBusiness.UserBusinessService; import com.wansensoft.utils.BaseResponseInfo; -import com.wansensoft.utils.Response; +import com.wansensoft.utils.ErpInfo; +import com.wansensoft.utils.ResponseJsonUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; @@ -64,9 +65,9 @@ public BaseResponseInfo getBasicData(@RequestParam(value = "KeyId") String keyId */ @GetMapping(value = "/checkIsValueExist") @ApiOperation(value = "校验存在") - public Response checkIsValueExist(@RequestParam(value ="type", required = false) String type, - @RequestParam(value ="keyId", required = false) String keyId, - HttpServletRequest request) { + public String checkIsValueExist(@RequestParam(value ="type", required = false) String type, + @RequestParam(value ="keyId", required = false) String keyId, + HttpServletRequest request)throws Exception { Map objectMap = new HashMap(); Long id = userBusinessService.checkIsValueExist(type, keyId); if(id != null) { @@ -74,7 +75,7 @@ public Response checkIsValueExist(@RequestParam(value ="type", required = false) } else { objectMap.put("id", null); } - return Response.responseData(objectMap); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } /** 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 f34c8d15..fa96b706 100644 --- a/api/src/main/java/com/wansensoft/api/user/UserController.java +++ b/api/src/main/java/com/wansensoft/api/user/UserController.java @@ -96,15 +96,17 @@ public BaseResponseInfo weixinLogin(@RequestBody JSONObject jsonObject, @PostMapping(value = "/weixinBind") @ApiOperation(value = "绑定微信") - public Response weixinBind(@RequestBody JSONObject jsonObject) { + public String weixinBind(@RequestBody JSONObject jsonObject, + HttpServletRequest request)throws Exception { + Map objectMap = new HashMap<>(); String loginName = jsonObject.getString("loginName"); String password = jsonObject.getString("password"); String weixinCode = jsonObject.getString("weixinCode"); int res = userService.weixinBind(loginName, password, weixinCode); if(res > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } @@ -144,7 +146,7 @@ public BaseResponseInfo logout(HttpServletRequest request, HttpServletResponse r @PostMapping(value = "/resetPwd") @ApiOperation(value = "重置密码") - public Response resetPwd(@RequestBody JSONObject jsonObject, + public String resetPwd(@RequestBody JSONObject jsonObject, HttpServletRequest request) throws Exception { Map objectMap = new HashMap<>(); Long id = jsonObject.getLong("id"); @@ -152,15 +154,15 @@ public Response resetPwd(@RequestBody JSONObject jsonObject, String md5Pwd = Tools.md5Encryp(password); int update = userService.resetPwd(md5Pwd, id); if(update > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, SUCCESS, ErpInfo.OK.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ERROR, ErpInfo.ERROR.code); } } @PutMapping(value = "/updatePwd") @ApiOperation(value = "更新密码") - public Response updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { + public String updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Integer flag = 0; Map objectMap = new HashMap(); try { @@ -180,15 +182,15 @@ public Response updatePwd(@RequestBody JSONObject jsonObject, HttpServletRequest } objectMap.put("status", flag); if(flag > 0) { - return Response.responseData(info); + return ResponseJsonUtil.returnJson(objectMap, info, ErpInfo.OK.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ERROR, ErpInfo.ERROR.code); } } catch (Exception e) { logger.error(">>>>>>>>>>>>>修改用户ID为 : " + jsonObject.getLong("userId") + "密码信息失败", e); flag = 3; objectMap.put("status", flag); - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ERROR, ErpInfo.ERROR.code); } } @@ -396,15 +398,16 @@ public BaseResponseInfo randomImage(HttpServletResponse response,@PathVariable S */ @PostMapping(value = "/batchSetStatus") @ApiOperation(value = "批量设置状态") - public Response batchSetStatus(@RequestBody JSONObject jsonObject, + public String batchSetStatus(@RequestBody JSONObject jsonObject, HttpServletRequest request)throws Exception { Byte status = jsonObject.getByte("status"); String ids = jsonObject.getString("ids"); + Map objectMap = new HashMap<>(); int res = userService.batchSetStatus(status, ids, request); if(res > 0) { - return Response.responseMsg(ErpInfo.OK.name, ErpInfo.OK.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); } else { - return Response.responseMsg(ErpInfo.ERROR.name, ErpInfo.ERROR.code); + return ResponseJsonUtil.returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); } } 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/depotHead/DepotHeadService.java b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java index 4c0245ec..b93c6438 100644 --- a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java +++ b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadService.java @@ -129,6 +129,4 @@ int debtListCount(Long organId, String materialParam, String number, String begi String getBillCategory(String subType); List selectByConditionDepotHead(RetailOutboundDto retailOutboundDto); - - String getCreatorByRoleType(String roleType, String userId); } \ 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 f7f86dc2..469a33bf 100644 --- a/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java +++ b/service/src/main/java/com/wansensoft/service/depotHead/DepotHeadServiceImpl.java @@ -65,9 +65,7 @@ public class DepotHeadServiceImpl extends ServiceImpl getFinishDepositMapByNumberList(List numberList) { Map finishDepositMap = new HashMap<>(); if(!numberList.isEmpty()) { @@ -1344,7 +1306,7 @@ public List selectByConditionDepotHead(RetailOutboundDto retai try{ String depotIds = String.valueOf(depotService.findDepotByCurrentUserTest(String.valueOf(retailOutboundDto.getCreator()))); String [] depotArray=depotIds.split(","); - String [] creatorArray = getCreatorArray(retailOutboundDto.getRoleType(), String.valueOf(retailOutboundDto.getCreator())); + 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 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 06cb8d85..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; @@ -53,25 +55,23 @@ 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; - private final RedisUtil redisUtil; + private final RoleMapperEx roleMapperEx; - public UserServiceImpl(UserMapper userMapper, UserMapperEx userMapperEx, OrgaUserRelService orgaUserRelService, LogService logService, TenantService tenantService, UserBusinessService userBusinessService, CommonService commonService, FunctionService functionService, PlatformConfigService platformConfigService, RedisService redisService, RedisUtil redisUtil) { + 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; - this.redisUtil = redisUtil; } public User getUser(long id) { @@ -765,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("]",""); } @@ -779,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/utils/src/main/java/com/wansensoft/utils/ErpInfo.java b/utils/src/main/java/com/wansensoft/utils/ErpInfo.java index cb255485..0785c539 100644 --- a/utils/src/main/java/com/wansensoft/utils/ErpInfo.java +++ b/utils/src/main/java/com/wansensoft/utils/ErpInfo.java @@ -5,21 +5,21 @@ */ public enum ErpInfo { //通过构造传递参数 - OK("200", "成功"), - BAD_REQUEST("400", "请求错误或参数错误"), - UNAUTHORIZED("401", "未认证用户"), - INVALID_VERIFY_CODE("461", "错误的验证码"), - ERROR("500", "服务内部错误"), - WARING_MSG("201", "提醒信息"), - REDIRECT("301", "session失效,重定向"), - FORWARD_REDIRECT("302", "转发请求session失效"), - FORWARD_FAILED("303", "转发请求失败!"), - TEST_USER("-1", "演示用户禁止操作"); + OK(200, "成功"), + BAD_REQUEST(400, "请求错误或参数错误"), + UNAUTHORIZED(401, "未认证用户"), + INVALID_VERIFY_CODE(461, "错误的验证码"), + ERROR(500, "服务内部错误"), + WARING_MSG(201, "提醒信息"), + REDIRECT(301, "session失效,重定向"), + FORWARD_REDIRECT(302, "转发请求session失效"), + FORWARD_FAILED(303, "转发请求失败!"), + TEST_USER(-1, "演示用户禁止操作"); - public final String code; + public final int code; public final String name; - public String getCode() { + public int getCode() { return code; } @@ -30,7 +30,7 @@ public String getName() { /** * 定义枚举构造函数 */ - ErpInfo(String code, String name) { + ErpInfo(int code, String name) { this.code = code; this.name = name; } From f4b67445994fe29cb892b5e8ab39aa8507f8a554 Mon Sep 17 00:00:00 2001 From: jameszow Date: Wed, 6 Sep 2023 00:31:07 +0800 Subject: [PATCH 09/10] annotation not use code --- .../api/config/MybatisPlusConfig.java | 156 ++++++++++++++++++ .../api/config/PluginConfiguration.java | 71 ++++++++ .../wansensoft/api/config/Swagger2Config.java | 44 +++++ 3 files changed, 271 insertions(+) create mode 100644 api/src/main/java/com/wansensoft/api/config/MybatisPlusConfig.java create mode 100644 api/src/main/java/com/wansensoft/api/config/PluginConfiguration.java create mode 100644 api/src/main/java/com/wansensoft/api/config/Swagger2Config.java diff --git a/api/src/main/java/com/wansensoft/api/config/MybatisPlusConfig.java b/api/src/main/java/com/wansensoft/api/config/MybatisPlusConfig.java new file mode 100644 index 00000000..77fa1a0e --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/config/MybatisPlusConfig.java @@ -0,0 +1,156 @@ +package com.wansensoft.api.config; + +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.context.annotation.Configuration; + +@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(); +// tenantSqlParser.setTenantHandler(new TenantHandler() { +// @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; +// } +// } +// +// @Override +// public String getTenantIdColumn() { +// return "tenant_id"; +// } +// +// @Override +// public boolean doTableFilter(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; +// } +// }); +// +// sqlParserList.add(tenantSqlParser); +// paginationInterceptor.setSqlParserList(sqlParserList); +// paginationInterceptor.setSqlParserFilter(new ISqlParserFilter() { +// @Override +// public boolean doFilter(MetaObject metaObject) { +// MappedStatement ms = SqlParserHelper.getMappedStatement(metaObject); +// // 过滤自定义查询此时无租户信息约束出现 +// if ("com.jsh.erp.datasource.mappers.UserMapperEx.getUserByWeixinOpenId".equals(ms.getId())) { +// return true; +// } else if ("com.jsh.erp.datasource.mappers.UserMapperEx.updateUserWithWeixinOpenId".equals(ms.getId())) { +// return true; +// } else if ("com.jsh.erp.datasource.mappers.UserMapperEx.getUserListByUserNameOrLoginName".equals(ms.getId())) { +// return true; +// } else if ("com.jsh.erp.datasource.mappers.UserMapperEx.disableUserByLimit".equals(ms.getId())) { +// return true; +// } else if ("com.jsh.erp.datasource.mappers.RoleMapperEx.getRoleWithoutTenant".equals(ms.getId())) { +// return true; +// } else if ("com.jsh.erp.datasource.mappers.LogMapperEx.insertLogWithUserId".equals(ms.getId())) { +// return true; +// } +// return false; +// } +// }); +// return paginationInterceptor; +// } + + /** + * 相当于顶部的: + * {@code @MapperScan("com.wansensoft.erp.datasource.mappers*")} + * 这里可以扩展,比如使用配置文件来配置扫描Mapper的路径 + */ +// @Bean +// public MapperScannerConfigurer mapperScannerConfigurer() { +// MapperScannerConfigurer scannerConfigurer = new MapperScannerConfigurer(); +// scannerConfigurer.setBasePackage("com.wansensoft.mappers*"); +// return scannerConfigurer; +// } + + /** + * 性能分析拦截器,不建议生产使用 + */ +// @Bean +// public PerformanceInterceptor performanceInterceptor(){ +// 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/api/src/main/java/com/wansensoft/api/config/Swagger2Config.java b/api/src/main/java/com/wansensoft/api/config/Swagger2Config.java new file mode 100644 index 00000000..fb4dd2e8 --- /dev/null +++ b/api/src/main/java/com/wansensoft/api/config/Swagger2Config.java @@ -0,0 +1,44 @@ +package com.wansensoft.api.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +/** + * 插件集成配置 + * + * @author jishenghua + * @version 1.0 + */ +@Configuration +@EnableSwagger2 +public class Swagger2Config { + + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(this.apiInfo()) + .select() + .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build(); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("WanSen ERP Restful Api") + .description("WanSen ERP接口描述") + .termsOfServiceUrl("http://127.0.0.1") + .contact(new Contact("WanSen ERP", "", "")) + .version("1.0.1") + .build(); + } + +} From c5e32fe2e4d6e0f618506cc8bafed6758b442ce2 Mon Sep 17 00:00:00 2001 From: jameszow Date: Wed, 6 Sep 2023 00:31:53 +0800 Subject: [PATCH 10/10] update ComponentScan --- api/src/main/java/com/wansensoft/api/ErpApplication.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/com/wansensoft/api/ErpApplication.java b/api/src/main/java/com/wansensoft/api/ErpApplication.java index 9f8973ec..613478da 100644 --- a/api/src/main/java/com/wansensoft/api/ErpApplication.java +++ b/api/src/main/java/com/wansensoft/api/ErpApplication.java @@ -13,7 +13,8 @@ @EnableScheduling @MapperScan("com.wansensoft.mappers") -@SpringBootApplication(scanBasePackages = {"com.wansensoft"}) +@ComponentScan("com.wansensoft") +@SpringBootApplication public class ErpApplication { public static void main(String[] args) throws IOException { @@ -23,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"); } + }