Commit 0c831aa9 authored by kongfm's avatar kongfm

Merge remote-tracking branch 'origin/developer' into developer

parents 5333e2a0 70e87bb8
...@@ -18,7 +18,8 @@ public enum WorkFlowEnum { ...@@ -18,7 +18,8 @@ public enum WorkFlowEnum {
GROUPNAME("groupName","角色组的key"), GROUPNAME("groupName","角色组的key"),
NAME("name","任务节点的key"), NAME("name","任务节点的key"),
PROCESSINSTANCEID("processInstanceId",""), PROCESSINSTANCEID("processInstanceId",""),
ASSIGN("assignee","角色执行人key"); ASSIGN("assignee","角色执行人key"),
INFORMERLIST("informerList", "用户信息集合");
private String code;//对应菜单组件名称 private String code;//对应菜单组件名称
private String desc;//描述 private String desc;//描述
......
package com.yeejoin.amos.boot.biz.common.service; package com.yeejoin.amos.boot.biz.common.service;
import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -59,6 +60,12 @@ public interface IWorkflowExcuteService{ ...@@ -59,6 +60,12 @@ public interface IWorkflowExcuteService{
* @throws Exception * @throws Exception
*/ */
public Object getCurrentUserAllTaskList(String key, ReginParams userInfo) throws Exception; public Object getCurrentUserAllTaskList(String key, ReginParams userInfo) throws Exception;
/**
* 根据流程id获取下一节点操作人员userId集合
* @param procressId
* @return
* @throws Exception
*/
public List<String> getUserIdsByWorkflow(String procressId, String checkLeaderId) throws Exception;
} }
...@@ -16,11 +16,8 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -16,11 +16,8 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.*;
import java.util.HashMap; import java.util.stream.Collectors;
import java.util.Map;
import java.util.Random;
import java.util.Set;
@Service @Service
public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService { public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
...@@ -267,4 +264,27 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService { ...@@ -267,4 +264,27 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
return allTaskResultList; return allTaskResultList;
} }
/**
* 根据工作流获取下一审核人角色下的所有用户ID
* @return
*/
@Override
public List<String> getUserIdsByWorkflow(String procressId, String checkLeaderId) throws Exception {
List<String> userIds = new ArrayList<>();
JSONObject teskObject = workflowFeignService.getTaskList(procressId);
JSONArray taskDetailArray = teskObject.getJSONArray(WorkFlowEnum.DATA.getCode());
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
JSONArray informerList = detail.getJSONArray(WorkFlowEnum.INFORMERLIST.getCode());
if (informerList.size() > 0) {
userIds = informerList.stream().map(item -> {
JSONObject jsonItem = (JSONObject) item;
return jsonItem.getString("userId");
}).collect(Collectors.toList());
} else {
userIds.add(checkLeaderId);
}
}
return userIds;
}
} }
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.entity.SourceFile;
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 java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "LinkageUnitVo", description = "联动单位")
public class LinkageUnitVo extends BaseDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "单位名称", index = 0)
@ApiModelProperty(value = "单位名称")
private String unitName;
@ExcelIgnore
@ApiModelProperty(value = "单位code")
private String unitCode;
@ExcelIgnore
@ApiModelProperty(value = "父级单位id")
private String parentId;
@ExcelProperty(value = "服务类别", index = 1)
@ExplicitConstraint(type = "LDDWLB", indexNum = 1, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "服务类别")
private String linkageUnitType;
@ExcelIgnore
@ApiModelProperty(value = "联动单位类别code")
private String linkageUnitTypeCode;
@ExcelIgnore
@ApiModelProperty(value = "行政区划")
private String administrativeDivisions;
@ExcelIgnore
@ApiModelProperty(value = "行政区划代码")
private String administrativeDivisionsCode;
@ExcelProperty(value = "地址", index = 2)
@ApiModelProperty(value = "地址")
private String address;
@ExcelProperty(value = "经度", index = 3)
@ApiModelProperty(value = "经度")
private String longitude;
@ExcelProperty(value = "纬度", index = 4)
@ApiModelProperty(value = "纬度")
private String latitude;
@ExcelProperty(value = "协议开始日期", index = 5)
@ApiModelProperty(value = "协议开始日期")
private Date agreementStartDate;
@ExcelProperty(value = "协议结束日期", index = 6)
@ApiModelProperty(value = "协议结束日期")
private Date agreementEndDate;
@ExcelProperty(value = "应急联动单位类别", index = 7)
@ExplicitConstraint(type = "YJLDDW", indexNum = 7, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "应急联动单位类别")
private String emergencyLinkageUnit;
@ExcelIgnore
@ApiModelProperty(value = "应急联动单位类别code")
private String emergencyLinkageUnitCode;
@ExcelProperty(value = "联系人", index = 8)
@ApiModelProperty(value = "联系人 ")
private String contactUser;
@ExcelProperty(value = "联系人电话", index = 9)
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ExcelIgnore
@ApiModelProperty(value = "实例id")
private Long instanceId;
@ExcelIgnore
@ApiModelProperty(value = "组织机构代码")
private String orgCode;
@ExcelIgnore
@ApiModelProperty(value = "操作人名称")
private String recUserName;
@ExcelIgnore
@ApiModelProperty(value = "是否在协议期 ")
private String inAgreement;
@ExcelProperty(value = "消防救援能力", index = 10)
@ApiModelProperty(value = "消防救援能力")
private String fireRescueCapability;
@ExcelProperty(value = "职责_简要情况", index = 11)
@ApiModelProperty(value = "职责_简要情况")
private String responsibilitiesSituation;
@ExcelProperty(value = "应急服务内容", index = 12)
@ApiModelProperty(value = "应急服务内容")
private String emergencyServiceContent;
@ExcelProperty(value = "单位_简要情况", index = 13)
@ApiModelProperty(value = "单位_简要情况")
private String unitSituation;
@ExcelIgnore
@ApiModelProperty(value = "联动单位图片")
private List<SourceFile> image;
@ExcelIgnore
@ApiModelProperty(value = "车辆数量")
private String vehicleNumber;
@ExcelIgnore
@ApiModelProperty(value = "特岗人数")
private String personNumber;
}
...@@ -85,7 +85,8 @@ public interface EquipFeignClient { ...@@ -85,7 +85,8 @@ public interface EquipFeignClient {
@RequestParam String code , @RequestParam String code ,
@RequestParam String pageNum, @RequestParam String pageNum,
@RequestParam String pageSize, @RequestParam String pageSize,
@RequestParam Long id); @RequestParam Long id,
@RequestParam Boolean isNo );
......
...@@ -19,7 +19,7 @@ import java.util.Map; ...@@ -19,7 +19,7 @@ import java.util.Map;
public interface OrgUsrMapper extends BaseMapper<OrgUsr> { public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
String selectUpUnitByParam(@Param("id")String biz_org_code); String selectUpUnitByParam(@Param("id")String biz_org_code);
int selectPersonListCount(Map<String, Object> map); int selectPersonListCount(@Param("map")Map<String, Object> map);
List<Map<String, Object>> selectPersonList(@Param("map")Map<String, Object> map); List<Map<String, Object>> selectPersonList(@Param("map")Map<String, Object> map);
......
...@@ -29,5 +29,5 @@ public interface IDutyCarService extends IDutyCommonService { ...@@ -29,5 +29,5 @@ public interface IDutyCarService extends IDutyCommonService {
* @return * @return
*/ */
JSONObject isFireCarDriver(); JSONObject isFireCarDriver();
int getDutyCarCount(Long carId);
} }
...@@ -71,6 +71,6 @@ public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr); ...@@ -71,6 +71,6 @@ public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr);
public List<KeySiteDateDto> getKeySiteDate(Long id); public List<KeySiteDateDto> getKeySiteDate(Long id);
public List<KeySite> getKeySiteDateByNameLike(); public List<KeySite> getKeySiteDateByNameLike(Long companyId);
} }
...@@ -117,7 +117,7 @@ public interface IOrgUsrService { ...@@ -117,7 +117,7 @@ public interface IOrgUsrService {
OrgUsrDto saveOrgPerson(OrgPersonDto OrgPersonDto) throws Exception; OrgUsrDto saveOrgPerson(OrgPersonDto OrgPersonDto) throws Exception;
void updateByIdOrgUsr(OrgUsrDto OrgUsrDto, Long id) throws Exception; OrgUsrDto updateByIdOrgUsr(OrgUsrDto OrgUsrDto, Long id) throws Exception;
void updateByIdOrgPerson(OrgPersonDto OrgPersonDto, Long id) throws Exception; void updateByIdOrgPerson(OrgPersonDto OrgPersonDto, Long id) throws Exception;
......
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
linkageUnitTypeCode, linkageUnitTypeCode,
a.emergency_linkage_unit_code a.emergency_linkage_unit_code
emergencyLinkageUnitCode, emergencyLinkageUnitCode,
emergency_linkage_unit,
a.address , a.address ,
a.latitude, a.latitude,
a.longitude, a.longitude,
......
...@@ -57,18 +57,28 @@ ...@@ -57,18 +57,28 @@
on u.sequence_nbr = g.instance_id on u.sequence_nbr = g.instance_id
where where
u.biz_org_type = 'person' u.biz_org_type = 'person'
AND AND
u.is_delete = 0 u.is_delete = 0
<if test="map.bizOrgName != null">
GROUP BY AND u.biz_org_name like concat('%',#{map.bizOrgName},'%')
u.sequence_nbr , </if>
u.biz_org_name , <if test="map.personNumber!= null">
u.biz_org_code AND v.field_value like concat('%',#{map.personNumber},'%')
order by u.rec_date desc </if>
)a where a.sequenceNbr is not null <if test="map.bizOrgCode != null and map.bizOrgCode != '-1'">
AND u.biz_org_code like concat(#{map.bizOrgCode}, '%')
</select> </if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
order by u.rec_date desc
)a where a.sequenceNbr is not null
<if test="map.fieldsValue != null">
<foreach collection="map.fieldsValue.keys" item="item">AND a.${item} = #{map.fieldsValue[${item}]}</foreach>
</if>
</select>
<!--机场单位人员按时间倒叙排列add order by u.rec_date desc 2021-09-08 by kongfm --> <!--机场单位人员按时间倒叙排列add order by u.rec_date desc 2021-09-08 by kongfm -->
<select id="selectPersonList" resultType="Map"> <select id="selectPersonList" resultType="Map">
...@@ -487,7 +497,7 @@ GROUP BY ...@@ -487,7 +497,7 @@ GROUP BY
AND u.biz_org_code LIKE CONCAT(#{code}, '%') AND u.biz_org_code LIKE CONCAT(#{code}, '%')
</if> </if>
<if test="fieldCode != null and fieldCode.length > 0"> <if test="fieldCode != null and fieldCode.length > 0">
AND fi.field_code IN AND f.field_code IN
<foreach collection="fieldCode" item="item" index="index" open="(" close=")" separator=","> <foreach collection="fieldCode" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
......
...@@ -27,4 +27,19 @@ public class AlertCalledObjsDto extends BaseDto{ ...@@ -27,4 +27,19 @@ public class AlertCalledObjsDto extends BaseDto{
@ApiModelProperty(value = "动态表单值") @ApiModelProperty(value = "动态表单值")
private List<AlertFormValue> alertFormValue; private List<AlertFormValue> alertFormValue;
public String getRemark() {
String value="";
for (AlertFormValue al : alertFormValue) {
if (al.getFieldCode().equals("remark")) {
value=al.getFieldValue();
}
}
return value;
}
} }
...@@ -101,6 +101,12 @@ public class AlertCalled extends BaseEntity { ...@@ -101,6 +101,12 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
private Date updateTime; private Date updateTime;
@ApiModelProperty(value = "备注信息")
private String remark;
/*bug 2408 接警记录,按警情状态和接警时间筛选功能失效 陈召 2021-09-22 开始*/ /*bug 2408 接警记录,按警情状态和接警时间筛选功能失效 陈召 2021-09-22 开始*/
@ApiModelProperty(value = "接警时间开始---用于列表过滤") @ApiModelProperty(value = "接警时间开始---用于列表过滤")
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
a.call_time callTime, a.call_time callTime,
a.update_time updateTime, a.update_time updateTime,
a.rescue_grid rescueGrid, a.rescue_grid rescueGrid,
CONCAT(a.alert_type,' ',IFNULL((select field_value from jc_alert_form_value where jc_alert_form_value.alert_called_id =a.sequence_nbr and jc_alert_form_value.field_code='remark'),"")) alertType, CONCAT(a.alert_type,' ',IFNULL(a.remark,"")) alertType,
a.alert_type_code alarmTypeCode, a.alert_type_code alarmTypeCode,
a.unit_involved unitInvolved, a.unit_involved unitInvolved,
a.trapped_num trappedNum, a.trapped_num trappedNum,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
FROM FROM
( (
SELECT SELECT
a.sequence_nbr, MD5(RAND() * 10000) sequence_nbr,
a.dispatch_type, a.dispatch_type,
a.rec_date, a.rec_date,
a.address, a.address,
......
...@@ -108,7 +108,8 @@ public class CommandController extends BaseController { ...@@ -108,7 +108,8 @@ public class CommandController extends BaseController {
IDataDictionaryService dataDictionaryService; IDataDictionaryService dataDictionaryService;
@Autowired @Autowired
IFireChemicalService fireChemicalService; IFireChemicalService fireChemicalService;
@Autowired
IDutyCarService dutyCarService;
@Autowired @Autowired
IFireExpertsService fireExpertsService; IFireExpertsService fireExpertsService;
...@@ -1065,6 +1066,9 @@ public class CommandController extends BaseController { ...@@ -1065,6 +1066,9 @@ public class CommandController extends BaseController {
if (e.get("carState").equals("在位")){ if (e.get("carState").equals("在位")){
e.put("carState",FireCarStatusEnum.执勤.getName()); e.put("carState",FireCarStatusEnum.执勤.getName());
} }
e.put("longitude",116.423762);
e.put("latitude",39.511552);
String sequenceNbr = e.get("sequenceNbr").toString(); String sequenceNbr = e.get("sequenceNbr").toString();
//同步力量调派车辆任务状态 //同步力量调派车辆任务状态
alertFormValue.stream().forEach(v->{ alertFormValue.stream().forEach(v->{
...@@ -1083,7 +1087,14 @@ public class CommandController extends BaseController { ...@@ -1083,7 +1087,14 @@ public class CommandController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "车辆资源详情", notes = "车辆资源详情") @ApiOperation(httpMethod = "GET", value = "车辆资源详情", notes = "车辆资源详情")
public ResponseModel<Map<String,Object>> getCarDetailById(Long id ) { public ResponseModel<Map<String,Object>> getCarDetailById(Long id ) {
ResponseModel<Map<String, Object>> date= equipFeignClient.getCarDetailById(id); ResponseModel<Map<String, Object>> date= equipFeignClient.getCarDetailById(id);
return ResponseHelper.buildResponse(date!=null?date.getResult():null);
Map<String, Object> map= date!=null?date.getResult():null;
if(map!=null){
int num =0;
num = iDutyCarService.getDutyCarCount(id);
map.put("personNum",num);
}
return ResponseHelper.buildResponse(map);
} }
...@@ -1323,10 +1334,10 @@ public class CommandController extends BaseController { ...@@ -1323,10 +1334,10 @@ public class CommandController extends BaseController {
Long id =null; Long id =null;
//获取用户已绑定车辆id、 //获取用户已绑定车辆id、
UserCar userCar=userCarService.selectByAmosUserId(Long.valueOf(agencyUserModel.getUserId())); UserCar userCar=userCarService.selectByAmosUserId(Long.valueOf(agencyUserModel.getUserId()));
if(isNo!=null&&isNo){
id =userCar!=null?userCar.getCarId():null; id =userCar!=null?userCar.getCarId():null;
}
ResponseModel<Object> data= equipFeignClient.equipmentCarList(teamId,name,code , pageNum,pageSize,id); ResponseModel<Object> data= equipFeignClient.equipmentCarList(teamId,name,code , pageNum,pageSize,id,isNo);
Map map =new HashMap(); Map map =new HashMap();
map.put("select",userCar!=null?userCar.getCarId():null); map.put("select",userCar!=null?userCar.getCarId():null);
map.put("data",data!=null?data.getResult():null); map.put("data",data!=null?data.getResult():null);
......
...@@ -47,7 +47,6 @@ public class DutyCarController extends BaseController { ...@@ -47,7 +47,6 @@ public class DutyCarController extends BaseController {
@Autowired @Autowired
IDutyCarService iDutyCarService; IDutyCarService iDutyCarService;
/** /**
* 值班列表视图--分页 * 值班列表视图--分页
* *
...@@ -165,5 +164,4 @@ public class DutyCarController extends BaseController { ...@@ -165,5 +164,4 @@ public class DutyCarController extends BaseController {
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @ApiParam(value = "岗位") @RequestParam(required = false) String postType){
return ResponseHelper.buildResponse(iDutyCarService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType)); return ResponseHelper.buildResponse(iDutyCarService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType));
} }
} }
\ No newline at end of file
...@@ -230,8 +230,8 @@ public class KeySiteController extends BaseController { ...@@ -230,8 +230,8 @@ public class KeySiteController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "通过名称模糊查询重点部位的信息", notes = "通过名称模糊查询重点部位的信息") @ApiOperation(httpMethod = "GET",value = "通过名称模糊查询重点部位的信息", notes = "通过名称模糊查询重点部位的信息")
@GetMapping(value = "/getKeySiteDateByNameLike") @GetMapping(value = "/getKeySiteDateByNameLike")
public ResponseModel<List<KeySite>> getKeySiteDateByNameLike() { public ResponseModel<List<KeySite>> getKeySiteDateByNameLike(@RequestParam(required = false) Long companyId) {
return ResponseHelper.buildResponse(keySiteService.getKeySiteDateByNameLike()); return ResponseHelper.buildResponse(keySiteService.getKeySiteDateByNameLike(companyId));
} }
} }
...@@ -144,7 +144,7 @@ public class OrgUsrController extends BaseController { ...@@ -144,7 +144,7 @@ public class OrgUsrController extends BaseController {
OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY); OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id); iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse( iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id));
} }
......
...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil; ...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.*; import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.enums.WaterResourceTypeEnum; import com.yeejoin.amos.boot.module.common.api.enums.WaterResourceTypeEnum;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.*; import com.yeejoin.amos.boot.module.common.biz.service.impl.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -92,7 +93,7 @@ public class WaterResourceController extends BaseController { ...@@ -92,7 +93,7 @@ public class WaterResourceController extends BaseController {
model.setResourceTypeName(resourceTypeEnum.get().getName()); model.setResourceTypeName(resourceTypeEnum.get().getName());
model.setRealityImg(null); model.setRealityImg(null);
model.setOrientationImg(JSONArray.toJSONString(model. getOrientationImgList())); model.setOrientationImg(null);
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/ /*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/
/* if(model.getAddress()!=null){ /* if(model.getAddress()!=null){
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress()); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
...@@ -187,7 +188,7 @@ public class WaterResourceController extends BaseController { ...@@ -187,7 +188,7 @@ public class WaterResourceController extends BaseController {
// 更新基本信息 // 更新基本信息
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
//model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList())); //model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList())); //model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList()));
WaterResourceDto waterResourceDto = waterResourceServiceImpl.updateWithModel(model); WaterResourceDto waterResourceDto = waterResourceServiceImpl.updateWithModel(model);
// 更新属性信息 // 更新属性信息
String resourceType = model.getResourceType(); String resourceType = model.getResourceType();
......
...@@ -218,5 +218,17 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -218,5 +218,17 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
} }
return detailList; return detailList;
} }
@Override
public int getDutyCarCount(Long carId) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(DateUtils.getDateNowShortStr(),
this.getGroupCode(), "carId", "carName", "teamName","result.carId");
int count =0;
for (Map<String, Object> map : equipmentList) {
if(map.containsKey("carId") && map.get("carId").equals(carId)) {
count++;
}
}
return count;
}
} }
...@@ -319,9 +319,12 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -319,9 +319,12 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
} }
@Override @Override
public List<KeySite> getKeySiteDateByNameLike() { public List<KeySite> getKeySiteDateByNameLike(Long companyId) {
LambdaQueryWrapper<KeySite> mapper =new LambdaQueryWrapper<KeySite>(); LambdaQueryWrapper<KeySite> mapper =new LambdaQueryWrapper<KeySite>();
mapper.eq(KeySite::getIsDelete, false); mapper.eq(KeySite::getIsDelete, false);
if(companyId!=null && companyId.longValue()!=0) {
mapper.eq(KeySite::getBelongId, companyId);
}
return this.baseMapper.selectList(mapper); return this.baseMapper.selectList(mapper);
} }
} }
...@@ -523,17 +523,19 @@ public class MaintenanceCompanyServiceImpl ...@@ -523,17 +523,19 @@ public class MaintenanceCompanyServiceImpl
parentCode = parent.getCode(); parentCode = parent.getCode();
} }
// 旧父节点的code // 旧父节点的code
String oldParentCode = company.getCode().substring(0, company.getCode().length() - TreeParser.CODE_LENGTH); if(company.getCode() != null){
List<MaintenanceCompany> children = String oldParentCode = company.getCode().substring(0, company.getCode().length() - TreeParser.CODE_LENGTH);
list(new LambdaQueryWrapper<MaintenanceCompany>().eq(MaintenanceCompany::getIsDelete, false).likeRight(MaintenanceCompany::getCode, company.getCode()).ne(MaintenanceCompany::getSequenceNbr, company.getSequenceNbr())); List<MaintenanceCompany> children =
if (!ValidationUtil.isEmpty(children)) { list(new LambdaQueryWrapper<MaintenanceCompany>().eq(MaintenanceCompany::getIsDelete, false).likeRight(MaintenanceCompany::getCode, company.getCode()).ne(MaintenanceCompany::getSequenceNbr, company.getSequenceNbr()));
String finalParentCode = parentCode; if (!ValidationUtil.isEmpty(children)) {
children.forEach(i -> { String finalParentCode = parentCode;
i.setCode(i.getCode().replaceFirst(oldParentCode, finalParentCode)); children.forEach(i -> {
}); i.setCode(i.getCode().replaceFirst(oldParentCode, finalParentCode));
updateBatchById(children); });
updateBatchById(children);
}
company.setCode(company.getCode().replaceFirst(oldParentCode, parentCode));
} }
company.setCode(company.getCode().replaceFirst(oldParentCode, parentCode));
} }
@Override @Override
......
...@@ -737,7 +737,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -737,7 +737,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
@Override @Override
public void updateByIdOrgUsr(OrgUsrDto OrgUsrVo, Long id) throws Exception { public OrgUsrDto updateByIdOrgUsr(OrgUsrDto OrgUsrVo, Long id) throws Exception {
// 修改单位信息 // 修改单位信息
OrgUsr orgUsr = new OrgUsr(); OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id); OrgUsr oriOrgUsr = getById(id);
...@@ -773,6 +773,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -773,6 +773,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
* 同步保存ES * 同步保存ES
*/ */
eSOrgUsrService.saveAlertCalledToES(orgUsr); eSOrgUsrService.saveAlertCalledToES(orgUsr);
OrgUsrVo.setBizOrgCode(orgUsr.getBizOrgCode());
return OrgUsrVo;
} }
@Override @Override
......
...@@ -403,14 +403,14 @@ public class AlertCalledController extends BaseController { ...@@ -403,14 +403,14 @@ public class AlertCalledController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "警情填报联系人模糊查询", notes = "警情填报联系人模糊查询") @ApiOperation(httpMethod = "GET", value = "警情填报联系人模糊查询", notes = "警情填报联系人模糊查询")
public ResponseModel<Object> getContact() { public ResponseModel<Object> getContact() {
if (redisUtils.hasKey(RedisKey.CONTACT_USER)) { // if (redisUtils.hasKey(RedisKey.CONTACT_USER)) {
Object obj = redisUtils.get(RedisKey.CONTACT_USER); // Object obj = redisUtils.get(RedisKey.CONTACT_USER);
return ResponseHelper.buildResponse(obj); // return ResponseHelper.buildResponse(obj);
} else { // } else {
List<Map<String, String>> contactName = iAlertCalledService.getContactName(); List<Map<String, String>> contactName = iAlertCalledService.getContactName();
redisUtils.set(RedisKey.CONTACT_USER, contactName, time); // redisUtils.set(RedisKey.CONTACT_USER, contactName, time);
return ResponseHelper.buildResponse(contactName); return ResponseHelper.buildResponse(contactName);
}
} }
/** /**
...@@ -441,7 +441,7 @@ public class AlertCalledController extends BaseController { ...@@ -441,7 +441,7 @@ public class AlertCalledController extends BaseController {
AlarmGiveStatisticsDto dto = new AlarmGiveStatisticsDto(); AlarmGiveStatisticsDto dto = new AlarmGiveStatisticsDto();
LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.isNull(AlertCalled::getFatherAlert); queryWrapper.isNull(AlertCalled::getFatherAlert);
queryWrapper.eq(AlertCalled::getAlertStatus, true); queryWrapper.eq(AlertCalled::getAlertStatus, false);
queryWrapper.eq(AlertCalled::getIsDelete, false); queryWrapper.eq(AlertCalled::getIsDelete, false);
Integer alertNum = iAlertCalledService.getBaseMapper().selectCount(queryWrapper); Integer alertNum = iAlertCalledService.getBaseMapper().selectCount(queryWrapper);
dto.setAlarmNum(alertNum); dto.setAlarmNum(alertNum);
......
...@@ -67,6 +67,8 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.TemplateMapper; ...@@ -67,6 +67,8 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.TemplateMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
import com.yeejoin.amos.component.rule.config.RuleConfig; import com.yeejoin.amos.component.rule.config.RuleConfig;
import ch.qos.logback.core.joran.conditional.IfAction;
/** /**
* 警情接警记录 服务实现类 * 警情接警记录 服务实现类
* *
...@@ -257,6 +259,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -257,6 +259,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
try { try {
// 警情基本信息 // 警情基本信息
AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled(); AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled();
//主表增加备注字段
if (alertCalled.getAddress() != null) { if (alertCalled.getAddress() != null) {
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(alertCalled.getAddress()); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(alertCalled.getAddress());
alertCalled.setAddress(address.getString(BizConstant.ADDRESS)); alertCalled.setAddress(address.getString(BizConstant.ADDRESS));
...@@ -290,6 +294,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -290,6 +294,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertCalled.setAlarmType(AlertStageEnums.JQGB.getValue()); alertCalled.setAlarmType(AlertStageEnums.JQGB.getValue());
alertCalled.setAlarmTypeCode(AlertStageEnums.JQGB.getCode()); alertCalled.setAlarmTypeCode(AlertStageEnums.JQGB.getCode());
alertCalled.setUpdateTime(new Date()); alertCalled.setUpdateTime(new Date());
alertCalled.setRemark(alertCalledObjsDto.getRemark());
this.save(alertCalled); this.save(alertCalled);
// 填充警情主键 // 填充警情主键
...@@ -307,6 +312,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -307,6 +312,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertCalled.setAlertStage(AlertStageEnums.LLDP.getValue()); alertCalled.setAlertStage(AlertStageEnums.LLDP.getValue());
alertCalled.setAlarmType(AlertStageEnums.JQCB.getValue()); alertCalled.setAlarmType(AlertStageEnums.JQCB.getValue());
alertCalled.setAlarmTypeCode(AlertStageEnums.JQCB.getCode()); alertCalled.setAlarmTypeCode(AlertStageEnums.JQCB.getCode());
alertCalled.setRemark(alertCalledObjsDto.getRemark());
this.save(alertCalled); this.save(alertCalled);
// 填充警情主键 // 填充警情主键
alertFormValuelist.stream().forEach(alertFormValue -> { alertFormValuelist.stream().forEach(alertFormValue -> {
...@@ -845,8 +851,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -845,8 +851,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
// firefightersName.addAll(contactNames); // firefightersName.addAll(contactNames);
List<Map<String, String>> list = orgUsrServiceImpl.getPersonSimpleDetail(); List<Map<String, String>> list = orgUsrServiceImpl.getPersonSimpleDetail();
list.stream().forEach(i->{ list.stream().forEach(i->{
String phone = QRCodeUtil.generateQRCode()+"@"+ i.get("phone").toString(); String phone="";
i.replace("phone", phone); if(i.containsKey("phone")) {
phone = QRCodeUtil.generateQRCode()+"@"+ i.get("phone").toString();
i.replace("phone", phone);
}else {
phone = QRCodeUtil.generateQRCode()+"@"+ phone;
i.put("phone", phone);
}
}); });
return list; return list;
} }
...@@ -861,16 +873,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -861,16 +873,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/* 2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束 */ /* 2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束 */
public Set<Map<String, Object>> getLocationLike(String locationt) { public Set<Map<String, Object>> getLocationLike(String locationt) {
// Set<Map<String, Object>> set=new HashSet<Map<String, Object>>(); Set<Map<String, Object>> set= alertCalledMapper.getLocation();
// List<Map<String, Object>> orgUserLocation = alertCalledMapper.getOrgUserLocation(locationt); set.remove(null);
// List<Map<String, Object>> alertCalledLocation = alertCalledMapper.getAlertCalledLocation(locationt); return set;
// List<Map<String, Object>> keySiteLocation = alertCalledMapper.getKeySiteLocation(locationt);
// List<Map<String, Object>> airportLocation = alertCalledMapper.getAirportLocation(locationt);
// set.addAll(alertCalledLocation);
// set.addAll(keySiteLocation);
// set.addAll(airportLocation);
// set.addAll(orgUserLocation);
// set.remove(null);
return alertCalledMapper.getLocation();
} }
} }
...@@ -15,32 +15,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils; ...@@ -15,32 +15,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil; import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; 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.common.api.dto.CompanyPerson; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInitDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireChemicalDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FireChemical; import com.yeejoin.amos.boot.module.common.api.entity.FireChemical;
...@@ -328,26 +303,40 @@ public class ExcelServiceImpl { ...@@ -328,26 +303,40 @@ public class ExcelServiceImpl {
List<Map<String, Object>> pageList = dynamicFormInstanceService.listAll("linkageUnit"); List<Map<String, Object>> pageList = dynamicFormInstanceService.listAll("linkageUnit");
linkageUnitListMap.forEach(i -> { linkageUnitListMap.forEach(i -> {
String mainString = i.get("instanceId").toString(); if ( i.get("instanceId") != null){
pageList.stream().forEach(detail -> { String mainString = i.get("instanceId").toString();
if (detail.get("instanceId").toString().equals(mainString)) { pageList.stream().forEach(detail -> {
i.putAll(detail); if (detail.get("instanceId").toString().equals(mainString)) {
} i.putAll(detail);
}); }
});
}
}); });
List<LinkageUnitDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(linkageUnitListMap), List<LinkageUnitDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(linkageUnitListMap),
LinkageUnitDto.class); LinkageUnitDto.class);
List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> { List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> {
Date now = new Date(); Date now = new Date();
if (item.getLongitude() != null){
}
boolean isInAgreement = DateUtils.belongCalendar(now, item.getAgreementStartDate(), boolean isInAgreement = DateUtils.belongCalendar(now, item.getAgreementStartDate(),
item.getAgreementEndDate()); item.getAgreementEndDate());
item.setInAgreement(isInAgreement ? "是" : "否"); item.setInAgreement(isInAgreement ? "是" : "否");
return item; return item;
}).filter(item -> org.apache.commons.lang3.StringUtils.isEmpty(inAgreement) || inAgreement.equals(item.getInAgreement())) }).filter(item -> org.apache.commons.lang3.StringUtils.isEmpty(inAgreement) || inAgreement.equals(item.getInAgreement()))
.collect(Collectors.toList()); .collect(Collectors.toList());
/*经纬度导出精度会丢失 转换成string导出 2021-11-02 陈召 开始*/
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), detaiList, List<LinkageUnitVo> result = new ArrayList<>();
LinkageUnitDto.class, null, false); detaiList.forEach(d->{
LinkageUnitVo linkageUnitVo = new LinkageUnitVo();
BeanUtils.copyProperties(d,linkageUnitVo);
linkageUnitVo.setLatitude(d.getLatitude() != null? String.valueOf(d.getLatitude()):" ");
linkageUnitVo.setLongitude(d.getLongitude() != null?String.valueOf(d.getLongitude()):" ");
result.add(linkageUnitVo);
});
/*经纬度导出精度会丢失 转换成string导出 2021-11-02 陈召 结束*/
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), result,
LinkageUnitVo.class, null, false);
break; break;
default: default:
break; break;
......
...@@ -18,4 +18,9 @@ public class DangerExecuteSubmitDto extends ExecuteSubmitDto { ...@@ -18,4 +18,9 @@ public class DangerExecuteSubmitDto extends ExecuteSubmitDto {
private Long dangerId; private Long dangerId;
private LatentDangerExecuteTypeEnum executeTypeEnum; private LatentDangerExecuteTypeEnum executeTypeEnum;
/**
* 检查组长userId
*/
private String checkLeaderId;
} }
...@@ -287,6 +287,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -287,6 +287,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
latentDanger.setCurrentFlowRecordId(inputRecord.getId()); latentDanger.setCurrentFlowRecordId(inputRecord.getId());
latentDanger.setInstanceId(instance.getString("id")); latentDanger.setInstanceId(instance.getString("id"));
latentDangerMapper.updateById(latentDanger); latentDangerMapper.updateById(latentDanger);
asyncTask.sendDangerMsg(RequestContext.cloneRequestContext(), latentDanger, onSiteConfirmRole);
} }
// TODO 使用远程调用替换 // TODO 使用远程调用替换
...@@ -1213,6 +1214,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1213,6 +1214,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
// 4、在执行完节点后需要将检查组长id设置为下个节点执行人 // 4、在执行完节点后需要将检查组长id设置为下个节点执行人
Object resultObj = workflowExecuteService.setTaskAssign(latentDanger.getInstanceId(), checkLeaderId); Object resultObj = workflowExecuteService.setTaskAssign(latentDanger.getInstanceId(), checkLeaderId);
executeSubmitDto.setCheckLeaderId(userModel.getUserId());
if (!(Boolean) resultObj) { if (!(Boolean) resultObj) {
executeSubmitDto.setIsOk(false); executeSubmitDto.setIsOk(false);
...@@ -2078,6 +2080,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2078,6 +2080,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if (!executeSubmitDto.getIsOk()) { if (!executeSubmitDto.getIsOk()) {
throw new Exception(executeSubmitDto.getMsg()); throw new Exception(executeSubmitDto.getMsg());
} }
List<String> userIds = workflowExecuteService.getUserIdsByWorkflow(latentDanger.getInstanceId(), executeSubmitDto.getCheckLeaderId());
asyncTask.sendDangerSubmitMsg(RequestContext.cloneRequestContext(), latentDanger, userIds);
return executeSubmitDto; return executeSubmitDto;
} }
......
...@@ -4,12 +4,17 @@ import com.alibaba.fastjson.JSONArray; ...@@ -4,12 +4,17 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.latentdanger.business.param.JPushTypeEnum; import com.yeejoin.amos.latentdanger.business.param.JPushTypeEnum;
import com.yeejoin.amos.latentdanger.business.param.PushMsgParam; import com.yeejoin.amos.latentdanger.business.param.PushMsgParam;
import com.yeejoin.amos.latentdanger.business.util.DateUtil;
import com.yeejoin.amos.latentdanger.business.util.Toke; import com.yeejoin.amos.latentdanger.business.util.Toke;
import com.yeejoin.amos.latentdanger.common.enums.MsgSubscribeEnum; import com.yeejoin.amos.latentdanger.common.enums.MsgSubscribeEnum;
import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger;
import com.yeejoin.amos.latentdanger.dao.entity.Msg; import com.yeejoin.amos.latentdanger.dao.entity.Msg;
import com.yeejoin.amos.latentdanger.feign.RemoteSecurityService; import com.yeejoin.amos.latentdanger.feign.RemoteSecurityService;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -17,12 +22,16 @@ import org.slf4j.LoggerFactory; ...@@ -17,12 +22,16 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.context.RequestContextModel;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Date; import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
/** /**
* 异步执行任务 * 异步执行任务
...@@ -33,6 +42,7 @@ import java.util.Set; ...@@ -33,6 +42,7 @@ import java.util.Set;
public class AsyncTask { public class AsyncTask {
private static final String TAB = "\r\n"; private static final String TAB = "\r\n";
private final Logger log = LoggerFactory.getLogger(AsyncTask.class); private final Logger log = LoggerFactory.getLogger(AsyncTask.class);
private final String msgType = "danger";
// @Autowired // @Autowired
// private IMsgDao iMsgDao; // private IMsgDao iMsgDao;
// @Autowired // @Autowired
...@@ -146,4 +156,58 @@ public class AsyncTask { ...@@ -146,4 +156,58 @@ public class AsyncTask {
// messageService.pushMsg(toke.getToke(), toke.getProduct(), toke.getAppKey(), pushMsgParam); // messageService.pushMsg(toke.getToke(), toke.getProduct(), toke.getAppKey(), pushMsgParam);
} }
} }
/**
* 提交隐患发送消息至检查组员被检查单位确认隐患
*/
@Async
public void sendDangerMsg(RequestContextModel requestContextModel, LatentDanger latentDanger, String roleName){
RequestContext.setToken(requestContextModel.getToken());
RequestContext.setProduct(requestContextModel.getProduct());
RequestContext.setAppKey(requestContextModel.getAppKey());
MessageModel model = new MessageModel();
model.setTitle(latentDanger.getDangerName());
String body = String.format("隐患名称:%s;隐患级别:%s;治理方式:%s",
latentDanger.getDangerName(), latentDanger.getDangerLevelName(), latentDanger.getReformTypeName());
model.setBody(body);
model.setIsSendApp(true);
model.setMsgType(msgType);
try {
List<RoleModel> result = Privilege.roleClient.queryRoleList(roleName, null).getResult();
if (result.size() > 0) {
List<AgencyUserModel> userModels = Privilege.agencyUserClient.queryByRoleId(String.valueOf(result.get(0).getSequenceNbr()), null).getResult();
List<String> userIds = userModels.stream().map(AgencyUserModel::getUserId).collect(Collectors.toList());
model.setRecivers(userIds);
}
model.setRelationId(String.valueOf(latentDanger.getId()));
Systemctl.messageClient.create(model);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 确认隐患发送消息
*/
@Async
public void sendDangerSubmitMsg(RequestContextModel requestContextModel, LatentDanger latentDanger, List<String> userIds){
RequestContext.setToken(requestContextModel.getToken());
RequestContext.setProduct(requestContextModel.getProduct());
RequestContext.setAppKey(requestContextModel.getAppKey());
MessageModel model = new MessageModel();
model.setTitle(latentDanger.getDangerName());
String body = String.format("隐患名称:%s;隐患级别:%s;治理方式:%s, 推送时间:%s",
latentDanger.getDangerName(), latentDanger.getDangerLevelName(), latentDanger.getReformTypeName(), DateUtil.date2LongStr(new Date()));
model.setBody(body);
model.setIsSendWeb(true);
model.setIsSendApp(true);
model.setMsgType(msgType);
model.setRecivers(userIds);
try {
model.setRelationId(String.valueOf(latentDanger.getId()));
Systemctl.messageClient.create(model);
} catch (Exception e) {
e.printStackTrace();
}
}
} }
package com.yeejoin.amos.supervision.business.service.impl; package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
...@@ -29,6 +30,7 @@ import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo; ...@@ -29,6 +30,7 @@ import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo; import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.business.vo.CheckVo; import com.yeejoin.amos.supervision.business.vo.CheckVo;
import com.yeejoin.amos.supervision.common.enums.*; import com.yeejoin.amos.supervision.common.enums.*;
import com.yeejoin.amos.supervision.core.async.AsyncTask;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto; import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.*; import com.yeejoin.amos.supervision.core.common.response.*;
...@@ -47,7 +49,9 @@ import org.springframework.data.domain.Page; ...@@ -47,7 +49,9 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.transaction.Transactional; import javax.transaction.Transactional;
...@@ -97,6 +101,12 @@ public class CheckServiceImpl implements ICheckService { ...@@ -97,6 +101,12 @@ public class CheckServiceImpl implements ICheckService {
IPlanTaskService planTaskService; IPlanTaskService planTaskService;
@Autowired @Autowired
private IPlanService planService;
@Autowired
private AsyncTask asyncTask;
@Autowired
DangerFeignClient DangerFeignClient; DangerFeignClient DangerFeignClient;
@Autowired @Autowired
...@@ -1414,7 +1424,6 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1414,7 +1424,6 @@ public class CheckServiceImpl implements ICheckService {
if (!depName.contains(personIdentity.getCompanyName())) { if (!depName.contains(personIdentity.getCompanyName())) {
check.setDepName(depName + "," + personIdentity.getCompanyName()); check.setDepName(depName + "," + personIdentity.getCompanyName());
} }
} }
List<CheckInputParam> list = recordParam.getCheckItems(); List<CheckInputParam> list = recordParam.getCheckItems();
...@@ -1560,6 +1569,12 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1560,6 +1569,12 @@ public class CheckServiceImpl implements ICheckService {
planTaskDetailMapper.finishTaskDetail(Long.parseLong(detail.get("planTaskDetailId").toString()), recordParam.getPointId(), planTaskDetailMapper.finishTaskDetail(Long.parseLong(detail.get("planTaskDetailId").toString()), recordParam.getPointId(),
recordParam.getPlanTaskId(), mtUserSeq, userName, size, planTaskStatus); recordParam.getPlanTaskId(), mtUserSeq, userName, size, planTaskStatus);
Plan plan = planService.queryPlanById(planTask.getPlanId());
// 计划完成,发送消息
if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){
asyncTask.sendPlanMsgToLeadPeople(RequestContext.cloneRequestContext(), plan);
}
// p_plan_task_detail更新隐患个数 // p_plan_task_detail更新隐患个数
planTaskDetailMapper.updateDanger(Long.parseLong(detail.get("planTaskDetailId").toString())); planTaskDetailMapper.updateDanger(Long.parseLong(detail.get("planTaskDetailId").toString()));
......
package com.yeejoin.amos.supervision.business.service.impl; package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; 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.service.IWorkflowExcuteService;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService; import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
...@@ -22,7 +21,6 @@ import org.springframework.stereotype.Service; ...@@ -22,7 +21,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -44,6 +42,9 @@ public class PlanAuditServiceImpl implements IPlanAuditService { ...@@ -44,6 +42,9 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
@Autowired @Autowired
WorkflowFeignService workflowFeignService; WorkflowFeignService workflowFeignService;
@Autowired
private PlanServiceImpl planService;
@Override @Override
@Transactional @Transactional
public Boolean auditWorkFlow(PlanAuditLog planAuditLog, Integer status, String condition, ReginParams reginParams) throws Exception { public Boolean auditWorkFlow(PlanAuditLog planAuditLog, Integer status, String condition, ReginParams reginParams) throws Exception {
...@@ -72,6 +73,7 @@ public class PlanAuditServiceImpl implements IPlanAuditService { ...@@ -72,6 +73,7 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
planAuditLog.setFlowJson(condition); planAuditLog.setFlowJson(condition);
planAuditLog.setRoleName(roleName); planAuditLog.setRoleName(roleName);
planAuditLogDao.save(planAuditLog); planAuditLogDao.save(planAuditLog);
planService.getUserIdsByWorkflow(plan, instanceId);
return Boolean.TRUE; return Boolean.TRUE;
} }
} }
......
package com.yeejoin.amos.supervision.business.service.impl; package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.enums.WorkFlowEnum;
import com.yeejoin.amos.boot.biz.common.service.IWorkflowExcuteService; import com.yeejoin.amos.boot.biz.common.service.IWorkflowExcuteService;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.supervision.business.constants.XJConstant; import com.yeejoin.amos.supervision.business.constants.XJConstant;
import com.yeejoin.amos.supervision.business.dao.mapper.PlanMapper; import com.yeejoin.amos.supervision.business.dao.mapper.PlanMapper;
...@@ -15,6 +19,7 @@ import com.yeejoin.amos.supervision.common.enums.CheckTypeSuEnum; ...@@ -15,6 +19,7 @@ import com.yeejoin.amos.supervision.common.enums.CheckTypeSuEnum;
import com.yeejoin.amos.supervision.common.enums.DangerCheckTypeLevelEnum; import com.yeejoin.amos.supervision.common.enums.DangerCheckTypeLevelEnum;
import com.yeejoin.amos.supervision.common.enums.PlanStatusEnum; import com.yeejoin.amos.supervision.common.enums.PlanStatusEnum;
import com.yeejoin.amos.supervision.common.enums.WorkFlowBranchEnum; import com.yeejoin.amos.supervision.common.enums.WorkFlowBranchEnum;
import com.yeejoin.amos.supervision.core.async.AsyncTask;
import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest; import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest;
import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone; import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone;
import com.yeejoin.amos.supervision.core.util.DateUtil; import com.yeejoin.amos.supervision.core.util.DateUtil;
...@@ -30,6 +35,7 @@ import org.springframework.data.domain.PageImpl; ...@@ -30,6 +35,7 @@ import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAccessor;
...@@ -74,6 +80,12 @@ public class PlanServiceImpl implements IPlanService { ...@@ -74,6 +80,12 @@ public class PlanServiceImpl implements IPlanService {
private IWorkflowExcuteService workflowExcuteService; private IWorkflowExcuteService workflowExcuteService;
@Autowired @Autowired
private AsyncTask asyncTask;
@Autowired
WorkflowFeignService workflowFeignService;
@Autowired
private IPlanAuditDao planAuditDao; private IPlanAuditDao planAuditDao;
@Autowired @Autowired
...@@ -132,38 +144,38 @@ public class PlanServiceImpl implements IPlanService { ...@@ -132,38 +144,38 @@ public class PlanServiceImpl implements IPlanService {
public void addPlan(HashMap<String, Object> map, ReginParams reginParams) throws Exception { public void addPlan(HashMap<String, Object> map, ReginParams reginParams) throws Exception {
// 新增路线 // 新增路线
AddPlanRequest addPlanRequest = (AddPlanRequest) map.get("param"); AddPlanRequest addPlanRequest = (AddPlanRequest) map.get("param");
Plan param = addPlanRequest.getPlan(); Plan plan = addPlanRequest.getPlan();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity(); ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
String orgCode = map.get("org_code") == null ? "" : map.get("org_code").toString(); String orgCode = map.get("org_code") == null ? "" : map.get("org_code").toString();
String userId = personIdentity.getPersonSeq(); String userId = personIdentity.getPersonSeq();
param.setOrgCode(orgCode); plan.setOrgCode(orgCode);
param.setNextGenDate(DateUtil.getIntervalDate(new Date(), 0)); plan.setNextGenDate(DateUtil.getIntervalDate(new Date(), 0));
param.setCreateBy(userId); plan.setCreateBy(userId);
addPlanRequest.setPlan(param); addPlanRequest.setPlan(plan);
Route route = save(addPlanRequest); Route route = save(addPlanRequest);
if (!ObjectUtils.isEmpty(route)) { if (!ObjectUtils.isEmpty(route)) {
param.setRouteId(route.getId()); plan.setRouteId(route.getId());
//编辑计划 //编辑计划
if (param.getId() > 0) { if (plan.getId() > 0) {
Plan oriPlan = planDao.findById(param.getId()).get(); Plan oriPlan = planDao.findById(plan.getId()).get();
param.setCreateDate(oriPlan.getCreateDate()); plan.setCreateDate(oriPlan.getCreateDate());
param.setCreateBy(oriPlan.getCreateBy()); plan.setCreateBy(oriPlan.getCreateBy());
param.setLastUpdBy(userId); plan.setLastUpdBy(userId);
param.setFirstFlag(XJConstant.PLAN_FIRST_STATUS_YES); plan.setFirstFlag(XJConstant.PLAN_FIRST_STATUS_YES);
} }
if (XJConstant.FIX_DATE_NO.equals(param.getIsFixedDate()) && (XJConstant.PLAN_TYPE_MONTH.equals(param.getPlanType()) || XJConstant.PLAN_TYPE_YEAR.equals(param.getPlanType()))) { if (XJConstant.FIX_DATE_NO.equals(plan.getIsFixedDate()) && (XJConstant.PLAN_TYPE_MONTH.equals(plan.getPlanType()) || XJConstant.PLAN_TYPE_YEAR.equals(plan.getPlanType()))) {
param.setDayBegin(DateUtil.formatStrToTime("00:00:00")); plan.setDayBegin(DateUtil.formatStrToTime("00:00:00"));
param.setDayEnd(DateUtil.formatStrToTime("23:59:59")); plan.setDayEnd(DateUtil.formatStrToTime("23:59:59"));
} }
planDao.save(param); planDao.save(plan);
Integer status = param.getStatus(); Integer status = plan.getStatus();
if (status != null && status == 1) { if (status != null && status == 1) {
CheckTypeSuEnum checkTypeSuEnum = CheckTypeSuEnum.getEumByCode(param.getCheckTypeId()); CheckTypeSuEnum checkTypeSuEnum = CheckTypeSuEnum.getEumByCode(plan.getCheckTypeId());
DangerCheckTypeLevelEnum levelEnum = DangerCheckTypeLevelEnum.getEumByCode(param.getCheckLevel()); DangerCheckTypeLevelEnum levelEnum = DangerCheckTypeLevelEnum.getEumByCode(plan.getCheckLevel());
String branch = workFlowExcuteBranch(levelEnum.getCondition(), checkTypeSuEnum.getCondition()); String branch = workFlowExcuteBranch(levelEnum.getCondition(), checkTypeSuEnum.getCondition());
try { try {
String processInstanceId; String processInstanceId;
PlanAudit audit = planAuditDao.findByPlanId(param.getId()); PlanAudit audit = planAuditDao.findByPlanId(plan.getId());
if (audit != null) { if (audit != null) {
//执行一步 //执行一步
processInstanceId = audit.getProcessInstanceId(); processInstanceId = audit.getProcessInstanceId();
...@@ -171,20 +183,22 @@ public class PlanServiceImpl implements IPlanService { ...@@ -171,20 +183,22 @@ public class PlanServiceImpl implements IPlanService {
//更新时间 //更新时间
audit.setUpdateDate(new Date()); audit.setUpdateDate(new Date());
planAuditDao.save(audit); planAuditDao.save(audit);
this.getUserIdsByWorkflow(plan, processInstanceId);
//记录执行流水-启动节点 //记录执行流水-启动节点
insertAuditLog(reginParams, param, personIdentity, audit); insertAuditLog(reginParams, plan, personIdentity, audit);
} else { } else {
//启动 //启动
processInstanceId = workflowExcuteService.startAndComplete(processDefinitionKey, branch); processInstanceId = workflowExcuteService.startAndComplete(processDefinitionKey, branch);
audit = new PlanAudit(); audit = new PlanAudit();
audit.setPlanId(param.getId()); audit.setPlanId(plan.getId());
audit.setBusinessKey(String.valueOf(sequence.nextId())); audit.setBusinessKey(String.valueOf(sequence.nextId()));
audit.setProcessDefinitionKey(processDefinitionKey); audit.setProcessDefinitionKey(processDefinitionKey);
audit.setProcessInstanceId(processInstanceId); audit.setProcessInstanceId(processInstanceId);
audit.setStartUserId(userId); audit.setStartUserId(userId);
planAuditDao.save(audit); planAuditDao.save(audit);
//记录执行流水-启动节点 //记录执行流水-启动节点
insertAuditLog(reginParams, param, personIdentity, audit); insertAuditLog(reginParams, plan, personIdentity, audit);
this.getUserIdsByWorkflow(plan, processInstanceId);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("=============防火监督,计划提交,工作流启动失败!!!============="); log.error("=============防火监督,计划提交,工作流启动失败!!!=============");
...@@ -193,6 +207,30 @@ public class PlanServiceImpl implements IPlanService { ...@@ -193,6 +207,30 @@ public class PlanServiceImpl implements IPlanService {
} }
} }
/**
* 根据工作流获取下一审核人角色下的所有用户ID
* @return
*/
protected List<String> getUserIdsByWorkflow (Plan plan, String processInstanceId){
List<String> userIds = new ArrayList<>();
JSONObject teskObject = workflowFeignService.getTaskList(processInstanceId);
JSONArray taskDetailArray = teskObject.getJSONArray(WorkFlowEnum.DATA.getCode());
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
JSONArray informerList = detail.getJSONArray(WorkFlowEnum.INFORMERLIST.getCode());
if (informerList.size() > 0) {
userIds = informerList.stream().map(item -> {
JSONObject jsonItem = (JSONObject) item;
return jsonItem.getString("userId");
}).collect(Collectors.toList());
asyncTask.sendAddPlanMsg(RequestContext.cloneRequestContext(), plan, userIds, true, false);
} else {
asyncTask.sendPlanMsgToLeadPeople(RequestContext.cloneRequestContext(), plan);
}
}
return userIds;
}
private void insertAuditLog(ReginParams reginParams, Plan param, ReginParams.PersonIdentity personIdentity, PlanAudit audit) { private void insertAuditLog(ReginParams reginParams, Plan param, ReginParams.PersonIdentity personIdentity, PlanAudit audit) {
PlanAuditLog planAuditLog = new PlanAuditLog(); PlanAuditLog planAuditLog = new PlanAuditLog();
planAuditLog.setPlanAuditId(audit.getId()); planAuditLog.setPlanAuditId(audit.getId());
......
...@@ -532,7 +532,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -532,7 +532,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 2.保存执行数据明细表 // 2.保存执行数据明细表
planTaskDetail.saveAndFlush(planTaskDetailInstance); planTaskDetail.saveAndFlush(planTaskDetailInstance);
// 推送消息 // 推送消息
asyncTask.sendPlanMsg(RequestContext.cloneRequestContext(), plan, planId); asyncTask.sendPlanMsg(RequestContext.cloneRequestContext(), plan);
} }
// 定时任务监控 // 定时任务监控
jobService.planTaskAddJob(planTask); jobService.planTaskAddJob(planTask);
......
...@@ -14,6 +14,7 @@ import com.yeejoin.amos.supervision.business.entity.mybatis.MsgSubscribeBo; ...@@ -14,6 +14,7 @@ import com.yeejoin.amos.supervision.business.entity.mybatis.MsgSubscribeBo;
import com.yeejoin.amos.supervision.business.param.PushMsgParam; import com.yeejoin.amos.supervision.business.param.PushMsgParam;
import com.yeejoin.amos.supervision.business.service.intfc.IMessageService; import com.yeejoin.amos.supervision.business.service.intfc.IMessageService;
import com.yeejoin.amos.supervision.business.service.intfc.ISafety3DDataSendService; import com.yeejoin.amos.supervision.business.service.intfc.ISafety3DDataSendService;
import com.yeejoin.amos.supervision.business.util.DateUtil;
import com.yeejoin.amos.supervision.business.util.Toke; import com.yeejoin.amos.supervision.business.util.Toke;
import com.yeejoin.amos.supervision.common.enums.JPushTypeEnum; import com.yeejoin.amos.supervision.common.enums.JPushTypeEnum;
import com.yeejoin.amos.supervision.common.enums.MsgSubscribeEnum; import com.yeejoin.amos.supervision.common.enums.MsgSubscribeEnum;
...@@ -45,6 +46,8 @@ import java.util.concurrent.Future; ...@@ -45,6 +46,8 @@ import java.util.concurrent.Future;
public class AsyncTask { public class AsyncTask {
private final Logger log = LoggerFactory.getLogger(AsyncTask.class); private final Logger log = LoggerFactory.getLogger(AsyncTask.class);
private final String msgType = "supervision";
@Autowired @Autowired
private ISafety3DDataSendService safety3DDataSend; private ISafety3DDataSendService safety3DDataSend;
...@@ -304,15 +307,42 @@ public class AsyncTask { ...@@ -304,15 +307,42 @@ public class AsyncTask {
} }
/** /**
* 计划任务消息 * 提交计划任务消息
* @param requestContextModel
* @param plan
* @param userIds 发送用户id集合
* @param isSendWeb 发送web标识
* @param isSendApp 发送app标识
*/
@Async
public void sendAddPlanMsg(RequestContextModel requestContextModel, Plan plan, List<String> userIds, boolean isSendWeb, boolean isSendApp){
MessageModel model = new MessageModel();
model.setTitle(plan.getName());
String body = String.format("计划名称:%s;检查类型:%s;推送时间:%s",
plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date()));
model.setBody(body);
try {
model.setIsSendWeb(isSendWeb);
model.setIsSendApp(isSendApp);
model.setMsgType(msgType);
model.setRelationId(String.valueOf(plan.getId()));
model.setRecivers(userIds);
// remoteSecurityService.addMessage(requestContextModel, model);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 发送消息至检查组长
* @param plan * @param plan
*/ */
@Async @Async
public void sendPlanMsg(RequestContextModel requestContextModel, Plan plan, long planId){ public void sendPlanMsgToLeadPeople(RequestContextModel requestContextModel, Plan plan){
MessageModel model = new MessageModel(); MessageModel model = new MessageModel();
model.setTitle(plan.getName()); model.setTitle(plan.getName());
String body = String.format("任务批号:%s;类型:%s;执行人:%s", String body = String.format("计划名称:%s;检查类型:%s;推送时间:%s",
planId, plan.getCheckTypeName(), plan.getMakerUserName()); plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date()));
model.setBody(body); model.setBody(body);
String leadPeopleIds = plan.getLeadPeopleIds(); String leadPeopleIds = plan.getLeadPeopleIds();
if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())){ if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())){
...@@ -320,9 +350,37 @@ public class AsyncTask { ...@@ -320,9 +350,37 @@ public class AsyncTask {
} }
try { try {
List<String> recivers = remoteSecurityService.getAmosIdListByUserIds(requestContextModel, leadPeopleIds); List<String> recivers = remoteSecurityService.getAmosIdListByUserIds(requestContextModel, leadPeopleIds);
model.setIsSendWeb(true);
model.setIsSendApp(true);
model.setMsgType(msgType);
model.setRelationId(String.valueOf(plan.getId()));
model.setRecivers(recivers);
// remoteSecurityService.addMessage(requestContextModel, model);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 发送消息至检查组员
* @param plan
*/
@Async
public void sendPlanMsg(RequestContextModel requestContextModel, Plan plan){
MessageModel model = new MessageModel();
model.setTitle(plan.getName());
String body = String.format("计划名称:%s;检查类型:%s;推送时间:%s",
plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date()));
model.setBody(body);
String leadPeopleIds = plan.getLeadPeopleIds();
if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())){
leadPeopleIds += "," + plan.getUserId();
}
try {
List<String> recivers = remoteSecurityService.getAmosIdListByUserIds(requestContextModel, leadPeopleIds);
model.setIsSendApp(true); model.setIsSendApp(true);
model.setIsSendWeb(true); model.setIsSendWeb(true);
model.setMsgType("supervision"); model.setMsgType(msgType);
model.setRelationId(String.valueOf(plan.getId())); model.setRelationId(String.valueOf(plan.getId()));
model.setRecivers(recivers); model.setRecivers(recivers);
remoteSecurityService.addMessage(requestContextModel, model); remoteSecurityService.addMessage(requestContextModel, model);
...@@ -349,5 +407,4 @@ public class AsyncTask { ...@@ -349,5 +407,4 @@ public class AsyncTask {
} }
return afterFilterUserIds; return afterFilterUserIds;
} }
} }
...@@ -1990,5 +1990,39 @@ ...@@ -1990,5 +1990,39 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenzhao" id="2021-11-02-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_template"/>
</preConditions>
<comment>update data jc_template</comment>
<sql>
UPDATE `jc_template` SET content ='【120急救】时间:callTime;地址:address;被困人数:trappedNum;伤亡人数:casualtiesNum;性别:gender;年龄段(岁):ageGroup;患者现状:patientStatus;情况说明:situation;警情阶段:alertStage' WHERE sequence_nbr=23;
</sql>
</changeSet>
<!-- <changeSet author="tw" id="2021-11-01-1">-->
<!-- <preConditions onFail="MARK_RAN">-->
<!-- <tableExists tableName="jc_alert_called"/>-->
<!-- </preConditions>-->
<!-- <comment>增加备注字段</comment>-->
<!-- <sql>-->
<!-- ALTER TABLE jc_alert_called ADD remark varchar(10000) NULL COMMENT '备注'-->
<!-- </sql>-->
<!-- </changeSet>-->
<changeSet author="chenhao" id="2021-11-02-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary"/>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions>
<comment>update data cb_data_dictionary</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 ('1347', '1', '物联报警', 'WLBJ', NULL, NULL, NULL, NULL, NULL, '\0', '12');
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 ('1348', '1', '语音融合报警', 'YYRHBJ', NULL, NULL, NULL, NULL, NULL, '\0', '12');
</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