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 {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
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) {
if(request.getRequestURI().indexOf(uri) != -1) {
......
......@@ -81,8 +81,8 @@ public class FireStationDto extends BaseDto {
@ExcelProperty(value = "装备简要情况", index = 9)
@ApiModelProperty(value = "装备简要情况")
private String equipmentBrief;
@ExcelProperty(value = "微型消防站照片", index = 10)
/*bug 2963 微型消防站,导入模板里面不应该有照片字段 2021-09-24 CEHNZHAO*/
@ExcelIgnore
@ApiModelProperty(value = "图片信息")
private String img;
......
......@@ -108,4 +108,9 @@ public class AlertCalledDto extends BaseDto{
@ApiModelProperty(value = "警情状态str")
private String alertStatusStr;
@ApiModelProperty(value = "来源系统")
private String systemSource;
@ApiModelProperty(value = "系统来源code")
private String systemSourceCode;
}
......@@ -127,4 +127,11 @@ public class AlertCalled extends BaseEntity {
@TableField(exist=false)
@ApiModelProperty(value = "警情状态str")
private String alertStatusStr;
@ApiModelProperty(value = "来源系统")
private String systemSource;
@ApiModelProperty(value = "系统来源code")
private String systemSourceCode;
}
......@@ -7,7 +7,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* 警情接警填报记录
......@@ -150,7 +149,7 @@ public class AlertCalledDto extends BaseDto {
private String describe;
@ApiModelProperty(value = "图片")
private List<String> images;
private String images;
@ApiModelProperty(value = "设备id")
private Long equipmentId;
......
......@@ -225,4 +225,8 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "设备id")
private Long equipmentId;
@TableField("images")
@ApiModelProperty(value = "图片")
private String images;
}
......@@ -10,6 +10,7 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.DependsOn;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.data.elasticsearch.core.SearchHit;
......@@ -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 $
*/
@Service
@DependsOn("liquibase")
public class ESAlertCalledService {
@Autowired
......@@ -73,7 +75,7 @@ public class ESAlertCalledService {
if (ValidationUtil.isEmpty(time)) //默认为同步48小时
{
currentTime = currentTime - 48*60*60*1000;
}else
}else
{
currentTime = currentTime - time*60*60*1000;
}
......
......@@ -294,7 +294,7 @@ public class ElevatorController extends BaseController {
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@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) {
if(StringUtils.isBlank(rescueCode) && sequenceNbr == null) {
......
......@@ -4,28 +4,27 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.RedisKey;
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.WechatMyTaskDto;
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.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.IWechatService;
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.utils.HttpUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.SmsRecordModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
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.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -33,6 +32,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -49,8 +49,8 @@ import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
......@@ -67,6 +67,8 @@ public class WechatController extends BaseController {
private final String token = "yeejoin_2021";
private final String WeUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=";
@Autowired
RedisUtils redisUtils;
......@@ -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 resp
......@@ -618,4 +655,29 @@ public class WechatController extends BaseController {
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 @@
</sql>
</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>
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