Commit 7666d4d0 authored by chenhao's avatar chenhao

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

parents 8120623a 2c2c48f8
...@@ -64,7 +64,7 @@ public class ControllerAop { ...@@ -64,7 +64,7 @@ public class ControllerAop {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest(); HttpServletRequest request = attributes.getRequest();
// 不需要添加请求头的接口 // 不需要添加请求头的接口
String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany", "/jcs/command/lookHtmlText", "/jcs/common/duty-person/findByDutyAreaId", "/tzs/wechatBack", "/tzs/wechat-relation/save","/tzs/alert-called/saveMobile"}; String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany", "/jcs/command/lookHtmlText", "/jcs/common/duty-person/findByDutyAreaId", "/tzs/wechatBack", "/tzs/wechat-relation/save","/tzs/alert-called/saveMobile","/tzs/elevator/getElevatorInfo"};
// 获取请求路径 // 获取请求路径
for(String uri : url) { for(String uri : url) {
if(request.getRequestURI().indexOf(uri) != -1) { if(request.getRequestURI().indexOf(uri) != -1) {
......
...@@ -81,8 +81,8 @@ public class FireStationDto extends BaseDto { ...@@ -81,8 +81,8 @@ public class FireStationDto extends BaseDto {
@ExcelProperty(value = "装备简要情况", index = 9) @ExcelProperty(value = "装备简要情况", index = 9)
@ApiModelProperty(value = "装备简要情况") @ApiModelProperty(value = "装备简要情况")
private String equipmentBrief; private String equipmentBrief;
/*bug 2963 微型消防站,导入模板里面不应该有照片字段 2021-09-24 CEHNZHAO*/
@ExcelProperty(value = "微型消防站照片", index = 10) @ExcelIgnore
@ApiModelProperty(value = "图片信息") @ApiModelProperty(value = "图片信息")
private String img; private String img;
......
...@@ -103,19 +103,19 @@ public class WaterResourceDto extends BaseDto { ...@@ -103,19 +103,19 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "实景图集合") @ApiModelProperty(value = "实景图集合")
private List<Object> realityImgList; private List<Object> realityImgList;
@ExcelProperty(value = "方位图", index = 9) @ExcelIgnore
@ApiModelProperty(value = "方位图") @ApiModelProperty(value = "方位图")
private String orientationImg; private String orientationImg;
@ExcelProperty(value = "实景图", index = 10) @ExcelIgnore
@ApiModelProperty(value = "实景图") @ApiModelProperty(value = "实景图")
private String realityImg; private String realityImg;
@ExcelProperty(value = "联系人姓名", index = 11) @ExcelProperty(value = "联系人姓名", index = 9)
@ApiModelProperty(value = "联系人姓名") @ApiModelProperty(value = "联系人姓名")
private String contactUser; private String contactUser;
@ExcelProperty(value = "联系人电话", index = 12) @ExcelProperty(value = "联系人电话", index = 10)
@ApiModelProperty(value = "联系人电话") @ApiModelProperty(value = "联系人电话")
private String contactPhone; private String contactPhone;
...@@ -143,7 +143,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -143,7 +143,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "资源id") @ApiModelProperty(value = "资源id")
private Long resourceId; private Long resourceId;
@ExcelProperty(value = "高度(cm)", index = 13) @ExcelProperty(value = "高度(cm)", index = 11)
@ApiModelProperty(value = "高度(cm)") @ApiModelProperty(value = "高度(cm)")
private Float height; private Float height;
...@@ -151,16 +151,16 @@ public class WaterResourceDto extends BaseDto { ...@@ -151,16 +151,16 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "水源可用状态类别代码") @ApiModelProperty(value = "水源可用状态类别代码")
private String statusCode; private String statusCode;
@ExplicitConstraint(type = "SYKYZT", indexNum = 14, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "SYKYZT", indexNum = 12, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源可用状态", index = 14) @ExcelProperty(value = "水源可用状态", index = 12)
@ApiModelProperty(value = "水源可用状态类别名称") @ApiModelProperty(value = "水源可用状态类别名称")
private String status; private String status;
@ExcelProperty(value = "所属路段", index = 15) @ExcelProperty(value = "所属路段", index = 13)
@ApiModelProperty(value = "所属路段") @ApiModelProperty(value = "所属路段")
private String section; private String section;
@ExcelProperty(value = "所属管网", index = 16) @ExcelProperty(value = "所属管网", index = 14)
@ApiModelProperty(value = "所属管网") @ApiModelProperty(value = "所属管网")
private String pipeNetwork; private String pipeNetwork;
...@@ -168,33 +168,33 @@ public class WaterResourceDto extends BaseDto { ...@@ -168,33 +168,33 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消防给水管网形式类型代码") @ApiModelProperty(value = "消防给水管网形式类型代码")
private String pipeTypeCode; private String pipeTypeCode;
@ExplicitConstraint(type = "XFJSGWXS", indexNum = 17, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "XFJSGWXS", indexNum = 15, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防给水管网形式", index = 17) @ExcelProperty(value = "消防给水管网形式", index = 15)
@ApiModelProperty(value = "消防给水管网形式") @ApiModelProperty(value = "消防给水管网形式")
private String pipeTypeName; private String pipeTypeName;
@ExcelProperty(value = "管网直径(cm)", index = 18) @ExcelProperty(value = "管网直径(cm)", index = 16)
@ApiModelProperty(value = "管网直径(cm)") @ApiModelProperty(value = "管网直径(cm)")
private Float pipeDiameter; private Float pipeDiameter;
@ExcelProperty(value = "进水管直径(cm)", index = 19) @ExcelProperty(value = "进水管直径(cm)", index = 17)
@ApiModelProperty(value = "进水管直径(cm)") @ApiModelProperty(value = "进水管直径(cm)")
private Float inletPipeDiameter; private Float inletPipeDiameter;
@ExcelProperty(value = "出水管直径(cm)", index = 20) @ExcelProperty(value = "出水管直径(cm)", index = 18)
@ApiModelProperty(value = "出水管直径(cm)") @ApiModelProperty(value = "出水管直径(cm)")
private Float outletPipeDiameter; private Float outletPipeDiameter;
@ExcelProperty(value = "加水车道数量(个)", index = 21) @ExcelProperty(value = "加水车道数量(个)", index = 19)
@ApiModelProperty(value = "加水车道数量(个)") @ApiModelProperty(value = "加水车道数量(个)")
private Integer waterfillingLaneNum; private Integer waterfillingLaneNum;
@ExcelProperty(value = "供水单位名称", index = 22) @ExcelProperty(value = "供水单位名称", index = 20)
@ApiModelProperty(value = "供水单位名称") @ApiModelProperty(value = "供水单位名称")
private String waterSupplyName; private String waterSupplyName;
@ExplicitConstraint(type = "XHSXTLX", indexNum = 23, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "XHSXTLX", indexNum = 21, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消火栓系统类型", index = 23) @ExcelProperty(value = "消火栓系统类型", index = 21)
@ApiModelProperty(value = "消火栓系统类型") @ApiModelProperty(value = "消火栓系统类型")
private String systemType; private String systemType;
...@@ -202,7 +202,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -202,7 +202,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消火栓系统类型code") @ApiModelProperty(value = "消火栓系统类型code")
private String systemTypeCode; private String systemTypeCode;
@ExcelProperty(value = "消防设施状况", index = 24) @ExcelProperty(value = "消防设施状况", index = 22)
@ApiModelProperty(value = "消防设施状况分类") @ApiModelProperty(value = "消防设施状况分类")
private String facilitiesCategory; private String facilitiesCategory;
...@@ -210,12 +210,12 @@ public class WaterResourceDto extends BaseDto { ...@@ -210,12 +210,12 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消防设施状况分类code") @ApiModelProperty(value = "消防设施状况分类code")
private String facilitiesCategoryCode; private String facilitiesCategoryCode;
@ExcelProperty(value = "道路路口路段", index = 25) @ExcelProperty(value = "道路路口路段", index = 23)
@ApiModelProperty(value = "道路路口路段简要情况") @ApiModelProperty(value = "道路路口路段简要情况")
private String roadJunctionInfo; private String roadJunctionInfo;
@ExplicitConstraint(type = "XHSFZXS", indexNum = 26, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "XHSFZXS", indexNum = 24, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消火栓放置形式", index = 26) @ExcelProperty(value = "消火栓放置形式", index = 24)
@ApiModelProperty(value = "消火栓放置形式") @ApiModelProperty(value = "消火栓放置形式")
private String placeForm; private String placeForm;
...@@ -223,8 +223,8 @@ public class WaterResourceDto extends BaseDto { ...@@ -223,8 +223,8 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消火栓放置形式code") @ApiModelProperty(value = "消火栓放置形式code")
private String placeFormCode; private String placeFormCode;
@ExplicitConstraint(type = "XFSDJK", indexNum = 27, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "XFSDJK", indexNum = 25, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防水带接口", index = 27) @ExcelProperty(value = "消防水带接口", index = 25)
@ApiModelProperty(value = "消防水带接口") @ApiModelProperty(value = "消防水带接口")
private String hoseConnection; private String hoseConnection;
...@@ -232,8 +232,8 @@ public class WaterResourceDto extends BaseDto { ...@@ -232,8 +232,8 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消防水带接口code") @ApiModelProperty(value = "消防水带接口code")
private String hoseConnectionCode; private String hoseConnectionCode;
@ExplicitConstraint(type = "QSXS", indexNum = 28, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "QSXS", indexNum = 26, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "取水形式", index = 28) @ExcelProperty(value = "取水形式", index = 26)
@ApiModelProperty(value = "取水形式") @ApiModelProperty(value = "取水形式")
private String intakeForm; private String intakeForm;
...@@ -241,61 +241,61 @@ public class WaterResourceDto extends BaseDto { ...@@ -241,61 +241,61 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "水源类型代码") @ApiModelProperty(value = "水源类型代码")
private String typeCode; private String typeCode;
@ExplicitConstraint(type = "TRSYLX", indexNum = 29, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "TRSYLX", indexNum = 27, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源类型", index = 29) @ExcelProperty(value = "水源类型", index = 27)
@ApiModelProperty(value = "水源类型") @ApiModelProperty(value = "水源类型")
private String type; private String type;
@ExcelProperty(value = "容积(m³)", index = 30) @ExcelProperty(value = "容积(m³)", index = 28)
@ApiModelProperty(value = "容积(m³)") @ApiModelProperty(value = "容积(m³)")
private Float volume; private Float volume;
@ExcelProperty(value = "面积(㎡)", index = 31) @ExcelProperty(value = "面积(㎡)", index = 29)
@ApiModelProperty(value = "面积(㎡)") @ApiModelProperty(value = "面积(㎡)")
private Float area; private Float area;
@ExcelProperty(value = "水质情况", index = 32) @ExcelProperty(value = "水质情况", index = 30)
@ApiModelProperty(value = "水质情况") @ApiModelProperty(value = "水质情况")
private String qualitySituationInfo; private String qualitySituationInfo;
@ExcelProperty(value = "四季变化简要情况", index = 33) @ExcelProperty(value = "四季变化简要情况", index = 31)
@ApiModelProperty(value = "四季变化简要情况") @ApiModelProperty(value = "四季变化简要情况")
private String seasonChangeInfo; private String seasonChangeInfo;
@ExplicitConstraint(indexNum = 34, source = {"1", "0"}) //固定下拉内容 @ExplicitConstraint(indexNum = 32, source = {"1", "0"}) //固定下拉内容
@ExcelProperty(value = "有无枯水期", index = 34) @ExcelProperty(value = "有无枯水期", index = 32)
@ApiModelProperty(value = "有无枯水期") @ApiModelProperty(value = "有无枯水期")
private Boolean hasDrySeason; private Boolean hasDrySeason;
@ExcelProperty(value = "枯水期跨度简要情况", index = 35) @ExcelProperty(value = "枯水期跨度简要情况", index = 33)
@ApiModelProperty(value = "枯水期跨度简要情况") @ApiModelProperty(value = "枯水期跨度简要情况")
private String dryPeriodSpan; private String dryPeriodSpan;
@ExcelProperty(value = "取水高度(cm)", index = 36) @ExcelProperty(value = "取水高度(cm)", index = 34)
@ApiModelProperty(value = "取水高度(cm)") @ApiModelProperty(value = "取水高度(cm)")
private Float intakeHeight; private Float intakeHeight;
@ExcelProperty(value = "水源标高差(cm)", index = 37) @ExcelProperty(value = "水源标高差(cm)", index = 35)
@ApiModelProperty(value = "水源标高差(cm)") @ApiModelProperty(value = "水源标高差(cm)")
private Float elevationDifference; private Float elevationDifference;
@ExcelProperty(value = "停车位置", index = 38) @ExcelProperty(value = "停车位置", index = 36)
@ApiModelProperty(value = "停车位置") @ApiModelProperty(value = "停车位置")
private String parkingPosition; private String parkingPosition;
@ExcelProperty(value = "停车数量(个)", index = 39) @ExcelProperty(value = "停车数量(个)", index = 37)
@ApiModelProperty(value = "停车数量(个)") @ApiModelProperty(value = "停车数量(个)")
private Integer parkingNum; private Integer parkingNum;
@ExcelProperty(value = "储水量容积", index = 40) @ExcelProperty(value = "储水量容积", index = 38)
@ApiModelProperty(value = "储水量容积物联编码") @ApiModelProperty(value = "储水量容积物联编码")
private String iotWaterStorage; private String iotWaterStorage;
@ExcelProperty(value = "流量", index = 41) @ExcelProperty(value = "流量", index = 39)
@ApiModelProperty(value = "流量物联编码") @ApiModelProperty(value = "流量物联编码")
private String iotFlowRate; private String iotFlowRate;
@ExcelProperty(value = "状态", index = 42) @ExcelProperty(value = "状态", index = 40)
@ApiModelProperty(value = "状态物联编码") @ApiModelProperty(value = "状态物联编码")
private String iotStatus; private String iotStatus;
...@@ -313,7 +313,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -313,7 +313,7 @@ public class WaterResourceDto extends BaseDto {
private Long equipId; private Long equipId;
@ApiModelProperty("设施定义名称") @ApiModelProperty("设施定义名称")
@ExcelProperty(value = "设施定义名称", index = 43) @ExcelProperty(value = "设施定义名称", index = 41)
private String equipName; private String equipName;
@ExcelIgnore @ExcelIgnore
...@@ -322,7 +322,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -322,7 +322,7 @@ public class WaterResourceDto extends BaseDto {
// BUG 2935 优化项 分类从93060000 取得字典数据 by kongfm 2021-09-17 // BUG 2935 优化项 分类从93060000 取得字典数据 by kongfm 2021-09-17
@ApiModelProperty("设施分类名称") @ApiModelProperty("设施分类名称")
@ExplicitConstraint(indexNum = 44, sourceClass = RoleNameExplicitConstraint.class, method = "getEquipCategory") @ExplicitConstraint(indexNum = 44, sourceClass = RoleNameExplicitConstraint.class, method = "getEquipCategory")
@ExcelProperty(value = "设施分类名称", index = 44) @ExcelProperty(value = "设施分类名称", index = 42)
private String equipCategoryName; private String equipCategoryName;
@ApiModelProperty("设施编码") @ApiModelProperty("设施编码")
...@@ -330,6 +330,6 @@ public class WaterResourceDto extends BaseDto { ...@@ -330,6 +330,6 @@ public class WaterResourceDto extends BaseDto {
private String equipCode; private String equipCode;
@ApiModelProperty("维保周期") @ApiModelProperty("维保周期")
@ExcelProperty(value = "维保周期(月)", index = 45) @ExcelProperty(value = "维保周期(月)", index = 43)
private String maintenancePeriod; private String maintenancePeriod;
} }
...@@ -108,4 +108,9 @@ public class AlertCalledDto extends BaseDto{ ...@@ -108,4 +108,9 @@ public class AlertCalledDto extends BaseDto{
@ApiModelProperty(value = "警情状态str") @ApiModelProperty(value = "警情状态str")
private String alertStatusStr; private String alertStatusStr;
@ApiModelProperty(value = "来源系统")
private String systemSource;
@ApiModelProperty(value = "系统来源code")
private String systemSourceCode;
} }
...@@ -127,4 +127,11 @@ public class AlertCalled extends BaseEntity { ...@@ -127,4 +127,11 @@ public class AlertCalled extends BaseEntity {
@TableField(exist=false) @TableField(exist=false)
@ApiModelProperty(value = "警情状态str") @ApiModelProperty(value = "警情状态str")
private String alertStatusStr; private String alertStatusStr;
@ApiModelProperty(value = "来源系统")
private String systemSource;
@ApiModelProperty(value = "系统来源code")
private String systemSourceCode;
} }
...@@ -7,7 +7,6 @@ import lombok.Data; ...@@ -7,7 +7,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 警情接警填报记录 * 警情接警填报记录
...@@ -150,7 +149,7 @@ public class AlertCalledDto extends BaseDto { ...@@ -150,7 +149,7 @@ public class AlertCalledDto extends BaseDto {
private String describe; private String describe;
@ApiModelProperty(value = "图片") @ApiModelProperty(value = "图片")
private List<String> images; private String images;
@ApiModelProperty(value = "设备id") @ApiModelProperty(value = "设备id")
private Long equipmentId; private Long equipmentId;
......
...@@ -225,4 +225,8 @@ public class AlertCalled extends BaseEntity { ...@@ -225,4 +225,8 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "设备id") @ApiModelProperty(value = "设备id")
private Long equipmentId; private Long equipmentId;
@TableField("images")
@ApiModelProperty(value = "图片")
private String images;
} }
...@@ -10,6 +10,7 @@ import org.elasticsearch.index.query.BoolQueryBuilder; ...@@ -10,6 +10,7 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.DependsOn;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.data.elasticsearch.core.SearchHit; import org.springframework.data.elasticsearch.core.SearchHit;
...@@ -37,6 +38,7 @@ import com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository; ...@@ -37,6 +38,7 @@ import com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository;
* @version $Id: ESAlertCalledService.java, v 0.1 2021年6月19日 下午5:12:01 gwb Exp $ * @version $Id: ESAlertCalledService.java, v 0.1 2021年6月19日 下午5:12:01 gwb Exp $
*/ */
@Service @Service
@DependsOn("liquibase")
public class ESAlertCalledService { public class ESAlertCalledService {
@Autowired @Autowired
...@@ -73,7 +75,7 @@ public class ESAlertCalledService { ...@@ -73,7 +75,7 @@ public class ESAlertCalledService {
if (ValidationUtil.isEmpty(time)) //默认为同步48小时 if (ValidationUtil.isEmpty(time)) //默认为同步48小时
{ {
currentTime = currentTime - 48*60*60*1000; currentTime = currentTime - 48*60*60*1000;
}else }else
{ {
currentTime = currentTime - time*60*60*1000; currentTime = currentTime - time*60*60*1000;
} }
......
...@@ -294,7 +294,7 @@ public class ElevatorController extends BaseController { ...@@ -294,7 +294,7 @@ public class ElevatorController extends BaseController {
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getElevatorInfo", method = RequestMethod.GET) @RequestMapping(value = "/getElevatorInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取电梯使用单位", notes = "获取电梯使用单位") @ApiOperation(httpMethod = "GET", value = "根据电梯id或电梯救援识别码获取电梯信息", notes = "根据电梯id或电梯救援识别码获取电梯信息")
public ResponseModel<ElevatorInfoDto> getElevatorInfo(Long sequenceNbr,String rescueCode) { public ResponseModel<ElevatorInfoDto> getElevatorInfo(Long sequenceNbr,String rescueCode) {
if(StringUtils.isBlank(rescueCode) && sequenceNbr == null) { if(StringUtils.isBlank(rescueCode) && sequenceNbr == null) {
......
...@@ -4,28 +4,27 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,28 +4,27 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatAccessDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatAccessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue; import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.WechatRelation; import com.yeejoin.amos.boot.module.tzs.api.entity.WechatRelation;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.service.IDispatchTaskService; import com.yeejoin.amos.boot.module.tzs.api.service.IDispatchTaskService;
import com.yeejoin.amos.boot.module.tzs.api.service.IWechatService; import com.yeejoin.amos.boot.module.tzs.api.service.IWechatService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.WechatRelationServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.WechatRelationServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.SmsRecordModel; import com.yeejoin.amos.feign.systemctl.model.SmsRecordModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -33,6 +32,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -33,6 +32,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -49,8 +49,8 @@ import java.io.ByteArrayInputStream; ...@@ -49,8 +49,8 @@ import java.io.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
...@@ -67,6 +67,8 @@ public class WechatController extends BaseController { ...@@ -67,6 +67,8 @@ public class WechatController extends BaseController {
private final String token = "yeejoin_2021"; private final String token = "yeejoin_2021";
private final String WeUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=";
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
...@@ -111,6 +113,41 @@ public class WechatController extends BaseController { ...@@ -111,6 +113,41 @@ public class WechatController extends BaseController {
} }
/** /**
* 获取微信签名
* @param timestamp
* @param noncestr
* @param url
* @return
*/
@TycloudOperation(ApiLevel = UserType.ANONYMOUS , needAuth = false)
@GetMapping(value = "/getSignature")
@ApiOperation(httpMethod = "GET", value = "获取微信签名", notes = "获取微信签名")
public String getSignature(@RequestParam String timestamp,@RequestParam String noncestr,@RequestParam String url) {
List<String> params = new ArrayList<String>();
try {
if(!redisUtils.hasKey(RedisKey.WECHAT_TOKEN)){
throw new BadRequest("token不存在或已失效");
}
String token = redisUtils.get(RedisKey.WECHAT_TOKEN).toString();
String result = HttpUtils.doGet(WeUrl+token+"&type=jsapi");
JSONObject jsonObject = JSONObject.parseObject(result);
String ticket = jsonObject.get("ticket").toString();
params.add("jsapi_ticket="+ticket);
params.add(noncestr);
params.add(timestamp);
params.add(url);
Collections.sort(params);
String tokenStr = StringUtils.join(params,"&");
tokenStr = DigestUtils.sha1Hex(tokenStr);
return tokenStr;
} catch (Exception e) {
throw new BadRequest(e.getMessage());
}
}
/**
* 获取微信推送的操作通知 * 获取微信推送的操作通知
* @param xml * @param xml
* @param resp * @param resp
...@@ -618,4 +655,29 @@ public class WechatController extends BaseController { ...@@ -618,4 +655,29 @@ public class WechatController extends BaseController {
return ResponseHelper.buildResponse(dispatchTaskService.getTaskListByPhonePager(phone, taskType, currentPage)); return ResponseHelper.buildResponse(dispatchTaskService.getTaskListByPhonePager(phone, taskType, currentPage));
} }
/**
* 微信端图片上传
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/uploadImage")
@ApiOperation(httpMethod = "POST", value = "微信公众号上传图片", notes = "微信公众号上传图片")
public ResponseModel<String> uploadImage(@ApiParam(value = "图片", required = true)@RequestParam MultipartFile file
) {
if (ValidationUtil.isEmpty(file)){
throw new BadRequest("参数校验失败.");
}
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFile(file);
String urlString="";
if (date != null) {
Map<String, String> map = date.getResult();
Iterator<String> it = map.keySet().iterator();
while (it.hasNext()) {
urlString=it.next();
}
}
return ResponseHelper.buildResponse(urlString);
}
} }
...@@ -1481,6 +1481,30 @@ ...@@ -1481,6 +1481,30 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="tw" id="2021-09-24-0001">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_alert_called"/>
</preConditions>
<comment>警情来源系统</comment>
<sql>
ALTER TABLE `jc_alert_called` add system_source varchar(255) COMMENT '来源系统';
ALTER TABLE `jc_alert_called` add system_source_code varchar(255) COMMENT '系统来源code';
</sql>
</changeSet>
<changeSet author="tw" id="2021-09-24-0002">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions>
<comment>add data jc_alert_form</comment>
<sql>
INSERT INTO `cb_data_dictionary`(`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1242, '1242', '融合调度系统', 'SOURCE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary`(`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1243, '1243', '消防物联系统', 'SOURCE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary`(`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1244, '1244', '119接处警系统', 'SOURCE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
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