Commit 34dfb7ce authored by suhuiguang's avatar suhuiguang

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

# Conflicts: # amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/WaterResourceDto.java
parents a2c65bbd cce69247
......@@ -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) {
......
......@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.biz.common.service;
import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
public interface IWorkflowExcuteService{
/**
......@@ -16,14 +18,14 @@ public interface IWorkflowExcuteService{
* @param processInstanceId 流程定义的ID
* @return true 可以执行,false 无执行权限
*/
boolean checkTaskAuth(String processInstanceId);
boolean checkTaskAuth(String processInstanceId, ReginParams userInfo);
/**
* 检查当前登录人有没有流程操作权限
* @param processInstanceId 流程定义的ID
* @return 包含是否执行的角色权限flag,以及当前任务的id
*/
Map<String, Object> checkTaskAuthMap(String processInstanceId);
Map<String, Object> checkTaskAuthMap(String processInstanceId, ReginParams userInfo);
/**
* 设置当前任务的执行人,只支持当前节点流程拥有单个可执行任务的情况,不支持并行网关产生的多条任务设置人的任务情况
* @param processInstanceId
......@@ -37,7 +39,7 @@ public interface IWorkflowExcuteService{
* @param userInfo
* @return
*/
boolean CompleteTask(String processInstanceId,String condition);
boolean CompleteTask(String processInstanceId,String condition, ReginParams userInfo);
}
......@@ -7,15 +7,19 @@ import java.util.Map;
import java.util.Random;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.service.IWorkflowExcuteService;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import ch.qos.logback.core.joran.conditional.IfAction;
@Service
public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
......@@ -43,49 +47,60 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
}
@Override
public boolean checkTaskAuth(String processInstanceId) {
Map<String, Object> map = checkTaskAuthMap(processInstanceId);
public boolean checkTaskAuth(String processInstanceId, ReginParams userInfo) {
Map<String, Object> map = checkTaskAuthMap(processInstanceId, userInfo);
return Boolean.parseBoolean(map.get("checkFlag").toString());
}
@Override
public Map<String, Object> checkTaskAuthMap(String processInstanceId) {
public Map<String, Object> checkTaskAuthMap(String processInstanceId, ReginParams userInfo) {
// 获取当前登录用户的角色
String currentLoginUserRole = userInfo.getRole().getRoleName();
String currentLoginUserId = userInfo.getUserModel().getUserId();
Map<String, Object> map = new HashMap<String, Object>();
map.put("checkFlag", false);
JSONObject teskObject = workflowFeignService.getTask(processInstanceId);
if (ObjectUtils.isNotEmpty(teskObject.getJSONObject("data"))) {
map.put("taskId", teskObject.getJSONObject("data").getString("id"));
map.put("checkFlag", true);
map.put("name", teskObject.getJSONObject("data").getString("name"));
JSONObject teskObject = workflowFeignService.getTaskList(processInstanceId);
if (ObjectUtils.isNotEmpty(teskObject)) {
JSONArray taskDetailArray = teskObject.getJSONArray("data");
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
if ("制定计划+内容".equals(detail.getString("name")) || "现场确认".equals(detail.getString("name")) ) {
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
map.put("name", detail.getString("name"));
return map;
}
JSONObject taskGroupNameObject = workflowFeignService.getTaskGroupName(detail.getString("id"));
// 获取流程中原本设置的当前节点的执行权限
JSONArray taskGroupNameDetail = taskGroupNameObject.getJSONArray("data");
// 如果拿不到当前任务的执行角色,再去获取当前任务有没有默认的执行人,如果都没有则返回校验失败
if (ObjectUtils.isEmpty(taskGroupNameDetail)) {
JSONObject taskAssignObject = workflowFeignService.getTaskAssign(detail.getString("id"));
String assignUser = taskAssignObject.getJSONObject("data").getString("assignee");
if (StringUtils.isNotBlank(assignUser)) {
// 如果当前登录人与当前任务的设定人不一定,则直接返回权限校验失败
if (!currentLoginUserId.equals(assignUser)) {
return map;
}
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
map.put("name", detail.getString("name"));
map.put("assign", assignUser);
return map;
}
continue;
}
String defaultExecutionRoleProcess = taskGroupNameDetail.getJSONObject(0).getString("groupId");
// 判断当前登录人的角色是不是与流程中设置的当前任务节点权限一致,一致则执行,不一致则退出
if (!defaultExecutionRoleProcess.equals(currentLoginUserRole)) {
continue;
}
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
map.put("name", detail.getString("name"));
map.put("groupName", currentLoginUserRole);
}
}
/*
* JSONObject teskObject = workflowFeignService.getTaskList(processInstanceId);
* if (ObjectUtils.isNotEmpty(teskObject)) { JSONArray taskDetailArray =
* teskObject.getJSONArray("data"); for (Object obj : taskDetailArray) {
* JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
* JSONObject taskGroupNameObject =
* workflowFeignService.getTaskGroupName(detail.getString("id")); //
* 获取流程中原本设置的当前节点的执行权限 JSONArray taskGroupNameDetail =
* taskGroupNameObject.getJSONArray("data"); //
* 如果拿不到当前任务的执行角色,再去获取当前任务有没有默认的执行人,如果都没有则返回校验失败 if
* (ObjectUtils.isEmpty(taskGroupNameDetail)) { JSONObject taskAssignObject =
* workflowFeignService.getTaskAssign(detail.getString("id")); String assignUser
* = taskAssignObject.getJSONObject("data").getString("assignee"); if
* (StringUtils.isNotBlank(assignUser)) { // 如果当前登录人与当前任务的设定人不一定,则直接返回权限校验失败 if
* (!currentLoginUserId.equals(assignUser)) { return map; } else {
* map.put("taskId", detail.getString("id")); map.put("checkFlag", true);
* map.put("name", detail.getString("name")); map.put("assign", assignUser);
* return map; } } continue; } String defaultExecutionRoleProcess =
* taskGroupNameDetail.getJSONObject(0).getString("groupId"); //
* 判断当前登录人的角色是不是与流程中设置的当前任务节点权限一致,一致则执行,不一致则退出 if
* (!defaultExecutionRoleProcess.equals(currentLoginUserRole)) { continue; }
* map.put("taskId", detail.getString("id")); map.put("checkFlag", true);
* map.put("name", detail.getString("name"));
* map.put("groupName",currentLoginUserRole); } }
*/
return map;
}
......@@ -126,8 +141,8 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
}
@Override
public boolean CompleteTask(String processInstanceId, String condition) {
Map<String, Object> map = checkTaskAuthMap(processInstanceId);
public boolean CompleteTask(String processInstanceId, String condition, ReginParams userInfo) {
Map<String, Object> map = checkTaskAuthMap(processInstanceId, userInfo);
if (Boolean.parseBoolean(map.get("checkFlag").toString())) {
HashMap<String, Object> conditionMap = new HashMap<String, Object>();
conditionMap.put("condition", condition);
......
......@@ -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;
......
......@@ -3,8 +3,8 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
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;
......@@ -103,19 +103,19 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "实景图集合")
private List<Object> realityImgList;
@ExcelProperty(value = "方位图", index = 9)
@ExcelIgnore
@ApiModelProperty(value = "方位图")
private String orientationImg;
@ExcelProperty(value = "实景图", index = 10)
@ExcelIgnore
@ApiModelProperty(value = "实景图")
private String realityImg;
@ExcelProperty(value = "联系人姓名", index = 11)
@ExcelProperty(value = "联系人姓名", index = 9)
@ApiModelProperty(value = "联系人姓名")
private String contactUser;
@ExcelProperty(value = "联系人电话", index = 12)
@ExcelProperty(value = "联系人电话", index = 10)
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
......@@ -143,7 +143,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "资源id")
private Long resourceId;
@ExcelProperty(value = "高度(cm)", index = 13)
@ExcelProperty(value = "高度(cm)", index = 11)
@ApiModelProperty(value = "高度(cm)")
private Float height;
......@@ -151,16 +151,16 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "水源可用状态类别代码")
private String statusCode;
@ExplicitConstraint(type = "SYKYZT", indexNum = 14, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源可用状态", index = 14)
@ExplicitConstraint(type = "SYKYZT", indexNum = 12, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源可用状态", index = 12)
@ApiModelProperty(value = "水源可用状态类别名称")
private String status;
@ExcelProperty(value = "所属路段", index = 15)
@ExcelProperty(value = "所属路段", index = 13)
@ApiModelProperty(value = "所属路段")
private String section;
@ExcelProperty(value = "所属管网", index = 16)
@ExcelProperty(value = "所属管网", index = 14)
@ApiModelProperty(value = "所属管网")
private String pipeNetwork;
......@@ -168,33 +168,33 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消防给水管网形式类型代码")
private String pipeTypeCode;
@ExplicitConstraint(type = "XFJSGWXS", indexNum = 17, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防给水管网形式", index = 17)
@ExplicitConstraint(type = "XFJSGWXS", indexNum = 15, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防给水管网形式", index = 15)
@ApiModelProperty(value = "消防给水管网形式")
private String pipeTypeName;
@ExcelProperty(value = "管网直径(cm)", index = 18)
@ExcelProperty(value = "管网直径(cm)", index = 16)
@ApiModelProperty(value = "管网直径(cm)")
private Float pipeDiameter;
@ExcelProperty(value = "进水管直径(cm)", index = 19)
@ExcelProperty(value = "进水管直径(cm)", index = 17)
@ApiModelProperty(value = "进水管直径(cm)")
private Float inletPipeDiameter;
@ExcelProperty(value = "出水管直径(cm)", index = 20)
@ExcelProperty(value = "出水管直径(cm)", index = 18)
@ApiModelProperty(value = "出水管直径(cm)")
private Float outletPipeDiameter;
@ExcelProperty(value = "加水车道数量(个)", index = 21)
@ExcelProperty(value = "加水车道数量(个)", index = 19)
@ApiModelProperty(value = "加水车道数量(个)")
private Integer waterfillingLaneNum;
@ExcelProperty(value = "供水单位名称", index = 22)
@ExcelProperty(value = "供水单位名称", index = 20)
@ApiModelProperty(value = "供水单位名称")
private String waterSupplyName;
@ExplicitConstraint(type = "XHSXTLX", indexNum = 23, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消火栓系统类型", index = 23)
@ExplicitConstraint(type = "XHSXTLX", indexNum = 21, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消火栓系统类型", index = 21)
@ApiModelProperty(value = "消火栓系统类型")
private String systemType;
......@@ -202,7 +202,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消火栓系统类型code")
private String systemTypeCode;
@ExcelProperty(value = "消防设施状况", index = 24)
@ExcelProperty(value = "消防设施状况", index = 22)
@ApiModelProperty(value = "消防设施状况分类")
private String facilitiesCategory;
......@@ -210,12 +210,12 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消防设施状况分类code")
private String facilitiesCategoryCode;
@ExcelProperty(value = "道路路口路段", index = 25)
@ExcelProperty(value = "道路路口路段", index = 23)
@ApiModelProperty(value = "道路路口路段简要情况")
private String roadJunctionInfo;
@ExplicitConstraint(type = "XHSFZXS", indexNum = 26, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消火栓放置形式", index = 26)
@ExplicitConstraint(type = "XHSFZXS", indexNum = 24, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消火栓放置形式", index = 24)
@ApiModelProperty(value = "消火栓放置形式")
private String placeForm;
......@@ -223,8 +223,8 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消火栓放置形式code")
private String placeFormCode;
@ExplicitConstraint(type = "XFSDJK", indexNum = 27, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防水带接口", index = 27)
@ExplicitConstraint(type = "XFSDJK", indexNum = 25, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防水带接口", index = 25)
@ApiModelProperty(value = "消防水带接口")
private String hoseConnection;
......@@ -232,8 +232,8 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消防水带接口code")
private String hoseConnectionCode;
@ExplicitConstraint(type = "QSXS", indexNum = 28, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "取水形式", index = 28)
@ExplicitConstraint(type = "QSXS", indexNum = 26, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "取水形式", index = 26)
@ApiModelProperty(value = "取水形式")
private String intakeForm;
......@@ -241,61 +241,61 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "水源类型代码")
private String typeCode;
@ExplicitConstraint(type = "TRSYLX", indexNum = 29, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源类型", index = 29)
@ExplicitConstraint(type = "TRSYLX", indexNum = 27, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源类型", index = 27)
@ApiModelProperty(value = "水源类型")
private String type;
@ExcelProperty(value = "容积(m³)", index = 30)
@ExcelProperty(value = "容积(m³)", index = 28)
@ApiModelProperty(value = "容积(m³)")
private Float volume;
@ExcelProperty(value = "面积(㎡)", index = 31)
@ExcelProperty(value = "面积(㎡)", index = 29)
@ApiModelProperty(value = "面积(㎡)")
private Float area;
@ExcelProperty(value = "水质情况", index = 32)
@ExcelProperty(value = "水质情况", index = 30)
@ApiModelProperty(value = "水质情况")
private String qualitySituationInfo;
@ExcelProperty(value = "四季变化简要情况", index = 33)
@ExcelProperty(value = "四季变化简要情况", index = 31)
@ApiModelProperty(value = "四季变化简要情况")
private String seasonChangeInfo;
@ExplicitConstraint(indexNum = 34, source = {"1", "0"}) //固定下拉内容
@ExcelProperty(value = "有无枯水期", index = 34)
@ExplicitConstraint(indexNum = 32, source = {"1", "0"}) //固定下拉内容
@ExcelProperty(value = "有无枯水期", index = 32)
@ApiModelProperty(value = "有无枯水期")
private Boolean hasDrySeason;
@ExcelProperty(value = "枯水期跨度简要情况", index = 35)
@ExcelProperty(value = "枯水期跨度简要情况", index = 33)
@ApiModelProperty(value = "枯水期跨度简要情况")
private String dryPeriodSpan;
@ExcelProperty(value = "取水高度(cm)", index = 36)
@ExcelProperty(value = "取水高度(cm)", index = 34)
@ApiModelProperty(value = "取水高度(cm)")
private Float intakeHeight;
@ExcelProperty(value = "水源标高差(cm)", index = 37)
@ExcelProperty(value = "水源标高差(cm)", index = 35)
@ApiModelProperty(value = "水源标高差(cm)")
private Float elevationDifference;
@ExcelProperty(value = "停车位置", index = 38)
@ExcelProperty(value = "停车位置", index = 36)
@ApiModelProperty(value = "停车位置")
private String parkingPosition;
@ExcelProperty(value = "停车数量(个)", index = 39)
@ExcelProperty(value = "停车数量(个)", index = 37)
@ApiModelProperty(value = "停车数量(个)")
private Integer parkingNum;
@ExcelProperty(value = "储水量容积", index = 40)
@ExcelProperty(value = "储水量容积", index = 38)
@ApiModelProperty(value = "储水量容积物联编码")
private String iotWaterStorage;
@ExcelProperty(value = "流量", index = 41)
@ExcelProperty(value = "流量", index = 39)
@ApiModelProperty(value = "流量物联编码")
private String iotFlowRate;
@ExcelProperty(value = "状态", index = 42)
@ExcelProperty(value = "状态", index = 40)
@ApiModelProperty(value = "状态物联编码")
private String iotStatus;
......@@ -313,7 +313,7 @@ public class WaterResourceDto extends BaseDto {
private Long equipId;
@ApiModelProperty("设施定义名称")
@ExcelProperty(value = "设施定义名称", index = 43)
@ExcelProperty(value = "设施定义名称", index = 41)
private String equipName;
@ExcelIgnore
......@@ -322,7 +322,7 @@ public class WaterResourceDto extends BaseDto {
// BUG 2935 优化项 分类从93060000 取得字典数据 by kongfm 2021-09-17
@ApiModelProperty("设施分类名称")
@ExplicitConstraint(indexNum = 44, sourceClass = CommonExplicitConstraint.class, method = "getEquipCategory")
@ExcelProperty(value = "设施分类名称", index = 44)
@ExcelProperty(value = "设施分类名称", index = 42)
private String equipCategoryName;
@ApiModelProperty("设施编码")
......@@ -330,6 +330,6 @@ public class WaterResourceDto extends BaseDto {
private String equipCode;
@ApiModelProperty("维保周期")
@ExcelProperty(value = "维保周期(月)", index = 45)
@ExcelProperty(value = "维保周期(月)", index = 43)
private String maintenancePeriod;
}
......@@ -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;
......
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* 微信公众号维修反馈dto 类
*/
@Data
@ApiModel(value="DispatchSaveFeedbackDto", description="救援回访DTO")
public class WechatDispatchFeedbackDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "任务id")
private Long taskId;
@ApiModelProperty(value = "维修结果")
private String fixResult;
@ApiModelProperty(value = "电梯故障原因分类")
private String errorResult;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "现场照片")
private List<AttachmentDto> imgs;
}
......@@ -225,4 +225,8 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "设备id")
private Long equipmentId;
@TableField("images")
@ApiModelProperty(value = "图片")
private String images;
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -31,4 +32,6 @@ public interface IDispatchTaskService {
Boolean saveFinish(Long taskId);
List<WechatMyTaskListDto> getTaskListByPhonePager(String phone,String typeCode,Long current);
WechatMyTaskDto saveWechatFeedBack(WechatDispatchFeedbackDto wechatDispatchFeedbackDto);
}
......@@ -36,7 +36,7 @@
<select id="getTaskInfoByTaskId" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto">
select
t.sequence_nbr
t.sequence_nbr,
t.alert_id as alertId,
p.sequence_nbr as paperId,
a.alert_stage as taskStatus,
......
......@@ -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;
}
......
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -84,4 +86,16 @@ public class DispatchTaskController extends BaseController {
List<DispatchTask> list = dispatchTaskServiceImpl.list(queryWrapper);
return ResponseHelper.buildResponse(list);
}
/**
* 微信公众号维修反馈接口
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveWechatFeed")
@ApiOperation(httpMethod = "POST", value = "微信公众号维修反馈接口", notes = "微信公众号维修反馈接口")
public ResponseModel<WechatMyTaskDto> saveWechatFeedBack(@RequestBody WechatDispatchFeedbackDto model) {
return ResponseHelper.buildResponse(dispatchTaskServiceImpl.saveWechatFeedBack(model));
}
}
......@@ -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);
}
}
......@@ -4,11 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.RescueProcessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
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.AlertCalled;
......@@ -31,11 +36,13 @@ import com.yeejoin.amos.boot.module.tzs.api.service.IRescueStationService;
import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import java.text.SimpleDateFormat;
import java.util.Date;
......@@ -82,6 +89,13 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
@Autowired
RescueProcessServiceImpl rescueProcessServiceImpl;
@Autowired
private DataDictionaryServiceImpl iDataDictionaryService;
@Autowired
ISourceFileService ISourceFileService;
/**
* 分页查询
*/
......@@ -243,6 +257,160 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
return baseMapper.getTaskListByPhonePager(phone, typeCode, current*5);
}
@Override
@Transactional
public WechatMyTaskDto saveWechatFeedBack(WechatDispatchFeedbackDto wechatDispatchFeedbackDto) {
// 更新反馈信息
DispatchTask task = this.getById(wechatDispatchFeedbackDto.getTaskId());
DispatchPaper dispatchPaper = dispatchPaperServiceImpl.getById(task.getPaperId());
// 反馈方式
dispatchPaper.setFeedbackCode("856");
dispatchPaper.setFeedbackType("主动反馈");
// 反馈时间
dispatchPaper.setFeedbackFinishTime(new Date());
dispatchPaper.setFeedbackTime(new Date());
// 反馈人信息
dispatchPaper.setFeedbackUid(task.getResponseUserId() + "");
dispatchPaper.setFeedbackUname(task.getResponseUserName());
dispatchPaper.setRepairUser(task.getResponseUserName());
// 保存照片
Map<String, List<AttachmentDto>> attachmentMap = new HashMap<>();
attachmentMap.put("imgs",wechatDispatchFeedbackDto.getImgs());
ISourceFileService.saveAttachments(task.getPaperId(),attachmentMap);
dispatchPaperServiceImpl.updateById(dispatchPaper);
// 动态字段
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,wechatDispatchFeedbackDto.getRemark()).
eq(AlertFormValue::getFieldCode,"fix_remark").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
if (StringUtils.isNotBlank(wechatDispatchFeedbackDto.getFixResult())) {
LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataDictionary::getType, TzsCommonParam.WXJG).eq(DataDictionary::getCode, wechatDispatchFeedbackDto.getFixResult());
DataDictionary fixResult = iDataDictionaryService.getOne(queryWrapper);
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,fixResult.getName()).
set(AlertFormValue::getFieldValueCode,fixResult.getCode()).
eq(AlertFormValue::getFieldCode,"fix_result").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
}
if (StringUtils.isNotBlank(wechatDispatchFeedbackDto.getErrorResult())) {
LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataDictionary::getType, TzsCommonParam.GZYY).eq(DataDictionary::getCode, wechatDispatchFeedbackDto.getErrorResult());
DataDictionary fixResult = iDataDictionaryService.getOne(queryWrapper);
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,fixResult.getName()).
set(AlertFormValue::getFieldValueCode,fixResult.getCode()).
eq(AlertFormValue::getFieldCode,"error_result").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(task.getAlertId(),TzsCommonParam.WXFK,task.getSequenceNbr(),null);
WechatMyTaskDto temp = this.getTaskInfoByTaskId(wechatDispatchFeedbackDto.getTaskId());
List<AlertFormValue> paperList = null;
LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>();
switch (temp.getTaskTypeCode()) {
case "960" : // 困人救援
temp.setHasDeadHurt("无");
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getAlertId());
// 警情动态表单数据
List<AlertFormValue> alertList = iAlertFormValueService.list(queryWrapper);
alertList.stream().forEach(t -> {
String value = t.getFieldValue();
if("trapped_floor_num".equals(t.getFieldCode())) {
// 被困楼层
temp.setTrappedFloorNum(value);
} else if("trapped_num".equals(t.getFieldCode())) {
// 被困人数
temp.setTrappedNum(value);
} else if("injured_num".equals(t.getFieldCode())) {
// 受伤人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
} else if("die_num".equals(t.getFieldCode())) {
// 死亡人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
}
});
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
}
});
// 预留照片处理
break;
case "961" : // 故障维修
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
} else if("feedback_result".equals(t.getFieldCode())) {
// 反馈结果
temp.setFeedbackResult(value);
}
});
break;
case "962" : // 投诉建议
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("action_result".equals(t.getFieldCode())) {
// 处置结果
temp.setActionResult(value);
}
});
break;
}
return temp;
}
@Transactional
@Override
public Boolean createDispatchTask(DispatchTaskDto dispatchTaskDto, AgencyUserModel sendUser) {
......
......@@ -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