Commit d16810eb authored by tangwei's avatar tangwei

修改警情结案时间

parent f8dfa5aa
package com.yeejoin.amos.boot.biz.config; package com.yeejoin.amos.boot.biz.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.yeejoin.amos.boot.biz.common.annotation.FillCommonUserField; import com.yeejoin.amos.boot.biz.common.annotation.FillCommonUserField;
...@@ -106,7 +107,13 @@ public class MetaHandler implements MetaObjectHandler { ...@@ -106,7 +107,13 @@ public class MetaHandler implements MetaObjectHandler {
this.setFieldValByName("recUserName", agencyUserModel.getRealName(), metaObject); this.setFieldValByName("recUserName", agencyUserModel.getRealName(), metaObject);
Date currentDate = new Date(); Date currentDate = new Date();
this.setFieldValByName("recDate", currentDate, metaObject); this.setFieldValByName("recDate", currentDate, metaObject);
this.setFieldValByName("updateTime", currentDate, metaObject); JSONObject jd= JSONObject.parseObject(JSONObject.toJSONString(metaObject.getOriginalObject()));
if(jd.containsKey("updateTime")&&jd.get("updateTime")==null){
this.setFieldValByName("updateTime", currentDate, metaObject);
}
} }
private Boolean isExistField(String field, Object obj) { private Boolean isExistField(String field, Object obj) {
......
...@@ -22,7 +22,7 @@ public interface IAlertCalledService { ...@@ -22,7 +22,7 @@ public interface IAlertCalledService {
* 根据id 修改警情 * 根据id 修改警情
* type:警情相关 操作类型 警情续报 非警情确认 警情结案 * type:警情相关 操作类型 警情续报 非警情确认 警情结案
* */ * */
boolean updateAlertCalled(Long id, String code); boolean updateAlertCalled(Long id, String code,String trappedNum,String casualtiesNum,String date);
/** /**
* *
......
...@@ -12,6 +12,7 @@ import java.util.Set; ...@@ -12,6 +12,7 @@ import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -672,24 +673,32 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -672,24 +673,32 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
*/ */
@Override @Override
@Transactional(rollbackFor = RuntimeException.class) @Transactional(rollbackFor = RuntimeException.class)
public boolean updateAlertCalled(Long id, String code) { public boolean updateAlertCalled(Long id, String code,String trappedNum,String casualtiesNum,String date) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
try { try {
AlertCalled alertCalledd = this.getById(id);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
switch (code) { switch (code) {
case "314": case "314":
alertCalledMapper.update(null, alertCalledMapper.update(null,
new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id).set("alert_status", 1) new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id).set("alert_status", 1)
.set("alert_stage", AlertStageEnums.CZJS.getValue()).set("update_time", new Date()) .set("alert_stage", AlertStageEnums.CZJS.getValue()).set("update_time", new Date())
.set("alarm_type", AlertStageEnums.FJQ.getValue()) .set("alarm_type", AlertStageEnums.FJQ.getValue())
.set("trapped_num", trappedNum!=null&&!"".equals(trappedNum) ?trappedNum:alertCalledd.getTrappedNum())
.set("casualties_num", casualtiesNum!=null&&!"".equals(casualtiesNum)?casualtiesNum:alertCalledd.getCasualtiesNum())
.set("alarm_type_code", AlertStageEnums.FJQ.getCode())); .set("alarm_type_code", AlertStageEnums.FJQ.getCode()));
break; break;
case "315": case "315":
alertCalledMapper.update(null, alertCalledMapper.update(null,
new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id).set("alert_status", 1) new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id).set("alert_status", 1)
.set("update_time", new Date()).set("alert_stage", AlertStageEnums.CZJS.getValue())); .set("trapped_num", trappedNum!=null&&!"".equals(trappedNum) ?trappedNum:alertCalledd.getTrappedNum())
.set("casualties_num", casualtiesNum!=null&&!"".equals(casualtiesNum)?casualtiesNum:alertCalledd.getCasualtiesNum())
.set("update_time", date!=null?sdf.parse(date): new Date()).set("alert_stage", AlertStageEnums.CZJS.getValue()));
break; break;
default: default:
alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id) alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id)
.set("trapped_num", trappedNum!=null&&!"".equals(trappedNum) ?trappedNum:alertCalledd.getTrappedNum())
.set("casualties_num", casualtiesNum!=null&&!"".equals(casualtiesNum)?casualtiesNum:alertCalledd.getCasualtiesNum())
.set("update_time", new Date()).set("alert_stage", AlertStageEnums.CZGZ.getValue())); .set("update_time", new Date()).set("alert_stage", AlertStageEnums.CZGZ.getValue()));
break; break;
...@@ -708,6 +717,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -708,6 +717,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return true; return true;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!"); throw new RuntimeException("系统异常!");
} }
} }
......
...@@ -780,7 +780,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -780,7 +780,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 3.更新警情状态 // 3.更新警情状态
alertCalledService.updateAlertCalled(alertSubmittedDto.getAlertCalledId(), alertCalledService.updateAlertCalled(alertSubmittedDto.getAlertCalledId(),
alertSubmittedDto.getBusinessTypeCode()); alertSubmittedDto.getBusinessTypeCode(),
alertSubmittedDto.getSubmitContent().get("trappedNum")!=null?alertSubmittedDto.getSubmitContent().get("trappedNum").toString():null,
alertSubmittedDto.getSubmitContent().get("casualtiesNum")!=null?alertSubmittedDto.getSubmitContent().get("casualtiesNum").toString():null,
alertSubmittedDto.getSubmitContent().get("recDate")!=null?alertSubmittedDto.getSubmitContent().get("recDate").toString():null
);
// 警情续报 // 警情续报
if(AlertBusinessTypeEnum.警情续报.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) { if(AlertBusinessTypeEnum.警情续报.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
......
...@@ -135,6 +135,7 @@ public class MsgController extends AbstractBaseController { ...@@ -135,6 +135,7 @@ public class MsgController extends AbstractBaseController {
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
return CommonResponseUtil.failure("通知发布失败!"); return CommonResponseUtil.failure("通知发布失败!");
} }
} }
......
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