Commit 6225538e authored by maoying's avatar maoying

Merge branch 'develop_dl_3.7.0.7' into temp

parents bb98a2a0 64bc5d1b
......@@ -81,7 +81,7 @@ public class ControllerAop {
// 不需要添加请求头的接口
String[] url = new String[]{"/api/user/save/curCompany", "/jcs/command/lookHtmlText",
"/jcs/common/duty-person/findByDutyAreaId", "/tzs/wechatBack", "/tzs/elevator/getElevatorInfo",
"/openapi/bizToken/applyToken","/fire-patrol-report/download","/fire-patrol-report/allPage"};
"/openapi/bizToken/applyToken","/fire-patrol-report/download","/fire-patrol-report/allPage","/jcs/common/duty-person/new-duty-detail","/equip/car/state/info"};
// 获取请求路径
for (String uri : url) {
if (request.getRequestURI().indexOf(uri) != -1) {
......
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
*
*
* 请求参数类
*
*/
@Data
@ApiModel(value="请求参数类", description="人员请求参数类")
public class OrgUserVO {
@ApiModelProperty(value = "关联应用appkey")
private List<String> appCodes;
@ApiModelProperty(value = "平台单位id")
private String companySeqs;
@ApiModelProperty(value = "平台部门id")
private String deptSeqs;
@ApiModelProperty(value = "邮箱")
private String email;
@ApiModelProperty(value = "固话号码")
private String landlinePhone;
@ApiModelProperty(value = "是否启用")
private String lockStatus;
@ApiModelProperty(value = "手机号码")
private String mobile;
@ApiModelProperty(value = "组装参数")
private Map<String,List<String>> orgRoleSeqs;
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "二次密码")
private String rePassword;
@ApiModelProperty(value = "姓名")
private String realName;
@ApiModelProperty(value = "角色权限")
private List<String> roleSeqs;
@ApiModelProperty(value = "用户名")
private String userName;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 机构/部门/人员表
*
* @author tb
* @date 2021-06-18
*/
@Data
@ApiModel(value="UserVO", description="平台信息")
public class UserVO {
/*************************平台***********************/
@ExcelIgnore
@ApiModelProperty(value = "关联应用appkey")
private List<String> appCodes;
@ApiModelProperty(value = "角色权限")
private List<String> roleSeqs;
@ApiModelProperty(value = "平台权限组id")
private String group;
@ApiModelProperty(value = "类型")
private String type;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author system_generator
* @date 2021-06-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "WaterBaseResourceDto", description = "水资源")
public class WaterBaseResourceDto extends BaseDto {
@ExcelIgnore
@ApiModelProperty(value = "机构/部门名称")
private String bizOrgName;
@ExcelIgnore
@ApiModelProperty(value = "机构编码")
private String bizOrgCode;
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "名称", index = 0)
@ApiModelProperty(value = "资源名称")
private String name;
@ExcelProperty(value = "地址", index = 1)
@ApiModelProperty(value = "地址")
private String address;
@ExcelIgnore
@ApiModelProperty(value = "资源类型(消火栓:hydrant、消防水鹤:crane、天然水源:natural、消防水池:pool)")
private String resourceType;
@ExplicitConstraint(type = "XFSYLX", indexNum = 2, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "资源类型", index = 2)
@ApiModelProperty(value = "资源类型名称(消火栓、消防水鹤、天然水源、消防水池)")
private String resourceTypeName;
@ExcelIgnore
@ApiModelProperty(value = "所在建筑id")
private Long belongBuildingId;
@ExplicitConstraint(indexNum = 3, sourceClass = CommonExplicitConstraint.class, method = "getWaterBuildingList")
@ExcelProperty(value = "所在建筑", index = 3)
@ApiModelProperty(value = "所在建筑")
private String belongBuilding;
@ExcelIgnore
@ApiModelProperty(value = "所属消防系统id")
private Long belongFightingSystemId;
@ExplicitConstraint(indexNum = 4, sourceClass = CommonExplicitConstraint.class, method = "getFireSystemList")
@ExcelProperty(value = "所属消防系统", index = 4)
@ApiModelProperty(value = "所属消防系统")
private String belongFightingSystem;
@ExcelIgnore
@ApiModelProperty("设施定义id")
private Long equipId;
@ApiModelProperty("设施定义名称")
@ExcelProperty(value = "设施定义名称", index = 5)
@ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getEquipDefinition")
private String equipName;
@ExcelIgnore
@ApiModelProperty("设施分类id")
private Long equipCategoryId;
@ApiModelProperty("维保周期")
@ExcelProperty(value = "维保周期(月)", index = 6)
private String maintenancePeriod;
@ExcelProperty(value = "建造日期", index = 7)
@ApiModelProperty(value = "建造日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date buildDate;
@ExcelProperty(value = "启用日期", index = 8)
@ApiModelProperty(value = "启用日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date enableDate;
@ExcelIgnore
@ApiModelProperty(value = "管理单位id")
private Long managementUnitId;
@ExplicitConstraint(indexNum = 9, sourceClass = CommonExplicitConstraint.class, method = "getWaterCompanyList")
@ExcelProperty(value = "管理单位", index = 9)
@ApiModelProperty(value = "管理单位")
private String managementUnit;
@ExcelIgnore
@ApiModelProperty(value = "维保单位id")
private Long maintenanceUnitId;
@ExplicitConstraint(indexNum = 10, sourceClass = CommonExplicitConstraint.class, method = "getCompanyList")
@ExcelProperty(value = "维保单位", index = 10)
@ApiModelProperty(value = "维保单位")
private String maintenanceUnit;
@ExplicitConstraint(indexNum =11, sourceClass = CommonExplicitConstraint.class, method = "getContactUser")
@ExcelProperty(value = "联系人姓名", index = 11)
@ApiModelProperty(value = "联系人姓名")
private String contactUser;
/**
* 联系人姓名id
*/
@ExcelIgnore
@TableField("contact_user_id")
private String contactUserId;
@ExcelProperty(value = "联系人电话", index = 12)
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ApiModelProperty(value = "经度")
@ExcelProperty(value = "经度", index = 13)
private Double longitude;
@ApiModelProperty(value = "纬度")
@ExcelProperty(value = "纬度", index = 14)
private Double latitude;
@ExcelIgnore
@ApiModelProperty(value = "是否有物联参数(1有,0没有)")
private Boolean isIot;
@ExcelIgnore
@ApiModelProperty(value = "消防救援机构_通用唯一识别码")
private String rescueOrgCode;
@ExcelIgnore
@ApiModelProperty(value = "行政区划代码")
private String administrativeCode;
@ExcelIgnore
@ApiModelProperty(value = "更新人员")
private String recUserName;
@ExcelIgnore
@ApiModelProperty(value = "组织机构代码")
private String orgCode;
@ExcelIgnore
@ApiModelProperty(value = "资源id")
private Long resourceId;
// 物联参数改为动态加载,原先字段作废,字段做隐藏
@ExcelIgnore
@ApiModelProperty(value = "储水量容积物联编码")
private String iotWaterStorage;
@ExcelIgnore
@ApiModelProperty(value = "流量物联编码")
private String iotFlowRate;
@ExcelIgnore
@ApiModelProperty(value = "状态物联编码")
private String iotStatus;
// BUG 2920 管网压力字段冗余 2021-09-18 陈召
@ExcelIgnore
@ApiModelProperty(value = "管网压力物联编码")
private String iotPipePressure;
@ExcelIgnore
@ApiModelProperty(value = "物联参数")
private Map<String, Object> waterResourceIotDto;
// BUG 2935 优化项 分类从93060000 取得字典数据 by kongfm 2021-09-17
@ApiModelProperty("设施分类名称")
@ExcelIgnore
private String equipCategoryName;
@ApiModelProperty("设施分类编码")
@ExcelIgnore
private String equipCategoryCode;
@ApiModelProperty("设施编码")
@ExcelIgnore
private String equipCode;
@ExcelIgnore
@ApiModelProperty(value = "附件")
@TableField(exist = false)
private Map<String, List<AttachmentDto>> attachments;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author system_generator
* @date 2021-06-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "WaterExcelCraneDto", description = "消防水鹤")
public class WaterExcelCraneDto extends WaterBaseResourceDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "高度(cm)", index = 15)
@ApiModelProperty(value = "高度(cm)")
private Float height;
@ExcelProperty(value = "供水单位名称", index = 16)
@ApiModelProperty(value = "供水单位名称")
private String waterSupplyName;
@ExcelProperty(value = "所属管网", index = 17)
@ApiModelProperty(value = "所属管网")
private String pipeNetwork;
@ExcelIgnore
@ApiModelProperty(value = "消防给水管网形式类型代码")
private String pipeTypeCode;
@ExplicitConstraint(type = "XFJSGW", indexNum = 18, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "消防给水管网形式", index = 18)
@ApiModelProperty(value = "消防给水管网形式")
private String pipeTypeName;
@ExcelProperty(value = "管网直径(cm)", index = 19)
@ApiModelProperty(value = "管网直径(cm)")
private Float pipeDiameter;
@ExcelProperty(value = "加水车道数量(个)", index = 20)
@ApiModelProperty(value = "加水车道数量(个)")
private Integer waterfillingLaneNum;
@ExcelProperty(value = "进水管直径(cm)", index = 21)
@ApiModelProperty(value = "进水管直径(cm)")
private Float inletPipeDiameter;
@ExcelProperty(value = "出水管直径(cm)", index = 22)
@ApiModelProperty(value = "出水管直径(cm)")
private Float outletPipeDiameter;
@ExcelIgnore
@ApiModelProperty(value = "水源可用状态类别代码")
private String statusCode;
@ExplicitConstraint(type = "SYZT", indexNum = 23, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "水源可用状态", index = 23)
@ApiModelProperty(value = "水源可用状态类别名称")
private String status;
@ExcelProperty(value = "所属路段", index = 24)
@ApiModelProperty(value = "所属路段")
private String section;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author system_generator
* @date 2021-06-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "WaterExcelHydrantDto", description = "消火栓")
public class WaterExcelHydrantDto extends WaterBaseResourceDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "所属管网", index = 24)
@ApiModelProperty(value = "所属管网")
private String pipeNetwork;
@ExcelIgnore
@ApiModelProperty(value = "消防给水管网形式类型代码")
private String pipeTypeCode;
@ExplicitConstraint(type = "XFJSGW", indexNum = 25, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "消防给水管网形式", index = 25)
@ApiModelProperty(value = "消防给水管网形式")
private String pipeTypeName;
@ExcelProperty(value = "管网直径(cm)", index = 15)
@ApiModelProperty(value = "管网直径(cm)")
private Float pipeDiameter;
@ExplicitConstraint(type = "XHSXTLX", indexNum = 16, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "消火栓系统类型", index = 16)
@ApiModelProperty(value = "消火栓系统类型")
private String systemType;
@ExcelIgnore
@ApiModelProperty(value = "消火栓系统类型code")
private String systemTypeCode;
@ExcelProperty(value = "消火栓类型", index = 17)
@ExplicitConstraint(type = "HSLX", indexNum = 17, sourceClass = CommonExplicitConstraint.class)
@ApiModelProperty(value = "消火栓类型")
@TableField(exist = false)
private String hydrantType;
@ExplicitConstraint(type = "XHSFZXS", indexNum = 18, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "消火栓放置形式", index = 18)
@ApiModelProperty(value = "消火栓放置形式")
private String placeForm;
@ExcelIgnore
@ApiModelProperty(value = "消火栓放置形式code")
private String placeFormCode;
@ExplicitConstraint(type = "XFSDJK", indexNum = 21, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "消防水带接口", index = 21)
@ApiModelProperty(value = "消防水带接口")
private String hoseConnection;
@ExcelIgnore
@ApiModelProperty(value = "消防水带接口code")
private String hoseConnectionCode;
@ExplicitConstraint(type = "QSXS", indexNum = 20, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "取水形式", index = 20)
@ApiModelProperty(value = "取水形式")
private String intakeForm;
@ExcelProperty(value = "供水单位名称", index = 19)
@ApiModelProperty(value = "供水单位名称")
private String waterSupplyName;
@ExcelProperty(value = "道路路口路段", index = 22)
@ApiModelProperty(value = "道路路口路段简要情况")
private String roadJunctionInfo;
@ExcelProperty(value = "消防设施状况", index = 23)
@ApiModelProperty(value = "消防设施状况分类")
private String facilitiesCategory;
@ExcelIgnore
@ApiModelProperty(value = "消防设施状况分类code")
private String facilitiesCategoryCode;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author system_generator
* @date 2021-06-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "WaterExcelIndustryPoolDto", description = "工业水池")
public class WaterExcelIndustryPoolDto extends WaterBaseResourceDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelIgnore
@ApiModelProperty(value = "水源可用状态类别代码")
private String statusCode;
@ExplicitConstraint(type = "SYZT", indexNum = 15, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "水源可用状态", index = 15)
@ApiModelProperty(value = "水源可用状态类别名称")
private String status;
@ExcelProperty(value = "容积(m³)", index = 16)
@ApiModelProperty(value = "容积(m³)")
private Float volume;
@ExplicitConstraint(type = "QSXS", indexNum = 17, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "取水形式", index = 17)
@ApiModelProperty(value = "取水形式")
private String intakeForm;
@ExcelProperty(value = "取水高度(cm)", index = 18)
@ApiModelProperty(value = "取水高度(cm)")
private Float intakeHeight;
@ExcelProperty(value = "水源标高差(cm)", index = 19)
@ApiModelProperty(value = "水源标高差(cm)")
private Float elevationDifference;
@ExcelProperty(value = "所属路段", index = 20)
@ApiModelProperty(value = "所属路段")
private String section;
@ExcelProperty(value = "停车位置", index = 21)
@ApiModelProperty(value = "停车位置")
private String parkingPosition;
@ExcelProperty(value = "停车数量(个)", index = 22)
@ApiModelProperty(value = "停车数量(个)")
private int parkingNum;
@ExcelIgnore
@ApiModelProperty(value = "消防给水管网形式类型代码")
private String pipeTypeCode;
@ExplicitConstraint(type = "XFJSGW", indexNum = 23, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "消防给水管网形式", index = 23)
@ApiModelProperty(value = "消防给水管网形式")
private String pipeTypeName;
@ExcelProperty(value = "供水单位名称", index = 24)
@ApiModelProperty(value = "供水单位名称")
private String waterSupplyName;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author system_generator
* @date 2021-06-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "WaterExcelNaturalDto", description = "天然水源")
public class WaterExcelNaturalDto extends WaterBaseResourceDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "高度(cm)", index = 15)
@ApiModelProperty(value = "高度(cm)")
private Float height;
@ExcelIgnore
@ApiModelProperty(value = "水源类型代码")
private String typeCode;
@ExplicitConstraint(type = "TRSYLX", indexNum = 16, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "水源类型", index = 16)
@ApiModelProperty(value = "水源类型")
private String type;
@ExcelProperty(value = "容积(m³)", index = 17)
@ApiModelProperty(value = "容积(m³)")
private Float volume;
@ExcelProperty(value = "面积(㎡)", index = 18)
@ApiModelProperty(value = "面积(㎡)")
private Float area;
@ExcelIgnore
@ApiModelProperty(value = "水源可用状态类别代码")
private String statusCode;
@ExplicitConstraint(type = "SYZT", indexNum = 19, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "水源可用状态", index = 19)
@ApiModelProperty(value = "水源可用状态类别名称")
private String status;
@ExcelIgnore
@ApiModelProperty(value = "有无枯水期")
private Boolean hasDrySeason;
@ExplicitConstraint(indexNum = 20, source = { "有", "无" }) // 固定下拉内容
@ExcelProperty(value = "有无枯水期", index = 20)
@ApiModelProperty(value = "有无枯水期")
private String hasDrySeasonType;
@ExcelProperty(value = "水质情况", index = 21)
@ApiModelProperty(value = "水质情况")
private String qualitySituationInfo;
@ExcelProperty(value = "四季变化简要情况", index = 22)
@ApiModelProperty(value = "四季变化简要情况")
private String seasonChangeInfo;
@ExcelProperty(value = "枯水期跨度简要情况", index = 23)
@ApiModelProperty(value = "枯水期跨度简要情况")
private String dryPeriodSpan;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author system_generator
* @date 2021-06-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "WaterExcelPoolDto", description = "消防水池")
public class WaterExcelPoolDto extends WaterBaseResourceDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExplicitConstraint(type = "QSXS", indexNum = 15, sourceClass = CommonExplicitConstraint.class) // 动态下拉内容
@ExcelProperty(value = "取水形式", index = 15)
@ApiModelProperty(value = "取水形式")
private String intakeForm;
@ExcelProperty(value = "容积(m³)", index = 16)
@ApiModelProperty(value = "容积(m³)")
private Float volume;
@ExcelProperty(value = "最低报警水位(m)", index = 17)
@ApiModelProperty(value = "最低报警水位(m)")
private Float minWaterLevel;
@ExcelProperty(value = "最高报警水位(m)", index = 18)
@ApiModelProperty(value = "最高报警水位(m)")
private Float maxWaterLevel;
@ExcelIgnore
@ApiModelProperty("水池液位显示装置id")
private String levelDeviceId;
@ApiModelProperty("水池液位显示装置名称")
@ExcelProperty(value = "水池液位显示装置", index = 19)
@ExplicitConstraint(indexNum = 19, sourceClass = CommonExplicitConstraint.class, method = "getListByEquipmentCode")
private String levelDeviceName;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author system_generator
* @date 2021-06-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "WaterExcelWaterTankDto", description = "消防水箱")
public class WaterExcelWaterTankDto extends WaterBaseResourceDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "容积(m³)", index = 18)
@ApiModelProperty(value = "容积(m³)")
private Float volume;
@ExcelProperty(value = "最低报警水位(m)", index = 15)
@ApiModelProperty(value = "最低报警水位(m)")
private Float minWaterLevel;
@ExcelProperty(value = "最高报警水位(m)", index = 16)
@ApiModelProperty(value = "最高报警水位(m)")
private Float maxWaterLevel;
@ExcelIgnore
@ApiModelProperty("水池液位显示装置id")
private String levelDeviceId;
@ApiModelProperty("水池液位显示装置名称")
@ExcelProperty(value = "水池液位显示装置", index = 17)
@ExplicitConstraint(indexNum = 17, sourceClass = CommonExplicitConstraint.class, method = "getListByEquipmentCode")
private String levelDeviceName;
}
......@@ -154,7 +154,7 @@ public class WaterResourceForExportDto extends BaseDto {
@ExcelProperty(value = "高度(cm)", index = 11)
@ApiModelProperty(value = "高度(cm)")
private Float height;
private Double height;
@ExcelIgnore
@ApiModelProperty(value = "水源可用状态类别代码")
......@@ -184,15 +184,15 @@ public class WaterResourceForExportDto extends BaseDto {
@ExcelProperty(value = "管网直径(cm)", index = 16)
@ApiModelProperty(value = "管网直径(cm)")
private Float pipeDiameter;
private Double pipeDiameter;
@ExcelProperty(value = "进水管直径(cm)", index = 17)
@ApiModelProperty(value = "进水管直径(cm)")
private Float inletPipeDiameter;
private Double inletPipeDiameter;
@ExcelProperty(value = "出水管直径(cm)", index = 18)
@ApiModelProperty(value = "出水管直径(cm)")
private Float outletPipeDiameter;
private Double outletPipeDiameter;
@ExcelProperty(value = "加水车道数量(个)", index = 19)
@ApiModelProperty(value = "加水车道数量(个)")
......@@ -257,11 +257,11 @@ public class WaterResourceForExportDto extends BaseDto {
@ExcelProperty(value = "容积(m³)", index = 28)
@ApiModelProperty(value = "容积(m³)")
private Float volume;
private Double volume;
@ExcelProperty(value = "面积(㎡)", index = 29)
@ApiModelProperty(value = "面积(㎡)")
private Float area;
private Double area;
@ExcelProperty(value = "水质情况", index = 30)
@ApiModelProperty(value = "水质情况")
......@@ -288,11 +288,11 @@ public class WaterResourceForExportDto extends BaseDto {
@ExcelProperty(value = "取水高度(cm)", index = 34)
@ApiModelProperty(value = "取水高度(cm)")
private Float intakeHeight;
private Double intakeHeight;
@ExcelProperty(value = "水源标高差(cm)", index = 35)
@ApiModelProperty(value = "水源标高差(cm)")
private Float elevationDifference;
private Double elevationDifference;
@ExcelProperty(value = "停车位置", index = 36)
@ApiModelProperty(value = "停车位置")
......@@ -342,7 +342,7 @@ public class WaterResourceForExportDto extends BaseDto {
// @ExplicitConstraint(indexNum = 42, sourceClass = CommonExplicitConstraint.class, method = "getEquipCategory")
// @ExcelProperty(value = "设施分类名称", index = 42)
private String equipCategoryName;
@ApiModelProperty("设施分类编码")
@ExcelIgnore
private String equipCategoryCode;
......@@ -376,11 +376,11 @@ public class WaterResourceForExportDto extends BaseDto {
@ExcelProperty(value = "最低报警水位(m)", index = 43)
@ApiModelProperty(value = "最低报警水位(m)")
private Float minWaterLevel;
private Double minWaterLevel;
@ExcelProperty(value = "最高报警水位(m)", index = 44)
@ApiModelProperty(value = "最高报警水位(m)")
private Float maxWaterLevel;
private Double maxWaterLevel;
@ExcelIgnore
@ApiModelProperty("水池液位显示装置id")
......
package com.yeejoin.amos.boot.module.common.api.excel;
public interface ExcelDynamicSelect {
/**
* 获取动态生成的下拉框可选数据
* @return 动态生成的下拉框可选数据
*/
String[] getSource();
}
package com.yeejoin.amos.boot.module.common.api.excel;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 标注导出的列为下拉框类型,并为下拉框设置内容
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface ExcelSelected {
/**
* 固定下拉内容
*/
String[] source() default {};
/**
* 动态下拉内容
*/
Class<? extends ExcelDynamicSelect>[] sourceClass() default {};
/**
* 设置下拉框的起始行,默认为第二行
*/
int firstRow() default 1;
/**
* 设置下拉框的结束行,默认为最后一行
*/
int lastRow() default 0x10000;
}
package com.yeejoin.amos.boot.module.common.api.excel;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
/**
* @program: mypro
* @description: todo
* @author: xuYao2
* @create: 2022-07-22 13:35
**/
@Data
@Slf4j
public class ExcelSelectedResolve {
/**
* 下拉内容
*/
private String[] source;
/**
* 设置下拉框的起始行,默认为第二行
*/
private int firstRow;
/**
* 设置下拉框的结束行,默认为最后一行
*/
private int lastRow;
public String[] resolveSelectedSource(ExplicitConstraint excelSelected, DataSources dataDictionaryMapper) {
if (excelSelected == null) {
return null;
}
// 获取固定下拉框的内容
String[] source = excelSelected.source();
if (source.length > 0) {
return source;
}
// 获取动态下拉框的内容
Class<? extends ExplicitInterface>[] classes = excelSelected.sourceClass();
if (classes.length > 0) {
try {
ExplicitInterface explicitInterface = classes[0].newInstance();
String[] dynamicSelectSource = explicitInterface.source(excelSelected.type(), excelSelected.method(),
dataDictionaryMapper);
if (dynamicSelectSource != null && dynamicSelectSource.length > 0) {
return dynamicSelectSource;
}
} catch (Exception e) {
log.error("解析动态下拉框数据异常", e);
}
}
return null;
}
}
......@@ -221,6 +221,14 @@ public class ExcelUtil {
return readExcel(reader, rowType, 0);
}
public static <T> List<T> readManySheetExcel(MultipartFile excel, Class<T> rowType, int header,int sheetCount) throws Exception {
ExcelReader reader = getReader(excel, header);
if (reader == null) {
return new ArrayList<>();
}
return readExcel(reader, rowType, 0);
}
/**
* 读取 Excel(多个 sheet)
*
......@@ -418,5 +426,39 @@ public class ExcelUtil {
}
}
/**
* 解析表头类中的下拉注解
* @param head 表头类
* @param <T> 泛型
* @return Map<下拉框列索引, 下拉框内容> map
*/
public static <T> Map<Integer, ExcelSelectedResolve> resolveSelectedAnnotation(Class<T> head,DataSources dataDictionaryMapper) {
Map<Integer, ExcelSelectedResolve> selectedMap = new HashMap<>();
// getDeclaredFields(): 返回全部声明的属性;getFields(): 返回public类型的属性
Field[] fields = head.getDeclaredFields();
for (int i = 0; i < fields.length; i++){
Field field = fields[i];
// 解析注解信息
ExplicitConstraint selected = field.getAnnotation(ExplicitConstraint.class);
ExcelProperty property = field.getAnnotation(ExcelProperty.class);
if (selected != null) {
ExcelSelectedResolve excelSelectedResolve = new ExcelSelectedResolve();
// 处理下拉框内容
String[] source = excelSelectedResolve.resolveSelectedSource(selected,dataDictionaryMapper);
if (source != null && source.length > 0){
excelSelectedResolve.setSource(source);
excelSelectedResolve.setFirstRow(selected.firstRow());
excelSelectedResolve.setLastRow(selected.lastRow());
if (property != null && property.index() >= 0){
selectedMap.put(property.index(), excelSelectedResolve);
} else {
selectedMap.put(i, excelSelectedResolve);
}
}
}
}
return selectedMap;
}
}
......@@ -18,5 +18,13 @@ public @interface ExplicitConstraint {
String type() default "";
//接口查询
String method() default "";
/**
* 设置下拉框的起始行,默认为第二行
*/
int firstRow() default 1;
/**
* 设置下拉框的结束行,默认为最后一行
*/
int lastRow() default 0x10000;
}
package com.yeejoin.amos.boot.module.common.api.excel;
import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import java.util.List;
import java.util.Map;
/**
* @author: CUI
* @date: 2022-05-27 9:11
*/
public class SelectDataSheetWriteHandler implements SheetWriteHandler {
private Map<Integer, String[]> selectMap;
private static final Integer LIMIT_NUMBER = 0;
private char[] alphabet = new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
public SelectDataSheetWriteHandler(Map<Integer, String[]> selectMap) {
this.selectMap = selectMap;
}
@Override
public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
}
@Override
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
if (selectMap == null || selectMap.size() == 0) {
return;
}
// 需要设置下拉框的sheet页
Sheet curSheet = writeSheetHolder.getSheet();
DataValidationHelper helper = curSheet.getDataValidationHelper();
String dictSheetName = "sheet2";
Workbook workbook = writeWorkbookHolder.getWorkbook();
// 数据字典的sheet页
Sheet dictSheet = workbook.createSheet(dictSheetName);
// 隐藏数据字典的sheet页
workbook.setSheetHidden(workbook.getSheetIndex(dictSheet), true);
// k 为存在下拉数据集的单元格下表 v为下拉数据集
selectMap.forEach((k, v) -> {
// 设置下拉单元格的首行 末行 首列 末列
CellRangeAddressList rangeList = new CellRangeAddressList(1, 65536, k, k);
// 如果下拉值总数大于100,则使用一个新sheet存储,避免生成的导入模板下拉值获取不到
if (v.length > LIMIT_NUMBER) {
//定义sheet的名称
//1.创建一个隐藏的sheet 名称为 hidden + k
String sheetName = "hidden" + k;
// Workbook workbook = writeWorkbookHolder.getWorkbook();
Sheet hiddenSheet = workbook.createSheet(sheetName);
for (int i = 0, length = v.length; i < length; i++) {
// 开始的行数i,列数k
hiddenSheet.createRow(i).createCell(k).setCellValue(v[i]);
}
Name category1Name = workbook.createName();
category1Name.setNameName(sheetName);
String excelLine = getExcelLine(k);
// 下拉框数据来源 eg:字典sheet!$B1:$B2
String refers = dictSheetName + "!$" + excelLine + "$1:$" + excelLine + "$" + (v.length + 1);
// 创建可被其他单元格引用的名称
Name name = workbook.createName();
// 设置名称的名字
name.setNameName("dict" + k);
// 设置公式
name.setRefersToFormula(refers);
// 设置引用约束
DataValidationConstraint constraint = helper.createFormulaListConstraint("dict" +k);
// 设置约束
DataValidation validation = helper.createValidation(constraint, rangeList);
if (validation instanceof HSSFDataValidation) {
validation.setSuppressDropDownArrow(false);
} else {
validation.setSuppressDropDownArrow(true);
validation.setShowErrorBox(true);
}
// 阻止输入非下拉框的值
validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
validation.createErrorBox("提示", "此值与单元格定义格式不一致!");
// 添加下拉框约束
writeSheetHolder.getSheet().addValidationData(validation);
}
});
/* for (Map.Entry<Integer, String[]> entry : selectMap.entrySet()) {
// 设置下拉单元格的首行、末行、首列、末列
CellRangeAddressList rangeAddressList = new CellRangeAddressList(1, 65533, entry.getKey(), entry.getKey());
int rowLen = entry.getValue().length;
// 设置字典sheet页的值 每一列一个字典项
for (int i = 0; i < rowLen; i++) {
Row row = dictSheet.getRow(i);
if (row == null) {
row = dictSheet.createRow(i);
}
row.createCell(entry.getKey()).setCellValue(entry.getValue()[i]);
}
String excelColumn = getExcelColumn(entry.getKey());
// 下拉框数据来源 eg:字典sheet!$B1:$B2
String refers = dictSheetName + "!$" + excelColumn + "$1:$" + excelColumn + "$" + rowLen;
// 创建可被其他单元格引用的名称
Name name = workbook.createName();
// 设置名称的名字
name.setNameName("dict" + entry.getKey());
// 设置公式
name.setRefersToFormula(refers);
// 设置引用约束
DataValidationConstraint constraint = helper.createFormulaListConstraint("dict" + entry.getKey());
// 设置约束
DataValidation validation = helper.createValidation(constraint, rangeAddressList);
if (validation instanceof HSSFDataValidation) {
validation.setSuppressDropDownArrow(false);
} else {
validation.setSuppressDropDownArrow(true);
validation.setShowErrorBox(true);
}
// 阻止输入非下拉框的值
validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
validation.createErrorBox("提示", "此值与单元格定义格式不一致!");
// 添加下拉框约束
writeSheetHolder.getSheet().addValidationData(validation);
}*/
}
/**
* 将数字列转化成为字母列
* @param num
* @author: CUI
* @date: 2022-05-27 9:12
* @return: java.lang.String
*/
private String getExcelColumn(int num) {
String column = "";
int len = alphabet.length - 1;
int first = num / len;
int second = num % len;
if (num <= len) {
column = alphabet[num] + "";
} else {
column = alphabet[first - 1] + "";
if (second == 0) {
column = column + alphabet[len] + "";
} else {
column = column + alphabet[second - 1] + "";
}
}
return column;
}
private String getExcelLine(int num) {
String line = "";
int first = num / 26;
int second = num % 26;
if (first > 0) {
line = (char) ('A' + first - 1) + "";
}
line += (char) ('A' + second) + "";
return line;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.common.api.excel;
import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.DataValidationHelper;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddressList;
import java.util.Map;
/**
* @program: mypro
* @description: todo
* @create: 2022-07-22 13:36
**/
@Data
@AllArgsConstructor
public class SelectedSheetWriteHandler implements SheetWriteHandler {
private final Map<Integer, ExcelSelectedResolve> selectedMap;
@Override
public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
}
@Override
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
// 这里可以对cell进行任何操作
Sheet sheet = writeSheetHolder.getSheet();
DataValidationHelper helper = sheet.getDataValidationHelper();
selectedMap.forEach((k, v) -> {
// 设置下拉列表的行: 首行,末行,首列,末列
CellRangeAddressList rangeList = new CellRangeAddressList(1, 65536, k, k);
if (v.getSource().length > 0){
// 设置下拉列表的值
DataValidationConstraint constraint = helper.createExplicitListConstraint(v.getSource());
// 设置约束
DataValidation validation = helper.createValidation(constraint, rangeList);
// 阻止输入非下拉选项的值
validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
validation.setShowErrorBox(true);
validation.setSuppressDropDownArrow(true);
validation.createErrorBox("提示", "请输入下拉选项中的内容");
sheet.addValidationData(validation);
}
});
}
}
package com.yeejoin.amos.boot.module.common.api.excel;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* @program: mypro
* @description: todo
* @create: 2022-07-22 13:45
**/
@Component
public class SpringContextUtil implements ApplicationContextAware {
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
SpringContextUtil.applicationContext = applicationContext;
}
// 通过class获取Bean
public static <T> T getBean(Class<T> clazz) {
return applicationContext.getBean(clazz);
}
// 通过name以及class获取Bean
public static <T> T getBean(String name, Class<T> clazz) {
return applicationContext.getBean(name, clazz);
}
}
package com.yeejoin.amos.boot.module.common.api.excel;
import com.google.zxing.qrcode.encoder.QRCode;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
import org.apache.poi.ss.usermodel.DataValidationHelper;
import org.apache.poi.ss.usermodel.Name;
import org.apache.poi.ss.usermodel.Workbook;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import java.util.HashMap;
import java.util.Map;
/**
* excel通用单元格格式类下拉框赋值
*/
public class TemplateCellWriteHandlerDate1 implements SheetWriteHandler {
/**
* 构造器注入
*/
private Map<Integer, String[]> explicitListConstraintMap = new HashMap<>();
public TemplateCellWriteHandlerDate1(Map<Integer, String[]> explicitListConstraintMap) {
this.explicitListConstraintMap = explicitListConstraintMap;
}
/**
* 避免生成的导入模板下拉值获取不到
*/
private static final Integer LIMIT_NUMBER = 0;
/**
* 返回excel列标A-Z-AA-ZZ
*
* @param num 列数
* @return java.lang.String
*/
private String getExcelLine(int num) {
String line = "";
int first = num / 26;
int second = num % 26;
if (first > 0) {
line = (char) ('A' + first - 1) + "";
}
line += (char) ('A' + second) + "";
return line;
}
@Override
public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
// TODO Auto-generated method stub
}
@Override
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
if(explicitListConstraintMap!=null) {
// 这里可以对cell进行任何操作
Sheet sheet = writeSheetHolder.getSheet();
DataValidationHelper helper = sheet.getDataValidationHelper();
// k 为存在下拉数据集的单元格下表 v为下拉数据集
explicitListConstraintMap.forEach((k, v) -> {
// 设置下拉单元格的首行 末行 首列 末列
CellRangeAddressList rangeList = new CellRangeAddressList(1, 65536, k, k);
// 如果下拉值总数大于100,则使用一个新sheet存储,避免生成的导入模板下拉值获取不到
if (v.length > LIMIT_NUMBER) {
//定义sheet的名称
//1.创建一个隐藏的sheet 名称为 hidden + k
String sheetName = "hidden" + k+ QRCodeUtil.generateQRCode();
Workbook workbook = writeWorkbookHolder.getWorkbook();
Sheet hiddenSheet = workbook.createSheet(sheetName);
for (int i = 0, length = v.length; i < length; i++) {
// 开始的行数i,列数k
hiddenSheet.createRow(i).createCell(k).setCellValue(v[i]);
}
Name category1Name = workbook.createName();
category1Name.setNameName(sheetName);
String excelLine = getExcelLine(k);
// =hidden!$H:$1:$H$50 sheet为hidden的 H1列开始H50行数据获取下拉数组
String refers = "=" + sheetName + "!$" + excelLine + "$1:$" + excelLine + "$" + (v.length + 1);
// 将刚才设置的sheet引用到你的下拉列表中
DataValidationConstraint constraint = helper.createFormulaListConstraint(refers);
DataValidation dataValidation = helper.createValidation(constraint, rangeList);
if (dataValidation instanceof HSSFDataValidation) {
dataValidation.setSuppressDropDownArrow(false);
} else {
dataValidation.setSuppressDropDownArrow(true);
dataValidation.setShowErrorBox(true);
}
writeSheetHolder.getSheet().addValidationData(dataValidation);
// 设置存储下拉列值得sheet为隐藏
int hiddenIndex = workbook.getSheetIndex(sheetName);
if (!workbook.isSheetHidden(hiddenIndex)) {
workbook.setSheetHidden(hiddenIndex, true);
}
}
});
}
}
}
package com.yeejoin.amos.boot.module.common.api.excel;
import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.DataValidationHelper;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddressList;
import java.util.Map;
@Slf4j
public class TitleHandler implements SheetWriteHandler {
/**
* 下拉框值
*/
private Map<Integer,String[]> dropDownMap;
/**
* 多少行有下拉
*/
private final static Integer rowSize = 200;
public TitleHandler(Map<Integer,String[]> dropDownMap) {
this.dropDownMap = dropDownMap;
}
@Override
public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
}
@Override
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
Sheet sheet = writeSheetHolder.getSheet();
DataValidationHelper helper = sheet.getDataValidationHelper();
dropDownMap.forEach((celIndex, strings) -> {
// 区间设置
CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(1, rowSize, celIndex, celIndex);
// 下拉内容
DataValidationConstraint constraint = helper.createExplicitListConstraint(strings);
DataValidation dataValidation = helper.createValidation(constraint, cellRangeAddressList);
sheet.addValidationData(dataValidation);
});
}
}
package com.yeejoin.amos.boot.module.common.api.feign;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUserVO;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.GroupUserModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* @description:
* @author: tw
* @createDate: 2023/3/29
*/
@FeignClient(name ="${privilege.fegin.name:AMOS-API-PRIVILEGE}", path = "", configuration = {MultipartSupportConfig.class})
public interface PrivilegeFeignClient {
@RequestMapping(value = "/privilege/v1/agencyuser", method = RequestMethod.POST)
ResponseModel<Object> create(
@RequestHeader("appKey") String appKey,
@RequestHeader("product") String product,
@RequestHeader("token") String token,
@RequestBody OrgUserVO var1);
@RequestMapping(value = "/privilege/v1/groupUser", method = RequestMethod.POST)
ResponseModel<Object> groupUser(
@RequestHeader("appKey") String appKey,
@RequestHeader("product") String product,
@RequestHeader("token") String token,
@RequestParam("groupSeq") Long groupSeq, @RequestBody List<String> var2);
}
......@@ -18,7 +18,7 @@ import java.util.Map;
*/
public interface WaterResourceMapper extends BaseMapper<WaterResource> {
List<WaterResourceForExportDto> exportToExcel(@Param("isDelete")Boolean isDelete, @Param("name")String name, @Param("resourceType")String resourceType, @Param("bizOrgCode")String bizOrgCode);
List<WaterResourceForExportDto> exportToExcel(@Param("isDelete")Boolean isDelete, @Param("name")String name, @Param("equipCateGoryCode")String equipCateGoryCode, @Param("bizOrgCode")String bizOrgCode);
/***
......
......@@ -1150,9 +1150,9 @@ LEFT JOIN (
cfp.fire_management_post,
cft.type_code,
cf.certificate_number certificatesNumber,
cf.employee_number,
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'personNumber' AND dfi.instance_id = u.sequence_nbr ) AS employee_number,
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'telephone' AND dfi.instance_id = u.sequence_nbr ) AS telephone,
( CASE WHEN cfp.post_qualification IS NULL THEN 0 ELSE 1 END ) AS is_certificate,
( CASE WHEN cfp.post_qualification IS NULL or cfp.post_qualification = '' THEN 0 ELSE 1 END ) AS is_certificate,
IF
(
( SELECT field_value FROM cb_dynamic_form_instance dfi WHERE dfi.field_code = 'peopleType' AND dfi.instance_id = u.sequence_nbr ) = 1601,
......
......@@ -22,6 +22,7 @@
r.equip_category_name,
r.equip_code,
r.maintenance_period,
r.resource_type,
(case r.resource_type when 'crane' then rc.height when 'natural' then rn.height end) height,
(case r.resource_type
when 'crane' then rc.status
......@@ -72,8 +73,8 @@
<if test='name!=null and name!=""'>
and r.name like concat('%',#{name}, '%')
</if>
<if test='resourceType!=null and resourceType!=""'>
and r.resource_type= #{resourceType}
<if test='equipCateGoryCode!=null and equipCateGoryCode!=""'>
and r.equip_category_code = #{equipCateGoryCode}
</if>
<if test='bizOrgCode !=null and bizOrgCode!=""'>
and r.biz_org_code like concat('%',#{bizOrgCode}, '%')
......
......@@ -67,6 +67,10 @@ public class EquipmentCategory extends BaseEntity implements TreeNode<EquipmentC
@ApiModelProperty(value = "个数")
private Double count;
@TableField(exist=false)
@ApiModelProperty(value = "个数")
private String countName;
@ApiModelProperty(value = "类型(car:车辆 equipment:装备)")
@TableField(exist=false)
private String type;
......
......@@ -43,4 +43,10 @@ public class VideoImportantEquipmentVo {
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "token")
private String token;
@ApiModelProperty(value = "视频格式")
private String videoType;
}
\ No newline at end of file
......@@ -21,6 +21,7 @@ public enum ExcelEnums {
CLZQ ("车辆执勤", "车辆执勤", "com.yeejoin.amos.boot.module.common.api.dto.DutyCarExcelDto","CLZQ"),//("CLZQ","车辆执勤")
JCDWRY ("单位人员", "单位人员", "com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto","JCDWRY"),//("JCDW","机场单位")
DLDWRY ("单位人员", "单位人员", "com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDlExcelDto","DLDWRY"),//("JCDW","机场单位")
JCDWRYTP ("单位人员同步平台", "单位人员同步平台", "com.yeejoin.amos.boot.module.common.api.dto.OrgUsrTPDlExcelDto","JCDWRYTP"),//("JCDW","机场单位")
LDDW ("联动单位", "联动单位", "com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto","LDDW"),//("JCDW","机场单位")
RYZB ("人员值班", "人员值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto","RYZB"),//("RYZB","人员值班")
// BUG 2455 相关代码 bykongfm
......
package com.yeejoin.amos.patrol.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum PointCheckTypeEnum {
WGJC("外观检查", "WGJC"),
GNCS("功能测试", "GNCS"),
HJJC("环境检查", "HJJC"),
QT("其他", "QT");
private String name;
private String value;
private PointCheckTypeEnum(String name, String value) {
this.name = name;
this.value = value;
}
public static String getName(String value) {
for (PointCheckTypeEnum c : PointCheckTypeEnum.values()) {
if (c.getValue().equals(value)) {
return c.name;
}
}
return null;
}
public static String getValue(String name) {
for (PointCheckTypeEnum c : PointCheckTypeEnum.values()) {
if (c.getName().equals(name)) {
return c.value;
}
}
return null;
}
public static PointCheckTypeEnum getEnum(String name) {
for (PointCheckTypeEnum c : PointCheckTypeEnum.values()) {
if (c.getName().equals(name)) {
return c;
}
}
return null;
}
public static List<String> getEnumNameList() {
List<String> nameList = new ArrayList<String>();
for (PointCheckTypeEnum c: PointCheckTypeEnum.values()) {
nameList.add(c.getName());
}
return nameList;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package com.yeejoin.amos.patrol.core.common.request;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.fasterxml.jackson.databind.module.SimpleModule;
/**
* @description:
* @author: tw
* @createDate: 2023/4/13
*/
public class ToJson {
public static Object tojson(Object obj) {
Object ob=null;
if(obj!=null){
SerializeConfig serializeConfig = new SerializeConfig();
serializeConfig.put(Long.class, ToStringSerializer.instance);
serializeConfig.put(Long.TYPE, ToStringSerializer.instance);
String json = JSONObject
.toJSONString(obj, serializeConfig,
SerializerFeature.PrettyFormat);
ob=JSONObject.parse(json);
}
return ob;
}
}
......@@ -10,6 +10,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.io.filefilter.FalseFileFilter;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
......@@ -138,7 +139,7 @@ public class DutyPersonController extends BaseController {
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping("/new-duty-detail")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
......
......@@ -51,7 +51,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.*;
import java.util.function.Consumer;
import java.util.stream.Collectors;
/**
......@@ -860,8 +861,14 @@ public class OrgUsrController extends BaseController {
if ("dl".equals(type)){
LambdaQueryWrapper<OrgUsr> lambda = new QueryWrapper<OrgUsr>().lambda();
lambda.eq(OrgUsr::getBizOrgCode, bizOrgCode);
lambda.eq(OrgUsr::getIsDelete, false);
OrgUsr orgUsr = orgUsrMapper.selectList(lambda).get(0);
lambda.and(new Consumer<LambdaQueryWrapper<OrgUsr>>() {
@Override
public void accept(LambdaQueryWrapper<OrgUsr> orgUsrLambdaQueryWrapper) {
orgUsrLambdaQueryWrapper.eq(OrgUsr::getIsDelete, false).or().eq(OrgUsr::getOrgExpandAttr8, 1);
}
});
OrgUsr orgUsr = orgUsrMapper.selectList(lambda).get(0);
if (!org.apache.commons.lang3.ObjectUtils.isEmpty(orgUsr.getBizOrgType()) && "COMPANY".equals(orgUsr.getBizOrgType())) {
bizOrgCode = orgUsr.getBizOrgCode();
} else {
......
......@@ -261,7 +261,7 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
orgUsrService.saveFirefightersPost(peopleInfoDto.getPostEduDtoObj(), id);
// 3.消防人员更新消防表
if ("1".equals(peopleInfoDto.getFirefighters().getPeopleType())){
if ("1601".equals(peopleInfoDto.getFirefighters().getPeopleType())){
// 更新紧急联系人
ifirefightersContactsService.updateById(peopleInfoDto.getFirefightersContacts());
}
......
......@@ -1231,7 +1231,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
saveOrgUsr(orgUsr, oldOrgUsr);
// 保存消防人员表数据
QueryWrapper<Firefighters> firefightersQueryWrapper = new QueryWrapper<>();
firefightersQueryWrapper.eq("orgUsrId", id);
firefightersQueryWrapper.eq("org_usr_id", id);
Firefighters fire = firefightersService.getOne(firefightersQueryWrapper);
if(!ObjectUtils.isEmpty(fire)) {
fire.setName(orgUsr.getBizOrgName());
......
......@@ -1274,7 +1274,7 @@ public class CarController extends AbstractBaseController {
* @return
*/
@RequestMapping(value = "/state/info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "根据车牌号查询车辆信息", notes = "根据车牌号查询车辆信息")
public ResponseModel getCarStateInfoByCarNum(@RequestParam(required = false) String carNum) {
return CommonResponseUtil.success(iCarService.getCarStateInfoByCarNum(carNum));
......
......@@ -232,7 +232,7 @@ public class ConfigureController extends AbstractBaseController {
} catch (Exception e) {
e.printStackTrace();
}
if (200 == sevenEntity.getStatus()) {
if (sevenEntity != null && 200 == sevenEntity.getStatus()) {
String json1 = JSON.toJSONString(sevenEntity.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("FireCar_Start") && t.get("FireCar_Start").equals("true"))).collect(Collectors.toList());
......
......@@ -286,6 +286,35 @@ public class EquipmentCategoryController extends AbstractBaseController {
return list;
}
@RequestMapping(value = "/itemType-tree", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "检查项类型统计树", notes = "检查项类型统计树")
public List<EquipmentCategory> countItemTree() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> equipmentCategories = this.listEquip();
List<EquipmentCategory> fireCategories = this.listFire();
fireCategories.get(0).setId(-2L);
fireCategories.get(0).setCode("-2");
List<EquipmentCategory> treeListByCustom = getTreeListByCustom(bizOrgCode);
list.addAll(equipmentCategories);
list.addAll(fireCategories);
list.addAll(treeListByCustom);
EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(list);
equipmentCategory.setCode("-3");
equipmentCategory.setName("全部类型");
equipmentCategory.setId(-3L);
int countAll = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countAll(bizOrgCode) : 0;
equipmentCategory.setCountName("全部类型" + "(" + countAll + ")");
equipmentCategory.setHasLowerClassification(true);
List<EquipmentCategory> result = new ArrayList<>();
result.add(equipmentCategory);
return result;
}
/**
* 除消防设施全量数据树形结构返回
......@@ -296,8 +325,12 @@ public class EquipmentCategoryController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "除消防设施全量数据树形结构返回", notes = "除消防设施全量数据树形结构返回")
public List<EquipmentCategory> listEquip() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode));
.getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode),bizOrgCode);
List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> result = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
......@@ -316,11 +349,13 @@ public class EquipmentCategoryController extends AbstractBaseController {
}
}
});
String equipItemCount = iEquipmentCategoryService.getEquipItemCount(bizOrgCode);
getChildren(list, tmpMap);
EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(list);
equipmentCategory.setCode("-1");
equipmentCategory.setName("消防设备");
equipmentCategory.setCountName("消防设备"+equipItemCount);
equipmentCategory.setId(0L);
equipmentCategory.setHasLowerClassification(true);
......@@ -337,8 +372,10 @@ public class EquipmentCategoryController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防设施分类定义树", notes = "消防设施分类定义树")
public List<EquipmentCategory> listFire() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode));
.getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode),bizOrgCode);
List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> result = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
......@@ -358,11 +395,12 @@ public class EquipmentCategoryController extends AbstractBaseController {
}
});
getChildren(list, tmpMap);
String fireItemCount = iEquipmentCategoryService.getFireItemCount(bizOrgCode);
EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(list);
equipmentCategory.setCode("-1");
equipmentCategory.setName("消防设施");
equipmentCategory.setName("设施/系统");
equipmentCategory.setCountName("消防设施"+fireItemCount);
equipmentCategory.setId(0L);
equipmentCategory.setHasLowerClassification(true);
......@@ -388,9 +426,9 @@ public class EquipmentCategoryController extends AbstractBaseController {
}
List<EquipmentCategory> result = new ArrayList<>();
List<EquipmentCategory> listFireCategories = listFirePrivate(bizOrgCode);
List<EquipmentCategory> listEquipCategories = listEquipPrivate(bizOrgCode);
//List<EquipmentCategory> listEquipCategories = listEquipPrivate(bizOrgCode);
List<EquipmentCategory> treeListByCustom = getTreeListByCustom(bizOrgCode);
listFireCategories.addAll(listEquipCategories);
//listFireCategories.addAll(listEquipCategories);
listFireCategories.addAll(treeListByCustom);
EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(listFireCategories);
......@@ -416,6 +454,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
int keyPartsTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByKeyPartsType(bizOrgCode) : 0;
equipmentCategory.setCode("-4");
equipmentCategory.setName("重点部位" + "(" + keyPartsTypeCount + ")");
equipmentCategory.setCountName("重点部位" + "(" + keyPartsTypeCount + ")");
equipmentCategory.setPatrolNum(keyPartsTypeCount);
equipmentCategory.setId(-4L);
equipmentCategory.setParentId(-3L);
......@@ -425,6 +464,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
int customTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByCustomType(bizOrgCode) : 0;
equipmentCategory2.setCode("-5");
equipmentCategory2.setName("自定义巡查点" + "(" + customTypeCount + ")");
equipmentCategory2.setCountName("自定义巡查点" + "(" + customTypeCount + ")");
equipmentCategory2.setPatrolNum(customTypeCount);
equipmentCategory2.setId(-5L);
equipmentCategory2.setParentId(-3L);
......@@ -433,9 +473,9 @@ public class EquipmentCategoryController extends AbstractBaseController {
return result;
}
private List<EquipmentCategory> listFirePrivate(String bizOrgCode) {
private List<EquipmentCategory> listFirePrivate(String bizOrgCode) {
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode));
.getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode),bizOrgCode);
List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> result = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
......@@ -475,7 +515,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
}
private List<EquipmentCategory> listEquipPrivate(String bizOrgCode) {
/* private List<EquipmentCategory> listEquipPrivate(String bizOrgCode) {
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode));
List<EquipmentCategory> list = new ArrayList<>();
......@@ -510,7 +550,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
equipmentCategory.setParentId(-3L);
result.add(equipmentCategory);
return result;
}
}*/
/**
*
......
......@@ -465,8 +465,10 @@ public class FireFightingSystemController extends AbstractBaseController {
equipmentCategory = equipmentCategoryService.getById(equipmentCategory.getParentId());
}
}
String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", "");
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode.length() % 2 == 0 ? classificationCode : classificationCode + "0", equipTypeAmountPage);
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", ""), equipTypeAmountPage);
//String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", "");
//return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode.length() % 2 == 0 ? classificationCode : classificationCode + "0", equipTypeAmountPage);
} else {
if (null != equipTypeAmountPage.getIsDefect() && 1 == equipTypeAmountPage.getIsDefect()) {
ReginParams reginParams = getSelectedOrgInfo();
......
......@@ -53,9 +53,14 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
int checkUsed( String id );
List<EquipmentCategory> getEquipmentCategoryList(Integer head);
List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head);
List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head,String bizOrgCode);
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head);
String getEquipItemCount(String bizOrgCode) ;
String getFireItemCount(String bizOrgCode) ;
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head,String bizOrgCode);
int countByFireTypeAndCode(@Param("code") String code, @Param("bizOrgCode") String bizOrgCode);
......
......@@ -47,9 +47,14 @@ public interface IEquipmentCategoryService extends IService<EquipmentCategory> {
List<EquipmentCategory> getEquipmentCategoryList(Integer head);
List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head) ;
List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head,String bizOrgCode) ;
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head) ;
String getEquipItemCount(String bizOrgCode) ;
String getFireItemCount(String bizOrgCode) ;
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head,String bizOrgCode) ;
/**
* 根据分类定义id获取对应所有子分类id
......
......@@ -79,7 +79,7 @@ public class ESeqServiceImpl implements IESeqService {
NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder()
.withQuery(
QueryBuilders.boolQuery()
.must(QueryBuilders.termQuery("systemId", systemId))
.must(QueryBuilders.wildcardQuery("systemId", "*"+systemId+"*"))
.must(QueryBuilders.termQuery("isAlarm", 0))
.must(QueryBuilders.rangeQuery("time").gte(startTime).lte(endTime))
)
......
......@@ -422,11 +422,12 @@ public class EmergencyServiceImpl implements IEmergencyService {
Object iotCode = x.get("iotCode");
if (x.get("iotCode") != null) {
List<Map<String, String>> dataList = dataListMap.get(iotCode.toString());
String flag = null;
if (!CollectionUtils.isEmpty(dataList)) {
Collections.reverse(dataList);
Map<String, List<Map<String, String>>> dataMap = dataList.stream().filter(y -> y.containsKey(PressurePumpRelateEnum.CREATED_TIME.getValue())).collect(Collectors.groupingBy(e -> e.get("createdTime").substring(5, 16)));
List<Map<String, String>> yDataList = null;
String flag = null;
for (String t : timeList) {
List<Map<String, String>> data = dataMap.get(t);
if (!CollectionUtils.isEmpty(data)) {
......@@ -438,7 +439,17 @@ public class EmergencyServiceImpl implements IEmergencyService {
}
}
} else {
timeList.forEach(t -> yList.add(Integer.parseInt(PressurePumpRelateEnum.STOP.getValue())));
// timeList.forEach(t -> yList.add(Integer.parseInt(PressurePumpRelateEnum.STOP.getValue())));
String prefix = iotCode.toString().substring(0, 8);
String suffix = iotCode.toString().substring(8);
List<Map<String, String>> iotDataList = pressurePumpService.getIotTopSingleField("1", prefix, suffix, PressurePumpRelateEnum.IOT_INDEX_VALUE_TRUE.getValue(), pressurePumpStart);
if (!CollectionUtils.isEmpty(iotDataList)) {
flag = iotDataList.get(0).get(pressurePumpStart);
}
String finalFlag = flag;
timeList.forEach(t -> yList.add(StringUtils.isNotBlank(finalFlag) && PressurePumpRelateEnum.IOT_INDEX_VALUE_TRUE.getValue().equalsIgnoreCase(finalFlag) ? Integer.parseInt(PressurePumpRelateEnum.START.getValue()) : Integer.parseInt(PressurePumpRelateEnum.STOP.getValue())));
}
yMap.put("data", yList);
yData.add(yMap);
......
......@@ -386,13 +386,24 @@ public class EquipmentCategoryServiceImpl extends ServiceImpl<EquipmentCategoryM
return this.baseMapper.getEquipmentCategoryList(head);
}
public List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head) {
return this.baseMapper.getEquipmentCategoryListNotFacilities(head);
public List<EquipmentCategory> getEquipmentCategoryListNotFacilities(Integer head,String bizOrgCode) {
return this.baseMapper.getEquipmentCategoryListNotFacilities(head,bizOrgCode);
}
public List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head) {
return this.baseMapper.getEquipmentCategoryListByFacilities(head);
public String getFireItemCount(String bizOrgCode) {
return this.baseMapper.getFireItemCount(bizOrgCode);
}
public String getEquipItemCount(String bizOrgCode) {
return this.baseMapper.getEquipItemCount(bizOrgCode);
}
public List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head,String bizOrgCode) {
return this.baseMapper.getEquipmentCategoryListByFacilities(head,bizOrgCode);
}
......
......@@ -195,10 +195,11 @@ public class ScrapServiceImpl extends ServiceImpl<ScrapMapper, Scrap> implements
for (ScrapDetail scrapDetail : list) {
StockDetail stockDetail = stockDetailService.getById(scrapDetail.getStockDetailId());
stockDetail.setStatus(equipStatusEnum.getCode().toString());
//更新库存,之前在新增报废时减库存,现调整为报废时再减库存
//更新库存,之前在新增报废时减库存,现调整为报废时再减库存,
BigDecimal stockAmount = new BigDecimal(stockDetail.getAmount());
BigDecimal scrapAmount = new BigDecimal(scrapDetail.getAmount());
stockDetail.setAmount(stockAmount.subtract(scrapAmount).doubleValue());
// stockDetail.setAmount(stockAmount.subtract(scrapAmount).doubleValue());
stockDetail.setAmount(stockAmount.doubleValue());
stockDetailList.add(stockDetail);
}
stockDetailService.updateBatchById(stockDetailList);
......
......@@ -58,10 +58,12 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
@Override
public List<AlamVideoVO> queryVideoList(String bizOrgCode) {
List<AlamVideoVO> list = supervisionVideoMapper.getVideoByCompany(bizOrgCode);
list.forEach(action -> {
action.setVedioFormat(action.getVideoType());
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
});
if (0 < list.size()) {
list.forEach(action -> {
action.setVedioFormat(action.getVideoType());
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
});
}
return list;
}
......
......@@ -32,6 +32,8 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import net.sf.cglib.beans.BeanMap;
......@@ -206,12 +208,33 @@ public class DataSourcesImpl implements DataSources {
case "getListByEquipmentCode":
str = getListByEquipmentCode();
break;
case "getdeptSeqsList":
str = getdeptSeqsList();
break;
}
}
return str;
}
private String[] getdeptSeqsList() {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
Long sequenceNbr = reginParams.getCompany().getSequenceNbr();
FeignClientResult<Collection<DepartmentModel>> date=Privilege.departmentClient.queryDeptTree(null,sequenceNbr);
Collection<DepartmentModel> depts = date.getResult();
List<String> carNameList = Lists.newArrayList();
depts.forEach(dept -> {
carNameList.add(dept.getDepartmentName() + "@" + dept.getSequenceNbr());
});
String[] str = carNameList.toArray(new String[carNameList.size()]);
return str;
}
private String[] getCarList() {
ResponseModel<Object> response = equipFeignClient.getFireCarListAll();
List<Map<String, Object>> carList = (List<Map<String, Object>>) response.getResult();
......
......@@ -17,6 +17,25 @@
<artifactId>amos-boot-module-patrol-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.1.1</version>
<exclusions>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-rule</artifactId>
......
......@@ -179,11 +179,13 @@ public class CheckController extends AbstractBaseController {
return CommonResponseUtil.failure("无权执行该任务");
}
statu = planTask.getFinishStatus();
if (!requestParam.getIsOffline() && statu == PlanTaskFinishStatusEnum.OVERTIME.getValue()) {
return CommonResponseUtil.failure("任务已超时,上传失败!");
}else if( statu == PlanTaskFinishStatusEnum.FINISHED.getValue()){
return CommonResponseUtil.failure("任务已完成!");
if (!requestParam.getIsOffline()) {
statu = planTask.getFinishStatus();
if (!requestParam.getIsOffline() && statu == PlanTaskFinishStatusEnum.OVERTIME.getValue()) {
return CommonResponseUtil.failure("任务已超时,上传失败!");
}else if( statu == PlanTaskFinishStatusEnum.FINISHED.getValue()){
return CommonResponseUtil.failure("任务已完成!");
}
}
Date checkTime = requestParam.getIsOffline()?DateUtil.getLongDate(requestParam.getCheckTime()):new Date();
......@@ -196,7 +198,7 @@ public class CheckController extends AbstractBaseController {
}
}
int count = checkService.checkHasRecord(requestParam);
if (count < 1 || requestParam.getPlanTaskId() < 1) {
if (count < 1 || requestParam.getPlanTaskId() < 1 || requestParam.getIsOffline()) {
ReginParams reginParams = getSelectedOrgInfo();
// String orgCode = getOrgCode(reginParams);
String orgCode =reginParams.getPersonIdentity().getBizOrgCode();
......
package com.yeejoin.amos.patrol.business.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.patrol.business.dao.repository.IInputItemDao;
import com.yeejoin.amos.patrol.business.dao.repository.IPointInputItemDao;
import com.yeejoin.amos.patrol.business.dto.InputItemDataDto;
import com.yeejoin.amos.patrol.business.dto.InputItemDataJsonlDto;
import com.yeejoin.amos.patrol.business.dto.InputItemExcelDto;
import com.yeejoin.amos.patrol.business.dto.InputItemExcelVo;
import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
import com.yeejoin.amos.patrol.business.param.InputItemPageParam;
import com.yeejoin.amos.patrol.business.param.InputItemParam;
......@@ -20,12 +26,14 @@ import com.yeejoin.amos.patrol.business.vo.PointInputItemVo;
import com.yeejoin.amos.patrol.common.enums.DictTypeEnum;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import com.yeejoin.amos.patrol.core.common.request.ToJson;
import com.yeejoin.amos.patrol.core.enums.QueryOperatorEnum;
import com.yeejoin.amos.patrol.core.util.StringUtil;
import com.yeejoin.amos.patrol.dao.entity.InputItem;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import liquibase.pro.packaged.S;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -36,14 +44,13 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
/**
* 检查项
......@@ -317,6 +324,92 @@ public class InputItemController extends AbstractBaseController {
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导入检查项", notes = "导入检查项")
@PostMapping(value = "/importData", produces = "application/json;charset=UTF-8")
public void importData(@RequestPart("file") MultipartFile multipartFile) {
try {
List<InputItemExcelDto> inputItemExcelDtos = ExcelUtil.readFirstSheetExcel(multipartFile, InputItemExcelDto.class, 1);
for (InputItemExcelDto inputItemExcelDto : inputItemExcelDtos) {
if (StringUtils.isEmpty(inputItemExcelDto.getItemNo()) || StringUtils.isEmpty(inputItemExcelDto.getName()) || StringUtils.isEmpty(inputItemExcelDto.getInputClassify())){
throw new BadRequest("编号、名称、检查类型不能为空");
}
//组装参数 因部分字段数据数据库中用json统一保存 按类型组装为所需数据结构
if (inputItemExcelDto.getItemType().equals("选择") && StringUtil.isNotEmpty(inputItemExcelDto.getDataJson())){
List<InputItemDataDto> itemDataDtos = new ArrayList<>();
if (inputItemExcelDto.getDataJson().contains("|")) {
String[] datas = inputItemExcelDto.getDataJson().split("\\|");
List<String> list = Arrays.asList(datas);
list.forEach(e->{
String[] data = e.split(",");
InputItemDataDto inputItemDataDto = new InputItemDataDto(data[0],data[1],data[2],data[3]);
itemDataDtos.add(inputItemDataDto);
});
}else {
String[] data = inputItemExcelDto.getDataJson().split(",");
InputItemDataDto inputItemDataDto = new InputItemDataDto(data[0],data[1],data[2],data[3]);
itemDataDtos.add(inputItemDataDto);
}
inputItemExcelDto.setDataJson(JSON.toJSONString(itemDataDtos));
}else if(inputItemExcelDto.getItemType().equals("数字") && StringUtil.isNotEmpty(inputItemExcelDto.getDataJson())){
InputItemDataJsonlDto inputItemDataJsonlDto = new InputItemDataJsonlDto();
BeanUtils.copyProperties(inputItemExcelDto,inputItemDataJsonlDto);
inputItemExcelDto.setDataJson(JSON.toJSONString(inputItemExcelDto));
}
//转化为新增接口所需参数
InputItemParam inputItemParam = new InputItemParam();
BeanUtils.copyProperties(inputItemExcelDto,inputItemParam);
//新增接口
this.addNewItemNew(inputItemParam);
}
} catch (Exception e) {
throw new BadRequest(e.getMessage());
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出检查项", notes = "导出检查项")
@RequestMapping(value = "/exportData", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public void exportData(HttpServletResponse response) {
InputItemPageParam criterias = new InputItemPageParam();
List<InputItemExcelVo> content = inputItemMapper.getInputItemInfoExcelNew(criterias);
//此处对数据做统一处理 拼接为易读内容
for (InputItemExcelVo inputItemExcelDto : content) {
String text = "";
if (inputItemExcelDto.getItemType().equals("选择")&& !inputItemExcelDto.getDataJson().equals("[]")) {
List<Map> maps = JSONObject.parseArray(inputItemExcelDto.getDataJson(), Map.class);
for (int i = 0; i< maps.size(); i++) {
Map jsonObject = maps.get(i);
text = text + jsonObject.get("name")+","+jsonObject.get("score")+","+jsonObject.get("isOk")+","+jsonObject.get("isChecked");
if(i < (maps.size()-1) ){
text = text+"|";
inputItemExcelDto.setDataJson(text);
}else {
inputItemExcelDto.setDataJson(text);
}
}
}
if (inputItemExcelDto.getItemType().equals("数字") || inputItemExcelDto.getItemType().equals("文本")) {
//此处为避免大量set方法 将data_json字段中的数据转为对象组装
InputItemDataJsonlDto inputItemDataJsonlDto = JSONObject.parseObject(inputItemExcelDto.getDataJson(), InputItemDataJsonlDto.class);
BeanUtils.copyProperties(inputItemDataJsonlDto,inputItemExcelDto);
inputItemExcelDto.setDataJson(null);
}
}
ExcelUtil.createTemplate(response,"检查项","检查项",content,InputItemExcelVo.class,null,true);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "模板下载", notes = "模板下载")
@RequestMapping(value = "/downTemplate", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public void downTemplate(HttpServletResponse response) {
ExcelUtil.createTemplate(response,"检查项模板","检查项",null,InputItemExcelDto.class,null,true);
}
/**
* 删除检查项
*
......@@ -446,7 +539,10 @@ public class InputItemController extends AbstractBaseController {
String companyBizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
List<PointInputItemVo> list = inputItemService.queryCustomInputItemNew(params,orgCode,companyBizOrgCode);
return CommonResponseUtil.success(list);
Object ov=ToJson.tojson(list);
return CommonResponseUtil.success(ov);
}
/**
* 条件查询检查项
......@@ -557,7 +653,6 @@ public class InputItemController extends AbstractBaseController {
}
}
if (CollectionUtils.isNotEmpty(inputItemDao.findByItemNo(param.getItemNo(), param.getId() != 0 ? String.valueOf(param.getId()) : null))) {
throw new BadRequest("该编号已存在,请重新输入");
}
......
......@@ -11,6 +11,7 @@ import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;
import com.yeejoin.amos.patrol.business.util.PlanPageParamUtil;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import com.yeejoin.amos.patrol.core.common.request.ToJson;
import com.yeejoin.amos.patrol.dao.entity.Plan;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -238,7 +239,8 @@ public class PlanController extends AbstractBaseController {
public CommonResponse queryPointById(@ApiParam(value = "计划id", required = true) @PathVariable(name = "id") Long id) {
Plan plan = planService.queryPlanById(id);
return CommonResponseUtil.success(plan);
Object ob= plan!=null?ToJson.tojson(plan):null;
return CommonResponseUtil.success(ob);
}
......
......@@ -225,15 +225,14 @@ public class PlanTaskController extends AbstractBaseController {
@ApiOperation(value = "执行计划导出", notes = "执行计划导出")
@GetMapping (value = "/reportPlanTaskNew", produces = "application/vnd.ms-excel;charset=UTF-8")
public void planTaskReportNew(
@ApiParam(value = "导出参数", required = false) @RequestBody(required = false)PlanTaskPageParam params,
@ApiParam(value = "导出参数", required = false) PlanTaskPageParam params,
HttpServletResponse response) {
try {
PlanTaskPageParam paramsk =new PlanTaskPageParam();
ReginParams reginParams = getSelectedOrgInfo();
paramsk.setBizOrgCode(reginParams.getPersonIdentity().getCompanyBizOrgCode());
params.setBizOrgCode(reginParams.getPersonIdentity().getCompanyBizOrgCode());
List<PlanTaskVo> list = planTaskService.planTaskReportNew(paramsk);
List<PlanTaskVo> list = planTaskService.planTaskReportNew(params);
String fileName = "计划执行" + new Date().getTime();
FileHelper.exportExcel(list, "计划执行", "计划执行", PlanTaskVo.class, fileName + ".xls", response);
} catch (Exception e) {
......@@ -464,6 +463,9 @@ public class PlanTaskController extends AbstractBaseController {
try {
HashMap<String, Object> params = new HashMap<String, Object>();
ReginParams reginParams = getSelectedOrgInfo();
if (pointNo.contains("\r")){
pointNo=pointNo.replace("\r","");
}
String loginOrgCode =reginParams.getPersonIdentity().getCompanyBizOrgCode();
params.put("bizOrgCode", loginOrgCode);
params.put("pointNo", pointNo);
......
......@@ -20,6 +20,7 @@ import com.yeejoin.amos.patrol.business.vo.*;
import com.yeejoin.amos.patrol.core.async.AsyncTask;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import com.yeejoin.amos.patrol.core.common.request.ToJson;
import com.yeejoin.amos.patrol.core.common.response.PointResponse;
import com.yeejoin.amos.patrol.dao.entity.*;
import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
......@@ -117,10 +118,10 @@ public class PointController extends AbstractBaseController {
public CommonResponse queryEquipPointInputItemNew(@ApiParam(value = "巡检点id", required = true) @RequestParam Long pointId) {
try {
List<Map<String, Object>> pointInputItemList = iPointService.queryEquipPointInputItem(pointId);
Page<Map<String, Object>> pag =new PageImpl<Map<String, Object>>(pointInputItemList);
return CommonResponseUtil.success(pag);
Object ov= pag!=null?ToJson.tojson(pag):null;
return CommonResponseUtil.success(ov);
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("查询巡检点的巡检项失败");
......@@ -864,7 +865,7 @@ public class PointController extends AbstractBaseController {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
String fileName = "巡检点导入模板.xls"; //模板名称
String[] handers = {"点编号","点名称","是否为移动点","计划外巡检是否评分","是否允许离线巡检","参考地址","最少拍照数量","最多拍照数量","风险等级","备注说明","检查项目","是否室内","归属单位/部门","责任人","所在建筑"}; //列标题
String[] handers = {"点编号","点名称","是否为移动点","计划外巡检是否评分","是否允许离线巡检","参考地址","最少拍照数量","最多拍照数量","风险等级","备注说明","是否室内","归属单位/部门","责任人","所在建筑", "装备对象|检查项编号"}; //列标题
List<String[]> downData = new ArrayList();
String[] isScore = {"否","是"};
String[] isFixed = {"否","是"};
......@@ -926,7 +927,7 @@ public class PointController extends AbstractBaseController {
} else {
downData.add(new String[0]);
}
String [] downRows = {"2","3","4", "8","11","12","13","14"}; //下拉的列序号数组(序号从0开始)
String [] downRows = {"2","3","4", "8","10","11","12","13"}; //下拉的列序号数组(序号从0开始)
try {
FileHelper.createExcelTemplate(fileName, handers, downData, downRows, response);
......@@ -1431,7 +1432,10 @@ public class PointController extends AbstractBaseController {
ReginParams reginParams = getSelectedOrgInfo();
String companyBizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
return CommonResponseUtil.success(iPointService.queryPointList4RouteNew(companyBizOrgCode,riskSourceId, pointNo, name, pageNumber, pageSize,companyId));
Page Page=iPointService.queryPointList4RouteNew(companyBizOrgCode,riskSourceId, pointNo, name, pageNumber, pageSize,companyId);
Object ob=Page!=null?ToJson.tojson(Page):null;
return CommonResponseUtil.success(ob);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -1616,4 +1620,12 @@ public class PointController extends AbstractBaseController {
return CommonResponseUtil.failure("查询巡检点信息失败");
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询巡检点绑定设备巡检项", notes = "查询巡检点绑定设备巡检项")
@GetMapping(value = "/equip/item/list", produces = "application/json;charset=UTF-8")
public CommonResponse getEquipItemList(@ApiParam(value = "巡检点id", required = true) @RequestParam Long routeId,
@ApiParam(value = "巡检点id", required = true) @RequestParam Long pointId){
return CommonResponseUtil.success(iPointService.queryEquipPointItemListByPointId(routeId, pointId));
}
}
......@@ -18,6 +18,7 @@ import com.yeejoin.amos.patrol.core.async.AsyncTask;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.core.common.request.CommonRequest;
import com.yeejoin.amos.patrol.core.common.request.RoutePointInputItemRequest;
import com.yeejoin.amos.patrol.core.common.request.ToJson;
import com.yeejoin.amos.patrol.core.common.response.RoutePointRespone;
import com.yeejoin.amos.patrol.dao.entity.InputItem;
import com.yeejoin.amos.patrol.dao.entity.Plan;
......@@ -140,7 +141,10 @@ public class RouteController extends AbstractBaseController {
//2.查询
List<Route> routeList = routeService.queryRouteListNew(orgCode);
List<Route> list = routeList.stream().filter(e -> e.getIsExist().equals("true")).collect(Collectors.toList());
return CommonResponseUtil.success(!Objects.isNull(isRemove) && 1 == isRemove ? routeList : list);
return CommonResponseUtil.success(!Objects.isNull(isRemove) && 1 == isRemove ? (routeList!=null?ToJson.tojson(routeList):null) : (list!=null?ToJson.tojson(list):null));
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("查询巡检路线信息失败");
......@@ -162,8 +166,11 @@ public class RouteController extends AbstractBaseController {
if(!StringUtils.isEmpty(route.getName())){
List<Route> list = iRouteDao.getListByName(route.getName());
if (!ObjectUtils.isEmpty(list) || list.size()>0){
List<Route> list =null;
list = route.getId()>0?iRouteDao.getListByNameUpdate(route.getId(),route.getName()):iRouteDao.getListByName(route.getName());
if (!ObjectUtils.isEmpty(list) || list.size()>0){
throw new BadRequest("该名称路线已存在");
}
}
......@@ -187,7 +194,7 @@ public class RouteController extends AbstractBaseController {
return CommonResponseUtil.success(routeService.addRouteNew(route));
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("巡检路线新增失败");
return CommonResponseUtil.failure(e.getMessage());
}
}
......
package com.yeejoin.amos.patrol.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.patrol.business.dto.InputItemExcelDto;
import com.yeejoin.amos.patrol.business.dto.InputItemExcelVo;
import com.yeejoin.amos.patrol.business.param.InputItemPageParam;
import com.yeejoin.amos.patrol.business.vo.InputItemVo;
import com.yeejoin.amos.patrol.business.vo.PointInputItemVo;
......@@ -30,6 +32,8 @@ public interface InputItemMapper extends BaseMapper<InputItem> {
public List<InputItemVo> getInputItemInfoNew(InputItemPageParam param);
public List<InputItemExcelVo> getInputItemInfoExcelNew(InputItemPageParam param);
Map<Long, Long> getAllCountInfo();
Map<String,String> getEquipParentCode(String code);
......@@ -57,6 +61,8 @@ public interface InputItemMapper extends BaseMapper<InputItem> {
public List<PointInputItemVo> queryCustomInputItem( HashMap<String, Object> param );
List<PointInputItemVo> queryCustomInputItemByCodes(@Param("inputItemNos") List<String> inputItemNos);
public List<InputItemVo> getInputItemListByitemNos(@Param("itemNos") String[] itemNos);
public List<PointInputItemVo> queryCustomInputItemByPointId(@Param("classifyId") String classifyId );
......
package com.yeejoin.amos.patrol.business.dao.mapper;
import com.yeejoin.amos.patrol.dao.entity.RoutePointItem;
import com.yeejoin.amos.patrol.dao.entity.RoutePointItem;
import java.util.HashMap;
import java.util.List;
public interface RoutePointItemMapper extends BaseMapper {
......@@ -11,4 +14,12 @@ public interface RoutePointItemMapper extends BaseMapper {
int delRoutePointItemByPointId(Long pointId);
public void insertRoutePointItem(RoutePointItem pointItem);
/**
* 根据装备编码查装备信息
* @param equipCode 装备code
* @return
*/
HashMap<String, String> getEquipByCode(String equipCode);
}
......@@ -25,4 +25,8 @@ public interface IRouteDao extends BaseDao<Route, Long> {
@Query(value = "select * from p_route where `name` = ?1 and is_delete =0", nativeQuery = true)
List<Route> getListByName(String name);
@Query(value = "select * from p_route where id !=?1 and `name` = ?2 and is_delete =0", nativeQuery = true)
List<Route> getListByNameUpdate(Long id,String name);
}
package com.yeejoin.amos.patrol.business.dto;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.StringUtils;
import java.util.Date;
@Data
public class ExcelDto {
@ApiModelProperty(value = "文件名称")
private String fileName;
@ApiModelProperty(value = "sheet页名称")
private String sheetName;
@ApiModelProperty(value = "类包全路径")
private String classUrl;
@ApiModelProperty(value = "导出类型 来源于ExcelEnums常量")
private String type;
public ExcelDto(String fileName, String sheetName, String classUrl, String type) {
super();
this.fileName = fileName;
this.sheetName = sheetName;
this.classUrl = classUrl;
this.type = type;
}
public ExcelDto(String fileName, String sheetName, String type) {
this.fileName = fileName;
this.sheetName = sheetName;
this.type = type;
}
public ExcelDto() {
}
public String getFileName() {
return StringUtils.isEmpty(fileName) ? DateUtils.convertDateToString(new Date(), "yyyyMMddHHmmss") : fileName;
}
public String getSheetName() {
return StringUtils.isEmpty(sheetName) ? "Sheet1" : sheetName;
}
}
package com.yeejoin.amos.patrol.business.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "InputItemDataDto", description = "检查项文本JSON数据")
@Data
public class InputItemDataDto extends BaseDto {
private String name;
private String score;
private String isOk;
private String isChecked;
public InputItemDataDto(String name, String score, String isOk, String isChecked) {
this.name = name;
this.score = score;
this.isOk = isOk;
this.isChecked = isChecked;
}
}
package com.yeejoin.amos.patrol.business.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "InputItemDataJsonlDto", description = "检查项JSON数据")
@Data
public class InputItemDataJsonlDto extends BaseDto {
@ApiModelProperty(value = "合格评分数")
private Integer okScore;
@ApiModelProperty(value = "不合格评分数")
private Integer noScore;
@ApiModelProperty(value = "合格判断方法")
private String checkType;
@ApiModelProperty(value = "有效值上限")
private Integer validUp;
@ApiModelProperty(value = "有效值下限")
private Integer validDown;
@ApiModelProperty(value = "合格值上限")
private Integer okUp;
@ApiModelProperty(value = "合格值下限")
private Integer okDown;
@ApiModelProperty(value = "强制校验,输入值不能大于有效值上限")
private String checkValidUp;
@ApiModelProperty(value = "强制校验,输入值不能小于有效值下限")
private String checkValidDown;
@ApiModelProperty(value = "合格判断,输入值大于合格值上限时为不合格")
private String checkOkUp;
@ApiModelProperty(value = "合格判断,输入值小于合格值上限时为不合格")
private String checkOkDown;
@ApiModelProperty(value = "小数点后位数")
private Integer precision;
public String getCheckValidUp() {
if (checkValidUp != null) {
return checkValidUp.equals("true") ? "是":"否";
}
return checkValidUp;
}
public String getCheckValidDown() {
if (checkValidDown != null) {
return checkValidDown.equals("true") ? "是":"否";
}
return checkValidDown;
}
public String getCheckOkUp() {
if (checkOkUp != null) {
return checkOkUp.equals("true") ? "是":"否";
}
return checkOkUp;
}
public String getCheckOkDown() {
if (checkOkDown != null) {
return checkOkDown.equals("true") ? "是":"否";
}
return checkOkDown;
}
}
......@@ -179,20 +179,21 @@ public class PointImportParam {
/**
* 负责人id
*/
@Excel(name = "责任人", orderNum = "13")
@Excel(name = "责任人", orderNum = "12")
private String chargePersonId;
@Excel(name = "检查项目", orderNum = "10")
// @Excel(name = "检查项目", orderNum = "10")
@ExcelIgnore
private String inputItems;
@Excel(name = "是否室内",replace={"是_1", "否_0"}, orderNum = "11")
@Excel(name = "是否室内",replace={"是_1", "否_0"}, orderNum = "10")
private String isIndoor = "0";
/**
* 归属区域/部门id
*/
@Excel(name = "归属单位/部门", orderNum = "12")
@Excel(name = "归属单位/部门", orderNum = "11")
private String chargeDeptId ;
......@@ -205,7 +206,7 @@ public class PointImportParam {
/**
* 物理区域id(数据来源于装备wl_area)
*/
@Excel(name = "所在建筑", orderNum = "14")
@Excel(name = "所在建筑", orderNum = "13")
private String areaId;
/**
* 物理区域名称(数据来源于装备wl_area)
......@@ -213,6 +214,17 @@ public class PointImportParam {
@ExcelIgnore
private String areaName;
@Excel(name = "装备对象|检查项编号", orderNum = "14")
private String equipInputInfo;
public String getEquipInputInfo() {
return equipInputInfo;
}
public void setEquipInputInfo(String equipInputInfo) {
this.equipInputInfo = equipInputInfo;
}
public String getChargeDeptId() {
return chargeDeptId;
}
......
......@@ -11,6 +11,7 @@ import com.yeejoin.amos.patrol.business.constants.XJConstant;
import com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.PointMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper;
import com.yeejoin.amos.patrol.business.dao.repository.*;
import com.yeejoin.amos.patrol.business.dto.PointClassifySynDto;
import com.yeejoin.amos.patrol.business.entity.mybatis.CheckPtListBo;
......@@ -19,6 +20,7 @@ import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
import com.yeejoin.amos.patrol.business.param.*;
import com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService;
import com.yeejoin.amos.patrol.business.service.intfc.IPointService;
import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;
import com.yeejoin.amos.patrol.business.util.DaoCriteria;
import com.yeejoin.amos.patrol.business.vo.*;
import com.yeejoin.amos.patrol.common.enums.PointStatusEnum;
......@@ -45,6 +47,7 @@ import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource;
......@@ -92,7 +95,8 @@ public class PointServiceImpl implements IPointService {
private ICatalogTreeDao catalogTreeDao;
@Autowired
private InputItemMapper inputItemMapper;
@Autowired
private RoutePointItemMapper routePointItemMapper;
@Resource
IPlanTaskDao planTaskDao;
@Autowired
......@@ -175,6 +179,7 @@ public class PointServiceImpl implements IPointService {
}
@Override
@Transactional
public List<Long> addImportPoint(List<PointImportParam> list, String orgCode, String userId) {
List<Long> ids = new ArrayList<>();
......@@ -188,6 +193,21 @@ public class PointServiceImpl implements IPointService {
if (count > 0) {// 该单位已存在该编号的点
continue;
}
if (ObjectUtils.isEmpty(param.getChargePersonId())) {
throw new BadRequest("责任人不能为空");
}
if (!ObjectUtils.isEmpty(param.getName())) {
List<Point> result = iPointDao.findByName(param.getName(), null);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(result)) {
throw new BadRequest(param.getName()+"该名称巡检点已存在");
}
}
if (!ObjectUtils.isEmpty(param.getPointNo())) {
List<Point> result = iPointDao.findByNo(param.getPointNo(), null);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(result)) {
throw new BadRequest(param.getPointNo()+"该编号已存在");
}
}
point.setAddress(param.getAddress());
point.setCatalogId(param.getCatalogId() == null ? 0 : param.getCatalogId());
// 负责人
......@@ -260,6 +280,64 @@ public class PointServiceImpl implements IPointService {
}
iPointDao.saveAndFlush(point);
ids.add(point.getId());
if (StringUtil.isNotEmpty(param.getEquipInputInfo())) {
String[] infos = param.getEquipInputInfo().split("\\|");
for (int i = 0; i < infos.length; i++) {
String[] split = infos[i].split(":");
String equipCode = split[0];
List<String> inputItemCodes = Arrays.asList(split[1].split(","));
List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(point.getId());
HashMap<String, String> equipByCode = routePointItemMapper.getEquipByCode(equipCode);
if (ObjectUtils.isEmpty(equipByCode)) {
throw new BadRequest("装备编码不存在");
}
PointClassify newPointClassify = new PointClassify();
newPointClassify.setEquipmentId(equipByCode.get("equipmentId"));
newPointClassify.setName(equipByCode.get("name"));
// newPointClassify.setInspectionSpecName();
newPointClassify.setCreatorId(userId);
newPointClassify.setPointId(point.getId());
newPointClassify.setOrderNo(0);
newPointClassify.setDataSourceCode("1");
newPointClassify.setDataSourceName("消防装备");
newPointClassify.setAddress(equipByCode.get("address"));
newPointClassify.setBuildingId(String.valueOf(equipByCode.get("sourceId")));
String uuid = UUID.randomUUID().toString().replace("-", "");
newPointClassify.setOriginalId(uuid.substring(0, 16));
newPointClassify.setCategoryCode(equipByCode.get("categoryCode"));
newPointClassify.setCategoryName(equipByCode.get("categoryName"));
newPointClassify.setCode(equipByCode.get("code"));
newPointClassify.setBuildingName(equipByCode.get("fullName"));
List<PointClassify> pointClassifies = iPointClassifyDao.queryByPointIdAndEquipmentId(point.getId(), equipByCode.get("equipmentId"));
if (!CollectionUtils.isEmpty(pointClassifies)) {
newPointClassify.setId(pointClassifies.get(0).getId());
}
this.addPointClassifyByPointId(newPointClassify);
List<PointInputItemVo> customInputList = inputItemMapper.queryCustomInputItemByCodes(inputItemCodes);
for (PointInputItemVo pItemVo : customInputList) {
PointInputItem pointInputItem = new PointInputItem();
pointInputItem.setPointId(newPointClassify.getPointId());
pointInputItem.setInputItemId(pItemVo.getId());
pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString());
pointInputItem.setId(0);
pointInputItem.setOrderNo(pItemVo.getpOrderNo());
PointInputItem pointInputItemResult = iPointInputItemDao.save(pointInputItem);
//更新巡检路线
if (routePointList.size() > 0) {
Long classifyId = newPointClassify.getId();
for (RoutePoint routePoint : routePointList) {
RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setPointClassifyId(classifyId);
routePointItem.setPointInputItemId(pointInputItemResult.getId());
routePointItem.setRoutePointId(routePoint.getId());
iRoutePointItemDao.save(routePointItem);
}
}
}
}
}
String inputItems = param.getInputItems();
if (!ObjectUtils.isEmpty(inputItems)) {
String[] itemNos = inputItems.replaceAll(" ", "").split(",");
......@@ -1692,6 +1770,16 @@ public class PointServiceImpl implements IPointService {
}
@Override
public List<String> queryEquipPointItemListByPointId(Long routeId, Long pointId) {
Long[] longs = new Long[]{pointId};
List<RoutePoint> list = iRoutePointDao.queryRoutePoint(routeId, longs);
String excludeItems = list.get(0).getExcludeItems();
String strings[] = excludeItems.split(",");
List<String> itemIds = Arrays.asList(strings);
return itemIds;
}
@Override
public List<PointResponse> getPointConfigDom() {
// TODO Auto-generated method stub
return pointMapper.getPointConfigDom();
......
......@@ -372,4 +372,6 @@ public interface IPointService {
void syncPointClassify(Map<String,Object> map);
List<PointInputItemVo> queryOldPointInputItemNew(Long pointId, Long id);
List<String> queryEquipPointItemListByPointId(Long routeId, Long pointId);
}
......@@ -309,6 +309,23 @@
ec.parent_id,
ec.CODE,
ec.NAME,
CONCAT(
ec.NAME,
CONCAT(
'(',
(
SELECT
count( 1 )
FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
......@@ -326,38 +343,72 @@
<select id="getEquipmentCategoryListByFacilities" resultMap="Category">
SELECT ec.id,
ec.parent_id,
ec.CODE,
ec.NAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
ec.remark,
ec.create_date,
i.`name` as industryName,
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment')
AS type
ec.parent_id,
ec.CODE,
ec.NAME,
CONCAT(
ec.NAME,
CONCAT(
'(',
(
SELECT
count( 1 )
FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
ec.remark,
ec.create_date,
i.`name` as industryName,
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment')
AS type
FROM wl_equipment_category ec
left join wl_industry i on ec.industry_code = i.code
left join wl_industry i on ec.industry_code = i.code
WHERE
ec.code LIKE CONCAT ('930','%')
ec.code LIKE CONCAT ('930','%')
UNION ALL
SELECT ec.id,
ec.parent_id,
ec.code as CODE,
ec.NAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
ec.remark,
ec.create_date,
i.`name` as industryName,
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment')
AS type
ec.parent_id,
ec.code as CODE,
ec.NAME,
CONCAT(
ec.NAME,
CONCAT(
'(',
(
SELECT
count( 1 )
FROM
p_input_item pit
WHERE
pit.equipment_type = ec.CODE
AND pit.is_delete = 0
AND pit.biz_org_code LIKE concat( '%', 'LSHLZ1yOrS3WfXqzjn', '%' )
),
')'
)
) AS countNAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
ec.remark,
ec.create_date,
i.`name` as industryName,
IF(LEFT(ec.CODE, 1) = 2 and ec.industry_code = 2, 'car', 'equipment')
AS type
FROM wl_equipment_category ec
left join wl_industry i on ec.industry_code = i.code
left join wl_industry i on ec.industry_code = i.code
WHERE
<!-- (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '1302863809086623746') or (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '846')-->
<!-- (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '1302863809086623746') or (ec.code LIKE CONCAT ('92','%') and ec.parent_id = '846')-->
ec.code like CONCAT ('92', '%')
</select>
......@@ -555,4 +606,24 @@
AND is_delete = '0'
AND input_type!='1'
</select>
<select id="getEquipItemCount" resultType="java.lang.String">
SELECT
CONCAT('(' , COUNT(1) ,')') as countName
FROM
p_input_item pit
WHERE
pit.equipment_type is not null
AND is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
</select>
<select id="getFireItemCount" resultType="java.lang.String">
SELECT
CONCAT('(' , COUNT(1) ,')') as countName
FROM
p_input_item pit
WHERE
pit.facilities_type is not null
AND is_delete = 0
AND pit.biz_org_code LIKE concat( '%', #{bizOrgCode}, '%' )
</select>
</mapper>
......@@ -1291,19 +1291,19 @@
AS `status`
FROM
(SELECT ffs.id,ffs.name FROM f_fire_fighting_system ffs
WHERE ffs.biz_org_code = #{bizOrgCode}
WHERE ffs.biz_org_code like concat(#{bizOrgCode} ,'%')
) temp
LEFT JOIN
(SELECT esa.system_ids,COUNT(DISTINCT(esa.iot_code)) AS notReturned
FROM wl_equipment_specific_alarm esa
WHERE esa.type = "BREAKDOWN"
and esa.equipment_specific_index_value = "true" and esa.create_date BETWEEN #{startTime} and #{endTime}
and esa.equipment_specific_index_value = "true" and esa.`status`=true and esa.create_date BETWEEN #{startTime} and #{endTime}
GROUP BY esa.system_ids)temp1
on
FIND_IN_SET(temp.id,temp1.system_ids)
LEFT JOIN
(SELECT esa.system_ids,COUNT(DISTINCT(esa.iot_code)) AS total
LEFT JOIN
(SELECT esa.system_ids,COUNT(DISTINCT(esa.iot_code)) AS total
FROM wl_equipment_specific_alarm esa
WHERE esa.type = "BREAKDOWN" and esa.create_date BETWEEN #{startTime} and #{endTime}
GROUP BY esa.system_ids)temp2
......@@ -1328,12 +1328,12 @@
(
SELECT COUNT(DISTINCT(esa.iot_code)) FROM wl_equipment_specific_alarm esa
WHERE esa.org_code = #{orgCode}
and create_date between #{startTime} and #{endTime}
and update_date between #{startTime} and #{endTime}
)AS alarmEquipNum,
(
SELECT COUNT(DISTINCT(esa.iot_code)) FROM wl_equipment_specific_alarm esa
WHERE esa.org_code = #{orgCode} AND esa.equipment_specific_index_value = "true"
and create_date between #{startTime} and #{endTime}
and update_date between #{startTime} and #{endTime}
)as notReturned)temp
</select>
<select id="inspectionMessage" resultType="java.util.Map">
......
......@@ -162,8 +162,9 @@
`wes`.`system_id`
)) AS `code`,
wes.system_id systemId,
(SELECT fs.name FROM f_fire_fighting_system fs WHERE `wes`.`system_id`=fs.id) AS systemName
FROM
( SELECT GROUP_CONCAT(fs.name) FROM f_fire_fighting_system fs WHERE `wes`.`system_id` like CONCAT("%",fs.id,'%') ) AS systemName
FROM
wl_equipment_specific AS wes
where TRIM(wes.iot_code) != '' AND wes.iot_code IS NOT NULL
UNION ALL
......
......@@ -2201,7 +2201,7 @@
)
)
) AS `todayAlarmNum`,
IF (
(
(
......@@ -3904,7 +3904,7 @@
<select id="selectAlarmList" resultType="java.util.Map">
select
a1.*,
(a1.num - a1.alarm_equip_num) as normalEquipNum,
ABS(a1.num - a1.alarm_equip_num) as normalEquipNum,
concat(FORMAT( (abs( ( (a1.num - a1.alarm_equip_num) / IF ( a1.num = 0, 1, a1.num ) ) ) * 100
),2), '%') as normalEquipPercent,
......@@ -4222,8 +4222,40 @@
if (SUM(a1.lastAlarmNum)>0,IFNULL( convert( ABS(SUM(a1.alarmNum)-SUM(a1.lastAlarmNum))/SUM(a1.lastAlarmNum),char(5)),'-'),ABS(SUM(a1.alarmNum)-SUM(a1.lastAlarmNum)))*100 as alarmWOW,
(CASE WHEN (SUM(a1.exepctionNum)-SUM(a1.lastExepctionNum)) &lt;0 THEN '减少' else '增加' end ) as status1,
(CASE WHEN (SUM(a1.alarmNum)-SUM(a1.lastAlarmNum)) &lt;0 THEN '减少' else '增加' end ) as status2,
FORMAT(if(SUM(a1.num)>0, convert(SUM(a1.num - a1.exepctionNum)/SUM(a1.num),char(5)), SUM(a1.num - a1.exepctionNum))*100, 2) as normalRate,
FORMAT(if(SUM(a1.num)>0,convert(SUM(a1.faultNum)/SUM(a1.num),char(5)),SUM(a1.faultNum)) *100, 2) as faultRate,
FORMAT(
IF
(
SUM( a1.num ) > 0,
(
abs(
(
SUM( a1.num - a1.exepctionNum ) /
IF
( SUM( a1.num ) = 0, 1, SUM( a1.num ) )
)
)
),
SUM( a1.num - a1.exepctionNum )
) * 100,
2
) AS normalRate,
FORMAT(
IF
(
SUM( a1.num ) > 0,
(
abs(
(
SUM( a1.faultNum ) /
IF
( SUM( a1.num ) = 0, 1, SUM( a1.num ) )
)
)
),
SUM( a1.faultNum )
) * 100,
2
) AS faultRate,
a1.create_date
from
(SELECT
......@@ -4672,7 +4704,27 @@
</select>
<select id="getWaterInfoBySuper" resultType="java.util.Map">
select * from (
select
*,
(
CASE
WHEN nowLevel IS NOT NULL
AND maxLevel IS NOT NULL
AND nowLevel - maxLevel > 0 THEN
'1'
WHEN nowLevel IS NOT NULL
AND minLevel IS NOT NULL
AND nowLevel != '--'
AND nowLevel - minLevel >= 0 THEN
'2'
WHEN nowLevel IS NOT NULL
AND minLevel IS NOT NULL AND nowLevel != '--'
AND minLevel - nowLevel > 0 THEN
'0' ELSE '4'
END
) AS `status`
from (
(SELECT
r.`name`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
......@@ -4757,7 +4809,7 @@
) a
)) b
ORDER BY
sequence_nbr DESC
status ASC
</select>
<select id="getFoamTankBySuper" resultType="java.util.Map">
......@@ -4871,7 +4923,10 @@
a.nowPressureDate,
(
CASE
WHEN nowPressure IS NOT NULL
AND maxLevel IS NOT NULL
AND nowPressure - maxLevel > 0 THEN
'压力高'
WHEN nowPressure IS NOT NULL
AND minLevel IS NOT NULL
AND nowPressure - minLevel >= 0 THEN
......
......@@ -12,7 +12,7 @@
wv.video_type as videoType,
wv.preset_position as presetPosition
from wl_supervision_video wsv left join wl_video wv on wsv.camera_id = wv.id
where wsv.biz_org_code like concat(#{bizOrgCode},'%');
where wsv.biz_org_code like concat(#{bizOrgCode},'%') AND wv.id IS NOT NULL;
</select>
<select id="queryVideoAllId" resultType="java.lang.String">
......
......@@ -31,7 +31,9 @@
v.type,
v.url,
v.img,
v.address
v.address,
v.video_type as videoType,
v.token as token
FROM
wl_video v
<where>
......@@ -40,6 +42,7 @@
where important_equipment_id = #{importantEquipmentId})
</if>
</where>
ORDER BY v.create_date DESC
</select>
<select id="getVideoAddressGroupList" resultType="java.lang.String">
SELECT
......@@ -53,5 +56,6 @@
</if>
</where>
GROUP BY v.address
ORDER BY v.create_date DESC
</select>
</mapper>
......@@ -176,12 +176,15 @@
vid.name as name,
vid.url,
vid.code,
vid.address,
vid.img,
vid.video_type as videoType,
vid.preset_position as presetPosition,
vid.name
from wl_video_equipment_specific as ves
left join wl_video as vid on ves.video_id = vid.id
where equipment_specific_id = #{id}
ORDER BY vid.create_date DESC
</select>
<select id="getVideoById" resultType="com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO">
SELECT
......
## DB properties:
spring.datasource.url=jdbc:mysql://172.16.10.215:3306/dl_amos_common_biz?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.url=jdbc:mysql://172.16.11.201:3306/dl_amos_common_biz?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=Yeejoin@2020
## eureka properties:
eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@172.16.10.215:10001/eureka/
eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@172.16.11.201:10001/eureka/
spring.security.user.name=admin
spring.security.user.password=a1234560
## redis properties:danger/list
spring.redis.database=1
spring.redis.host=172.16.10.215
spring.redis.host=172.16.11.201
spring.redis.port=6379
spring.redis.password=yeejoin@2020
## ES properties:
biz.elasticsearch.address=172.16.10.215
biz.elasticsearch.address=172.16.11.201
spring.data.elasticsearch.cluster-name=elasticsearch
spring.data.elasticsearch.cluster-nodes=${biz.elasticsearch.address}:9300
spring.elasticsearch.rest.uris=http://${biz.elasticsearch.address}:9200
......@@ -28,7 +28,7 @@ elasticsearch.password= Yeejoin@2020
## emqx properties:
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.215:1883
emqx.broker=tcp://172.16.11.201:1883
emqx.user-name=admin
emqx.password=public
......@@ -42,9 +42,13 @@ rule.definition.default-agency=jcs
#spring.data.mongodb.uri=mongodb://172.16.6.60:27017/command_db
## file properties:
file.url=http://39.98.45.134:9000/
file.url=http://172.16.11.201:9000/
video.url=https://11.11.16.4:443/
ifc.url=http://11.11.16.17/IFCInterface
ifc.call-back.localIp=11.11.16.1
#ƽ̨Ӧ
privilege.fegin.name=AMOS-API-PRIVILEGE
feign.client.config.default.connect-timeout=20000
feign.client.config.default.read-timeout=20000
\ No newline at end of file
[
{
"type": "管理员",
"group": "1476527581793099777",
"roleSeqs": [
"1242292537276882946",
"1262313307763683330",
"1262313395743404033",
"1232939411144667138"
],
"appCodes": [
"studio_normalapp_3056965",
"studio_normalapp_3532826",
"studio_normalapp_3143547",
"AMOS_STUDIO",
"AMOS_ADMIN"
]
},
{
"type": "非管理员",
"group": "1476527581793099777",
"roleSeqs": [
"1242292537276882946",
"1262313307763683330",
"1262313395743404033",
"1232939411144667138"
],
"appCodes": [
"studio_normalapp_3056965",
"studio_normalapp_3532826",
"studio_normalapp_3143547",
"AMOS_STUDIO",
"AMOS_ADMIN"
]
}
]
\ No newline at end of file
......@@ -114,7 +114,7 @@
'%Y-%m-%d'
) = curdate()
</if>
<if test="isExecute!=null and isExecute!='' and isExecute = '3'">and a.is_OK != #{isExecute}</if>
<if test="isExecute!=null and isExecute!='' and isExecute == '3'">and a.is_OK != #{isExecute}</if>
</trim>
</select>
......@@ -219,6 +219,7 @@
a.user_name,
a.dep_name department_name,
a.dep_id departmentId,
wws.name address,
date_format(
`a`.`check_time`,
'%Y-%m-%d %H:%i:%s'
......@@ -249,7 +250,6 @@
) as is_ok,
a.score,
d.`name` AS `route_name`,
(
CASE
WHEN a.check_mode = 'QR'
......@@ -266,9 +266,6 @@
'系统自检'
END
) as check_mode,
e.`name` AS `plan_name`,
a.plan_task_id,
a.plan_id,
......@@ -281,6 +278,7 @@
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id`
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id`
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id`
LEFT JOIN wl_warehouse_structure wws on wws.id = b.risk_source_id
<if test="dangerId != null and dangerId != ''">
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id
</if>
......@@ -324,7 +322,7 @@
'%Y-%m-%d'
) = curdate()
</if>
<if test="isExecute!=null and isExecute!='' and isExecute = 3">and a.is_OK != #{isExecute}</if>
<if test="isExecute!=null and isExecute!='' and isExecute == '3'">and a.is_OK != #{isExecute}</if>
</trim>
order by ${orderBy}
<choose>
......
......@@ -65,6 +65,8 @@
<result property="facilitiesType" column="facilities_type" />
<result property="equipmentType" column="equipment_type" />
</resultMap>
<!--统计 -->
<select id="countInputItemInfoData" resultType="long">
SELECT
......@@ -177,48 +179,19 @@
ORDER BY create_date DESC
</select>
<select id="queryCustomInputItemByPointId" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo">
-- SELECT
-- pii.id,
-- pii.org_code,
-- pii.name,
-- ppi.order_no as order_no,
-- pii.item_type ,
-- pii.is_must,
-- pii.input_json,
-- pii.catalog_id,
-- pii.is_delete,
-- pii.item_no,
-- pii.risk_desc,
-- pii.input_classify,
-- pii.picture_json,
-- pii.check_method,
-- pii.title,
-- pii.equipment_name,
-- pii.input_type,
-- pii.basis_json,
-- pii.level
-- FROM
-- p_point_classify ppc
-- LEFT JOIN p_point_inputitem ppi ON ppi.classify_ids = ppc.id
-- LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
--
-- WHERE pii.is_delete = '0'
SELECT
pii.*,
ppi.order_no as pOrderNo,
ppi.id as pointItemId,
ppc.name as classifyNames,
ppc.id as classifyIds
<!-- ,prpi.id as routePointItemId-->
FROM
p_point_classify ppc
LEFT JOIN p_point_inputitem ppi ON ppi.classify_ids = ppc.id and ppc.point_id=ppi.point_id
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
<!-- lEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = pii.id-->
WHERE pii.is_delete = '0'
<if test="classifyId!=null and classifyId !='' "> AND ppc.id = #{classifyId}</if>
<!-- <if test="pointId!=null and pointId !='' "> AND ppc.point_id = #{pointId}</if>-->
<!-- <if test="equipmentId!=null and equipmentId !='' "> AND ppc.equipment_id = #{equipmentId}</if>-->
<if test="classifyId!=null and classifyId !='' "> AND ppi.classify_ids = #{classifyId}</if>
</select>
<select id="getInputItemListByitemNos" resultType="com.yeejoin.amos.patrol.business.vo.InputItemVo">
SELECT
......@@ -386,6 +359,93 @@
</choose>
</select>
<select id="getInputItemInfoExcelNew" resultType="com.yeejoin.amos.patrol.business.dto.InputItemExcelVo">
SELECT
a.id,
a.name,
a.item_no,
a.item_type,
a.is_must,
a.default_value,
a.is_score,
b.name as catalog_name,
a.remark,
a.input_classify,
a.check_method,
(CASE a.equipment_type
WHEN '-1'
THEN '通用消防装备'
ELSE
(select name from wl_equipment_category where code = a.equipment_type AND industry_code = 2)
END) as equipment_type,
(CASE a.facilities_type
WHEN '-1'
THEN '通用消防设施'
ELSE (select name from wl_equipment_category where code = a.facilities_type AND industry_code = 2)
END) as facilities_type,
(CASE a.level
WHEN 1 THEN
'一级'
WHEN 2 THEN
'二级'
WHEN 3 THEN
'三级'
WHEN 4 THEN
'四级'
ELSE
'五级'
IFNULL(a.key_parts_type,1) AS keyPartsType,
IFNULL(a.custom_type,1) AS customType,
a.risk_desc,
a.data_json
from
p_input_item a left join p_catalog_tree b on a.catalog_id = b.id
where a.is_delete = '0'
and a.input_type!='1'
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%")</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if>
<if test="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
<if test="catalogIds !=null">
and a.catalog_id in <foreach collection="catalogIds" item="catalogId" index="index" open="(" separator="," close=")" >#{catalogId}</foreach>
</if>
<if test="bizOrgCode!=null and bizOrgCode!=''">
and a.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if>
<if test="treeId != null and treeId != '' and treeId == '-1'">
and a.facilities_type is not null
</if>
<if test="treeId != null and treeId != '' and treeId == '-2'">
and a.equipment_type is not null
</if>
<if test="treeId != null and treeId != '' and treeId == '-4'">
and a.key_parts_type is not null
</if>
<if test="treeId != null and treeId != '' and treeId == '-5'">
and a.custom_type is not null
</if>
<if test="subCode!=null and subCode!='' and subCode!=' ' and
treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
treeId != '-2' and treeId != '-4' and treeId != '-5' and treeId.contains('@'.toString())">
and LEFT (a.facilities_type, #{inhierarchy}) = #{subCode}
</if>
<if test="subCode!=null and subCode!='' and subCode!=' ' and
treeId != null and treeId != '' and treeId != '-3' and treeId != '-1' and
treeId != '-2' and treeId != '-4' and treeId != '-5' and !treeId.contains('@'.toString())">
and LEFT (a.equipment_type, #{inhierarchy}) = #{subCode}
</if>
<choose>
<when test="level == '-0' ">and a.level is null</when>
<when test="level!=null and level != '-0'">and a.level = #{level}</when>
</choose>
order by a.id desc
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select>
<select id="getEquipParentCode" resultType="map">
select * from wl_equipment_category where code = #{code} and industry_code = '2'
</select>
......@@ -461,4 +521,16 @@
</foreach>
</delete>
<select id="queryCustomInputItemByCodes" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo">
SELECT * FROM p_input_item
<where>
is_delete = '0'
<if test="inputItemNos != null and inputItemNos.size() > 0">
AND item_no IN
<foreach collection="inputItemNos" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -22,15 +22,15 @@
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- )-->
<if test="beginDate!=null and endDate!=null and endDate != '' and endDate == null">
<if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if>
<if test="beginDate==null and endDate != null and endDate != ''">
<if test="beginDate=='' and endDate != null and endDate != ''">
AND a.end_Time <![CDATA[<=]]> #{endDate}
</if>
<if test="beginDate!=null and beginDate != '' and endDate == null">
<if test="beginDate!=null and beginDate != '' and endDate == ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate}
</if>
......@@ -41,7 +41,6 @@
<if test="orgCode!=null">
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if>
<if test="bizOrgCode!=null"> and a.org_Code like concat (#{bizOrgCode},"%")</if>
<if test="searchDay!=null and searchDay != '' and searchDay == 1">
and a.`check_date` = curdate()
</if>
......@@ -104,15 +103,15 @@
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- )-->
<if test="beginDate!=null and endDate!=null and endDate != '' and endDate == null">
<if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if>
<if test="beginDate==null and endDate != null and endDate != ''">
<if test="beginDate=='' and endDate != null and endDate != ''">
AND a.end_Time <![CDATA[<=]]> #{endDate}
</if>
<if test="beginDate!=null and beginDate != '' and endDate == null">
<if test="beginDate!=null and beginDate != '' and endDate == ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate}
</if>
......
......@@ -1082,9 +1082,6 @@
LEFT JOIN p_point_classify ppc ON ppc.point_id = p.id
<where>
p.is_delete = 0
<if test="orgCode !=null and orgCode !=''">
and p.org_code = #{orgCode}
</if>
<if test="bizOrgCode !=null and bizOrgCode !=''">
and p.biz_org_code like CONCAT(#{bizOrgCode},'%')
</if>
......
......@@ -75,7 +75,50 @@
</insert>
<select id="getEquipByCode" resultType="java.util.HashMap">
SELECT
Cast( spec.id as char) as equipmentId,
spec.name AS name,
structure.source_id AS sourceId,
structure.source_code AS sourceCode,
spec.system_id AS systemId,
spec.code AS code,
spec.id AS id,
category.NAME AS categoryName,
category.CODE AS categoryCode,
equipment_detail.area AS address,
equipment_detail.equipment_name as eqpDefName,
equipment_detail.equipment_id as eqpDefId,
spec.biz_org_name as bizOrgName,
spec.position AS acre,
we.inspection_spec as inspectionSpecId,
0 as orderNo,
structure.full_name as fullName
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail equipment_detail ON equipment_detail.id = spec.equipment_detail_id
LEFT JOIN (
SELECT
DISTINCT equipment_specific_id
, warehouse_structure_id
FROM
wl_stock_detail
) AS detail ON detail.equipment_specific_id = spec.id
LEFT JOIN wl_warehouse_structure structure ON spec.warehouse_structure_id = structure.id
LEFT JOIN (
SELECT
s.id,
s.name AS prevName
FROM
wl_warehouse_structure s
) AS area ON area.id = structure.parent_id
LEFT JOIN wl_equipment we ON we.id = equipment_detail.equipment_id
LEFT JOIN wl_equipment_category category ON category.id = we.category_id
<where>
<if test="equipCode != '' and equipCode != null">and spec.code = #{equipCode}</if>
</where>
limit 1
</select>
......
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