From b6565928899fb7d817959466c96c5246f511bd83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E4=BA=91=E6=98=8A?= Date: Sun, 16 Jun 2019 13:36:08 +0800 Subject: [PATCH] =?UTF-8?q?excel=E5=B7=A5=E5=85=B7=E7=B1=BB=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/busi/SysLogExceptionController.java | 20 +- .../controller/busi/SysLogOperateController.java | 13 +- .../controller/busi/SysLogSystemController.java | 16 +- .../controller/busi/SysMenuController.java | 15 +- .../controller/busi/SysOrderNoRuleController.java | 27 +- .../controller/busi/SysUserController.java | 3 - .../controller/busi/SysUserInfoController.java | 12 +- .../serviceimpl/busi/SysMessageService.java | 3 - .../busi/TestSysLocaleResourceService.java | 13 +- .../i3plus/core/apiservice/util/ExcelReadData.java | 22 +- .../i3plus/core/apiservice/util/JavaTest.java | 293 +++++++++++---------- .../i3plus/core/apiservice/util/TestExcelUtil.java | 13 +- 12 files changed, 288 insertions(+), 162 deletions(-) diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogExceptionController.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogExceptionController.java index 0144cfd..3decb90 100644 --- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogExceptionController.java +++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogExceptionController.java @@ -1,6 +1,9 @@ package cn.estsh.i3plus.core.apiservice.controller.busi; -import cn.estsh.i3plus.core.api.iservice.busi.*; +import cn.estsh.i3plus.core.api.iservice.busi.ISysConfigService; +import cn.estsh.i3plus.core.api.iservice.busi.ISysFileService; +import cn.estsh.i3plus.core.api.iservice.busi.ISysLogExceptionService; +import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService; import cn.estsh.i3plus.platform.common.tool.ExcelTool; import cn.estsh.i3plus.platform.common.tool.FileTool; import cn.estsh.i3plus.platform.common.tool.ZipTool; @@ -14,10 +17,10 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController; import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum; +import cn.estsh.impp.framework.boot.util.ImppRedis; import cn.estsh.impp.framework.boot.util.ResultBean; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.apache.commons.compress.archivers.zip.ZipUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -25,6 +28,8 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; +import javax.persistence.EntityManager; import java.io.File; import java.util.ArrayList; import java.util.Date; @@ -55,6 +60,12 @@ public class SysLogExceptionController extends CoreBaseController { @Autowired private ISysMessageService sysMessageService; + @Autowired + private EntityManager entityManager; + + @Resource(name="redisRes") + private ImppRedis redisRes; + /** * 异常日志复杂查询,分页,排序 * @param sysLogException 查询条件 @@ -108,7 +119,10 @@ public class SysLogExceptionController extends CoreBaseController { File zipFile = null; File excelDir = null; File excelFile; + ExcelTool excelTool; + try { + excelTool = new ExcelTool(entityManager, redisRes); Pager pager = new Pager(); pager.setCurrentPage(1); // 判断是否超过excel最大导出数量设定值 @@ -138,7 +152,7 @@ public class SysLogExceptionController extends CoreBaseController { excelFile = new File(excelDir + File.separator + SysLogException.class.getSimpleName() + pager.getCurrentPage() + ".xls"); excelFile.createNewFile(); - ExcelTool.exportData(excelFile, listPager.getObjectList(), SysLogException.class, colName); + excelTool.exportData(excelFile, listPager.getObjectList(), SysLogException.class, colName); result.add(sysFileService.uploadFile(excelFile)); pager.setCurrentPage(pager.getCurrentPage() + 1); diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogOperateController.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogOperateController.java index bc5f4c2..ce7fcf8 100644 --- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogOperateController.java +++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogOperateController.java @@ -14,6 +14,7 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController; import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum; +import cn.estsh.impp.framework.boot.util.ImppRedis; import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ValidatorBean; import io.swagger.annotations.Api; @@ -23,6 +24,8 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import javax.persistence.EntityManager; import java.io.File; import java.util.ArrayList; import java.util.Date; @@ -56,6 +59,12 @@ public class SysLogOperateController extends CoreBaseController { @Autowired private ISysMessageService sysMessageService; + @Autowired + private EntityManager entityManager; + + @Resource(name="redisRes") + private ImppRedis redisRes; + /** * 添加操作日志 * @param logOperate 操作日志 @@ -212,6 +221,8 @@ public class SysLogOperateController extends CoreBaseController { excelDir = new File(System.getProperty("java.io.tmpdir") + File.separator + new Date().getTime()); excelDir.mkdir(); + + ExcelTool excelTool = new ExcelTool(entityManager, redisCore); do { listPager = logOperateService.querySysLogOperateByPager(sysLogOperate, pager); pager = listPager.getObjectPager(); @@ -220,7 +231,7 @@ public class SysLogOperateController extends CoreBaseController { excelFile = new File(excelDir + File.separator + SysLogOperate.class.getSimpleName() + pager.getCurrentPage() + ".xls"); excelFile.createNewFile(); - ExcelTool.exportData(excelFile, listPager.getObjectList(), SysLogOperate.class, colName); + excelTool.exportData(excelFile, listPager.getObjectList(), SysLogOperate.class, colName); result.add(sysFileService.uploadFile(excelFile)); pager.setCurrentPage(pager.getCurrentPage() + 1); diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogSystemController.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogSystemController.java index 01fcbc9..e124a97 100644 --- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogSystemController.java +++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysLogSystemController.java @@ -17,6 +17,7 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController; import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum; +import cn.estsh.impp.framework.boot.util.ImppRedis; import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ValidatorBean; import io.swagger.annotations.Api; @@ -26,6 +27,8 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import javax.persistence.EntityManager; import java.io.File; import java.util.ArrayList; import java.util.Date; @@ -56,6 +59,12 @@ public class SysLogSystemController extends CoreBaseController{ @Autowired private ISysMessageService sysMessageService; + @Autowired + private EntityManager entityManager; + + @Resource(name="redisRes") + private ImppRedis redisRes; + /** * 新增系统日志 * @param logSystem 系统日志 @@ -166,7 +175,7 @@ public class SysLogSystemController extends CoreBaseController{ } /** - * 导出系统异常日志 + * 导出系统异常日志A * @param sysLogSystem 查询条件 * @param colName 导出列 * @param pageSize 页大小 @@ -181,8 +190,11 @@ public class SysLogSystemController extends CoreBaseController{ File zipFile = null; File excelDir = null; File excelFile; + ExcelTool excelTool; + try { startMultiService(); + excelTool = new ExcelTool(entityManager, redisRes); Pager pager = new Pager(); pager.setCurrentPage(1); @@ -213,7 +225,7 @@ public class SysLogSystemController extends CoreBaseController{ excelFile = new File(excelDir + File.separator + SysLogSystem.class.getSimpleName() + pager.getCurrentPage() + ".xls"); excelFile.createNewFile(); - ExcelTool.exportData(excelFile, listPager.getObjectList(), SysLogSystem.class, colName); + excelTool.exportData(excelFile, listPager.getObjectList(), SysLogSystem.class, colName); result.add(sysFileService.uploadFile(excelFile)); pager.setCurrentPage(pager.getCurrentPage() + 1); diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysMenuController.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysMenuController.java index 6ca9757..c8d641c 100644 --- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysMenuController.java +++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysMenuController.java @@ -14,6 +14,7 @@ import cn.estsh.i3plus.pojo.platform.bean.SysMenu; import cn.estsh.impp.framework.base.controller.CoreBaseController; import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; +import cn.estsh.impp.framework.boot.util.ImppRedis; import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ValidatorBean; import io.swagger.annotations.Api; @@ -24,6 +25,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; +import javax.persistence.EntityManager; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.util.HashMap; @@ -47,6 +50,12 @@ public class SysMenuController extends CoreBaseController { @Autowired private ISysMenuService sysMenuService; + @Autowired + private EntityManager entityManager; + + @Resource(name="redisRes") + private ImppRedis redisRes; + /** * 新增系统功能 * @param menu 系统功能 @@ -289,6 +298,7 @@ public class SysMenuController extends CoreBaseController { public ResultBean singleFileUpload(@RequestParam("file") MultipartFile multipart) { try { startMultiService(); + ExcelTool excelTool = new ExcelTool(entityManager, redisRes); if(multipart.isEmpty()){ throw ImppExceptionBuilder.newInstance() @@ -297,7 +307,7 @@ public class SysMenuController extends CoreBaseController { .setErrorDetail("请选择需要上传的文件。") .build(); } - List list = ExcelTool.importData("permission.xls",multipart.getInputStream(), SysMenu.class); + List list = excelTool.importData("permission.xls",multipart.getInputStream(), SysMenu.class); Map map = new HashMap<>(); list.forEach(menu -> { @@ -349,12 +359,13 @@ public class SysMenuController extends CoreBaseController { public ResultBean singleDownload(HttpServletResponse response) { try { startMultiService(); + ExcelTool excelTool = new ExcelTool(entityManager, redisRes); String fileName = "menu_" + System.currentTimeMillis() + ".xls"; List list = sysMenuService.findSysMenuAll(); File file = new File(fileName); file.createNewFile(); - File excle = ExcelTool.exportData(file, list, SysMenu.class, new String[]{ + File excle = excelTool.exportData(file, list, SysMenu.class, new String[]{ "menuCode", "name","parentId","menuType","menuStatus","parentNameRdd","menuUrl","menuClassPath","menuGrade","menuSort" ,"menuCss","menuIcon","menuDescription" }); diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysOrderNoRuleController.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysOrderNoRuleController.java index 0159b0f..5a758d3 100644 --- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysOrderNoRuleController.java +++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysOrderNoRuleController.java @@ -1,6 +1,9 @@ package cn.estsh.i3plus.core.apiservice.controller.busi; -import cn.estsh.i3plus.core.api.iservice.busi.*; +import cn.estsh.i3plus.core.api.iservice.busi.ISysConfigService; +import cn.estsh.i3plus.core.api.iservice.busi.ISysFileService; +import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService; +import cn.estsh.i3plus.core.api.iservice.busi.ISysOrderNoRuleService; import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum; import cn.estsh.i3plus.platform.common.tool.ExcelTool; import cn.estsh.i3plus.platform.common.tool.FileTool; @@ -18,6 +21,7 @@ import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.fastdfs.FastDFSClient; import cn.estsh.impp.framework.boot.fastdfs.FastDFSFile; +import cn.estsh.impp.framework.boot.util.ImppRedis; import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ValidatorBean; import io.swagger.annotations.Api; @@ -26,6 +30,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; +import javax.persistence.EntityManager; import java.io.File; import java.util.ArrayList; import java.util.Date; @@ -47,9 +53,6 @@ public class SysOrderNoRuleController extends CoreBaseController { private ISysOrderNoRuleService sysOrderNoRuleService; @Autowired - private ISysDictionaryService sysDictionaryService; - - @Autowired private ISysConfigService sysConfigService; @Autowired @@ -61,6 +64,12 @@ public class SysOrderNoRuleController extends CoreBaseController { @Autowired private FastDFSClient dfsClient; + @Autowired + private EntityManager entityManager; + + @Resource(name="redisRes") + private ImppRedis redisRes; + /** * 新增单号规则 * @param sysOrderNoRule 单号规则 @@ -227,7 +236,9 @@ public class SysOrderNoRuleController extends CoreBaseController { File zipFile = null; File excelDir = null; File excelFile; + ExcelTool excelTool; try { + excelTool = new ExcelTool(entityManager, redisRes); Pager pager = new Pager(); pager.setCurrentPage(1); // 判断是否超过excel最大导出数量设定值 @@ -256,7 +267,7 @@ public class SysOrderNoRuleController extends CoreBaseController { // 将excel导出至临时文件夹 excelFile = new File(excelDir + File.separator + SysOrderNoRule.class.getSimpleName() + pager.getCurrentPage() + ".xls"); excelFile.createNewFile(); - ExcelTool.exportData(excelFile, listPager.getObjectList(), SysOrderNoRule.class, colName); + excelTool.exportData(excelFile, listPager.getObjectList(), SysOrderNoRule.class, colName); pager.setCurrentPage(pager.getCurrentPage() + 1); } while (pager.getCurrentPage() <= pager.getTotalPages()); @@ -290,7 +301,8 @@ public class SysOrderNoRuleController extends CoreBaseController { @ApiOperation(value = "导入单号规则") public ResultBean importSysOrderNoRule(@RequestParam("file") MultipartFile file) { try { - List sysOrderNoRuleList = ExcelTool.importData(file.getOriginalFilename(), file.getInputStream(), SysOrderNoRule.class); + ExcelTool excelTool = new ExcelTool(entityManager, redisRes); + List sysOrderNoRuleList = excelTool.importData(file.getOriginalFilename(), file.getInputStream(), SysOrderNoRule.class); // 初始化数据 for (SysOrderNoRule sysOrderNoRule : sysOrderNoRuleList) { sysOrderNoRule.setOrderNoRuleStatus(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); @@ -310,13 +322,14 @@ public class SysOrderNoRuleController extends CoreBaseController { public ResultBean downSysOrderNoRuleTemplate() { try { startMultiService(); + ExcelTool excelTool = new ExcelTool(entityManager, redisRes); String importTemplateCode = SysOrderNoRule.class.getSimpleName() + "ImportTemplate"; // 查询服务器中是否存在模板文件 SysFile sysFile = sysFileService.getSysFileByFileCode(importTemplateCode); if(sysFile == null){ FastDFSFile fastDFSFile = new FastDFSFile(SysOrderNoRule.class.getSimpleName() + "ImportTemplate.xls", - ExcelTool.importTemplate(SysOrderNoRule.class), ".xls"); + excelTool.importTemplate(SysOrderNoRule.class), ".xls"); sysFile = dfsClient.upload(fastDFSFile,CommonEnumUtil.SOFT_TYPE.CORE.getValue()); sysFile.setFileCode(importTemplateCode); diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserController.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserController.java index fb0f212..5ab8bee 100644 --- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserController.java +++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserController.java @@ -21,19 +21,16 @@ import cn.estsh.impp.framework.boot.auth.AuthUtil; import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum; -import cn.estsh.impp.framework.boot.util.ImppRedis; import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ValidatorBean; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; import org.apache.commons.lang3.RandomStringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; import java.util.List; /** diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserInfoController.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserInfoController.java index 1314ead..4fbe4d9 100644 --- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserInfoController.java +++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserInfoController.java @@ -18,6 +18,7 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController; import cn.estsh.impp.framework.boot.auth.AuthUtil; import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; +import cn.estsh.impp.framework.boot.util.ImppRedis; import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ValidatorBean; import io.swagger.annotations.Api; @@ -29,6 +30,8 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import javax.persistence.EntityManager; import java.io.File; import java.util.ArrayList; import java.util.Date; @@ -66,6 +69,11 @@ public class SysUserInfoController extends CoreBaseController{ @Autowired private ISysMessageService sysMessageService; + @Autowired + private EntityManager entityManager; + + @Resource(name="redisRes") + private ImppRedis redisRes; /** * 添加用户信息 * @param userInfo 用户信息 @@ -381,8 +389,10 @@ public class SysUserInfoController extends CoreBaseController{ File zipFile = null; File excelDir = null; File excelFile; + ExcelTool excelTool; try { + excelTool = new ExcelTool(entityManager, redisRes); Pager pager = new Pager(); pager.setCurrentPage(1); // 判断是否超过excel最大导出数量设定值 @@ -412,7 +422,7 @@ public class SysUserInfoController extends CoreBaseController{ excelFile = new File(excelDir + File.separator + SysUserInfo.class.getSimpleName() + pager.getCurrentPage() + ".xls"); excelFile.createNewFile(); - ExcelTool.exportData(excelFile, listPager.getObjectList(), SysUserInfo.class, colName); + excelTool.exportData(excelFile, listPager.getObjectList(), SysUserInfo.class, colName); result.add(sysFileService.uploadFile(excelFile)); pager.setCurrentPage(pager.getCurrentPage() + 1); diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/SysMessageService.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/SysMessageService.java index 2f0fe39..640e42b 100644 --- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/SysMessageService.java +++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/SysMessageService.java @@ -18,9 +18,7 @@ import cn.estsh.i3plus.pojo.platform.repository.*; import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack; import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum; -import cn.estsh.impp.framework.boot.util.ImppRedis; import com.alibaba.fastjson.JSON; -import com.netflix.discovery.converters.Auto; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,7 +26,6 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import javax.annotation.Resource; import java.util.List; /** diff --git a/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestSysLocaleResourceService.java b/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestSysLocaleResourceService.java index 7e6b1d9..3bc7df8 100644 --- a/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestSysLocaleResourceService.java +++ b/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/TestSysLocaleResourceService.java @@ -4,9 +4,12 @@ import cn.estsh.i3plus.core.api.iservice.busi.ISysLocaleResourceService; import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.TestBase; import cn.estsh.i3plus.platform.common.tool.ExcelTool; import cn.estsh.i3plus.pojo.platform.bean.SysLocaleResource; +import cn.estsh.impp.framework.boot.util.ImppRedis; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import javax.persistence.EntityManager; import java.io.File; import java.io.IOException; import java.util.Date; @@ -23,6 +26,13 @@ public class TestSysLocaleResourceService extends TestBase { @Autowired ISysLocaleResourceService sysLocaleResourceService; + @Autowired + private EntityManager entityManager; + + @Resource(name = "redisRes") + private ImppRedis redisRes; + + @Test public void exportSysLocaleResourceData() throws IOException { SysLocaleResource ds = new SysLocaleResource(); @@ -32,7 +42,8 @@ public class TestSysLocaleResourceService extends TestBase { }; File file = File.createTempFile(SysLocaleResource.class.getSimpleName() + new Date().getTime(), "Tp.xls"); try { - ExcelTool.exportData(file,sysLocaleResourceService.listSysLocaleResource(),SysLocaleResource.class,colName); + ExcelTool excelTool = new ExcelTool(entityManager, redisRes); + excelTool.exportData(file,sysLocaleResourceService.listSysLocaleResource(),SysLocaleResource.class,colName); System.out.println(file.getPath()); } catch (Exception e) { e.printStackTrace(); diff --git a/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/ExcelReadData.java b/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/ExcelReadData.java index d1e988c..de397f5 100644 --- a/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/ExcelReadData.java +++ b/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/ExcelReadData.java @@ -2,8 +2,12 @@ package test.cn.estsh.i3plus.core.apiservice.util; import cn.estsh.i3plus.platform.common.tool.ExcelTool; import cn.estsh.i3plus.pojo.platform.bean.SysMenu; +import cn.estsh.impp.framework.boot.util.ImppRedis; import com.alibaba.fastjson.JSON; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import javax.persistence.EntityManager; import java.io.FileInputStream; import java.util.List; @@ -15,8 +19,24 @@ import java.util.List; * @Modify: **/ public class ExcelReadData { + + private static EntityManager entityManager; + + @Autowired + public void setEntityManager(EntityManager entityManager) { + this.entityManager = entityManager; + } + + private static ImppRedis redisRes; + + @Resource(name = "redisRes") + public void setRedisRes(ImppRedis redisRes) { + this.redisRes = redisRes; + } + public static void main(String[] args) throws Exception{ - List list = ExcelTool.importData("permission.xls", new FileInputStream("E:\\permission.xls"), SysMenu.class); + ExcelTool excelTool = new ExcelTool(entityManager, redisRes); + List list = excelTool.importData("permission.xls", new FileInputStream("E:\\permission.xls"), SysMenu.class); System.out.println(JSON.toJSONString(list)); } diff --git a/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/JavaTest.java b/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/JavaTest.java index 5b89157..49af183 100644 --- a/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/JavaTest.java +++ b/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/JavaTest.java @@ -3,9 +3,14 @@ package test.cn.estsh.i3plus.core.apiservice.util; import cn.estsh.i3plus.platform.common.tool.ExcelTool; import cn.estsh.i3plus.platform.common.tool.StringTool; import cn.estsh.i3plus.pojo.platform.bean.SysMenu; +import cn.estsh.impp.framework.boot.util.ImppRedis; import lombok.Data; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import javax.persistence.Entity; +import javax.persistence.EntityManager; import java.io.File; import java.util.*; @@ -20,22 +25,22 @@ public class JavaTest { public static final Menu menu = new Menu("IMPP", "100000000", 1, -1L, "").addChildList( //region Description 设置 - new Menu("设置", "101000000", 1, "fa fa-cog","/impp").addChildList( + new Menu("设置", "101000000", 1, "fa fa-cog", "/impp").addChildList( //region Description 基础信息管理 new Menu("基础信息管理", "101010000", 2).addChildList( - new Menu("组织管理", "101010100", 3,"","/impp/basic/organize").addChildList( + new Menu("组织管理", "101010100", 3, "", "/impp/basic/organize").addChildList( new Menu("新增", "101010101", 4), new Menu("修改", "101010102", 4), new Menu("删除", "101010103", 4), new Menu("查询", "101010104", 4) ), - new Menu("部门管理", "101010200", 3,"","/impp/basic/department").addChildList( + new Menu("部门管理", "101010200", 3, "", "/impp/basic/department").addChildList( new Menu("新增", "101010201", 4), new Menu("修改", "101010202", 4), new Menu("删除", "101010203", 4), new Menu("查询", "101010204", 4) ), - new Menu("岗位管理", "101010300", 3,"","/impp/basic/position").addChildList( + new Menu("岗位管理", "101010300", 3, "", "/impp/basic/position").addChildList( new Menu("新增", "101010301", 4), new Menu("修改", "101010302", 4), new Menu("删除", "101010303", 4), @@ -45,7 +50,7 @@ public class JavaTest { //endregion //region Description 权限管理 new Menu("权限管理", "101020000", 2).addChildList( - new Menu("账号管理", "101020100", 3,"","/impp/permission/user").addChildList( + new Menu("账号管理", "101020100", 3, "", "/impp/permission/user").addChildList( new Menu("新增", "101020101", 4), new Menu("修改", "101020102", 4), new Menu("删除", "101020103", 4), @@ -56,14 +61,14 @@ public class JavaTest { new Menu("重置", "101020108", 4), new Menu("导出", "101020109", 4) ), - new Menu("用户管理", "101020200", 3,"","/impp/permission/user-info").addChildList( + new Menu("用户管理", "101020200", 3, "", "/impp/permission/user-info").addChildList( new Menu("新增", "101020201", 4), new Menu("修改", "101020202", 4), new Menu("删除", "101020203", 4), new Menu("查询", "101020204", 4), new Menu("导出", "101020205", 4) ), - new Menu("角色管理", "101020300", 3,"","/impp/permission/role").addChildList( + new Menu("角色管理", "101020300", 3, "", "/impp/permission/role").addChildList( new Menu("新增", "101020301", 4), new Menu("修改", "101020302", 4), new Menu("删除", "101020303", 4), @@ -72,7 +77,7 @@ public class JavaTest { new Menu("禁用", "101020306", 4), new Menu("分配权限", "101020307", 4) ), - new Menu("功能管理", "101020400", 3,"","/impp/permission/menu").addChildList( + new Menu("功能管理", "101020400", 3, "", "/impp/permission/menu").addChildList( new Menu("新增", "101020401", 4), new Menu("修改", "101020402", 4), new Menu("删除", "101020403", 4), @@ -84,19 +89,19 @@ public class JavaTest { //endregion //region Description 定时任务管理 new Menu("定时任务管理", "101030000", 2).addChildList( - new Menu("任务列表", "101030100", 3,"","/impp/task/task").addChildList( + new Menu("任务列表", "101030100", 3, "", "/impp/task/task").addChildList( new Menu("新增", "101030101", 4), new Menu("修改", "101030102", 4), new Menu("删除", "101030103", 4), new Menu("查询", "101030104", 4) ), - new Menu("任务周期", "101030200", 3,"","/impp/task/task-cycle").addChildList( + new Menu("任务周期", "101030200", 3, "", "/impp/task/task-cycle").addChildList( new Menu("新增", "101030201", 4), new Menu("修改", "101030202", 4), new Menu("删除", "101030203", 4), new Menu("查询", "101030204", 4) ), - new Menu("任务周期", "101030300", 3,"","/task/task-plan").addChildList( + new Menu("任务周期", "101030300", 3, "", "/task/task-plan").addChildList( new Menu("新增", "101030301", 4), new Menu("修改", "101030302", 4), new Menu("删除", "101030303", 4), @@ -109,18 +114,18 @@ public class JavaTest { //endregion //region Description 系统管理 new Menu("系统管理", "101040000", 2).addChildList( - new Menu("文件管理", "101040100", 3,"","/impp/task/task-plan").addChildList( + new Menu("文件管理", "101040100", 3, "", "/impp/task/task-plan").addChildList( new Menu("删除", "101040101", 4), new Menu("下载", "101040102", 4), new Menu("查询", "101040103", 4) ), - new Menu("消息管理", "101040200", 3,"","/impp/param/message").addChildList( + new Menu("消息管理", "101040200", 3, "", "/impp/param/message").addChildList( new Menu("新增", "101040201", 4), new Menu("修改", "101040202", 4), new Menu("删除", "101040203", 4), new Menu("查询", "101040204", 4) ), - new Menu("硬件管理", "101040300", 3,"","/param/tool").addChildList( + new Menu("硬件管理", "101040300", 3, "", "/param/tool").addChildList( new Menu("新增", "101040301", 4), new Menu("修改", "101040302", 4), new Menu("删除", "101040303", 4), @@ -128,20 +133,20 @@ public class JavaTest { new Menu("启用", "101040305", 4), new Menu("禁用", "101040306", 4) ), - new Menu("硬件类型管理", "101040400", 3,"","/impp/param/tool-type").addChildList( + new Menu("硬件类型管理", "101040400", 3, "", "/impp/param/tool-type").addChildList( new Menu("新增", "101040401", 4), new Menu("修改", "101040402", 4), new Menu("删除", "101040403", 4), new Menu("查询", "101040404", 4) ), - new Menu("字典管理", "101040500", 3,"","/impp/param/dictionary").addChildList( + new Menu("字典管理", "101040500", 3, "", "/impp/param/dictionary").addChildList( new Menu("新增", "101040501", 4), new Menu("修改", "101040502", 4), new Menu("删除", "101040503", 4), new Menu("查询", "101040504", 4), new Menu("默认", "101040505", 4) ), - new Menu("语言管理", "101040600", 3,"","/impp/locale/language").addChildList( + new Menu("语言管理", "101040600", 3, "", "/impp/locale/language").addChildList( new Menu("新增", "101040601", 4), new Menu("修改", "101040602", 4), new Menu("删除", "101040603", 4), @@ -150,7 +155,7 @@ public class JavaTest { new Menu("启用", "101040606", 4), new Menu("默认", "101040607", 4) ), - new Menu("资源管理", "101040700", 3,"","/impp/locale/resource").addChildList( + new Menu("资源管理", "101040700", 3, "", "/impp/locale/resource").addChildList( new Menu("新增", "101040701", 4), new Menu("修改", "101040702", 4), new Menu("删除", "101040703", 4), @@ -160,15 +165,15 @@ public class JavaTest { //endregion //region Description 系统配置 new Menu("系统配置", "101050000", 2).addChildList( - new Menu("系统参数", "101050100", 3,"","/impp/config/config").addChildList( + new Menu("系统参数", "101050100", 3, "", "/impp/config/config").addChildList( new Menu("修改", "101050101", 4), new Menu("查询", "101050102", 4) ), - new Menu("邮件配置", "101050200", 3,"","/impp/config/email").addChildList( + new Menu("邮件配置", "101050200", 3, "", "/impp/config/email").addChildList( new Menu("保存", "101050201", 4), new Menu("测试", "101050202", 4) ), - new Menu("单号生成配置", "101050300", 3,"","/impp/param/order-no-rule").addChildList( + new Menu("单号生成配置", "101050300", 3, "", "/impp/param/order-no-rule").addChildList( new Menu("新增", "101050301", 4), new Menu("修改", "101050302", 4), new Menu("删除", "101050303", 4), @@ -178,13 +183,13 @@ public class JavaTest { new Menu("导入", "101050307", 4), new Menu("导出", "101050308", 4) ), - new Menu("条码规则管理", "101050400", 3,"","/impp/param/code-rule-management").addChildList( + new Menu("条码规则管理", "101050400", 3, "", "/impp/param/code-rule-management").addChildList( new Menu("新增", "101050401", 4), new Menu("修改", "101050402", 4), new Menu("删除", "101050403", 4), new Menu("查询", "101050404", 4) ), - new Menu("打印模板管理", "101050500", 3,"","/impp/param/print-template-management").addChildList( + new Menu("打印模板管理", "101050500", 3, "", "/impp/param/print-template-management").addChildList( new Menu("新增", "101050501", 4), new Menu("修改", "101050502", 4), new Menu("删除", "101050503", 4), @@ -196,29 +201,29 @@ public class JavaTest { //endregion //region Description 服务监控 new Menu("服务监控", "101060000", 2).addChildList( - new Menu("异常日志", "101060100", 3,"","/impp/param/log-exception").addChildList( + new Menu("异常日志", "101060100", 3, "", "/impp/param/log-exception").addChildList( new Menu("查询", "101060101", 4), new Menu("导出", "101060102", 4) ), - new Menu("系统日志", "101060200", 3,"","/impp/param/log-system").addChildList( + new Menu("系统日志", "101060200", 3, "", "/impp/param/log-system").addChildList( new Menu("查询", "101060201", 4), new Menu("导出", "101060202", 4) ), - new Menu("操作日志", "101060300", 3,"","/impp/param/log-operate").addChildList( + new Menu("操作日志", "101060300", 3, "", "/impp/param/log-operate").addChildList( new Menu("查询", "101060301", 4), new Menu("导出", "101060302", 4) ), - new Menu("定制任务日志", "101060400", 3,"","/impp/param/log-task").addChildList( + new Menu("定制任务日志", "101060400", 3, "", "/impp/param/log-task").addChildList( new Menu("查询", "101060401", 4), new Menu("导出", "101060402", 4) ), - new Menu("注册中心", "101060500", 3,"","/impp/could/reg").addChildList( + new Menu("注册中心", "101060500", 3, "", "/impp/could/reg").addChildList( new Menu("查询", "101060501", 4) ), - new Menu("链路监控", "101060600", 3,"","/impp/could/hystrix").addChildList( + new Menu("链路监控", "101060600", 3, "", "/impp/could/hystrix").addChildList( new Menu("查询", "101060601", 4) ), - new Menu("熔断监控", "101060700", 3,"","/impp/could/zipkin").addChildList( + new Menu("熔断监控", "101060700", 3, "", "/impp/could/zipkin").addChildList( new Menu("查询", "101060701", 4) ) ) @@ -226,22 +231,22 @@ public class JavaTest { ), //endregion //region Description WMS - new Menu("WMS", "102000000", 1, "","/wms").addChildList( + new Menu("WMS", "102000000", 1, "", "/wms").addChildList( //region Description 物料数据维护 new Menu("物料数据维护", "102010000", 2).addChildList( - new Menu("物料信息", "102010100", 3,"","/wms/materiel-maintenance/materiel-info").addChildList( + new Menu("物料信息", "102010100", 3, "", "/wms/materiel-maintenance/materiel-info").addChildList( new Menu("新增", "102010101", 4), new Menu("修改", "102010102", 4), new Menu("删除", "102010103", 4), new Menu("查询", "102010104", 4) ), - new Menu("库位物料信息", "102010200", 3,"","/wms/materiel-maintenance/locatorMateriel-info").addChildList( + new Menu("库位物料信息", "102010200", 3, "", "/wms/materiel-maintenance/locatorMateriel-info").addChildList( new Menu("新增", "102010201", 4), new Menu("修改", "102010202", 4), new Menu("删除", "102010203", 4), new Menu("查询", "102010204", 4) ), - new Menu("物料路线信息", "102010300", 3,"","/wms/materiel-maintenance/route-info").addChildList( + new Menu("物料路线信息", "102010300", 3, "", "/wms/materiel-maintenance/route-info").addChildList( new Menu("新增", "102010301", 4), new Menu("修改", "102010302", 4), new Menu("删除", "102010303", 4), @@ -251,7 +256,7 @@ public class JavaTest { //endregion //region Description 仓库数据维护 new Menu("仓库数据维护", "102020000", 2).addChildList( - new Menu("仓库信息", "102020100", 3,"","/wms/warehouse-maintenance/warehouse-info").addChildList( + new Menu("仓库信息", "102020100", 3, "", "/wms/warehouse-maintenance/warehouse-info").addChildList( new Menu("新增", "102020101", 4), new Menu("修改", "102020102", 4), new Menu("删除", "102020103", 4), @@ -259,13 +264,13 @@ public class JavaTest { new Menu("仓库信息禁用", "102020105", 4), new Menu("仓库信息启用", "102020106", 4) ), - new Menu("库位信息", "102020200", 3,"","/wms/warehouse-maintenance/locator-info").addChildList( + new Menu("库位信息", "102020200", 3, "", "/wms/warehouse-maintenance/locator-info").addChildList( new Menu("新增", "102020201", 4), new Menu("修改", "102020202", 4), new Menu("删除", "102020203", 4), new Menu("查询", "102020204", 4) ), - new Menu("存储区信息", "102020300", 3,"","/wms/warehouse-maintenance/storageArea-info").addChildList( + new Menu("存储区信息", "102020300", 3, "", "/wms/warehouse-maintenance/storageArea-info").addChildList( new Menu("新增", "102020301", 4), new Menu("修改", "102020302", 4), new Menu("删除", "102020303", 4), @@ -275,13 +280,13 @@ public class JavaTest { //endregion //region Description 供应链维护 new Menu("供应链维护", "102030000", 2).addChildList( - new Menu("客户信息", "102030100", 3,"","/wms/supplyChain-maintenance/customer-info").addChildList( + new Menu("客户信息", "102030100", 3, "", "/wms/supplyChain-maintenance/customer-info").addChildList( new Menu("新增", "102030101", 4), new Menu("修改", "102030102", 4), new Menu("删除", "102030103", 4), new Menu("查询", "102030104", 4) ), - new Menu("供应商信息", "102030200", 3,"","/wms/supplyChain-maintenance/supplier-info").addChildList( + new Menu("供应商信息", "102030200", 3, "", "/wms/supplyChain-maintenance/supplier-info").addChildList( new Menu("新增", "102030201", 4), new Menu("修改", "102030202", 4), new Menu("删除", "102030203", 4), @@ -289,7 +294,7 @@ public class JavaTest { new Menu("禁用", "102030205", 4), new Menu("启用", "102030206", 4) ), - new Menu("客户发往地信息", "102030300", 3,"","/wms/supplyChain-maintenance/customership-info").addChildList( + new Menu("客户发往地信息", "102030300", 3, "", "/wms/supplyChain-maintenance/customership-info").addChildList( new Menu("新增", "102030301", 4), new Menu("修改", "102030302", 4), new Menu("删除", "102030303", 4), @@ -299,13 +304,13 @@ public class JavaTest { //endregion //region Description 交易数据维护 new Menu("交易数据维护", "102040000", 2).addChildList( - new Menu("交易类型信息", "102040100", 3,"","/wms/trans-maintenance/transType-info").addChildList( + new Menu("交易类型信息", "102040100", 3, "", "/wms/trans-maintenance/transType-info").addChildList( new Menu("新增", "102040101", 4), new Menu("修改", "102040102", 4), new Menu("删除", "102040103", 4), new Menu("查询", "102040104", 4) ), - new Menu("抽点比例信息", "102040200", 3,"","/wms/trans-maintenance/proportion-info").addChildList( + new Menu("抽点比例信息", "102040200", 3, "", "/wms/trans-maintenance/proportion-info").addChildList( new Menu("新增", "102040201", 4), new Menu("修改", "102040202", 4), new Menu("删除", "102040203", 4), @@ -315,13 +320,13 @@ public class JavaTest { //endregion //region Description 外部订单管理 new Menu("外部订单管理", "102050000", 2).addChildList( - new Menu("PO", "102050100", 3,"","/wms/external-order/po").addChildList( + new Menu("PO", "102050100", 3, "", "/wms/external-order/po").addChildList( new Menu("新增", "102050101", 4), new Menu("修改", "102050102", 4), new Menu("删除", "102050103", 4), new Menu("查询", "102050104", 4) ), - new Menu("ASN", "102050200", 3,"","/wms/external-order/asn").addChildList( + new Menu("ASN", "102050200", 3, "", "/wms/external-order/asn").addChildList( new Menu("新增", "102050201", 4), new Menu("修改", "102050202", 4), new Menu("删除", "102050203", 4), @@ -333,19 +338,19 @@ public class JavaTest { new Menu("子表-删除", "102050209", 4), new Menu("子表-查询", "102050210", 4) ), - new Menu("产品入库", "102050300", 3,"","/wms/external-order/product-storage").addChildList( + new Menu("产品入库", "102050300", 3, "", "/wms/external-order/product-storage").addChildList( new Menu("新增", "102050301", 4), new Menu("修改", "102050302", 4), new Menu("删除", "102050303", 4), new Menu("查询", "102050304", 4) ), - new Menu("产品发运", "102050400", 3,"","/wms/external-order/product-delivery").addChildList( + new Menu("产品发运", "102050400", 3, "", "/wms/external-order/product-delivery").addChildList( new Menu("新增", "102050401", 4), new Menu("修改", "102050402", 4), new Menu("删除", "102050403", 4), new Menu("查询", "102050404", 4) ), - new Menu("移库单信息", "102050500", 3,"","/wms/external-order/doc-movement").addChildList( + new Menu("移库单信息", "102050500", 3, "", "/wms/external-order/doc-movement").addChildList( new Menu("新增", "102050501", 4), new Menu("修改", "102050502", 4), new Menu("删除", "102050503", 4), @@ -361,13 +366,13 @@ public class JavaTest { //endregion //region Description 内部订单管理 new Menu("内部订单管理", "102060000", 2).addChildList( - new Menu("责任区分配", "102060100", 3,"","/wms/internal-order/res-allocation").addChildList( + new Menu("责任区分配", "102060100", 3, "", "/wms/internal-order/res-allocation").addChildList( new Menu("新增", "102060101", 4), new Menu("修改", "102060102", 4), new Menu("删除", "102060103", 4), new Menu("查询", "102060104", 4) ), - new Menu("库存移动单", "102060200", 3,"","/wms/internal-order/inventory-movement").addChildList( + new Menu("库存移动单", "102060200", 3, "", "/wms/internal-order/inventory-movement").addChildList( new Menu("新增", "102060201", 4), new Menu("修改", "102060202", 4), new Menu("删除", "102060203", 4), @@ -379,13 +384,13 @@ public class JavaTest { new Menu("子表-删除", "102060209", 4), new Menu("子表-查询", "102060210", 4) ), - new Menu("质检", "102060300", 3,"","/wms/internal-order/quality-testing").addChildList( + new Menu("质检", "102060300", 3, "", "/wms/internal-order/quality-testing").addChildList( new Menu("新增", "102060301", 4), new Menu("修改", "102060302", 4), new Menu("删除", "102060303", 4), new Menu("查询", "102060304", 4) ), - new Menu("盘点", "102060400", 3,"","/wms/internal-order/check").addChildList( + new Menu("盘点", "102060400", 3, "", "/wms/internal-order/check").addChildList( new Menu("新增", "102060401", 4), new Menu("修改", "102060402", 4), new Menu("删除", "102060403", 4), @@ -395,7 +400,7 @@ public class JavaTest { //endregion //region Description 作业任务 new Menu("作业任务", "102070000", 2).addChildList( - new Menu("作业类型信息", "102070100", 3,"","/wms/receiving-operation/operationtype-info").addChildList( + new Menu("作业类型信息", "102070100", 3, "", "/wms/receiving-operation/operationtype-info").addChildList( new Menu("新增", "102070101", 4), new Menu("修改", "102070102", 4), new Menu("删除", "102070103", 4), @@ -403,13 +408,13 @@ public class JavaTest { new Menu("禁用", "102070105", 4), new Menu("启用", "102070106", 4) ), - new Menu("抽点记录", "102070200", 3,"","/wms/receiving-operation/take-notes").addChildList( + new Menu("抽点记录", "102070200", 3, "", "/wms/receiving-operation/take-notes").addChildList( new Menu("新增", "102070201", 4), new Menu("修改", "102070202", 4), new Menu("删除", "102070203", 4), new Menu("查询", "102070204", 4) ), - new Menu("作业任务", "102070300", 3,"","/wms/receiving-operation/task-work").addChildList( + new Menu("作业任务", "102070300", 3, "", "/wms/receiving-operation/task-work").addChildList( new Menu("新增", "102070301", 4), new Menu("修改", "102070302", 4), new Menu("删除", "102070303", 4), @@ -419,7 +424,7 @@ public class JavaTest { //endregion //region Description 库存数据维护 new Menu("库存数据维护", "102080000", 2).addChildList( - new Menu("库存信息", "102080100", 3,"","/wms/inventory-data/inventory-info").addChildList( + new Menu("库存信息", "102080100", 3, "", "/wms/inventory-data/inventory-info").addChildList( new Menu("新增", "102080101", 4), new Menu("修改", "102080102", 4), new Menu("删除", "102080103", 4), @@ -431,7 +436,7 @@ public class JavaTest { new Menu("子表-删除", "102080109", 4), new Menu("子表-查询", "102080110", 4) ), - new Menu("库存交易信息", "102080200", 3,"","/wms/inventory-data/inventory-trans").addChildList( + new Menu("库存交易信息", "102080200", 3, "", "/wms/inventory-data/inventory-trans").addChildList( new Menu("新增", "102080201", 4), new Menu("修改", "102080202", 4), new Menu("删除", "102080203", 4), @@ -447,31 +452,31 @@ public class JavaTest { //endregion //region Description 流程管理 new Menu("流程管理", "102090000", 2).addChildList( - new Menu("作业步骤参数类型", "102090100", 3,"","/wms/flow-manage/job-step-type").addChildList( + new Menu("作业步骤参数类型", "102090100", 3, "", "/wms/flow-manage/job-step-type").addChildList( new Menu("新增", "102090101", 4), new Menu("修改", "102090102", 4), new Menu("删除", "102090103", 4), new Menu("查询", "102090104", 4) ), - new Menu("作业流程", "102090200", 3,"","/wms/flow-manage/job-flow").addChildList( + new Menu("作业流程", "102090200", 3, "", "/wms/flow-manage/job-flow").addChildList( new Menu("新增", "102090201", 4), new Menu("修改", "102090202", 4), new Menu("删除", "102090203", 4), new Menu("查询", "102090204", 4) ), - new Menu("作业记录", "102090300", 3,"","/wms/flow-manage/job-record").addChildList( + new Menu("作业记录", "102090300", 3, "", "/wms/flow-manage/job-record").addChildList( new Menu("新增", "102090301", 4), new Menu("修改", "102090302", 4), new Menu("删除", "102090303", 4), new Menu("查询", "102090304", 4) ), - new Menu("自定义脚本", "102090400", 3,"","/wms/flow-manage/custom-script").addChildList( + new Menu("自定义脚本", "102090400", 3, "", "/wms/flow-manage/custom-script").addChildList( new Menu("新增", "102090401", 4), new Menu("修改", "102090402", 4), new Menu("删除", "102090403", 4), new Menu("查询", "102090404", 4) ), - new Menu("作业处理组件", "102090500", 3,"","/wms/flow-manage/job-module").addChildList( + new Menu("作业处理组件", "102090500", 3, "", "/wms/flow-manage/job-module").addChildList( new Menu("新增", "102090501", 4), new Menu("修改", "102090502", 4), new Menu("删除", "102090503", 4), @@ -481,19 +486,19 @@ public class JavaTest { //endregion //region Description 业务数据维护 new Menu("业务数据维护", "102100000", 2).addChildList( - new Menu("物理包装信息", "102100100", 3,"","/wms/business-data/physical-pack").addChildList( + new Menu("物理包装信息", "102100100", 3, "", "/wms/business-data/physical-pack").addChildList( new Menu("新增", "102100101", 4), new Menu("修改", "102100102", 4), new Menu("删除", "102100103", 4), new Menu("查询", "102100104", 4) ), - new Menu("打印队列信息", "102100200", 3,"","/wms/business-data/print-queue").addChildList( + new Menu("打印队列信息", "102100200", 3, "", "/wms/business-data/print-queue").addChildList( new Menu("新增", "102100201", 4), new Menu("修改", "102100202", 4), new Menu("删除", "102100203", 4), new Menu("查询", "102100204", 4) ), - new Menu("单据并发锁定操作信息", "102100300", 3,"","/wms/business-data/document-operation").addChildList( + new Menu("单据并发锁定操作信息", "102100300", 3, "", "/wms/business-data/document-operation").addChildList( new Menu("新增", "102100301", 4), new Menu("修改", "102100302", 4), new Menu("删除", "102100303", 4), @@ -503,7 +508,7 @@ public class JavaTest { //endregion //region Description 权限管控 new Menu("权限管控", "102110000", 2).addChildList( - new Menu("数据权限", "102110100", 3,"","/wms/authority-control/data-permission").addChildList( + new Menu("数据权限", "102110100", 3, "", "/wms/authority-control/data-permission").addChildList( new Menu("新增", "102110101", 4), new Menu("修改", "102110102", 4), new Menu("删除", "102110103", 4), @@ -513,19 +518,19 @@ public class JavaTest { //endregion //region Description 打印中心 new Menu("打印中心", "102120000", 2).addChildList( - new Menu("条码打印", "102120100", 3,"","/wms/print-center/barcode-printing").addChildList( + new Menu("条码打印", "102120100", 3, "", "/wms/print-center/barcode-printing").addChildList( new Menu("打印", "102120101", 4), new Menu("补打", "102120102", 4), new Menu("查询", "102120103", 4) ), - new Menu("条码补打记录", "102120200", 3,"","/wms/print-center/barcode-makeup").addChildList( + new Menu("条码补打记录", "102120200", 3, "", "/wms/print-center/barcode-makeup").addChildList( new Menu("查询", "102120201", 4), new Menu("导出", "102120202", 4) ), - new Menu("收货回执", "102120300", 3,"","/wms/print-center/receipt-receipt").addChildList( + new Menu("收货回执", "102120300", 3, "", "/wms/print-center/receipt-receipt").addChildList( new Menu("查询", "102120301", 4) ), - new Menu("单据打印", "102120400", 3,"","/wms/print-center/document-printing").addChildList( + new Menu("单据打印", "102120400", 3, "", "/wms/print-center/document-printing").addChildList( new Menu("查询", "102120401", 4), new Menu("打印", "102120402", 4) ) @@ -533,30 +538,30 @@ public class JavaTest { //endregion //region Description 散件业务 new Menu("散件业务", "102130000", 2).addChildList( - new Menu("散件入库", "102130100", 3,"","/wms/parts-business/parts-instock").addChildList( + new Menu("散件入库", "102130100", 3, "", "/wms/parts-business/parts-instock").addChildList( new Menu("保存", "102130101", 4), new Menu("补打", "102130102", 4), new Menu("查询", "102130103", 4) ), - new Menu("散件拣货", "102130200", 3,"","/wms/parts-business/parts-picking").addChildList( + new Menu("散件拣货", "102130200", 3, "", "/wms/parts-business/parts-picking").addChildList( new Menu("拣货", "102130201", 4), new Menu("查询", "102130202", 4), new Menu("导出", "102130203", 4) ), - new Menu("散件收货", "102130300", 3,"","/wms/parts-business/parts-receipt").addChildList( + new Menu("散件收货", "102130300", 3, "", "/wms/parts-business/parts-receipt").addChildList( new Menu("查询", "102130301", 4) ), - new Menu("散件质检", "102130400", 3,"","/wms/parts-business/parts-quality").addChildList( + new Menu("散件质检", "102130400", 3, "", "/wms/parts-business/parts-quality").addChildList( new Menu("保存", "102130401", 4), new Menu("补打", "102130402", 4), new Menu("查询", "102130403", 4) ), - new Menu("散件盘点", "102130500", 3,"","/wms/parts-business/parts-check").addChildList( + new Menu("散件盘点", "102130500", 3, "", "/wms/parts-business/parts-check").addChildList( new Menu("保存", "102130501", 4), new Menu("补打", "102130502", 4), new Menu("查询", "102130503", 4) ), - new Menu("散件移库", "102130600", 3,"","/wms/parts-business/parts-transfer").addChildList( + new Menu("散件移库", "102130600", 3, "", "/wms/parts-business/parts-transfer").addChildList( new Menu("保存", "102130601", 4), new Menu("补打", "102130602", 4), new Menu("查询", "102130603", 4) @@ -566,10 +571,10 @@ public class JavaTest { ), //endregion //region Description MES - new Menu("MES", "103000000", 1, "","/mes").addChildList( + new Menu("MES", "103000000", 1, "", "/mes").addChildList( //region Description 报表设置 new Menu("基础数据维护", "103010000", 2).addChildList( - new Menu("BOM", "103010100", 3,"","").addChildList( + new Menu("BOM", "103010100", 3, "", "").addChildList( new Menu("新增", "103010101", 4), new Menu("修改", "103010102", 4), new Menu("删除", "103010103", 4), @@ -580,10 +585,10 @@ public class JavaTest { ), //endregion //region Description 动态表单 - new Menu("动态表单", "104000000", 1, "fa fa-newspaper-o","/form").addChildList( + new Menu("动态表单", "104000000", 1, "fa fa-newspaper-o", "/form").addChildList( //region Description 基础信息管理 new Menu("表单设置", "104010000", 2).addChildList( - new Menu("对象管理", "104010100", 3,"","/form/obj").addChildList( + new Menu("对象管理", "104010100", 3, "", "/form/obj").addChildList( new Menu("新增", "104010101", 4), new Menu("修改", "104010102", 4), new Menu("删除", "104010103", 4), @@ -592,7 +597,7 @@ public class JavaTest { new Menu("对象属性-修改", "104010106", 4), new Menu("对象属性-删除", "104010107", 4) ), - new Menu("元素管理", "104010200", 3,"","/form/ele").addChildList( + new Menu("元素管理", "104010200", 3, "", "/form/ele").addChildList( new Menu("新增", "104010201", 4), new Menu("修改", "104010202", 4), new Menu("删除", "104010203", 4), @@ -604,7 +609,7 @@ public class JavaTest { new Menu("虚拟属性-删除", "104010209", 4), new Menu("虚拟属性-查询", "104010210", 4) ), - new Menu("拦截器管理", "104010300", 3,"","/form/interceptor").addChildList( + new Menu("拦截器管理", "104010300", 3, "", "/form/interceptor").addChildList( new Menu("新增", "104010301", 4), new Menu("修改", "104010302", 4), new Menu("删除", "104010303", 4), @@ -616,7 +621,7 @@ public class JavaTest { new Menu("子表-删除", "104010309", 4), new Menu("子表-查询", "104010310", 4) ), - new Menu("按钮管理", "104010400", 3,"","/form/button").addChildList( + new Menu("按钮管理", "104010400", 3, "", "/form/button").addChildList( new Menu("新增", "104010401", 4), new Menu("修改", "104010402", 4), new Menu("删除", "104010403", 4), @@ -626,13 +631,13 @@ public class JavaTest { new Menu("绑定-删除", "104010407", 4), new Menu("绑定-查询", "104010408", 4) ), - new Menu("功能管理", "104010500", 3,"","/form/func").addChildList( + new Menu("功能管理", "104010500", 3, "", "/form/func").addChildList( new Menu("新增", "104010501", 4), new Menu("修改", "104010502", 4), new Menu("删除", "104010503", 4), new Menu("查询", "104010504", 4) ), - new Menu("功能明细管理", "104010600", 3,"","/form/func-details").addChildList( + new Menu("功能明细管理", "104010600", 3, "", "/form/func-details").addChildList( new Menu("新增", "104010601", 4), new Menu("修改", "104010602", 4), new Menu("删除", "104010603", 4), @@ -642,14 +647,14 @@ public class JavaTest { new Menu("关联属性-删除", "104010607", 4), new Menu("关联属性-查询", "104010608", 4) ), - new Menu("布局管理", "104010700", 3,"","/form/layout").addChildList( + new Menu("布局管理", "104010700", 3, "", "/form/layout").addChildList( new Menu("新增", "104010701", 4), new Menu("修改", "104010702", 4), new Menu("删除", "104010703", 4), new Menu("查询", "104010704", 4), new Menu("预览", "104010705", 4) ), - new Menu("功能目录", "104010800", 3,"","").addChildList( + new Menu("功能目录", "104010800", 3, "", "").addChildList( new Menu("新增", "104010801", 4), new Menu("修改", "104010802", 4), new Menu("删除", "104010803", 4), @@ -657,7 +662,7 @@ public class JavaTest { new Menu("启用", "104010805", 4), new Menu("禁用", "104010806", 4) ), - new Menu("级联管理", "104010900", 3,"","/form/func-catalog").addChildList( + new Menu("级联管理", "104010900", 3, "", "/form/func-catalog").addChildList( new Menu("新增", "104010901", 4), new Menu("修改", "104010902", 4), new Menu("删除", "104010903", 4), @@ -667,7 +672,7 @@ public class JavaTest { new Menu("明细-删除", "104010907", 4), new Menu("明细-查询", "104010908", 4) ), - new Menu("权限分配", "104011000", 3,"","/form/permission").addChildList( + new Menu("权限分配", "104011000", 3, "", "/form/permission").addChildList( new Menu("分配权限", "104011001", 4), new Menu("删除", "104011002", 4), new Menu("查询", "104011003", 4) @@ -677,16 +682,16 @@ public class JavaTest { ), //endregion //region Description 动态报表 - new Menu("动态报表", "105000000", 1, "fa fa-book","/report").addChildList( + new Menu("动态报表", "105000000", 1, "fa fa-book", "/report").addChildList( //region Description 报表设置 new Menu("报表设置", "105010000", 2).addChildList( - new Menu("元素管理", "105010100", 3,"","/report/ele").addChildList( + new Menu("元素管理", "105010100", 3, "", "/report/ele").addChildList( new Menu("新增", "105010101", 4), new Menu("修改", "105010102", 4), new Menu("删除", "105010103", 4), new Menu("查询", "105010104", 4) ), - new Menu("目录管理", "105010200", 3,"","/report/catalog").addChildList( + new Menu("目录管理", "105010200", 3, "", "/report/catalog").addChildList( new Menu("新增", "105010201", 4), new Menu("修改", "105010202", 4), new Menu("删除", "105010203", 4), @@ -694,21 +699,21 @@ public class JavaTest { new Menu("启用", "105010205", 4), new Menu("禁用", "105010206", 4) ), - new Menu("报表管理", "105010300", 3,"","/report/manage").addChildList( + new Menu("报表管理", "105010300", 3, "", "/report/manage").addChildList( new Menu("新增", "105010301", 4), new Menu("修改", "105010302", 4), new Menu("删除", "105010303", 4), new Menu("查询", "105010304", 4), new Menu("预览", "105010305", 4) ), - new Menu("模板管理", "105010400", 3,"","/report/templet").addChildList( + new Menu("模板管理", "105010400", 3, "", "/report/templet").addChildList( new Menu("新增", "105010401", 4), new Menu("修改", "105010402", 4), new Menu("删除", "105010403", 4), new Menu("查询", "105010404", 4), new Menu("预览", "105010405", 4) ), - new Menu("布局管理", "105010500", 3,"","/report/layout").addChildList( + new Menu("布局管理", "105010500", 3, "", "/report/layout").addChildList( new Menu("新增", "105010501", 4), new Menu("修改", "105010502", 4), new Menu("删除", "105010503", 4), @@ -720,63 +725,63 @@ public class JavaTest { ), //endregion //region Description WMS-PDA - new Menu("WMS-PDA", "106000000", 1, "fa fa-barcode","/wms-pda").addChildList( + new Menu("WMS-PDA", "106000000", 1, "fa fa-barcode", "/wms-pda").addChildList( //region Description 收货 - new Menu("收货", "106010100", 2,"#icon-purchasereceipt").addChildList( - new Menu("ASN收货", "106010101", 3,"#icon-shouhuoshou--","/handle?transCode=10070").addChildList(), - new Menu("PO收货", "106010102", 3,"#icon-recept","/handle?transCode=10080").addChildList() + new Menu("收货", "106010100", 2, "#icon-purchasereceipt").addChildList( + new Menu("ASN收货", "106010101", 3, "#icon-shouhuoshou--", "/handle?transCode=10070").addChildList(), + new Menu("PO收货", "106010102", 3, "#icon-recept", "/handle?transCode=10080").addChildList() ), //endregion //region Description 质检 - new Menu("质检", "106020000", 2,"#icon-shouye-").addChildList( + new Menu("质检", "106020000", 2, "#icon-shouye-").addChildList( new Menu("条码打印", "106020100", 3).addChildList() ), //endregion //region Description 生产领料 - new Menu("生产领料", "106030000", 2,"#icon-lingqu").addChildList( + new Menu("生产领料", "106030000", 2, "#icon-lingqu").addChildList( new Menu("条码打印", "106030100", 3).addChildList() ), //endregion //region Description 生产退料 - new Menu("生产退料", "106040000", 2,"#icon-shengchanlingliaoyutuiliao").addChildList( + new Menu("生产退料", "106040000", 2, "#icon-shengchanlingliaoyutuiliao").addChildList( new Menu("条码打印", "106040100", 3).addChildList() ), //endregion //region Description 内部移库 - new Menu("内部移库", "106050000", 2,"#icon-yiku").addChildList( + new Menu("内部移库", "106050000", 2, "#icon-yiku").addChildList( new Menu("条码打印", "106050100", 3).addChildList() ), //endregion //region Description 零星出库 - new Menu("零星出库", "106060000", 2,"#icon-ico_kufangguanli_qinglingchuku").addChildList( + new Menu("零星出库", "106060000", 2, "#icon-ico_kufangguanli_qinglingchuku").addChildList( new Menu("条码打印", "106060100", 3).addChildList() ), //endregion //region Description 零星入库 - new Menu("零星入库", "106070000", 2,"#icon-zhcc_ruku").addChildList( + new Menu("零星入库", "106070000", 2, "#icon-zhcc_ruku").addChildList( new Menu("条码打印", "106070100", 3).addChildList() ), //endregion //region Description 盘点 - new Menu("盘点", "106080000", 2,"#icon-PDA").addChildList( + new Menu("盘点", "106080000", 2, "#icon-PDA").addChildList( new Menu("条码打印", "106080100", 3).addChildList() ), //endregion //region Description 入库上架 - new Menu("入库上架", "106090000", 2,"#icon-ico_zongkuguanli_caigouruku").addChildList( + new Menu("入库上架", "106090000", 2, "#icon-ico_zongkuguanli_caigouruku").addChildList( new Menu("标准入库", "106090100", 3).addChildList() ) //endregion ), //endregion //region Description MES-PCN - new Menu("MES-PCN", "107000000", 1, "","/mes-pcn"), + new Menu("MES-PCN", "107000000", 1, "", "/mes-pcn"), //endregion //region Description SWEB - new Menu("SWEB", "108000000", 1, "fa fa-file-word-o","/sweb").addChildList( + new Menu("SWEB", "108000000", 1, "fa fa-file-word-o", "/sweb").addChildList( //region Description 基础数据维护 new Menu("基础数据维护", "108010000", 2).addChildList( - new Menu("供应商信息", "108010100", 3,"","/sweb/base-data/supplier-info").addChildList( + new Menu("供应商信息", "108010100", 3, "", "/sweb/base-data/supplier-info").addChildList( new Menu("新增", "108010101", 4), new Menu("修改", "108010102", 4), new Menu("删除", "108010103", 4), @@ -784,7 +789,7 @@ public class JavaTest { new Menu("启用", "108010105", 4), new Menu("禁用", "108010106", 4) ), - new Menu("开口合同", "108010200", 3,"","/sweb/base-data/open-end").addChildList( + new Menu("开口合同", "108010200", 3, "", "/sweb/base-data/open-end").addChildList( new Menu("新增", "108010201", 4), new Menu("修改", "108010202", 4), new Menu("删除", "108010203", 4), @@ -792,7 +797,7 @@ public class JavaTest { new Menu("启用", "108010205", 4), new Menu("禁用", "108010206", 4) ), - new Menu("系统配置", "108010300", 3,"","/sweb/base-data/config-info").addChildList( + new Menu("系统配置", "108010300", 3, "", "/sweb/base-data/config-info").addChildList( new Menu("新增", "108010301", 4), new Menu("修改", "108010302", 4), new Menu("删除", "108010303", 4), @@ -804,7 +809,7 @@ public class JavaTest { //endregion //region Description 工厂订单管理 new Menu("工厂订单管理", "108020000", 2).addChildList( - new Menu("条码打印", "108020100", 3,"","/sweb/factory-order/barcode-printing").addChildList( + new Menu("条码打印", "108020100", 3, "", "/sweb/factory-order/barcode-printing").addChildList( new Menu("新增", "108020101", 4), new Menu("修改", "108020102", 4), new Menu("删除", "108020103", 4), @@ -814,7 +819,7 @@ public class JavaTest { new Menu("启用", "108020107", 4), new Menu("禁用", "108020108", 4) ), - new Menu("订单发布", "108020200", 3,"","/sweb/factory-order/order-release").addChildList( + new Menu("订单发布", "108020200", 3, "", "/sweb/factory-order/order-release").addChildList( new Menu("新增", "108020201", 4), new Menu("修改", "108020202", 4), new Menu("删除", "108020203", 4), @@ -825,7 +830,7 @@ public class JavaTest { new Menu("启用", "108020208", 4), new Menu("禁用", "108020209", 4) ), - new Menu("订单管理", "108020300", 3,"","/sweb/factory-order/order-manage").addChildList( + new Menu("订单管理", "108020300", 3, "", "/sweb/factory-order/order-manage").addChildList( new Menu("新增", "108020301", 4), new Menu("修改", "108020302", 4), new Menu("删除", "108020303", 4), @@ -837,26 +842,26 @@ public class JavaTest { //endregion //region Description 供应商订单管理 new Menu("供应商订单管理", "108030000", 2).addChildList( - new Menu("打包", "108030100", 3,"","/sweb/base-data/physical-pack").addChildList( + new Menu("打包", "108030100", 3, "", "/sweb/base-data/physical-pack").addChildList( new Menu("新增", "108030101", 4), new Menu("修改", "108030102", 4), new Menu("删除", "108030103", 4), new Menu("查询", "108030104", 4) ), - new Menu("订单查看", "108030200", 3,"","/sweb/supplier-manage/order-view").addChildList( + new Menu("订单查看", "108030200", 3, "", "/sweb/supplier-manage/order-view").addChildList( new Menu("新增", "108030201", 4), new Menu("修改", "108030202", 4), new Menu("删除", "108030203", 4), new Menu("查询", "108030204", 4) ), - new Menu("订单确认与发布", "108030300", 3,"","/sweb/supplier-manage/order-check").addChildList( + new Menu("订单确认与发布", "108030300", 3, "", "/sweb/supplier-manage/order-check").addChildList( new Menu("新增", "108030301", 4), new Menu("修改", "108030302", 4), new Menu("删除", "108030303", 4), new Menu("查询", "108030304", 4), new Menu("订单确认", "108030305", 4) ), - new Menu("条码打印", "108030400", 3,"","/sweb/supplier-manage/barcode-printing").addChildList( + new Menu("条码打印", "108030400", 3, "", "/sweb/supplier-manage/barcode-printing").addChildList( new Menu("新增", "108030401", 4), new Menu("修改", "108030402", 4), new Menu("删除", "108030403", 4), @@ -876,10 +881,10 @@ public class JavaTest { new Menu("LES", "109000000", 1, ""), //endregion //region Description 安灯-管理 - new Menu("安灯-管理", "110000000", 1, "","/andon-management").addChildList( + new Menu("安灯-管理", "110000000", 1, "", "/andon-management").addChildList( //region Description 异常管理 new Menu("异常管理", "110010000", 2).addChildList( - new Menu("任务管理", "110010100", 3,"","/andon-management/error-manage/task-manage").addChildList( + new Menu("任务管理", "110010100", 3, "", "/andon-management/error-manage/task-manage").addChildList( new Menu("事件维护信息", "110010101", 4), new Menu("操作详情", "110010102", 4) ) @@ -887,29 +892,29 @@ public class JavaTest { //endregion //region Description 报表管理 new Menu("报表管理", "110020000", 2).addChildList( - new Menu("人员统计报表", "110020100", 3,"","/andon-management/report-manage/personnel-report").addChildList( + new Menu("人员统计报表", "110020100", 3, "", "/andon-management/report-manage/personnel-report").addChildList( new Menu("新增", "110020101", 4) ), - new Menu("工位统计报表", "110020200", 3,"","/andon-management/report-manage/workstation-report").addChildList( + new Menu("工位统计报表", "110020200", 3, "", "/andon-management/report-manage/workstation-report").addChildList( new Menu("新增", "110020201", 4) ), - new Menu("原因统计报表", "110020300", 3,"","/andon-management/report-manage/reason-report").addChildList( + new Menu("原因统计报表", "110020300", 3, "", "/andon-management/report-manage/reason-report").addChildList( new Menu("查询", "110020301", 4) ), - new Menu("统计分析柏拉图", "11002040", 3,"","/andon-management/report-manage/statistical-plato").addChildList( + new Menu("统计分析柏拉图", "11002040", 3, "", "/andon-management/report-manage/statistical-plato").addChildList( new Menu("查询", "110020401", 4) ) ), //endregion //region Description 基础数据维护 new Menu("基础数据维护", "110030000", 2).addChildList( - new Menu("Andon类型", "110030100", 3,"","/andon-management/basic-data/andon-type").addChildList( + new Menu("Andon类型", "110030100", 3, "", "/andon-management/basic-data/andon-type").addChildList( new Menu("新增", "110030101", 4), new Menu("修改", "110030102", 4), new Menu("删除", "110030103", 4), new Menu("查询", "110030104", 4) ), - new Menu("组织模型", "110030200", 3,"","/andon-management/base-data/factorymodel").addChildList( + new Menu("组织模型", "110030200", 3, "", "/andon-management/base-data/factorymodel").addChildList( new Menu("新增", "110030201", 4), new Menu("修改", "110030202", 4), new Menu("删除", "110030203", 4), @@ -920,9 +925,9 @@ public class JavaTest { ), //endregion //region Description 安灯-工位 - new Menu("安灯-工位", "111000000", 1, "","/andon-station").addChildList( + new Menu("安灯-工位", "111000000", 1, "", "/andon-station").addChildList( //region Description ANDON 看板 - new Menu("ANDON 看板", "111010000", 2,"","/andon-station").addChildList(), + new Menu("ANDON 看板", "111010000", 2, "", "/andon-station").addChildList(), //endregion //region Description ANDON 作业 new Menu("ANDON 作业", "111020000", 2).addChildList() @@ -931,8 +936,21 @@ public class JavaTest { //endregion ); + private static EntityManager entityManager; - public static void main(String[] args)throws Exception { + @Autowired + public void setEntityManager(EntityManager entityManager) { + this.entityManager = entityManager; + } + + private static ImppRedis redisRes; + + @Resource(name = "redisRes") + public void setRedisRes(ImppRedis redisRes) { + this.redisRes = redisRes; + } + + public static void main(String[] args) throws Exception { Map map = getChildList(menu); List list = new ArrayList<>(); @@ -946,9 +964,9 @@ public class JavaTest { System.out.println("INSERT INTO sys_menu (id, is_deleted, is_valid, menu_class_path, menu_code, menu_css, " + "menu_description, menu_grade, menu_icon, menu_sort, menu_status, menu_type, menu_url, name, parent_id," + " parent_name_rdd, name_zh_shortening) VALUES " + - "("+menu.getId()+", 2, 1, '"+getValue(menu.getMenuClassPath())+"', '"+getValue(menu.getMenuCode())+"', '"+getValue(menu.getMenuCss())+"'," + - " '"+getValue(menu.getMenuDescription())+"', '"+menu.getMenuGrade()+"', '"+getValue(menu.getMenuIcon())+"', '0', 1, "+menu.getMenuType()+", " + - "'"+getValue(menu.getMenuUrl())+"', '"+getValue(menu.getName())+"', "+menu.getParentId()+", '"+getValue(menu.getParentNameRdd())+"', '"+getValue(menu.getNameZhShortening())+"');"); + "(" + menu.getId() + ", 2, 1, '" + getValue(menu.getMenuClassPath()) + "', '" + getValue(menu.getMenuCode()) + "', '" + getValue(menu.getMenuCss()) + "'," + + " '" + getValue(menu.getMenuDescription()) + "', '" + menu.getMenuGrade() + "', '" + getValue(menu.getMenuIcon()) + "', '0', 1, " + menu.getMenuType() + ", " + + "'" + getValue(menu.getMenuUrl()) + "', '" + getValue(menu.getName()) + "', " + menu.getParentId() + ", '" + getValue(menu.getParentNameRdd()) + "', '" + getValue(menu.getNameZhShortening()) + "');"); }); System.out.println("\n\n\n"); @@ -956,9 +974,10 @@ public class JavaTest { File file = new File("E:\\test.xls"); file.createNewFile(); - ExcelTool.exportData(file, list, SysMenu.class, new String[]{ - "menuCode", "name","parentId","menuType","menuStatus","parentNameRdd","menuUrl","menuClassPath","menuGrade","menuSort" - ,"menuCss","menuIcon","menuDescription" + ExcelTool excelTool = new ExcelTool(entityManager, redisRes); + excelTool.exportData(file, list, SysMenu.class, new String[]{ + "menuCode", "name", "parentId", "menuType", "menuStatus", "parentNameRdd", "menuUrl", "menuClassPath", "menuGrade", "menuSort" + , "menuCss", "menuIcon", "menuDescription" }); System.out.println("----------------------------"); @@ -989,7 +1008,7 @@ public class JavaTest { return result; } - public static String getValue(String str){ + public static String getValue(String str) { return StringUtils.isNotBlank(str) ? str : ""; } @@ -1026,7 +1045,7 @@ class Menu { this.menuIcon = menuIcon; } - public Menu(String name, String menuCode, Integer menuType, String menuIcon,String menuUrl) { + public Menu(String name, String menuCode, Integer menuType, String menuIcon, String menuUrl) { this.name = name; this.menuCode = menuCode; this.menuType = menuType; diff --git a/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/TestExcelUtil.java b/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/TestExcelUtil.java index 357373a..c575a78 100644 --- a/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/TestExcelUtil.java +++ b/modules/i3plus-core-apiservice/src/test/java/test/cn/estsh/i3plus/core/apiservice/util/TestExcelUtil.java @@ -4,11 +4,14 @@ import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.TestBase; import cn.estsh.i3plus.platform.common.tool.ExcelTool; import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil; import cn.estsh.i3plus.pojo.platform.bean.SysTool; +import cn.estsh.impp.framework.boot.util.ImppRedis; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import javax.persistence.EntityManager; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; @@ -30,10 +33,18 @@ public class TestExcelUtil extends TestBase { } + + @Autowired + private EntityManager entityManager; + + @Resource(name = "redisRes") + private ImppRedis redisRes; + @Test public void importData() throws Exception{ try { - List sy = ExcelTool.importData("testOut.xls", new FileInputStream("E://testOut.xls"), SysTool.class); + ExcelTool excelTool = new ExcelTool(entityManager, redisRes); + List sy = excelTool.importData("testOut.xls", new FileInputStream("E://testOut.xls"), SysTool.class); System.out.println(sy); } catch (FileNotFoundException e) { e.printStackTrace();