Commit 8ca07d33 authored by tangwei's avatar tangwei

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

parents cec6d94d f2c126fa
package com.yeejoin.amos.boot.biz.common.dto;
import java.io.Serializable;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 基础DTO
* @author kinky
......@@ -30,10 +30,7 @@ public class BaseDto implements Serializable{
@ApiModelProperty(value = "更新人")
protected String recUserId;
/**
* 是否删除
*/
@ExcelIgnore
@TableField(value = "is_delete")
@ApiModelProperty(value = "是否删除")
private Boolean isDelete;
}
......@@ -97,4 +97,12 @@ public class AlertCalledDto extends BaseDto{
@ApiModelProperty(value = "发送人名称")
private String recUserName;
@ApiModelProperty(value = "接警时间开始---用于列表过滤")
private Date callTimeStart ;
@ApiModelProperty(value = "接警时间结束---用于列表过滤")
private Date callTimeEnd ;
@ApiModelProperty(value = "响应级别字典code 为了过滤用(只有航空器故障有)")
private String responseLevelCode;
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
......@@ -11,7 +15,12 @@ import java.util.List;
* 动态表单值
* */
@Data
public class AlertCalledFormVo {
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertCalledFormDto", description=" 动态表单值")
public class AlertCalledFormDto extends BaseDto{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情基本信息")
private AlertCalled alertCalled;
......@@ -19,11 +28,8 @@ public class AlertCalledFormVo {
private List<FormValue> dynamicFormAlert;
public AlertCalledFormVo(AlertCalled alertCalled, List<FormValue> formValue) {
public AlertCalledFormDto(AlertCalled alertCalled, List<FormValue> formValue) {
this.alertCalled = alertCalled;
this.dynamicFormAlert = formValue;
}
public AlertCalledFormVo() {
}
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
package com.yeejoin.amos.boot.module.jcs.api.dto;
import java.util.List;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import lombok.EqualsAndHashCode;
/**
* 保存警情接警记录
*
* @author tb
* @date 2021-06-17
*/
* 警情接警记录对象集合
* @author system
*
*/
@Data
public class AlertCalledVo{
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertCalledObjsDto", description="警情接警记录对象集合")
public class AlertCalledObjsDto extends BaseDto{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情基本信息")
private AlertCalled alertCalled;
@ApiModelProperty(value = "动态表单值")
private List<AlertFormValue> alertFormValue;
public AlertCalledVo(AlertCalled alertCalled, List<AlertFormValue> alertFormValue) {
this.alertCalled = alertCalled;
this.alertFormValue = alertFormValue;
}
public AlertCalledVo() {
}
}
......@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertFromDto", description="警情表单")
public class AlertFromDto extends BaseDto{
public class AlertFormDto extends BaseDto{
private static final long serialVersionUID = 1L;
......
package com.yeejoin.amos.boot.module.jcs.api.vo;
package com.yeejoin.amos.boot.module.jcs.api.dto;
import java.io.Serializable;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 表
* 表表单初始值
*
* @author tb
* @date 2021-06-17
*/
@Data
public class AlertFormVo{
@ApiModel(value="AlertFormInitDto", description="表单初始值")
public class AlertFormInitDto implements Serializable{
private static final long serialVersionUID = 1L;
......@@ -32,11 +37,11 @@ public class AlertFormVo{
@ApiModelProperty(value = "提交表单附加字段")
private AlertFormValue formItemDescr;
public AlertFormVo() {
public AlertFormInitDto() {
super();
}
public AlertFormVo(String key, String label, String type, Items data) {
public AlertFormInitDto(String key, String label, String type, Items data) {
super();
this.key = key;
this.label = label;
......
......@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertFromTypeDto", description="动态表单类型")
public class AlertFromTypeDto extends BaseDto {
public class AlertFormTypeDto extends BaseDto {
private static final long serialVersionUID = 1L;
......
......@@ -7,14 +7,14 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*
*表单实例值
* @author tb
* @date 2021-06-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertFromValueDto", description="")
public class AlertFromValueDto extends BaseDto {
@ApiModel(value="AlertFromValueDto", description="表单实例值")
public class AlertFormValueDto extends BaseDto {
private static final long serialVersionUID = 1L;
......@@ -42,7 +42,9 @@ public class AlertFromValueDto extends BaseDto {
@ApiModelProperty(value = "操作人名称")
private String recUserName;
@ApiModelProperty(value = "是否一行显示")
private Boolean block;
private Boolean isDelete;
@ApiModelProperty(value = "表单类型")
private String fieldType;
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
package com.yeejoin.amos.boot.module.jcs.api.dto;
/*
*
* 下拉表单值
* */
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class AlertListvalue {
@ApiModel(value="AlertListvalue", description="下拉表单值")
public class AlertListvalue implements Serializable{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "key")
private String key;
......
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -15,8 +14,9 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class ESAlertCalledRequestDto extends AlertCalledVo
public class ESAlertCalledRequestDto extends AlertCalledObjsDto
{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情状态")
private String[] alertStatus;
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
package com.yeejoin.amos.boot.module.jcs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 消防队伍
* 消防队伍卡片列表dto
*
* @author tb
* @date 2021-06-07
*/
@Data
@ApiModel(value = "FireTeamVo", description = "消防队伍")
public class FireTeamVo {
@ApiModel(value = "FireTeamCardDto", description = "消防队伍卡片列表dto")
public class FireTeamCardDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "消防队伍图片")
private String img;
@ApiModelProperty(value = "队伍名称")
......@@ -32,13 +31,11 @@ public class FireTeamVo {
@ApiModelProperty(value = "队伍id")
private Long sequenceNbr;
@ApiModelProperty(value = "队伍车数量")
private Double carNum = 0D;
@ApiModelProperty(value = "队伍装备数量")
private Double eqNum = 0D;
private Integer carNum = 0;
@ApiModelProperty(value = "队伍人员数量")
private Integer fighterNum = 0;
@ApiModelProperty(value = "出动数量")
private Integer dispatchNum;
@ApiModelProperty(value = "执勤数量")
private Integer onDutyNum;
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author DELL
*/
@Data
public class FireTeamListDto {
@ApiModelProperty(value = "单位名称")
private String name;
@ApiModelProperty(value = "机构code")
private String companyCode;
@ApiModelProperty(value = "队伍code")
private String typeCode;
@ApiModelProperty(value = "父级id")
private Long parent;
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
package com.yeejoin.amos.boot.module.jcs.api.dto;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -13,8 +16,10 @@ import lombok.Data;
* 动态表单值
*/
@Data
public class FormValue {
@ApiModel(value="FormValue", description="动态表单值")
public class FormValue implements Serializable{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "key")
private String key;
@ApiModelProperty(value = "label")
......
package com.yeejoin.amos.boot.module.jcs.api.vo;
package com.yeejoin.amos.boot.module.jcs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
......@@ -10,7 +12,10 @@ import java.util.List;
*
**/
@Data
public class Items {
@ApiModel(value="FormValue", description="动态表单值")
public class Items implements Serializable{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "初始化值")
private List<AlertListvalue> items;
......
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
......@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormValueDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import java.util.List;
......@@ -14,6 +14,6 @@ import java.util.List;
*/
public interface AlertFormValueMapper extends BaseMapper<AlertFormValue> {
public List<AlertFormValueVo> selectListByCalledId(Long id);
public List<AlertFormValueDto> selectListByCalledId(Long id);
}
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireBrigadeResourceDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireTeamCardDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireTeamListDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamListVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamVo;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* 消防队伍 Mapper 接口
......@@ -18,22 +18,22 @@ import java.util.Map;
*/
public interface FireTeamMapper extends BaseMapper<FireTeam> {
@Select("<script>"
+ "select a.sequence_nbr sequenceNbr, a.img,a.name,a.contact_user contactUser,a.contact_phone contactPhone, a.address from cb_fire_team a where a.is_delete=0"
+ "<if test='par.parent!=null'>" + "and a.parent= #{par.parent}" + "</if>"
+ "<if test='par.typeCode!=null'>" + "and a.type_code= #{par.typeCode}" + "</if>"
+ "<if test='par.companyCode!=null'>" + "and a.company_code= #{par.companyCode}" + "</if>"
+ "<if test='par.name!=null'>" + "and a.name= #{par.name}" + "</if>"
+ "</script>")
List<FireTeamVo> getFireTeam(int pageNum, int pageSize, FireTeamListVo par);
@Select("<script>"
+ "select COUNT(a.sequence_nbr) num from cb_fire_team a where a.is_delete=0"
+ "<if test='par.parent!=null'>" + "and a.parent= #{par.parent}" + "</if>"
+ "<if test='par.typeCode!=null'>" + "and a.type_code= #{par.typeCode}" + "</if>"
+ "<if test='par.companyCode!=null'>" + "and a.company_code= #{par.companyCode}" + "</if>"
+ "<if test='par.name!=null'>" + " and a.name= #{par.name}" + "</if>"
+ "</script>")
Map<String, Long> getFireTeamCount(int pageNum, int pageSize, FireTeamListVo par);
// @Select("<script>"
// + "select a.sequence_nbr sequenceNbr, a.img,a.name,a.contact_user contactUser,a.contact_phone contactPhone, a.address from cb_fire_team a where a.is_delete=0"
// + "<if test='par.parent!=null'>" + "and a.parent= #{par.parent}" + "</if>"
// + "<if test='par.typeCode!=null'>" + "and a.type_code= #{par.typeCode}" + "</if>"
// + "<if test='par.companyCode!=null'>" + "and a.company_code= #{par.companyCode}" + "</if>"
// + "<if test='par.name!=null'>" + "and a.name= #{par.name}" + "</if>"
// + "</script>")
// List<FireTeamVo> getFireTeam(int pageNum, int pageSize, FireTeamListVo par);
// @Select("<script>"
// + "select COUNT(a.sequence_nbr) num from cb_fire_team a where a.is_delete=0"
// + "<if test='par.parent!=null'>" + "and a.parent= #{par.parent}" + "</if>"
// + "<if test='par.typeCode!=null'>" + "and a.type_code= #{par.typeCode}" + "</if>"
// + "<if test='par.companyCode!=null'>" + "and a.company_code= #{par.companyCode}" + "</if>"
// + "<if test='par.name!=null'>" + " and a.name= #{par.name}" + "</if>"
// + "</script>")
// Map<String, Long> getFireTeamCount(int pageNum, int pageSize, FireTeamListVo par);
/**
* 返回监控大队信息列表
......@@ -41,4 +41,13 @@ public interface FireTeamMapper extends BaseMapper<FireTeam> {
* @return
*/
List<FireBrigadeResourceDto> listMonitorFireBrigade();
/**
* 查询消防队伍卡片分页列表
*
* @param page
* @param par
* @return
*/
IPage<FireTeamCardDto> getFireTeamForPage(Page page, FireTeamListDto par);
}
package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamListVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamVo;
import java.util.List;
import java.util.Map;
/**
* 消防队伍 服务类
*
......@@ -13,8 +7,4 @@ import java.util.Map;
* @date 2021-06-07
*/
public interface IFireTeamService {
List<FireTeamVo> getFireTeam(int pageNum, int pageSize, FireTeamListVo par);
Map<String, Long> getFireTeamCount(int pageNum, int pageSize, FireTeamListVo par);
}
......@@ -5,6 +5,7 @@ import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.jcs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgDepartmentDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgDepartmentFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgMenuDto;
......@@ -14,7 +15,6 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
......
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 ;
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
*
*
* @author tb
* @date 2021-06-17
*/
@Data
@Accessors(chain = true)
@TableName("jc_alert_form_value")
@ApiModel(value="AlertFormValueVo", description="")
public class AlertFormValueVo{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "表单id")
private Integer alertFormId;
@ApiModelProperty(value = "警情id")
private Long alertCalledId;
@ApiModelProperty(value = "警情类型")
private String alertTypeCode;
@ApiModelProperty(value = "字段名称")
private String fieldName;
@ApiModelProperty(value = "英文名称")
private String fieldCode;
@ApiModelProperty(value = "字段值")
private String fieldValue;
@ApiModelProperty(value = "字段值字典code")
private String fieldValueCode;
@ApiModelProperty(value = "操作人名称")
private String recUserName;
@ApiModelProperty(value = "是否一行显示")
private Boolean block;
@ApiModelProperty(value = "表单类型")
private String fieldType;
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
import io.swagger.annotations.ApiModelProperty;
public class FireTeamListVo{
@ApiModelProperty(value = "单位名称")
private String name;
@ApiModelProperty(value = "机构code")
private String companyCode;
@ApiModelProperty(value = "队伍code")
private String typeCode;
@ApiModelProperty(value = "父级id")
private Long parent;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCompanyCode() {
return companyCode;
}
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public Long getParent() {
return parent;
}
public void setParent(Long parent) {
this.parent = parent;
}
}
package com.yeejoin.amos.boot.module.jcs.api.vo;
import org.springframework.stereotype.Component;
@Component
public class FormList {
/**
* 数据字典
*
*/
// @Autowired
// DataDictionaryServiceImpl iDataDictionaryService;
// public List<AlertFormVo> getFormlist(List<AlertForm> list) {
//
// List<AlertFormVo> listfrom = new ArrayList<AlertFormVo>();
// // 组装数据
// for (AlertForm alertFrom : list) {
// if(alertFrom.getFieldType().equals("string")||alertFrom.getFieldType().equals("date")||alertFrom.getFieldType().equals("textarea")) {
// AlertFormVo vo = new AlertFormVo(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(), null,
// new AlertFormValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode(),alertFrom.isBlock()));
// listfrom.add(vo);
// }else {
// // 查询数据项
// Map<String, Object> columnMap = new HashMap<>();
// columnMap.put("type", alertFrom.getFieldValueCode());
// Collection<DataDictionary> listDataDictionary = iDataDictionaryService.listByMap(columnMap);
// AlertFormVo vo = new AlertFormVo(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(),
// new Items(getdata(listDataDictionary)), new AlertFormValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode(),alertFrom.isBlock()));
// listfrom.add(vo);
// }
// }
//
// return listfrom;
// }
//
// public List<AlertListvalue> getdata(Collection<DataDictionary> list) {
// List<AlertListvalue> listAlertListvalue = new ArrayList<AlertListvalue>();
// for (DataDictionary dataDictionary : list) {
//
// listAlertListvalue.add(new AlertListvalue(dataDictionary.getSequenceNbr().toString(),
// dataDictionary.getName(),dataDictionary.getCode()));
// }
// return listAlertListvalue;
// }
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormValueMapper">
<select id="selectListByCalledId" resultType="com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo">
<select id="selectListByCalledId" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto">
SELECT
v.sequence_nbr sequenceNbr,
v.alert_form_id alertFormId,
......
......@@ -16,4 +16,22 @@
GROUP BY
ft.sequence_nbr
</select>
<select id="getFireTeamForPage" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.FireTeamCardDto">
SELECT
a.sequence_nbr sequenceNbr,
a.img,
a.NAME,
a.contact_user contactUser,
a.contact_phone contactPhone,
a.address,
( SELECT count( 1 ) FROM cb_firefighters WHERE fire_team_id = a.sequence_nbr AND is_delete = 0 ) fighterNum
FROM
cb_fire_team a
WHERE
a.is_delete = 0
<if test='par.parent!=null'>and a.parent = #{par.parent}</if>
<if test='par.typeCode!=null'>and a.type_code = #{par.typeCode}</if>
<if test='par.companyCode!=null'>and a.company_code = #{par.companyCode}</if>
<if test='par.name!=null'>and a.name like concat('%', #{par.name}, '%')</if>
</select>
</mapper>
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AircraftServiceImpl;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AircraftServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -10,36 +37,19 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ESAlertCalledService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 警情接警记录
......@@ -71,21 +81,21 @@ public class AlertCalledController extends BaseController {
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增警情接警记录", notes = "新增警情接警记录")
@Transactional
public ResponseModel<AlertCalled> saveAlertCalled(@RequestBody AlertCalledVo alertCalledVo) throws Exception{
public ResponseModel<AlertCalled> saveAlertCalled(@RequestBody AlertCalledObjsDto alertCalledObjsDto) throws Exception{
if (ValidationUtil.isEmpty(alertCalledVo)
|| ValidationUtil.isEmpty(alertCalledVo.getAlertCalled()))
if (ValidationUtil.isEmpty(alertCalledObjsDto)
|| ValidationUtil.isEmpty(alertCalledObjsDto.getAlertCalled()))
throw new BadRequest("参数校验失败.");
ReginParams reginParams =
JSONObject.parseObject(null != redisUtils.get(buildKey(getToken())) ?
redisUtils.get(buildKey(getToken())).toString() : null, ReginParams.class);
//获取当前登录人公司
String name= reginParams.getCompany().getCompanyName();
AlertCalled alertCalled = alertCalledVo.getAlertCalled();
AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled();
alertCalled.setCompanyName(name);
alertCalledVo.setAlertCalled(alertCalled);
alertCalledVo =iAlertCalledService.createAlertCalled(alertCalledVo);
return ResponseHelper.buildResponse(alertCalledVo.getAlertCalled());
alertCalledObjsDto.setAlertCalled(alertCalled);
alertCalledObjsDto =iAlertCalledService.createAlertCalled(alertCalledObjsDto);
return ResponseHelper.buildResponse(alertCalledObjsDto.getAlertCalled());
}
/**
......@@ -141,7 +151,7 @@ public class AlertCalledController extends BaseController {
formValue.add(value);
}
}
AlertCalledFormVo alertCalledFormVo = new AlertCalledFormVo(alertCalled, formValue);
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalled, formValue);
redisUtils.set(RedisKey.ALERTCALLED_ID+id,JSON.toJSON(alertCalledFormVo),time);
return ResponseHelper.buildResponse(alertCalledFormVo);
......
......@@ -8,8 +8,8 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormInitDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormVo;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -110,7 +110,7 @@ public class AlertFormController extends BaseController {
@RequestMapping(value = "/form/{code}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据表态类型code查询表单数据项", notes = "根据表态类型code查询表单数据项")
public ResponseModel<Object> selectFormdItem(HttpServletRequest request, @PathVariable String code){
List<AlertFormVo> list=new ArrayList<AlertFormVo>();
List<AlertFormInitDto> list=new ArrayList<AlertFormInitDto>();
if(redisUtils.hasKey(RedisKey.FORM_CODE+code)){
Object obj= redisUtils.get(RedisKey.FORM_CODE+code);
return ResponseHelper.buildResponse(obj);
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireSystemDto;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.EquipmentServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -15,7 +11,12 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.EquipmentServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 装备服务接口
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import org.apache.commons.beanutils.BeanUtils;
import org.bouncycastle.crypto.RuntimeCryptoException;
import org.springframework.beans.factory.annotation.Autowired;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireChemicalDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.FireChemical;
import com.yeejoin.amos.boot.module.jcs.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.jcs.api.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireChemicalServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireStationServiceImpl;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
......@@ -55,7 +50,7 @@ public class ExcelController extends BaseController {
public void template(HttpServletResponse response,ExcelDto excelDto ) {
try {
String url=packageUrl+excelDto.getClassUrl();
Class clz = Class.forName(url);
Class<?> clz = Class.forName(url);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,clz, dataDictionaryMapper,true);
} catch (Exception e) {
e.printStackTrace();
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -28,13 +8,31 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireTeamCardDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireTeamListDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamListVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamVo;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -56,7 +54,7 @@ public class FireTeamController extends BaseController {
*
* @return
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增消防队伍", notes = "新增消防队伍")
public ResponseModel<Object> saveFireTeam(HttpServletRequest request, @RequestBody FireTeam fireTeam) {
......@@ -70,7 +68,7 @@ public class FireTeamController extends BaseController {
* @param id
* @return
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public ResponseModel<Object> deleteById(HttpServletRequest request, @PathVariable Long id) {
......@@ -78,13 +76,12 @@ public class FireTeamController extends BaseController {
return ResponseHelper.buildResponse(null);
}
/**
* 修改消防队伍
*
* @return
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改消防队伍", notes = "修改消防队伍")
public ResponseModel<Object> updateByIdFireTeam(HttpServletRequest request, @RequestBody FireTeam fireTeam) {
......@@ -93,31 +90,36 @@ public class FireTeamController extends BaseController {
}
/**
* 根据id查询
*
* @param id
* @return
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<FireTeam> selectById(HttpServletRequest request, @PathVariable Long id) {
return ResponseHelper.buildResponse(iFireTeamService.getById(id));
}
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getList", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "新列表分页查询", notes = "新表分页查询")
public ResponseModel<Page<FireTeamVo>> getFirefighters(Integer pageNum, Integer pageSize, FireTeamListVo fireTeamList) {
@ApiOperation(httpMethod = "GET", value = "新列表分页查询", notes = "新列表分页查询")
public ResponseModel<IPage<FireTeamCardDto>> getFireTeamByPage(@RequestParam Integer pageNum,
@RequestParam Integer pageSize,
FireTeamListDto fireTeamList) {
//条件分页
List<FireTeamVo> list = iFireTeamService.getFireTeam(pageNum, pageSize, fireTeamList);
Map<String, Long> num = iFireTeamService.getFireTeamCount(pageNum, pageSize, fireTeamList);
Page<FireTeamVo> pageBean = new Page<>(pageNum, pageSize, num.get("num"));
pageBean.setRecords(list);
return ResponseHelper.buildResponse(pageBean);
if (pageNum == null || pageSize == null) {
pageNum = 1;
pageSize = 10;
}
if (pageSize == -1) {
pageSize = Integer.MAX_VALUE;
}
Page<FireTeamCardDto> pageBean = new Page<>(pageNum, pageSize);
IPage<FireTeamCardDto> page = iFireTeamService.listFireTeamByPage(pageBean, fireTeamList);
return ResponseHelper.buildResponse(page);
}
......@@ -127,7 +129,7 @@ public class FireTeamController extends BaseController {
* @return
* @throws Exception
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/listTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "队伍树", notes = "队伍树")
public ResponseModel<List<Menu>> listTree() throws Exception {
......@@ -139,7 +141,6 @@ public class FireTeamController extends BaseController {
return ResponseHelper.buildResponse(menus);
}
/**
* 列表分页查询
*
......@@ -157,7 +158,7 @@ public class FireTeamController extends BaseController {
try {
field.setAccessible(true);
Object o = field.get(fireTeam);
if (o != null) {
if (o != null && !"serialVersionUID".equals(field)) {
Class<?> type = field.getType();
String name = NameUtils.camel2Underline(field.getName());
if (type.equals(Integer.class)) {
......@@ -187,20 +188,4 @@ public class FireTeamController extends BaseController {
page = iFireTeamService.page(pageBean, fireTeamQueryWrapper);
return page;
}
/**
* 查询消防力量信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/list_fire_team", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "查询消防力量信息", notes = "查询消防力量信息")
public List<FireTeamVo> list() {
List<FireTeam> list = iFireTeamService.list();
return null;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.alibaba.fastjson.JSON;
import java.util.Arrays;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -17,20 +34,9 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FirefightersContactsSer
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FirefightersEducationServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FirefightersPostServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FirefightersWorkexperienceServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
/**
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -25,8 +23,9 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.utils.ExcelUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgPersonDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgPersonFormDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrServiceImpl;
......@@ -55,7 +54,7 @@ public class OrgPersonController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增人员信息", notes = "新增人员信息")
public ResponseModel saveOrgUsr(HttpServletRequest request, @RequestBody OrgPersonDto OrgPersonVo) throws Exception {
public ResponseModel<?> saveOrgUsr(HttpServletRequest request, @RequestBody OrgPersonDto OrgPersonVo) throws Exception {
OrgPersonVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
iOrgUsrService.saveOrgPerson(OrgPersonVo);
return ResponseHelper.buildResponse(null);
......@@ -70,7 +69,7 @@ public class OrgPersonController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public ResponseModel deleteById(HttpServletRequest request, @PathVariable Long id) {
public ResponseModel<?> deleteById(HttpServletRequest request, @PathVariable Long id) {
// 删除时,只作逻辑删除
iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
return ResponseHelper.buildResponse(null);
......@@ -84,7 +83,7 @@ public class OrgPersonController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据")
public ResponseModel updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgPersonDto OrgPersonVo, @PathVariable Long id) throws Exception {
public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgPersonDto OrgPersonVo, @PathVariable Long id) throws Exception {
OrgPersonVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
iOrgUsrService.updateByIdOrgPerson(OrgPersonVo,id);
return ResponseHelper.buildResponse(null);
......@@ -102,7 +101,7 @@ public class OrgPersonController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取人员详情", notes = "获取人员详情")
public ResponseModel selectById(HttpServletRequest request, @PathVariable Long id) throws Exception {
public ResponseModel<OrgPersonFormDto> selectById(HttpServletRequest request, @PathVariable Long id) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.selectPersonById(id));
}
......@@ -116,7 +115,7 @@ public class OrgPersonController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}/detail", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取人员详情", notes = "获取人员详情")
public ResponseModel selectByIdDetail(HttpServletRequest request, @PathVariable Long id) throws Exception {
public ResponseModel<OrgPersonFormDto> selectByIdDetail(HttpServletRequest request, @PathVariable Long id) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.selectPersonByIdDetail(id));
}
......@@ -129,7 +128,7 @@ public class OrgPersonController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/show/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取人员详情(map类型)", notes = "获取人员详情")
public ResponseModel selectForShowById(HttpServletRequest request, @PathVariable Long id) throws Exception {
public ResponseModel<Map<String, Object>> selectForShowById(HttpServletRequest request, @PathVariable Long id) throws Exception {
OrgUsr orgUsr = iOrgUsrService.getById(id);
Map<String, Object> result = iOrgUsrService.selectForShowById(orgUsr, id);
return ResponseHelper.buildResponse(result);
......@@ -145,7 +144,7 @@ public class OrgPersonController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取人员树", notes = "获取人员树")
public ResponseModel selectPersonTree() throws Exception {
public ResponseModel<List<OrgMenuDto> > selectPersonTree() throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.selectPersonTree());
}
......@@ -170,7 +169,7 @@ public class OrgPersonController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{orgCode}/users", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据orgCode查询", notes = "根据orgCode查询")
public ResponseModel selectUsersByOrgCode(HttpServletRequest request, String pageNum, String pageSize, @PathVariable Long orgCode) {
public ResponseModel<Collection<OrgUsr>> selectUsersByOrgCode(HttpServletRequest request, String pageNum, String pageSize, @PathVariable Long orgCode) {
Map<String, Object> columnMap = new HashMap<>();
columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_code", orgCode);
......@@ -188,8 +187,8 @@ public class OrgPersonController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/download-template", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "导出人员模板", notes = "导出人员模板")
public ResponseModel downloadTemplate(HttpServletResponse response) throws UnsupportedEncodingException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
public ResponseModel<?> downloadTemplate(HttpServletResponse response) throws UnsupportedEncodingException {
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
// List<OrgUsrDownloadTemplateVO> OrgUsrDownloadTemplateVO = new ArrayList<OrgUsrDownloadTemplateVO>();
// ExcelUtils.exportExcel(OrgUsrDownloadTemplateVO, "人员信息", "人员信息", OrgUsrDownloadTemplateVO.class, simpleDateFormat.format(new Date()) + ".xls", response);
return ResponseHelper.buildResponse(null);
......@@ -203,7 +202,7 @@ public class OrgPersonController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/savePerson", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "导入人员信息", notes = "导入人员信息")
public ResponseModel savePerson(HttpServletRequest request, @RequestBody List<OrgPersonDto> OrgPersonVo) throws Exception {
public ResponseModel<?> savePerson(HttpServletRequest request, @RequestBody List<OrgPersonDto> OrgPersonVo) throws Exception {
iOrgUsrService.savePersonList(OrgPersonVo);
return ResponseHelper.buildResponse(null);
}
......@@ -217,7 +216,7 @@ public class OrgPersonController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/showPersonList/{ids}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取人员列表详情(map类型)", notes = "获取人员详情")
public ResponseModel selectForShowByListId(HttpServletRequest request, @PathVariable List<Long> ids) throws Exception {
public ResponseModel<List<Map<String, Object>> > selectForShowByListId(HttpServletRequest request, @PathVariable List<Long> ids) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.selectForShowByListId(ids)
);
}
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
......@@ -28,6 +29,7 @@ import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgDepartmentDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrServiceImpl;
......@@ -60,7 +62,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增单位信息", notes = "新增单位信息")
public ResponseModel saveOrgUsr(HttpServletRequest request, @RequestBody OrgUsrDto OrgUsrVo) throws Exception {
public ResponseModel<?> saveOrgUsr(HttpServletRequest request, @RequestBody OrgUsrDto OrgUsrVo) throws Exception {
OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
iOrgUsrService.saveOrgUsr(OrgUsrVo);
return ResponseHelper.buildResponse(null);
......@@ -75,7 +77,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public ResponseModel deleteById(HttpServletRequest request, @PathVariable Long id) {
public ResponseModel<?> deleteById(HttpServletRequest request, @PathVariable Long id) {
// 删除时,只作逻辑删除
iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
return ResponseHelper.buildResponse(null);
......@@ -90,7 +92,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据")
public ResponseModel updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgUsrDto OrgUsrVo, @PathVariable Long id) throws Exception {
public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgUsrDto OrgUsrVo, @PathVariable Long id) throws Exception {
OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
iOrgUsrService.updateByIdOrgUsr(OrgUsrVo,id);
return ResponseHelper.buildResponse(null);
......@@ -106,7 +108,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取单位详情", notes = "获取单位详情")
public ResponseModel selectById(HttpServletRequest request, @PathVariable Long id) throws Exception {
public ResponseModel<OrgUsrFormDto> selectById(HttpServletRequest request, @PathVariable Long id) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.selectCompanyById(id));
}
......@@ -120,7 +122,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/selectByBizOrgType/{bizOrgType}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据bizOrgType分页查询", notes = "根据bizOrgType分页查询")
public ResponseModel bizOrgTypeListPage(String pageNum, String pageSize, @PathVariable String bizOrgType) throws Exception {
public ResponseModel<IPage<OrgUsr>> bizOrgTypeListPage(String pageNum, String pageSize, @PathVariable String bizOrgType) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.page( iOrgUsrService.bizOrgTypeListPage(pageNum,pageSize,bizOrgType)));
}
......@@ -149,7 +151,7 @@ public class OrgUsrController extends BaseController {
@RequestMapping(value = "/orgTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取单位部门树(bizOrgCode为物理主键)", notes = "获取单位部门树(bizOrgCode为物理主键)\"")
public ResponseModel< List<OrgMenuDto>>selectCompanyTreeCode() throws Exception {
List<OrgMenuDto> menus = iOrgUsrService.buildTreeParallel(iOrgUsrService.selectCompanyDepartmentMsg());
List<OrgMenuDto> menus = OrgUsrServiceImpl.buildTreeParallel(iOrgUsrService.selectCompanyDepartmentMsg());
return ResponseHelper.buildResponse(menus);
}
......@@ -209,7 +211,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/saveDepartment", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "导入部门信息", notes = "导入部门信息")
public ResponseModel saveDepartment(HttpServletRequest request, @RequestBody List<OrgDepartmentDto> OrgDepartmentVo, @PathVariable Long id) throws Exception {
public ResponseModel<?> saveDepartment(HttpServletRequest request, @RequestBody List<OrgDepartmentDto> OrgDepartmentVo, @PathVariable Long id) throws Exception {
iOrgUsrService.saveDepartment(OrgDepartmentVo,id);
return ResponseHelper.buildResponse(null);
}
......@@ -222,7 +224,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/saveCompany", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "导入单位信息", notes = "导入单位信息")
public ResponseModel saveCompany(HttpServletRequest request, @RequestBody List<OrgUsrDto> OrgUsrVo) throws Exception {
public ResponseModel<?> saveCompany(HttpServletRequest request, @RequestBody List<OrgUsrDto> OrgUsrVo) throws Exception {
iOrgUsrService.saveCompany(OrgUsrVo);
return ResponseHelper.buildResponse(null);
}
......@@ -236,7 +238,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{ids}/users", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id获取单位人员列表", notes = "根据id获取单位人员列表")
public ResponseModel selectUsersByOrgCode(HttpServletRequest request, @PathVariable List<Long> ids) throws Exception {
public ResponseModel<List<Map<String, Object>> > selectUsersByOrgCode(HttpServletRequest request, @PathVariable List<Long> ids) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.returnCompanyPersonMsg(ids)) ;
}
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -12,14 +14,12 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
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.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import javax.annotation.Resource;
/**
* 警情接警记录 服务实现类
......@@ -53,10 +53,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
* @return
*/
@Transactional
public AlertCalledVo createAlertCalled(AlertCalledVo alertCalledVo) {
public AlertCalledObjsDto createAlertCalled(AlertCalledObjsDto alertCalledObjsDto) {
try {
// 警情基本信息
AlertCalled alertCalled = alertCalledVo.getAlertCalled();
AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled();
alertCalled.setCallTime(new Date());
if(AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())||
AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())){
......@@ -74,7 +74,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalled.setAlarmTypeCode(AlertStageEnums.JQGB.getCode());
this.save(alertCalled);
// 动态表单
List<AlertFormValue> alertFormValuelist = alertCalledVo.getAlertFormValue();
List<AlertFormValue> alertFormValuelist = alertCalledObjsDto.getAlertFormValue();
// 填充警情主键
alertFormValuelist.stream().forEach(alertFormValue -> {
alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr());
......@@ -93,7 +93,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
this.save(alertCalled);
// 动态表单
List<AlertFormValue> alertFormValuelist = alertCalledVo.getAlertFormValue();
List<AlertFormValue> alertFormValuelist = alertCalledObjsDto.getAlertFormValue();
// 填充警情主键
alertFormValuelist.stream().forEach(alertFormValue -> {
alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr());
......@@ -101,10 +101,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
});
// 保存动态表单数据
iAlertFormValueService.saveBatch(alertFormValuelist);
alertCalledVo.setAlertCalled(alertCalled);
alertCalledVo.setAlertFormValue(alertFormValuelist);
alertCalledObjsDto.setAlertCalled(alertCalled);
alertCalledObjsDto.setAlertFormValue(alertFormValuelist);
//调用规则
ruleAlertCalledService.fireAlertCalledRule(alertCalledVo);
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto);
}
......@@ -113,7 +113,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
*/
eSAlertCalledService.saveAlertCalledToES(alertCalled);
return alertCalledVo;
return alertCalledObjsDto;
} catch (Exception e) {
throw new RuntimeException("报送失败,系统异常!");
}
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormInitDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertListvalue;
import com.yeejoin.amos.boot.module.jcs.api.dto.Items;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertForm;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.DataDictionary;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertListvalue;
import com.yeejoin.amos.boot.module.jcs.api.vo.Items;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -28,23 +29,23 @@ import java.util.stream.Collectors;
* @date 2021-06-17
*/
@Service
public class AlertFormServiceImpl extends BaseService<AlertFromDto,AlertForm,AlertFormMapper> implements IAlertFormService{
public class AlertFormServiceImpl extends BaseService<AlertFormDto,AlertForm,AlertFormMapper> implements IAlertFormService{
@Autowired
DataDictionaryServiceImpl iDataDictionaryService;
public List<AlertFormVo> getFormlist(String code) {
public List<AlertFormInitDto> getFormlist(String code) {
QueryWrapper<AlertForm> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_type_code", code);
queryWrapper.orderByAsc("sort_num");
List<AlertForm> alertFormValue = this.list(queryWrapper);
List<AlertFormVo> listfrom = new ArrayList<AlertFormVo>();
List<AlertFormInitDto> listfrom = new ArrayList<AlertFormInitDto>();
// 组装数据
for (AlertForm alertFrom : alertFormValue) {
if(alertFrom.getFieldType().equals("string")||alertFrom.getFieldType().equals("datetime")||alertFrom.getFieldType().equals("textarea")||alertFrom.getFieldType().equals("inputBitmap")) {
AlertFormVo vo = new AlertFormVo(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(), null);
AlertFormInitDto vo = new AlertFormInitDto(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(), null);
AlertFormValue alertFormValu= new AlertFormValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode(),alertFrom.getBlock(), alertFrom.getAlertTypeCode(),null, null);
if(alertFrom.getFieldType().equals("datetime")) {
......@@ -63,7 +64,7 @@ public class AlertFormServiceImpl extends BaseService<AlertFromDto,AlertForm,Ale
queryWrappercolumnMap.orderByAsc("sort_num");
Collection<DataDictionary> listDataDictionary = iDataDictionaryService.list(queryWrappercolumnMap);
List<AlertListvalue> list=getdata(listDataDictionary);
AlertFormVo vo = new AlertFormVo(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(), new Items(list));
AlertFormInitDto vo = new AlertFormInitDto(alertFrom.getFieldCode(), alertFrom.getFieldName(), alertFrom.getFieldType(), new Items(list));
AlertFormValue alertFormValu= new AlertFormValue(alertFrom.getSequenceNbr(),alertFrom.getFieldName(), alertFrom.getFieldCode(),alertFrom.getBlock(), alertFrom.getAlertTypeCode(),null, null);
......@@ -94,7 +95,7 @@ public class AlertFormServiceImpl extends BaseService<AlertFromDto,AlertForm,Ale
return this.queryListByTypeCode(typeCode).stream().map(c -> c.getFieldCode()).collect(Collectors.toList());
}
public List<AlertFromDto> queryListByTypeCode(String alertTypeCode) {
public List<AlertFormDto> queryListByTypeCode(String alertTypeCode) {
return this.queryForList(null, false, alertTypeCode);
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromTypeDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormTypeDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormType;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormTypeMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormTypeService;
......@@ -15,6 +15,6 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
* @date 2021-06-17
*/
@Service
public class AlertFormTypeServiceImpl extends BaseService<AlertFromTypeDto, AlertFormType,AlertFormTypeMapper> implements IAlertFormTypeService {
public class AlertFormTypeServiceImpl extends BaseService<AlertFormTypeDto, AlertFormType,AlertFormTypeMapper> implements IAlertFormTypeService {
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormValueMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormValueDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertFormValueMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
/**
* 服务实现类
*
......@@ -19,16 +18,16 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
* @date 2021-06-17
*/
@Service
public class AlertFormValueServiceImpl extends BaseService<AlertFromValueDto,AlertFormValue,AlertFormValueMapper> implements IAlertFormValueService {
public class AlertFormValueServiceImpl extends BaseService<AlertFormValueDto,AlertFormValue,AlertFormValueMapper> implements IAlertFormValueService {
@Autowired
private AlertFormValueMapper alertFormValueMapper;
public List<AlertFromValueDto> queryByCalledId(Long alertCalledId) {
public List<AlertFormValueDto> queryByCalledId(Long alertCalledId) {
return this.queryForList(null, false, alertCalledId);
}
public List<AlertFormValueVo> listByCalledId(Long id) {
public List<AlertFormValueDto> listByCalledId(Long id) {
return alertFormValueMapper.selectListByCalledId(id);
}
......
......@@ -28,8 +28,10 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateExtendDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
......@@ -45,10 +47,8 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedExtVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertSubmittedSMSVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferCompanyVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.SchedulingReportingVo;
import com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction;
......@@ -138,7 +138,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Long alertSubmittedId = saveAlertSubmitted(alertSubmittedDto, userName);
// 组装规则入参
AlertCalled alertCalled = alertCalledService.getById(alertSubmittedDto.getAlertCalledId());
AlertCalledVo alertCalledVo = new AlertCalledVo();
AlertCalledObjsDto alertCalledVo = new AlertCalledObjsDto();
alertCalledVo.setAlertCalled(alertCalled);
List<AlertFormValue> alertFormValue = new ArrayList<>();
AlertFormValue formValue = new AlertFormValue();
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireBrigadeResourceDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireTeamCardDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireTeamDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireTeamListDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.jcs.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IFireTeamService;
import com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamListVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FireTeamVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 消防队伍 服务实现类
......@@ -25,18 +32,9 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam,FireT
@Autowired
FireTeamMapper fireTeamMapper;
@Override
public List<FireTeamVo> getFireTeam(int pageNum, int pageSize, FireTeamListVo par) {
// TODO Auto-generated method stub
return fireTeamMapper.getFireTeam( pageNum, pageSize, par) ;
}
@Override
public Map<String, Long> getFireTeamCount(int pageNum, int pageSize, FireTeamListVo par) {
// TODO Auto-generated method stub
return fireTeamMapper.getFireTeamCount( pageNum, pageSize, par) ;
}
@Autowired
EquipFeignClient equipFeignClient;
/**
* 获取监控大队列表
......@@ -46,4 +44,35 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam,FireT
public List<FireBrigadeResourceDto> listMonitorFireBrigade() {
return fireTeamMapper.listMonitorFireBrigade();
}
/**
* 消防队伍分页查询
*
* @param page 分页对象
* @param team 查询参数
* @return
*/
public IPage<FireTeamCardDto> listFireTeamByPage(Page page, FireTeamListDto team) {
// 获取消防车辆列表
ResponseModel<Object> result = equipFeignClient.getFireCarListAll();
Map<Object, Long> teamCarCountMap = Maps.newConcurrentMap();
if (!ValidationUtil.isEmpty(result)) {
List<Map<String, Object>> fireCarListMapList = (List<Map<String, Object>>) result.getResult();
if (!ValidationUtil.isEmpty(fireCarListMapList)) {
teamCarCountMap =
fireCarListMapList.stream().filter(car -> !ValidationUtil.isEmpty(car.get("teamId"))).collect(Collectors.groupingBy(car -> car.get(
"teamId"), Collectors.counting()));
}
}
IPage<FireTeamCardDto> fireTeamListPage = this.baseMapper.getFireTeamForPage(page, team);
List<FireTeamCardDto> fireTeamList = fireTeamListPage.getRecords();
Map<Object, Long> finalTeamCarCountMap = teamCarCountMap;
fireTeamList.forEach(t -> {
if (!ValidationUtil.isEmpty(finalTeamCarCountMap.get(t.getSequenceNbr().toString()))) {
t.setCarNum(finalTeamCarCountMap.get(t.getSequenceNbr().toString()).intValue());
}
});
fireTeamListPage.setRecords(fireTeamList);
return fireTeamListPage;
}
}
......@@ -24,8 +24,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertFormValueDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgDepartmentDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgDepartmentFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgMenuDto;
......@@ -39,8 +40,6 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.jcs.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.FormValue;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -315,9 +314,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public List<FormValue> getFormValue(Long id) throws Exception {
// 动态表单数据
List<AlertFormValueVo> list = alertFormValueServiceImpl.listByCalledId(id);
List<AlertFormValueDto> list = alertFormValueServiceImpl.listByCalledId(id);
List<FormValue> formValue = new ArrayList<>();
for (AlertFormValueVo alertFormValue : list) {
for (AlertFormValueDto alertFormValue : list) {
if (alertFormValue.getFieldValueCode() == null) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValue(), alertFormValue.getBlock());
......@@ -333,9 +332,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public List<FormValue> getFormValueDetail(Long id) throws Exception {
// 动态表单数据
List<AlertFormValueVo> list = alertFormValueServiceImpl.listByCalledId(id);
List<AlertFormValueDto> list = alertFormValueServiceImpl.listByCalledId(id);
List<FormValue> formValue = new ArrayList<>();
for (AlertFormValueVo alertFormValue : list) {
for (AlertFormValueDto alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), alertFormValue.getFieldType(),
alertFormValue.getFieldValue(), alertFormValue.getBlock());
formValue.add(value);
......@@ -413,10 +412,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
alertFromValuelist.stream().forEach(alertFromValue -> {
alertFromValue.setAlertCalledId(orgUsr.getSequenceNbr());
});
List<AlertFromValueDto> formList = alertFormValueServiceImpl.queryByCalledId(orgUsr.getSequenceNbr());
List<AlertFormValueDto> formList = alertFormValueServiceImpl.queryByCalledId(orgUsr.getSequenceNbr());
if (formList != null && formList.size() > 0) {
for (AlertFormValue dis : alertFromValuelist) {
for (AlertFromValueDto src : formList) {
for (AlertFormValueDto src : formList) {
if (dis.getAlertFormId() == src.getAlertFormId()) {
dis.setSequenceNbr(src.getSequenceNbr());
dis.setRecDate(new Date());
......@@ -432,7 +431,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 保存动态表单数据
alertFormValueServiceImpl.updateBatchById(alertFromValuelist);
List<AlertFromDto> form = alertFormServiceImpl.queryListByTypeCode(formList.get(0).getAlertTypeCode());
List<AlertFormDto> form = alertFormServiceImpl.queryListByTypeCode(formList.get(0).getAlertTypeCode());
if (form.size() != alertFromValuelist.size()) {
......@@ -440,7 +439,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
for (AlertFormValue dis : alertFromValuelist) {
boolean exist = false;
for (AlertFromValueDto src : formList) {
for (AlertFormValueDto src : formList) {
if (dis.getAlertFormId() == src.getSequenceNbr()) {
exist = true;
break;
......@@ -470,7 +469,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
queryWrapper.eq("alert_type_code",OrgPersonEnum.人员.getCode());
List<AlertForm> alertForms = alertFormServiceImpl.list(queryWrapper);
// 动态表单数据
List<AlertFormValueVo> list = alertFormValueServiceImpl.listByCalledId(id);
List<AlertFormValueDto> list = alertFormValueServiceImpl.listByCalledId(id);
Map<String, Object> result = new HashMap<>();
result = Bean.BeantoMap(orgUsr);
result.put("parenName",getById(orgUsr.getParentId()).getBizOrgName());
......@@ -478,7 +477,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
for (AlertForm alertForm : alertForms) {
result.put(alertForm.getFieldCode(), null);
}
for (AlertFormValueVo alertFormValue : list) {
for (AlertFormValueDto alertFormValue : list) {
result.replace(alertFormValue.getFieldCode(), alertFormValue.getFieldValue());
}
return result;
......
......@@ -4,14 +4,13 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertCalledVo;
import com.yeejoin.amos.component.rule.RuleTrigger;
/**
......@@ -39,7 +38,7 @@ public class RuleAlertCalledService {
* @return
* @throws Exception
*/
public Boolean fireAlertCalledRule(AlertCalledVo alertCalledVo) throws Exception
public Boolean fireAlertCalledRule(AlertCalledObjsDto alertCalledVo) throws Exception
{
AlertCalled alertCalled = alertCalledVo.getAlertCalled();
if (ValidationUtil.isEmpty(alertCalled))
......
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