Commit 3b7d53fa authored by 郭武斌's avatar 郭武斌

*)提交警情触发规则

parent 4ad6db7b
...@@ -24,14 +24,14 @@ public class AlertCalledRo implements Serializable{ ...@@ -24,14 +24,14 @@ public class AlertCalledRo implements Serializable{
* *
* </pre> * </pre>
*/ */
private static final long serialVersionUID = -8105736102662461646L; private static final long serialVersionUID = -9034974124471572825L;
/** /**
* 通用属性 * 通用属性
*/ */
@Label("警情id") @Label("警情id")
private Long sequenceNbr; private String sequenceNbr;
@Label(value = "警情类型") @Label(value = "警情类型")
private String alertType; private String alertType;
...@@ -43,10 +43,10 @@ public class AlertCalledRo implements Serializable{ ...@@ -43,10 +43,10 @@ public class AlertCalledRo implements Serializable{
private String unitInvolved; private String unitInvolved;
@Label(value = "被困人数") @Label(value = "被困人数")
private Integer trappedNum; private String trappedNum;
@Label(value = "伤亡人数") @Label(value = "伤亡人数")
private Integer casualtiesNum; private String casualtiesNum;
@Label(value = "地址") @Label(value = "地址")
private String address; private String address;
......
...@@ -16,7 +16,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -16,7 +16,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrDto; import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.rule.RuleActionBean; import com.yeejoin.amos.component.rule.RuleActionBean;
import com.yeejoin.amos.component.rule.RuleMethod; import com.yeejoin.amos.component.rule.RuleMethod;
...@@ -79,22 +79,27 @@ public class AlertCalledAction { ...@@ -79,22 +79,27 @@ public class AlertCalledAction {
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@RuleMethod(methodLabel = "短信报送", project = "西咸机场119接处警规则") @RuleMethod(methodLabel = "短信报送", project = "西咸机场119接处警规则")
public void sendcmd(String smsCode, String sendType, String sendIds, Object object) public void sendcmd(String smsCode, String sendType, String sendIds, Object object) throws Exception
{ {
List<Long> seqs = StringUtil.String2LongList(sendIds); List<Long> seqs = StringUtil.String2LongList(sendIds);
if (ValidationUtil.isEmpty(seqs)) if (!ValidationUtil.isEmpty(seqs))
{ {
//构建短信参数 //构建短信参数
HashMap<String, String> smsParams = new HashMap<String, String>(); HashMap<String, String> smsParams = new HashMap<String, String>();
Map<String, String> objectMap = JSON.parseObject(JSON.toJSONString(object), HashMap.class); Map<String, String> objectMap = JSON.parseObject(JSON.toJSONString(object), HashMap.class);
smsParams.putAll(objectMap); smsParams.putAll(objectMap);
//查询人员手机号 //查询人员手机号
Set<String> mobiles = new HashSet<>(); Set<String> mobiles = new HashSet<>();
List<OrgUsrDto> orgUsrDtos = orgUsrService.queryBatchSeq(seqs);
for (OrgUsrDto orgUsrDto : orgUsrDtos) for (Long seq : seqs)
{
OrgUsr orgUsr = orgUsrService.getById(seq);
Map<String, Object> result = orgUsrService.selectForShowById(orgUsr, seq);
Object telephone = result.get("telephone");
if (!ValidationUtil.isEmpty(telephone))
{ {
// mobiles.add(e); mobiles.add(String.valueOf(telephone));
}
} }
//发送短信 //发送短信
...@@ -115,7 +120,6 @@ public class AlertCalledAction { ...@@ -115,7 +120,6 @@ public class AlertCalledAction {
//发送短信 //发送短信
Systemctl.smsClient.sendCommonSms(smsParams); Systemctl.smsClient.sendCommonSms(smsParams);
} }
} }
} }
......
...@@ -4,7 +4,6 @@ import java.util.List; ...@@ -4,7 +4,6 @@ import java.util.List;
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.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...@@ -51,7 +50,13 @@ public class RuleAlertCalledService { ...@@ -51,7 +50,13 @@ public class RuleAlertCalledService {
*/ */
AlertCalledRo alertCalledRo = new AlertCalledRo(); AlertCalledRo alertCalledRo = new AlertCalledRo();
//通用属性 //通用属性
Bean.toModel(alertCalled, alertCalledRo); alertCalledRo.setSequenceNbr(String.valueOf(alertCalled.getSequenceNbr()));
alertCalledRo.setAddress(alertCalled.getAddress());
alertCalledRo.setAlertType(alertCalled.getAlertType());
alertCalledRo.setAlertTypeCode(alertCalled.getAlertTypeCode());
alertCalledRo.setCasualtiesNum(alertCalled.getCasualtiesNum() != null ? String.valueOf(alertCalled.getCasualtiesNum()) : "无");
alertCalledRo.setTrappedNum(alertCalled.getTrappedNum() != null ? String.valueOf(alertCalled.getTrappedNum()) : "无");
alertCalledRo.setUnitInvolved(alertCalled.getUnitInvolved());
List<AlertFormValue> alertFormValues = alertCalledVo.getAlertFormValue(); List<AlertFormValue> alertFormValues = alertCalledVo.getAlertFormValue();
for (AlertFormValue alertFormValue : alertFormValues) for (AlertFormValue alertFormValue : alertFormValues)
...@@ -87,7 +92,6 @@ public class RuleAlertCalledService { ...@@ -87,7 +92,6 @@ public class RuleAlertCalledService {
} }
alertCalledRo.setAlertTypeCode("229");
//触发规则 //触发规则
ruleTrigger.publish(alertCalledRo, "西咸机场119接处警规则/alertCalledRule", new String[0]); ruleTrigger.publish(alertCalledRo, "西咸机场119接处警规则/alertCalledRule", new String[0]);
......
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