应急的bug修复
This commit is contained in:
parent
cbb335e668
commit
c8eb09de4e
@ -30,7 +30,7 @@ public class Notice implements Serializable {
|
|||||||
private java.lang.Long id;
|
private java.lang.Long id;
|
||||||
@ApiModelProperty(value = "类型,1考勤提醒,2人员报警,3车辆,4混凝土监测,5卸料平台,6配电箱,7扬尘,8视频,9标养室,10安全检查,11质量检查,12塔吊,13升降机," +
|
@ApiModelProperty(value = "类型,1考勤提醒,2人员报警,3车辆,4混凝土监测,5卸料平台,6配电箱,7扬尘,8视频,9标养室,10安全检查,11质量检查,12塔吊,13升降机," +
|
||||||
"14电表,15水表,16访客,17,防疫人员通知,18访客通知,19巡检点,20人员的资质证书即将到期,21人员的合同信息即将到期,22人员的保险信息即将到期," +
|
"14电表,15水表,16访客,17,防疫人员通知,18访客通知,19巡检点,20人员的资质证书即将到期,21人员的合同信息即将到期,22人员的保险信息即将到期," +
|
||||||
"23同步人员到海康isc,24同步车辆到海康isc,25同步组织到海康isc 30工作流审批通知,31大屏的安全和质量,32大屏的危大")
|
"23同步人员到海康isc,24同步车辆到海康isc,25同步组织到海康isc 30工作流审批通知,31大屏的安全和质量,32大屏的危大,33应急处置")
|
||||||
private java.lang.String type;
|
private java.lang.String type;
|
||||||
/**
|
/**
|
||||||
* 消息内容
|
* 消息内容
|
||||||
|
|||||||
@ -120,7 +120,7 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
|
|||||||
public void addUserNoticeAndApp(Long accountId, String msg, String title, String type, Object payload) {
|
public void addUserNoticeAndApp(Long accountId, String msg, String title, String type, Object payload) {
|
||||||
final SerializeConfig config = new SerializeConfig();
|
final SerializeConfig config = new SerializeConfig();
|
||||||
config.put(Long.class, ToStringSerializer.instance);
|
config.put(Long.class, ToStringSerializer.instance);
|
||||||
addUserNotice(accountId, msg, title, type, JSONObject.toJSONString(payload, config));
|
addUserNotice(accountId, msg, title, type, payload != null ? JSONObject.toJSONString(payload, config) : null);
|
||||||
SystemUser systemUser = systemUserMapper.selectById(accountId);
|
SystemUser systemUser = systemUserMapper.selectById(accountId);
|
||||||
if (systemUser == null) {
|
if (systemUser == null) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -112,15 +112,7 @@ public class WorkerInfoController {
|
|||||||
@ApiImplicitParam(name = "id", value = "劳务人员ID", paramType = "body", required = true, dataType = "Integer")
|
@ApiImplicitParam(name = "id", value = "劳务人员ID", paramType = "body", required = true, dataType = "Integer")
|
||||||
@PostMapping(value = "/queryById")
|
@PostMapping(value = "/queryById")
|
||||||
public Result<WorkerInfo> queryById(@RequestBody Map<String, Object> map) {
|
public Result<WorkerInfo> queryById(@RequestBody Map<String, Object> map) {
|
||||||
Result<WorkerInfo> result = new Result<WorkerInfo>();
|
return Result.success(workerInfoService.queryById(map));
|
||||||
WorkerInfo workerInfo = workerInfoService.getById(MapUtils.getString(map, "id"));
|
|
||||||
if (workerInfo == null) {
|
|
||||||
result.error500(MessageUtil.get("notFindErr"));
|
|
||||||
} else {
|
|
||||||
result.setResult(workerInfo);
|
|
||||||
result.setSuccess(true);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,9 @@
|
|||||||
and create_time>=current_date group by person_sn ) wa on wa.person_sn = a.person_sn
|
and create_time>=current_date group by person_sn ) wa on wa.person_sn = a.person_sn
|
||||||
</if>
|
</if>
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
|
<if test="param.id != null and param.id != ''">
|
||||||
|
and a.id = #{param.id}
|
||||||
|
</if>
|
||||||
<if test="param.isFilterQualityRegionEnterprise != null and param.isFilterQualityRegionEnterprise == '1'.toString() and param.accountType == '6'.toString()">
|
<if test="param.isFilterQualityRegionEnterprise != null and param.isFilterQualityRegionEnterprise == '1'.toString() and param.accountType == '6'.toString()">
|
||||||
and a.enterprise_id in(
|
and a.enterprise_id in(
|
||||||
select distinct qrte.enterprise_id from quality_region_to_enterprise qrte join quality_region_to_user qrtu
|
select distinct qrte.enterprise_id from quality_region_to_enterprise qrte join quality_region_to_user qrtu
|
||||||
|
|||||||
@ -139,4 +139,6 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
|
|||||||
List<TrendOneVo> statsEnterprise(Map<String, Object> map);
|
List<TrendOneVo> statsEnterprise(Map<String, Object> map);
|
||||||
|
|
||||||
List<StatsTrendVo> statsEnterpriseRisk(Map<String, Object> map);
|
List<StatsTrendVo> statsEnterpriseRisk(Map<String, Object> map);
|
||||||
|
|
||||||
|
WorkerInfo queryById(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2153,6 +2153,17 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
|||||||
return baseMapper.statsEnterpriseRisk(map);
|
return baseMapper.statsEnterpriseRisk(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WorkerInfo queryById(Map<String, Object> map) {
|
||||||
|
String id = MapUtils.getString(map, "id");
|
||||||
|
map.put("id", id);
|
||||||
|
IPage<WorkerInfo> page = selectWorkerInfoList(map);
|
||||||
|
if (CollUtil.isEmpty(page.getRecords())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return page.getRecords().get(0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 真正递归的方法
|
* 真正递归的方法
|
||||||
*
|
*
|
||||||
|
|||||||
@ -126,4 +126,16 @@ public class XzEmergencyRecordController {
|
|||||||
public Result<StatsDispositionStatusVo> statsDispositionStatus(@ApiIgnore @RequestBody Map<String, Object> param) {
|
public Result<StatsDispositionStatusVo> statsDispositionStatus(@ApiIgnore @RequestBody Map<String, Object> param) {
|
||||||
return Result.success(xzEmergencyRecordService.statsDispositionStatus(param));
|
return Result.success(xzEmergencyRecordService.statsDispositionStatus(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "发送通知", notes = "发送通知", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "id", value = "星纵-应急-处置台账ID", paramType = "body", required = true, dataType = "String"),
|
||||||
|
})
|
||||||
|
@PostMapping(value = "/sendNotice")
|
||||||
|
public Result sendNotice(@ApiIgnore @RequestBody Map<String, Object> param) {
|
||||||
|
xzEmergencyRecordService.sendNotice(param);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,4 +30,6 @@ public interface IXzEmergencyRecordService extends IService<XzEmergencyRecord> {
|
|||||||
XzEmergencyRecord queryById(String id);
|
XzEmergencyRecord queryById(String id);
|
||||||
|
|
||||||
StatsDispositionStatusVo statsDispositionStatus(Map<String, Object> param);
|
StatsDispositionStatusVo statsDispositionStatus(Map<String, Object> param);
|
||||||
|
|
||||||
|
void sendNotice(Map<String, Object> param);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,13 +11,18 @@ import com.zhgd.jeecg.common.execption.OpenAlertException;
|
|||||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||||
|
import com.zhgd.xmgl.modules.basicdata.service.impl.NoticeServiceImpl;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
|
import com.zhgd.xmgl.modules.worker.service.impl.WorkerInfoServiceImpl;
|
||||||
import com.zhgd.xmgl.modules.xz.emergency.entity.XzEmergencyPush;
|
import com.zhgd.xmgl.modules.xz.emergency.entity.XzEmergencyPush;
|
||||||
import com.zhgd.xmgl.modules.xz.emergency.entity.XzEmergencyRecord;
|
import com.zhgd.xmgl.modules.xz.emergency.entity.XzEmergencyRecord;
|
||||||
import com.zhgd.xmgl.modules.xz.emergency.entity.XzEmergencyRescueSituation;
|
import com.zhgd.xmgl.modules.xz.emergency.entity.XzEmergencyRescueSituation;
|
||||||
|
import com.zhgd.xmgl.modules.xz.emergency.entity.XzEmergencyType;
|
||||||
import com.zhgd.xmgl.modules.xz.emergency.entity.vo.StatsDispositionStatusVo;
|
import com.zhgd.xmgl.modules.xz.emergency.entity.vo.StatsDispositionStatusVo;
|
||||||
import com.zhgd.xmgl.modules.xz.emergency.mapper.XzEmergencyPushMapper;
|
import com.zhgd.xmgl.modules.xz.emergency.mapper.XzEmergencyPushMapper;
|
||||||
import com.zhgd.xmgl.modules.xz.emergency.mapper.XzEmergencyRecordMapper;
|
import com.zhgd.xmgl.modules.xz.emergency.mapper.XzEmergencyRecordMapper;
|
||||||
import com.zhgd.xmgl.modules.xz.emergency.mapper.XzEmergencyRescueSituationMapper;
|
import com.zhgd.xmgl.modules.xz.emergency.mapper.XzEmergencyRescueSituationMapper;
|
||||||
|
import com.zhgd.xmgl.modules.xz.emergency.mapper.XzEmergencyTypeMapper;
|
||||||
import com.zhgd.xmgl.modules.xz.emergency.service.IXzEmergencyRecordService;
|
import com.zhgd.xmgl.modules.xz.emergency.service.IXzEmergencyRecordService;
|
||||||
import com.zhgd.xmgl.security.entity.UserInfo;
|
import com.zhgd.xmgl.security.entity.UserInfo;
|
||||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||||
@ -42,9 +47,15 @@ import java.util.Map;
|
|||||||
@Service
|
@Service
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public class XzEmergencyRecordServiceImpl extends ServiceImpl<XzEmergencyRecordMapper, XzEmergencyRecord> implements IXzEmergencyRecordService {
|
public class XzEmergencyRecordServiceImpl extends ServiceImpl<XzEmergencyRecordMapper, XzEmergencyRecord> implements IXzEmergencyRecordService {
|
||||||
|
@Autowired
|
||||||
|
WorkerInfoServiceImpl workerInfoService;
|
||||||
|
@Autowired
|
||||||
|
NoticeServiceImpl noticeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
ISystemUserService systemUserService;
|
ISystemUserService systemUserService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
XzEmergencyTypeMapper xzEmergencyTypeMapper;
|
||||||
|
@Autowired
|
||||||
private XzEmergencyRecordMapper xzEmergencyRecordMapper;
|
private XzEmergencyRecordMapper xzEmergencyRecordMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private XzEmergencyRescueSituationMapper xzEmergencyRescueSituationMapper;
|
private XzEmergencyRescueSituationMapper xzEmergencyRescueSituationMapper;
|
||||||
@ -72,8 +83,21 @@ public class XzEmergencyRecordServiceImpl extends ServiceImpl<XzEmergencyRecordM
|
|||||||
String alias = "t.";
|
String alias = "t.";
|
||||||
QueryWrapper<XzEmergencyRecord> queryWrapper = QueryGenerator.initPageQueryWrapper(XzEmergencyRecord.class, paramMap, alias);
|
QueryWrapper<XzEmergencyRecord> queryWrapper = QueryGenerator.initPageQueryWrapper(XzEmergencyRecord.class, paramMap, alias);
|
||||||
String enterpriseId = MapUtils.getString(paramMap, "enterpriseId");
|
String enterpriseId = MapUtils.getString(paramMap, "enterpriseId");
|
||||||
|
String alarmPersonName = MapUtils.getString(paramMap, "alarmPersonName");
|
||||||
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
||||||
//只能看到自己的负责的企业
|
//项目子账号只能看到自己的负责的企业
|
||||||
|
querySelfEnterpriseIfSub(enterpriseId, projectSn);
|
||||||
|
if (StrUtil.isNotBlank(enterpriseId)) {
|
||||||
|
queryWrapper.eq("ei.id", enterpriseId);
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(alarmPersonName)) {
|
||||||
|
queryWrapper.like("wi.worker_name", alarmPersonName);
|
||||||
|
}
|
||||||
|
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(XzEmergencyRecord::getUpdateDate));
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String querySelfEnterpriseIfSub(String enterpriseId, String projectSn) {
|
||||||
UserInfo user = SecurityUtils.getUser();
|
UserInfo user = SecurityUtils.getUser();
|
||||||
if (user.getAccountType() == 6) {
|
if (user.getAccountType() == 6) {
|
||||||
List<SystemUser> systemUserList = systemUserService.getProjectChilderSystemUserList(new MapBuilder<String, Object>().put("projectSn", projectSn).put("userId", user.getUserId()).build());
|
List<SystemUser> systemUserList = systemUserService.getProjectChilderSystemUserList(new MapBuilder<String, Object>().put("projectSn", projectSn).put("userId", user.getUserId()).build());
|
||||||
@ -87,7 +111,7 @@ public class XzEmergencyRecordServiceImpl extends ServiceImpl<XzEmergencyRecordM
|
|||||||
if (push == null) {
|
if (push == null) {
|
||||||
enterpriseId = "-1";
|
enterpriseId = "-1";
|
||||||
} else {
|
} else {
|
||||||
List<String> userIds = StrUtil.split(",", push.getEmergencyManagerId());
|
List<String> userIds = StrUtil.split(push.getEmergencyManagerId(), ",");
|
||||||
if (userIds.contains(user.getUserId() + "")) {
|
if (userIds.contains(user.getUserId() + "")) {
|
||||||
enterpriseId = String.valueOf(push.getEnterpriseId());
|
enterpriseId = String.valueOf(push.getEnterpriseId());
|
||||||
} else {
|
} else {
|
||||||
@ -96,11 +120,7 @@ public class XzEmergencyRecordServiceImpl extends ServiceImpl<XzEmergencyRecordM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(enterpriseId)) {
|
return enterpriseId;
|
||||||
queryWrapper.eq("ei.id", enterpriseId);
|
|
||||||
}
|
|
||||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(XzEmergencyRecord::getId));
|
|
||||||
return queryWrapper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<XzEmergencyRecord> dealList(List<XzEmergencyRecord> list) {
|
private List<XzEmergencyRecord> dealList(List<XzEmergencyRecord> list) {
|
||||||
@ -141,6 +161,9 @@ public class XzEmergencyRecordServiceImpl extends ServiceImpl<XzEmergencyRecordM
|
|||||||
throw new OpenAlertException("未找到对应实体");
|
throw new OpenAlertException("未找到对应实体");
|
||||||
}
|
}
|
||||||
baseMapper.deleteById(id);
|
baseMapper.deleteById(id);
|
||||||
|
|
||||||
|
xzEmergencyRescueSituationMapper.delete(new LambdaQueryWrapper<XzEmergencyRescueSituation>()
|
||||||
|
.eq(XzEmergencyRescueSituation::getXzEmergencyRecordId, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -160,4 +183,38 @@ public class XzEmergencyRecordServiceImpl extends ServiceImpl<XzEmergencyRecordM
|
|||||||
return baseMapper.statsDispositionStatus(param);
|
return baseMapper.statsDispositionStatus(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendNotice(Map<String, Object> param) {
|
||||||
|
String id = MapUtils.getString(param, "id");
|
||||||
|
XzEmergencyRecord entity = baseMapper.queryById(id);
|
||||||
|
if (entity == null) {
|
||||||
|
throw new OpenAlertException("未找到对应实体");
|
||||||
|
}
|
||||||
|
WorkerInfo wi = workerInfoService.queryById(new MapBuilder<String, Object>().put("id", entity.getAlarmPersonId()).build());
|
||||||
|
if (wi == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
XzEmergencyPush push = xzEmergencyPushMapper.selectOne(new LambdaQueryWrapper<XzEmergencyPush>()
|
||||||
|
.eq(XzEmergencyPush::getEnterpriseId, wi.getEnterpriseId())
|
||||||
|
.eq(XzEmergencyPush::getProjectSn, wi.getProjectSn())
|
||||||
|
);
|
||||||
|
if (push == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<String> userIds = StrUtil.split(push.getEmergencyManagerId(), ",");
|
||||||
|
if (CollUtil.isEmpty(userIds)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
XzEmergencyType type = xzEmergencyTypeMapper.selectById(entity.getEmergencyTypeId());
|
||||||
|
for (String userId : userIds) {
|
||||||
|
if (entity.getEmergencyTypeId() == -1) {
|
||||||
|
noticeService.addUserNoticeAndApp(Long.valueOf(userId), StrUtil.format("{}人员在{}位置发起一键报警,请及时救援!", wi.getWorkerName(), entity.getLongitude() == null || entity.getLatitude() == null ? "未知" : entity.getLongitude() + "," + entity.getLatitude()),
|
||||||
|
"有应急消息待处理", "33");
|
||||||
|
} else {
|
||||||
|
noticeService.addUserNoticeAndApp(Long.valueOf(userId), StrUtil.format("{}人员在{}位置发起【{}】应急报警,请及时救援!", wi.getWorkerName(), entity.getLongitude() == null || entity.getLatitude() == null ? "未知" : entity.getLongitude() + "," + entity.getLatitude(), type != null ? type.getEmergencyType() : "其他类型"),
|
||||||
|
"有应急消息待处理", "33");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user