bug解决

添加默认字典项
ics添加全局异常捕获
yun-zuoyi
yunhao.wang 6 years ago
parent 13118c8ef5
commit 4dc6158baf

@ -96,4 +96,11 @@ public interface ISysDictionaryService {
*/
@ApiOperation(value = "根据父节点 以及当前节点CODE 获取字典信息")
SysDictionary getSysDictionaryByParentCodeAndCode(String parentCode,String code);
/**
*
* @param id
*/
@ApiOperation(value = "设置默认字典项",notes = "根据id设置默认字典项")
void updateSysDictionaryDefaultById(Long id);
}

@ -81,7 +81,7 @@ public class SysDashboardController extends CoreBaseController {
try {
// 保持时间,key统一
Date nowDate = new Date();
String redisKey = PlatformConstWords.REDIS_DASHBOARD_AVG_RESP_TIME + "_" + nowDate.getTime();
String redisKey = PlatformConstWords.REDIS_DASHBOARD_LOG_INFO + "_" + nowDate.getTime();
Map<Object, Object> dashboardData = redisCore.getHashMap(redisKey);
if (dashboardData == null || dashboardData.size() == 0) {
@ -116,7 +116,7 @@ public class SysDashboardController extends CoreBaseController {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dashboardData = sysDashboardService.querySysLogSystemAvgExecuteTime(
sdf.format(TimeTool.timeCalc(nowDate, Calendar.MINUTE, -5)),sdf.format(nowDate));
sdf.format(TimeTool.timeCalc(nowDate, Calendar.MINUTE, -3)),sdf.format(nowDate));
redisCore.putHashMap(redisKey, dashboardData, 180);
}
@ -155,6 +155,7 @@ public class SysDashboardController extends CoreBaseController {
}
@GetMapping(value = "/get-server-pressure")
@ApiOperation(value = "获取服务压力情况", notes = "获取服务压力情况")
public ResultBean getServerPressure() {
try {
// 保持时间,key统一

@ -56,7 +56,7 @@ public class SysDictionaryController extends CoreBaseController{
.notNull("dictionaryValue",sysDictionary.getDictionaryValue());
//新增初始化
ConvertBean.modelInitialize(sysDictionary,user);
sysDictionary.setIsDefault(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
sysDictionaryService.insertSysDictionary(sysDictionary);
return ResultBean.success("添加成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
@ -231,4 +231,20 @@ public class SysDictionaryController extends CoreBaseController{
return ResultBean.fail().setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}
}
@PutMapping("/default/{id}")
@ApiOperation(value = "设置默认字典值",notes = "根据id设置默认字典值")
public ResultBean updateSysDictionaryDefaultById(@PathVariable("id") String idStr){
try {
//条件验证
ValidatorBean.checkNotNull(idStr,"id不能为空");
sysDictionaryService.updateSysDictionaryDefaultById(Long.parseLong(idStr));
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
return ResultBean.fail(busExcep);
}catch(Exception e){
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
}

@ -275,8 +275,9 @@ public class SysFileController extends CoreBaseController{
}
}
}
// 增加文件下载次数
sysFile.setDownloadNum(sysFile.getDownloadNum() + 1);
sysFileService.updateSysFile(sysFile);
return ResultBean.success("下载").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
LOGGER.error(busExcep.getErrorMsg() + "{}",busExcep.getErrorDetail(),busExcep);

@ -59,7 +59,7 @@ public class SysMessageController extends CoreBaseController {
.notNull("messageReceiversId",sysMessage.getMessageReceiversId());
// 设置发件人名称
sysMessage.setMessageSenderId(getSessionUser().getUserId());
sysMessage.setMessageSenderId(getSessionUser().getUser().getId());
sysMessage.setMessageSenderNameRdd(getSessionUser().getUserName());
sysMessage.setMessageSendTime(sdf.format(new Date()));
sysMessage.setMessageContentType(ImppEnumUtil.MESSAGE_TYPE_CONTENT.HTML.getValue());
@ -182,7 +182,7 @@ public class SysMessageController extends CoreBaseController {
try {
// 设置消息类型为站内信
sysRefUserMessage.setMessageTypeRdd(ImppEnumUtil.MESSAGE_TYPE.LETTER.getValue());
sysRefUserMessage.setReceiverId(getSessionUser().getUserId());
sysRefUserMessage.setReceiverId(getSessionUser().getUser().getId());
ListPager userMessageList = sysMessageService.querySysRefUserMessageByPager(sysRefUserMessage,pager);
return ResultBean.success("查询成功").setListPager(userMessageList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
@ -198,6 +198,7 @@ public class SysMessageController extends CoreBaseController {
public ResultBean querySysRefUserMessageByPager(SysMessage sysMessage,Pager pager){
try {
// 发件人为当前用户
sysMessage.setMessageType(ImppEnumUtil.MESSAGE_TYPE.LETTER.getValue());
sysMessage.setMessageSenderId(getSessionUser().getUser().getId());
ListPager sysMessageListPager = sysMessageService.querySysMessageByPager(sysMessage,pager);
@ -213,7 +214,7 @@ public class SysMessageController extends CoreBaseController {
@ApiOperation(value = "查看用户未读站内信")
public ResultBean findUnreadUserMessage(){
try {
List userMessageList = sysMessageService.findSysRefUserMessageByUserIdAndStatus(getSessionUser().getUserInfo().getId(),
List userMessageList = sysMessageService.findSysRefUserMessageByUserIdAndStatus(getSessionUser().getUser().getId(),
ImppEnumUtil.MESSAGE_STATUS.UNREAD.getValue());
return ResultBean.success("查询成功").setResultList(userMessageList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
@ -304,7 +305,7 @@ public class SysMessageController extends CoreBaseController {
// 设置发件人名称
sysMessage.setMessageType(ImppEnumUtil.MESSAGE_TYPE.LETTER.getValue());
sysMessage.setMessageSenderId(getSessionUser().getUserId());
sysMessage.setMessageSenderId(getSessionUser().getUser().getId());
sysMessage.setMessageSenderNameRdd(getSessionUser().getUserName());
sysMessage.setMessageSendTime(sdf.format(new Date()));
sysMessage.setMessageContentType(ImppEnumUtil.MESSAGE_TYPE_CONTENT.HTML.getValue());

@ -14,10 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @Description :
@ -59,7 +56,7 @@ public class SysLogSystemDaoImpl implements ISysLogSystemDao {
.aggregate(aggregateList);
MongoCursor<Document> cursor = findIter.iterator();
Map resultData = new HashMap();
Map resultData = new LinkedHashMap();
Document item_doc;
while (cursor.hasNext()) {
item_doc = cursor.next();
@ -90,7 +87,7 @@ public class SysLogSystemDaoImpl implements ISysLogSystemDao {
.aggregate(aggregateList);
MongoCursor<Document> cursor = findIter.iterator();
Map resultData = new HashMap();
Map resultData = new LinkedHashMap();
Document item_doc;
while (cursor.hasNext()) {
item_doc = cursor.next();

@ -69,7 +69,7 @@ public class MessageLetterQueueReceiver {
refUserMessage.setMessageTitleRdd(msg.getMessageTitle());
refUserMessage.setMessageTypeRdd(msg.getMessageType());
refUserMessage.setMessageSenderNameRdd(msg.getMessageSenderNameRdd());
refUserMessage.setReceiverId(sysUser.getUserInfoId());
refUserMessage.setReceiverId(sysUser.getId());
refUserMessage.setReceiverNameRdd(sysUser.getUserName());
refUserMessage.setMessageStatus(ImppEnumUtil.MESSAGE_STATUS.UNREAD.getValue());
refUserMessage.setReceiverTime(TimeTool.getNowTime(true));

@ -59,7 +59,8 @@ public class MessageMailQueueReceiver {
mailUtil.setContentType(ImppEnumUtil.MESSAGE_TYPE_CONTENT.valueOfDescription(msg.getMessageContentType()));
mailUtil.setBody(msg.getMessageContent());
mailUtil.setTo(sysConfigService.getSysConfigByCode(PlatformConstWords.CONTACT_MAIL).getConfigValue());
mailUtil.send();
//信息已处理
// mailUtil.send();
}else {
// 收件人信息

@ -40,13 +40,14 @@ public class SysDictionaryService implements ISysDictionaryService {
@ApiOperation(value = "添加字典")
public void insertSysDictionary(SysDictionary sysDictionary) {
long repeatCodeCount = sysDictionaryRDao.findByPropertyCount("dictionaryCode",sysDictionary.getDictionaryCode());
long repeatValueCount = sysDictionaryRDao.findByPropertyCount("dictionaryValue",sysDictionary.getDictionaryValue());
long repeatValueCount = sysDictionaryRDao.findByPropertyCount(new String[]{"parentId","dictionaryValue"},
new Object[]{sysDictionary.getParentId(),sysDictionary.getDictionaryValue()});
if (repeatCodeCount > 0 || repeatValueCount > 0){
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.IO_EXCEPTION.getCode())
.setErrorDetail("字典代码已存在")
.setErrorSolution("请重新输入字典代码")
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())
.setErrorDetail("字典代码或字典值已存在")
.setErrorSolution("请重新输入字典代码或字典值")
.build();
}
@ -176,4 +177,15 @@ public class SysDictionaryService implements ISysDictionaryService {
}
return null;
}
@Override
@ApiOperation(value = "设置默认字典项",notes = "根据id设置默认字典项")
public void updateSysDictionaryDefaultById(Long id) {
SysDictionary sysDictionary = sysDictionaryRDao.getById(id);
sysDictionaryRDao.updateByProperties("parentId",sysDictionary.getParentId(),
"isDefault",CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
sysDictionaryRDao.updateByProperties("id",id,
"isDefault",CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
}
}

@ -66,7 +66,9 @@ public class SysToolTypeService implements ISysToolTypeService {
public void updateSysToolType(SysToolType toolType) {
LOGGER.info("硬件类型 TOOL_TYPE toolType:{}",toolType);
toolTypeRDao.update(toolType);
// TODO 修改硬件对象中冗余的硬件类型名称
// 修改硬件中的类型名称冗余
toolRDao.updateByProperties("toolTypeId",toolType.getId(),"toolTypeNameRdd",toolType.getName());
}
@Override

@ -157,7 +157,7 @@ public class SysUserService implements ISysUserService {
}else {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.LOGIN_EXCEPTION_USER_LOCKING.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("旧密码错误")
.setErrorSolution("请重新输入")
.build();

Loading…
Cancel
Save