Merge remote-tracking branch 'remotes/origin/dev' into test

yun-zuoyi
汪云昊 5 years ago
commit 1e13741d03

@ -60,16 +60,28 @@ public interface ISysLocaleResourceService {
@ApiOperation(value = "删除所有资源")
void deleteSysLocaleResourceAll();
/***************************** 缺失资源管理 ******************************/
List<MissResourceModel> listMissResourceModel();
MissResourceModel saveMissResourceModel(MissResourceModel missResourceModel);
void updateMissResourceModelIsValidByKeys(String[] keys, Integer isValid);
void doCleanInValidMissResource();
void doConversionMissResourceByKeys(String[] keys);
/***************************** 缺失资源管理 ******************************/
/**
*
* @param num
* @return
*/
@ApiOperation(value = "查询指定数量的缺失资源")
List<MissResourceModel> findMissResourceModelByTop(int num);
/**
* key
* @param keys
*/
@ApiOperation(value = "根据key删除缺失资源信息")
void deleteInValidMissResourceByKeys(String[] keys);
/**
*
* @param missResourceModelList
*/
@ApiOperation(value = "批量转换缺失资源")
void doConversionMissResourceByKeys(List<MissResourceModel> missResourceModelList) ;
}

@ -98,4 +98,7 @@ public interface ISysMenuService {
@ApiOperation(value = "查询菜单信息",notes = "查询菜单信息(分页、组合)")
ListPager<SysMenu> querySysMenu(SysMenu menu,List<Long> idList, Pager pager);
@ApiOperation(value = "根据菜单代码查询菜单信息")
SysMenu getSysMenuByCode(String code);
}

@ -24,13 +24,14 @@ import java.util.Map;
* @Modify:
**/
public class DefaultModularRealm extends ModularRealmAuthenticator {
private static final Logger LOGGER = LoggerFactory.getLogger(DemoAuthController.class);
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultModularRealm.class);
private Map<String, Realm> definedRealms;
public DefaultModularRealm(Map<String, Realm> definedRealms) {
this.definedRealms = definedRealms;
}
@Override
protected AuthenticationInfo doMultiRealmAuthentication(Collection<Realm> realms, AuthenticationToken token) {
return super.doMultiRealmAuthentication(realms, token);
}
@ -43,6 +44,7 @@ public class DefaultModularRealm extends ModularRealmAuthenticator {
this.definedRealms = definedRealms;
}
@Override
protected AuthenticationInfo doAuthenticate(AuthenticationToken token) throws AuthenticationException {
Realm realm;
if (token instanceof SaAdminToken) {
@ -61,6 +63,7 @@ public class DefaultModularRealm extends ModularRealmAuthenticator {
return this.doSingleRealmAuthentication(realm, token);
}
@Override
protected AuthenticationInfo doSingleRealmAuthentication(Realm realm, AuthenticationToken token) {
if (!realm.supports(token)) {
throw new AuthenticationException("TOKEN类型异常请联系管理员");

@ -61,9 +61,6 @@ public class AppStartSystemInit implements CommandLineRunner {
@Override
public void run(String... args) throws Exception {
try {
LOGGER.info("【IMPP-Core开始绑定资源信息...】");
packIMPPResources();
LOGGER.info("【IMPP-Core开始加载基础信息...】");
systemInitService.putAndLoadAll();
@ -115,168 +112,4 @@ public class AppStartSystemInit implements CommandLineRunner {
}
}
/**
*
* cn.estsh.i3plus.core.apiservice.serviceimpl.base.SystemInitService
*/
public void packIMPPResources() {
// /**
// * 整体数据结构:
// * code <lang : value>
// * 先根据code查询判断是否存在然后通过语言获取对应的值
// */
// HashMap<String, HashMap<String, String>> resMap = new HashMap();
// HashMap<String, String> lanMap = null;
// HashMap<String, HashMap<String, String>> webLangMap = new HashMap<>();
// HashMap<String, String> webResMap;
//
// //语言数量
// List<SysLocaleLanguage> langList = systemResourceService.listSysLocaleLanguage(null);
//
// //查询所有资源
// List<SysLocaleResource> resourceList = systemResourceService.listSysLocaleResource(null);
// LOGGER.info("【加载平台资源】共有{}个资源,{}种语言。", resourceList.size(), langList.size());
// for (SysLocaleResource res : resourceList) {
// //遍历资源放入map中
// lanMap = resMap.get(res.getResourceKey());
// //判断是否已存在资源信息
// if (lanMap == null) {
// lanMap = new HashMap<String, String>();
// //将key/代码放入
// resMap.put(res.getResourceKey(), lanMap);
// }
// //根据语言放入
// lanMap.put(res.getLanguageCode(), res.getResourceValue());
//
// // web 资源
// if (!webLangMap.containsKey(res.getLanguageCode())) {
// webLangMap.put(res.getLanguageCode(), new HashMap<>());
// }
// // 放入资源信息
// webResMap = webLangMap.get(res.getLanguageCode());
// webResMap.put(res.getResourceKey(), res.getResourceValue());
// }
//
// for (String key : resMap.keySet()) {
// //放入缓存
// redisRes.putHashMap(CommonConstWords.REDIS_PREFIX_CACHE_LANGUAGE + ":" + key, resMap.get(key), 0);
// }
//
// for (String key : webLangMap.keySet()) {
// //放入缓存
// redisRes.putHashMap(CommonConstWords.REDIS_PREFIX_CACHE_LANGUAGE + ":" + key, webLangMap.get(key), 0);
// }
//
// LOGGER.info("【资源配置文件已全部加载:{}个】", resMap.size());
/*
//资源集合
HashMap<String,String> resMap;
//模块集合
HashMap<String,HashMap<String,String>> langModoleMap = new HashMap();
//功能集合
HashMap<String,HashMap<String,String>> langMethodMap = new HashMap();
//按钮集合
HashMap<String,HashMap<String,String>> langBtnMap = new HashMap();
//信息集合
HashMap<String,HashMap<String,String>> langMsgMap = new HashMap();
//异常集合
HashMap<String,HashMap<String,String>> langExMap = new HashMap();
*//************** 加载国际化 *************//*
for(SysLocaleLanguage lang : langList) {
*//************** 加载模块 *************//*
resource = new SysLocaleResource();
resource.setResourceType(CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.MODULE.getValue());
resource.setLanguageCode(lang.getLanguageCode());
resourceList = systemResourceService.listSysLocaleResource(resource);
if(resourceList.size() > 0) {
LOGGER.info("【{}-{},{}】共有{}个资源。", CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.MODULE.getDescription(),
lang.getLanguageName(), lang.getLanguageCode(), resourceList.size());
}
resMap = new HashMap<String,String>();
for(SysLocaleResource res : resourceList){
resMap.put(res.getResourceKey(),res.getResourceValue());
}
langModoleMap.put(lang.getLanguageCode(),resMap);
*//************** 加载功能 *************//*
resource = new SysLocaleResource();
resource.setResourceType(CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.METHOD.getValue());
resource.setLanguageCode(lang.getLanguageCode());
resourceList = systemResourceService.listSysLocaleResource(resource);
if(resourceList.size() > 0) {
LOGGER.info("【{}-{},{}】共有{}个资源。",CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.METHOD.getDescription(),
lang.getLanguageName(),lang.getLanguageCode(),resourceList.size());
}
resMap = new HashMap<String,String>();
for(SysLocaleResource res : resourceList){
resMap.put(res.getResourceKey(),res.getResourceValue());
}
langMethodMap.put(lang.getLanguageCode(),resMap);
*//************** 加载按钮 *************//*
resource = new SysLocaleResource();
resource.setResourceType(CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.BUTTON.getValue());
resource.setLanguageCode(lang.getLanguageCode());
resourceList = systemResourceService.listSysLocaleResource(resource);
if(resourceList.size() > 0) {
LOGGER.info("【{}-{},{}】共有{}个资源。", CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.BUTTON.getDescription(),
lang.getLanguageName(), lang.getLanguageCode(), resourceList.size());
}
resMap = new HashMap<String,String>();
for(SysLocaleResource res : resourceList){
resMap.put(res.getResourceKey(),res.getResourceValue());
}
langBtnMap.put(lang.getLanguageCode(),resMap);
*//************** 加载资源 *************//*
resource = new SysLocaleResource();
resource.setResourceType(CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.COMMON.getValue());
resource.setLanguageCode(lang.getLanguageCode());
resourceList = systemResourceService.listSysLocaleResource(resource);
if(resourceList.size() > 0) {
LOGGER.info("【{}-{},{}】共有{}个资源。", CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.COMMON.getDescription(),
lang.getLanguageName(), lang.getLanguageCode(), resourceList.size());
}
resMap = new HashMap<String,String>();
for(SysLocaleResource res : resourceList){
resMap.put(res.getResourceKey(),res.getResourceValue());
}
langMsgMap.put(lang.getLanguageCode(),resMap);
*//************** 加载异常 *************//*
resource = new SysLocaleResource();
resource.setResourceType(CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.EXCEPTION.getValue());
resource.setLanguageCode(lang.getLanguageCode());
resourceList = systemResourceService.listSysLocaleResource(resource);
if(resourceList.size() > 0) {
LOGGER.info("【{}-{},{}】共有{}个资源。", CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.EXCEPTION.getDescription(),
lang.getLanguageName(), lang.getLanguageCode(), resourceList.size());
}
resMap = new HashMap<String,String>();
for(SysLocaleResource res : resourceList){
resMap.put(res.getResourceKey(),res.getResourceValue());
}
langExMap.put(lang.getLanguageCode(),resMap);
}
redisCore.putHashMap(CommonConstWords.RES_PLAT_MODULE,langModoleMap);
redisCore.putHashMap(CommonConstWords.RES_PLAT_MODULE_METHOD,langMethodMap);
redisCore.putHashMap(CommonConstWords.RES_PLAT_MODULE_BUTTON,langBtnMap);
redisCore.putHashMap(CommonConstWords.RES_LANGUAGE_CONVERT,langMsgMap);
redisCore.putHashMap(CommonConstWords.RES_EXCEPTION_CONVERT,langExMap);
LOGGER.info("【资源配置文件已全部加载】");*/
}
}

@ -89,7 +89,7 @@ public class DemoAuthController extends CoreBaseController {
while (headerNames.hasMoreElements()) {
String key = (String) headerNames.nextElement();
String value = request.getHeader(key);
System.out.println("k : " + key + " , v : " + value);
LOGGER.info("k : {} , v : {}", key, value);
}
return new ResultBean(true, "", sUser);

@ -17,7 +17,7 @@ import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;

@ -8,7 +8,7 @@ import cn.estsh.i3plus.pojo.platform.bean.SysDepartment;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@ -14,7 +14,7 @@ import cn.estsh.i3plus.pojo.platform.platbean.SysLogOperate;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@ -9,11 +9,10 @@ import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleLanguage;
import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
import cn.estsh.i3plus.pojo.platform.bean.SysUser;
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.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.LocaleUtils;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
@ -23,7 +22,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

@ -2,18 +2,12 @@ package cn.estsh.i3plus.core.apiservice.controller.base;
import cn.estsh.i3plus.core.api.iservice.base.ISysLogService;
import cn.estsh.i3plus.core.api.iservice.base.ISystemInitService;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.platform.plugin.elasticsearch.ElasticSearchTool;
import cn.estsh.i3plus.pojo.model.license.ImppLicense;
import cn.estsh.impp.framework.boot.license.ImppLicenseTool;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogException;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogOperate;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogSystem;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogTaskTime;
import cn.estsh.i3plus.pojo.model.license.ImppLicense;
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.license.ImppLicenseTool;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;
@ -25,8 +19,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
* @Description :
* @Reference :

@ -17,7 +17,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.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import org.springframework.beans.factory.annotation.Autowired;

@ -5,11 +5,10 @@ import cn.estsh.i3plus.core.api.iservice.base.ISystemInitService;
import cn.estsh.i3plus.core.api.iservice.base.ISystemLoginService;
import cn.estsh.i3plus.core.api.iservice.busi.*;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.tool.CookieTool;
import cn.estsh.i3plus.platform.common.tool.ServletRequestTool;
import cn.estsh.i3plus.platform.common.tool.StringTool;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.platform.common.tool.*;
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
import cn.estsh.i3plus.pojo.base.annotation.AnnoIgnoreLog;
import cn.estsh.i3plus.pojo.base.bean.BaseConstWords;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
@ -21,10 +20,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.LocaleUtils;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import cn.estsh.impp.framework.boot.util.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -519,13 +515,14 @@ public class WhiteController extends CoreBaseController {
}
}
@AnnoIgnoreLog
@PostMapping(value = "/miss-resource/get")
@ApiOperation(value = "根据条件分页查询账号信息", notes = "根据条件分页查询账号信息")
public ResultBean getMissResourceByKey(String key,String soft){
@ApiOperation(value = "缺失资源", notes = "缺失资源")
public ResultBean getMissResourceByKey(String key,String menuCode){
try {
LocaleUtils.saveMissResource(key, AuthUtil.getSessionLanguage().toString(), CommonEnumUtil.SOFT_TYPE.descOf(soft),
CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.MISSING.getValue(),
CommonEnumUtil.MiSS_RESOURCE_SOURCE.SERVER.getValue());
Map<String,String> missResource = new HashMap<>();
missResource.put(key,menuCode);
rabbitTemplate.convertAndSend(PlatformConstWords.QUEUE_IMPP_RESOURCE, JsonUtilTool.encode(missResource));
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
@ -533,4 +530,21 @@ public class WhiteController extends CoreBaseController {
return ResultBean.fail(e).setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}
}
@AnnoIgnoreLog
@GetMapping(value = "/miss-resource/web-listener-switch")
@ApiOperation(value = "缺失资源开关", notes = "缺失资源开关")
public ResultBean getWebMissResourceSwitch(){
try {
int webListener = RedisCacheTool.getSysConfigIntVal(PlatformConstWords.WEB_MISS_RESOURCE_LISTENER_SWITCH,
CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
return ResultBean.success("获取成功")
.setResultObject(webListener == CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
} catch (Exception e) {
return ResultBean.fail(e).setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}
}
}

@ -11,7 +11,7 @@ import cn.estsh.i3plus.pojo.platform.bean.SysBarcodeRule;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;

@ -15,7 +15,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.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;

@ -8,6 +8,7 @@ import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.exception.BaseImppException;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.tool.ExcelTool;
import cn.estsh.i3plus.platform.common.tool.FileTool;
import cn.estsh.i3plus.platform.common.tool.StringTool;
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.platform.common.util.FileContentTypeTool;
@ -43,7 +44,10 @@ import javax.persistence.EntityManager;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -531,7 +535,7 @@ public class SysLocaleResourceController extends CoreBaseController {
@ApiOperation(value = "缺失资源列表")
public ResultBean listMissResource(){
try {
List<MissResourceModel> missResourceModelList = sysLocaleResourceService.listMissResourceModel();
List<MissResourceModel> missResourceModelList = sysLocaleResourceService.findMissResourceModelByTop(100);
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(missResourceModelList);
} catch (ImppBusiException busExcep) {
@ -541,39 +545,11 @@ public class SysLocaleResourceController extends CoreBaseController {
}
}
@PutMapping(value = "/miss/update")
@ApiOperation(value = "更新缺失资源信息")
public ResultBean listMissResource(MissResourceModel missResourceModel){
try {
missResourceModel = sysLocaleResourceService.saveMissResourceModel(missResourceModel);
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultObject(missResourceModel);
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@PutMapping(value = "/miss/batch-update-valid")
@ApiOperation(value = "更新缺失资源有效状态")
public ResultBean updateMissResourceIsValidByKeys(String[] keys,Integer valid){
try {
sysLocaleResourceService.updateMissResourceModelIsValidByKeys(keys, valid);
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@DeleteMapping(value = "/miss/clean-invalid")
@ApiOperation(value = "更新缺失资源有效状态")
public ResultBean cleanMissResourceByInvalid(){
public ResultBean cleanMissResourceByInvalid(String[] keys){
try {
sysLocaleResourceService.doCleanInValidMissResource();
sysLocaleResourceService.deleteInValidMissResourceByKeys(keys);
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {
@ -585,9 +561,9 @@ public class SysLocaleResourceController extends CoreBaseController {
@PostMapping(value = "/miss/batch-conversion")
@ApiOperation(value = "批量转换缺失资源")
public ResultBean doBatchConversionMissResource(String[] keys){
public ResultBean doBatchConversionMissResource(@RequestBody List<MissResourceModel> missResourceModelList){
try {
sysLocaleResourceService.doConversionMissResourceByKeys(keys);
sysLocaleResourceService.doConversionMissResourceByKeys(missResourceModelList);
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {
@ -601,7 +577,7 @@ public class SysLocaleResourceController extends CoreBaseController {
@ApiOperation(value = "导出缺失资源")
public ResultBean exportMissResource(HttpServletResponse response){
try {
List<MissResourceModel> missResourceModelList = sysLocaleResourceService.listMissResourceModel();
List<MissResourceModel> missResourceModelList = sysLocaleResourceService.findMissResourceModelByTop(-1);
Map<String, String> langCodeMap = sysLocaleLanguageService.listSysLocaleLanguage()
.stream()
.collect(
@ -627,9 +603,10 @@ public class SysLocaleResourceController extends CoreBaseController {
}
ExcelTool excelTool = new ExcelTool(entityManager, redisRes);
String tempDir = FileTool.makeTempFolder();
String fileName = "locale_" + System.currentTimeMillis() + ".xls";
File file = new File(fileName);
File file = new File(tempDir,fileName);
if (file.createNewFile()) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())

@ -17,7 +17,7 @@ import cn.estsh.i3plus.pojo.platform.platbean.SysLogException;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import cn.estsh.impp.framework.boot.util.ResultBean;
import io.swagger.annotations.Api;

@ -18,16 +18,17 @@ import cn.estsh.i3plus.pojo.platform.platbean.SysLogOperate;
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.i3plus.platform.common.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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
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;

@ -16,7 +16,7 @@ import cn.estsh.i3plus.pojo.platform.platbean.SysLogSystem;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import cn.estsh.impp.framework.boot.util.ResultBean;
import io.swagger.annotations.Api;

@ -17,7 +17,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.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;

@ -16,7 +16,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.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;

@ -14,7 +14,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.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;

@ -14,7 +14,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.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;

@ -12,7 +12,7 @@ import cn.estsh.i3plus.pojo.platform.bean.SysPosition;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@ -17,7 +17,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.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;

@ -135,7 +135,7 @@ public class CoreReportController extends CoreBaseController {
LOGGER.info("【类信息:{}】", clzNameList);
List<ClassModel> clzList = new ArrayList<>(clzNameList.size());
for (String clzName : clzNameList) {
ClassModel model = ClassTool.getClassModel(clzName);
ClassTool.getClassModel(clzName);
}
return ResultBean.success("获取类:" + clzList.size()).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(clzList);
}

@ -1,23 +1,21 @@
package cn.estsh.i3plus.core.apiservice.mq;
import cn.estsh.i3plus.core.api.iservice.base.ISystemInitService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysLocaleLanguageService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysLocaleResourceService;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.core.api.iservice.busi.ISysMenuService;
import cn.estsh.i3plus.platform.common.tool.JsonUtilTool;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleLanguage;
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleResource;
import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.util.LocaleUtils;
import com.rabbitmq.client.Channel;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static cn.estsh.i3plus.platform.common.util.PlatformConstWords.QUEUE_IMPP_RESOURCE;
@ -29,19 +27,13 @@ import static cn.estsh.i3plus.platform.common.util.PlatformConstWords.QUEUE_IMPP
* @CreateDate : 19-8-23 3:12
* @Modify:
**/
//@Component
@Component
public class SysLocalResourceQueue {
private static final Logger LOGGER = LoggerFactory.getLogger(SysLocalResourceQueue.class);
@Autowired
private ISysLocaleResourceService localeResourceService;
@Autowired
private ISysLocaleLanguageService localeLanguageService;
@Autowired
private ISystemInitService systemInitService;
private ISysMenuService sysMenuService;
/**
*
@ -49,55 +41,28 @@ public class SysLocalResourceQueue {
* <br/>
* <br/>
* </per>
* @param resourceKey
* @param channel
* @param message
*/
@RabbitListener(queues = QUEUE_IMPP_RESOURCE)
public void processImppMessage(String resourceKey, Channel channel, Message message) {
public void processImppMessage(String missResourceStr, Channel channel, Message message) {
try {
if(StringUtils.isNotBlank(resourceKey)){
List<SysLocaleLanguage> list = localeLanguageService.listSysLocaleLanguage();
if(list != null && list.size() > 0){
List<SysLocaleResource> resourceList = localeResourceService.findSysLocaleResourceByResKey(resourceKey);
List<SysLocaleResource> saveResource = new ArrayList<>(list.size());
SysLocaleResource resource = null;
for (SysLocaleLanguage language : list) {
resource = null;
if(resourceList != null && resourceList.size() > 0){
for (SysLocaleResource localeResource : resourceList) {
if(language.getLanguageCode() != null && language.getLanguageCode().equals(localeResource.getLanguageCode())){
resource = localeResource;
}
}
}else {
resource = new SysLocaleResource();
resource.setLanguageCode(language.getLanguageCode());
resource.setLanguageNameRdd(language.getLanguageName());
resource.setIsSystem(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
resource.setResourceType(CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.MISSING.getValue());
resource.setResourceValue(resourceKey);
resource.setResourceKey(resourceKey);
resource.setCreateDatetime(TimeTool.getNowTime(true));
resource.setModifyDatetime(TimeTool.getNowTime(true));
resource.setIsValid(CommonEnumUtil.IS_VAILD.VAILD.getValue()); //有效
resource.setIsDeleted(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); //未删除
}
if(resource != null){
saveResource.add(resource);
}
}
if(saveResource != null && saveResource.size() > 0){
localeResourceService.saveSysLocaleResource(saveResource);
}
Map<String, String> missResource = JsonUtilTool.decode(missResourceStr, Map.class);
if (missResource != null && !missResource.isEmpty()) {
Map.Entry<String, String> entry = missResource.entrySet().iterator().next();
SysMenu sysMenu = sysMenuService.getSysMenuByCode(entry.getValue());
CommonEnumUtil.SOFT_TYPE softType = CommonEnumUtil.SOFT_TYPE.valueOf(sysMenu.getSoftType());
if(softType == null){
softType = CommonEnumUtil.SOFT_TYPE.IMPP;
}
LocaleUtils.saveMissResource(entry.getKey(), AuthUtil.getSessionLanguage().toString(),
softType.getValue(),
CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.MISSING.getValue(),
CommonEnumUtil.MiSS_RESOURCE_SOURCE.WEB.getValue());
}
}catch (Exception e){
e.printStackTrace();
LOGGER.error("缺失资源保存异常:{}", missResourceStr, e);
}finally {
try {
channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);

@ -27,7 +27,7 @@ public class DemoCloudJob extends BaseImppScheduleJob {
@Override
public void executeImppJob(JobExecutionContext context, ApplicationProperties applicationProperties) {
System.out.println("==============测试微服定时任务demo===========");
LOGGER.info("==============测试微服定时任务demo===========");
}
}

@ -186,12 +186,12 @@ public class SystemInitService implements ISystemInitService {
} while (pager.hasNext());
for (Map.Entry<String, Map<String, String>> entry : webLangMap.entrySet()) {
redisRes.putHashMap(entry.getKey(), entry.getValue());
redisRes.putHashMap(entry.getKey(), entry.getValue(),-1);
}
LOGGER.info("【加载WEB资源】WEB-语言 已分类缓存完毕");
for (Map.Entry<String, Map<String, String>> entry : webLangSoftMap.entrySet()) {
redisRes.putHashMap(entry.getKey(), entry.getValue());
redisRes.putHashMap(entry.getKey(), entry.getValue(),-1);
}
LOGGER.info("【加载WEB资源】WEB-语言-模块 已分类缓存完毕");
@ -245,7 +245,7 @@ public class SystemInitService implements ISystemInitService {
} while (pager.hasNext());
for (Map.Entry<String, Map<String, String>> entry : langSoftMap.entrySet()) {
redisRes.putHashMap(entry.getKey(), entry.getValue());
redisRes.putHashMap(entry.getKey(), entry.getValue(),-1);
}
LOGGER.info("【加载资源】模块资源 已分类缓存完毕");

@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@ -35,10 +36,10 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysPosition> packTreeSysPosition(List<SysPosition> list, Long parentId) {
List<SysPosition> result = new ArrayList<>();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
List<SysPosition> copyList = new ArrayList<>(list);
list.forEach(position -> {
if(position.getParentId() != null && position.getParentId().equals(parentId)){
if (position.getParentId() != null && position.getParentId().equals(parentId)) {
result.add(position);
copyList.remove(position);
position.setChildList(packTreeSysPosition(copyList, position.getId()));
@ -51,11 +52,11 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public List<SysPosition> packTreeSysPositionBySysRefUserPosition(List<SysPosition> list, List<SysRefUserPosition> refList) {
List<Long> ids = new ArrayList<>(refList.size());
if(refList != null && refList.size() > 0){
refList.forEach(ref -> ids.add(ref.getPositionId()));
if (refList == null || refList.isEmpty()) {
return Collections.emptyList();
}
List<Long> ids = new ArrayList<>(refList.size());
refList.forEach(ref -> ids.add(ref.getPositionId()));
return packTreeSysPositionByIds(list, ids);
}
@ -64,15 +65,15 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysPosition> packTreeSysPositionByIds(List<SysPosition> list, List<Long> ids) {
List<SysPosition> result = new ArrayList<>();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
list.forEach(position -> {
if(position.getChildList() == null || position.getChildList().size() <= 0){
if(ids.contains(position.getId())){
if (position.getChildList() == null || position.getChildList().size() <= 0) {
if (ids.contains(position.getId())) {
result.add(position);
}
}else{
} else {
List<SysPosition> childList = packTreeSysPositionByIds(position.getChildList(), ids);
if(ids.contains(position.getId()) || childList != null && childList.size() > 0){
if (ids.contains(position.getId()) || childList != null && childList.size() > 0) {
position.setChildList(childList);
result.add(position);
}
@ -85,9 +86,9 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public SysPosition packTreeSysPositionById(List<SysPosition> list, Long id) {
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
for (SysPosition position : list) {
if(position.getId().equals(id)){
if (position.getId().equals(id)) {
position.setChildList(packTreeSysPosition(list, position.getId()));
return position;
}
@ -100,7 +101,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<Long> findChildSysPosition(SysPosition position) {
List<Long> result = new ArrayList<>();
if(position != null && position.getChildList() != null && position.getChildList().size() > 0){
if (position != null && position.getChildList() != null && position.getChildList().size() > 0) {
for (SysPosition sp : position.getChildList()) {
result.add(sp.getId());
List<Long> list = findChildSysPosition(sp);
@ -114,16 +115,16 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public List<Long> findSysPositionChildIdList(Long id) {
SysPosition position = personnelService.getSysPositionById(id);
if(position != null){
if (position != null) {
List<SysPosition> list = personnelService.findSysPositionList();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
SysPosition treeSPosition = packTreeSysPositionById(list, position.getId());
List<Long> idList = findChildSysPosition(treeSPosition);
idList.add(position.getId());
return idList;
}
}
return null;
return Collections.emptyList();
}
/********************************************* Start SysOrganize Tree *********************************************/
@ -131,10 +132,10 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysOrganize> packTreeSysOrganize(List<SysOrganize> list, Long parentId) {
List<SysOrganize> result = new ArrayList<>();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
List<SysOrganize> copyList = new ArrayList<>(list);
list.forEach(organize -> {
if(organize.getParentId() != null && organize.getParentId().equals(parentId)){
if (organize.getParentId() != null && organize.getParentId().equals(parentId)) {
result.add(organize);
copyList.remove(organize);
organize.setChildList(packTreeSysOrganize(copyList, organize.getId()));
@ -149,7 +150,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysOrganize> packTreeSysOrganizeBySysRefUserOrganize(List<SysOrganize> list, List<SysRefUserDepartment> refList) {
List<Long> ids = new ArrayList<>(refList.size());
if(refList != null && refList.size() > 0){
if (refList != null && refList.size() > 0) {
refList.forEach(ref -> ids.add(ref.getOrganizeId()));
}
@ -160,8 +161,8 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysOrganize> packTreeSysOrganizeBySysRefUserInfoOrganize(List<SysOrganize> list, List<SysRefUserInfoDepartment> refList) {
List<Long> ids = new ArrayList<>(refList.size());
if(refList != null && refList.size() > 0){
refList.forEach(ref ->{
if (refList != null && refList.size() > 0) {
refList.forEach(ref -> {
ids.add(ref.getOrganizeId());
});
}
@ -173,15 +174,15 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysOrganize> packTreeSysOrganizeByIds(List<SysOrganize> list, List<Long> ids) {
List<SysOrganize> result = new ArrayList<>();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
list.forEach(organize -> {
if(organize.getChildList() == null || organize.getChildList().size() <= 0){
if(ids.contains(organize.getId())){
if (organize.getChildList() == null || organize.getChildList().size() <= 0) {
if (ids.contains(organize.getId())) {
result.add(organize);
}
}else{
} else {
List<SysOrganize> childList = packTreeSysOrganizeByIds(organize.getChildList(), ids);
if(ids.contains(organize.getId()) || childList != null && childList.size() > 0){
if (ids.contains(organize.getId()) || childList != null && childList.size() > 0) {
organize.setChildList(childList);
result.add(organize);
}
@ -194,9 +195,9 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public SysOrganize packTreeSysOrganizeById(List<SysOrganize> list, Long id) {
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
for (SysOrganize organize : list) {
if(organize.getId().equals(id)){
if (organize.getId().equals(id)) {
organize.setChildList(packTreeSysOrganize(list, organize.getId()));
return organize;
}
@ -208,14 +209,14 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public SysOrganize getTreeSysOrganizeById(List<SysOrganize> list, Long id) {
SysOrganize result = null;
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
for (SysOrganize organize : list) {
if(organize.getId().equals(id)){
if (organize.getId().equals(id)) {
result = organize;
} else if(organize.getChildList() != null && organize.getChildList().size() > 0){
} else if (organize.getChildList() != null && organize.getChildList().size() > 0) {
result = getTreeSysOrganizeById(organize.getChildList(), id);
}
if(result != null){
if (result != null) {
return result;
}
}
@ -227,8 +228,8 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<Long> findChildSysOrganize(SysOrganize organize) {
List<Long> result = new ArrayList<>();
if(organize != null){
if(organize.getChildList() != null && organize.getChildList().size() > 0){
if (organize != null) {
if (organize.getChildList() != null && organize.getChildList().size() > 0) {
for (SysOrganize so : organize.getChildList()) {
result.add(so.getId());
result.addAll(findChildSysOrganize(so));
@ -243,16 +244,16 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public List<Long> findSysOrganizeChildIdList(Long id) {
SysOrganize organize = personnelService.getSysOrganizeById(id);
if(organize != null){
if (organize != null) {
List<SysOrganize> list = personnelService.findSysOrganizeList();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
SysOrganize treeSPosition = packTreeSysOrganizeById(list, organize.getId());
List<Long> idList = findChildSysOrganize(treeSPosition);
idList.add(organize.getId());
return idList;
}
}
return null;
return Collections.emptyList();
}
/********************************************* End SysOrganize Tree *********************************************/
@ -262,15 +263,15 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public List<CommonTreeModel> packTreeTreeModelByRefUserDepartment(List<SysOrganize> organizeList, List<SysDepartment> departmentList, List<SysRefUserDepartment> refList) {
if(refList != null && organizeList != null && departmentList != null){
if (refList != null && organizeList != null && departmentList != null) {
List<Long> organizeIdList = new ArrayList<>();
List<Long> departmentIdList = new ArrayList<>();
refList.forEach(ref -> {
if(!organizeIdList.contains(ref.getOrganizeId())){
if (!organizeIdList.contains(ref.getOrganizeId())) {
organizeIdList.add(ref.getOrganizeId());
}
if(!departmentIdList.contains(ref.getDepartmentId())){
if (!departmentIdList.contains(ref.getDepartmentId())) {
departmentIdList.add(ref.getDepartmentId());
}
});
@ -286,7 +287,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
return result;
}
return null;
return Collections.emptyList();
}
@Override
@ -324,7 +325,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<CommonTreeModel> packTreeTreeModelSysOrganize(List<SysOrganize> list) {
List<CommonTreeModel> result = new ArrayList<>();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
for (SysOrganize organize : list) {
CommonTreeModel model = new CommonTreeModel();
model.setBeanType(ModelEnumUtil.COMMON_TREE_TYPE.TYPE_ORGANIZE.getValue());
@ -342,7 +343,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<CommonTreeModel> packTreeTreeModelSysDepartment(List<SysDepartment> list) {
List<CommonTreeModel> result = new ArrayList<>();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
for (SysDepartment department : list) {
CommonTreeModel model = new CommonTreeModel();
model.setBeanType(ModelEnumUtil.COMMON_TREE_TYPE.TYPE_DEPARTMENT.getValue());
@ -358,12 +359,12 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public List<CommonTreeModel> packTreeTreeModel(List<CommonTreeModel> list, List<SysDepartment> departmentList) {
if(list != null && list.size() > 0 && departmentList != null && departmentList.size() > 0){
if (list != null && list.size() > 0 && departmentList != null && departmentList.size() > 0) {
list.forEach(model -> {
SysOrganize organize = (SysOrganize) model.getBean();
List<SysDepartment> departments = new ArrayList<>();
departmentList.forEach(department -> {
if(department.getParentId().equals(CommonEnumUtil.PARENT.DEFAULT.getValue()) && department.getOrganizeId().equals(organize.getId())){
if (department.getParentId().equals(CommonEnumUtil.PARENT.DEFAULT.getValue()) && department.getOrganizeId().equals(organize.getId())) {
departments.add(department);
}
});
@ -387,9 +388,9 @@ public class CoreMemTreeService implements ICoreMemTreeService {
refList.forEach(ref -> refFilterIds.add(ref.getDepartmentId()));
}
if(refIdList.size() <= 0){
if (refIdList.size() <= 0) {
refIdList = refFilterIds;
}else {
} else {
// List 取交集
refIdList = (ArrayList<Long>) CollectionUtils.intersection(refIdList, refFilterIds);
}
@ -429,10 +430,10 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysDepartment> packTreeSysDepartment(List<SysDepartment> list, Long parentId) {
List<SysDepartment> result = new ArrayList<>();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
List<SysDepartment> copyList = new ArrayList<>(list);
list.forEach(department -> {
if(department.getParentId() != null && department.getParentId().equals(parentId)){
if (department.getParentId() != null && department.getParentId().equals(parentId)) {
result.add(department);
copyList.remove(department);
department.setChildList(packTreeSysDepartment(copyList, department.getId()));
@ -447,7 +448,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysDepartment> packTreeSysDepartmentBySysRefUserOrganize(List<SysDepartment> list, List<SysRefUserDepartment> refList) {
List<Long> ids = new ArrayList<>(refList.size());
if(refList != null && refList.size() > 0){
if (refList != null && refList.size() > 0) {
refList.forEach(ref -> ids.add(ref.getDepartmentId()));
}
@ -458,7 +459,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysDepartment> packTreeSysDepartmentBySysRefUserInfoOrganize(List<SysDepartment> list, List<SysRefUserInfoDepartment> refList) {
List<Long> ids = new ArrayList<>(refList.size());
if(refList != null && refList.size() > 0){
if (refList != null && refList.size() > 0) {
refList.forEach(ref -> ids.add(ref.getDepartmentId()));
}
@ -469,15 +470,15 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysDepartment> packTreeSysDepartmentByIds(List<SysDepartment> list, List<Long> ids) {
List<SysDepartment> result = new ArrayList<>();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
list.forEach(department -> {
if(department.getChildList() == null || department.getChildList().size() <= 0){
if(ids.contains(department.getId())){
if (department.getChildList() == null || department.getChildList().size() <= 0) {
if (ids.contains(department.getId())) {
result.add(department);
}
}else{
} else {
List<SysDepartment> childList = packTreeSysDepartmentByIds(department.getChildList(), ids);
if(ids.contains(department.getId()) || childList != null && childList.size() > 0){
if (ids.contains(department.getId()) || childList != null && childList.size() > 0) {
department.setChildList(childList);
result.add(department);
}
@ -490,9 +491,9 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public SysDepartment packTreeSysDepartmentById(List<SysDepartment> list, Long id) {
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
for (SysDepartment department : list) {
if(department.getId().equals(id)){
if (department.getId().equals(id)) {
department.setChildList(packTreeSysDepartment(list, department.getId()));
return department;
}
@ -505,7 +506,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<Long> findChildSysDepartment(SysDepartment department) {
List<Long> result = new ArrayList<>();
if(department != null && department.getChildList() != null && department.getChildList().size() > 0){
if (department != null && department.getChildList() != null && department.getChildList().size() > 0) {
for (SysDepartment dep : department.getChildList()) {
result.add(dep.getId());
result.addAll(findChildSysDepartment(dep));
@ -518,16 +519,16 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public List<Long> findSysDepartmentChildIdList(Long id) {
SysDepartment department = personnelService.getSysDepartmentById(id);
if(department != null){
if (department != null) {
List<SysDepartment> list = personnelService.findSysDepartmentList();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
SysDepartment treeDep = packTreeSysDepartmentById(list, department.getId());
List<Long> idList = findChildSysDepartment(treeDep);
idList.add(department.getId());
return idList;
}
}
return null;
return Collections.emptyList();
}
/********************************************* End SysDepartment Tree *********************************************/
@ -537,10 +538,10 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysMenu> packTreeSysMenu(List<SysMenu> list, Long parentId) {
List<SysMenu> result = new ArrayList<>();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
List<SysMenu> copyList = new ArrayList<>(list);
list.forEach(menu -> {
if(menu.getParentId() != null && menu.getParentId().equals(parentId)){
if (menu.getParentId() != null && menu.getParentId().equals(parentId)) {
result.add(menu);
copyList.remove(menu);
menu.setChildList(packTreeSysMenu(copyList, menu.getId()));
@ -555,7 +556,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysMenu> packTreeSysMenuBySysRefRoleMenu(List<SysMenu> list, List<SysRefRoleMenu> refList) {
List<Long> ids = new ArrayList<>(refList.size());
if(refList != null && refList.size() > 0){
if (refList != null && refList.size() > 0) {
refList.forEach(ref -> ids.add(ref.getMenuId()));
}
@ -566,15 +567,15 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysMenu> packTreeSysMenuByIds(List<SysMenu> list, List<Long> ids) {
List<SysMenu> result = new ArrayList<>();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
list.forEach(menu -> {
if(menu.getChildList() == null || menu.getChildList().size() <= 0){
if(ids.contains(menu.getId())){
if (menu.getChildList() == null || menu.getChildList().size() <= 0) {
if (ids.contains(menu.getId())) {
result.add(menu);
}
}else{
} else {
List<SysMenu> childList = packTreeSysMenuByIds(menu.getChildList(), ids);
if(ids.contains(menu.getId()) || childList != null && childList.size() > 0){
if (ids.contains(menu.getId()) || childList != null && childList.size() > 0) {
menu.setChildList(childList);
result.add(menu);
}
@ -587,9 +588,9 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public SysMenu packTreeSysMenuById(List<SysMenu> list, Long id) {
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
for (SysMenu menu : list) {
if(menu.getId().equals(id)){
if (menu.getId().equals(id)) {
menu.setChildList(packTreeSysMenu(list, menu.getId()));
return menu;
}
@ -602,7 +603,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<Long> findChildSysMenu(SysMenu menu) {
List<Long> result = new ArrayList<>();
if(menu != null && menu.getChildList() != null && menu.getChildList().size() > 0){
if (menu != null && menu.getChildList() != null && menu.getChildList().size() > 0) {
for (SysMenu sp : menu.getChildList()) {
result.add(sp.getId());
result.addAll(findChildSysMenu(sp));
@ -621,28 +622,28 @@ public class CoreMemTreeService implements ICoreMemTreeService {
public List<SysMenu> packTreeSysMenuByUserIdAndParentId(Long userId, Long parentId) {
List<SysRefUserRole> roleList = personnelService.findSysRefUserRole(userId);
if(roleList != null && roleList.size() > 0){
if (roleList != null && roleList.size() > 0) {
List<SysRefRoleMenu> refRoleMenuList = personnelService.findSysRefRoleMenuByRefUserRole(roleList);
if(refRoleMenuList != null && refRoleMenuList.size() > 0){
List<SysMenu> menuList = menuService.findLanguageMenuByMenuAndInId(null,null);
if (refRoleMenuList != null && refRoleMenuList.size() > 0) {
List<SysMenu> menuList = menuService.findLanguageMenuByMenuAndInId(null, null);
List<SysMenu> menuRootTree = packTreeSysMenu(menuList, parentId);
return packTreeSysMenuBySysRefRoleMenu(menuRootTree, refRoleMenuList);
}
}
return null;
return Collections.emptyList();
}
@Override
public List<SysMenu> packTreeSysMenuByParentIdAndMenuType(List<SysMenu> list,Long parentId, Integer menuType) {
public List<SysMenu> packTreeSysMenuByParentIdAndMenuType(List<SysMenu> list, Long parentId, Integer menuType) {
List<SysMenu> result = new ArrayList<>();
if(list != null && list.size() > 0){
if (list != null && list.size() > 0) {
for (SysMenu menu : list) {
if(menu.getChildList() != null && menu.getChildList().size() > 0){
if (menu.getChildList() != null && menu.getChildList().size() > 0) {
result.addAll(packTreeSysMenuByParentIdAndMenuType(menu.getChildList(), parentId, menuType));
}
if(menu.getParentId().equals(parentId) && menu.getMenuType().equals(menuType)){
if (menu.getParentId().equals(parentId) && menu.getMenuType().equals(menuType)) {
result.add(menu);
}
}
@ -653,7 +654,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override
public List<SysMenu> packTreeSysMenu() {
List<SysMenu> menuList = menuService.findLanguageMenuByMenuAndInId(null,null);
List<SysMenu> menuList = menuService.findLanguageMenuByMenuAndInId(null, null);
return packTreeSysMenu(menuList, CommonEnumUtil.PARENT.DEFAULT.getValue());
}

@ -18,7 +18,7 @@ import cn.estsh.i3plus.pojo.platform.repository.SysMenuRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysOrganizeRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysPositionRepository;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.ApiOperation;
@ -610,37 +610,10 @@ public class CoreTreeService implements ICoreTreeService {
private List<SysDepartment> findSysDepartmentCacheByHqlWhere(String hql) {
return departmentRDao.findByHqlWhere(hql);
// if(!StringUtils.isBlank(hql)){
// String redisKey = CommonConstWords.REDIS_PREFIX_CACHE_DEPARTMENT+ "_findCacheByHqlWhere" + "_" + hql.hashCode();
// List list = redisCore.getList(redisKey, 0, -1);
// if(list == null){
// list = departmentRDao.findByHqlWhere(hql);
// if(list != null){
// redisCore.putList(redisKey,list,CommonConstWords.REDIS_TIME_DAY_ONE);
// }
// }
// return list;
// }else {
// return null;
// }
}
private List<SysOrganize> findSysOrganizeCacheByHqlWhere(String hql) {
return organizeRDao.findByHqlWhere(hql);
// if(!StringUtils.isBlank(hql)){
// String redisKey = CommonConstWords.REDIS_PREFIX_CACHE_ORGANIZE+ "_findCacheByHqlWhere" + "_" + hql.hashCode();
// List list = redisCore.getList(redisKey, 0, -1);
// if(list == null){
// list = organizeRDao.findByHqlWhere(hql);
// if(list != null){
// redisCore.putList(redisKey,list,CommonConstWords.REDIS_TIME_DAY_ONE);
// }
// }
// return list;
// }else {
// return null;
// }
}
}

@ -14,5 +14,5 @@ import org.springframework.stereotype.Service;
**/
@Service
public class DataMoreService implements IDataMoreService {
private Logger LOGGER = LoggerFactory.getLogger(this.getClass());
public static final Logger LOGGER = LoggerFactory.getLogger(DataMoreService.class);
}

@ -9,7 +9,7 @@ import cn.estsh.i3plus.pojo.platform.bean.SysBarcodeRule;
import cn.estsh.i3plus.pojo.platform.repository.SysBarcodeRuleRepository;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@ -13,7 +13,7 @@ import cn.estsh.i3plus.pojo.platform.bean.SysOrganize;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;

@ -195,7 +195,7 @@ public class SysDictionaryService implements ISysDictionaryService {
List<SysDictionary> list = findSysDictionaryBySoftTypeAndParentCode(CommonEnumUtil.SOFT_TYPE.CORE.getValue(),
BaseConstWords.DICTIONARY_FILE_TYPE);
if (list != null && list.size() > 0) {
if (list != null && !list.isEmpty()) {
String suffix = StringTool.getStringFileSuffix(fileName, true);
for (SysDictionary dictionary : list) {

@ -18,7 +18,7 @@ import cn.estsh.i3plus.pojo.platform.repository.SysLabelTemplateRepository;
import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;

@ -22,7 +22,6 @@ import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -232,8 +231,8 @@ public class SysLocaleResourceService implements ISysLocaleResourceService {
}
@Override
public List<MissResourceModel> listMissResourceModel() {
List<Object> listStr = redisRes.scan(CommonConstWords.REDIS_PREFIX_CACHE_NO_RES + "*");
public List<MissResourceModel> findMissResourceModelByTop(int num) {
List<Object> listStr = redisRes.scan(CommonConstWords.REDIS_PREFIX_CACHE_NO_RES + "*",num);
MissResourceModel missResourceModel = null;
List<MissResourceModel> missResourceModelList = new ArrayList<>(listStr.size());
@ -253,59 +252,12 @@ public class SysLocaleResourceService implements ISysLocaleResourceService {
}
@Override
public MissResourceModel saveMissResourceModel(MissResourceModel missResourceModel) {
redisRes.putObject(missResourceModel.getKey(), JSON.toJSONString(missResourceModel), -1);
return missResourceModel;
public void deleteInValidMissResourceByKeys(String[] keys) {
redisRes.deleteKey(keys);
}
@Override
public void updateMissResourceModelIsValidByKeys(String[] keys, Integer valid) {
List<Object> missResourceStrList = redisRes.findObject(Arrays.asList(keys));
MissResourceModel missResourceModel = null;
List<MissResourceModel> missResourceModelList = new ArrayList<>(missResourceStrList.size());
// 更新状态
for (Object missResourceStr : missResourceStrList) {
if (missResourceStr == null || StringUtils.isBlank(missResourceStr.toString())) {
continue;
}
missResourceModel = JsonUtilTool.decode(missResourceStr.toString(), MissResourceModel.class);
missResourceModel.setIsValid(valid);
missResourceModelList.add(missResourceModel);
}
// 存入redis
for (MissResourceModel resourceModel : missResourceModelList) {
redisRes.putObject(resourceModel.getKey(), JsonUtilTool.encode(resourceModel));
}
}
@Override
public void doCleanInValidMissResource() {
List<Object> listStr = redisRes.scan(CommonConstWords.REDIS_PREFIX_CACHE_NO_RES + "*");
MissResourceModel missResourceModel = null;
List<String> cleanKeys = new ArrayList<>(listStr.size());
// 更新状态
for (Object missResourceStr : listStr) {
if (missResourceStr ==null || StringUtils.isBlank(missResourceStr.toString())) {
continue;
}
missResourceModel = JsonUtilTool.decode(missResourceStr.toString(), MissResourceModel.class);
if (missResourceModel != null && missResourceModel.getIsValid() != null
&& CommonEnumUtil.IS_VAILD.INVAILD.getValue() == missResourceModel.getIsValid()) {
cleanKeys.add(missResourceModel.getKey());
}
}
redisRes.deleteKey(cleanKeys.toArray(new String[cleanKeys.size()]));
}
@Override
public void doConversionMissResourceByKeys(String[] keys) {
List<Object> missResourceStrList = redisRes.findObject(Arrays.asList(keys));
MissResourceModel missResourceModel = null;
List<MissResourceModel> missResourceModelList = new ArrayList<>(missResourceStrList.size());
public void doConversionMissResourceByKeys(List<MissResourceModel> missResourceModelList) {
Map<String, String> langCodeMap = sysLocaleLanguageRDao.list()
.stream()
.collect(
@ -315,15 +267,6 @@ public class SysLocaleResourceService implements ISysLocaleResourceService {
)
);
// 类型转换
for (Object missResourceStr : missResourceStrList) {
if (missResourceStr == null || StringUtils.isBlank(missResourceStr.toString())) {
continue;
}
missResourceModel = JsonUtilTool.decode(missResourceStr.toString(), MissResourceModel.class);
missResourceModelList.add(missResourceModel);
}
SysLocaleResource sysLocaleResource;
for (MissResourceModel resourceModel : missResourceModelList) {
sysLocaleResource = new SysLocaleResource();

@ -1,6 +1,5 @@
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.core.api.iservice.busi.IPersonnelService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysLocaleResourceService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysMenuService;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
@ -11,11 +10,11 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
import cn.estsh.i3plus.pojo.platform.repository.SysRefRoleMenuRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysMenuRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysRefRoleMenuRepository;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -24,7 +23,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
/**
@ -232,4 +230,11 @@ public class SysMenuService implements ISysMenuService {
pager = PagerHelper.getPager(pager, sysMenuRDao.findByHqlWhereCount(packBean));
return new ListPager(sysMenuRDao.findByHqlWherePage(packBean, pager), pager);
}
@Override
public SysMenu getSysMenuByCode(String code) {
return sysMenuRDao.getByProperty(
new String[]{"menuCode", "isDeleted", "isValid"},
new Object[]{code, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue()});
}
}

@ -17,7 +17,7 @@ import cn.estsh.i3plus.pojo.platform.bean.SysRefUserMessage;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;

@ -13,7 +13,7 @@ import cn.estsh.i3plus.pojo.platform.bean.SysOrderNoRule;
import cn.estsh.i3plus.pojo.platform.repository.SysOrderNoRuleRepository;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@ -15,7 +15,7 @@ import cn.estsh.i3plus.pojo.platform.repository.SysUserInfoRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysUserRepository;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;

@ -18,7 +18,7 @@ import cn.estsh.i3plus.pojo.platform.repository.SysRoleRepository;
import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;

@ -12,7 +12,7 @@ import cn.estsh.i3plus.pojo.platform.repository.SysTaskCycleRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysTaskPlanRepository;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@ -15,7 +15,7 @@ import cn.estsh.i3plus.pojo.platform.repository.SysRefTaskCyclePlanRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysTaskPlanRepository;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;

@ -1,6 +1,7 @@
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.core.api.iservice.busi.ISysTaskService;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
@ -12,7 +13,6 @@ import cn.estsh.i3plus.pojo.platform.repository.SysTaskPlanRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysTaskRepository;
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 io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@ -11,7 +11,7 @@ import cn.estsh.i3plus.pojo.platform.repository.SysToolRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysToolTypeRepository;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@ -15,7 +15,7 @@ import cn.estsh.i3plus.pojo.platform.bean.*;
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.i3plus.platform.common.exception.ImppExceptionEnum;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;

@ -26,7 +26,7 @@ import cn.estsh.i3plus.pojo.platform.repository.*;
import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import cn.estsh.impp.framework.boot.util.RedisCacheTool;
import io.swagger.annotations.ApiOperation;

@ -24,25 +24,25 @@ public class CoreDemoThread extends BaseThread {
private String param;
public CoreDemoThread(String param){
public CoreDemoThread(String param) {
this.param = param;
IPersonnelService personnelService = ( IPersonnelService ) SpringContextsUtil.getBean(IPersonnelService.class);
LOGGER.info("spring容器获取服务{}" + personnelService);
IPersonnelService personnelService = (IPersonnelService) SpringContextsUtil.getBean(IPersonnelService.class);
LOGGER.info("spring容器获取服务{}", personnelService);
WebApplicationContext webAppContext = WebApplicationContextUtils.getWebApplicationContext(ServletContextUtil.getServletContext());
ISysMessageService sysMessageService = webAppContext.getBean(ISysMessageService.class);
LOGGER.info("servlet容器获取服务{}" + sysMessageService);
LOGGER.info("servlet容器获取服务{}", sysMessageService);
}
@Override
public boolean doRun() {
//处理业务逻辑
System.out.println("线程执行:获取参数" + param);
LOGGER.info("线程执行:获取参数" + param);
return true;
}
//使用方式
public static void main(String[] args){
public static void main(String[] args) {
ImppThreadPool.getThreadExcutorService().execute(new CoreDemoThread("thread param"));
}
}

@ -1,9 +1,10 @@
package cn.estsh.i3plus.core.apiservice.util;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SysBarcodeRule;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import java.util.HashMap;
import java.util.Map;

@ -4,7 +4,7 @@ import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SysOrderNoRule;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.StringUtils;
import java.text.MessageFormat;

@ -24,11 +24,11 @@ public class ArraySort implements Runnable {
@Override
public void run() {
try {
Thread.sleep(Integer.parseInt(num));
// try {
// Thread.sleep(Integer.parseInt(num));
System.out.println(num);
} catch (InterruptedException e) {
e.printStackTrace();
}
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
}
}

Loading…
Cancel
Save