Sonar代码缺陷修复

查询条件优化
拦截器,自定义按钮对外接口实现
表单-功能目录优化
软适配日志优化
yun-zuoyi
汪云昊 5 years ago
parent 483d88812f
commit acae46c408

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

@ -40,7 +40,7 @@ public class AppStartSystemInit implements CommandLineRunner {
private static Environment environment; private static Environment environment;
@Value("${spring.profiles.active}") @Value("${spring.profiles.active}")
public String SPRING_PROFILES_ACTIVE; public String springProfilesActive;
// 限制组织数量 // 限制组织数量
public static int organizeCount = 5; public static int organizeCount = 5;
// 限制账号数量 // 限制账号数量
@ -66,9 +66,6 @@ public class AppStartSystemInit implements CommandLineRunner {
@Override @Override
public void run(String... args) throws Exception { public void run(String... args) throws Exception {
try { try {
LOGGER.info("【IMPP-Core开始绑定资源信息...】");
packIMPPResources();
LOGGER.info("【IMPP-Core开始加载基础信息...】"); LOGGER.info("【IMPP-Core开始加载基础信息...】");
systemInitService.putAndLoadAll(); systemInitService.putAndLoadAll();
@ -124,168 +121,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()) { while (headerNames.hasMoreElements()) {
String key = (String) headerNames.nextElement(); String key = (String) headerNames.nextElement();
String value = request.getHeader(key); String value = request.getHeader(key);
System.out.println("k : " + key + " , v : " + value); LOGGER.info("k : {} , v : {}", key, value);
} }
return new ResultBean(true, "", sUser); return new ResultBean(true, "", sUser);

@ -9,7 +9,6 @@ import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser; import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleLanguage; import cn.estsh.i3plus.pojo.platform.bean.SysLocaleLanguage;
import cn.estsh.i3plus.pojo.platform.bean.SysMenu; 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.base.controller.CoreBaseController;
import cn.estsh.impp.framework.boot.auth.AuthUtil; import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.exception.ImppBusiException;
@ -23,7 +22,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;

@ -5,16 +5,12 @@ import cn.estsh.i3plus.core.api.iservice.busi.ICoreMemTreeService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysMenuService; import cn.estsh.i3plus.core.api.iservice.busi.ISysMenuService;
import cn.estsh.i3plus.core.apiservice.serviceimpl.base.SysLogElasticSearchService; import cn.estsh.i3plus.core.apiservice.serviceimpl.base.SysLogElasticSearchService;
import cn.estsh.i3plus.core.apiservice.serviceimpl.base.SysLogMongoService; import cn.estsh.i3plus.core.apiservice.serviceimpl.base.SysLogMongoService;
import cn.estsh.i3plus.platform.common.tool.SerializeTool;
import cn.estsh.i3plus.platform.common.tool.TimeTool; import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.platform.common.util.CommonConstWords; import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
import cn.estsh.i3plus.platform.plugin.elasticsearch.ElasticSearchTool; import cn.estsh.i3plus.platform.plugin.elasticsearch.ElasticSearchTool;
import cn.estsh.i3plus.platform.plugin.license.ImppLicense; import cn.estsh.i3plus.platform.plugin.license.ImppLicense;
import cn.estsh.i3plus.platform.plugin.license.ImppLicenseTool; import cn.estsh.i3plus.platform.plugin.license.ImppLicenseTool;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogException; import cn.estsh.i3plus.pojo.platform.platbean.SysLogException;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogOperate; import cn.estsh.i3plus.pojo.platform.platbean.SysLogOperate;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogSystem; import cn.estsh.i3plus.pojo.platform.platbean.SysLogSystem;
@ -25,7 +21,6 @@ import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.util.ImppRedis; import cn.estsh.impp.framework.boot.util.ImppRedis;
import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean; import cn.estsh.impp.framework.boot.util.ValidatorBean;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -37,7 +32,6 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Description : * @Description :

@ -520,12 +520,12 @@ public class WhiteController extends CoreBaseController {
} }
@PostMapping(value = "/miss-resource/get") @PostMapping(value = "/miss-resource/get")
@ApiOperation(value = "根据条件分页查询账号信息", notes = "根据条件分页查询账号信息") @ApiOperation(value = "缺失资源", notes = "缺失资源")
public ResultBean getMissResourceByKey(String key,String soft){ public ResultBean getMissResourceByKey(String key,String soft){
try { try {
LocaleUtils.saveMissResource(key, AuthUtil.getSessionLanguage().toString(), CommonEnumUtil.SOFT_TYPE.descOf(soft), LocaleUtils.saveMissResource(key, AuthUtil.getSessionLanguage().toString(), CommonEnumUtil.SOFT_TYPE.descOf(soft),
CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.MISSING.getValue(), CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.MISSING.getValue(),
CommonEnumUtil.MiSS_RESOURCE_SOURCE.SERVER.getValue()); CommonEnumUtil.MiSS_RESOURCE_SOURCE.WEB.getValue());
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) { } catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep); return ResultBean.fail(busExcep);

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

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

@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -51,11 +52,11 @@ public class CoreMemTreeService implements ICoreMemTreeService {
@Override @Override
public List<SysPosition> packTreeSysPositionBySysRefUserPosition(List<SysPosition> list, List<SysRefUserPosition> refList) { public List<SysPosition> packTreeSysPositionBySysRefUserPosition(List<SysPosition> list, List<SysRefUserPosition> refList) {
if (refList == null || refList.isEmpty()) {
return Collections.emptyList();
}
List<Long> ids = new ArrayList<>(refList.size()); List<Long> ids = new ArrayList<>(refList.size());
if(refList != null && refList.size() > 0){
refList.forEach(ref -> ids.add(ref.getPositionId())); refList.forEach(ref -> ids.add(ref.getPositionId()));
}
return packTreeSysPositionByIds(list, ids); return packTreeSysPositionByIds(list, ids);
} }
@ -123,7 +124,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
return idList; return idList;
} }
} }
return null; return Collections.emptyList();
} }
/********************************************* Start SysOrganize Tree *********************************************/ /********************************************* Start SysOrganize Tree *********************************************/
@ -252,7 +253,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
return idList; return idList;
} }
} }
return null; return Collections.emptyList();
} }
/********************************************* End SysOrganize Tree *********************************************/ /********************************************* End SysOrganize Tree *********************************************/
@ -286,7 +287,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
return result; return result;
} }
return null; return Collections.emptyList();
} }
@Override @Override
@ -527,7 +528,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
return idList; return idList;
} }
} }
return null; return Collections.emptyList();
} }
/********************************************* End SysDepartment Tree *********************************************/ /********************************************* End SysDepartment Tree *********************************************/
@ -630,7 +631,7 @@ public class CoreMemTreeService implements ICoreMemTreeService {
return packTreeSysMenuBySysRefRoleMenu(menuRootTree, refRoleMenuList); return packTreeSysMenuBySysRefRoleMenu(menuRootTree, refRoleMenuList);
} }
} }
return null; return Collections.emptyList();
} }
@Override @Override

@ -610,37 +610,10 @@ public class CoreTreeService implements ICoreTreeService {
private List<SysDepartment> findSysDepartmentCacheByHqlWhere(String hql) { private List<SysDepartment> findSysDepartmentCacheByHqlWhere(String hql) {
return departmentRDao.findByHqlWhere(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) { private List<SysOrganize> findSysOrganizeCacheByHqlWhere(String hql) {
return organizeRDao.findByHqlWhere(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 @Service
public class DataMoreService implements IDataMoreService { public class DataMoreService implements IDataMoreService {
private Logger LOGGER = LoggerFactory.getLogger(this.getClass()); public static final Logger LOGGER = LoggerFactory.getLogger(DataMoreService.class);
} }

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

@ -27,17 +27,17 @@ public class CoreDemoThread extends BaseThread {
public CoreDemoThread(String param) { public CoreDemoThread(String param) {
this.param = param; this.param = param;
IPersonnelService personnelService = (IPersonnelService) SpringContextsUtil.getBean(IPersonnelService.class); IPersonnelService personnelService = (IPersonnelService) SpringContextsUtil.getBean(IPersonnelService.class);
LOGGER.info("spring容器获取服务{}" + personnelService); LOGGER.info("spring容器获取服务{}", personnelService);
WebApplicationContext webAppContext = WebApplicationContextUtils.getWebApplicationContext(ServletContextUtil.getServletContext()); WebApplicationContext webAppContext = WebApplicationContextUtils.getWebApplicationContext(ServletContextUtil.getServletContext());
ISysMessageService sysMessageService = webAppContext.getBean(ISysMessageService.class); ISysMessageService sysMessageService = webAppContext.getBean(ISysMessageService.class);
LOGGER.info("servlet容器获取服务{}" + sysMessageService); LOGGER.info("servlet容器获取服务{}", sysMessageService);
} }
@Override @Override
public boolean doRun() { public boolean doRun() {
//处理业务逻辑 //处理业务逻辑
System.out.println("线程执行:获取参数" + param); LOGGER.info("线程执行:获取参数" + param);
return true; return true;
} }

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

Loading…
Cancel
Save