Commit d426904a authored by tangwei's avatar tangwei

增接修改警情接口

parent 00c71705
package com.yeejoin.amos.boot.biz.common.enums;
/**
*
* 警情类型枚举
*
* ***/
public enum AlertStageEnums {
JQJB ("260","警情接报"),
LLDP("261","力量调派"),
ZBQJ("262","值班确警"),
CZGZ("263","处置跟踪"),
CZJS("264","处置结束"),
//警情类型
JQCB("297","警情初报"),
JQGB("298","警情归并"),
FJQ("299","非警情"),
QT("300","其他");
private String code;
private String value;
AlertStageEnums(String code, String value) {
this.code=code;
this.value=value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
...@@ -9,7 +9,7 @@ package com.yeejoin.amos.boot.module.jcs.api.service; ...@@ -9,7 +9,7 @@ package com.yeejoin.amos.boot.module.jcs.api.service;
public interface IAlertCalledService { public interface IAlertCalledService {
/* /*
* 根据id 修改警情 * 根据id 修改警情
* type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案 * type:警情相关 操作类型 警情续报 非警情确认 警情结案
* */ * */
boolean updateAlertCalled(Long id, String code,String name); boolean updateAlertCalled(Long id, String code);
} }
...@@ -7,6 +7,7 @@ import org.springframework.stereotype.Service; ...@@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.enums.AlertStageEnums;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto;
...@@ -45,23 +46,30 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -45,23 +46,30 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
* @param alertCalledVo * @param alertCalledVo
* @return * @return
*/ */
public AlertCalledVo createAlertCalled(AlertCalledVo alertCalledVo) throws Exception public AlertCalledVo createAlertCalled(AlertCalledVo alertCalledVo) throws Exception {
{
// 警情基本信息 // 警情基本信息
AlertCalled alertCalled = alertCalledVo.getAlertCalled(); AlertCalled alertCalled = alertCalledVo.getAlertCalled();
alertCalled.setAlertStage(AlertStageEnums.JQJB.getValue());
// 判断是否归并警情 // 判断是否归并警情
if (alertCalled.getFatherAlert() != null) { if (alertCalled.getFatherAlert() != null) {
// 警情归并,设置当前警情状态为结束。 // 警情归并,设置当前警情状态为结束。
alertCalled.setAlertStatus(true); alertCalled.setAlertStatus(true);
alertCalled.setAlarmType(AlertStageEnums.JQGB.getValue());
alertCalled.setAlarmTypeCode(AlertStageEnums.JQGB.getCode());
} else { } else {
// 警情报送 // 警情报送
// ****************************************************待确认开发 // ****************************************************待确认开发
alertCalled.setAlarmType(AlertStageEnums.JQCB.getValue());
alertCalled.setAlarmTypeCode(AlertStageEnums.JQCB.getCode());
} }
this.save(alertCalled); this.save(alertCalled);
// 动态表单 // 动态表单
List<AlertFormValue> alertFormValuelist = alertCalledVo.getAlertFormValue(); List<AlertFormValue> alertFormValuelist = alertCalledVo.getAlertFormValue();
// 填充警情主键 // 填充警情主键
alertFormValuelist.stream().forEach(alertFormValue -> { alertFormValuelist.stream().forEach(alertFormValue -> {
alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr()); alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr());
alertFormValue.setAlertTypeCode(alertCalled.getAlertTypeCode()); alertFormValue.setAlertTypeCode(alertCalled.getAlertTypeCode());
}); });
...@@ -73,7 +81,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -73,7 +81,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
*/ */
eSAlertCalledService.saveAlertCalledToES(alertCalled); eSAlertCalledService.saveAlertCalledToES(alertCalled);
return alertCalledVo; return alertCalledVo;
} }
...@@ -82,22 +90,30 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -82,22 +90,30 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
* type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案 * type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
* */ * */
@Override @Override
public boolean updateAlertCalled(Long id, String code,String name) { public boolean updateAlertCalled(Long id, String code) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
switch (code) { try {
case "314": switch (code) {
alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id) case "314":
.set("alert_status", 1).set("alert_stage", "").set("alarm_type", name).set("alarm_type_code", code) ); alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id)
break; .set("alert_status", 1).set("alert_stage", AlertStageEnums.ZBQJ.getValue()).set("alarm_type", AlertStageEnums.FJQ.getValue()).set("alarm_type_code", AlertStageEnums.FJQ.getCode()) );
case "315": break;
case "315":
break; alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id)
default: .set("alert_status", 1).set("alert_stage", AlertStageEnums.CZJS.getValue()) );
break; break;
} default:
//删除缓存 alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id)
redisUtils.del(RedisKey.ALERTCALLED_ID+id); .set("alert_stage", AlertStageEnums.CZGZ.getValue()));
return false;
break;
}
//删除缓存
redisUtils.del(RedisKey.ALERTCALLED_ID+id);
return true;
} catch (Exception e) {
throw new RuntimeException("系统异常!");
}
} }
......
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