Commit 17e203b7 authored by tangwei's avatar tangwei

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents bf7bb563 b29d42a0
...@@ -14,6 +14,7 @@ public class Menu { ...@@ -14,6 +14,7 @@ public class Menu {
public Long id; public Long id;
public String name; public String name;
public Long parentId; public Long parentId;
public Boolean isRoot;
public List<Menu> children; public List<Menu> children;
public Menu(Long id, String name, Long parentId2) { public Menu(Long id, String name, Long parentId2) {
super(); super();
...@@ -30,6 +31,14 @@ public class Menu { ...@@ -30,6 +31,14 @@ public class Menu {
this.children = children; this.children = children;
} }
public Menu(Long id, String name, Long parentId, Boolean isRoot, List<Menu> children) {
this.id = id;
this.name = name;
this.parentId = parentId;
this.isRoot = isRoot;
this.children = children;
}
public Long getId() { public Long getId() {
return id; return id;
} }
...@@ -57,4 +66,11 @@ public class Menu { ...@@ -57,4 +66,11 @@ public class Menu {
this.children = children; this.children = children;
} }
public Boolean getRoot() {
return isRoot;
}
public void setRoot(Boolean root) {
isRoot = root;
}
} }
\ No newline at end of file
...@@ -10,6 +10,9 @@ import org.apache.ibatis.reflection.MetaObject; ...@@ -10,6 +10,9 @@ import org.apache.ibatis.reflection.MetaObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date; import java.util.Date;
...@@ -18,16 +21,16 @@ import java.util.Date; ...@@ -18,16 +21,16 @@ import java.util.Date;
@Component @Component
public class MetaHandler implements MetaObjectHandler { public class MetaHandler implements MetaObjectHandler {
@Autowired
protected HttpServletRequest request;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
protected String getToken() { protected String getToken() {
String authToken = request.getHeader("token");
if (authToken == null) { String authToken = RequestContext.getToken();
authToken = request.getHeader("X-Access-Token"); // if (authToken == null) {
} // authToken = request.getHeader("X-Access-Token");
// }
return authToken; return authToken;
} }
protected String buildKey(String token) { protected String buildKey(String token) {
......
...@@ -191,7 +191,7 @@ public class FireExpertsController extends BaseController { ...@@ -191,7 +191,7 @@ public class FireExpertsController extends BaseController {
Collection<DataDictionary> list = dataDictionaryService.list(queryWrapper); Collection<DataDictionary> list = dataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName" List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
, "getParent"); , "getParent");
Menu menu = new Menu(-1L, "专家领域", -1L, menus); Menu menu = new Menu(-1L, "专家领域", -1L, true, menus);
List<Menu> menuList = new ArrayList<>(); List<Menu> menuList = new ArrayList<>();
menuList.add(menu); menuList.add(menu);
// 创建挂在主节点 // 创建挂在主节点
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
...@@ -28,6 +27,8 @@ import org.apache.commons.lang3.ObjectUtils; ...@@ -28,6 +27,8 @@ import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.typroject.tyboot.core.foundation.utils.StringUtil; import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -120,6 +121,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -120,6 +121,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
formValue.setFieldValue(alertSubmittedId.toString()); formValue.setFieldValue(alertSubmittedId.toString());
alertFormValue.add(formValue); alertFormValue.add(formValue);
alertCalledVo.setAlertFormValue(alertFormValue); alertCalledVo.setAlertFormValue(alertFormValue);
ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(sra, true);
// TODO 调用规则 // TODO 调用规则
ruleAlertCalledService.fireAlertCalledRule(alertCalledVo); ruleAlertCalledService.fireAlertCalledRule(alertCalledVo);
return true; return true;
...@@ -130,7 +134,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -130,7 +134,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
*/ */
public void ruleCallbackAction(String smsCode, String sendIds, Object object) throws Exception { public void ruleCallbackAction(String smsCode, String sendIds, Object object) throws Exception {
// 获取报送对象列表 // 获取报送对象列表
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();; List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
Set<String> mobiles = new HashSet<>(); Set<String> mobiles = new HashSet<>();
HashMap<String, String> smsParams = new HashMap<>(); HashMap<String, String> smsParams = new HashMap<>();
// 根据id列表查询所有人员信息 // 根据id列表查询所有人员信息
...@@ -138,6 +143,30 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -138,6 +143,30 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if (object instanceof AlertCalledRo) { if (object instanceof AlertCalledRo) {
AlertCalledRo calledRo = (AlertCalledRo) object; AlertCalledRo calledRo = (AlertCalledRo) object;
String alertSubmittedId = calledRo.getAlertSubmittedId(); String alertSubmittedId = calledRo.getAlertSubmittedId();
if (alertSubmittedId == null) {
// 1.保存警情记录主表
AlertSubmitted alertSubmitted = new AlertSubmitted();
alertSubmitted.setAlertCalledId(Long.valueOf(calledRo.getSequenceNbr()));
alertSubmitted.setBusinessTypeCode(calledRo.getAlertTypeCode());
Optional<AlertBusinessTypeEnum> businessTypeEnum = EnumsUtils.getEnumObject(AlertBusinessTypeEnum.class,
e -> e.getCode().equals(calledRo.getAlertTypeCode()));
alertSubmitted.setBusinessType(businessTypeEnum.get().getName());
Optional<SubmissionMethodEnum> submissionMethodEnum = Optional.of(SubmissionMethodEnum.SMS);
alertSubmitted.setSubmissionMethodCode(submissionMethodEnum.get().getCode());
alertSubmitted.setSubmissionMethod(submissionMethodEnum.get().getName());
Optional<AlertSchedulingTypeEnum> alertSchedulingTypeEnum = Optional.of(AlertSchedulingTypeEnum.融合调度);
alertSubmitted.setSchedulingTypeCode(alertSchedulingTypeEnum.get().getCode());
alertSubmitted.setSchedulingType(alertSchedulingTypeEnum.get().getName());
alertSubmitted.setSubmissionContent(JSONObject.toJSONString(objectToMap(calledRo)));
alertSubmitted.setUpdateTime(new Date());
alertSubmitted.setSubmissionTime(new Date());
this.baseMapper.insert(alertSubmitted);
alertSubmittedId = alertSubmitted.getSequenceNbr().toString();
smsCode = businessTypeEnum.get().getSms_code();
}
// 组装人员信息 // 组装人员信息
List<Map<String, Object>> orgUsers = orgUsrService.selectForShowByListId(ids); List<Map<String, Object>> orgUsers = orgUsrService.selectForShowByListId(ids);
...@@ -147,7 +176,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -147,7 +176,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setCompanyId(Long.valueOf((String) orgUser.get("parentId"))); alertSubmittedObject.setCompanyId(Long.valueOf((String) orgUser.get("parentId")));
alertSubmittedObject.setCompanyName((String) orgUser.get("parenName")); alertSubmittedObject.setCompanyName((String) orgUser.get("parenName"));
alertSubmittedObject.setUserId(10010L); alertSubmittedObject.setUserId(Long.valueOf(String.valueOf(orgUser.get("sequenceNbr"))));
alertSubmittedObject.setUserName((String) orgUser.get("bizOrgName")); alertSubmittedObject.setUserName((String) orgUser.get("bizOrgName"));
alertSubmittedObject.setUserPhone((String) orgUser.get("telephone")); alertSubmittedObject.setUserPhone((String) orgUser.get("telephone"));
alertSubmittedObject.setRecUserName("ZW"); alertSubmittedObject.setRecUserName("ZW");
...@@ -156,12 +185,22 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -156,12 +185,22 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedObjectList.add(alertSubmittedObject); alertSubmittedObjectList.add(alertSubmittedObject);
} }
// 组装报送内容 // 组装报送内容
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put("callTimeStr",calledRo.getCallTimeStr());
smsParams.put("address",calledRo.getAddress());
smsParams.put("fireLocation",calledRo.getFireLocation());
smsParams.put("burningMaterial",calledRo.getBurningMaterial());
smsParams.put("fireSituation",calledRo.getFireSituation());
smsParams.put("trappedNum", calledRo.getTrappedNum()); smsParams.put("trappedNum", calledRo.getTrappedNum());
smsParams.put("casualtiesNum", calledRo.getCasualtiesNum());
smsParams.put("dangerousExplosives", calledRo.getDangerousExplosives());
smsParams.put("companyName", calledRo.getCompanyName()); smsParams.put("companyName", calledRo.getCompanyName());
} }
// 执行短信报送对象 // 短信报送对象
saveAlertSubmittedObject(alertSubmittedObjectList, smsCode, mobiles, smsParams); alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息
// 组织短信内容
// 调用短信发送接口
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
} }
/** /**
...@@ -266,7 +305,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -266,7 +305,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
*/ */
public void saveAlertSubmittedObject(List<AlertSubmittedObject> alertSubmittedObjectList, String smsCode, public void saveAlertSubmittedObject(List<AlertSubmittedObject> alertSubmittedObjectList, String smsCode,
Set<String> mobiles, HashMap<String, String> smsParams) { Set<String> mobiles, HashMap<String, String> smsParams) {
alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息 // 发送任务消息
// 组织短信内容 // 组织短信内容
// 调用短信发送接口 // 调用短信发送接口
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment