diff --git a/.gitignore b/.gitignore
index 957d4bcd..fd35dd9c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,9 +13,10 @@
hs_err_pid*
.idea
-**/target
+**/target/
/logs.home_IS_UNDEFINED
**/*.iml
.gitattributes
+/api/src/main/resources/application-prod.yml
\ No newline at end of file
diff --git a/api/src/main/java/com/wansensoft/api/ErpApplication.java b/api/src/main/java/com/wansensoft/api/ErpApplication.java
index 07e7a9d6..613478da 100644
--- a/api/src/main/java/com/wansensoft/api/ErpApplication.java
+++ b/api/src/main/java/com/wansensoft/api/ErpApplication.java
@@ -11,10 +11,10 @@
import java.io.IOException;
+@EnableScheduling
@MapperScan("com.wansensoft.mappers")
@ComponentScan("com.wansensoft")
@SpringBootApplication
-@EnableScheduling
public class ErpApplication {
public static void main(String[] args) throws IOException {
@@ -24,4 +24,5 @@ public static void main(String[] args) throws IOException {
+ environment.getProperty("server.port") + "/wansenerp/doc.html");
System.out.println("您还需启动前端服务,启动命令:yarn run serve 或 npm run serve,测试用户:wansenerp,密码:123456");
}
+
}
diff --git a/api/src/main/java/com/wansensoft/api/IncomeExpenseController.java b/api/src/main/java/com/wansensoft/api/IncomeExpenseController.java
new file mode 100644
index 00000000..54a54d15
--- /dev/null
+++ b/api/src/main/java/com/wansensoft/api/IncomeExpenseController.java
@@ -0,0 +1,19 @@
+package com.wansensoft.api;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ *
+ * 收支项目 前端控制器
+ *
+ *
+ * @author James Zow
+ * @since 2023-09-05
+ */
+@RestController
+@RequestMapping("/incomeExpense")
+public class IncomeExpenseController {
+
+}
diff --git a/api/src/main/java/com/wansensoft/api/LogController.java b/api/src/main/java/com/wansensoft/api/LogController.java
new file mode 100644
index 00000000..feced9fa
--- /dev/null
+++ b/api/src/main/java/com/wansensoft/api/LogController.java
@@ -0,0 +1,43 @@
+package com.wansensoft.api;
+
+import com.wansensoft.entities.log.Log;
+import com.wansensoft.entities.user.User;
+import com.wansensoft.service.log.LogService;
+import com.wansensoft.utils.BaseResponseInfo;
+import jakarta.servlet.http.HttpServletRequest;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping(value = "/log")
+public class LogController {
+
+ private final LogService logService;
+
+ public LogController(LogService logService) {
+ this.logService = logService;
+ }
+
+ @GetMapping("/getAllList")
+ public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception {
+ BaseResponseInfo res = new BaseResponseInfo();
+ try {
+ Map data = new HashMap<>();
+ List dataList = logService.getLog();
+ if(dataList!=null) {
+ data.put("logList", dataList);
+ }
+ res.code = 200;
+ res.data = data;
+ } catch(Exception e){
+ res.code = 500;
+ res.data = "获取失败";
+ }
+ return res;
+ }
+}
diff --git a/api/src/main/java/com/wansensoft/api/OperatorController.java b/api/src/main/java/com/wansensoft/api/OperatorController.java
new file mode 100644
index 00000000..132fb3a9
--- /dev/null
+++ b/api/src/main/java/com/wansensoft/api/OperatorController.java
@@ -0,0 +1,20 @@
+package com.wansensoft.api;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ *
+ * 经手人表 前端控制器
+ *
+ *
+ * @author James Zow
+ * @since 2023-09-05
+ */
+@RestController
+@RequestMapping("/operator")
+public class OperatorController {
+
+}
diff --git a/api/src/main/java/com/wansensoft/api/PluginController.java b/api/src/main/java/com/wansensoft/api/PluginController.java
index 58d9cbf4..2cb62487 100644
--- a/api/src/main/java/com/wansensoft/api/PluginController.java
+++ b/api/src/main/java/com/wansensoft/api/PluginController.java
@@ -1,11 +1,14 @@
-package com.wansensoft.api;//package com.wansensoft.erp.controller;
+//package com.wansensoft.api;
//
-//import constants.com.wansensoft.BusinessConstants;
-//import entities.datasource.com.wansensoft.User;
-//import user.service.com.wansensoft.UserService;
-//import utils.com.wansensoft.utils.BaseResponseInfo;
-//import utils.com.wansensoft.utils.ComputerInfo;
-//import utils.com.wansensoft.utils.StringUtil;
+//import com.gitee.starblues.core.PluginInfo;
+//import com.gitee.starblues.integration.application.PluginApplication;
+//import com.gitee.starblues.integration.operator.PluginOperator;
+//import com.wansensoft.entities.user.User;
+//import com.wansensoft.service.user.UserService;
+//import com.wansensoft.utils.BaseResponseInfo;
+//import com.wansensoft.utils.ComputerInfo;
+//import com.wansensoft.utils.StringUtil;
+//import com.wansensoft.utils.constants.BusinessConstants;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
@@ -13,29 +16,27 @@
//import org.springframework.web.bind.annotation.*;
//import org.springframework.web.multipart.MultipartFile;
//
-//import jakarta.annotation.Resource;
//import jakarta.servlet.http.HttpServletRequest;
//import jakarta.servlet.http.HttpServletResponse;
//import java.nio.file.Paths;
//import java.util.*;
//
///**
-// * 插件jar 包测试功能
-// * @author jishenghua
-// * @version 1.0
+// * 插件包
+// *
// */
//@RestController
//@RequestMapping("/plugin")
//@Api(tags = {"插件管理"})
//public class PluginController {
//
-// @Resource
-// private UserService userService;
+// private final UserService userService;
//
// private final PluginOperator pluginOperator;
//
// @Autowired
-// public PluginController(PluginApplication pluginApplication) {
+// public PluginController(UserService userService, PluginApplication pluginApplication) {
+// this.userService = userService;
// this.pluginOperator = pluginApplication.getPluginOperator();
// }
// /**
@@ -59,7 +60,7 @@
// resList = list;
// } else {
// for (PluginInfo pi : list) {
-// String desc = pi.getPluginDescriptor().getPluginDescription();
+// String desc = pi.getPluginDescriptor().getDescription();
// if (desc.contains(name)) {
// resList.add(pi);
// }
@@ -82,21 +83,21 @@
// * 获取插件jar文件名
// * @return 获取插件文件名。只在生产环境显示
// */
-// @GetMapping("/files")
-// @ApiOperation(value = "获取插件jar文件名")
-// public Set getPluginFilePaths(){
-// try {
-// User userInfo = userService.getCurrentUser();
-// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
-// return pluginOperator.getPluginFilePaths();
-// } else {
-// return null;
-// }
-// } catch (Exception e) {
-// e.printStackTrace();
-// return null;
-// }
-// }
+//// @GetMapping("/files")
+//// @ApiOperation(value = "获取插件jar文件名")
+//// public Set getPluginFilePaths(){
+//// try {
+//// User userInfo = userService.getCurrentUser();
+//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
+//// return pluginOperator.getPluginFilePaths();
+//// } else {
+//// return null;
+//// }
+//// } catch (Exception e) {
+//// e.printStackTrace();
+//// return null;
+//// }
+//// }
//
//
// /**
@@ -173,34 +174,34 @@
// * @param id 插件id
// * @return 返回操作结果
// */
-// @PostMapping("/uninstall/{id}")
-// @ApiOperation(value = "根据插件id卸载插件")
-// public BaseResponseInfo uninstall(@PathVariable("id") String id){
-// BaseResponseInfo res = new BaseResponseInfo();
-// Map map = new HashMap();
-// String message = "";
-// try {
-// User userInfo = userService.getCurrentUser();
-// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
-// if (pluginOperator.uninstall(id, true)) {
-// message = "plugin '" + id + "' uninstall success";
-// } else {
-// message = "plugin '" + id + "' uninstall failure";
-// }
-// } else {
-// message = "power is limit";
-// }
-// map.put("message", message);
-// res.code = 200;
-// res.data = map;
-// } catch (Exception e) {
-// e.printStackTrace();
-// map.put("message", "plugin '" + id +"' uninstall failure. " + e.getMessage());
-// res.code = 500;
-// res.data = map;
-// }
-// return res;
-// }
+//// @PostMapping("/uninstall/{id}")
+//// @ApiOperation(value = "根据插件id卸载插件")
+//// public BaseResponseInfo uninstall(@PathVariable("id") String id){
+//// BaseResponseInfo res = new BaseResponseInfo();
+//// Map map = new HashMap();
+//// String message = "";
+//// try {
+//// User userInfo = userService.getCurrentUser();
+//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
+//// if (pluginOperator.uninstall(id, true)) {
+//// message = "plugin '" + id + "' uninstall success";
+//// } else {
+//// message = "plugin '" + id + "' uninstall failure";
+//// }
+//// } else {
+//// message = "power is limit";
+//// }
+//// map.put("message", message);
+//// res.code = 200;
+//// res.data = map;
+//// } catch (Exception e) {
+//// e.printStackTrace();
+//// map.put("message", "plugin '" + id +"' uninstall failure. " + e.getMessage());
+//// res.code = 500;
+//// res.data = map;
+//// }
+//// return res;
+//// }
//
//
// /**
@@ -208,25 +209,25 @@
// * @param path 插件路径名称
// * @return 操作结果
// */
-// @PostMapping("/installByPath")
-// @ApiOperation(value = "根据插件路径安装插件")
-// public String install(@RequestParam("path") String path){
-// try {
-// User userInfo = userService.getCurrentUser();
-// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
-// if (pluginOperator.install(Paths.get(path))) {
-// return "installByPath success";
-// } else {
-// return "installByPath failure";
-// }
-// } else {
-// return "installByPath failure";
-// }
-// } catch (Exception e) {
-// e.printStackTrace();
-// return "installByPath failure : " + e.getMessage();
-// }
-// }
+//// @PostMapping("/installByPath")
+//// @ApiOperation(value = "根据插件路径安装插件")
+//// public String install(@RequestParam("path") String path){
+//// try {
+//// User userInfo = userService.getCurrentUser();
+//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
+//// if (pluginOperator.install(Paths.get(path))) {
+//// return "installByPath success";
+//// } else {
+//// return "installByPath failure";
+//// }
+//// } else {
+//// return "installByPath failure";
+//// }
+//// } catch (Exception e) {
+//// e.printStackTrace();
+//// return "installByPath failure : " + e.getMessage();
+//// }
+//// }
//
//
// /**
@@ -234,78 +235,78 @@
// * @param file 上传文件 multipartFile
// * @return 操作结果
// */
-// @PostMapping("/uploadInstallPluginJar")
-// @ApiOperation(value = "上传并安装插件")
-// public BaseResponseInfo install(MultipartFile file, HttpServletRequest request, HttpServletResponse response){
-// BaseResponseInfo res = new BaseResponseInfo();
-// try {
-// User userInfo = userService.getCurrentUser();
-// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
-// pluginOperator.uploadPluginAndStart(file);
-// res.code = 200;
-// res.data = "导入成功";
-// } else {
-// res.code = 500;
-// res.data = "抱歉,无操作权限!";
-// }
-// } catch(Exception e){
-// e.printStackTrace();
-// res.code = 500;
-// res.data = "导入失败";
-// }
-// return res;
-// }
+//// @PostMapping("/uploadInstallPluginJar")
+//// @ApiOperation(value = "上传并安装插件")
+//// public BaseResponseInfo install(MultipartFile file, HttpServletRequest request, HttpServletResponse response){
+//// BaseResponseInfo res = new BaseResponseInfo();
+//// try {
+//// User userInfo = userService.getCurrentUser();
+//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
+//// pluginOperator.uploadPluginAndStart(file);
+//// res.code = 200;
+//// res.data = "导入成功";
+//// } else {
+//// res.code = 500;
+//// res.data = "抱歉,无操作权限!";
+//// }
+//// } catch(Exception e){
+//// e.printStackTrace();
+//// res.code = 500;
+//// res.data = "导入失败";
+//// }
+//// return res;
+//// }
+////
+//// /**
+//// * 上传插件的配置文件。注意: 该操作只适用于生产环境
+//// * @param multipartFile 上传文件 multipartFile
+//// * @return 操作结果
+//// */
+//// @PostMapping("/uploadPluginConfigFile")
+//// @ApiOperation(value = "上传插件的配置文件")
+//// public String uploadConfig(@RequestParam("configFile") MultipartFile multipartFile){
+//// try {
+//// User userInfo = userService.getCurrentUser();
+//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
+//// if (pluginOperator.uploadConfigFile(multipartFile)) {
+//// return "uploadConfig success";
+//// } else {
+//// return "uploadConfig failure";
+//// }
+//// } else {
+//// return "installByPath failure";
+//// }
+//// } catch (Exception e) {
+//// e.printStackTrace();
+//// return "uploadConfig failure : " + e.getMessage();
+//// }
+//// }
//
-// /**
-// * 上传插件的配置文件。注意: 该操作只适用于生产环境
-// * @param multipartFile 上传文件 multipartFile
-// * @return 操作结果
-// */
-// @PostMapping("/uploadPluginConfigFile")
-// @ApiOperation(value = "上传插件的配置文件")
-// public String uploadConfig(@RequestParam("configFile") MultipartFile multipartFile){
-// try {
-// User userInfo = userService.getCurrentUser();
-// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
-// if (pluginOperator.uploadConfigFile(multipartFile)) {
-// return "uploadConfig success";
-// } else {
-// return "uploadConfig failure";
-// }
-// } else {
-// return "installByPath failure";
-// }
-// } catch (Exception e) {
-// e.printStackTrace();
-// return "uploadConfig failure : " + e.getMessage();
-// }
-// }
//
-//
-// /**
-// * 备份插件。注意: 该操作只适用于生产环境
-// * @param pluginId 插件id
-// * @return 操作结果
-// */
-// @PostMapping("/back/{pluginId}")
-// @ApiOperation(value = "备份插件")
-// public String backupPlugin(@PathVariable("pluginId") String pluginId){
-// try {
-// User userInfo = userService.getCurrentUser();
-// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
-// if (pluginOperator.backupPlugin(pluginId, "testBack")) {
-// return "backupPlugin success";
-// } else {
-// return "backupPlugin failure";
-// }
-// } else {
-// return "backupPlugin failure";
-// }
-// } catch (Exception e) {
-// e.printStackTrace();
-// return "backupPlugin failure : " + e.getMessage();
-// }
-// }
+//// /**
+//// * 备份插件。注意: 该操作只适用于生产环境
+//// * @param pluginId 插件id
+//// * @return 操作结果
+//// */
+//// @PostMapping("/back/{pluginId}")
+//// @ApiOperation(value = "备份插件")
+//// public String backupPlugin(@PathVariable("pluginId") String pluginId){
+//// try {
+//// User userInfo = userService.getCurrentUser();
+//// if(BusinessConstants.DEFAULT_MANAGER.equals(userInfo.getLoginName())) {
+//// if (pluginOperator.backupPlugin(pluginId, "testBack")) {
+//// return "backupPlugin success";
+//// } else {
+//// return "backupPlugin failure";
+//// }
+//// } else {
+//// return "backupPlugin failure";
+//// }
+//// } catch (Exception e) {
+//// e.printStackTrace();
+//// return "backupPlugin failure : " + e.getMessage();
+//// }
+//// }
//
// /**
// * 获取加密后的mac
diff --git a/api/src/main/java/com/wansensoft/api/ResourceController.java b/api/src/main/java/com/wansensoft/api/ResourceController.java
index ef3108d5..abdbd188 100644
--- a/api/src/main/java/com/wansensoft/api/ResourceController.java
+++ b/api/src/main/java/com/wansensoft/api/ResourceController.java
@@ -4,11 +4,11 @@
import com.wansensoft.utils.constants.BusinessConstants;
import com.wansensoft.service.CommonQueryManager;
import com.wansensoft.utils.*;
+import com.wansensoft.utils.enums.CodeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
-import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
@@ -19,8 +19,11 @@
@Api(tags = {"资源接口"})
public class ResourceController {
- @Resource
- private CommonQueryManager configResourceManager;
+ private final CommonQueryManager configResourceManager;
+
+ public ResourceController(CommonQueryManager configResourceManager) {
+ this.configResourceManager = configResourceManager;
+ }
@GetMapping(value = "/{apiName}/info")
@ApiOperation(value = "根据id获取信息")
@@ -46,7 +49,7 @@ public String getList(@PathVariable("apiName") String apiName,
HttpServletRequest request)throws Exception {
Map parameterMap = ParamUtils.requestToMap(request);
parameterMap.put(Constants.SEARCH, search);
- Map objectMap = new HashMap();
+ Map objectMap = new HashMap<>();
if (pageSize != null && pageSize <= 0) {
pageSize = 10;
}
@@ -65,6 +68,35 @@ public String getList(@PathVariable("apiName") String apiName,
return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
}
+// @GetMapping(value = "/{apiName}/list")
+// @ApiOperation(value = "获取信息列表")
+// public String getList(@PathVariable("apiName") String apiName,
+// @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
+// @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
+// @RequestParam(value = Constants.SEARCH, required = false) String search,
+// HttpServletRequest request)throws Exception {
+// Map parameterMap = ParamUtils.requestToMap(request);
+// parameterMap.put(Constants.SEARCH, search);
+// Map objectMap = new HashMap();
+// if (pageSize != null && pageSize <= 0) {
+// pageSize = 10;
+// }
+// String offset = ParamUtils.getPageOffset(currentPage, pageSize);
+// if (StringUtil.isNotEmpty(offset)) {
+// parameterMap.put(Constants.OFFSET, offset);
+// }
+// List> list = configResourceManager.select(apiName, parameterMap);
+// if (list != null) {
+// objectMap.put("total", configResourceManager.counts(apiName, parameterMap));
+// objectMap.put("rows", list);
+// System.err.println(ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, Integer.parseInt(ErpInfo.OK.code)));
+// return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, Integer.parseInt(ErpInfo.OK.code));
+// } else {
+// objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER);
+// objectMap.put("rows", new ArrayList