|
@@ -7,15 +7,11 @@ import cn.cslg.pas.common.model.request.*;
|
|
|
|
|
|
import cn.cslg.pas.common.utils.CacheUtils;
|
|
|
import cn.cslg.pas.common.utils.LoginUtils;
|
|
|
-import cn.cslg.pas.common.utils.parseQueryToTree.expressManager;
|
|
|
-import cn.cslg.pas.common.utils.parseQueryToTree.operateNode;
|
|
|
-import cn.cslg.pas.common.utils.parseQueryToTree.treeNode;
|
|
|
import cn.cslg.pas.common.vo.business.EventCountVO;
|
|
|
import cn.cslg.pas.common.vo.business.EventVO;
|
|
|
import cn.cslg.pas.domain.business.AssoEventFile;
|
|
|
import cn.cslg.pas.domain.business.Event;
|
|
|
import cn.cslg.pas.domain.business.SystemDict;
|
|
|
-import cn.cslg.pas.exception.ConditionException;
|
|
|
import cn.cslg.pas.exception.UnLoginException;
|
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
|
import cn.cslg.pas.factorys.businessFactory.Business;
|
|
@@ -41,6 +37,7 @@ import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -83,6 +80,7 @@ public class EventService extends ServiceImpl<EventMapper, Event> implements Bus
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Object queryMessage(QueryRequest queryRequest) throws Exception {
|
|
|
+
|
|
|
List<String> sqls = formatQueryService.reSqls(queryRequest);
|
|
|
//根据sql查询事件信息
|
|
|
List<EventVO> eventVOS = eventMapper.getEvent(sqls.get(0),sqls.get(1),sqls.get(2));
|
|
@@ -103,9 +101,9 @@ public class EventService extends ServiceImpl<EventMapper, Event> implements Bus
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Integer addMessage(Object object, List<MultipartFile> files) {
|
|
|
- EventUpdateDTO eventUpdateDTO = (EventUpdateDTO) object;
|
|
|
+ EventDTO eventDTO = (EventDTO) object;
|
|
|
//检查事件格式
|
|
|
- if (eventUpdateDTO.getScenarioId() == null) {
|
|
|
+ if (eventDTO.getScenarioId() == null) {
|
|
|
throw new XiaoShiException("参数错误");
|
|
|
}
|
|
|
|
|
@@ -118,8 +116,8 @@ public class EventService extends ServiceImpl<EventMapper, Event> implements Bus
|
|
|
}
|
|
|
|
|
|
//根据名称查询是否重复
|
|
|
- eventUpdateDTO.setName(eventUpdateDTO.getName().trim());
|
|
|
- String name = eventUpdateDTO.getName();
|
|
|
+ eventDTO.setName(eventDTO.getName().trim());
|
|
|
+ String name = eventDTO.getName();
|
|
|
LambdaQueryWrapper<Event> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(Event::getName, name);
|
|
|
List<Event> events = this.list(queryWrapper);
|
|
@@ -129,7 +127,7 @@ public class EventService extends ServiceImpl<EventMapper, Event> implements Bus
|
|
|
|
|
|
//事件入库
|
|
|
Event event = new Event();
|
|
|
- BeanUtils.copyProperties(eventUpdateDTO, event);
|
|
|
+ BeanUtils.copyProperties(eventDTO, event);
|
|
|
event.setCreateId(personnelVO.getId());
|
|
|
event.setTenantId(personnelVO.getTenantId());
|
|
|
event.insert();
|
|
@@ -259,7 +257,7 @@ public class EventService extends ServiceImpl<EventMapper, Event> implements Bus
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public GroupVO getGroup(GroupRequest groupRequest,String tableName) throws Exception {
|
|
|
+ public Object getGroup(GroupRequest groupRequest,String tableName) throws Exception {
|
|
|
StringRequest stringRequest =new StringRequest();
|
|
|
BeanUtils.copyProperties(groupRequest,stringRequest);
|
|
|
List<String> sqls = formatQueryService.reSqls(stringRequest);
|
|
@@ -276,13 +274,18 @@ public class EventService extends ServiceImpl<EventMapper, Event> implements Bus
|
|
|
|
|
|
//返回分组数据
|
|
|
QueryGroupImp queryGroupImp = queryGroupFactory.getClass(groupConfig.getGroupClass());
|
|
|
- List<String> strs = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField());
|
|
|
+ ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField());
|
|
|
|
|
|
//装载数据
|
|
|
GroupVO groupVO = new GroupVO();
|
|
|
groupVO.setField(groupRequest.getGroupBy());
|
|
|
- groupVO.setValues(strs);
|
|
|
- return groupVO;
|
|
|
+ groupVO.setValues(reGroupDataVO.getValues());
|
|
|
+ Records records = new Records();
|
|
|
+ records.setCurrent(groupRequest.getCurrent());
|
|
|
+ records.setSize(groupRequest.getSize());
|
|
|
+ records.setData(groupVO);
|
|
|
+ records.setTotal(reGroupDataVO.getTotal());
|
|
|
+ return records;
|
|
|
}
|
|
|
|
|
|
/**
|