Commit d1aa3d7d authored by tangwei's avatar tangwei

合并解决冲突

parents 19b5cd85 fa8d7e5e
package com.yeejoin.amos.boot.module.common.api.dto; package com.yeejoin.amos.boot.module.common.api.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -22,6 +23,7 @@ public class DutyPersonShiftDto extends BaseDto { ...@@ -22,6 +23,7 @@ public class DutyPersonShiftDto extends BaseDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "值班日期") @ApiModelProperty(value = "值班日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date dutyDate; private Date dutyDate;
@ApiModelProperty(value = "值班班次id") @ApiModelProperty(value = "值班班次id")
......
...@@ -353,7 +353,7 @@ ...@@ -353,7 +353,7 @@
SELECT SELECT
COUNT(a.id) num COUNT(a.id) num
FROM important_companys a FROM important_companys a
where a.longitude is not null and a.latitude is not null where a.longitude is not null and a.latitude is not null and a.keySiteCompany = 1
<if test='par.distance!=null'> <if test='par.distance!=null'>
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance} #{par.distance}
...@@ -945,7 +945,7 @@ LEFT JOIN ( ...@@ -945,7 +945,7 @@ LEFT JOIN (
* *
FROM FROM
cb_org_usr cb_org_usr
WHERE is_delete = false AND biz_org_code LIKE CONCAT(#{bizOrgCode} '%') AND( biz_org_type = 'COMPANY' || biz_org_type = 'DEPARTMENT') WHERE is_delete = false AND biz_org_code LIKE CONCAT(#{bizOrgCode}, '%') AND( biz_org_type = 'COMPANY' || biz_org_type = 'DEPARTMENT')
</select> </select>
<select id="companyDeptListWithPersonCount" <select id="companyDeptListWithPersonCount"
......
...@@ -29,6 +29,12 @@ public class BaseTreeNode { ...@@ -29,6 +29,12 @@ public class BaseTreeNode {
private String companyId; private String companyId;
private String ownerUnitId;
private Integer type;
public BaseTreeNode() { public BaseTreeNode() {
} }
...@@ -52,7 +58,19 @@ public class BaseTreeNode { ...@@ -52,7 +58,19 @@ public class BaseTreeNode {
public void setParentId(String parentId) { public void setParentId(String parentId) {
this.parentId = parentId; this.parentId = parentId;
} }
public void setOwnerUnitId(String ownerUnitId) {
this.ownerUnitId = ownerUnitId;
}
public String getOwnerUnitId() {
return ownerUnitId;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getType() {
return type;
}
public List<BaseTreeNode> getChildren() { public List<BaseTreeNode> getChildren() {
if (this.children == null) { if (this.children == null) {
return Lists.newArrayList(); return Lists.newArrayList();
......
package com.yeejoin.equipmanage.common.entity.vo; package com.yeejoin.equipmanage.common.entity.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -65,4 +66,11 @@ public class BuildingVideoListVO { ...@@ -65,4 +66,11 @@ public class BuildingVideoListVO {
@ApiModelProperty("机构编码") @ApiModelProperty("机构编码")
private String bizOrgCode; private String bizOrgCode;
private String type;
private String ip;
} }
...@@ -313,6 +313,7 @@ public class TreeNodeUtil { ...@@ -313,6 +313,7 @@ public class TreeNodeUtil {
// 循环处理子节点数据 // 循环处理子节点数据
for (T t : newTreeNodes) { for (T t : newTreeNodes) {
//递归 //递归
listNodes.removeAll(collect);
assembleTree2(t, listNodes); assembleTree2(t, listNodes);
} }
return newTreeNodes; return newTreeNodes;
...@@ -328,7 +329,7 @@ public class TreeNodeUtil { ...@@ -328,7 +329,7 @@ public class TreeNodeUtil {
if (!CollectionUtils.isEmpty(node.getChildren())) { if (!CollectionUtils.isEmpty(node.getChildren())) {
for (Object t : node.getChildren()) { for (Object t : node.getChildren()) {
//递归 //递归
//listNodes.remove(t); listNodes.removeAll(node.getChildren());
assembleTreeSon((T) t, listNodes); assembleTreeSon((T) t, listNodes);
} }
} }
...@@ -339,17 +340,18 @@ public class TreeNodeUtil { ...@@ -339,17 +340,18 @@ public class TreeNodeUtil {
if (node != null && !CollectionUtils.isEmpty(listNodes)) { if (node != null && !CollectionUtils.isEmpty(listNodes)) {
// 循环节点数据,如果是子节点则添加起来 // 循环节点数据,如果是子节点则添加起来
listNodes.stream().filter(t -> t.getParentId().equals(node.getId()) && t.getCompanyId().equals(node.getCompanyId() == null ?node.getParentId():node.getCompanyId() ) ).forEachOrdered(node::addChild); listNodes.stream().filter(t ->t.getOwnerUnitId()!= null && t.getOwnerUnitId().equals(node.getOwnerUnitId()==null?node.getId():node.getOwnerUnitId())&&t.getParentId().equals(node.getId()) && t.getCompanyId().equals(node.getCompanyId() == null ?node.getParentId():node.getCompanyId() )).forEachOrdered(node::addChild);
// 循环处理子节点数据,递归 // 循环处理子节点数据,递归
if (!CollectionUtils.isEmpty(node.getChildren())) { if (!CollectionUtils.isEmpty(node.getChildren())) {
for (Object t : node.getChildren()) { for (Object t : node.getChildren()) {
//递归 //递归
//listNodes.remove(t); listNodes.removeAll(node.getChildren());
assembleTreeSon((T) t, listNodes); assembleTreeSon((T) t, listNodes);
} }
} }
} }
} }
static <T extends BaseTreeNode> void assembleTree_1(T node, List<T> listNodes) { static <T extends BaseTreeNode> void assembleTree_1(T node, List<T> listNodes) {
if (node != null && !CollectionUtils.isEmpty(listNodes)) { if (node != null && !CollectionUtils.isEmpty(listNodes)) {
// 循环节点数据,如果是子节点则添加起来 // 循环节点数据,如果是子节点则添加起来
......
...@@ -69,6 +69,9 @@ public interface PowerTransferMapper extends BaseMapper<PowerTransfer> { ...@@ -69,6 +69,9 @@ public interface PowerTransferMapper extends BaseMapper<PowerTransfer> {
Map<String, Integer> getCarNum(@Param("id") Long id); Map<String, Integer> getCarNum(@Param("id") Long id);
List< Map<String, Integer>> getCarUserNum(@Param("dutyDate") String dutyDate,@Param("id") Long id);
Map<String, Integer> getCompanyNum(@Param("id") Long id); Map<String, Integer> getCompanyNum(@Param("id") Long id);
List<PowerData> getPowerDataList(@Param("id") Long id); List<PowerData> getPowerDataList(@Param("id") Long id);
...@@ -122,4 +125,10 @@ public interface PowerTransferMapper extends BaseMapper<PowerTransfer> { ...@@ -122,4 +125,10 @@ public interface PowerTransferMapper extends BaseMapper<PowerTransfer> {
IPage<PowerTransferResourceDto> getPowerTransferCarResource(Page<PowerTransferResourceDto> page, IPage<PowerTransferResourceDto> getPowerTransferCarResource(Page<PowerTransferResourceDto> page,
@Param("alertCalledId") Long alertCalledId); @Param("alertCalledId") Long alertCalledId);
/**
* 查询未结案的航空器报警航班号
* @param alertTypeCode
* @return
*/
List<String> selectFlightNumber(@Param("alertTypeCode") String alertTypeCode);
} }
...@@ -145,6 +145,58 @@ ...@@ -145,6 +145,58 @@
</select> </select>
<select id="getCarUserNum" resultType="Map">
select * from (
SELECT
MAX(
CASE
WHEN cd.FIELD_CODE ='carId' THEN
cd.FIELD_VALUE
END
) AS 'carId',
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName'
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate} and dp.is_delete=0
) cds ON cd.instance_id = cds.instance_id
where cd.group_code ='dutyCar' and cds.instance_id is not null and
cd.is_delete=0
group by cd.instance_id
) result
where carId is not null and userName is not null and carId in (
SELECT
c.resources_id
FROM
jc_power_transfer a
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr
WHERE
a.alert_called_id = ${id}
)
</select>
<select id="getCompanyNum" resultType="Map"> <select id="getCompanyNum" resultType="Map">
select COUNT(*) companyNum from select COUNT(*) companyNum from
(SELECT DISTINCT (SELECT DISTINCT
...@@ -324,5 +376,13 @@ ...@@ -324,5 +376,13 @@
transfer.alert_called_id = #{alertCalledId} transfer.alert_called_id = #{alertCalledId}
AND is_distribution_agencies = 0 AND is_distribution_agencies = 0
</select> </select>
<select id="selectFlightNumber" resultType="java.lang.String">
SELECT DISTINCT(jaf.field_value) FROM `jc_alert_called` jac
left join jc_alert_form_value jaf on jac.sequence_nbr = jaf.alert_called_id
WHERE jac.alert_status = 0
and jac.alert_type_code = #{alertTypeCode}
and jaf.field_code = "flightNumber"
and jaf.field_value_code is not NULL
</select>
</mapper> </mapper>
...@@ -36,6 +36,10 @@ ...@@ -36,6 +36,10 @@
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>slf4j-log4j12</artifactId>
</exclusion> </exclusion>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -39,6 +39,7 @@ class SqlStatement extends BaseSqlCondition { ...@@ -39,6 +39,7 @@ class SqlStatement extends BaseSqlCondition {
private static final Map<String, String[]> valueTagFieldSqlMap; private static final Map<String, String[]> valueTagFieldSqlMap;
private static final Pattern numberPattern = Pattern.compile("^[-\\+]?[\\d]+[.]?[\\d]*$"); private static final Pattern numberPattern = Pattern.compile("^[-\\+]?[\\d]+[.]?[\\d]*$");
private static final Pattern datePattern = Pattern.compile("^[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}$"); private static final Pattern datePattern = Pattern.compile("^[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}$");
private static final Pattern datePattern16 = Pattern.compile("^[\\d]{4}/[\\d]{2}/[\\d]{2} [\\d]{2}:[\\d]{2}$");
/** /**
* 字段类型 * 字段类型
...@@ -101,36 +102,48 @@ class SqlStatement extends BaseSqlCondition { ...@@ -101,36 +102,48 @@ class SqlStatement extends BaseSqlCondition {
return false; return false;
} }
boolean emptyVal = ValidationUtil.isEmpty(values); boolean emptyVal = ValidationUtil.isEmpty(values);
if (fieldType != FieldType.textTag) { if (fieldType != FieldType.textTag && values.size() > 0) {
String val1 = values.get(0);
String val2 = "";
switch (valueType) { switch (valueType) {
case text: case text:
//格式化 //格式化
if (!emptyVal && !ValidationUtil.isEmpty(values.get(0))) { if (!emptyVal && !ValidationUtil.isEmpty(val1)) {
values.add(0, stringParamFormat(values.get(0))); values.add(0, stringParamFormat(val1));
values.remove(1); values.remove(1);
} }
break; break;
case date: case date:
// 校验并格式化 // 校验并格式化
if (!emptyVal && !ValidationUtil.isEmpty((values.get(0)))) { if (!emptyVal && !ValidationUtil.isEmpty(val1)) {
paramValidate(datePattern, values.get(0)); if (val1.contains("/") && val1.length() == 16) {
values.add(0, stringParamFormat(values.get(0))); paramValidate(datePattern16, val1);
} else {
paramValidate(datePattern, val1);
}
values.add(0, stringParamFormat(val1));
values.remove(1); values.remove(1);
} }
if (!emptyVal && values.size() > 1 && !ValidationUtil.isEmpty((values.get(1)))) { val2 = values.get(1);
paramValidate(datePattern, values.get(1)); if (!emptyVal && !ValidationUtil.isEmpty(val2)) {
values.add(1, stringParamFormat(values.get(1))); if (val2.contains("/") && val1.length() == 16) {
paramValidate(datePattern16, val2);
} else {
paramValidate(datePattern, val2);
}
values.add(1, stringParamFormat(val2));
values.remove(2); values.remove(2);
} }
break; break;
case range: case range:
case single: case single:
// 校验 // 校验
if (!emptyVal && !ValidationUtil.isEmpty((values.get(0)))) { if (!emptyVal && !ValidationUtil.isEmpty(val1)) {
paramValidate(numberPattern, values.get(0)); paramValidate(numberPattern, val1);
} }
if (!emptyVal && values.size() > 1 && !ValidationUtil.isEmpty((values.get(1)))) { val2 = values.get(1);
paramValidate(numberPattern, values.get(1)); if (!emptyVal && !ValidationUtil.isEmpty(val2)) {
paramValidate(numberPattern, val2);
} }
break; break;
default: default:
......
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>slf4j-log4j12</artifactId>
</exclusion> </exclusion>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.docx4j/docx4j-ImportXHTML --> <!-- https://mvnrepository.com/artifact/org.docx4j/docx4j-ImportXHTML -->
......
...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.dto.PermissionModelDto; import com.yeejoin.amos.boot.biz.common.dto.PermissionModelDto;
import com.yeejoin.amos.boot.biz.common.enums.HomePageEnum; import com.yeejoin.amos.boot.biz.common.enums.HomePageEnum;
...@@ -35,11 +36,14 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResources ...@@ -35,11 +36,14 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResources
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.*; import com.yeejoin.amos.boot.module.jcs.api.service.*;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
...@@ -1569,6 +1573,20 @@ public class CommandController extends BaseController { ...@@ -1569,6 +1573,20 @@ public class CommandController extends BaseController {
carTaskDto.getCode(), carTaskDto.getCode(),
carTaskDto.getType(), carTaskDto.getType(),
carTaskDto.getRemarks()); carTaskDto.getRemarks());
ReginParams reginParams = getSelectedOrgInfo();
String userId = reginParams.getUserModel().getUserId();
// 执行任务完成反馈,同步修改待办任务状态
if (carTaskDto.getType() == 2 && FireCarStatusEnum.已完成.getCode().equals(carTaskDto.getCode())){
MessageModel model = new MessageModel();
model.setRelationId(String.valueOf(carTaskDto.getAlertCalledId()));
model.setIsRead(true);
model.setMsgType("jcs119");
if (!ObjectUtils.isEmpty(userId)){
model.setUserId(userId);
}
Systemctl.messageClient.update(model);
}
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
......
...@@ -845,6 +845,21 @@ public class OrgUsrController extends BaseController { ...@@ -845,6 +845,21 @@ public class OrgUsrController extends BaseController {
@PathVariable String authKey) { @PathVariable String authKey) {
// 获取登陆人角色 // 获取登陆人角色
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
if(authKey.equals("fire_building_info")){
if (StringUtils.isNotEmpty(orgType) && orgType.equals("COMPANY")){
//查询当前登录人所属单位/部门
OrgUsr orgUsr = orgUsrMapper.selectById(reginParams.getPersonIdentity().getCompanyId());
//判断登陆人是否已经是顶级节点单位
if (orgUsr.getParentId() != null ){
orgUsr =iOrgUsrService.selectParentOrgUsr(orgUsr);
String bizOrgCode = orgUsr.getBizOrgCode() != null? orgUsr.getBizOrgCode() : reginParams.getPersonIdentity().getBizOrgCode();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
personIdentity.setBizOrgCode(bizOrgCode);
reginParams.setPersonIdentity(personIdentity);
}
}
}
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey); PermissionInterceptorContext.setDataAuthRule(authKey);
List<OrgMenuDto> menus = iOrgUsrService.companyTreeByUserAndType(reginParams, orgType); List<OrgMenuDto> menus = iOrgUsrService.companyTreeByUserAndType(reginParams, orgType);
...@@ -919,4 +934,30 @@ public class OrgUsrController extends BaseController { ...@@ -919,4 +934,30 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse(iOrgUsrService.getByOrgCode(bizOrgCode)); return ResponseHelper.buildResponse(iOrgUsrService.getByOrgCode(bizOrgCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "无权限单位树", notes = "无权限单位树")
@GetMapping(value = "/listCompanyTree")
public ResponseModel<List<OrgUsr>> listCompanyTree(@RequestParam(required = false) String orgType) throws Exception {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
String bizOrgCode = personIdentity.getBizOrgCode();
List<OrgUsr> listByBizOrgTypeCode = iOrgUsrService.getListByBizOrgTypeCode(orgType, bizOrgCode);
return ResponseHelper.buildResponse(listByBizOrgTypeCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据amosId返回单位code", notes = "根据amosId返回单位code")
@GetMapping(value = "/getBizByAmos")
public ResponseModel<String> getBizByAmos() throws Exception {
ReginParams selectedOrgInfo = getSelectedOrgInfo();
String userId = selectedOrgInfo.getUserModel().getUserId();
String parentId = iOrgUsrService.getParentId(userId);
OrgUsr orgUsr = iOrgUsrService.getById(parentId);
return ResponseHelper.buildResponse(orgUsr.getBizOrgCode());
}
} }
\ No newline at end of file
...@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.ArrayList;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -69,9 +70,12 @@ public class ESOrgUsrService { ...@@ -69,9 +70,12 @@ public class ESOrgUsrService {
public void saveAll(List<OrgUsr> orgUsrs) throws Exception { public void saveAll(List<OrgUsr> orgUsrs) throws Exception {
if (!ValidationUtil.isEmpty(orgUsrs)) { if (!ValidationUtil.isEmpty(orgUsrs)) {
for (OrgUsr orgUsr : orgUsrs) { // for (OrgUsr orgUsr : orgUsrs) {
this.saveAlertCalledToES(orgUsr); // this.saveAlertCalledToES(orgUsr);
} // }
this.saveAlertCalledToES(orgUsrs);
} }
} }
...@@ -90,6 +94,32 @@ public class ESOrgUsrService { ...@@ -90,6 +94,32 @@ public class ESOrgUsrService {
return esOrgUsrDto; return esOrgUsrDto;
} }
public List<ESOrgUsrDto> saveAlertCalledToES(List<OrgUsr> orgUsrs) throws Exception {
List<ESOrgUsrDto> listes=new ArrayList<>();
try {
for (OrgUsr orgUsr : orgUsrs) {
ESOrgUsrDto esOrgUsrDto = new ESOrgUsrDto();
String seqStr = String.valueOf(orgUsr.getSequenceNbr());
Long seq = Long.parseLong(seqStr);
esOrgUsrDto.setSequenceNbr(seq);
esOrgUsrDto.setBizOrgName(orgUsr.getBizOrgName());
listes.add(esOrgUsrDto);
}
esOrgUsrDtoRepository.saveAll(listes);
} catch (Exception e) {
e.printStackTrace();
}
return listes;
}
public ESOrgUsrDto saveAlertCalledToESNew(OrgUsr orgUsr) throws Exception { public ESOrgUsrDto saveAlertCalledToESNew(OrgUsr orgUsr) throws Exception {
ESOrgUsrDto esOrgUsrDto = new ESOrgUsrDto(); ESOrgUsrDto esOrgUsrDto = new ESOrgUsrDto();
String seqStr = String.valueOf(orgUsr.getSequenceNbr()); String seqStr = String.valueOf(orgUsr.getSequenceNbr());
......
...@@ -1742,6 +1742,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1742,6 +1742,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
String authKey = PermissionInterceptorContext.getDataAuthRule(); String authKey = PermissionInterceptorContext.getDataAuthRule();
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode(); String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
PermissionInterceptorContext.clean(); PermissionInterceptorContext.clean();
if (StringUtils.isNotEmpty(type) && type.equals("COMPANY")){ if (StringUtils.isNotEmpty(type) && type.equals("COMPANY")){
//查询当前登录人所属单位/部门 //查询当前登录人所属单位/部门
......
...@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -51,8 +52,8 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -51,8 +52,8 @@ public class EquipmentAlarmController extends AbstractBaseController {
@Autowired @Autowired
IEquipmentSpecificAlarmService iEquipmentSpecificAlarmService; IEquipmentSpecificAlarmService iEquipmentSpecificAlarmService;
@Value("${equip.enabled}")
private Boolean equioEnabled;
/** /**
* 列表列名 * 列表列名
* *
...@@ -157,12 +158,18 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -157,12 +158,18 @@ public class EquipmentAlarmController extends AbstractBaseController {
request12.setName("isRemoveShield"); request12.setName("isRemoveShield");
request12.setValue(StringUtil.isNotEmpty(isRemoveShield) ? StringUtils.trimToNull(isRemoveShield) : null); request12.setValue(StringUtil.isNotEmpty(isRemoveShield) ? StringUtils.trimToNull(isRemoveShield) : null);
queryRequests.add(request12); queryRequests.add(request12);
if (!ValidationUtil.isEmpty(reginParams.getPersonIdentity())){ if (equioEnabled) {
if (!ValidationUtil.isEmpty(reginParams.getPersonIdentity())) {
CommonRequest request13 = new CommonRequest(); CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode"); request13.setName("bizOrgCode");
request13.setValue(StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null ); request13.setValue(StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null);
queryRequests.add(request13); queryRequests.add(request13);
} }
}else {
CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode");
request13.setValue("");
}
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<Map<String, Object>> list = iEquipmentSpecificAlarmService.listPage(param); Page<Map<String, Object>> list = iEquipmentSpecificAlarmService.listPage(param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
...@@ -279,12 +286,19 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -279,12 +286,19 @@ public class EquipmentAlarmController extends AbstractBaseController {
request13.setName("isRemovedFire"); request13.setName("isRemovedFire");
request13.setValue(StringUtil.isNotEmpty(isRemovedFire) ? StringUtils.trimToNull(isRemovedFire) : null); request13.setValue(StringUtil.isNotEmpty(isRemovedFire) ? StringUtils.trimToNull(isRemovedFire) : null);
queryRequests.add(request13); queryRequests.add(request13);
if (equioEnabled){
if (!ValidationUtil.isEmpty(reginParams.getPersonIdentity())){ if (!ValidationUtil.isEmpty(reginParams.getPersonIdentity())){
CommonRequest request14 = new CommonRequest(); CommonRequest request14 = new CommonRequest();
request14.setName("bizOrgCode"); request14.setName("bizOrgCode");
request14.setValue(StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null ); request14.setValue(StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null );
queryRequests.add(request14); queryRequests.add(request14);
} }
}else {
CommonRequest request14 = new CommonRequest();
request14.setName("bizOrgCode");
request14.setValue("");
}
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
org.springframework.data.domain.Page<AlarmListDataVO> list = iEquipmentSpecificAlarmService.listAlarmsPage(param); org.springframework.data.domain.Page<AlarmListDataVO> list = iEquipmentSpecificAlarmService.listAlarmsPage(param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
......
...@@ -333,7 +333,13 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -333,7 +333,13 @@ public class EquipmentSpecificController extends AbstractBaseController {
public ResponseModel videoOnEquipmentSpecific(@RequestBody VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo) { public ResponseModel videoOnEquipmentSpecific(@RequestBody VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo) {
return CommonResponseUtil.success(equipmentSpecificSerivce.videoOnEquipmentSpecific(videoOnEquipmentSpecificVo)); return CommonResponseUtil.success(equipmentSpecificSerivce.videoOnEquipmentSpecific(videoOnEquipmentSpecificVo));
} }
@RequestMapping(value = "/delVideoOnEquipmentSpecific/{equipmentSpecificId}/{videoId}", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "摄像头解绑设备", notes = "摄像头绑定设备")
public ResponseModel delVideoOnEquipmentSpecific( @PathVariable Long equipmentSpecificId, @PathVariable Long videoId) {
return CommonResponseUtil.success(equipmentSpecificSerivce.delVideoOnEquipmentSpecific(equipmentSpecificId,videoId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{buildingId}/list") @GetMapping(value = "/{buildingId}/list")
......
...@@ -8,6 +8,8 @@ import java.util.List; ...@@ -8,6 +8,8 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -197,7 +199,17 @@ public class MaintenanceResourceDataController extends AbstractBaseController { ...@@ -197,7 +199,17 @@ public class MaintenanceResourceDataController extends AbstractBaseController {
pageBean = new Page<>(0, Long.MAX_VALUE); pageBean = new Page<>(0, Long.MAX_VALUE);
} }
page = maintenanceResourceDataService.page(pageBean, queryWrapper); page = maintenanceResourceDataService.page(pageBean, queryWrapper);
page.getRecords().stream().forEach(e->e.setLocation(e.getBuildingName() == null ? "" : e.getBuildingName()+e.getLocation() == null ? "" : e.getLocation()) ); page.getRecords().stream().forEach(e->{
String add = "";
if (!ValidationUtil.isEmpty(e.getBuildingName())){
add = add+e.getBuildingName();
};
if (!ValidationUtil.isEmpty(e.getLocation())){
add = add+e.getLocation();
}
e.setLocation(add);
}
);
return page; return page;
} }
......
...@@ -43,7 +43,7 @@ public interface JcsFeign { ...@@ -43,7 +43,7 @@ public interface JcsFeign {
@RequestParam(value = "belongFightingSystemId") Long belongFightingSystemId, @RequestParam(value = "belongFightingSystemId") Long belongFightingSystemId,
@RequestParam(value = "sequenceNbr") Long sequenceNbr, @RequestParam(value = "sequenceNbr") Long sequenceNbr,
@RequestParam(value = "classifyId") String classifyId, @RequestParam(value = "classifyId") String classifyId,
@RequestParam(value = "classifyId") List<String> ids @RequestParam(value = "ids") List<String> ids
); );
@RequestMapping(value = "/equip/fireSystem_waterResource/list", method = RequestMethod.GET, consumes = "application/json") @RequestMapping(value = "/equip/fireSystem_waterResource/list", method = RequestMethod.GET, consumes = "application/json")
...@@ -172,4 +172,14 @@ public interface JcsFeign { ...@@ -172,4 +172,14 @@ public interface JcsFeign {
ResponseModel<Long> getMaintenanceId( ResponseModel<Long> getMaintenanceId(
@RequestParam(value = "userId") String userId); @RequestParam(value = "userId") String userId);
/**
* 查询有权限的公司部门列表
*
* @param authKey 权限key
* @param orgTypes(多个逗号分隔) 为空默认查询公司和部门,COMPANY: 公司树 DEPARTMENT部门树
* @return ResponseModel<OrgUsrDto>
*/
@GetMapping(value = "/org-usr/listCompanyTree")
FeignClientResult<List<OrgUsrDto>> getlistCompanyTree( @RequestParam(required = false) String orgType);
} }
...@@ -172,6 +172,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -172,6 +172,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<UserDto> getEquipSpecificLocationInfo(Long equipmentSpecificId, String[] fieldName); List<UserDto> getEquipSpecificLocationInfo(Long equipmentSpecificId, String[] fieldName);
Map<String,Double> getEquipLocationInfo(Long equipmentSpecificId);
Map<String, Object> getEquipSpeInfo(@Param("equipmentSpecificId") Long equipmentSpecificId); Map<String, Object> getEquipSpeInfo(@Param("equipmentSpecificId") Long equipmentSpecificId);
/** /**
......
...@@ -16,6 +16,7 @@ import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO; ...@@ -16,6 +16,7 @@ import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo; import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO; import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
...@@ -169,6 +170,7 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -169,6 +170,7 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
EquipmentDetailVo getAirEquipSpecificDetail(Long stockDetailId); EquipmentDetailVo getAirEquipSpecificDetail(Long stockDetailId);
List<UserDto> getEquipSpecificLocationInfo(Long equipmentSpecificId, String[] fieldName); List<UserDto> getEquipSpecificLocationInfo(Long equipmentSpecificId, String[] fieldName);
Map<String,Double> getEquipLocationInfo(Long equipmentSpecificId);
/** /**
* 根据specificId删除相关数据 * 根据specificId删除相关数据
...@@ -214,5 +216,6 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -214,5 +216,6 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
* @return * @return
*/ */
Boolean videoOnEquipmentSpecific(VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo); Boolean videoOnEquipmentSpecific(VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo);
Boolean delVideoOnEquipmentSpecific(Long equipmentSpecificId, Long videoId);
} }
...@@ -1300,7 +1300,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1300,7 +1300,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
} }
Map<String, Long> countMap = iVideoService.getVideoCountMap(); Map<String, Long> countMap = iVideoService.getVideoCountMap();
// 1.获取公司list // 1.获取公司list
List<OrgUsrDto> orgUsrLists = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "COMPANY"); List<OrgUsrDto> orgUsrLists = jcsRemoteService.getlistCompanyTree("COMPANY");
if (orgUsrLists.isEmpty()) { if (orgUsrLists.isEmpty()) {
return new ArrayList<>(); return new ArrayList<>();
} }
......
...@@ -451,23 +451,15 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -451,23 +451,15 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
log.error("查询机场人员为空,检查机场人员是否绑定单位!"); log.error("查询机场人员为空,检查机场人员是否绑定单位!");
} }
confirmAlamVo.setFireLocation(ent.getLocation()); confirmAlamVo.setFireLocation(ent.getLocation());
List<UserDto> infoList = equipmentSpecificSerivce.getEquipSpecificLocationInfo(ent.getEquipmentSpecificId(), FIELD_NAME.split(",")); Map<String, Double> equipLocationInfo = equipmentSpecificSerivce.getEquipLocationInfo(ent.getEquipmentSpecificId());
if (CollectionUtils.isNotEmpty(infoList)) {
infoList.stream().forEach(dto -> { if (!ObjectUtils.isEmpty(equipLocationInfo)) {
// String name = dto.getPersonName(); if (equipLocationInfo.containsKey("longitude")){
// confirmAlamVo.setFireLocation(name); confirmAlamVo.setFloorLongitude(equipLocationInfo.get("longitude"));
String code = dto.getFieldCode(); }
String value = dto.getFieldValue(); if (equipLocationInfo.containsKey("latitude")){
switch (code) { confirmAlamVo.setFloorLatitude(equipLocationInfo.get("latitude"));
case "longitude":
confirmAlamVo.setFloorLongitude(getVal(value));
break;
case "latitude":
confirmAlamVo.setFloorLatitude(getVal(value));
break;
default:
} }
});
} }
try { try {
ruleConfirmAlamService.confirmAlam(confirmAlamVo, appKey, product, token); ruleConfirmAlamService.confirmAlam(confirmAlamVo, appKey, product, token);
......
...@@ -1197,6 +1197,10 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1197,6 +1197,10 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
return equipmentSpecificMapper.getEquipSpecificLocationInfo(equipmentSpecificId, fieldName); return equipmentSpecificMapper.getEquipSpecificLocationInfo(equipmentSpecificId, fieldName);
} }
public Map<String,Double> getEquipLocationInfo(Long equipmentSpecificId) {
return equipmentSpecificMapper.getEquipLocationInfo(equipmentSpecificId);
}
@Override @Override
@Async("equipAsyncExecutor") @Async("equipAsyncExecutor")
public void equipSpecificDataSync(Long equipmentId) { public void equipSpecificDataSync(Long equipmentId) {
...@@ -1764,6 +1768,15 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1764,6 +1768,15 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
} }
} }
@Override
public Boolean delVideoOnEquipmentSpecific(Long equipmentSpecificId, Long videoId) {
QueryWrapper<VideoEquipmentSpecific> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("equipment_specific_id", equipmentSpecificId);
queryWrapper.eq("video_id", videoId);
videoEquipmentSpecificService.remove(queryWrapper);
return true;
}
private Boolean bingEquipmentRelationshipToVideo(List<Long> videoIdList, Long equipmentSpecificId) { private Boolean bingEquipmentRelationshipToVideo(List<Long> videoIdList, Long equipmentSpecificId) {
List<VideoEquipmentSpecific> videoSpecificList = new ArrayList<>(); List<VideoEquipmentSpecific> videoSpecificList = new ArrayList<>();
videoIdList.parallelStream().forEach(x -> { videoIdList.parallelStream().forEach(x -> {
......
...@@ -41,4 +41,15 @@ public class JCSRemoteService { ...@@ -41,4 +41,15 @@ public class JCSRemoteService {
return feignClientResult.getResult(); return feignClientResult.getResult();
} }
/**
*
* 查询无权限的公司部门列表
*
* @param orgTypes(多个逗号分隔) 为空默认查询公司和部门,COMPANY: 公司树 DEPARTMENT部门树
* @return List<OrgUsrDto>
*/
public List<OrgUsrDto> getlistCompanyTree( String orgType) {
FeignClientResult<List<OrgUsrDto>> feignClientResult = jcsFeignClient.getlistCompanyTree( orgType);
return feignClientResult.getResult();
}
} }
...@@ -128,6 +128,7 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou ...@@ -128,6 +128,7 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou
List<MaintenanceResourceData> maintenanceResourceData = maintenanceResourceDataMapper.selectMaintenanceResourceDataListByclassifyId(); List<MaintenanceResourceData> maintenanceResourceData = maintenanceResourceDataMapper.selectMaintenanceResourceDataListByclassifyId();
//获取第三层分类节点 //获取第三层分类节点
List<MaintenanceResourceDto> maintenanceResourceDtos = this.baseMapper.selectAllType(); List<MaintenanceResourceDto> maintenanceResourceDtos = this.baseMapper.selectAllType();
List<MaintenanceResourceDto> list = new ArrayList<>(); List<MaintenanceResourceDto> list = new ArrayList<>();
maintenanceResourceData.stream().forEach(e-> { maintenanceResourceData.stream().forEach(e-> {
MaintenanceResourceDto e1 = new MaintenanceResourceDto(); MaintenanceResourceDto e1 = new MaintenanceResourceDto();
...@@ -136,7 +137,7 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou ...@@ -136,7 +137,7 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou
e1.setCompanyId(e.getMaintenanceCompanyId().toString()); e1.setCompanyId(e.getMaintenanceCompanyId().toString());
e1.setType(MaintenanceResourceEnum.CLASSIFY.getValue()); e1.setType(MaintenanceResourceEnum.CLASSIFY.getValue());
e1.setParentId(e.getFireFightSysId().toString()); e1.setParentId(e.getFireFightSysId().toString());
e1.setCode(e.getClassifyCode()); e1.setOwnerUnitId(e.getOwnerUnitId().toString());
list.add(e1); list.add(e1);
}); });
// List<MaintenanceResourceDto> list = this.selectAll(); // List<MaintenanceResourceDto> list = this.selectAll();
...@@ -144,27 +145,6 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou ...@@ -144,27 +145,6 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou
//获取维保单位和业主单位 //获取维保单位和业主单位
List<MaintenanceResourceDto> companyTree = getCompanyList(appKey, product, token); List<MaintenanceResourceDto> companyTree = getCompanyList(appKey, product, token);
if (!CollectionUtils.isEmpty(companyTree)) { if (!CollectionUtils.isEmpty(companyTree)) {
/* List<MaintenanceResourceDto> result = new ArrayList<>();
result.addAll(list);
for (int i = 0; i < list.size(); i++) {
for (int j = 0; j < companyTree.size(); j++) {
if (list.get(i).getParentId().equals(companyTree.get(j).getParentId()) && list.get(i).getId().equals(companyTree.get(j).getId()) ){
result.remove(list.get(i));
}
}
}*/
/* result.addAll(companyTree);
result.forEach(e->{if (e.getContractId() == null){
e.setContractId(QRCodeUtil.generateQRCode());
}
});
List<MaintenanceResourceDto> dataList = new ArrayList<>();
Map<String, Optional<MaintenanceResourceDto>> collect = result.stream().collect(groupingBy(MaintenanceResourceDto::getContractId, minBy(Comparator.comparing(MaintenanceResourceDto::getParentId))));
collect.entrySet().forEach(entry -> {
entry.getValue().ifPresent(v -> {
dataList.add(v);
});
});*/
list.addAll(companyTree); list.addAll(companyTree);
list.addAll(maintenanceResourceDtos); list.addAll(maintenanceResourceDtos);
//避免造成其他代码bug,替换新的组装树 //避免造成其他代码bug,替换新的组装树
......
...@@ -9,8 +9,13 @@ import java.util.Iterator; ...@@ -9,8 +9,13 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.logging.Logger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import liquibase.pro.packaged.W;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -34,12 +39,6 @@ import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm; ...@@ -34,12 +39,6 @@ import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFaultAlarm; import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFaultAlarm;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm; import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm;
import com.yeejoin.equipmanage.common.dto.TemperatureAlarmDto; import com.yeejoin.equipmanage.common.dto.TemperatureAlarmDto;
import com.yeejoin.equipmanage.common.entity.CarProperty;
import com.yeejoin.equipmanage.common.entity.EquipmentAlarmReportDay;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo; import com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO; import com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo; import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
...@@ -491,6 +490,16 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -491,6 +490,16 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
model.setIsSendWeb(true); model.setIsSendWeb(true);
model.setCategory(1); model.setCategory(1);
//告警弹窗需要根据人员单位判断是否展示 后端返回单位Code 前端判断
LambdaQueryWrapper<EquipmentSpecific> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BaseEntity::getId,equipmentSpecificAlarmLog.getEquipmentSpecificId());
EquipmentSpecific equipmentSpecific = equipmentSpecificMapper.selectOne(wrapper);
if (!ValidationUtil.isEmpty(equipmentSpecific) && !ValidationUtil.isEmpty(equipmentSpecific.getBizOrgCode())){
Map<String, String> equipMap = new HashMap<>();
equipMap.put("bizOrgCode",equipmentSpecific.getBizOrgCode());
model.setExtras(equipMap);
}
model.setRelationId(String.valueOf(equipmentSpecificAlarmLog.getId())); model.setRelationId(String.valueOf(equipmentSpecificAlarmLog.getId()));
Token token = remoteSecurityService.getServerToken(); Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model); systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
......
...@@ -508,6 +508,21 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -508,6 +508,21 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
relationRedisUtil.delSysRedisKey(fireFightSysIdsBuffer.toString()); relationRedisUtil.delSysRedisKey(fireFightSysIdsBuffer.toString());
} }
if (redisUtils.hasKey("equipAndCarIotCodes")) {
redisUtils.del("equipAndCarIotCodes");
}
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
// @Override
// public void afterCommit() {
// List<EquipmentSpecificVo> data = equipmentSpecificMapper.getEquipOrCarByIotCode(null);
// if (redisUtils.hasKey("equipAndCarIotCodes")) {
// redisUtils.del("equipAndCarIotCodes");
// }
// redisUtils.set("equipAndCarIotCodes", JSONObject.toJSONString(data));
// }
// });
} catch (Exception e) { } catch (Exception e) {
//处理异常 返回 成功失败条数 //处理异常 返回 成功失败条数
e.printStackTrace(); e.printStackTrace();
...@@ -517,7 +532,14 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -517,7 +532,14 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
return date; return date;
} }
String[] split = errBufferName.toString().split(","); String[] split = errBufferName.toString().split(",");
String date="上传成功:"+(equipmentDetailDownloadVOS.size()-(split!=null?split.length:0))+"条---上传失败:"+(split!=null?split.length:0)+"条(失败编号:"+errBufferName+"详情:"+erryy+")"; String date="";
if(split!=null&&split.length>0&&!"".equals(split[0])){
date="上传成功:"+(equipmentDetailDownloadVOS.size()-(split!=null?split.length:0))+"条---上传失败:"+(split!=null?split.length:0)+"条(失败编号:"+errBufferName+"详情:"+erryy+")";
}else{
date="上传成功:"+(equipmentDetailDownloadVOS.size())+"条---上传失败:"+"0条(失败编号:"+errBufferName+"详情:"+erryy+")";
}
log.error(date); log.error(date);
// 刷新redis中iotCode值 // 刷新redis中iotCode值
List<EquipmentSpecificVo> data = equipmentSpecificMapper.getEquipOrCarByIotCode(null); List<EquipmentSpecificVo> data = equipmentSpecificMapper.getEquipOrCarByIotCode(null);
......
...@@ -44,8 +44,10 @@ public class RelationRedisUtil { ...@@ -44,8 +44,10 @@ public class RelationRedisUtil {
List<String> collect = list.stream().map(FireFightingSystemEntity::getSystemTypeCode).collect(Collectors.toList()); List<String> collect = list.stream().map(FireFightingSystemEntity::getSystemTypeCode).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) { if (CollectionUtils.isNotEmpty(collect)) {
for (String key : collect) { for (String key : collect) {
if (key!=null&&redisUtil.hasKey(key)){
redisUtil.del(key); redisUtil.del(key);
} }
}
return Boolean.TRUE; return Boolean.TRUE;
} }
} }
......
...@@ -10,6 +10,7 @@ import java.util.stream.Stream; ...@@ -10,6 +10,7 @@ import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
...@@ -553,4 +554,11 @@ public class AlertCalledController extends BaseController { ...@@ -553,4 +554,11 @@ public class AlertCalledController extends BaseController {
public ResponseModel<Object> toCompletePoliceSituationMatch(@RequestParam Long id)throws Exception { public ResponseModel<Object> toCompletePoliceSituationMatch(@RequestParam Long id)throws Exception {
return ResponseHelper.buildResponse(iAlertCalledService.toCompletePoliceSituationMatch(id)); return ResponseHelper.buildResponse(iAlertCalledService.toCompletePoliceSituationMatch(id));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/selectFlightNumber")
@ApiOperation(httpMethod = "GET", value = "查询未结案的航空器报警存在的航班号", notes = "查询未结案的航空器报警存在的航班号")
public ResponseModel<Object> toCompletePoliceSituationMatch() throws MqttException {
return ResponseHelper.buildResponse(iAlertCalledService.selectFlightNumber());
}
} }
\ No newline at end of file
...@@ -119,9 +119,9 @@ public class FirestationJacketController extends BaseController { ...@@ -119,9 +119,9 @@ public class FirestationJacketController extends BaseController {
QueryWrapper<FirestationJacket> queryWrapper = new QueryWrapper<>(); QueryWrapper<FirestationJacket> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("firefighters_id", sequenceNbr); queryWrapper.eq("firefighters_id", sequenceNbr);
queryWrapper.eq("is_delete", 0); queryWrapper.eq("is_delete", 0);
FirestationJacket firestationJacket = iFirestationJacketService.getOne(queryWrapper); List<FirestationJacket> firestationJacket = iFirestationJacketService.list(queryWrapper);
if(firestationJacket!=null){ if(firestationJacket!=null&&firestationJacket.size()>0){
return CommonResponseUtil2.failure("微型消防站有配装装备,不能删除!"); return CommonResponseUtil2.failure("微型消防站有配装装备,不能删除!");
} }
......
package com.yeejoin.amos.boot.module.jcs.biz.controller; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar;
import com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -12,7 +18,9 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -12,7 +18,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -49,7 +57,9 @@ public class PowerTransferController extends BaseController { ...@@ -49,7 +57,9 @@ public class PowerTransferController extends BaseController {
@Autowired @Autowired
FireTeamServiceImpl fireTeamService; FireTeamServiceImpl fireTeamService;
@Autowired @Autowired
EquipFeignClient equipFeignClient; EquipFeignClient docequipFeignClient;
@Autowired
UserCarMapper userCarMapper;
/** /**
* 新增力量调派 * 新增力量调派
...@@ -174,6 +184,29 @@ public class PowerTransferController extends BaseController { ...@@ -174,6 +184,29 @@ public class PowerTransferController extends BaseController {
@RequestMapping(value = "/create", method = RequestMethod.POST) @RequestMapping(value = "/create", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "力量调派-任务派发", notes = "力量调派-任务派发") @ApiOperation(httpMethod = "POST", value = "力量调派-任务派发", notes = "力量调派-任务派发")
public ResponseModel<Boolean> createPowerTransfer(@RequestBody PowerTransferDto powerTransferDto) { public ResponseModel<Boolean> createPowerTransfer(@RequestBody PowerTransferDto powerTransferDto) {
List<PowerTransferCompanyDto> powerTransferCompanyDotList = powerTransferDto.getPowerTransferCompanyDotList();
StringBuilder content = new StringBuilder();
powerTransferCompanyDotList.forEach(e->{
if (e.getPowerTransferCompanyResourcesDtoList()!=null){
e.getPowerTransferCompanyResourcesDtoList().forEach(
c->
{
LambdaQueryWrapper<UserCar> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(UserCar::getCarId,c.getResourcesId());
wrapper.eq(BaseEntity::getIsDelete, false);
Integer count = userCarMapper.selectCount(wrapper);
if (count < 1){
content.append(c.getResourcesName()+":"+c.getResourcesNum()+" ");
}
}
);
}
});
if (!ValidationUtil.isEmpty(content)){
throw new BadRequest("车辆:"+content+"未绑定人员,无法调派");
}
AgencyUserModel userInfo = getUserInfo(); AgencyUserModel userInfo = getUserInfo();
powerTransferDto.setTaskSenderId(Long.parseLong(userInfo.getUserId())); powerTransferDto.setTaskSenderId(Long.parseLong(userInfo.getUserId()));
powerTransferDto.setTaskSenderName(userInfo.getRealName()); powerTransferDto.setTaskSenderName(userInfo.getRealName());
......
...@@ -17,6 +17,7 @@ import org.apache.commons.lang3.ObjectUtils; ...@@ -17,6 +17,7 @@ import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -147,6 +148,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -147,6 +148,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
@Value("${mqtt.topic.command.knowledgebase.alert.match}") @Value("${mqtt.topic.command.knowledgebase.alert.match}")
private String topicMatch; private String topicMatch;
@Value("${mqtt.topic.command.alert.noticeAviation}")
private String noticeAviation;
@Autowired @Autowired
private OrgUsrServiceImpl iOrgUsrService; private OrgUsrServiceImpl iOrgUsrService;
...@@ -454,6 +457,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -454,6 +457,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
emqKeeper.getMqttClient().publish(topicData, json.getBytes(), RuleConfig.DEFAULT_QOS, false); emqKeeper.getMqttClient().publish(topicData, json.getBytes(), RuleConfig.DEFAULT_QOS, false);
// 航空报警器报警通知
if (AlertStageEnums.HKJY.getCode().equals(alertCalled.getAlertTypeCode())) {
List<String> flightNumber = powerTransferMapper.selectFlightNumber(AlertStageEnums.HKJY.getCode());
String flightNumIds = JSONObject.toJSONString(flightNumber);
emqKeeper.getMqttClient().publish(noticeAviation, flightNumIds.getBytes(), RuleConfig.DEFAULT_QOS, false);
}
/** /**
* 同步保存ES * 同步保存ES
*/ */
...@@ -479,6 +489,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -479,6 +489,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
} }
public List<String> selectFlightNumber() throws MqttException {
return powerTransferMapper.selectFlightNumber(AlertStageEnums.HKJY.getCode());
}
...@@ -684,11 +699,31 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -684,11 +699,31 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
Map<String, Integer> map = powerTransferMapper.getCarNum(id); Map<String, Integer> map = powerTransferMapper.getCarNum(id);
// Map<String,Integer> mapc=powerTransferMapper.getCompanyNum(id); // Map<String,Integer> mapc=powerTransferMapper.getCompanyNum(id);
// Map<String,Integer> mapu= alertSubmittedMapper.getUseNum(id); // Map<String,Integer> mapu= alertSubmittedMapper.getUseNum(id);
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String dateString = formatter.format(currentTime);
List< Map<String, Integer>> list=powerTransferMapper.getCarUserNum(dateString,id);
AlertCalled al=alertCalledMapper.selectById(id);
// 统计参与人员 // 统计参与人员
List<KeyValueLabel> listdate = new ArrayList<>(); List<KeyValueLabel> listdate = new ArrayList<>();
// if(al.getAlertStatus()){
// listdate.add(new KeyValueLabel("调动人力", "useNum", "0", "人"));
// }
if(list!=null&&list.size()>0){
listdate.add(new KeyValueLabel("调动人力", "useNum", list.size(), "人"));
}else{
listdate.add(new KeyValueLabel("调动人力", "useNum", "0", "人")); listdate.add(new KeyValueLabel("调动人力", "useNum", "0", "人"));
}
// listdate.add(new KeyValueLabel("调动人力", "useNum", "0", "人"));
// 统计参与车辆 // 统计参与车辆
listdate.add(new KeyValueLabel("调动人力", "carNum", map.get("carNum"), "辆")); listdate.add(new KeyValueLabel("调派车辆", "carNum", map.get("carNum"), "辆/次"));
// 统计参与队伍 // 统计参与队伍
listdate.add(new KeyValueLabel("调动单位", "companyNum", map.get("companyNum"), "个")); listdate.add(new KeyValueLabel("调动单位", "companyNum", map.get("companyNum"), "个"));
return listdate; return listdate;
......
...@@ -36,6 +36,7 @@ import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService; ...@@ -36,6 +36,7 @@ import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.jcs.api.entity.*; import com.yeejoin.amos.boot.module.jcs.api.entity.*;
import com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xwpf.usermodel.XWPFTable; import org.apache.poi.xwpf.usermodel.XWPFTable;
...@@ -186,6 +187,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -186,6 +187,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Value("${mqtt.topic.command.power.deployment}") @Value("${mqtt.topic.command.power.deployment}")
private String powertopic; private String powertopic;
@Value("${mqtt.topic.command.alert.noticeAviation}")
private String noticeAviation;
@Autowired @Autowired
EquipFeignClient equipFeignClient; EquipFeignClient equipFeignClient;
...@@ -348,6 +351,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -348,6 +351,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
ruleAlertCalledService.fireAlertCalledRule(alertCalledVo, map.get("alertWay"),map.get("mobiles"), map.get("usIds"), map.get("feedBack")); ruleAlertCalledService.fireAlertCalledRule(alertCalledVo, map.get("alertWay"),map.get("mobiles"), map.get("usIds"), map.get("feedBack"));
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化 //通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(powertopic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true); emqKeeper.getMqttClient().publish(powertopic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
// 航空报警器警情结案推送
if(AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode()) && AlertStageEnums.HKJY.getCode().equals(alertCalled.getAlertTypeCode())) {
List<String> list = powerTransferMapper.selectFlightNumber(AlertStageEnums.HKJY.getCode());
emqKeeper.getMqttClient().publish(noticeAviation, JSONObject.toJSONString(list).getBytes(), RuleConfig.DEFAULT_QOS, false);
}
// 警情结案时,修改该警情关联待办任务状态
if(AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
MessageModel model = new MessageModel();
model.setRelationId(String.valueOf(alertCalled.getSequenceNbr()));
model.setIsRead(true);
model.setMsgType("jcs119");
Systemctl.messageClient.update(model);
}
} catch (MqttException e) { } catch (MqttException e) {
throw new RuntimeException(); throw new RuntimeException();
} }
...@@ -1224,11 +1242,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1224,11 +1242,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
int listLength = dangerList.size(); int listLength = dangerList.size();
for (int i = 0; i < fSizs; i++) { for (int i = 0; i < fSizs; i++) {
if(i == 0) { if(i == 0) {
TableStyle tableStyle = new TableStyle();
tableStyle.setAlign(Enum.forString("center"));
reverseList.get(i).getCellDatas().get(0).setCellStyle(tableStyle);
Style style = new Style(); Style style = new Style();
style.setFontFamily("宋体"); style.setFontFamily("宋体");
style.setFontSize(12); style.setFontSize(12);
style.setBold(true); style.setBold(true);
reverseList.get(i).getCellDatas().get(0).getRenderData().setStyle(style); reverseList.get(i).getCellDatas().get(0).getRenderData().setStyle(style);
reverseList.get(i).getCellDatas().get(0).getRenderData().setText("增\n援\n力\n量");
} else { } else {
reverseList.get(i).getCellDatas().forEach(cellRenderData -> { reverseList.get(i).getCellDatas().forEach(cellRenderData -> {
Style style = new Style(); Style style = new Style();
...@@ -1247,13 +1270,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1247,13 +1270,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
for (int i = fSizs; i < listLength ; i++) { for (int i = fSizs; i < listLength ; i++) {
TableStyle tableStyle = new TableStyle(); TableStyle tableStyle = new TableStyle();
tableStyle.setAlign(Enum.forInt(2)); tableStyle.setAlign(Enum.forString("center"));
reverseList.get(i).getCellDatas().get(0).setCellStyle(tableStyle); reverseList.get(i).getCellDatas().get(0).setCellStyle(tableStyle);
reverseList.get(i).getCellDatas().get(0).getRenderData().setText("增\n援\n力\n量"); reverseList.get(i).getCellDatas().get(0).getRenderData().setText("增\n援\n力\n量");
Style style = new Style(); Style style = new Style();
style.setFontFamily("宋体"); style.setFontFamily("宋体");
style.setFontSize(12); style.setFontSize(12);
style.setBold(true); style.setBold(true);
reverseList.get(i).getCellDatas().get(0).getRenderData().setStyle(style); reverseList.get(i).getCellDatas().get(0).getRenderData().setStyle(style);
// reverseList.get(i).getCellDatas().forEach(cellRenderData -> { // reverseList.get(i).getCellDatas().forEach(cellRenderData -> {
// Style style = new Style(); // Style style = new Style();
...@@ -1696,7 +1721,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1696,7 +1721,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Map<String, String> besidesMap = new HashMap<String, String>(); Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("responseLevelString", responseLevelString); besidesMap.put("responseLevelString", responseLevelString);
besidesMap.put("alterId", alertCalledId); besidesMap.put("alterId", alertCalledId);
if(userList.size()>0) { if(!ValidationUtil.isEmpty(userList)) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList, null); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList, null);
} }
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
...@@ -86,11 +87,14 @@ public class ESAlertCalledService { ...@@ -86,11 +87,14 @@ public class ESAlertCalledService {
List<AlertCalled> alertCalleds = alertCalledService.list(wrapper); List<AlertCalled> alertCalleds = alertCalledService.list(wrapper);
if (!ValidationUtil.isEmpty(alertCalleds)) if (!ValidationUtil.isEmpty(alertCalleds))
{ {
for (AlertCalled alertCalled : alertCalleds) // for (AlertCalled alertCalled : alertCalleds)
{ // {
saveAlertCalledToES(alertCalled); // saveAlertCalledToES(alertCalled);
} // }
saveAlertCalledToES(alertCalleds);
} }
return true; return true;
} }
...@@ -151,6 +155,44 @@ public class ESAlertCalledService { ...@@ -151,6 +155,44 @@ public class ESAlertCalledService {
return esAlertCalled; return esAlertCalled;
} }
public List<ESAlertCalled> saveAlertCalledToES(List<AlertCalled> alertCalleds) throws Exception
{
List<ESAlertCalled> list1=new ArrayList<>();
for (AlertCalled alertCalled : alertCalleds)
{
ESAlertCalled esAlertCalled = new ESAlertCalled();
esAlertCalled.setSequenceNbr(alertCalled.getSequenceNbr());
esAlertCalled.setAlertType(alertCalled.getAlertType());
esAlertCalled.setAlertTypeCode(alertCalled.getAlertTypeCode());
esAlertCalled.setCallTime(alertCalled.getCallTime());
esAlertCalled.setCallTimeLong(alertCalled.getCallTime()!=null?alertCalled.getCallTime().getTime():null);
esAlertCalled.setContactUser(alertCalled.getContactUser());
esAlertCalled.setContactPhone(alertCalled.getContactPhone());
esAlertCalled.setAddress(alertCalled.getAddress());
esAlertCalled.setAlertStage(alertCalled.getAlertStage());
esAlertCalled.setAlertStatus(alertCalled.getAlertStatus());
if (alertCalled.getAlertStatus())
{
esAlertCalled.setAlertStatusStr(AlertStatusEnum.CLOSED.getCode());
}else
{
esAlertCalled.setAlertStatusStr(AlertStatusEnum.UNCLOSED.getCode());
}
esAlertCalled.setResponseLevelCode(alertCalled.getResponseLevelCode());
esAlertCalled.setUnitInvolved(alertCalled.getUnitInvolved());
esAlertCalled.setCoordinateX(alertCalled.getCoordinateX());
esAlertCalled.setCoordinateY(alertCalled.getCoordinateY());
list1.add(esAlertCalled);
}
esAlertCalledRepository.saveAll(list1);
return list1;
}
/** /**
* *
* <pre> * <pre>
......
...@@ -6,6 +6,7 @@ import java.util.List; ...@@ -6,6 +6,7 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum; import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum;
import com.yeejoin.amos.component.rule.config.ClazzUtils; import com.yeejoin.amos.component.rule.config.ClazzUtils;
import com.yeejoin.amos.feign.rule.Rule; import com.yeejoin.amos.feign.rule.Rule;
...@@ -90,7 +91,10 @@ public class RuleAlertCalledService { ...@@ -90,7 +91,10 @@ public class RuleAlertCalledService {
FactBaseModel factBaseModel = new FactBaseModel(); FactBaseModel factBaseModel = new FactBaseModel();
factBaseModel.setPackageId("西咸机场119接处警规则/alertCalledRule"); factBaseModel.setPackageId("西咸机场119接处警规则/alertCalledRule");
HashMap<String, byte[]> map = new HashMap<>(); HashMap<String, byte[]> map = new HashMap<>();
map.put("com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo", ClazzUtils.serializableObject(alertCalledRo));
// map.put("com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo", ClazzUtils.serializableObject(alertCalledRo));
map.put("com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo", JSONObject.toJSON(alertCalledRo).toString().getBytes());
factBaseModel.setFactMap(map); factBaseModel.setFactMap(map);
Rule.ruleClient.fireRule(factBaseModel); Rule.ruleClient.fireRule(factBaseModel);
return true; return true;
......
...@@ -17,6 +17,12 @@ ...@@ -17,6 +17,12 @@
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-knowledgebase-api</artifactId> <artifactId>amos-boot-module-knowledgebase-api</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>
......
package com.yeejoin.amos.knowledgebase.controller; package com.yeejoin.amos.knowledgebase.controller;
import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONArray;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -212,18 +214,31 @@ public class DocLibraryResource { ...@@ -212,18 +214,31 @@ public class DocLibraryResource {
docLibraryService.export(id, type, response); docLibraryService.export(id, type, response);
} }
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "导入excel文档")
// @RequestMapping(value = "/import", method = RequestMethod.POST)
// public ResponseModel importExcel(@RequestPart(value = "file") MultipartFile file,
// @RequestPart(value = "module") String moduleStr) {
// ExcelImportConfig excelConfig;
// try {
// excelConfig = JSON.parseObject(moduleStr, ExcelImportConfig.class);
// } catch (Exception e) {
// throw new BadRequest("模板配置信息格式有误");
// }
// return ResponseHelper.buildResponse(docLibraryService.importExcel(file, excelConfig));
// }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导入excel文档") @ApiOperation(value = "导入excel文档")
@RequestMapping(value = "/import", method = RequestMethod.POST) @RequestMapping(value = "/import", method = RequestMethod.POST)
public ResponseModel importExcel(@RequestPart(value = "file") MultipartFile file, public ResponseModel importExcel(@RequestPart(value = "file") MultipartFile file, @RequestPart(value = "module") String moduleStr) {
@RequestPart(value = "module") String moduleStr) { List<ExcelImportConfig> excelConfigList;
ExcelImportConfig excelConfig;
try { try {
excelConfig = JSON.parseObject(moduleStr, ExcelImportConfig.class); excelConfigList = JSONArray.parseArray(moduleStr, ExcelImportConfig.class);
} catch (Exception e) { } catch (Exception e) {
throw new BadRequest("模板配置信息格式有误"); throw new BadRequest("模板配置信息格式有误");
} }
return ResponseHelper.buildResponse(docLibraryService.importExcel(file, excelConfig)); return ResponseHelper.buildResponse(docLibraryService.importExcel(file, excelConfigList));
} }
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.knowledgebase.face.orm.dao; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.knowledgebase.face.orm.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowlegeStatisticsRecord; import com.yeejoin.amos.knowledgebase.face.orm.entity.KnowlegeStatisticsRecord;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -18,12 +19,14 @@ public interface StatisticsRecordMapper extends BaseMapper<KnowlegeStatisticsRec ...@@ -18,12 +19,14 @@ public interface StatisticsRecordMapper extends BaseMapper<KnowlegeStatisticsRec
/** /**
* 表清空 * 表清空
*
* @return * @return
*/ */
void deleteAll(); void deleteAll();
/** /**
* 查询灾情总计 * 查询灾情总计
*
* @return * @return
*/ */
Map<String, Object> selectDisasterCount(); Map<String, Object> selectDisasterCount();
...@@ -38,4 +41,19 @@ public interface StatisticsRecordMapper extends BaseMapper<KnowlegeStatisticsRec ...@@ -38,4 +41,19 @@ public interface StatisticsRecordMapper extends BaseMapper<KnowlegeStatisticsRec
*/ */
List<Map<String, Object>> selectCountByNameAndDateRange(Map<String, Object> queryMap); List<Map<String, Object>> selectCountByNameAndDateRange(Map<String, Object> queryMap);
List<Map<String, Object>> tagStatisticsMonth(String tag, Date startDate, Date endDate);
List<Map<String, Object>> tagStatisticsYear(String tag, Date startDate, Date endDate);
List<Map<String, Object>> docStatisticsMonth(String categoryName, Date startDate, Date endDate);
List<Map<String, Object>> docStatisticsYear(String categoryName, Date startDate, Date endDate);
List<Map<String, Object>> tagChartStatistics(String tag, Date startDate, Date endDate,String splitSQL);
List<Map<String, Object>> tagTimeChartStatistics(Date startDate, Date endDate,String splitSQL);
List<Map<String, Object>> docChartStatistics(Date startDate, Date endDate);
List<Map<String, Object>> docBurnChartStatistics(Date startDate, Date endDate);
} }
\ No newline at end of file
package com.yeejoin.amos.knowledgebase.face.service; package com.yeejoin.amos.knowledgebase.face.service;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -257,4 +250,13 @@ public class DocCategoryService extends BaseService<KnowledgeDocCategoryModel, K ...@@ -257,4 +250,13 @@ public class DocCategoryService extends BaseService<KnowledgeDocCategoryModel, K
List<KnowledgeDocCategoryModel> categoryModelList = this.queryForList(null, true, categoryName, parentId); List<KnowledgeDocCategoryModel> categoryModelList = this.queryForList(null, true, categoryName, parentId);
return categoryModelList.isEmpty() ? null : categoryModelList.get(0); return categoryModelList.isEmpty() ? null : categoryModelList.get(0);
} }
public Map<String, Long> getGroupNameValue(List<Long> ids) {
List<KnowledgeDocCategoryModel> list = this.queryBatchSeq(ids);
Map<String, Long> result = new HashMap<>();
for(KnowledgeDocCategoryModel knowledgeDocCategoryModel: list) {
result.put(knowledgeDocCategoryModel.getCategoryName(), knowledgeDocCategoryModel.getSequenceNbr());
}
return result;
}
} }
...@@ -96,8 +96,9 @@ public class ESDocService { ...@@ -96,8 +96,9 @@ public class ESDocService {
} }
catch (Exception e) catch (Exception e)
{ {
return new AggregatedPageImpl<>(list, PageRequest.of(current, size), 0); e.printStackTrace();
} }
return new AggregatedPageImpl<>(list, PageRequest.of(current, size), 0);
} }
/** /**
...@@ -129,12 +130,12 @@ public class ESDocService { ...@@ -129,12 +130,12 @@ public class ESDocService {
for (String key : keys) { for (String key : keys) {
boolMust.must( boolMust.must(
QueryBuilders.boolQuery().minimumShouldMatch(1) QueryBuilders.boolQuery().minimumShouldMatch(1)
.should(QueryBuilders.matchQuery("docTitle", key)) .should(QueryBuilders.matchPhraseQuery("docTitle", key))
.should(QueryBuilders.matchQuery("docInfo", key)) .should(QueryBuilders.matchPhraseQuery("docInfo", key))
.should(QueryBuilders.matchQuery("author", key)) .should(QueryBuilders.matchPhraseQuery("author", key))
.should(QueryBuilders.matchQuery("textContent", key)) .should(QueryBuilders.matchPhraseQuery("textContent", key))
.should(QueryBuilders.matchQuery("docTags.tagInfo", key)) .should(QueryBuilders.matchPhraseQuery("docTags.tagInfo", key))
.should(QueryBuilders.matchQuery("contentTags.tagInfo", key)) .should(QueryBuilders.matchPhraseQuery("contentTags.tagInfo", key))
); );
} }
// 创建查询构造器 // 创建查询构造器
......
...@@ -436,4 +436,11 @@ public class LatentDangerController extends BaseController { ...@@ -436,4 +436,11 @@ public class LatentDangerController extends BaseController {
} }
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
@ApiOperation(value = "隐患跳转巡检任务页面", notes = "隐患跳转巡检任务页面")
@GetMapping(value = "/web/patrol/{id}/{bizId}")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel selectByIdandBizId(@PathVariable String bizId, @PathVariable Long id) {
return ResponseHelper.buildResponse(iLatentDangerService.selectByIdandBizId(id, bizId));
}
} }
...@@ -90,4 +90,6 @@ public interface LatentDangerMapper extends BaseMapper<LatentDanger> { ...@@ -90,4 +90,6 @@ public interface LatentDangerMapper extends BaseMapper<LatentDanger> {
String orgCode); String orgCode);
List<LatentDanger> updateStatusByUserIdAndPlandIdLike(String userId,String planId); List<LatentDanger> updateStatusByUserIdAndPlandIdLike(String userId,String planId);
String selectByIdandBizId(Long id,String bizId);
} }
...@@ -9,7 +9,9 @@ import java.util.*; ...@@ -9,7 +9,9 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.opengis.metadata.acquisition.Plan;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -2488,10 +2490,18 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2488,10 +2490,18 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
DangerExecuteSubmitDto executeSubmitDto) throws Exception { DangerExecuteSubmitDto executeSubmitDto) throws Exception {
List<String> userIds = workflowExecuteService.getUserIdsByWorkflow(latentDanger.getInstanceId(), List<String> userIds = workflowExecuteService.getUserIdsByWorkflow(latentDanger.getInstanceId(),
executeSubmitDto.getCheckLeaderId()); executeSubmitDto.getCheckLeaderId());
// 修改待办任务状态
updateTaskStatus(latentDanger);
ruleDangerService.addDangerSubmitRule(latentDanger, userIds, RuleTypeEnum.隐患审核.getCode(), ruleDangerService.addDangerSubmitRule(latentDanger, userIds, RuleTypeEnum.隐患审核.getCode(),
ExecuteTypeEnum.getNameByCode(executeType)); ExecuteTypeEnum.getNameByCode(executeType));
} }
private void updateTaskStatus(LatentDanger latentDanger){
MessageModel model = new MessageModel();
model.setRelationId(String.valueOf(latentDanger.getId()));
model.setMsgType("danger");
model.setIsRead(true);
Systemctl.messageClient.update(model);
}
@Override @Override
public IPage<LatentDanger> reviewListDanger(PageParam pageParam, String userId) throws Exception { public IPage<LatentDanger> reviewListDanger(PageParam pageParam, String userId) throws Exception {
String type = pageParam.get("type").toString(); String type = pageParam.get("type").toString();
...@@ -2707,4 +2717,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2707,4 +2717,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
this.savePatrol(dangerDtos,userId,userRealName,departmentId,departmentName,companyId,orgCode,role,"1"); this.savePatrol(dangerDtos,userId,userRealName,departmentId,departmentName,companyId,orgCode,role,"1");
} }
public String selectByIdandBizId(Long id,String bizId){
return latentDangerMapper.selectByIdandBizId(id,bizId);
}
} }
\ No newline at end of file
...@@ -203,4 +203,6 @@ public interface ILatentDangerService { ...@@ -203,4 +203,6 @@ public interface ILatentDangerService {
public Map<String, Integer> currentLandgerCount(String companyId,String loginOrgCode); public Map<String, Integer> currentLandgerCount(String companyId,String loginOrgCode);
void updateStatusByUserIdAndPlandIdLike(String userId, String planId,ReginParams reginParams) throws Exception; void updateStatusByUserIdAndPlandIdLike(String userId, String planId,ReginParams reginParams) throws Exception;
String selectByIdandBizId(Long id,String bizId) ;
} }
package com.yeejoin.amos.maintenance.business.service.impl; package com.yeejoin.amos.maintenance.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;
...@@ -11,8 +11,11 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -11,8 +11,11 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel; import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.maintenance.business.constants.XJConstant; import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dao.mapper.CheckMapper; import com.yeejoin.amos.maintenance.business.dao.mapper.CheckMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskDetailMapper; import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper; import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.RouteMapper; import com.yeejoin.amos.maintenance.business.dao.mapper.RouteMapper;
...@@ -115,6 +118,9 @@ public class CheckServiceImpl implements ICheckService { ...@@ -115,6 +118,9 @@ public class CheckServiceImpl implements ICheckService {
@Autowired @Autowired
IRouteDao iRouteDao; IRouteDao iRouteDao;
@Autowired
PlanServiceImpl planService;
final String CHECK_UPDATE_TOPIC = "maintenance/date/update"; final String CHECK_UPDATE_TOPIC = "maintenance/date/update";
...@@ -273,6 +279,15 @@ public class CheckServiceImpl implements ICheckService { ...@@ -273,6 +279,15 @@ public class CheckServiceImpl implements ICheckService {
jsonObject.put("maintenanceTime", check.getCheckTime()); jsonObject.put("maintenanceTime", check.getCheckTime());
mqttGateway.publish(CHECK_UPDATE_TOPIC, jsonObject.toJSONString()); mqttGateway.publish(CHECK_UPDATE_TOPIC, jsonObject.toJSONString());
} }
Plan plan = planService.queryPlanById(planTask.getPlanId());
if (!ObjectUtils.isEmpty(plan) && plan.getIsSingleExecution()){
// 单人执行
updateTaskStatus(plan.getId(), reginParams.getUserModel().getUserId());
}else {
// 多人执行
updateTaskStatus(plan.getId(), null);
}
//7.返回不合格记录 //7.返回不合格记录
return new CheckDto(check.getId(), unqualifiedCheckItemList); return new CheckDto(check.getId(), unqualifiedCheckItemList);
} catch (Exception e) { } catch (Exception e) {
...@@ -280,6 +295,17 @@ public class CheckServiceImpl implements ICheckService { ...@@ -280,6 +295,17 @@ public class CheckServiceImpl implements ICheckService {
throw new Exception(e.getMessage(), e); throw new Exception(e.getMessage(), e);
} }
} }
private void updateTaskStatus(Long planId, String userId){
MessageModel model = new MessageModel();
model.setRelationId(String.valueOf(planId));
model.setIsRead(true);
model.setMsgType("maintenance");
if (!ObjectUtils.isEmpty(userId)){
model.setUserId(userId);
}
log.info("修改待办任务参数-->{}", JSON.toJSON(model));
Systemctl.messageClient.update(model);
}
private void checkCanFinishTask(String mtUserSeq, PlanTask planTask, Long pointId) throws Exception { private void checkCanFinishTask(String mtUserSeq, PlanTask planTask, Long pointId) throws Exception {
int status; int status;
......
...@@ -273,6 +273,7 @@ public class CheckController extends AbstractBaseController { ...@@ -273,6 +273,7 @@ public class CheckController extends AbstractBaseController {
//数字换流站页面刷新 //数字换流站页面刷新
try { try {
webMqttComponent.publish(patrolTopic, ""); webMqttComponent.publish(patrolTopic, "");
}catch (Exception e){ }catch (Exception e){
log.error("数字换流站页面推送失败-----------"+e.getMessage()); log.error("数字换流站页面推送失败-----------"+e.getMessage());
} }
......
...@@ -139,6 +139,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -139,6 +139,7 @@ public class LatentDangerController extends AbstractBaseController {
} }
return iLatentDangerService.detail(id, user.getUserId(),isFinish); return iLatentDangerService.detail(id, user.getUserId(),isFinish);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
return CommonResponseUtil.failure("系统繁忙,请稍后再试"); return CommonResponseUtil.failure("系统繁忙,请稍后再试");
} }
} }
......
...@@ -48,4 +48,7 @@ public class LatentDangerPatrolBo extends LatentDangerPatrolBoExtend { ...@@ -48,4 +48,7 @@ public class LatentDangerPatrolBo extends LatentDangerPatrolBoExtend {
* 记录修改时间 * 记录修改时间
*/ */
private Date updateDate; private Date updateDate;
//input id
private Long inputId;
} }
...@@ -15,6 +15,11 @@ import java.util.stream.Collectors; ...@@ -15,6 +15,11 @@ import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.patrol.dao.entity.Plan;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.assertj.core.util.Sets; import org.assertj.core.util.Sets;
...@@ -137,6 +142,9 @@ public class CheckServiceImpl implements ICheckService { ...@@ -137,6 +142,9 @@ public class CheckServiceImpl implements ICheckService {
@Autowired @Autowired
private IPointClassifyDao iPointClassifyDao; private IPointClassifyDao iPointClassifyDao;
@Autowired
private PlanServiceImpl planService;
// @Value("${file.ip}") // @Value("${file.ip}")
// private String fileIp; // private String fileIp;
// //
...@@ -211,6 +219,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -211,6 +219,7 @@ public class CheckServiceImpl implements ICheckService {
PlanTask planTask = null; PlanTask planTask = null;
Check check = new Check(); Check check = new Check();
HashMap<String, Object> routeParam = new HashMap<String, Object>(); HashMap<String, Object> routeParam = new HashMap<String, Object>();
Map detail = null; Map detail = null;
Boolean isOffline = requestParam.getIsOffline(); Boolean isOffline = requestParam.getIsOffline();
...@@ -343,7 +352,15 @@ public class CheckServiceImpl implements ICheckService { ...@@ -343,7 +352,15 @@ public class CheckServiceImpl implements ICheckService {
}else{ }else{
check.setScore(Integer.parseInt(XJConstant.POINT_NOT_SCORE)); check.setScore(Integer.parseInt(XJConstant.POINT_NOT_SCORE));
} }
// check = checkDao.save(check);
try {
check = checkDao.save(check); check = checkDao.save(check);
}catch (Exception e) {
e.printStackTrace();
}
List<CheckShot> imgList = new ArrayList<>(); List<CheckShot> imgList = new ArrayList<>();
...@@ -409,6 +426,15 @@ public class CheckServiceImpl implements ICheckService { ...@@ -409,6 +426,15 @@ public class CheckServiceImpl implements ICheckService {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
planTaskMapper.reformStatistics(user.getUserId(), sdf.format(new Date()), requestParam.getOrgCode()); planTaskMapper.reformStatistics(user.getUserId(), sdf.format(new Date()), requestParam.getOrgCode());
} }
// 任务完成、同步修改待办任务状态
Plan plan = planService.queryPlanById(check.getPlanId());
if (!ObjectUtils.isEmpty(plan) && plan.getIsSingleExecution()){
// 单人执行
updateTaskStatus(plan.getId(), user.getUserId());
}else {
// 多人执行
updateTaskStatus(plan.getId(), null);
}
return new CheckDto(check.getId(), unqualifiedcheckItemList); return new CheckDto(check.getId(), unqualifiedcheckItemList);
} catch (Exception e) { } catch (Exception e) {
...@@ -416,7 +442,21 @@ public class CheckServiceImpl implements ICheckService { ...@@ -416,7 +442,21 @@ public class CheckServiceImpl implements ICheckService {
return null; return null;
} }
} }
private void updateTaskStatus(Long id, String userId){
try {
MessageModel model = new MessageModel();
model.setRelationId(String.valueOf(id));
model.setIsRead(true);
model.setMsgType("patrolSystem");
if (!ObjectUtils.isEmpty(userId)){
model.setUserId(userId);
}
FeignClientResult<MessageModel> update = Systemctl.messageClient.update(model);
}catch (Exception e) {
e.printStackTrace();
}
}
@Override @Override
public void delCheckById(List<Long> list) { public void delCheckById(List<Long> list) {
// List<Long> pointIdList = checkDao.getPointIdList(list); // List<Long> pointIdList = checkDao.getPointIdList(list);
......
...@@ -602,6 +602,9 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -602,6 +602,9 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
} }
Date startDate1 = new Date();; Date startDate1 = new Date();;
int dangerListSize = latentDangerMapper.countByBathBusinessKeys(bussinessKeys, latentDangerListParam); int dangerListSize = latentDangerMapper.countByBathBusinessKeys(bussinessKeys, latentDangerListParam);
if (latentDangerListParam.getBelongType().equals(1)){
latentDangerListParam.setUserId(user.getUserId());
}
List<LatentDangerBo> dangerList = latentDangerMapper.getByBathBusinessKeys(bussinessKeys, latentDangerListParam); List<LatentDangerBo> dangerList = latentDangerMapper.getByBathBusinessKeys(bussinessKeys, latentDangerListParam);
Date endDate1 = new Date(); Date endDate1 = new Date();
logger.info("-------------------------sql时间" +(endDate1.getTime()-startDate1.getTime())); logger.info("-------------------------sql时间" +(endDate1.getTime()-startDate1.getTime()));
...@@ -835,6 +838,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -835,6 +838,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
// detailVo.setCurrentUserCanExcute(true); // detailVo.setCurrentUserCanExcute(true);
// } // }
// } // }
detailVo.setCurrentFlowRecordId(latentDangerBo.getCurrentFlowRecordId()); detailVo.setCurrentFlowRecordId(latentDangerBo.getCurrentFlowRecordId());
detailVo.setCurrentFlowRecordIdWeb(String.valueOf(latentDangerBo.getCurrentFlowRecordId())); detailVo.setCurrentFlowRecordIdWeb(String.valueOf(latentDangerBo.getCurrentFlowRecordId()));
if (!StringUtils.isEmpty(latentDangerBo.getReformJson())) { if (!StringUtils.isEmpty(latentDangerBo.getReformJson())) {
...@@ -851,8 +855,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -851,8 +855,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
} }
private void buildOfDifferentDangerType(LatentDangerBo latentDangerBo, LatentDangerDetailVo detailVo) { private void buildOfDifferentDangerType(LatentDangerBo latentDangerBo, LatentDangerDetailVo detailVo) {
if (latentDangerBo.getDangerType().equals(LatentDangerTypeEnum.计划检查.getCode()) if (latentDangerBo.getDangerType().equals(LatentDangerTypeEnum.计划检查.getCode().toString())
|| latentDangerBo.getDangerType().equals(LatentDangerTypeEnum.无计划检查.getCode())) { || latentDangerBo.getDangerType().equals(LatentDangerTypeEnum.无计划检查.getCode().toString())) {
LatentDangerPatrolBo patrolBo = latentDangerPatrolMapper.getByDangerId(latentDangerBo.getId()); LatentDangerPatrolBo patrolBo = latentDangerPatrolMapper.getByDangerId(latentDangerBo.getId());
if (patrolBo != null) { if (patrolBo != null) {
LatentDangerDetailRiskVo riskVo = new LatentDangerDetailRiskVo(); LatentDangerDetailRiskVo riskVo = new LatentDangerDetailRiskVo();
...@@ -870,19 +874,23 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -870,19 +874,23 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
if (StringUtil.isNotEmpty(checkUser)) { if (StringUtil.isNotEmpty(checkUser)) {
riskVo.setCheckUser(checkUser.getRealName()); riskVo.setCheckUser(checkUser.getRealName());
} }
RiskFactorBo riskFactorBo = StringUtil.isNotEmpty(patrolBo.getClassifyOriginalId()) ? riskFactorMapper.getById(Long.valueOf(patrolBo.getClassifyOriginalId())) : null; // RiskFactorBo riskFactorBo = StringUtil.isNotEmpty(patrolBo.getClassifyOriginalId()) ? riskFactorMapper.getById(Long.valueOf(patrolBo.getClassifyOriginalId())) : null;
if (riskFactorBo != null && riskFactorBo.getEquipmentDepartmentId() != null) { // if (riskFactorBo != null && riskFactorBo.getEquipmentDepartmentId() != null) {
DepartmentModel department = remoteSecurityService.getDepartmentByDeptId(RequestContext.getToken(), getProduct(),RequestContext.getAppKey(),riskFactorBo.getEquipmentDepartmentId().toString()); // DepartmentModel department = remoteSecurityService.getDepartmentByDeptId(RequestContext.getToken(), getProduct(),RequestContext.getAppKey(),riskFactorBo.getEquipmentDepartmentId().toString());
if (department != null) { // if (department != null) {
riskVo.setBelongDepartmentName(department.getDepartmentName()); // riskVo.setBelongDepartmentName(department.getDepartmentName());
} // }
} // }
// List<CheckShot> checkShots = iCheckShotDao.findAllByCheckIdAndCheckInputId(patrolBo.getCheckId(),
// latentDangerBo.getBizId());
List<CheckShot> checkShots = iCheckShotDao.findAllByCheckIdAndCheckInputId(patrolBo.getCheckId(), List<CheckShot> checkShots = iCheckShotDao.findAllByCheckIdAndCheckInputId(patrolBo.getCheckId(),
latentDangerBo.getBizId()); patrolBo.getInputId());
if (!CollectionUtils.isEmpty(checkShots)) { if (!CollectionUtils.isEmpty(checkShots)) {
List<String> photos = Lists.transform(checkShots, e -> { List<String> photos = Lists.transform(checkShots, e -> {
if (e != null) { if (e != null) {
return fileServerAddress + e.getPhotoData().replaceAll("\\\\", "/"); // return fileServerAddress + e.getPhotoData().replaceAll("\\\\", "/");
return e.getPhotoData().replaceAll("\\\\", "/");
} else { } else {
return ""; return "";
} }
...@@ -1264,9 +1272,12 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -1264,9 +1272,12 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
latentDangerBo.setReformType(LatentDangerReformTypeEnum.常规整改.getCode().toString()); latentDangerBo.setReformType(LatentDangerReformTypeEnum.常规整改.getCode().toString());
JSONObject reformJsonObj = JSONObject.parseObject(latentDangerBo.getReformJson()); JSONObject reformJsonObj = JSONObject.parseObject(latentDangerBo.getReformJson());
if (ValidationUtil.isEmpty(reformJsonObj)) { if (ValidationUtil.isEmpty(reformJsonObj)) {
reformJsonObj = executeParam.getFlowJson(); // reformJsonObj = executeParam.getFlowJson();
reformJsonObj.put("governPhotoObj",executeParam.getFlowJson().get("photoUrls"));
} else { } else {
reformJsonObj.putAll(executeParam.getFlowJson()); // reformJsonObj.putAll(executeParam.getFlowJson());
reformJsonObj.put("governPhotoObj",executeParam.getFlowJson().get("photoUrls"));
} }
latentDangerBo.setReformJson(reformJsonObj.toJSONString()); latentDangerBo.setReformJson(reformJsonObj.toJSONString());
latentDangerBo.setInferOtherThings(executeParam.getInferOtherThings()); latentDangerBo.setInferOtherThings(executeParam.getInferOtherThings());
...@@ -1290,6 +1301,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -1290,6 +1301,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
reformJsonObject = new JSONObject(); reformJsonObject = new JSONObject();
} }
reformJsonObject.put("governUserId", governUserId); reformJsonObject.put("governUserId", governUserId);
reformJsonObject.put("reviewPhotoObj",reformJsonObject.get("photoUrls"));
latentDangerBo.setReformJson(reformJsonObject.toJSONString()); latentDangerBo.setReformJson(reformJsonObject.toJSONString());
// 消防巡查需求:评审通过后指定治理人 // 消防巡查需求:评审通过后指定治理人
......
package com.yeejoin.amos.supervision.business.controller; package com.yeejoin.amos.supervision.business.controller;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.supervision.business.constants.XJConstant; import com.yeejoin.amos.supervision.business.constants.XJConstant;
import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.supervision.business.dto.CheckDto; import com.yeejoin.amos.supervision.business.dto.CheckDto;
import com.yeejoin.amos.supervision.business.dto.CheckInputItemDto; import com.yeejoin.amos.supervision.business.dto.CheckInputItemDto;
import com.yeejoin.amos.supervision.business.param.*; import com.yeejoin.amos.supervision.business.param.*;
...@@ -19,6 +23,7 @@ import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone; ...@@ -19,6 +23,7 @@ import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.supervision.core.common.response.GraphInitDataResponse; import com.yeejoin.amos.supervision.core.common.response.GraphInitDataResponse;
import com.yeejoin.amos.supervision.core.framework.PersonIdentify; import com.yeejoin.amos.supervision.core.framework.PersonIdentify;
import com.yeejoin.amos.supervision.core.util.StringUtil; import com.yeejoin.amos.supervision.core.util.StringUtil;
import com.yeejoin.amos.supervision.dao.entity.PlanTask;
import com.yeejoin.amos.supervision.mqtt.WebMqttComponent; import com.yeejoin.amos.supervision.mqtt.WebMqttComponent;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -82,6 +87,10 @@ public class CheckController extends AbstractBaseController { ...@@ -82,6 +87,10 @@ public class CheckController extends AbstractBaseController {
@Value("${amosRefresh.patrol.topic}") @Value("${amosRefresh.patrol.topic}")
private String patrolTopic; private String patrolTopic;
@Autowired
PlanTaskDetailMapper planTaskDetailMapper;
@Autowired @Autowired
private WebMqttComponent webMqttComponent; private WebMqttComponent webMqttComponent;
...@@ -557,6 +566,20 @@ public class CheckController extends AbstractBaseController { ...@@ -557,6 +566,20 @@ public class CheckController extends AbstractBaseController {
String orgCode = getOrgCode(reginParams); String orgCode = getOrgCode(reginParams);
requestParam.setOrgCode(orgCode); requestParam.setOrgCode(orgCode);
List<CheckInputItemDto> checkInputItemDtoList = checkService.saveCheckRecord(requestParam, reginParams); List<CheckInputItemDto> checkInputItemDtoList = checkService.saveCheckRecord(requestParam, reginParams);
// 查询检查计划任务信息
PlanTask planTasks = planTaskDetailMapper.selectById(requestParam.getPlanTaskId());
log.info("检查任务信息-->{}", JSON.toJSON(planTasks));
if (!ObjectUtils.isEmpty(planTasks)){
// 如果计划已超时或者已结束-----更新待办任务状态
if (XJConstant.TASK_STATUS_TIMEOUT == planTasks.getFinishStatus() || XJConstant.TASK_STATUS_FINISH == planTasks.getFinishStatus()){
MessageModel model = new MessageModel();
model.setRelationId(String.valueOf(planTasks.getPlanId()));
model.setMsgType("supervision");
model.setIsRead(true);
log.info("修改待办任务参数-->{}", JSON.toJSON(model));
Systemctl.messageClient.update(model);
}
}
return ResponseHelper.buildResponse(checkInputItemDtoList); return ResponseHelper.buildResponse(checkInputItemDtoList);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.supervision.business.dao.mapper; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.supervision.business.dao.mapper;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.supervision.dao.entity.PlanTask;
import com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail; import com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -19,4 +20,11 @@ public interface PlanTaskDetailMapper extends BaseMapper { ...@@ -19,4 +20,11 @@ public interface PlanTaskDetailMapper extends BaseMapper {
* @param planTaskDetailId 主键id * @param planTaskDetailId 主键id
*/ */
void updateDanger(@Param(value="planTaskDetailId") long planTaskDetailId); void updateDanger(@Param(value="planTaskDetailId") long planTaskDetailId);
/**
* 任务id查询任务信息
* @param id
* @return
*/
PlanTask selectById(@Param("id") Long id);
} }
...@@ -22,6 +22,11 @@ public interface IPlanDao extends BaseDao<Plan, Long> { ...@@ -22,6 +22,11 @@ public interface IPlanDao extends BaseDao<Plan, Long> {
@Modifying @Modifying
@Transactional @Transactional
@Query(value = "select * from p_plan WHERE status NOT IN (0,5,6,7,8)", nativeQuery = true)
List<Plan> queryOutTimePlan();
@Modifying
@Transactional
@Query(value = "select * from p_plan WHERE route_id = ?1 and status = ?2", nativeQuery = true) @Query(value = "select * from p_plan WHERE route_id = ?1 and status = ?2", nativeQuery = true)
List<Plan> queryPlanByRouteId(long routeId, String status); List<Plan> queryPlanByRouteId(long routeId, String status);
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.supervision.business.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.supervision.business.service.impl;
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.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService; 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.dao.repository.IPlanAuditDao; import com.yeejoin.amos.supervision.business.dao.repository.IPlanAuditDao;
...@@ -26,10 +27,7 @@ import org.springframework.stereotype.Service; ...@@ -26,10 +27,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@Service("planAuditService") @Service("planAuditService")
public class PlanAuditServiceImpl implements IPlanAuditService { public class PlanAuditServiceImpl implements IPlanAuditService {
...@@ -77,6 +75,8 @@ public class PlanAuditServiceImpl implements IPlanAuditService { ...@@ -77,6 +75,8 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
workflowExcuteService.CompleteTask(instanceId, conditionValue, reginParams); workflowExcuteService.CompleteTask(instanceId, conditionValue, reginParams);
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity(); ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
String userId = reginParams.getUserModel().getUserId(); String userId = reginParams.getUserModel().getUserId();
plan.setNextGenDate(DateUtils.dateTimeToDate(new Date()));
planService.updateGenDate(plan);
// 更新计划状态,指定执行人 // 更新计划状态,指定执行人
updatePlanStatus(condition,plan,instanceId, conditionValue); updatePlanStatus(condition,plan,instanceId, conditionValue);
// 更新流水表 // 更新流水表
......
...@@ -12,12 +12,16 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey; ...@@ -12,12 +12,16 @@ 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.biz.common.workflow.feign.WorkflowFeignService; 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.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.client.MessageClient;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
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;
import com.yeejoin.amos.supervision.business.dao.mapper.PointMapper; import com.yeejoin.amos.supervision.business.dao.mapper.PointMapper;
import com.yeejoin.amos.supervision.business.dao.repository.*; import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam; import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanService; import com.yeejoin.amos.supervision.business.service.intfc.IPlanService;
import com.yeejoin.amos.supervision.business.util.Toke;
import com.yeejoin.amos.supervision.common.enums.*; import com.yeejoin.amos.supervision.common.enums.*;
import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum; import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum;
import com.yeejoin.amos.supervision.core.async.AsyncTask; import com.yeejoin.amos.supervision.core.async.AsyncTask;
...@@ -238,6 +242,11 @@ public class PlanServiceImpl implements IPlanService { ...@@ -238,6 +242,11 @@ public class PlanServiceImpl implements IPlanService {
} }
} }
public void updateGenDate(Plan plan){
planMapper.updateById(plan);
}
/** /**
* 根据工作流获取下一审核人角色下的所有用户ID =》规则推送消息 * 根据工作流获取下一审核人角色下的所有用户ID =》规则推送消息
* @return * @return
...@@ -260,9 +269,13 @@ public class PlanServiceImpl implements IPlanService { ...@@ -260,9 +269,13 @@ public class PlanServiceImpl implements IPlanService {
rulePlanService.addPlanRule(plan, userIds, RuleTypeEnum.计划提交, null); // 计划提交 rulePlanService.addPlanRule(plan, userIds, RuleTypeEnum.计划提交, null); // 计划提交
} else { } else {
if (PlanStatusEnum.EXAMINE_THREE.getValue() != status){ if (PlanStatusEnum.EXAMINE_THREE.getValue() != status){
// 待办任务状态更新
updateTaskStatus(plan);
// rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核 // rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核
rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核任务, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核任务通知 rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核任务, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核任务通知
} else { } else {
// 待办任务状态更新
updateTaskStatus(plan);
rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核完成, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核完成 rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核完成, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核完成
} }
} }
...@@ -273,6 +286,19 @@ public class PlanServiceImpl implements IPlanService { ...@@ -273,6 +286,19 @@ public class PlanServiceImpl implements IPlanService {
return userIds; return userIds;
} }
private void updateTaskStatus(Plan plan){
Toke toke= remoteSecurityService.getServerToken();
RequestContext.setToken(toke.getToke());
RequestContext.setProduct(toke.getProduct());
RequestContext.setAppKey(toke.getAppKey());
MessageModel model = new MessageModel();
model.setRelationId(String.valueOf(plan.getId()));
model.setMsgType("supervision");
model.setIsRead(true);
log.info("修改待办任务参数-->{}", JSON.toJSON(model));
Systemctl.messageClient.update(model);
}
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());
......
...@@ -377,6 +377,31 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -377,6 +377,31 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String strDate = df.format(now); String strDate = df.format(now);
String tomorrow = DateUtil.getIntervalDateStr(now, 1, "yyyy-MM-dd");// 下一天 String tomorrow = DateUtil.getIntervalDateStr(now, 1, "yyyy-MM-dd");// 下一天
//除草稿状态外其他状态过了计划结束时间都需要根据任务状态更新计划状态。
List<Plan> planLists = iplanDao.queryOutTimePlan();
if (CollectionUtils.isNotEmpty(planLists)){
for (Plan plan : planLists) {
// 当前时间在计划结束时间之前,则计划还未超时
Date date = new Date();
Time time = new Time(date.getTime());
String planEndTime = plan.getPlanEnd() + " " + plan.getDayEnd().toString();
try {
Date parse = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(planEndTime);
if (time.before(new Time(parse.getTime()))){
continue;
}
} catch (ParseException e) {
e.printStackTrace();
}
HashMap<String, Object> param= new HashMap<String, Object>();
param.put("id", plan.getId());
param.put("status", PlanStatusEnum.COMPLETED.getValue());
planMapper.updPlanStatusOrGenDate(param);
}
}
// 根据计划状态5,6和next_gen_date查询需要生成任务的计划 // 根据计划状态5,6和next_gen_date查询需要生成任务的计划
List<Plan> planList = iplanDao.queryScheduledPlan(strDate, List<Plan> planList = iplanDao.queryScheduledPlan(strDate,
String.valueOf(PlanStatusEnum.EXAMINE_DEVELOPED.getValue()), String.valueOf(PlanStatusEnum.EXAMINE_DEVELOPED.getValue()),
...@@ -414,6 +439,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -414,6 +439,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
int num = 0; int num = 0;
//根据计划id查询关联的任务 //根据计划id查询关联的任务
List<PlanTask> planTaskByRouteId = planTaskMapper.getPlanTaskByRouteId(plan.getId()); List<PlanTask> planTaskByRouteId = planTaskMapper.getPlanTaskByRouteId(plan.getId());
if (!ValidationUtil.isEmpty(planTaskByRouteId)){ if (!ValidationUtil.isEmpty(planTaskByRouteId)){
HashMap<String, Object> param = new HashMap<String, Object>(); HashMap<String, Object> param = new HashMap<String, Object>();
param.put("pointId",plan.getId()); param.put("pointId",plan.getId());
...@@ -427,6 +453,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -427,6 +453,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}else { }else {
paramMap.put("status", PlanStatusEnum.COMPLETED.getValue()); paramMap.put("status", PlanStatusEnum.COMPLETED.getValue());
} }
}else {
paramMap.put("status", PlanStatusEnum.OUT_TIME.getValue());
planMapper.updPlanStatusOrGenDate(paramMap);
continue;
} }
if (plan.getIsFixedDate().equals("2")){ if (plan.getIsFixedDate().equals("2")){
paramMap.put("status", PlanStatusEnum.OUT_TIME.getValue()); paramMap.put("status", PlanStatusEnum.OUT_TIME.getValue());
...@@ -437,7 +467,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -437,7 +467,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
planTaskMapper.updateTaskDetailStatusByPlanId(plan.getId()); planTaskMapper.updateTaskDetailStatusByPlanId(plan.getId());
continue; continue;
} }
planMapper.updPlanStatusOrGenDate(paramMap);
if (!ObjectUtils.isEmpty(paramMap.get("status")) && paramMap.get("status").equals(PlanStatusEnum.OUT_TIME.getValue())){ if (!ObjectUtils.isEmpty(paramMap.get("status")) && paramMap.get("status").equals(PlanStatusEnum.OUT_TIME.getValue())){
// 计划超时,修改计划下任务状态 // 计划超时,修改计划下任务状态
...@@ -854,13 +884,17 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -854,13 +884,17 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
} }
log.info(String.format("计划对象:%s", JSON.toJSON(plan))); log.info(String.format("计划对象:%s", JSON.toJSON(plan)));
// 规则推送消息
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.消息型计划生成, extraUserIds);// 根据bug4150 将此处的计划生成的枚举值变成了消息,既TASK ->
// NOTIFY
String userIdString = plan.getUserId(); String userIdString = plan.getUserId();
FeignClientResult amosIdListByUserIds = jcsFeignClient.getAmosIdListByUserIds(userIdString); FeignClientResult amosIdListByUserIds = jcsFeignClient.getAmosIdListByUserIds(userIdString);
List<String> result = (List<String>) amosIdListByUserIds.getResult(); List<String> result = (List<String>) amosIdListByUserIds.getResult();
// 规则推送消息
extraUserIds.removeAll(result);//给执行人只发送待办 不发通知
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.消息型计划生成, extraUserIds);// 根据bug4150 将此处的计划生成的枚举值变成了消息,既TASK ->
// NOTIFY
if (org.apache.commons.lang3.ObjectUtils.isNotEmpty(result)) { if (org.apache.commons.lang3.ObjectUtils.isNotEmpty(result)) {
// String[] userIdArr = userIdString.split(","); // String[] userIdArr = userIdString.split(",");
// List<String> userIdList = Arrays.asList(userIdArr); // List<String> userIdList = Arrays.asList(userIdArr);
......
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
<artifactId>servlet-api</artifactId> <artifactId>servlet-api</artifactId>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
</exclusion> </exclusion>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-equip-biz</artifactId> <artifactId>amos-boot-module-equip-biz</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
<exclusions>
<exclusion>
<artifactId>log4j-to-slf4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -85,6 +85,11 @@ dcs.token-key=dcs_token_key ...@@ -85,6 +85,11 @@ dcs.token-key=dcs_token_key
dcs.client.secret=fire_system dcs.client.secret=fire_system
dcs.x.hw.id=NR_REST_APP dcs.x.hw.id=NR_REST_APP
dcs.x.hw.appKey=s+YkvQhwilx91TRJHhNDmw== dcs.x.hw.appKey=s+YkvQhwilx91TRJHhNDmw==
# 故障告警/消防告警/跑马灯权限标识 true 机场 / false 电力
equip.enabled =true
management.endpoints.enabled-by-default=false
# 权限标识-物联区域 # 权限标识-物联区域
auth-key-area=area_info auth-key-area=area_info
......
...@@ -1240,7 +1240,7 @@ ...@@ -1240,7 +1240,7 @@
'其他' AS fireFightSysName, '其他' AS fireFightSysName,
'equip' AS fireFacilityType, 'equip' AS fireFacilityType,
ws.source_id AS buildingId, ws.source_id AS buildingId,
ws.`name` AS buildingName, ws.full_name AS buildingName,
ed.area AS location ed.area AS location
FROM FROM
wl_equipment_specific es wl_equipment_specific es
...@@ -1300,6 +1300,20 @@ ...@@ -1300,6 +1300,20 @@
</where> </where>
</select> </select>
<select id="getEquipLocationInfo" resultType="map">
SELECT
wed.longitude as longitude,
wed.latitude as latitude
FROM
wl_stock_detail sd
LEFT JOIN wl_equipment_detail wed ON sd.equipment_detail_id = wed.id
<where>
<if test="equipmentSpecificId != null">
sd.equipment_specific_id = #{equipmentSpecificId}
</if>
</where>
</select>
<select id="getEquipSpeInfo" resultType="Map"> <select id="getEquipSpeInfo" resultType="Map">
SELECT SELECT
es.id, es.id,
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
create_date create_date
FROM FROM
mt_maintenance_resource_data mt_maintenance_resource_data
GROUP BY maintenance_company_id,classify_id GROUP BY maintenance_company_id,classify_id,owner_unit_id,fire_fight_sys_id
</select> </select>
<select id="selectMaintenanceResourceDataList" <select id="selectMaintenanceResourceDataList"
...@@ -252,7 +252,17 @@ ...@@ -252,7 +252,17 @@
m.maintenance_company_name, m.maintenance_company_name,
m.owner_unit_id, m.owner_unit_id,
m.owner_unit_name, m.owner_unit_name,
<choose>
<when test="fireFightSysId != null and fireFightSysId != '' ">
m.fire_fight_sys_id, m.fire_fight_sys_id,
</when>
<otherwise>
'' as fire_fight_sys_id,
</otherwise>
</choose>
m.fire_fight_sys_name, m.fire_fight_sys_name,
m.classify_id, m.classify_id,
m.classify_name, m.classify_name,
...@@ -279,7 +289,8 @@ ...@@ -279,7 +289,8 @@
</if> </if>
</where> </where>
GROUP BY GROUP BY
m.classify_code -- m.classify_code
m.classify_id
</select> </select>
<select id="getFireFacilityPage" resultType="com.yeejoin.equipmanage.common.dto.MaintenanceResourceDataDto"> <select id="getFireFacilityPage" resultType="com.yeejoin.equipmanage.common.dto.MaintenanceResourceDataDto">
SELECT SELECT
...@@ -316,7 +327,7 @@ ...@@ -316,7 +327,7 @@
<if test="ownerUnitId != null"> <if test="ownerUnitId != null">
AND m.owner_unit_id = #{ownerUnitId} AND m.owner_unit_id = #{ownerUnitId}
</if> </if>
<if test="fireFightSysId != null"> <if test="fireFightSysId != null and fireFightSysId != '' ">
AND m.fire_fight_sys_id = #{fireFightSysId} AND m.fire_fight_sys_id = #{fireFightSysId}
</if> </if>
<if test="classifyId != null"> <if test="classifyId != null">
......
...@@ -132,6 +132,7 @@ ...@@ -132,6 +132,7 @@
fire_fight_sys_id AS id, fire_fight_sys_id AS id,
fire_fight_sys_name name , fire_fight_sys_name name ,
owner_unit_id as parentId, owner_unit_id as parentId,
owner_unit_id as ownerUnitId,
IFNULL(classify_type,3) as type IFNULL(classify_type,3) as type
FROM FROM
`mt_maintenance_resource_data` `mt_maintenance_resource_data`
......
...@@ -50,6 +50,13 @@ ...@@ -50,6 +50,13 @@
<if test="video!=null and video.bizOrgCode!=null and video.bizOrgCode!=''"> <if test="video!=null and video.bizOrgCode!=null and video.bizOrgCode!=''">
and wlv.biz_org_code LIKE CONCAT(#{video.bizOrgCode}, '%') and wlv.biz_org_code LIKE CONCAT(#{video.bizOrgCode}, '%')
</if> </if>
<if test="video!=null and video.ip!=null and video.ip!=''">
and wlv.ip like concat('%',#{video.ip},'%')
</if>
<if test="video!=null and video.type!=null and video.type!=''">
and wlv.type=#{video.type}
</if>
group by wlv.id group by wlv.id
order by wlv.create_date desc order by wlv.create_date desc
</select> </select>
...@@ -108,10 +115,19 @@ ...@@ -108,10 +115,19 @@
<if test="dto.code!=null and dto.code!=''"> <if test="dto.code!=null and dto.code!=''">
and v.code like concat('%',#{dto.code},'%') and v.code like concat('%',#{dto.code},'%')
</if> </if>
<if test=" dto.ip!=null and dto.ip!=''">
and v.ip like concat('%',#{dto.ip},'%')
</if>
<if test="dto.type!=null and dto.type!=''">
and v.type = #{dto.type}
</if>
GROUP BY id GROUP BY id
order by v.create_date order by v.create_date
</when> </when>
<when test="dto.buildingId == null || dto.buildingId ==''"> <when test='dto.buildingId == null || dto.buildingId ==""'>
<where> <where>
<if test="dto.bizOrgCode!=null and dto.bizOrgCode!=''"> <if test="dto.bizOrgCode!=null and dto.bizOrgCode!=''">
v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%') v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%')
...@@ -122,6 +138,16 @@ ...@@ -122,6 +138,16 @@
<if test="dto.equipmentName!=null and dto.equipmentName!=''"> <if test="dto.equipmentName!=null and dto.equipmentName!=''">
and v.name like concat('%',#{dto.equipmentName},'%') and v.name like concat('%',#{dto.equipmentName},'%')
</if> </if>
<if test=" dto.ip!=null and dto.ip!=''">
and v.ip like concat('%',#{dto.ip},'%')
</if>
<if test="dto.type!=null and dto.type!=''">
and v.type =#{dto.type}
</if>
</where> </where>
GROUP BY id GROUP BY id
order by v.create_date order by v.create_date
...@@ -160,7 +186,7 @@ ...@@ -160,7 +186,7 @@
select select
vid.id, vid.id,
vid.token, vid.token,
vid.remark, vid.name as name,
vid.url, vid.url,
vid.code, vid.code,
vid.preset_position as presetPosition, vid.preset_position as presetPosition,
......
...@@ -199,9 +199,29 @@ ...@@ -199,9 +199,29 @@
<if test="equipmentName!=null"> <if test="equipmentName!=null">
AND d.equipmentName LIKE '%${equipmentName}%' AND d.equipmentName LIKE '%${equipmentName}%'
</if> </if>
<if test="startTime!=null">
<!-- <if test="startTime!=null and endTime!=null ">-->
<!-- AND d.create_date BETWEEN '${startTime}' AND '${endTime}'-->
<!-- </if>-->
<choose>
<when test="startTime!=null and endTime!=null ">
AND d.create_date BETWEEN '${startTime}' AND '${endTime}' AND d.create_date BETWEEN '${startTime}' AND '${endTime}'
</when>
<otherwise>
<if test="startTime!=null">
AND d.create_date &gt;= '${startTime}'
</if>
<if test="endTime!=null ">
AND d.create_date &lt;= '${endTime}'
</if> </if>
</otherwise>
</choose>
<if test="buildId!=null"> <if test="buildId!=null">
AND d.buildId in (#{buildId}) AND d.buildId in (#{buildId})
<!-- AND d.buildId in <!-- AND d.buildId in
......
...@@ -26,10 +26,7 @@ ...@@ -26,10 +26,7 @@
<groupId>org.liquibase</groupId> <groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId> <artifactId>liquibase-core</artifactId>
</dependency> </dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
<!-- </dependency>-->
</dependencies> </dependencies>
<build> <build>
......
...@@ -29,11 +29,7 @@ spring.datasource.hikari.max-lifetime=120000 ...@@ -29,11 +29,7 @@ spring.datasource.hikari.max-lifetime=120000
spring.datasource.hikari.connection-timeout=30000 spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.connection-test-query=SELECT 1 spring.datasource.hikari.connection-test-query=SELECT 1
endpoints.enabled = false
management.security.enabled=true
security.user.name=admin
security.user.password=admin
##liquibase ##liquibase
...@@ -79,6 +75,8 @@ mqtt.topic.alert.iot=iot-system-alarm ...@@ -79,6 +75,8 @@ mqtt.topic.alert.iot=iot-system-alarm
mqtt.topic.alert.iot.web=iot-system-alarm-web mqtt.topic.alert.iot.web=iot-system-alarm-web
#警情预案匹配的消息topic名称 #警情预案匹配的消息topic名称
mqtt.topic.command.knowledgebase.alert.match=knowledgeAlertMatch mqtt.topic.command.knowledgebase.alert.match=knowledgeAlertMatch
#航空报警器警情通知
mqtt.topic.command.alert.noticeAviation=aviationAlarm
security.systemctl.name=AMOS-API-SYSTEMCTL security.systemctl.name=AMOS-API-SYSTEMCTL
...@@ -122,6 +120,7 @@ mybatis.interceptor.enabled = false ...@@ -122,6 +120,7 @@ mybatis.interceptor.enabled = false
## 消防救援保障部ID ## 消防救援保障部ID
fire-rescue=1432549862557130753 fire-rescue=1432549862557130753
management.endpoints.enabled-by-default=false
#阿里云实时语音识别参数 #阿里云实时语音识别参数
speech-config.access-key-id=LTAI5t62oH95jgbjRiNXPsho speech-config.access-key-id=LTAI5t62oH95jgbjRiNXPsho
speech-config.access-key-secret=shy9SpogYgcdDoyTB3bvP21VSRmz8n speech-config.access-key-secret=shy9SpogYgcdDoyTB3bvP21VSRmz8n
......
...@@ -3222,5 +3222,44 @@ ...@@ -3222,5 +3222,44 @@
REPLACE 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 (1165, '1165', '集结待命', 'XYJBR', NULL, NULL, NULL, NULL, NULL, b'0', 1); REPLACE 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 (1165, '1165', '集结待命', 'XYJBR', NULL, NULL, NULL, NULL, NULL, b'0', 1);
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenzhao" id="2022-07-1-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
</preConditions>
<comment>修改数据字典parent</comment>
<sql>
ALTER TABLE cb_data_dictionary MODIFY COLUMN parent VARCHAR(100) </sql>
</changeSet>
<changeSet author="chenzhao" id="2022-07-4-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
</preConditions>
<comment>修改数据字典</comment>
<sql>
UPDATE `cb_data_dictionary` SET `code` = '1210', `name` = '消防指挥员', `type` = 'GWMC', `type_desc` = '消防人员岗位', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1210;
UPDATE `cb_data_dictionary` SET `code` = '141', `name` = '消防战斗员', `type` = 'GWMC', `type_desc` = NULL, `parent` = '140', `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 141;
</sql>
</changeSet>
<changeSet author="chenzhao" id="2022-07-4-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
</preConditions>
<comment>增加数据字典数据</comment>
<sql>
REPLACE 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 (1353, 1, '急救类', 'GWMC', NULL, NULL, NULL, NULL, NULL, b'0', 1);
REPLACE 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 (1354, 2, '医生', 'GWMC', NULL, '1353', NULL, NULL, NULL, b'0', 1);
REPLACE 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 (1355, 3, '公卫医生', 'GWMC', NULL, '1353', NULL, NULL, NULL, b'0', 1);
REPLACE 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 (1356, 4, '护士长', 'GWMC', NULL, '1353', NULL, NULL, NULL, b'0', 1);
REPLACE 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 (1357, 5, '护士', 'GWMC', NULL, '1353', NULL, NULL, NULL, b'0', 1);
REPLACE 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 (1358, 6, '急救驾驶员', 'GWMC', NULL, '1353', NULL, NULL, NULL, b'0', 1);
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -14,10 +14,12 @@ ...@@ -14,10 +14,12 @@
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-knowledgebase-biz</artifactId> <artifactId>amos-boot-module-knowledgebase-biz</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
</dependency> <exclusions>
<dependency> <exclusion>
<groupId>org.springframework.boot</groupId> <artifactId>log4j</artifactId>
<artifactId>spring-boot-starter-security</artifactId> <groupId>log4j</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -22,8 +22,4 @@ mybatis-plus.mapper-locations=classpath:mapper/* ...@@ -22,8 +22,4 @@ mybatis-plus.mapper-locations=classpath:mapper/*
## redis失效时间 ## redis失效时间
redis.cache.failure.time=10800 redis.cache.failure.time=10800
endpoints.enabled = false management.endpoints.enabled-by-default=false
management.security.enabled=true
security.user.name=admin
security.user.password=admin
...@@ -23,10 +23,7 @@ ...@@ -23,10 +23,7 @@
<artifactId>pagehelper</artifactId> <artifactId>pagehelper</artifactId>
<version>5.1.10</version> <version>5.1.10</version>
</dependency> </dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
<!-- </dependency>-->
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -64,9 +64,4 @@ latentDanger.feign.name=AMOS-LATENT-DANGER ...@@ -64,9 +64,4 @@ latentDanger.feign.name=AMOS-LATENT-DANGER
Knowledgebase.fegin.name=AMOS-API-KNOWLEDGEBASE Knowledgebase.fegin.name=AMOS-API-KNOWLEDGEBASE
## 消防救援保障部ID ## 消防救援保障部ID
fire-rescue=1432549862557130753 fire-rescue=1432549862557130753
management.endpoints.enabled-by-default=false
endpoints.enabled = false
management.security.enabled=true
security.user.name=admin
security.user.password=admin
...@@ -1104,4 +1104,16 @@ WHERE ...@@ -1104,4 +1104,16 @@ WHERE
AND deleted = 0 AND deleted = 0
) )
</select> </select>
<select id="selectByIdandBizId" resultType="string">
SELECT
pc.plan_task_id as taskId
FROM
p_latent_danger p
LEFT JOIN p_check_input pci ON pci.id = p.biz_id
LEFT JOIN p_check pc ON pci.check_id = pc.id
WHERE
p.id = #{id} and p.biz_id = #{bizId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -13,10 +13,7 @@ ...@@ -13,10 +13,7 @@
<artifactId>amos-boot-module-maintenance-biz</artifactId> <artifactId>amos-boot-module-maintenance-biz</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -67,8 +67,4 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa ...@@ -67,8 +67,4 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa
eureka.instance.status-page-url-path=/actuator/info eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
endpoints.enabled = false management.endpoints.enabled-by-default=false
\ No newline at end of file
management.security.enabled=true
security.user.name=admin
security.user.password=admin
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</if> </if>
<choose> <choose>
<when test="identityType==1"> <when test="identityType==1">
And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} ) And (a.orgCode LIKE CONCAT( #{orgCode}, '%' ) or a.orgCode= #{orgCode} )
<if test="companyId != null and companyId != ''"> and a.owner_id = #{companyId}</if> <if test="companyId != null and companyId != ''"> and a.owner_id = #{companyId}</if>
</when> </when>
<when test="identityType==2"> <when test="identityType==2">
......
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
<artifactId>amos-boot-module-patrol-biz</artifactId> <artifactId>amos-boot-module-patrol-biz</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -58,8 +58,4 @@ rule.definition.default-agency=STATE_GRID ...@@ -58,8 +58,4 @@ rule.definition.default-agency=STATE_GRID
jcs.fegin.name=JCS jcs.fegin.name=JCS
emergency.command.section.id=1418223840361709569 emergency.command.section.id=1418223840361709569
endpoints.enabled = false management.endpoints.enabled-by-default=false
management.security.enabled=true
security.user.name=admin
security.user.password=admin
...@@ -898,6 +898,9 @@ ...@@ -898,6 +898,9 @@
<if test="latentDangerListParam.dangerName != null and latentDangerListParam.dangerName !=''"> <if test="latentDangerListParam.dangerName != null and latentDangerListParam.dangerName !=''">
AND pld.danger_name LIKE concat('%',#{latentDangerListParam.dangerName},'%') AND pld.danger_name LIKE concat('%',#{latentDangerListParam.dangerName},'%')
</if> </if>
<if test="latentDangerListParam.belongType != null and latentDangerListParam.belongType == 1">
AND pld.discoverer_user_id =#{latentDangerListParam.userId}
</if>
<if test="latentDangerListParam.dangerId != null and latentDangerListParam.dangerId !=''"> <if test="latentDangerListParam.dangerId != null and latentDangerListParam.dangerId !=''">
and pld.id=#{latentDangerListParam.dangerId} and pld.id=#{latentDangerListParam.dangerId}
</if> </if>
......
...@@ -127,8 +127,9 @@ ...@@ -127,8 +127,9 @@
</delete> </delete>
<select id="getByDangerId" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerPatrolBo"> <select id="getByDangerId" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerPatrolBo">
select select
a.*, pci.check_id,
pci.input_id,
b.name as itemName, b.name as itemName,
b.original_id as itemOriginalId, b.original_id as itemOriginalId,
b.basis_json as itemBasis, b.basis_json as itemBasis,
...@@ -139,32 +140,38 @@ ...@@ -139,32 +140,38 @@
c.charge_dept_id as pointDepartMentId, c.charge_dept_id as pointDepartMentId,
c.original_id as pointOriginalId, c.original_id as pointOriginalId,
d.name as routeName, d.name as routeName,
e.check_time as checkTime, pc.check_time as checkTime,
e.user_id as checkUserId, pc.user_id as checkUserId,
e.dep_id as checkDepartmentId, pc.dep_id as checkDepartmentId,
f.name as planName, f.name as planName,
f.plan_type as planType, f.plan_type as planType,
f.execute_rate as executeRate, f.execute_rate as executeRate,
g.original_id as classifyOriginalId, g.original_id as classifyOriginalId,
g.name as classifyName g.name as classifyName
from from
p_latent_danger_patrol as a p_latent_danger as a
left join
p_input_item as b on a.item_id = b.id
LEFT JOIN p_check_input pci ON pci.id = a.biz_id
LEFT JOIN p_check pc ON pci.check_id = pc.id
left join left join
p_point as c on a.point_id = c.id p_input_item as b on pci.input_id = b.id
left join left join
p_route as d on a.route_id = d.id p_point as c on pc.point_id = c.id
left join left join
p_check as e on a.check_id = e.id p_route as d on pc.route_id = d.id
left join left join
p_plan as f on e.plan_id = f.id p_plan as f on pc.plan_id = f.id
left join left join
p_point_classify as g on a.point_classify_id = g.id p_point_classify as g on pc.point_id= g.point_id
where where
a.deleted = 0 a.deleted = 0
and and
a.latent_danger_id = #{dangerId} a.id= #{dangerId}
</select> </select>
<select id="listByMap" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerPatrolBo"> <select id="listByMap" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerPatrolBo">
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if> <if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null">and a.is_OK = #{isOK}</if> <if test="isOK!=null">and a.is_OK = #{isOK}</if>
<if test="planId!=null">and a.plan_Id = #{planId}</if> <if test="planId!=null">and a.plan_Id = #{planId}</if>
<if test="planTaskId!=null">and a.plan_task_detail_id = #{planTaskId}</if> <if test="planTaskId!=null">and a.plan_task_id = #{planTaskId}</if>
<if test="userId!=null">and find_in_set(#{userId}, a.user_id) > 0</if> <if test="userId!=null">and find_in_set(#{userId}, a.user_id) > 0</if>
<if test="routeId!=null">and a.route_Id = #{routeId}</if> <if test="routeId!=null">and a.route_Id = #{routeId}</if>
<if test="catalogId!=null">and b.Catalog_Id = #{catalogId}</if> <if test="catalogId!=null">and b.Catalog_Id = #{catalogId}</if>
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if> <if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null">and a.is_OK = #{isOK}</if> <if test="isOK!=null">and a.is_OK = #{isOK}</if>
<if test="planId!=null">and a.plan_Id = #{planId}</if> <if test="planId!=null">and a.plan_Id = #{planId}</if>
<if test="planTaskId!=null">and a.plan_task_detail_id = #{planTaskId}</if> <if test="planTaskId!=null">and a.plan_task_id = #{planTaskId}</if>
<if test="userId!=null">and find_in_set(#{userId}, a.user_id) > 0</if> <if test="userId!=null">and find_in_set(#{userId}, a.user_id) > 0</if>
<if test="routeId!=null">and a.route_Id = #{routeId}</if> <if test="routeId!=null">and a.route_Id = #{routeId}</if>
<if test="catalogId!=null">and b.Catalog_Id = #{catalogId}</if> <if test="catalogId!=null">and b.Catalog_Id = #{catalogId}</if>
......
...@@ -18,6 +18,12 @@ ...@@ -18,6 +18,12 @@
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-precontrol-biz</artifactId> <artifactId>amos-boot-module-precontrol-biz</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -33,10 +33,7 @@ ...@@ -33,10 +33,7 @@
<groupId>cn.jpush.api</groupId> <groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId> <artifactId>jpush-client</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -73,8 +73,4 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa ...@@ -73,8 +73,4 @@ eureka.instance.metadata-map.management.context-path=${server.servlet.context-pa
eureka.instance.status-page-url-path=/actuator/info eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/swagger-ui.html
endpoints.enabled = false management.endpoints.enabled-by-default=false
\ No newline at end of file
management.security.enabled=true
security.user.name=admin
security.user.password=admin
...@@ -405,7 +405,9 @@ ...@@ -405,7 +405,9 @@
<if test="companyId != null and companyId != ''">and ppn.original_id = #{companyId}</if> <if test="companyId != null and companyId != ''">and ppn.original_id = #{companyId}</if>
<if test="taskType != null and taskType != ''">and ppn.check_type_id = #{taskType}</if> <if test="taskType != null and taskType != ''">and ppn.check_type_id = #{taskType}</if>
<if test="planTaskId != null and planTaskId > 0 ">and ptd.task_no = #{planTaskId}</if> <if test="planTaskId != null and planTaskId > 0 ">and ptd.task_no = #{planTaskId}</if>
<if test="orderBy != null and orderBy != ''">order by ${orderBy}</if> <!-- <if test="orderBy != null and orderBy != ''">order by ${orderBy}</if>-->
order by p.id
<if test="offset != null and pageSize != null"> <if test="offset != null and pageSize != null">
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</if> </if>
......
...@@ -34,4 +34,9 @@ ...@@ -34,4 +34,9 @@
WHERE WHERE
pptd.id = a.id pptd.id = a.id
</update> </update>
<select id="selectById" resultType="com.yeejoin.amos.supervision.dao.entity.PlanTask">
SELECT * FROM p_plan_task where id = #{id}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -22,5 +22,12 @@ ...@@ -22,5 +22,12 @@
<artifactId>jpush-client</artifactId> <artifactId>jpush-client</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project> </project>
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<amos.version>1.7.8</amos.version> <amos.version>1.7.8</amos.version>
<rule.version>1.7.9-SNAPSHOT</rule.version> <rule.version>1.7.9-SNAPSHOT</rule.version>
<itext.version>7.1.1</itext.version> <itext.version>7.1.1</itext.version>
<elasticsearch.version>7.15.2</elasticsearch.version>
</properties> </properties>
<dependencies> <dependencies>
...@@ -215,7 +216,7 @@ ...@@ -215,7 +216,7 @@
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-feign-systemctl</artifactId> <artifactId>amos-feign-systemctl</artifactId>
<version>1.6.5</version> <version>1.7.8</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
...@@ -243,7 +244,7 @@ ...@@ -243,7 +244,7 @@
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
<artifactId>amos-component-rule</artifactId> <artifactId>amos-component-rule</artifactId>
<version>${rule.version}</version> <version>1.7.9-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.yeejoin</groupId> <groupId>com.yeejoin</groupId>
......
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