Commit 165d4afb authored by tangwei's avatar tangwei

修改接口

parent 462cfae0
......@@ -32,7 +32,7 @@ public class MyBatisPlusCodeGenerator {
/**
* 项目名称缩写
*/
static String projectShortName = "tzs";
static String projectShortName = "jcs";
/**
* 项目api目录
......@@ -107,7 +107,7 @@ public class MyBatisPlusCodeGenerator {
gc.setActiveRecord(false);
// 数据源配置
DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://172.16.6.60:3306/amos-tzs-biz?serverTimezone=GMT%2B8");
dsc.setUrl("jdbc:mysql://172.16.6.60:3306/amos-jcs-biz?serverTimezone=GMT%2B8");
// dsc.setSchemaName("public");
dsc.setDriverName("com.mysql.jdbc.Driver");
dsc.setUsername("root");
......
package com.yeejoin.amos.boot.module.jcs.api.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import java.util.Date;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
......@@ -8,8 +9,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
......@@ -28,7 +27,6 @@ public class AlertCalled extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情状态")
private Boolean alertStatus;
......@@ -109,4 +107,10 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "发送人名称")
private String recUserName;
@ApiModelProperty(value = "接警时间开始---用于列表过滤")
@TableField(exist=false)
private Date callTimeStart ;
@ApiModelProperty(value = "接警时间结束---用于列表过滤")
@TableField(exist=false)
private Date callTimeEnd ;
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 警情接警记录
*
* @author tb
* @date 2021-06-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("jc_alert_called")
@ApiModel(value="AlertCalled对象", description="警情接警记录")
public class AlertCalledListVo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情状态")
private Boolean alertStatus;
@ApiModelProperty(value = "系统/人工")
private String type;
@ApiModelProperty(value = "警情阶段")
private String alertStage;
@ApiModelProperty(value = "报警类型")
private String alarmType;
@ApiModelProperty(value = "响应级别字典code 为了过滤用(只有航空器故障有)")
private String responseLevelCode;
@ApiModelProperty(value = "报警类型code")
private String alarmTypeCode;
@ApiModelProperty(value = "报警方式")
private String alarmMode;
@ApiModelProperty(value = "报警方式code")
private String alarmModeCode;
@ApiModelProperty(value = "通话记录信息id")
private Integer callRecordId;
@ApiModelProperty(value = "父警情id")
private Long fatherAlert;
@ApiModelProperty(value = "联系人姓名")
private String contactUser;
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ApiModelProperty(value = "接警时间")
private Date callTime;
@ApiModelProperty(value = "接警时长")
private Double callTimeNum;
@ApiModelProperty(value = "警情来源")
private String alertSource;
@ApiModelProperty(value = "警情来源code")
private String alertSourceCode;
@ApiModelProperty(value = "警情类型")
private String alertType;
@ApiModelProperty(value = "警情类型code")
private String alertTypeCode;
@ApiModelProperty(value = "事发单位")
private String unitInvolved;
@ApiModelProperty(value = "被困人数")
private Integer trappedNum;
@ApiModelProperty(value = "伤亡人数")
private Integer casualtiesNum;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "救援方格")
private String rescueGrid;
@ApiModelProperty(value = "坐标x")
private String coordinateX;
@ApiModelProperty(value = "坐标y")
private String coordinateY;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "发送人名称")
private String recUserName;
@ApiModelProperty(value = "接警时间开始---用于列表过滤")
private Date callTimeStart ;
@ApiModelProperty(value = "接警时间结束---用于列表过滤")
private Date callTimeEnd ;
}
......@@ -2,7 +2,11 @@ package com.yeejoin.amos.boot.module.jcs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import java.util.List;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -14,96 +18,25 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
/**
* 警情接警记录
* 保存警情接警记录
*
* @author tb
* @date 2021-06-17
*/
@Data
@Accessors(chain = true)
@TableName("jc_alert_called")
@ApiModel(value="AlertCalledVo", description="警情接警记录")
public class AlertCalledVo{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情状态")
private Boolean alertStatus;
@ApiModelProperty(value = "系统/人工")
private String type;
@ApiModelProperty(value = "警情阶段")
private String alertStage;
@ApiModelProperty(value = "报警类型")
private String alarmType;
@ApiModelProperty(value = "报警类型code")
private String alarmTypeCode;
@ApiModelProperty(value = "报警方式")
private String alarmMode;
@ApiModelProperty(value = "报警方式code")
private String alarmModeCode;
@ApiModelProperty(value = "通话记录信息id")
private Integer callRecordId;
@ApiModelProperty(value = "父警情id")
private Long fatherAlert;
@ApiModelProperty(value = "联系人姓名")
private String contactUser;
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ApiModelProperty(value = "接警时间")
private Date callTime;
@ApiModelProperty(value = "接警时长")
private Double callTimeNum;
@ApiModelProperty(value = "警情来源")
private String alertSource;
@ApiModelProperty(value = "警情来源code")
private String alertSourceCode;
@ApiModelProperty(value = "警情类型")
private String alertType;
@ApiModelProperty(value = "警情类型code")
private String alertTypeCode;
@ApiModelProperty(value = "事发单位")
private String unitInvolved;
@ApiModelProperty(value = "被困人数")
private Integer trappedNum;
@ApiModelProperty(value = "伤亡人数")
private Integer casualtiesNum;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "救援方格")
private String rescueGrid;
@ApiModelProperty(value = "坐标x")
private String coordinateX;
@ApiModelProperty(value = "坐标y")
private String coordinateY;
@ApiModelProperty(value = "警情基本信息")
private AlertCalled alertCalled;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "动态表单值")
private List<AlertFromValue> alertFromValue;
@ApiModelProperty(value = "发送人名称")
private String recUserName;
public AlertCalledVo(AlertCalled alertCalled, List<AlertFromValue> alertFromValue) {
this.alertCalled = alertCalled;
this.alertFromValue = alertFromValue;
}
public AlertCalledVo() {
}
}
......@@ -13,33 +13,41 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
/**
* 警情表单
* 表单
*
* @author tb
* @date 2021-06-17
*/
@Data
@Accessors(chain = true)
@TableName("jc_alert_from")
@ApiModel(value="AlertFromVo", description="警情表单")
public class AlertFromVo{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情类型")
private String alertTypeCode;
@ApiModelProperty(value = "表单key")
private String key;
@ApiModelProperty(value = "字段名称")
private String fieldName;
@ApiModelProperty(value = "表单名称")
private String label;
@ApiModelProperty(value = "英文名称")
private String fieldCode;
@ApiModelProperty(value = "表单类型")
private String type;
@ApiModelProperty(value = "字段类型")
private String fieldType;
@ApiModelProperty(value = "表单初始化值")
private String data;
@ApiModelProperty(value = "操作人名称")
private String recUserName;
public AlertFromVo(String key, String label, String type, String data) {
super();
this.key = key;
this.label = label;
this.type = type;
this.data = data;
}
public AlertFromVo() {
super();
}
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
/*
*
* 下拉表单值
* */
import io.swagger.annotations.ApiModelProperty;
public class AlertListvalue {
@ApiModelProperty(value = "key")
private String key;
@ApiModelProperty(value = "名称")
private String text;
@ApiModelProperty(value = "值")
private String value;
@ApiModelProperty(value = "表单id")
private Long alertFromId;
@ApiModelProperty(value = "英文名称")
private String fieldCode;
@ApiModelProperty(value = "字段值字典code")
private String fieldValueCode;
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFrom;
import com.yeejoin.amos.boot.module.jcs.api.service.IFireTeamService;
@Component
public class FromList {
/**
* 数据字典
*
* */
@Autowired
IFireTeamService iFireTeamService;
public static List<AlertFromVo> getFromlist(List<AlertFrom> list) {
List<AlertFromVo> listfrom = new ArrayList<AlertFromVo>();
// 组装数据
for (AlertFrom alertFrom : list) {
switch (alertFrom.getFieldType()) {
case "select":
// 查询数据项
AlertFromVo vo = new AlertFromVo(null, null, null, null);
break;
case "date":
break;
case "radio":
break;
default:
break;
}
}
return null;
}
}
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.FirefightersJacket;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFromValueService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledListVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -18,7 +25,10 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Arrays;
import java.util.List;
/**
......@@ -34,7 +44,8 @@ public class AlertCalledController extends BaseController {
@Autowired
IAlertCalledService iAlertCalledService;
@Autowired
IAlertFromValueService iAlertFromValueService;
/**
* 新增警情接警记录
* @return
......@@ -42,8 +53,29 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增警情接警记录", notes = "新增警情接警记录")
public boolean saveAlertCalled(HttpServletRequest request, @RequestBody AlertCalled alertCalled){
return iAlertCalledService.save(alertCalled);
@Transactional
public ResponseModel saveAlertCalled(HttpServletRequest request, @RequestBody AlertCalledVo alertCalledVo){
//警情基本信息
AlertCalled alertCalled= alertCalledVo.getAlertCalled();
//判断是否归并警情
if(alertCalled.getFatherAlert()!=null){
//警情归并,设置当前警情状态为结束。
alertCalled.setAlertStatus(true);
}else{
//警情报送
//****************************************************待确认开发
}
iAlertCalledService.save(alertCalled);
//动态表单
List<AlertFromValue> alertFromValuelist= alertCalledVo.getAlertFromValue();
//填充警情主键
alertFromValuelist.stream().forEach(alertFromValue->{
alertFromValue.setAlertCalledId(alertCalled.getSequenceNbr());
});
//保存动态表单数据
iAlertFromValueService.saveBatch(alertFromValuelist);
iAlertCalledService.save(alertCalled);
return CommonResponseUtil.success(alertCalledVo);
}
/**
......@@ -82,8 +114,15 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public AlertCalled selectById(HttpServletRequest request, @PathVariable Long id){
return iAlertCalledService.getById(id);
public ResponseModel selectById(HttpServletRequest request, @PathVariable Long id){
//警情基本信息
AlertCalled alertCalled=iAlertCalledService.getById(id);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id);
//警情动态表单数据
List<AlertFromValue> alertFromValue = iAlertFromValueService.list(queryWrapper);
AlertCalledVo alertCalledVo=new AlertCalledVo(alertCalled,alertFromValue);
return CommonResponseUtil.success(alertCalledVo);
}
......@@ -95,11 +134,15 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
public IPage<AlertCalled> listPage(String pageNum,String pageSize, AlertCalled alertCalled){
public ResponseModel listPage(String pageNum,String pageSize, AlertCalled alertCalled){
Page<AlertCalled> pageBean;
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
Class<? extends AlertCalled> aClass = alertCalled.getClass();
alertCalledQueryWrapper.eq("is_delete",1);
if(alertCalled.getCallTimeStart()!=null&&alertCalled.getCallTimeEnd()!=null){
alertCalledQueryWrapper.between("call_time",alertCalled.getCallTimeStart(),alertCalled.getCallTimeEnd());
}
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
......@@ -122,6 +165,7 @@ public class AlertCalledController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<AlertCalled> page;
......@@ -131,7 +175,7 @@ public class AlertCalledController extends BaseController {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
return page;
return CommonResponseUtil.success(page);
}
}
......@@ -15,10 +15,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFrom;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFromValue;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.util.Arrays;
import java.util.List;
/**
......@@ -88,6 +90,40 @@ public class AlertFromController extends BaseController {
/**
* 根据表态类型code查询表单数据项
* @param id
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{code}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public AlertFrom selectFromdItem(HttpServletRequest request, @PathVariable String code){
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_type_code", code);
//警情动态表单数据
List<AlertFrom> alertFromValue = iAlertFromService.list(queryWrapper);
return null;
}
/**
* 列表分页查询
* @return
......@@ -122,6 +158,7 @@ public class AlertFromController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<AlertFrom> page;
......
......@@ -122,6 +122,7 @@ public class AlertFromTypeController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<AlertFromType> page;
......
......@@ -122,6 +122,7 @@ public class AlertFromValueController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<AlertFromValue> page;
......
......@@ -122,6 +122,7 @@ public class AlertSubmittedController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<AlertSubmitted> page;
......
......@@ -122,6 +122,7 @@ public class AlertSubmittedObjectController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<AlertSubmittedObject> page;
......
......@@ -122,6 +122,7 @@ public class FireExpertsController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<FireExperts> page;
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
......@@ -21,6 +20,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.entity.FireTeam;
import com.yeejoin.amos.boot.biz.common.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -173,6 +174,7 @@ public class FireTeamController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<FireTeam> page;
......
......@@ -122,6 +122,7 @@ public class FirefightersContactsController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<FirefightersContacts> page;
......
......@@ -149,6 +149,7 @@ public class FirefightersContractController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<FirefightersContract> page;
......
......@@ -203,6 +203,7 @@ public class FirefightersController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<Firefighters> page;
......
......@@ -122,6 +122,7 @@ public class FirefightersEducationController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<FirefightersEducation> page;
......
......@@ -138,6 +138,7 @@ public class FirefightersJacketController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<FirefightersJacket> page;
......
......@@ -161,6 +161,7 @@ public class FirefightersPostController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<FirefightersPost> page;
......
......@@ -144,6 +144,7 @@ public class FirefightersThoughtController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<FirefightersThought> page;
......
......@@ -122,6 +122,7 @@ public class FirefightersWorkexperienceController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<FirefightersWorkexperience> page;
......
......@@ -122,6 +122,7 @@ public class PowerTransferCompanyController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<PowerTransferCompany> page;
......
......@@ -122,6 +122,7 @@ public class PowerTransferCompanyResourcesController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<PowerTransferCompanyResources> page;
......
......@@ -122,6 +122,7 @@ public class PowerTransferController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<PowerTransfer> page;
......
......@@ -122,6 +122,7 @@ public class TemplateController extends BaseController {
}
}
} catch (Exception e) {
throw new RuntimeException("系统异常");
}
});
IPage<Template> page;
......
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