Commit e7f81c0b authored by chenzhao's avatar chenzhao

Merge branch 'develop_dl_plan6_temp' of…

Merge branch 'develop_dl_plan6_temp' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6_temp
parents 5b1bef51 9e46aa4e
...@@ -6,6 +6,20 @@ ...@@ -6,6 +6,20 @@
<option value="$PROJECT_DIR$/pom.xml" /> <option value="$PROJECT_DIR$/pom.xml" />
</list> </list>
</option> </option>
<option name="ignoredFiles">
<set>
<option value="$PROJECT_DIR$/amos-boot-data/amos-boot-data-accessapi/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-module/amos-boot-module-api/amos-boot-module-kgd-api/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-module/amos-boot-module-biz/amos-boot-module-kgd-biz/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-cas/amos-boot-module-cas-api/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-cas/amos-boot-module-cas-biz/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-cas/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-kgd/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-tdc/amos-boot-module-tdc-api/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-tdc/amos-boot-module-tdc-biz/pom.xml" />
<option value="$PROJECT_DIR$/amos-boot-system-tdc/pom.xml" />
</set>
</option>
</component> </component>
<component name="ProjectRootManager" version="2" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" /> <output url="file://$PROJECT_DIR$/classes" />
......
...@@ -45,5 +45,16 @@ ...@@ -45,5 +45,16 @@
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>
package com.yeejoin.amos.boot.biz.common.aop; package com.yeejoin.amos.boot.biz.common.aop;
import com.alibaba.fastjson.JSONObject; import java.util.HashMap;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import java.util.List;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo; import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptor;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.AfterReturning;
...@@ -34,10 +25,22 @@ import org.typroject.tyboot.core.foundation.utils.Bean; ...@@ -34,10 +25,22 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; 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 javax.servlet.http.HttpServletRequest; import com.alibaba.fastjson.JSONObject;
import java.util.HashMap; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import java.util.List; import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import java.util.Map; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
/** /**
* controller层切面 用于用户数据缓存 供 sql自动填充使用 * controller层切面 用于用户数据缓存 供 sql自动填充使用
...@@ -155,6 +158,11 @@ public class ControllerAop { ...@@ -155,6 +158,11 @@ public class ControllerAop {
} else { } else {
roleM = roles.get(sequenceNbr).get(0); roleM = roles.get(sequenceNbr).get(0);
} }
if(companyM!=null&&companyM.getRegionSeq()!=null)
{
FeignClientResult<RegionModel> result = Systemctl.regionClient.getRegion(Long.valueOf(companyM.getRegionSeq()));
company.setRegionCode(String.valueOf(result.getResult().getRegionCode()));
}
Bean.copyExistPropertis(roleM, role); Bean.copyExistPropertis(roleM, role);
ReginParams reginParams = new ReginParams(); ReginParams reginParams = new ReginParams();
reginParams.setCompany(company); reginParams.setCompany(company);
......
...@@ -19,6 +19,7 @@ public class CompanyBo { ...@@ -19,6 +19,7 @@ public class CompanyBo {
private String orgCode; private String orgCode;
private Long parentId; private Long parentId;
private Long sequenceNbr; private Long sequenceNbr;
private String regionCode;
private List<CompanyBo> children; private List<CompanyBo> children;
public String getAddress() { public String getAddress() {
...@@ -116,4 +117,13 @@ public class CompanyBo { ...@@ -116,4 +117,13 @@ public class CompanyBo {
public void setChildren(List<CompanyBo> children) { public void setChildren(List<CompanyBo> children) {
this.children = children; this.children = children;
} }
public String getRegionCode() {
return regionCode;
}
public void setRegionCode(String regionCode) {
this.regionCode = regionCode;
}
} }
...@@ -44,4 +44,5 @@ public class BaseDto implements Serializable{ ...@@ -44,4 +44,5 @@ public class BaseDto implements Serializable{
private Boolean isDelete=false; private Boolean isDelete=false;
} }
...@@ -97,7 +97,7 @@ public class BusinessController { ...@@ -97,7 +97,7 @@ public class BusinessController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = true) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/getData", method = RequestMethod.GET) @RequestMapping(value = "/getData", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取map", notes = "获取map") @ApiOperation(httpMethod = "GET", value = "获取map", notes = "获取map")
@RestEventTrigger(value = "openapiLogEventHandler") @RestEventTrigger(value = "openapiLogEventHandler")
......
...@@ -12,6 +12,7 @@ import com.csoft.sdk.domain.response.CsoftDataApiXixianGetzhutiinfoResponse; ...@@ -12,6 +12,7 @@ import com.csoft.sdk.domain.response.CsoftDataApiXixianGetzhutiinfoResponse;
import com.yeejoin.amos.api.openapi.face.orm.dao.DataDictionaryMapper; import com.yeejoin.amos.api.openapi.face.orm.dao.DataDictionaryMapper;
import org.springframework.beans.factory.annotation.Autowired; 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.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
...@@ -57,7 +58,10 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc ...@@ -57,7 +58,10 @@ public class TaBusinessServiceImpl extends BaseService<TaAccessConfigModel, TaAc
System.out.println(response.getResult()); System.out.println(response.getResult());
JSONObject jsonObject = JSONObject.parseObject(response.getData()); JSONObject jsonObject = JSONObject.parseObject(response.getData());
JSONObject data = jsonObject.getJSONObject("data"); JSONObject data = jsonObject.getJSONObject("data");
//如果不存在该企业 则直接返回null
if(ValidationUtil.isEmpty(data)){
return null;
}
//分割字符串 根据详细地址分割出 省/市/区、街道地址、小区地址 //分割字符串 根据详细地址分割出 省/市/区、街道地址、小区地址
String address = data.getString("dom"); String address = data.getString("dom");
String area = address.substring(0,address.indexOf("区")+1); String area = address.substring(0,address.indexOf("区")+1);
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
...@@ -9,4 +9,21 @@ ...@@ -9,4 +9,21 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-module-ccs-api</artifactId> <artifactId>amos-boot-module-ccs-api</artifactId>
<dependencies>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-component-emq</artifactId>
<version>1.1.20</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project> </project>
\ No newline at end of file
...@@ -142,8 +142,8 @@ public class OrgUsrFireExcelDto extends BaseDto { ...@@ -142,8 +142,8 @@ public class OrgUsrFireExcelDto extends BaseDto {
@ExcelProperty(value = "出生日期", index = 17) @ExcelProperty(value = "出生日期", index = 17)
@ApiModelProperty(value = "出生日期") @ApiModelProperty(value = "出生日期")
@DateTimeFormat(pattern = "yyyy-MM-dd") // @DateTimeFormat(pattern = "yyyy-MM-dd") 此注解用于此处不起任何作用 --ky20220918
@JsonFormat(pattern = "yyyy-MM-dd") // @JsonFormat(pattern = "yyyy-MM-dd")
private String birthdayTime; private String birthdayTime;
@ExplicitConstraint(indexNum = 18, sourceClass = CommonExplicitConstraint.class, method = "getMaritalStatus") //固定下拉内容 @ExplicitConstraint(indexNum = 18, sourceClass = CommonExplicitConstraint.class, method = "getMaritalStatus") //固定下拉内容
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.api.dto; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters; import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts; import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsrAgencyUser;
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;
...@@ -18,6 +19,9 @@ public class PeopleInfoDto { ...@@ -18,6 +19,9 @@ public class PeopleInfoDto {
@ApiModelProperty(value = "联系人信息") @ApiModelProperty(value = "联系人信息")
private FirefightersContacts firefightersContacts; private FirefightersContacts firefightersContacts;
@ApiModelProperty(value = "账户信息")
private OrgUsrAgencyUser orgUsrAgencyUser;
@ApiModelProperty(value = "岗位页签") @ApiModelProperty(value = "岗位页签")
private FirefightersDataDto postEduDtoObj; private FirefightersDataDto postEduDtoObj;
......
...@@ -24,8 +24,9 @@ public class OrgUsrAgencyUser extends BaseEntity { ...@@ -24,8 +24,9 @@ public class OrgUsrAgencyUser extends BaseEntity {
/** /**
* 用户名 * 用户名
*/ */
@TableField("user_name") @TableField("usr_name")
private String userName; private String usrName;
/** /**
* 手机号 * 手机号
...@@ -57,4 +58,10 @@ public class OrgUsrAgencyUser extends BaseEntity { ...@@ -57,4 +58,10 @@ public class OrgUsrAgencyUser extends BaseEntity {
@TableField("amos_user_id") @TableField("amos_user_id")
private String amosUserId; private String amosUserId;
@TableField(exist = false)
private String upPassWord;
@TableField(exist = false)
private String upAmosUser;
} }
...@@ -65,6 +65,12 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -65,6 +65,12 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
@Param("dutyDate") String dutyDate, @Param("dutyDate") String dutyDate,
@Param("groupCode") String groupCode @Param("groupCode") String groupCode
); );
List<Map<String, Object>> newStationViewDataByFieldCode(
@Param("dutyDate") String dutyDate,
@Param("groupCode") String groupCode,
@Param("fieldCode") String fieldCode
);
/** /**
* 利用mysql 生成连续时间区间 * 利用mysql 生成连续时间区间
* *
...@@ -123,7 +129,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -123,7 +129,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
* @param instanceIds * @param instanceIds
* @return * @return
*/ */
List<Map<String, Object>> getPositionStaffDutyForSpecifyDate(String dutyDate,String groupCode,String[] instanceIds,String duty); List<Map<String, Object>> getPositionStaffDutyForSpecifyDate(String dutyDate,String groupCode,String[] instanceIds,String duty, String fieldCode);
/** /**
......
...@@ -50,4 +50,6 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> { ...@@ -50,4 +50,6 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> {
Long sequenceNbr, String equipId,String bizOrgCode, String equipCateGoryCode,List<String> ids,String companyId); Long sequenceNbr, String equipId,String bizOrgCode, String equipCateGoryCode,List<String> ids,String companyId);
List<Map<String, Object>> getWaterTypeByBizOrgCode(String bizOrgCode); List<Map<String, Object>> getWaterTypeByBizOrgCode(String bizOrgCode);
}
Page<WaterResourceDto> pageByDefect(Page<WaterResourceDto> page, @Param("nameOrCode") String nameOrCode, @Param("bizOrgCode") String bizOrgCode);
}
...@@ -32,12 +32,14 @@ public interface IDutyCommonService { ...@@ -32,12 +32,14 @@ public interface IDutyCommonService {
List<Map<String, Object>> statisticsDay(String beginDate, String endDate) throws ParseException; List<Map<String, Object>> statisticsDay(String beginDate, String endDate) throws ParseException;
/** /**
* 新值班月视图 * 新值班月视图
*
* @param beginDate * @param beginDate
* @param endDate * @param endDate
* @param dutyType
* @return * @return
* @throws ParseException * @throws ParseException
*/ */
List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate) throws ParseException; List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate, String fieldCode) throws ParseException;
/** /**
* 不分页查询 * 不分页查询
* *
...@@ -128,5 +130,5 @@ public interface IDutyCommonService { ...@@ -128,5 +130,5 @@ public interface IDutyCommonService {
*/ */
public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList); public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList);
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType); public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode);
} }
...@@ -102,6 +102,21 @@ ...@@ -102,6 +102,21 @@
and i.group_code =#{groupCode} and i.group_code =#{groupCode}
GROUP BY i.field_value GROUP BY i.field_value
</select> </select>
<select id="newStationViewDataByFieldCode" resultType="java.util.Map">
select
i.field_value as postTypeName,
count(1) as total
from
cb_duty_person_shift s,
cb_dynamic_form_instance i
where
s.instance_id = i.instance_id
and i.field_code = #{fieldCode}
AND s.duty_date = #{dutyDate}
AND s.shift_id is not null
and i.group_code =#{groupCode}
GROUP BY i.field_value
</select>
<select id="genRangeDate" resultType="map"> <select id="genRangeDate" resultType="map">
SELECT SELECT
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date, DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
...@@ -328,12 +343,24 @@ FROM ...@@ -328,12 +343,24 @@ FROM
cd.FIELD_VALUE cd.FIELD_VALUE
END END
) AS 'userName', ) AS 'userName',
MAX( <choose>
CASE <when test="fieldCode != null and fieldCode != ''">
WHEN cd.FIELD_CODE = 'postTypeName' THEN MAX(
CASE
WHEN cd.FIELD_CODE = #{fieldCode} THEN
cd.FIELD_VALUE cd.FIELD_VALUE
END END
) AS 'postTypeName', ) AS 'postTypeName',
</when>
<otherwise>
MAX(
CASE
WHEN cd.FIELD_CODE = 'postTypeName' THEN
cd.FIELD_VALUE
END
) AS 'postTypeName',
</otherwise>
</choose>
cd.instance_id cd.instance_id
FROM FROM
cb_dynamic_form_instance cd cb_dynamic_form_instance cd
......
...@@ -407,9 +407,9 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr ...@@ -407,9 +407,9 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
AND type = 'RYZT' AND type = 'RYZT'
) AS stateCode, ) AS stateCode,
fp.employee_hierarchy, fp.employee_hierarchy,
cast(b.birthdayTime as datetime) as birthdayTime,
b.*, b.*,
fw.* fw.*,
DATE_FORMAT(b.birthdayTime,'%Y-%m-%d') AS birthdaryTime
from cb_org_usr a LEFT JOIN from cb_org_usr a LEFT JOIN
(SELECT (SELECT
instance_id, instance_id,
...@@ -427,7 +427,7 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr ...@@ -427,7 +427,7 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
max(case field_code when 'telephone' then field_value end) telephone, max(case field_code when 'telephone' then field_value end) telephone,
max(case field_code when 'peopleType' then field_value end) peopleType, max(case field_code when 'peopleType' then field_value end) peopleType,
max(case field_code when 'nation' then field_value end) nation, max(case field_code when 'nation' then field_value end) nation,
max(case field_code when 'birthdayTime' then field_value end) birthdayTime, max( CASE field_code WHEN 'birthdayTime' THEN DATE_FORMAT(field_value, '%Y-%m-%d') END ) birthdayTime,
max(case field_code when 'maritalStatus' then field_value end) maritalStatus, max(case field_code when 'maritalStatus' then field_value end) maritalStatus,
max(case field_code when 'nativePlace' then field_value end) nativePlace, max(case field_code when 'nativePlace' then field_value end) nativePlace,
max(case field_code when 'nativePlaceVal' then field_value end) nativePlaceVal, max(case field_code when 'nativePlaceVal' then field_value end) nativePlaceVal,
......
...@@ -151,6 +151,9 @@ ...@@ -151,6 +151,9 @@
<if test="map.company != null and map.company != '-1'"> <if test="map.company != null and map.company != '-1'">
AND u.parent_id = #{map.company} AND u.parent_id = #{map.company}
</if> </if>
<if test="map.positionType != null and map.positionType != ''">
AND AND FIND_IN_SET(#{positionType},g.positionType)
</if>
GROUP BY GROUP BY
u.sequence_nbr , u.sequence_nbr ,
u.biz_org_name , u.biz_org_name ,
...@@ -198,7 +201,7 @@ ...@@ -198,7 +201,7 @@
LEFT JOIN cb_dynamic_form_column f ON f.sequence_nbr = v.form_column_id LEFT JOIN cb_dynamic_form_column f ON f.sequence_nbr = v.form_column_id
where u.parent_id = #{parentId} where u.parent_id = #{parentId}
AND u.biz_org_type = #{bizOrgType} AND u.biz_org_type = #{bizOrgType}
AND U.is_delete = 0 AND u.is_delete = 0
GROUP BY GROUP BY
u.sequence_nbr , u.sequence_nbr ,
u.biz_org_name , u.biz_org_name ,
......
...@@ -186,4 +186,10 @@ ...@@ -186,4 +186,10 @@
</select> </select>
<select id="pageByDefect" resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto">
select * from cb_water_resource where is_delete = 1
<if test="nameOrCode != null and nameOrCode != ''">and (name like concat('%', #{nameOrCode}, '%') or equip_code like concat('%', #{nameOrCode}, '%'))</if>
<if test="bizOrgCode != null and bizOrgCode != ''">and biz_org_code like concat( #{bizOrgCode}, '%')</if>
order by cb_water_resource.rec_date desc
</select>
</mapper> </mapper>
...@@ -61,7 +61,11 @@ public class EquipmentCategory extends BaseEntity implements TreeNode<EquipmentC ...@@ -61,7 +61,11 @@ public class EquipmentCategory extends BaseEntity implements TreeNode<EquipmentC
@TableField(exist=false) @TableField(exist=false)
@ApiModelProperty(value = "级别") @ApiModelProperty(value = "级别")
private String level; private String level;
@TableField(exist = false)
@ApiModelProperty(value = "个数-巡检树用")
private Integer patrolNum;
@TableField(exist=false) @TableField(exist=false)
@ApiModelProperty(value = "个数") @ApiModelProperty(value = "个数")
private Double count; private Double count;
......
package com.yeejoin.equipmanage.common.entity; package com.yeejoin.equipmanage.common.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
...@@ -93,12 +94,12 @@ public class EquipmentDetail extends BaseEntity { ...@@ -93,12 +94,12 @@ public class EquipmentDetail extends BaseEntity {
@ApiModelProperty(value = "合同编号") @ApiModelProperty(value = "合同编号")
private String contractCode; private String contractCode;
@TableField("production_date") @TableField(value = "production_date", updateStrategy = FieldStrategy.IGNORED)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "生产日期") @ApiModelProperty(value = "生产日期")
private Date productionDate; private Date productionDate;
@TableField("delivery_date") @TableField(value = "delivery_date", updateStrategy = FieldStrategy.IGNORED)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "投运日期") @ApiModelProperty(value = "投运日期")
private Date deliveryDate; private Date deliveryDate;
......
...@@ -86,26 +86,27 @@ public class EquipmentSpecificAlarm extends BaseEntity { ...@@ -86,26 +86,27 @@ public class EquipmentSpecificAlarm extends BaseEntity {
private Long equipmentIndexId; private Long equipmentIndexId;
@ApiModelProperty(value = "确认类型") @ApiModelProperty(value = "确认类型")
@TableField("confirm_type") @TableField(exist = false)
private String confirmType; private String confirmType;
@ApiModelProperty(value = "报警原因") @ApiModelProperty(value = "报警原因")
@TableField("alam_reason") @TableField(exist = false)
private String alamReason; private String alamReason;
@ApiModelProperty(value = "处理情况") @ApiModelProperty(value = "处理情况")
@TableField("resolve_result") @TableField(exist = false)
private String resolveResult; private String resolveResult;
@ApiModelProperty(value = "确警人员") @ApiModelProperty(value = "确警人员")
@TableField("confirm_user") @TableField(exist = false)
private String confirmUser; private String confirmUser;
@ApiModelProperty(value = "确警人员姓名") @ApiModelProperty(value = "确警人员姓名")
@TableField(exist = false)
private String confirmUserName; private String confirmUserName;
@ApiModelProperty(value = "确警时间") @ApiModelProperty(value = "确警时间")
@TableField("confirm_date") @TableField(exist = false)
private Date confirmDate; private Date confirmDate;
@ApiModelProperty(value = "iot数据上报唯一id") @ApiModelProperty(value = "iot数据上报唯一id")
......
...@@ -133,4 +133,12 @@ public class FireFightingSystemEntity { ...@@ -133,4 +133,12 @@ public class FireFightingSystemEntity {
@ApiModelProperty(value = "分析报告统计用参数(为空不统计) ") @ApiModelProperty(value = "分析报告统计用参数(为空不统计) ")
private String analysisIndexKey; private String analysisIndexKey;
@ApiModelProperty(value = "责任单位")
private String designOrg;
@ApiModelProperty(value = "设计单位联系方式")
private String designOrgTelephone;
@ApiModelProperty(value = "主要设计人员")
private String leadDesigner;
} }
...@@ -60,4 +60,10 @@ public class EquipTypeAmountPageDTO extends BaseDTO<EquipmentSpecific> { ...@@ -60,4 +60,10 @@ public class EquipTypeAmountPageDTO extends BaseDTO<EquipmentSpecific> {
@ApiModelProperty(value = "是否物联") @ApiModelProperty(value = "是否物联")
private String isIot; private String isIot;
@ApiModelProperty(value = "装备编码或名称")
private String nameOrCode;
@ApiModelProperty(value = "缺陷管理新增页面用,其余地方可忽略 1-是缺陷管理 0-不是")
private Integer isDefect;
} }
...@@ -53,4 +53,6 @@ public class EquipTypeImgAmountVO { ...@@ -53,4 +53,6 @@ public class EquipTypeImgAmountVO {
@ApiModelProperty(value = "单位部门org") @ApiModelProperty(value = "单位部门org")
private String bizOrgCode; private String bizOrgCode;
@ApiModelProperty(value = "所在建筑")
private String belongBuildName;
} }
package com.yeejoin.equipmanage.common.entity.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author keyong
* @title: IdxBizDefectVo
* <pre>
* @description: TODO
* </pre>
* @date 2022/9/27 18:44
*/
@Data
public class IdxBizDefectVo {
private String id;
@ApiModelProperty(value = "缺陷等级1-一般 2-严重 3-危急")
private Integer defectLevel;
@ApiModelProperty(value = "缺陷设备ids")
private String defectEquipmentIds;
@ApiModelProperty(value = "缺陷设备名称")
private String defectEquipmentName;
@ApiModelProperty(value = "缺陷设备类型1-装备2-系统3-水源")
private Integer defectEquipmentType;
@ApiModelProperty(value = "缺陷描述")
private String defectDescribe;
@ApiModelProperty(value = "缺陷来源 1-巡查 2-维保 3-消防检测 4-其他")
private Integer defectResource;
@ApiModelProperty(value = "缺陷类型")
private String defectType;
@ApiModelProperty(value = "缺陷图片")
private String defectImg;
@ApiModelProperty(value = "发现日期")
private Date defectDiscoverDate;
@ApiModelProperty(value = "发现人")
private String defectDiscover;
@ApiModelProperty(value = "计划消缺日期")
private Date planClearDate;
@ApiModelProperty(value = "责任人")
private String defectResponsible;
@ApiModelProperty(value = "处理状态(0:未处理,1:已处理,2:处理中)")
private Integer defectStatus;
@ApiModelProperty(value = "是否需要停电处理(0:不需要,1:需要)")
private Integer isPowerCut;
@ApiModelProperty(value = "换流站名称")
private String bizOrgName;
@ApiModelProperty(value = "机构编码")
private String bizOrgCode;
@ApiModelProperty(value = "公司编码")
private String orgCode;
@ApiModelProperty(value = "添加时间")
private Date addTime;
@ApiModelProperty(value = "处理措施/处理情况")
private String handleSituation;
@ApiModelProperty(value = "处理-图片")
private String handleImg;
@ApiModelProperty(value = "工作票号")
private String handleWorkTicketNum;
@ApiModelProperty(value = "工作负责人")
private String handleWorkLeader;
@ApiModelProperty(value = "工作票是否已消号 1-已消号 0 -未消号")
private Integer handleWorkIdTicket;
@ApiModelProperty(value = "负责人检查日期")
private String handleLeaderDate;
@ApiModelProperty(value = "负责人")
private String handleLeader;
@ApiModelProperty(value = "消缺日期")
private Date handleClearDate;
@ApiModelProperty(value = "消缺人")
private String handleClearPerson;
@ApiModelProperty(value = "缺陷编号")
private String defectNum;
@ApiModelProperty(value = "超期提醒")
private String expiredWarning;
@ApiModelProperty(value = "缺陷状态【装备用】")
private String defectStatusName;
@ApiModelProperty(value = "告警id")
private String specificAlarmLogId;
}
...@@ -125,4 +125,6 @@ public class EquipmentManageVo implements Serializable { ...@@ -125,4 +125,6 @@ public class EquipmentManageVo implements Serializable {
private String controBoxBuildName; private String controBoxBuildName;
private String controBoxBuildId; private String controBoxBuildId;
private String address; private String address;
private String fullName;
} }
...@@ -176,4 +176,16 @@ public class FireFightingSystemVo implements Serializable { ...@@ -176,4 +176,16 @@ public class FireFightingSystemVo implements Serializable {
*/ */
private String bizOrgName; private String bizOrgName;
/**
* 责任单位
*/
private String designOrg;
/**
* 主要设计人员
*/
private String leadDesigner;
private String designOrgTelephone;
} }
...@@ -45,5 +45,16 @@ ...@@ -45,5 +45,16 @@
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-api</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-module-kgd-api</artifactId>
<properties>
<tyboot.version>1.1.23-SNAPSHOT</tyboot.version>
</properties>
<dependencies>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-influxdb</artifactId>
<version>1.7.13-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>1.4.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-component-cache</artifactId>
<version>${tyboot.version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- j2cache 二级缓存 -->
<dependency>
<groupId>net.oschina.j2cache</groupId>
<artifactId>j2cache-spring-boot2-starter</artifactId>
<version>2.8.0-release</version>
</dependency>
<dependency>
<groupId>net.oschina.j2cache</groupId>
<artifactId>j2cache-core</artifactId>
<version>2.8.0-release</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-component-emq</artifactId>
<version>${tyboot.version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.yeejoin.amos.kgd.message;
public class Constant {
public static final String REGION = "REALTIME";
}
package com.yeejoin.amos.kgd.message;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqxListener;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import com.yeejoin.amos.kgd.message.model.MessageModel;
import net.oschina.j2cache.CacheChannel;
import net.oschina.j2cache.CacheObject;
@Component
public class IOTPropertyMessageAction extends EmqxListener{
private InfluxDbConnection influxDbConnection;
private InfluxdbUtil influxdbUtil;
private CacheChannel cacheChannel;
public static final int threadNum = 5;
ExecutorService service = Executors.newFixedThreadPool(threadNum);
private static final BlockingQueue<MessageModel> blockingQueue = new LinkedBlockingQueue<MessageModel>();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
public IOTPropertyMessageAction(InfluxDbConnection influxDbConnection, InfluxdbUtil influxdbUtil, CacheChannel cacheChannel) {
this.influxDbConnection = influxDbConnection;
this.cacheChannel = cacheChannel;
this.influxdbUtil = influxdbUtil;
for (int i = 0; i < threadNum; i++) {
service.execute(task_runnable);
}
}
@Override
public void processMessage(String topic,MqttMessage mqttMessage) throws Exception {
MessageModel message = new MessageModel();
message.setPayload(mqttMessage.getPayload());
message.setTableName(topic.replace("/", "").replace("property", ""));
blockingQueue.add(message);
}
Runnable task_runnable = new Runnable() {
public void run() {
while (true) {
try {
MessageModel mqttMessage = blockingQueue.take();
String jsonStr = new String(mqttMessage.getPayload());
String tableName = mqttMessage.getTableName();
if ("iotlogs".contains(tableName)) {
continue;
}
Map<String, String> tagsMap = new HashMap<>();
tagsMap.put("iotCode", tableName);
Map<String, Object> fieldsMap = JSON.parseObject(jsonStr, Map.class);
String sql = "show field keys from " + tableName;
try {
List<Map<String, Object>> list = influxdbUtil.query(sql);
Map<String, Object> fieldsTempMap = new HashMap<>();
for (Map<String, Object> field : list) {
if (fieldsTempMap.containsKey(field.get("fieldKey").toString())) {
continue;
}
fieldsTempMap.put(field.get("fieldKey").toString(), field.get("fieldType").toString());
if (fieldsMap.containsKey(field.get("fieldKey"))) {
if ("integer".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Integer.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
} else if ("float".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Float.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
} else if ("double".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Double.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
}
else {
if ("true".equals(fieldsMap.get(field.get("fieldKey")).toString().toLowerCase()) ||
"false".equals(fieldsMap.get(field.get("fieldKey")).toString().toLowerCase())) {
fieldsMap.put(field.get("fieldKey").toString(), Boolean.valueOf(fieldsMap.get(field.get("fieldKey")).toString()) ? 1 : 0);
} else {
fieldsMap.put(field.get("fieldKey").toString(),
fieldsMap.get(field.get("fieldKey")).toString());
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
fieldsMap.put("createdTime", simpleDateFormat.format(new Date()));
influxDbConnection.insert(tableName, tagsMap, fieldsMap);
CacheObject cacheObject = cacheChannel.get(Constant.REGION, tableName);
if (cacheObject.getValue() == null) {
cacheChannel.set(Constant.REGION, tableName, fieldsMap);
} else {
HashMap<String, Object> cacheData = (HashMap<String, Object>) cacheObject.getValue();
cacheData.putAll(fieldsMap);
cacheChannel.set(Constant.REGION, tableName, cacheData);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
}
package com.yeejoin.amos.kgd.message;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqxListener;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import com.yeejoin.amos.kgd.message.model.MessageModel;
import net.oschina.j2cache.CacheChannel;
import net.oschina.j2cache.CacheObject;
@Component
public class MaasMessageAction extends EmqxListener{
private InfluxDbConnection influxDbConnection;
private InfluxdbUtil influxdbUtil;
private CacheChannel cacheChannel;
public static final int threadNum = 5;
ExecutorService service = Executors.newFixedThreadPool(threadNum);
private static final BlockingQueue<MessageModel> blockingQueue = new LinkedBlockingQueue<MessageModel>();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
public MaasMessageAction(InfluxDbConnection influxDbConnection, InfluxdbUtil influxdbUtil, CacheChannel cacheChannel) {
this.influxDbConnection = influxDbConnection;
this.cacheChannel = cacheChannel;
this.influxdbUtil = influxdbUtil;
for (int i = 0; i < threadNum; i++) {
service.execute(task_runnable);
}
}
@Override
public void processMessage(String topic,MqttMessage mqttMessage) throws Exception {
MessageModel message = new MessageModel();
message.setPayload(mqttMessage.getPayload());
message.setTableName(topic.replace("/", ""));
blockingQueue.add(message);
}
Runnable task_runnable = new Runnable() {
public void run() {
while (true) {
try {
MessageModel mqttMessage = blockingQueue.take();
String jsonStr = new String(mqttMessage.getPayload());
JSONObject data = JSONObject.parseObject(jsonStr);
String tableName = mqttMessage.getTableName();
Map<String, String> tagsMap = new HashMap<>();
Map<String, Object> fieldsMap = JSONObject.toJavaObject(data, HashMap.class);
String sql = "show field keys from " + tableName;
try {
List<Map<String, Object>> list = influxdbUtil.query(sql);
Map<String, Object> fieldsTempMap = new HashMap<>();
for (Map<String, Object> field : list) {
if (fieldsTempMap.containsKey(field.get("fieldKey").toString())) {
continue;
}
fieldsTempMap.put(field.get("fieldKey").toString(), field.get("fieldType").toString());
if (fieldsMap.containsKey(field.get("fieldKey"))) {
if ("integer".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Integer.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
} else if ("float".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Float.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
} else if ("double".equals(field.get("fieldType").toString())) {
fieldsMap.put(field.get("fieldKey").toString(),
Double.valueOf(fieldsMap.get(field.get("fieldKey")).toString()));
} else {
fieldsMap.put(field.get("fieldKey").toString(),
fieldsMap.get(field.get("fieldKey")).toString());
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
fieldsMap.put("createdTime", simpleDateFormat.format(new Date()));
influxDbConnection.insert(tableName, tagsMap, fieldsMap);
CacheObject cacheObject = cacheChannel.get(Constant.REGION, tableName);
if (cacheObject.getValue() == null) {
cacheChannel.set(Constant.REGION, tableName, fieldsMap);
} else {
HashMap<String, Object> cacheData = (HashMap<String, Object>) cacheObject.getValue();
cacheData.putAll(fieldsMap);
cacheChannel.set(Constant.REGION, tableName, cacheData);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
}
package com.yeejoin.amos.kgd.message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.typroject.tyboot.component.emq.EmqKeeper;
@Configuration
public class MessageConfig implements ApplicationListener<ApplicationReadyEvent>{
@Autowired
private EmqKeeper emqKeeper;
@Autowired
IOTPropertyMessageAction propertyMessageAction;
@Autowired
MaasMessageAction maasMessageAction;
@Value("spring.application.name")
private String serviceName;
public static final Integer DEFAULT_QOS = 2;
@Override
public void onApplicationEvent(ApplicationReadyEvent event) {
try {
emqKeeper.subscript(Topic.IOT_PROPERTY_MESSAGE.getShareTopicStr(serviceName), DEFAULT_QOS, propertyMessageAction);
emqKeeper.subscript(Topic.MAAS_CALCULATION_RESULTS.getShareTopicStr(serviceName), DEFAULT_QOS, maasMessageAction);
} catch (Exception e) {
e.printStackTrace();
}
}
}
package com.yeejoin.amos.kgd.message;
public enum Topic {
MAAS_CALCULATION_RESULTS("maas/calculation/result"),
IOT_PROPERTY_MESSAGE("+/+/property"),
IOT_SHADOW_MESSAGE("+/+/shadow");
private String topicStr;
Topic(String topicStr) {
this.topicStr = topicStr;
}
public String getTopicStr() {
return topicStr;
}
public String getShareTopicStr(String groupName) {
String shareTopicStr = "$share/" + groupName.trim() + "/" + getTopicStr();
return shareTopicStr;
}
}
package com.yeejoin.amos.kgd.message.model;
import lombok.Data;
@Data
public class MessageModel {
private String tableName;
private byte[] payload;
}
package com.yeejoin.amos.kgd.service;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import com.yeejoin.amos.component.feign.model.Page;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import com.yeejoin.amos.kgd.message.Constant;
import net.oschina.j2cache.CacheChannel;
import net.oschina.j2cache.CacheObject;
@Component
public class LiveDataService {
private final Logger logger = LogManager.getLogger(LiveDataService.class);
@Autowired
private InfluxdbUtil influxdbUtil;
@Autowired
InfluxDbConnection influxDbConnection;
@Autowired
private CacheChannel cacheChannel;
public static final String SPACE = " ";
public static final String ASTERISK = "*";
public static final String DATE = "time";
public static final String COMMA = ",";
public static final String FROM = "FROM";
public static final String WHERE = "WHERE";
public static final String EQUALSIGN = "=";
public static final String AND = "AND";
public List queryHistoryDataForList(String tableName, String timeStart, String timeEnd, String fieldKeys, Map<String, Object> requestParams) {
StringBuffer sqlSb = new StringBuffer();
sqlSb.append("SELECT").append(SPACE);
if (ObjectUtils.isEmpty(fieldKeys)) {
sqlSb.append(SPACE).append(ASTERISK).append(SPACE);
} else {
fieldKeys = fieldKeys + ", createdTime ";
sqlSb.append(SPACE).append(fieldKeys).append(SPACE);
}
sqlSb.append(SPACE).append(FROM).append(SPACE);
sqlSb.append(tableName);
if (!ObjectUtils.isEmpty(requestParams)) {
sqlSb.append(SPACE).append(WHERE).append(SPACE);
sqlSb.append(DATE).append(">=").append("'").append(timeStart).append("'");
sqlSb.append(AND).append(DATE).append("<=").append("'").append(timeEnd).append("'");
Set<String> keys = requestParams.keySet();
StringBuffer whereSb = new StringBuffer();
for (String key : keys) {
whereSb.append(AND).append(SPACE).append(key).append(SPACE).append(EQUALSIGN).append(requestParams.get(key)).append(SPACE);
}
sqlSb.append(whereSb.toString());
}
sqlSb.append(SPACE).append("tz('Asia/Shanghai')");
List<Map<String, Object>> list = influxdbUtil.query(sqlSb.toString());
return list;
}
public Page<Map<String, Object>> queryHistoryDataForPage(String tableName, String timeStart, String timeEnd, String fieldKeys, Map<String, Object> requestParams, long current, long size) {
StringBuffer sqlSb = new StringBuffer();
StringBuffer countSb = new StringBuffer();
StringBuffer whereSb = new StringBuffer();
sqlSb.append("SELECT").append(SPACE);
if (ObjectUtils.isEmpty(fieldKeys)) {
sqlSb.append(SPACE).append(ASTERISK).append(SPACE);
} else {
fieldKeys = fieldKeys + ", createdTime ";
sqlSb.append(SPACE).append(fieldKeys).append(SPACE);
}
sqlSb.append(SPACE).append(FROM).append(SPACE);
sqlSb.append(tableName);
if (!ObjectUtils.isEmpty(requestParams)) {
whereSb.append(SPACE).append(WHERE).append(SPACE);
whereSb.append(DATE).append(">=").append("'").append(timeStart).append("'").append(SPACE);
whereSb.append(AND).append(SPACE).append(DATE).append("<=").append("'").append(timeEnd).append("'");
Set<String> keys = requestParams.keySet();
StringBuffer subWhereSb = new StringBuffer();
for (String key : keys) {
subWhereSb.append(AND).append(SPACE).append(key).append(SPACE).append(EQUALSIGN).append(requestParams.get(key)).append(SPACE);
}
whereSb.append(subWhereSb.toString());
}
sqlSb.append(" LIMIT ").append(size).append(" OFFSET ").append((current - 1) * size);
sqlSb.append(whereSb.toString());
sqlSb.append(SPACE).append("tz('Asia/Shanghai')");
countSb.append("SELECT COUNT(createdTime) FROM ").append(tableName);
countSb.append(whereSb.toString());
List<Map<String, Object>> count = influxdbUtil.query(countSb.toString());
List<Map<String, Object>> list = influxdbUtil.query(sqlSb.toString());
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setCurrent(current);
page.setSize(size);
page.setRecords(list);
page.setTotal((Double.valueOf(count.get(0).get("count").toString()).longValue()));
return page;
}
public Map<String, Object> queryrealTimeData(String tableName) {
CacheObject cacheObject = cacheChannel.get(Constant.REGION, tableName);
return (Map<String, Object>) cacheObject.getValue();
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.avic.face.orm.dao.AvicCustomPathMapper">
</mapper>
...@@ -28,5 +28,6 @@ ...@@ -28,5 +28,6 @@
<module>amos-boot-module-ccs-api</module> <module>amos-boot-module-ccs-api</module>
<module>amos-boot-module-avic-api</module> <module>amos-boot-module-avic-api</module>
<module>amos-boot-module-precontrol-api</module> <module>amos-boot-module-precontrol-api</module>
<module>amos-boot-module-kgd-api</module>
</modules> </modules>
</project> </project>
\ No newline at end of file
...@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto; import com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentSignalLog; import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentSignalLog;
...@@ -17,12 +18,15 @@ import com.yeejoin.amos.boot.module.ccs.api.vo.RawDataVO; ...@@ -17,12 +18,15 @@ import com.yeejoin.amos.boot.module.ccs.api.vo.RawDataVO;
import com.yeejoin.amos.boot.module.ccs.api.vo.ReceiveDataVO; import com.yeejoin.amos.boot.module.ccs.api.vo.ReceiveDataVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -43,6 +47,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -43,6 +47,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Autowired @Autowired
private FireEquipmentSignalLogMapper fireEquipmentSignalLogMapper; private FireEquipmentSignalLogMapper fireEquipmentSignalLogMapper;
@Autowired
protected EmqKeeper emqKeeper;
public static final String EMERGENCY_ALARM_DATA_REFRESH = "emergency/alarm/data/refresh";
//TODO 逻辑待补充 //TODO 逻辑待补充
@Override @Override
...@@ -92,6 +100,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -92,6 +100,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
fireEquipmentSignalLog.setLng(oneByCode.getLng()); fireEquipmentSignalLog.setLng(oneByCode.getLng());
fireEquipmentSignalLog.setLat(oneByCode.getLat()); fireEquipmentSignalLog.setLat(oneByCode.getLat());
fireEquipmentSignalLogMapper.insert(fireEquipmentSignalLog); fireEquipmentSignalLogMapper.insert(fireEquipmentSignalLog);
// 发送mqtt消息--刷新应急指挥屏数据
HashMap<String, String> refresh = new HashMap<>();
refresh.put("uuId", String.valueOf(System.currentTimeMillis()));
try {
emqKeeper.getMqttClient().publish(EMERGENCY_ALARM_DATA_REFRESH, JSON.toJSONString(refresh).getBytes(), 0, false);
} catch (MqttException e) {
e.printStackTrace();
}
} }
} else if (ObjectUtil.isNotEmpty(receiveData) && StrUtil.isNotEmpty(receiveData.getActive()) && } else if (ObjectUtil.isNotEmpty(receiveData) && StrUtil.isNotEmpty(receiveData.getActive()) &&
"update".equals(receiveData.getActive()) && ObjectUtil.isNotEmpty(receiveData.getRawData()) && StrUtil.isNotEmpty(receiveData.getRawData().getEquipmentSpecificCode())) { "update".equals(receiveData.getActive()) && ObjectUtil.isNotEmpty(receiveData.getRawData()) && StrUtil.isNotEmpty(receiveData.getRawData().getEquipmentSpecificCode())) {
...@@ -102,6 +119,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -102,6 +119,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
updateWrapper.lambda().eq(FireEquipmentSignalLog::getFireEquipmentMrid, rawData.getEquipmentSpecificCode()) updateWrapper.lambda().eq(FireEquipmentSignalLog::getFireEquipmentMrid, rawData.getEquipmentSpecificCode())
.eq(FireEquipmentSignalLog::getFireEquipmentIndexKey, rawData.getEquipmentIndexKey()); .eq(FireEquipmentSignalLog::getFireEquipmentIndexKey, rawData.getEquipmentIndexKey());
fireEquipmentSignalLogServiceImpl.update(fireEquipmentSignalLog, updateWrapper); fireEquipmentSignalLogServiceImpl.update(fireEquipmentSignalLog, updateWrapper);
// 发送mqtt消息--刷新应急指挥屏数据
HashMap<String, String> refresh = new HashMap<>();
refresh.put("uuId", String.valueOf(System.currentTimeMillis()));
try {
emqKeeper.getMqttClient().publish(EMERGENCY_ALARM_DATA_REFRESH, JSON.toJSONString(refresh).getBytes(), 0, false);
} catch (MqttException e) {
e.printStackTrace();
}
} }
log.info(String.format("收到mqtt(警情)消息并处理完成:%s", message)); log.info(String.format("收到mqtt(警情)消息并处理完成:%s", message));
} }
......
...@@ -103,9 +103,10 @@ public class DutyCarController extends BaseController { ...@@ -103,9 +103,10 @@ public class DutyCarController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图") @ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail( public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate @ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode
) throws ParseException { ) throws ParseException {
return ResponseHelper.buildResponse(iDutyCarService.newStatisticsDay(beginDate, endDate)); return ResponseHelper.buildResponse(iDutyCarService.newStatisticsDay(beginDate, endDate, fieldCode));
} }
/** /**
* 调班 * 调班
...@@ -175,8 +176,9 @@ public class DutyCarController extends BaseController { ...@@ -175,8 +176,9 @@ public class DutyCarController extends BaseController {
@GetMapping("/person/{dutyDay}/list") @GetMapping("/person/{dutyDay}/list")
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay, public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @ApiParam(value = "岗位") @RequestParam(required = false) String postType,
return ResponseHelper.buildResponse(iDutyCarService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType)); @ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode){
return ResponseHelper.buildResponse(iDutyCarService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType, fieldCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询指定車輛值班人信息列表") @ApiOperation("查询指定車輛值班人信息列表")
......
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import java.text.ParseException; import java.text.ParseException;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -18,18 +17,14 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -18,18 +17,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
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.DateUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; 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.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;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
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.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService; import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
...@@ -102,9 +97,10 @@ public class DutyFireFightingController extends BaseController{ ...@@ -102,9 +97,10 @@ public class DutyFireFightingController extends BaseController{
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图") @ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail( public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate @ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode
) throws ParseException { ) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.newStatisticsDay(beginDate, endDate)); return ResponseHelper.buildResponse(iDutyFireFightingService.newStatisticsDay(beginDate, endDate, fieldCode));
} }
/** /**
* 调班 * 调班
...@@ -173,8 +169,9 @@ public class DutyFireFightingController extends BaseController{ ...@@ -173,8 +169,9 @@ public class DutyFireFightingController extends BaseController{
@GetMapping("/person/{dutyDay}/list") @GetMapping("/person/{dutyDay}/list")
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay, public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @ApiParam(value = "岗位") @RequestParam(required = false) String postType,
return ResponseHelper.buildResponse(iDutyFireFightingService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType)); @ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode){
return ResponseHelper.buildResponse(iDutyFireFightingService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType, fieldCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -89,9 +89,10 @@ public class DutyFirstAidController extends BaseController{ ...@@ -89,9 +89,10 @@ public class DutyFirstAidController extends BaseController{
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图") @ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail( public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate @ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode
) throws ParseException { ) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.newStatisticsDay(beginDate, endDate)); return ResponseHelper.buildResponse(iDutyFirstAidService.newStatisticsDay(beginDate, endDate, fieldCode));
} }
/** /**
* 调班 * 调班
...@@ -160,7 +161,8 @@ public class DutyFirstAidController extends BaseController{ ...@@ -160,7 +161,8 @@ public class DutyFirstAidController extends BaseController{
@GetMapping("/person/{dutyDay}/list") @GetMapping("/person/{dutyDay}/list")
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay, public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @ApiParam(value = "岗位") @RequestParam(required = false) String postType,
return ResponseHelper.buildResponse(iDutyFirstAidService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType)); @ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode){
return ResponseHelper.buildResponse(iDutyFirstAidService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType, fieldCode));
} }
} }
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import java.text.ParseException; import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.Map; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import javax.servlet.http.HttpServletResponse; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.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.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -23,15 +16,10 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -23,15 +16,10 @@ 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;
import com.baomidou.mybatisplus.core.metadata.IPage; import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import java.text.ParseException;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import java.util.List;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/** /**
...@@ -103,9 +91,10 @@ public class DutyPersonController extends BaseController { ...@@ -103,9 +91,10 @@ public class DutyPersonController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图") @ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail( public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate @ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode
) throws ParseException { ) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.newStatisticsDay(beginDate, endDate)); return ResponseHelper.buildResponse(iDutyPersonService.newStatisticsDay(beginDate, endDate, fieldCode));
} }
/** /**
...@@ -186,8 +175,9 @@ public class DutyPersonController extends BaseController { ...@@ -186,8 +175,9 @@ public class DutyPersonController extends BaseController {
@GetMapping("/new-person/{dutyDay}/list") @GetMapping("/new-person/{dutyDay}/list")
public ResponseModel newListDutyPerson(@ApiParam(value = "值班日期", required = true) @PathVariable String dutyDay, public ResponseModel newListDutyPerson(@ApiParam(value = "值班日期", required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType) { @ApiParam(value = "岗位") @RequestParam(required = false) String postType,
return ResponseHelper.buildResponse(iDutyPersonService.getSchedulingDutyForSpecifyDate(dutyDay, shiftId, postType)); @ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode) {
return ResponseHelper.buildResponse(iDutyPersonService.getSchedulingDutyForSpecifyDate(dutyDay, shiftId, postType, fieldCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询当前值班人信息列表") @ApiOperation("查询当前值班人信息列表")
......
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
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.constants.CommonConstant;
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.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
...@@ -23,43 +13,33 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey; ...@@ -23,43 +13,33 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify; import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.CompanyInfo; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper; import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireCompanyInfoServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.FireCompanyInfoServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
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;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import java.io.UnsupportedEncodingException;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil; import java.util.Collection;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import java.util.HashMap;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import java.util.List;
import com.yeejoin.amos.feign.privilege.Privilege; import java.util.Map;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/** /**
* @author fengwang * @author fengwang
......
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrAgencyUserService; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrAgencyUserService;
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.util.ObjectUtils;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
...@@ -36,10 +37,15 @@ public class OrgUsrAgencyUserController extends BaseController { ...@@ -36,10 +37,15 @@ public class OrgUsrAgencyUserController extends BaseController {
* @return OrgUsrAgencyUser * @return OrgUsrAgencyUser
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{orgUsrId}/detail", method = RequestMethod.GET) @RequestMapping(value = "/{orgUsrId}/detail", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "查询关联的amos账号信息", notes = "查询关联的amos账号信息") @ApiOperation(httpMethod = "POST", value = "查询关联的amos账号信息", notes = "查询关联的amos账号信息")
public ResponseModel<OrgUsrAgencyUser> getAccountDetail(@PathVariable String orgUsrId) { public ResponseModel<OrgUsrAgencyUser> getAccountDetail(@PathVariable String orgUsrId) {
OrgUsrAgencyUser orgUsrAgencyUser = new OrgUsrAgencyUser();
OrgUsrAgencyUser agencyUser = orgUsrAgencyUserService.getAccountDetail(orgUsrId); OrgUsrAgencyUser agencyUser = orgUsrAgencyUserService.getAccountDetail(orgUsrId);
if (ObjectUtils.isEmpty(agencyUser)) {
orgUsrAgencyUser.setUpAmosUser("0");
return ResponseHelper.buildResponse(orgUsrAgencyUser);
}
return ResponseHelper.buildResponse(agencyUser); return ResponseHelper.buildResponse(agencyUser);
} }
} }
\ No newline at end of file
...@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; ...@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.*; import com.yeejoin.amos.boot.module.common.biz.service.impl.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; 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;
...@@ -511,6 +512,34 @@ public class WaterResourceController extends BaseController { ...@@ -511,6 +512,34 @@ public class WaterResourceController extends BaseController {
} }
/** /**
* 列表分页查询缺陷模块用
*
* @param pageNum 当前页
* @param pageSize 每页大小
* @return 返回结果
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/pageByDefect")
@ApiOperation(httpMethod = "GET", value = "列表分页查询缺陷模块用", notes = "列表分页查询缺陷模块用")
public ResponseModel<Page<WaterResourceDto>> pageByDefect(@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize,
@RequestParam(value = "nameOrCode", required = false) String nameOrCode,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo();
if (StringUtils.isEmpty(bizOrgCode)) {
if (ObjectUtils.isEmpty(reginParams) || ObjectUtils.isEmpty(reginParams.getPersonIdentity()) || StringUtils.isEmpty(reginParams.getPersonIdentity().getBizOrgCode())) {
return ResponseHelper.buildResponse(null);
}
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
Page<WaterResourceDto> page = new Page<>();
page.setCurrent(pageNum);
page.setSize(pageSize);
Page<WaterResourceDto> waterResourceDtoPage = waterResourceServiceImpl.pageByDefect(page, nameOrCode, bizOrgCode);
return ResponseHelper.buildResponse(waterResourceDtoPage);
}
/**
* 列表全部数据查询 * 列表全部数据查询
* *
* @return 返回结果 * @return 返回结果
......
package com.yeejoin.amos.boot.module.common.biz.enums;
public enum DynamicGroupCode {
JCS_PERSON("机场人员", "246");
private String name;
private String code;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
DynamicGroupCode(String name, String code) {
this.name = name;
this.code = code;
}
}
...@@ -4,11 +4,13 @@ import com.yeejoin.amos.boot.module.common.biz.listener.AmosMqttListener; ...@@ -4,11 +4,13 @@ import com.yeejoin.amos.boot.module.common.biz.listener.AmosMqttListener;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner; import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
/** /**
* @author Administrator * @author Administrator
*/ */
@Component
public class ApplicationRunnerImpl implements ApplicationRunner { public class ApplicationRunnerImpl implements ApplicationRunner {
@Autowired @Autowired
......
...@@ -142,7 +142,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -142,7 +142,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
return result; return result;
} }
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay, List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "carId", "carName", "teamName","result.carId"); this.getGroupCode(), "carId", "carName", "teamName","result.carId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) { if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
...@@ -181,7 +181,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -181,7 +181,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
// } // }
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay, List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,null); this.getGroupCode(), instanceIds,null, fieldCode);
/*if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) { /*if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue; continue;
}*/ }*/
...@@ -246,7 +246,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -246,7 +246,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
if (StringUtils.isNotBlank(instanceId)) { if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(","); String[] instanceIds = instanceId.split(",");
specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay, specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,null); this.getGroupCode(), instanceIds,null, null);
} }
return specifyDateList; return specifyDateList;
} }
......
...@@ -11,6 +11,8 @@ import java.util.stream.Stream; ...@@ -11,6 +11,8 @@ import java.util.stream.Stream;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCode;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -230,7 +232,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -230,7 +232,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
LocalDate startDate = LocalDate.parse(start); LocalDate startDate = LocalDate.parse(start);
LocalDate endDate = LocalDate.parse(end); LocalDate endDate = LocalDate.parse(end);
long distance = ChronoUnit.DAYS.between(startDate, endDate); long distance = ChronoUnit.DAYS.between(startDate, endDate);
if (distance < 1) { if (distance < 1 && StringUtils.isNotBlank(start)) {
list.add(start);
return list; return list;
} }
Stream.iterate(startDate, d -> d.plusDays(1)).limit(distance + 1).forEach(f -> list.add(f.toString())); Stream.iterate(startDate, d -> d.plusDays(1)).limit(distance + 1).forEach(f -> list.add(f.toString()));
...@@ -278,7 +281,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -278,7 +281,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
/*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 结束*/ /*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 结束*/
} }
public List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate) throws ParseException { public List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate, String fieldCode) throws ParseException {
Date dateBegin = DateUtils.dateParse(beginDate, DateUtils.DATE_PATTERN); Date dateBegin = DateUtils.dateParse(beginDate, DateUtils.DATE_PATTERN);
String timeStart = DateUtils.dateTimeToDateString(dateBegin); String timeStart = DateUtils.dateTimeToDateString(dateBegin);
...@@ -306,7 +309,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -306,7 +309,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
result.put("key", objectMap.get("date")); result.put("key", objectMap.get("date"));
String dateString = objectMap.get("date").toString(); String dateString = objectMap.get("date").toString();
if(this.getGroupCode().equals("dutyPerson")) { if(this.getGroupCode().equals("dutyPerson")) {
result.put("data", getPersonPostTypeNameAndCount(dateString)); result.put("data", getPersonPostTypeNameAndCount(dateString, fieldCode));
}else if(this.getGroupCode().equals("dutyCar")) { }else if(this.getGroupCode().equals("dutyCar")) {
result.put("data", getCarPostTypeNameAndCount(dateString)); result.put("data", getCarPostTypeNameAndCount(dateString));
}else if(this.getGroupCode().equals("dutyFireFighting")) { }else if(this.getGroupCode().equals("dutyFireFighting")) {
...@@ -323,11 +326,16 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -323,11 +326,16 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
/** /**
* 排班值班人员的统计类型为: * 排班值班人员的统计类型为:
* 岗位: 岗位人员数量 * 岗位: 岗位人员数量
*
* @param dutyDate * @param dutyDate
* @param dutyType
* @return * @return
*/ */
public Object getPersonPostTypeNameAndCount(String dutyDate) { public Object getPersonPostTypeNameAndCount(String dutyDate, String fieldCode) {
if (StringUtils.isNotBlank(fieldCode)) {
return dutyPersonShiftService.getBaseMapper().newStationViewDataByFieldCode(dutyDate, this.getGroupCode(), fieldCode);
}
return dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode()); return dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
} }
/** /**
...@@ -503,6 +511,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -503,6 +511,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
Long instanceId = null; Long instanceId = null;
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>() List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>()
.eq(DynamicFormColumn::getGroupCode, this.getGroupCode())); .eq(DynamicFormColumn::getGroupCode, this.getGroupCode()));
Map<String, Object> dataMap = buildDataMap(d, userId);
// 1.组装动态表单数据 // 1.组装动态表单数据
if (!instances.isEmpty()) { if (!instances.isEmpty()) {
// 0.定位instanceId,准备进行更新操作 // 0.定位instanceId,准备进行更新操作
...@@ -515,7 +524,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -515,7 +524,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instancesInDb, "fieldCode", Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instancesInDb, "fieldCode",
DynamicFormInstance.class); DynamicFormInstance.class);
// 3.待更新数据组装,待批量入库 // 3.待更新数据组装,待批量入库
this.updateFormValue(formInstanceList, d, instanceId, columns, instanceMap); this.updateFormValue(formInstanceList, dataMap, instanceId, columns, instanceMap);
} else { } else {
// 0.新数据,生成id // 0.新数据,生成id
instanceId = sequence.nextId(); instanceId = sequence.nextId();
...@@ -523,14 +532,14 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -523,14 +532,14 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
// 1.组装数据 // 1.组装数据
List<DynamicFormInstance> newInstances = columns.stream().map(column -> { List<DynamicFormInstance> newInstances = columns.stream().map(column -> {
DynamicFormInstance instance = new DynamicFormInstance(); DynamicFormInstance instance = new DynamicFormInstance();
buildFormInstanceData(finalInstanceId1, d, column, instance); buildFormInstanceData(finalInstanceId1, dataMap, column, instance);
return instance; return instance;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
// 2.待更新数据组装,待批量入库 // 2.待更新数据组装,待批量入库
formInstanceList.addAll(newInstances); formInstanceList.addAll(newInstances);
} }
// 2.组装值班数据 // 2.组装值班数据
List<DutyPersonShiftDto> shiftDtos = (List<DutyPersonShiftDto>) d.get("dutyShift"); List<DutyPersonShiftDto> shiftDtos = (List<DutyPersonShiftDto>) dataMap.get("dutyShift");
Long finalInstanceId = instanceId; Long finalInstanceId = instanceId;
// 按照业务唯一索引查询主键 // 按照业务唯一索引查询主键
List<DutyPersonShift> dutyPersonShiftsDb = dutyPersonShiftService List<DutyPersonShift> dutyPersonShiftsDb = dutyPersonShiftService
...@@ -574,6 +583,20 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -574,6 +583,20 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
} }
} }
private Map<String, Object> buildDataMap(Map<String, Object> d, String userId) {
// 表单存在人员类型,获取用户ID,查询人员类型赋值
if (!ObjectUtils.isEmpty(userId)) {
List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "peopleType")
.eq(DynamicFormInstance::getInstanceId, userId)
.eq(DynamicFormInstance::getGroupCode, DynamicGroupCode.JCS_PERSON.getCode()));
if (!CollectionUtils.isEmpty(instances)) {
d.put("personType", instances.get(0).getFieldValue());
}
}
return d;
}
private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column, private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column,
DynamicFormInstance formInstance) { DynamicFormInstance formInstance) {
fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId()); fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId());
...@@ -809,7 +832,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -809,7 +832,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
} }
@Override @Override
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null; return null;
} }
......
...@@ -55,7 +55,7 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement ...@@ -55,7 +55,7 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
insertPersonShift(instanceId, dto.getDutyShift()); insertPersonShift(instanceId, dto.getDutyShift());
return dto; return dto;
} }
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay, List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "fireFightingId", "fireFighting", "teamName","result.fireFightingId"); this.getGroupCode(), "fireFightingId", "fireFighting", "teamName","result.fireFightingId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) { if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
...@@ -90,7 +90,7 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement ...@@ -90,7 +90,7 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
// } // }
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay, List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,null); this.getGroupCode(), instanceIds,null, fieldCode);
if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) { if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue; continue;
} }
......
...@@ -7,7 +7,6 @@ import java.util.List; ...@@ -7,7 +7,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.velocity.runtime.directive.Break;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
...@@ -58,7 +57,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -58,7 +57,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
} }
@Override @Override
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay, List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "firstAidId", "firstAid", "teamName", "result.firstAidId"); this.getGroupCode(), "firstAidId", "firstAid", "teamName", "result.firstAidId");
if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) { if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) {
...@@ -94,7 +93,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -94,7 +93,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds, .getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
null); null, fieldCode);
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) { if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue; continue;
} }
......
...@@ -304,7 +304,7 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType ...@@ -304,7 +304,7 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
} }
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay, List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "deptId", "deptName", "result.deptId"); this.getGroupCode(), "deptId", "deptName", "result.deptId");
if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) { if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) {
...@@ -330,7 +330,7 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType ...@@ -330,7 +330,7 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds, .getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
null); null, fieldCode);
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) { if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue; continue;
} }
......
...@@ -6,9 +6,10 @@ import java.util.stream.Collectors; ...@@ -6,9 +6,10 @@ import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper; import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrAgencyUserMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper; import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.component.feign.model.Page;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
...@@ -28,8 +29,6 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; ...@@ -28,8 +29,6 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.Menu; import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser; import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFirefightersService; import com.yeejoin.amos.boot.module.common.api.service.IFirefightersService;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
...@@ -61,6 +60,9 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -61,6 +60,9 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
FirefightersContactsServiceImpl ifirefightersContactsService; FirefightersContactsServiceImpl ifirefightersContactsService;
@Autowired @Autowired
private OrgUsrMapper orgUsrMapper; private OrgUsrMapper orgUsrMapper;
@Autowired
OrgUsrAgencyUserMapper orgUsrAgencyUserMapper;
@Override @Override
public List<FirefightersZhDto> getFirefighters(int pageNum, int pageSize, FirefightersDto par) { public List<FirefightersZhDto> getFirefighters(int pageNum, int pageSize, FirefightersDto par) {
...@@ -228,20 +230,65 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -228,20 +230,65 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public PeopleInfoDto updatePeopleById(PeopleInfoDto peopleInfoDto, Long id) { public PeopleInfoDto updatePeopleById(PeopleInfoDto peopleInfoDto, Long id) {
Map<String, String> map = new HashMap<>();
// 1.动态表单 // 1.动态表单
OrgUsr orgUsr = orgUsrService.peopleSaveOrgUsr(peopleInfoDto.getFirefighters());
if(!ValidationUtil.isEmpty(peopleInfoDto.getFirefighters().getAmosUserId())) { if(!ValidationUtil.isEmpty(peopleInfoDto.getFirefighters().getAmosUserId()) || "1".equals(peopleInfoDto.getOrgUsrAgencyUser().getUpAmosUser())) {
AgencyUserModel amosUser = Privilege.agencyUserClient.queryByUserId(peopleInfoDto.getFirefighters().getAmosUserId()).getResult(); AgencyUserModel amosUser = null;
peopleInfoDto.getFirefighters().setAmosName(amosUser.getRealName()); if(!ValidationUtil.isEmpty(peopleInfoDto.getFirefighters().getAmosUserId())){
amosUser = Privilege.agencyUserClient.queryByUserId(peopleInfoDto.getFirefighters().getAmosUserId()).getResult();
}
//删除之前所在用户组
OrgUsrAgencyUser orgUsrAgencyUser = orgUsrAgencyUserMapper.selectOne(new QueryWrapper<OrgUsrAgencyUser>().eq("org_usr_id", id));
if (!ValidationUtil.isEmpty(orgUsrAgencyUser) && amosUser != null ) {
String groupIds = orgUsrAgencyUser.getGroupIds();
if (!"".equals(groupIds) && null != groupIds) {
String[] ids = groupIds.split(",");
for (String gId : ids) {
Long groupId = Long.valueOf(gId);
Privilege.groupUserClient.deleteGroupUser(groupId,amosUser.getUserId());
}
}
}
//同步更新或者创建平台用户
if(null == amosUser){
map = orgUsrService.savePlatformUser(orgUsr,peopleInfoDto,"create");
} else {
if("0".equals(peopleInfoDto.getOrgUsrAgencyUser().getUpAmosUser())){
//删除cb_org_usr_agency_user中对应数据
if (!ValidationUtil.isEmpty(orgUsrAgencyUser)) {
orgUsrAgencyUserMapper.delete(new QueryWrapper<OrgUsrAgencyUser>().eq("org_usr_id", id));
}
//删除cb_org_usr相关字段
OrgUsr orgUsr1 = orgUsrMapper.queryBySequenceNbr(id.toString());
orgUsr1.setAmosOrgId("");
orgUsr1.setAmosOrgCode("");
orgUsrMapper.update(orgUsr1,new QueryWrapper<OrgUsr>().eq("sequence_nbr",id));
//删除cb_firefighters相关字段
Firefighters firefighters = firefightersMapper.selectOne(new QueryWrapper<Firefighters>().eq("org_usr_id", id));
firefighters.setAmosUserId("");
firefighters.setAmosName("");
firefightersMapper.update(firefighters,new QueryWrapper<Firefighters>().eq("org_usr_id", id));
Privilege.agencyUserClient.multDeleteUser(orgUsrAgencyUser.getAmosUserId());
} else {
map = orgUsrService.savePlatformUser(orgUsr,peopleInfoDto,"update");
}
}
if(amosUser==null){
peopleInfoDto.getFirefighters().setAmosName(peopleInfoDto.getOrgUsrAgencyUser().getUsrName());
}else {
peopleInfoDto.getFirefighters().setAmosName(amosUser.getRealName());
}
} else { } else {
peopleInfoDto.getFirefighters().setAmosUserId(null); peopleInfoDto.getFirefighters().setAmosUserId(null);
peopleInfoDto.getFirefighters().setAmosName(null); peopleInfoDto.getFirefighters().setAmosName(null);
} }
OrgUsr orgUsr = orgUsrService.peopleSaveOrgUsr(peopleInfoDto.getFirefighters());
OrgPersonDto orgPersonDto = new OrgPersonDto(); OrgPersonDto orgPersonDto = new OrgPersonDto();
BeanUtils.copyProperties(orgUsr, orgPersonDto); BeanUtils.copyProperties(orgUsr, orgPersonDto);
List<DynamicFormInstance> dynamicFormInstances = orgUsrService.dynamicFormColumn(peopleInfoDto.getFirefighters(), true); orgPersonDto.setAmosOrgId(map.get("orgId"));
orgPersonDto.setAmosOrgCode(map.get("orgCode"));
List<DynamicFormInstance> dynamicFormInstances = orgUsrService.dynamicFormColumn(peopleInfoDto.getFirefighters(), false);
orgPersonDto.setDynamicFormValue(dynamicFormInstances); orgPersonDto.setDynamicFormValue(dynamicFormInstances);
try { try {
orgUsrService.updateByIdOrgPerson(orgPersonDto, id); orgUsrService.updateByIdOrgPerson(orgPersonDto, id);
...@@ -270,7 +317,7 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -270,7 +317,7 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
@Override @Override
public void saveFirefightersByUser(PeopleInfoDto firefighters) { public void saveFirefightersByUser(PeopleInfoDto firefighters) {
orgUsrService.saveFirefighters(firefighters); orgUsrService.saveFirefighters(firefighters,new HashMap<>());
} }
public Map<String, String> getPersonByCodes(List<String> list) { public Map<String, String> getPersonByCodes(List<String> list) {
......
...@@ -3,14 +3,22 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl; ...@@ -3,14 +3,22 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrAgencyUserDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrAgencyUserDto;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsrAgencyUser; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsrAgencyUser;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrAgencyUserMapper; import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrAgencyUserMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrAgencyUserService; import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrAgencyUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -22,6 +30,12 @@ import java.util.stream.Collectors; ...@@ -22,6 +30,12 @@ import java.util.stream.Collectors;
@Service @Service
public class OrgUsrAgencyUserServiceImpl extends BaseService<OrgUsrAgencyUserDto, OrgUsrAgencyUser, OrgUsrAgencyUserMapper> implements IOrgUsrAgencyUserService { public class OrgUsrAgencyUserServiceImpl extends BaseService<OrgUsrAgencyUserDto, OrgUsrAgencyUser, OrgUsrAgencyUserMapper> implements IOrgUsrAgencyUserService {
@Autowired
OrgUsrAgencyUserMapper orgUsrAgencyUserMapper;
@Autowired
FirefightersMapper firefightersMapper;
@Autowired
OrgUsrMapper orgUsrMapper;
@Override @Override
public OrgUsrAgencyUser getAccountDetail(String orgUsrId) { public OrgUsrAgencyUser getAccountDetail(String orgUsrId) {
...@@ -35,17 +49,52 @@ public class OrgUsrAgencyUserServiceImpl extends BaseService<OrgUsrAgencyUserDto ...@@ -35,17 +49,52 @@ public class OrgUsrAgencyUserServiceImpl extends BaseService<OrgUsrAgencyUserDto
String userId = jsonObject.getString("userId"); String userId = jsonObject.getString("userId");
// 平台添加用户 // 平台添加用户
if ("update".equals(methodName)) { if ("update".equals(methodName)) {
// 更新cb_org_usr_agency_user、cb_org_usr、cb_firefighters // 更新cb_org_usr_agency_user
JSONObject object = result.getJSONObject("result"); JSONObject object = result.getJSONObject("result");
// person.setId(object.getLong("sequenceNbr")); OrgUsrAgencyUser orgUsrAgencyUser = orgUsrAgencyUserMapper.selectOne(new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id", object.getString("userId")));
// person.setAccountName(object.getString("userName")); orgUsrAgencyUser.setUsrName(object.getString("userName"));
// person.setUserId(object.getLong("userId")); orgUsrAgencyUser.setMobile(object.getString("mobile"));
// person.setName(object.getString("realName")); orgUsrAgencyUser.setAmosUserId(object.getString("userId"));
// person.setPhone(object.getString("mobile")); orgUsrAgencyUserMapper.update(orgUsrAgencyUser,new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id",object.getString("userId")));
// 更新cb_firefighters
Firefighters firefighter = firefightersMapper.selectOne(new QueryWrapper<Firefighters>().eq("org_usr_id", orgUsrAgencyUser.getOrgUsrId()));
if (!ObjectUtils.isEmpty(firefighter) && !firefighter.getIsDelete()) {
firefighter.setAmosUserId(object.get("userId").toString());
firefighter.setAmosName(object.getString("userName"));
firefightersMapper.update(firefighter, new QueryWrapper<Firefighters>().eq("org_usr_id", orgUsrAgencyUser.getOrgUsrId()));
}
// 更新cb_org_usr
OrgUsr orgUsr1 = orgUsrMapper.selectById(orgUsrAgencyUser.getOrgUsrId());
if (!ObjectUtils.isEmpty(orgUsr1) && !orgUsr1.getIsDelete()) {
orgUsr1.setAmosOrgId(object.get("userId").toString());
List<Map<String, Object>> companys = (List<Map<String, Object>>) object.get("companys");
orgUsr1.setAmosOrgCode(companys.get(0).get("orgCode").toString());
orgUsrMapper.update(orgUsr1,new QueryWrapper<OrgUsr>().eq("sequence_nbr",orgUsrAgencyUser.getOrgUsrId()));
}
} else if ("multDeleteUser".equals(methodName)) { } else if ("multDeleteUser".equals(methodName)) {
JSONArray array = result.getJSONArray("result"); JSONArray array = result.getJSONArray("result");
List<Object> userIds = array.stream().collect(Collectors.toList()); List<Object> userIds = array.stream().collect(Collectors.toList());
// 删除cb_org_usr_agency_user、cb_org_usr与用户有关字段、cb_firefighters和用户有关字段 for (Object id : userIds) {
//删除cb_org_usr_agency_user中信息
OrgUsrAgencyUser orgUsrAgencyUser = orgUsrAgencyUserMapper.selectOne(new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id", id));
if (!ObjectUtils.isEmpty(orgUsrAgencyUser)) {
orgUsrAgencyUserMapper.delete(new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id", id));
}
// 删除cb_firefighters和用户有关字段
Firefighters firefighter = firefightersMapper.selectOne(new QueryWrapper<Firefighters>().eq("amos_user_id", id));
if (!ObjectUtils.isEmpty(firefighter)) {
firefighter.setAmosUserId("");
firefighter.setAmosName("");
firefightersMapper.update(firefighter, new QueryWrapper<Firefighters>().eq("amos_user_id", id).eq("is_delete", 0));
}
// 删除cb_org_usr与用户有关字段
OrgUsr orgUsr1 = orgUsrMapper.selectOne(new QueryWrapper<OrgUsr>().eq("amos_org_id", id));
if (!ObjectUtils.isEmpty(orgUsr1)) {
orgUsr1.setAmosOrgId("");
orgUsr1.setAmosOrgCode("");
orgUsrMapper.update(orgUsr1,new QueryWrapper<OrgUsr>().eq("amos_org_id",id).eq("is_delete",0));
}
}
} }
} }
} }
\ No newline at end of file
...@@ -94,6 +94,15 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -94,6 +94,15 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
} }
/** /**
* 分页查询
*/
public Page<WaterResourceDto> pageByDefect(Page<WaterResourceDto> page,
String nameOrCode,
String bizOrgCode) {
return this.waterResourceMapper.pageByDefect(page, nameOrCode, bizOrgCode);
}
/**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<WaterResourceDto> queryForWaterResourceList(@Condition(Operator.eq) Boolean isDelete) { public List<WaterResourceDto> queryForWaterResourceList(@Condition(Operator.eq) Boolean isDelete) {
......
...@@ -51,6 +51,21 @@ ...@@ -51,6 +51,21 @@
<artifactId>geodesy</artifactId> <artifactId>geodesy</artifactId>
<version>1.1.3</version> <version>1.1.3</version>
</dependency> </dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-authtoken</artifactId>
<version>1.7.13-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>io.springfox</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -4,8 +4,11 @@ import java.text.ParseException; ...@@ -4,8 +4,11 @@ import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto;
import io.swagger.annotations.ApiParam;
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.format.annotation.DateTimeFormat;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -87,4 +90,20 @@ public class AnalysisReportLogController extends AbstractBaseController { ...@@ -87,4 +90,20 @@ public class AnalysisReportLogController extends AbstractBaseController {
return reportResponse; return reportResponse;
} }
@GetMapping(value = "/iotReportPage")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "分页查询", notes = "分页查询")
public IPage<AnalysisReportLogDto> iotReportPage(Page page, @RequestParam Integer reportType,
@ApiParam(value = "开始日期", required = false) @RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd")Date startDate,
@ApiParam(value = "结束日期", required = false) @RequestParam(required = false) @DateTimeFormat(pattern="yyyy-MM-dd")Date endDate,
@ApiParam(value = "换流站编码", required = false) @RequestParam(required = false) String stationCode) {
AnalysisReportLogDto dto = new AnalysisReportLogDto();
dto.setStartDate(startDate);
dto.setEndDate(endDate);
dto.setReportType(reportType);
dto.setStationCode(stationCode);
return iAnalysisReportLogService.iotReportPage(page, dto);
}
} }
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto; import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.ObjectUtils;
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.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -37,6 +41,7 @@ import com.yeejoin.equipmanage.service.IFormInstanceService; ...@@ -37,6 +41,7 @@ import com.yeejoin.equipmanage.service.IFormInstanceService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -106,8 +111,23 @@ public class BuildingController extends AbstractBaseController { ...@@ -106,8 +111,23 @@ public class BuildingController extends AbstractBaseController {
@ApiOperation("消防建筑树") @ApiOperation("消防建筑树")
@GetMapping(value = "/tree") @GetMapping(value = "/tree")
public List<BuildingTreeVo> getBuildingTree() { public List<BuildingTreeVo> getBuildingTree() {
return buildService.getBuildingTree(); ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return buildService.getBuildingTree(bizOrgCode);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树带筛选")
@GetMapping(value = "/treeByName")
public List<BuildingTreeVo> treeByName(@RequestParam(required = false) String name) {
ReginParams reginParams = getSelectedOrgInfo();
if (ObjectUtils.isEmpty(reginParams) || ObjectUtils.isEmpty(reginParams.getPersonIdentity()) || StringUtils.isEmpty(reginParams.getPersonIdentity().getBizOrgCode())) {
return new ArrayList<>();
}
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return buildService.treeByName(bizOrgCode, name);
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树列表信息") @ApiOperation("消防建筑树列表信息")
@GetMapping(value = "/getBuildingList") @GetMapping(value = "/getBuildingList")
......
...@@ -121,7 +121,7 @@ public class CarController extends AbstractBaseController { ...@@ -121,7 +121,7 @@ public class CarController extends AbstractBaseController {
private RestTemplate restTemplate; private RestTemplate restTemplate;
@Value("${security.productApp}") @Value("${security.productApp}")
private String productApp; private String productApp;
@Value("${security.appKeyApp}") @Value("${amos.system.user.app-key}")
private String appKeyApp; private String appKeyApp;
@Value("${iot.vehicle.track}") @Value("${iot.vehicle.track}")
private String iotServerName; private String iotServerName;
......
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog;
import com.yeejoin.equipmanage.common.entity.MonitorEvent; import com.yeejoin.equipmanage.common.entity.MonitorEvent;
import com.yeejoin.equipmanage.common.entity.vo.IdxBizDefectVo;
import com.yeejoin.equipmanage.fegin.IdxFeign;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmLogMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmLogMapper;
import com.yeejoin.equipmanage.service.IConfirmAlarmService; import com.yeejoin.equipmanage.service.IConfirmAlarmService;
import com.yeejoin.equipmanage.service.impl.MonitorEventService; import com.yeejoin.equipmanage.service.impl.MonitorEventService;
...@@ -14,6 +18,7 @@ import org.springframework.http.MediaType; ...@@ -14,6 +18,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
...@@ -35,6 +40,8 @@ public class ConfirmAlarmController extends AbstractBaseController { ...@@ -35,6 +40,8 @@ public class ConfirmAlarmController extends AbstractBaseController {
EquipmentSpecificAlarmLogMapper equipmentSpecificAlarmLogMapper; EquipmentSpecificAlarmLogMapper equipmentSpecificAlarmLogMapper;
@Autowired @Autowired
private MonitorEventService monitorEventService; private MonitorEventService monitorEventService;
@Autowired
private IdxFeign idxFeign;
@GetMapping(value = "/getDetailsById") @GetMapping(value = "/getDetailsById")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -108,4 +115,14 @@ public class ConfirmAlarmController extends AbstractBaseController { ...@@ -108,4 +115,14 @@ public class ConfirmAlarmController extends AbstractBaseController {
public Map<String, Object> getEquipSceneAndRelationVideo(@PathVariable Long equipmentSpecificId) { public Map<String, Object> getEquipSceneAndRelationVideo(@PathVariable Long equipmentSpecificId) {
return iConfirmAlarmService.getEquipSceneAndRelationVideo(equipmentSpecificId); return iConfirmAlarmService.getEquipSceneAndRelationVideo(equipmentSpecificId);
} }
@GetMapping(value = "/defect/status/{id}")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "缺陷处理状态")
public IdxBizDefectVo getDefectStatus(@PathVariable String id) {
ResponseModel<JSONObject> responseModel = idxFeign.queryDefectByAlarmLogId(id);
JSONObject result = responseModel.getResult();
IdxBizDefectVo vo = JSON.parseObject(JSON.toJSONString(result), IdxBizDefectVo.class);
return vo;
}
} }
...@@ -7,12 +7,15 @@ import java.util.HashSet; ...@@ -7,12 +7,15 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.enums.SourceTypeEnum; import com.yeejoin.equipmanage.common.enums.SourceTypeEnum;
import com.yeejoin.equipmanage.common.utils.SpringUtils; import com.yeejoin.equipmanage.common.utils.SpringUtils;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.mapper.EquipmentCategoryMapper;
import com.yeejoin.equipmanage.service.ISourceStatistics; import com.yeejoin.equipmanage.service.ISourceStatistics;
import com.yeejoin.equipmanage.service.impl.SourcesStatisticsImpl; import com.yeejoin.equipmanage.service.impl.SourcesStatisticsImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -28,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -28,6 +31,7 @@ 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.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -88,11 +92,16 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -88,11 +92,16 @@ public class EquipmentCategoryController extends AbstractBaseController {
@Value("${redis_equip_type_count}") @Value("${redis_equip_type_count}")
private String equipTypeAndCount; private String equipTypeAndCount;
@Autowired
private EquipmentCategoryMapper equipmentCategoryMapper;
private static final String equipmentTreeListAll = "equipmentTreeListAll"; private static final String equipmentTreeListAll = "equipmentTreeListAll";
private static final String equipmentTreeListIndustry = "equipmentTreeListIndustry"; private static final String equipmentTreeListIndustry = "equipmentTreeListIndustry";
// 装备redis缓存key前缀 // 装备redis缓存key前缀
private static final String prefix = "equipmentTreeList"; private static final String prefix = "equipmentTreeList";
private static final String EQUIP_AND_FIRE_TREE = "EQUIP_AND_FIRE_TREE:";
/** /**
* 新增装备分类 * 新增装备分类
* *
...@@ -378,6 +387,147 @@ public class EquipmentCategoryController extends AbstractBaseController { ...@@ -378,6 +387,147 @@ public class EquipmentCategoryController extends AbstractBaseController {
} }
/** /**
* 消防设施分类定义树
*
* @return
*/
@PersonIdentify
@RequestMapping(value = "/equipAndFireAllTree", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防设施分类定义树组合消防装备树", notes = "消防设施分类定义树组合消防装备树")
public ResponseModel equipAndFireAllTree() {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : "";
if (redisUtils.hasKey(EQUIP_AND_FIRE_TREE + bizOrgCode)) {
return CommonResponseUtil.success(redisUtils.get(EQUIP_AND_FIRE_TREE + bizOrgCode));
}
List<EquipmentCategory> result = new ArrayList<>();
List<EquipmentCategory> listFireCategories = listFirePrivate(bizOrgCode);
List<EquipmentCategory> listEquipCategories = listEquipPrivate(bizOrgCode);
List<EquipmentCategory> treeListByCustom = getTreeListByCustom(bizOrgCode);
listFireCategories.addAll(listEquipCategories);
listFireCategories.addAll(treeListByCustom);
EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(listFireCategories);
equipmentCategory.setCode("-3");
int countAll = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countAll(bizOrgCode) : 0;
equipmentCategory.setName("全部类型" + "(" + countAll + ")");
equipmentCategory.setId(-3L);
equipmentCategory.setHasLowerClassification(true);
result.add(equipmentCategory);
//默认设置两天,新增修改删除数据时清除此缓存
redisUtils.set(EQUIP_AND_FIRE_TREE + bizOrgCode, result, 172800);
return CommonResponseUtil.success(result);
}
/**
* 自定义和重点部位组装
* @return
*/
private List<EquipmentCategory> getTreeListByCustom(String bizOrgCode) {
List<EquipmentCategory> result = new ArrayList<>();
EquipmentCategory equipmentCategory = new EquipmentCategory();
int keyPartsTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByKeyPartsType(bizOrgCode) : 0;
equipmentCategory.setCode("-4");
equipmentCategory.setName("重点部位" + "(" + keyPartsTypeCount + ")");
equipmentCategory.setPatrolNum(keyPartsTypeCount);
equipmentCategory.setId(-4L);
equipmentCategory.setParentId(-3L);
equipmentCategory.setHasLowerClassification(false);
result.add(equipmentCategory);
EquipmentCategory equipmentCategory2 = new EquipmentCategory();
int customTypeCount = StringUtils.isNotEmpty(bizOrgCode) ? equipmentCategoryMapper.countByCustomType(bizOrgCode) : 0;
equipmentCategory2.setCode("-5");
equipmentCategory2.setName("自定义巡查点" + "(" + customTypeCount + ")");
equipmentCategory2.setPatrolNum(customTypeCount);
equipmentCategory2.setId(-5L);
equipmentCategory2.setParentId(-3L);
equipmentCategory2.setHasLowerClassification(false);
result.add(equipmentCategory2);
return result;
}
private List<EquipmentCategory> listFirePrivate(String bizOrgCode) {
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListByFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode));
List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> result = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
equipmentCategorys.forEach(action -> {
String beginName = action.getName();
String subCode = action.getCode().replaceAll("0+$", "");
int count = StringUtils.isNotEmpty(bizOrgCode)? equipmentCategoryMapper.countByFireTypeAndCode(subCode, bizOrgCode) : 0;
action.setName(action.getName() + "(" + count + ")");
action.setCode(action.getCode() + "@");
if (beginName.equals("消防设施") || beginName.equals("消防系统")) {
action.setPatrolNum(count);
action.setParentId(-1L);
list.add(action);
} else {
if (tmpMap.get(action.getParentId().toString()) == null) {
ArrayList<EquipmentCategory> tmplist = new ArrayList<EquipmentCategory>();
tmplist.add(action);
tmpMap.put(action.getParentId().toString(), tmplist);
} else {
if (!tmpMap.get(action.getParentId().toString()).contains(action)) {
tmpMap.get(action.getParentId().toString()).add(action);
}
}
}
});
getChildren(list, tmpMap);
EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(list);
equipmentCategory.setCode("-1");
equipmentCategory.setName("消防设施(" + ((StringUtils.isNotEmpty(bizOrgCode)? equipmentCategoryMapper.countByFacilitiesType(bizOrgCode) : 0) + ")"));
equipmentCategory.setId(-1L);
equipmentCategory.setHasLowerClassification(true);
equipmentCategory.setParentId(-3L);
result.add(equipmentCategory);
return result;
}
private List<EquipmentCategory> listEquipPrivate(String bizOrgCode) {
List<EquipmentCategory> equipmentCategorys = this.iEquipmentCategoryService
.getEquipmentCategoryListNotFacilities(Integer.valueOf(equipmentCategoryLeftTypeCode));
List<EquipmentCategory> list = new ArrayList<>();
List<EquipmentCategory> result = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
equipmentCategorys.forEach(action -> {
String subCode = action.getCode().replaceAll("0+$", "");
int count = StringUtils.isNotEmpty(bizOrgCode)? equipmentCategoryMapper.countByEquipTypeAndCode(subCode, bizOrgCode) : 0;
action.setName(action.getName() + "(" + count + ")");
if (action.getParentId() == null) {
action.setPatrolNum(count);
list.add(action);
} else {
if (tmpMap.get(action.getParentId().toString()) == null) {
ArrayList<EquipmentCategory> tmplist = new ArrayList<EquipmentCategory>();
tmplist.add(action);
tmpMap.put(action.getParentId().toString(), tmplist);
} else {
if (!tmpMap.get(action.getParentId().toString()).contains(action)) {
tmpMap.get(action.getParentId().toString()).add(action);
}
}
}
});
getChildren(list, tmpMap);
EquipmentCategory equipmentCategory = new EquipmentCategory();
equipmentCategory.setChildren(list);
equipmentCategory.setCode("-2");
equipmentCategory.setName("消防装备(" + (StringUtils.isNotEmpty(bizOrgCode)? equipmentCategoryMapper.countByEquipType(bizOrgCode) : 0) + ")");
equipmentCategory.setId(-2L);
equipmentCategory.setHasLowerClassification(true);
equipmentCategory.setParentId(-3L);
result.add(equipmentCategory);
return result;
}
/**
* *
* 获取子节点 * 获取子节点
**/ **/
......
...@@ -62,7 +62,8 @@ public class EquipmentManageController extends AbstractBaseController{ ...@@ -62,7 +62,8 @@ public class EquipmentManageController extends AbstractBaseController{
@RequestParam(value = "controBoxBuildId",required = false) String controBoxBuildId, @RequestParam(value = "controBoxBuildId",required = false) String controBoxBuildId,
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int pageSize, @RequestParam(value = "size") int pageSize,
@RequestParam(value = "companyId") String companyId @RequestParam(value = "companyId") String companyId,
@RequestParam(required = false) String nameOrCode
) { ) {
...@@ -77,7 +78,7 @@ public class EquipmentManageController extends AbstractBaseController{ ...@@ -77,7 +78,7 @@ public class EquipmentManageController extends AbstractBaseController{
companyId = result.get("sequenceNbr").toString(); companyId = result.get("sequenceNbr").toString();
} }
} }
return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize,controBoxBuildId,companyId); return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize,controBoxBuildId,companyId, nameOrCode);
} }
@GetMapping(value = "/getUtils") @GetMapping(value = "/getUtils")
......
...@@ -9,11 +9,13 @@ import com.alibaba.fastjson.JSONObject; ...@@ -9,11 +9,13 @@ import com.alibaba.fastjson.JSONObject;
import com.yeejoin.equipmanage.common.entity.*; import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.utils.SpringUtils; import com.yeejoin.equipmanage.common.utils.SpringUtils;
import com.yeejoin.equipmanage.fegin.JcsFeign; import com.yeejoin.equipmanage.fegin.JcsFeign;
import io.swagger.annotations.ApiParam;
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.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -486,6 +488,12 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -486,6 +488,12 @@ public class FireFightingSystemController extends AbstractBaseController {
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().substring(0, inhierarchy), equipTypeAmountPage); return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().substring(0, inhierarchy), equipTypeAmountPage);
} else { } else {
if (null != equipTypeAmountPage.getIsDefect() && 1 == equipTypeAmountPage.getIsDefect()) {
ReginParams reginParams = getSelectedOrgInfo();
if (StringUtils.isEmpty(equipTypeAmountPage.getBizOrgCode())) {
equipTypeAmountPage.setBizOrgCode(reginParams.getPersonIdentity().getBizOrgCode());
}
}
return fireFightingSystemService.getColaCategoryAmountEquList(0, null, equipTypeAmountPage); return fireFightingSystemService.getColaCategoryAmountEquList(0, null, equipTypeAmountPage);
} }
...@@ -534,8 +542,19 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -534,8 +542,19 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestParam(value = "formGroupId", required = false) String formGroupId, @RequestParam(value = "formGroupId", required = false) String formGroupId,
@RequestParam(value = "controBoxBuildId", required = false) String controBoxBuildId, @RequestParam(value = "controBoxBuildId", required = false) String controBoxBuildId,
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int pageSize, @RequestParam(value = "companyId",required = false) String companyId @RequestParam(value = "size") int pageSize,
@RequestParam(value = "nameOrCode", required = false) String nameOrCode, @RequestParam(value = "companyId",required = false) String companyId,
@ApiParam(value = "缺陷管理新增页面用,其余地方可忽略 1-是缺陷管理 0-不是") @RequestParam(required = false) Integer isDefect
) { ) {
if (null != isDefect && 1 == isDefect) {
ReginParams reginParams = getSelectedOrgInfo();
if (org.apache.commons.lang3.ObjectUtils.isEmpty(reginParams) || org.apache.commons.lang3.ObjectUtils.isEmpty(reginParams.getPersonIdentity()) || StringUtils.isEmpty(reginParams.getPersonIdentity().getBizOrgCode())) {
return new HashMap<>();
}
if (StringUtils.isEmpty(bizOrgCode)) {
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
}
if (current > 0){ if (current > 0){
current = (current - 1) * pageSize; current = (current - 1) * pageSize;
} }
...@@ -550,7 +569,7 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -550,7 +569,7 @@ public class FireFightingSystemController extends AbstractBaseController {
} }
} }
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId, companyId); return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId, companyId, nameOrCode);
} }
/** /**
......
package com.yeejoin.equipmanage.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.service.DutyDetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
/**
* 获取用户信息
*
*/
@RestController
@RequestMapping(value = "/org/user")
@Api(tags = "用户信息api")
public class OrgUserController {
@Autowired
DutyDetailsService dutyDetailsService;
@Autowired
RedisUtils redisUtils;
/**
* 今日值班运维人员列表清单--分页
*
* @return ResponseModel
*/
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "duty-person/page-list")
@ApiOperation(httpMethod = "GET", value = "今日值班运维人员列表清单", notes = "今日值班运维人员列表清单")
public ResponseModel<IPage<Map<String, Object>>> dutyPersonPageList(
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页面大小", required = true) @RequestParam(value = "size") int size) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return ResponseHelper.buildResponse(dutyDetailsService.dutyPersonPageList(current, size, bizOrgCode));
}
}
\ No newline at end of file
package com.yeejoin.equipmanage.fegin;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
/**
* @author DELL
*/
@FeignClient(name = "${idx.feign.name}", path = "idx", configuration = {FeignConfiguration.class})
public interface IdxFeign {
/***
* <pre>
* @Description: 根据告警id查询缺陷治理情况
* </pre>
*
* @MethodName:
* @Param:
* @Return: null
* @Throws
* @Author keyong
* @Date 2022/9/27 17:46
*/
@RequestMapping(value = "/defect/alarm/{alarmLogId}", method = RequestMethod.GET)
ResponseModel<JSONObject> queryDefectByAlarmLogId(@PathVariable String alarmLogId);
}
...@@ -20,8 +20,8 @@ import com.yeejoin.equipmanage.common.entity.AnalysisReportLog; ...@@ -20,8 +20,8 @@ import com.yeejoin.equipmanage.common.entity.AnalysisReportLog;
*/ */
public interface AnalysisReportLogMapper extends BaseMapper<AnalysisReportLog> { public interface AnalysisReportLogMapper extends BaseMapper<AnalysisReportLog> {
IPage<AnalysisReportLogDto> allPage(Page<AnalysisReportLogDto> page, @Param("analysisReportLog")AnalysisReportLogDto analysisReportLog, IPage<AnalysisReportLogDto> allPage(Page<AnalysisReportLogDto> page, @Param("analysisReportLog")AnalysisReportLogDto analysisReportLog
@Param("rootParentId") Long rootParentId); );
Map<String,Object> getStation(String stationCode); Map<String,Object> getStation(String stationCode);
...@@ -30,4 +30,6 @@ public interface AnalysisReportLogMapper extends BaseMapper<AnalysisReportLog> { ...@@ -30,4 +30,6 @@ public interface AnalysisReportLogMapper extends BaseMapper<AnalysisReportLog> {
List<Map<String, Object>> getDefect(@Param("analysisReportLog")AnalysisReportLogDto analysisReportLog); List<Map<String, Object>> getDefect(@Param("analysisReportLog")AnalysisReportLogDto analysisReportLog);
Map<String, Object> getRootOrgUsr(); Map<String, Object> getRootOrgUsr();
IPage<AnalysisReportLogDto> iotReportPage(Page page, @Param("analysisReportLog")AnalysisReportLogDto analysisReportLog);
} }
...@@ -12,7 +12,7 @@ public interface ConfirmAlarmMapper extends BaseMapper<EquipmentSpecificAlarm> { ...@@ -12,7 +12,7 @@ public interface ConfirmAlarmMapper extends BaseMapper<EquipmentSpecificAlarm> {
int confirmAlam(EquipmentSpecificAlarmLog ent); int confirmAlam(EquipmentSpecificAlarmLog ent);
EquipmentSpecificAlarm getIdAndConfirmType(String id); EquipmentSpecificAlarmLog getIdAndConfirmType(String id);
int getFireAlarm(); int getFireAlarm();
......
package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
public interface DutyDetailsMapper {
IPage<Map<String, Object>> selectDutyPersonList(Page page, @Param(value = "dutyDate") String dutyDate, @Param(value = "bizOrgCode") String bizOrgCode);
}
...@@ -57,6 +57,40 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { ...@@ -57,6 +57,40 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head); List<EquipmentCategory> getEquipmentCategoryListByFacilities(Integer head);
int countByFireTypeAndCode(@Param("code") String code, @Param("bizOrgCode") String bizOrgCode);
int countByEquipTypeAndCode(@Param("code") String code, @Param("bizOrgCode") String bizOrgCode);
/**
* 重点部位数量
* @return
*/
int countByKeyPartsType(@Param("bizOrgCode") String bizOrgCode);
/**
* 自定义数量
* @return
*/
int countByCustomType(@Param("bizOrgCode") String bizOrgCode);
/**
* 装备
* @return
*/
int countByEquipType(@Param("bizOrgCode") String bizOrgCode);
/**
* 设施
* @return
*/
int countByFacilitiesType(@Param("bizOrgCode") String bizOrgCode);
/**
* 所有数量
* @return
*/
int countAll(@Param("bizOrgCode") String bizOrgCode);
List<EquipmentCategory> getEquipmentCategoryCarList(); List<EquipmentCategory> getEquipmentCategoryCarList();
List<EquipmentCategory> getEquipmentCategoryEquipmentList(); List<EquipmentCategory> getEquipmentCategoryEquipmentList();
......
...@@ -47,7 +47,14 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> { ...@@ -47,7 +47,14 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> {
* @param parentId * @param parentId
* @return * @return
*/ */
List<Map<String,Object>> querySpecialChildrenList(String parentId); List<Map<String,Object>> querySpecialChildrenList(String parentId, String bizOrgCode);
/**
* 查询指定节点的子
* @param parentId
* @return
*/
List<Map<String,Object>> querySpecialChildrenListByName(String parentId, String bizOrgCode, String name);
/** /**
* 查询指定节点的子 * 查询指定节点的子
......
...@@ -9,6 +9,7 @@ import java.util.concurrent.TimeUnit; ...@@ -9,6 +9,7 @@ import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.component.authtoken.robot.AmosRequestContext;
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.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
...@@ -46,18 +47,15 @@ import com.yeejoin.equipmanage.common.vo.Token; ...@@ -46,18 +47,15 @@ import com.yeejoin.equipmanage.common.vo.Token;
@Service("remoteSecurityService") @Service("remoteSecurityService")
public class RemoteSecurityService { public class RemoteSecurityService {
@Value("${security.password}") @Autowired
AmosRequestContext amosRequestContext;
@Value("${amos.system.user.password}")
private String password; private String password;
@Value("${security.loginId}")
private String loginId;
@Value("${security.productWeb}")
private String productWeb;
@Value("${security.productApp}") @Value("${security.productApp}")
private String productApp; private String productApp;
@Value("${security.appKeyApp}") @Value("${amos.system.user.app-key}")
private String appKeyApp; private String appKeyApp;
@Autowired @Autowired
...@@ -410,15 +408,15 @@ public class RemoteSecurityService { ...@@ -410,15 +408,15 @@ public class RemoteSecurityService {
public Token getServerToken() { public Token getServerToken() {
IdPasswordAuthModel dPasswordAuthModel = new IdPasswordAuthModel(); IdPasswordAuthModel dPasswordAuthModel = new IdPasswordAuthModel();
dPasswordAuthModel.setLoginId(loginId); dPasswordAuthModel.setLoginId(amosRequestContext.getUserName());
dPasswordAuthModel.setPassword(DesUtil.encode(password, "qaz")); dPasswordAuthModel.setPassword(DesUtil.encode(password, "qaz"));
Token toke = null; Token toke = null;
try { try {
toke = JSON.parseObject(this.redisTemplate.opsForValue().get(buildKey(loginId)), Token.class); toke = JSON.parseObject(this.redisTemplate.opsForValue().get(buildKey(amosRequestContext.getUserName())), Token.class);
if (ObjectUtils.isEmpty(toke)) { if (ObjectUtils.isEmpty(toke)) {
toke = getLogin(dPasswordAuthModel); toke = getLogin(dPasswordAuthModel);
} else { } else {
RequestContext.setProduct(productWeb); RequestContext.setProduct(amosRequestContext.getProduct());
if (!redisUtils.refresh(toke.getToke())) { if (!redisUtils.refresh(toke.getToke())) {
toke = getLogin(dPasswordAuthModel); toke = getLogin(dPasswordAuthModel);
} }
...@@ -436,15 +434,11 @@ public class RemoteSecurityService { ...@@ -436,15 +434,11 @@ public class RemoteSecurityService {
private Token getLogin(IdPasswordAuthModel dPasswordAuthModel) { private Token getLogin(IdPasswordAuthModel dPasswordAuthModel) {
Token toke = new Token(); Token toke = new Token();
RequestContext.setProduct(productWeb); RequestContext.setProduct(amosRequestContext.getProduct());
FeignClientResult feignClientResult = Privilege.authClient.idpassword(dPasswordAuthModel); toke.setToke(amosRequestContext.getToken());
Map map = (Map) feignClientResult.getResult(); toke.setProduct(amosRequestContext.getProduct());
if (map != null) { toke.setAppKey(amosRequestContext.getAppKey());
toke.setToke(map.get("token").toString()); redisTemplate.opsForValue().set(buildKey(dPasswordAuthModel.getLoginId()), JSONObject.toJSONString(toke), 28, TimeUnit.DAYS);
toke.setProduct(productWeb);
toke.setAppKey(appKeyApp);
redisTemplate.opsForValue().set(buildKey(dPasswordAuthModel.getLoginId()), JSONObject.toJSONString(toke), 28, TimeUnit.DAYS);
}
return toke; return toke;
} }
} }
package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.Map;
/**
* 服务类
*
*/
public interface DutyDetailsService {
IPage<Map<String, Object>> dutyPersonPageList(int current, int size, String bizOrgCode);
}
...@@ -27,7 +27,7 @@ public interface EquipmentManageService extends IService<EquipmentManageEntity> ...@@ -27,7 +27,7 @@ public interface EquipmentManageService extends IService<EquipmentManageEntity>
* @param pageSize * @param pageSize
* @return * @return
*/ */
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String controBoxBuildId,String companyId); Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String controBoxBuildId,String companyId, String nameOrCode);
/** /**
* 获取下拉菜单数据 * 获取下拉菜单数据
......
...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.service; ...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto;
import com.yeejoin.equipmanage.common.entity.AnalysisReportLog; import com.yeejoin.equipmanage.common.entity.AnalysisReportLog;
import com.yeejoin.equipmanage.common.enums.AnalysisReportEnum; import com.yeejoin.equipmanage.common.enums.AnalysisReportEnum;
...@@ -35,4 +36,13 @@ public interface IAnalysisReportLogService extends IService<AnalysisReportLog> { ...@@ -35,4 +36,13 @@ public interface IAnalysisReportLogService extends IService<AnalysisReportLog> {
* @param endDate 结束日期 * @param endDate 结束日期
*/ */
void generateMonthReport(AnalysisReportEnum monthReport, Date beginDate, Date endDate) throws ParseException; void generateMonthReport(AnalysisReportEnum monthReport, Date beginDate, Date endDate) throws ParseException;
/**
* 消防物联报表列表分页查询
* @param page
* @param dto
* @return
*/
IPage<AnalysisReportLogDto> iotReportPage (Page page, AnalysisReportLogDto dto);
} }
...@@ -74,7 +74,7 @@ public interface IBuilldService extends IService<Building> { ...@@ -74,7 +74,7 @@ public interface IBuilldService extends IService<Building> {
* *
* @return List<BuildingTreeVo> * @return List<BuildingTreeVo>
*/ */
List<BuildingTreeVo> getBuildingTree(); List<BuildingTreeVo> getBuildingTree(String bizOrgCode);
/** /**
* 消防建筑树查询接口(带条件bizOrgCode) * 消防建筑树查询接口(带条件bizOrgCode)
...@@ -346,4 +346,6 @@ public interface IBuilldService extends IService<Building> { ...@@ -346,4 +346,6 @@ public interface IBuilldService extends IService<Building> {
List<BuildingTreeVo> getBuildingTreeInMyOrgCodeList(String bizOrgCode); List<BuildingTreeVo> getBuildingTreeInMyOrgCodeList(String bizOrgCode);
List<OrgMenuDto> companyTreeByUserAndType(); List<OrgMenuDto> companyTreeByUserAndType();
List<BuildingTreeVo> treeByName(String bizOrgCode, String name);
} }
...@@ -40,7 +40,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -40,7 +40,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param pageSize * @param pageSize
* @return * @return
*/ */
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyId); Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyId, String nameOrCode);
FireFightingSystemEntity getOneById(Long id); FireFightingSystemEntity getOneById(Long id);
......
...@@ -70,7 +70,7 @@ public interface IFormInstanceService extends IService<FormInstance> { ...@@ -70,7 +70,7 @@ public interface IFormInstanceService extends IService<FormInstance> {
* @param parentId 父节点 * @param parentId 父节点
* @return List<Map < String, Object>> * @return List<Map < String, Object>>
*/ */
List<Map<String, Object>> getSpecialChildrenList(String parentId); List<Map<String, Object>> getSpecialChildrenList(String parentId, String bizOrgCode);
/** /**
* 查询指定节点的下降 * 查询指定节点的下降
...@@ -164,4 +164,12 @@ public interface IFormInstanceService extends IService<FormInstance> { ...@@ -164,4 +164,12 @@ public interface IFormInstanceService extends IService<FormInstance> {
List<UnitAreaTreeVo> getValueByColumn(Long instanceId, String bizOrgcode); List<UnitAreaTreeVo> getValueByColumn(Long instanceId, String bizOrgcode);
List<Map<String, Long>> getBuildVideoCount(); List<Map<String, Long>> getBuildVideoCount();
/**
* 查询指定节点的下降
*
* @param parentId 父节点
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> getSpecialChildrenListByName(String parentId, String bizOrgCode, String name);
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.dto.AnalysisReportLogDto;
import com.yeejoin.equipmanage.common.entity.AnalysisReportLog; import com.yeejoin.equipmanage.common.entity.AnalysisReportLog;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity; import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity; import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
...@@ -39,6 +40,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM ...@@ -39,6 +40,8 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM
@Autowired @Autowired
AnalysisReportSummaryMapper analysisReportSummaryMapper; AnalysisReportSummaryMapper analysisReportSummaryMapper;
@Autowired
AnalysisReportLogMapper analysisReportLogMapper;
@Override @Override
public IPage<AnalysisReportLog> listPage(Page page, AnalysisReportLog analysisReportLog) { public IPage<AnalysisReportLog> listPage(Page page, AnalysisReportLog analysisReportLog) {
...@@ -127,4 +130,9 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM ...@@ -127,4 +130,9 @@ public class AnalysisReportLogServiceImpl extends ServiceImpl<AnalysisReportLogM
} }
return desc.toString(); return desc.toString();
} }
@Override
public IPage<AnalysisReportLogDto> iotReportPage(Page page, AnalysisReportLogDto dto) {
return analysisReportLogMapper.iotReportPage(page, dto);
}
} }
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.thoughtworks.xstream.mapper.Mapper;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto; import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
...@@ -270,7 +271,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA ...@@ -270,7 +271,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
vo.setType("area"); vo.setType("area");
vo.setBizOrgCode(area.getBizOrgCode()); vo.setBizOrgCode(area.getBizOrgCode());
vo.setBizOrgName(area.getBizOrgName()); vo.setBizOrgName(area.getBizOrgName());
vo.setParentId(area.getParentId().equals(0L) ? orgMap.get(area.getBizOrgCode()) : area.getParentId()); vo.setParentId(Objects.isNull(area.getParentId()) || area.getParentId().equals(0L) ? orgMap.get(area.getBizOrgCode()) : area.getParentId());
return vo; return vo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
orgTreeList.addAll(areaTreeVoList); orgTreeList.addAll(areaTreeVoList);
......
...@@ -452,8 +452,20 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -452,8 +452,20 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
} }
@Override @Override
public List<BuildingTreeVo> getBuildingTree(String bizOrgCode) {
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true, bizOrgCode);
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
t.setChildren(this.getChildren(t.getInstanceId(), allListVo));
t.setDetailPaneApi(address);
t.setApiUrl(apiUrl);
return t;
}).collect(Collectors.toList());
}
public List<BuildingTreeVo> getBuildingTree() { public List<BuildingTreeVo> getBuildingTree() {
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true); List<BuildingTreeVo> allListVo = getBuildingTreeVos(true, null);
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> { return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo(); BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t); Bean.copyExistPropertis(s, t);
...@@ -488,12 +500,12 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -488,12 +500,12 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override @Override
public List<Map<String, Object>> getBuildingDetaiList() { public List<Map<String, Object>> getBuildingDetaiList() {
return iFormInstanceService.getSpecialChildrenList(null); return iFormInstanceService.getSpecialChildrenList(null, null);
} }
private List<BuildingTreeVo> getBuildingTreeVos(Boolean isContainRootNode) { private List<BuildingTreeVo> getBuildingTreeVos(Boolean isContainRootNode, String bizOrgCode) {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode()); FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null); List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, bizOrgCode);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, isContainRootNode); List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, isContainRootNode);
Map<Long, String> absolutePositionMap = getBuildingAbsolutePosition(allListVo); Map<Long, String> absolutePositionMap = getBuildingAbsolutePosition(allListVo);
allListVo.forEach(s -> s.setAbsolutePosition(absolutePositionMap.get(s.getId()))); allListVo.forEach(s -> s.setAbsolutePosition(absolutePositionMap.get(s.getId())));
...@@ -505,7 +517,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -505,7 +517,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override @Override
public List<BuildingTreeVo> getBuildingTierTree(Integer tier) { public List<BuildingTreeVo> getBuildingTierTree(Integer tier) {
if (tier != null) { if (tier != null) {
List<BuildingTreeVo> list = getBuildingTreeVos(true); List<BuildingTreeVo> list = getBuildingTreeVos(true, null);
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
if (tier == 1) { if (tier == 1) {
List<BuildingTreeVo> collect = list.stream().filter(x -> "-1".equals(x.getParentId()) || "building".equalsIgnoreCase(x.getGroupType())).collect(Collectors.toList()); List<BuildingTreeVo> collect = list.stream().filter(x -> "-1".equals(x.getParentId()) || "building".equalsIgnoreCase(x.getGroupType())).collect(Collectors.toList());
...@@ -1217,7 +1229,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1217,7 +1229,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override @Override
public Map<Long, String> getBuildingAbsolutePosition() { public Map<Long, String> getBuildingAbsolutePosition() {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode()); FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null); List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, true); List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, true);
return getBuildingAbsolutePosition(allListVo); return getBuildingAbsolutePosition(allListVo);
} }
...@@ -1225,7 +1237,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1225,7 +1237,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override @Override
public Map<String, Long> getBuildingCodeKey() { public Map<String, Long> getBuildingCodeKey() {
Map<String, Long> resMap = new HashMap<>(); Map<String, Long> resMap = new HashMap<>();
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null); List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
if (!allList.isEmpty()) { if (!allList.isEmpty()) {
allList.forEach(map -> resMap.put(String.valueOf(map.get("code")), Long.valueOf(String.valueOf(map.get("id"))))); allList.forEach(map -> resMap.put(String.valueOf(map.get("code")), Long.valueOf(String.valueOf(map.get("id")))));
} }
...@@ -1387,7 +1399,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1387,7 +1399,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
if (StringUtils.isEmpty(authKey)) { if (StringUtils.isEmpty(authKey)) {
authKey = this.authKey; authKey = this.authKey;
} }
List<BuildingTreeVo> buildingTreeVos = getBuildingTreeVos(false); List<BuildingTreeVo> buildingTreeVos = getBuildingTreeVos(false, null);
// 1.获取公司list // 1.获取公司list
List<OrgUsrDto> orgUsrLists = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "COMPANY"); List<OrgUsrDto> orgUsrLists = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "COMPANY");
if(orgUsrLists.isEmpty()){ if(orgUsrLists.isEmpty()){
...@@ -1537,7 +1549,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1537,7 +1549,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
//如果传递的为部门bizOrgCode 取其上级单位下的建筑 //如果传递的为部门bizOrgCode 取其上级单位下的建筑
// ResponseModel<OrgUsrDto> companyByBizOrgCodeList = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode); // ResponseModel<OrgUsrDto> companyByBizOrgCodeList = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode);
// String resultCode = companyByBizOrgCodeList.getResult().getBizOrgCode(); // String resultCode = companyByBizOrgCodeList.getResult().getBizOrgCode();
List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true); List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true, null);
List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().contains(bizOrgCode)).collect(Collectors.toList()); List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().contains(bizOrgCode)).collect(Collectors.toList());
return buildingTreeVos.stream().filter(b -> "-1".equals(b.getParentId())).peek(b -> { return buildingTreeVos.stream().filter(b -> "-1".equals(b.getParentId())).peek(b -> {
b.setId(0L); b.setId(0L);
...@@ -1550,7 +1562,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1550,7 +1562,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
//如果传递的为部门bizOrgCode 取其上级单位下的建筑 //如果传递的为部门bizOrgCode 取其上级单位下的建筑
ResponseModel<OrgUsrDto> companyByBizOrgCodeList = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode); ResponseModel<OrgUsrDto> companyByBizOrgCodeList = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode);
String companyCode = companyByBizOrgCodeList.getResult().getBizOrgCode(); String companyCode = companyByBizOrgCodeList.getResult().getBizOrgCode();
List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true); List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true, bizOrgCode);
List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().startsWith(companyCode)).collect(Collectors.toList()); List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().startsWith(companyCode)).collect(Collectors.toList());
...@@ -1565,7 +1577,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1565,7 +1577,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
//如果传递的为部门bizOrgCode 取其上级单位下的建筑 //如果传递的为部门bizOrgCode 取其上级单位下的建筑
ResponseModel<OrgUsrDto> companyByBizOrgCodeList = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode); ResponseModel<OrgUsrDto> companyByBizOrgCodeList = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode);
String companyCode = companyByBizOrgCodeList.getResult().getBizOrgCode(); String companyCode = companyByBizOrgCodeList.getResult().getBizOrgCode();
List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true); List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true, bizOrgCode);
List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().startsWith(companyCode)).collect(Collectors.toList()); List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().startsWith(companyCode)).collect(Collectors.toList());
return orgBuildingTreeVos; return orgBuildingTreeVos;
} }
...@@ -1580,4 +1592,26 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1580,4 +1592,26 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
a.setChildren(getCompanyBuildingChildrenTree(a.getId().toString(), all)); a.setChildren(getCompanyBuildingChildrenTree(a.getId().toString(), all));
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@Override
public List<BuildingTreeVo> treeByName(String bizOrgCode, String name) {
List<BuildingTreeVo> allListVo = getBuildingTreeVosByName(true, bizOrgCode, name);
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
t.setChildren(this.getChildren(t.getInstanceId(), allListVo));
t.setDetailPaneApi(address);
t.setApiUrl(apiUrl);
return t;
}).collect(Collectors.toList());
}
private List<BuildingTreeVo> getBuildingTreeVosByName(Boolean isContainRootNode, String bizOrgCode, String name) {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenListByName(null, bizOrgCode, name);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, isContainRootNode);
Map<Long, String> absolutePositionMap = getBuildingAbsolutePosition(allListVo);
allListVo.forEach(s -> s.setAbsolutePosition(absolutePositionMap.get(s.getId())));
return allListVo;
}
} }
...@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.IotSystemAlarmRo; import com.yeejoin.amos.boot.module.jcs.api.dto.IotSystemAlarmRo;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.dto.UserDto;
import com.yeejoin.equipmanage.common.entity.*; import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO; import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO;
import com.yeejoin.equipmanage.common.enums.*; import com.yeejoin.equipmanage.common.enums.*;
...@@ -23,6 +22,7 @@ import com.yeejoin.equipmanage.remote.WebMqttHandler; ...@@ -23,6 +22,7 @@ import com.yeejoin.equipmanage.remote.WebMqttHandler;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
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.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
...@@ -39,16 +39,24 @@ import java.util.*; ...@@ -39,16 +39,24 @@ import java.util.*;
@Service @Service
public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, EquipmentSpecificAlarm> implements IConfirmAlarmService { public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, EquipmentSpecificAlarm> implements IConfirmAlarmService {
private static final org.slf4j.Logger log = LoggerFactory.getLogger(ConfirmAlarmServiceImpl.class);
private final static String FIELD_NAME = "longitude,latitude"; private final static String FIELD_NAME = "longitude,latitude";
@Autowired @Autowired
private RemoteSecurityService remoteSecurityService; private RemoteSecurityService remoteSecurityService;
static ConfirmAlarmMapper confirmAlarmMapper;
@Autowired @Autowired
ConfirmAlarmMapper confirmAlarmMapper; public void setConfirmAlarmMapper(ConfirmAlarmMapper confirmAlarmMapper){
ConfirmAlarmServiceImpl.confirmAlarmMapper = confirmAlarmMapper;
}
private static JcsFeign jcsFeign;
@Autowired @Autowired
private JcsFeign jcsFeign; public void setJcsFeign(JcsFeign jcsFeign){
ConfirmAlarmServiceImpl.jcsFeign = jcsFeign;
}
@Autowired @Autowired
VideoMapper videoMapper; VideoMapper videoMapper;
...@@ -66,9 +74,12 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -66,9 +74,12 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Autowired @Autowired
private IEquipmentSpecificAlarmLogService equipmentSpecificAlarmLogService; private IEquipmentSpecificAlarmLogService equipmentSpecificAlarmLogService;
private static IEquipmentSpecificSerivce equipmentSpecificSerivce;
@Autowired @Autowired
@Lazy @Lazy
private IEquipmentSpecificSerivce equipmentSpecificSerivce; public void setIEquipmentSpecificIndexSerivce(IEquipmentSpecificSerivce equipmentSpecificSerivce){
ConfirmAlarmServiceImpl.equipmentSpecificSerivce = equipmentSpecificSerivce;
}
@Autowired @Autowired
private IEquipmentSpecificIndexSerivce iEquipmentSpecificIndexSerivce; private IEquipmentSpecificIndexSerivce iEquipmentSpecificIndexSerivce;
...@@ -88,8 +99,11 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -88,8 +99,11 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Autowired @Autowired
private SystemctlFeign systemctlFeign; private SystemctlFeign systemctlFeign;
private static RuleConfirmAlarmService ruleConfirmAlamService;
@Autowired @Autowired
private RuleConfirmAlarmService ruleConfirmAlamService; public void setRuleConfirmAlamService(RuleConfirmAlarmService ruleConfirmAlamService){
ConfirmAlarmServiceImpl.ruleConfirmAlamService = ruleConfirmAlamService;
}
@Autowired @Autowired
private EquipmentSpecificMapper equipmentSpecificMapper; private EquipmentSpecificMapper equipmentSpecificMapper;
...@@ -103,8 +117,11 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -103,8 +117,11 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Autowired @Autowired
private ISignalClassifyService signalClassifyService; private ISignalClassifyService signalClassifyService;
private static IFormInstanceService instanceService;
@Autowired @Autowired
private IFormInstanceService instanceService; public void setInstanceService(IFormInstanceService instanceService){
ConfirmAlarmServiceImpl.instanceService = instanceService;
}
@Autowired @Autowired
private SourceSceneMapper sourceSceneMapper; private SourceSceneMapper sourceSceneMapper;
...@@ -191,7 +208,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -191,7 +208,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
set(EquipmentSpecific::getRealtimeIotIndexUpdateDate,new Date()). set(EquipmentSpecific::getRealtimeIotIndexUpdateDate,new Date()).
eq(EquipmentSpecific::getId,alarm.getEquipmentSpecificId()); eq(EquipmentSpecific::getId,alarm.getEquipmentSpecificId());
equipmentSpecificSerivce.update(wrapper); equipmentSpecificSerivce.update(wrapper);
MqttReceiveServiceImpl.upAlarmLogStatus(alarmLog.getIotCode(), alarmLog.getEquipmentSpecificIndexKey(), null, equipmentSpecificAlarmLogService); MqttReceiveServiceImpl.upAlarmLogStatus(alarmLog.getIotCode(), alarmLog.getEquipmentSpecificIndexKey(), null, equipmentSpecificAlarmLogService, true);
} }
// 如果是批量确警,先查询,再确警,用于批量消息推送 // 如果是批量确警,先查询,再确警,用于批量消息推送
isBatch = ent.getIsBatch(); isBatch = ent.getIsBatch();
...@@ -387,7 +404,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -387,7 +404,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
//查询当前建筑是否是 最顶级建筑 //查询当前建筑是否是 最顶级建筑
public List<FormInstance> selectBuildingById(List<FormInstance> formInstances){ public static List<FormInstance> selectBuildingById(List<FormInstance> formInstances){
if (formInstances.get(0).getGroupType().equals("building")){ if (formInstances.get(0).getGroupType().equals("building")){
return formInstances; return formInstances;
} }
...@@ -404,7 +421,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -404,7 +421,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
} }
public void sendIotSystemAlarm(EquipmentSpecificAlarmLog ent, String userId, String appKey, String product, String token){ public static void sendIotSystemAlarm(EquipmentSpecificAlarmLog ent, String userId, String appKey, String product, String token){
// Token serverToken = remoteSecurityService.getServerToken(); // Token serverToken = remoteSecurityService.getServerToken();
IotSystemAlarmRo confirmAlamVo = new IotSystemAlarmRo(); IotSystemAlarmRo confirmAlamVo = new IotSystemAlarmRo();
confirmAlamVo.setId(ent.getId()); confirmAlamVo.setId(ent.getId());
......
...@@ -72,7 +72,7 @@ public class DownloadFileService implements IDownloadFileService { ...@@ -72,7 +72,7 @@ public class DownloadFileService implements IDownloadFileService {
//建筑信息 //建筑信息
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode()); FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null); List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList); List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList);
appDownload.setBuildTree(allListVo); appDownload.setBuildTree(allListVo);
......
package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.mapper.DutyDetailsMapper;
import com.yeejoin.equipmanage.service.DutyDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
@Service
public class DutyDetailsImpl implements DutyDetailsService {
@Autowired
private DutyDetailsMapper dutyDetailsMapper;
@Autowired
RedisUtils redisUtils;
@Override
public IPage<Map<String, Object>> dutyPersonPageList(int current, int size,String bizOrgCode) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String dutyDate = sdf.format(new Date());
Page page = new Page();
if (current > 0){
page.setCurrent((long) (current - 1) *size);
page.setSize(size);
}
return dutyDetailsMapper.selectDutyPersonList(page, dutyDate, bizOrgCode);
}
}
...@@ -56,7 +56,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe ...@@ -56,7 +56,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
@Override @Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance,
String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyCode) { String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyCode, String nameOrCode) {
HttpServletRequest request = null; HttpServletRequest request = null;
Map map = new HashMap<String, Object>(); Map map = new HashMap<String, Object>();
map.put("equimentName", equimentName); map.put("equimentName", equimentName);
...@@ -69,11 +69,14 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe ...@@ -69,11 +69,14 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
map.put("companyCode", companyCode); map.put("companyCode", companyCode);
map.put("formGroupId", formGroupId); map.put("formGroupId", formGroupId);
map.put("controBoxBuildId",controBoxBuildId); map.put("controBoxBuildId",controBoxBuildId);
map.put("nameOrCode", nameOrCode);
List<EquipmentManageVo> dataList = equipmentManageMapper.queryEquipmenInfo(map); List<EquipmentManageVo> dataList = equipmentManageMapper.queryEquipmenInfo(map);
Long count = equipmentManageMapper.queryEquipmenCount(map); Long count = equipmentManageMapper.queryEquipmenCount(map);
map.clear(); map.clear();
map.put("dataList", dataList); map.put("dataList", dataList);
map.put("count", count); map.put("count", count);
map.put("current", current);
map.put("pageSize", pageSize);
return map; return map;
} }
......
...@@ -371,8 +371,8 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService { ...@@ -371,8 +371,8 @@ public class FilePatrolReportServiceImpl implements IFirePatrolReportService {
analysisReportLog.setEndDate(endDate); analysisReportLog.setEndDate(endDate);
analysisReportLog.setReportType(reportType); analysisReportLog.setReportType(reportType);
analysisReportLog.setStationCode(stationCode); analysisReportLog.setStationCode(stationCode);
Long rootParentId = Long.valueOf(String.valueOf(analysisReportLogMapper.getRootOrgUsr().get("sequence_nbr"))); //Long rootParentId = Long.valueOf(String.valueOf(analysisReportLogMapper.getRootOrgUsr().get("sequence_nbr")));
return analysisReportLogMapper.allPage(page, analysisReportLog, rootParentId); return analysisReportLogMapper.allPage(page, analysisReportLog);
} }
@Override @Override
......
...@@ -250,8 +250,8 @@ public class FireAutoSysManageReportServiceImpl implements IFireAutoSysManageRep ...@@ -250,8 +250,8 @@ public class FireAutoSysManageReportServiceImpl implements IFireAutoSysManageRep
analysisReportLog.setEndDate(endDate); analysisReportLog.setEndDate(endDate);
analysisReportLog.setReportType(reportType); analysisReportLog.setReportType(reportType);
analysisReportLog.setStationCode(stationCode); analysisReportLog.setStationCode(stationCode);
Long rootParentId = Long.valueOf(String.valueOf(analysisReportLogMapper.getRootOrgUsr().get("sequence_nbr"))); //Long rootParentId = Long.valueOf(String.valueOf(analysisReportLogMapper.getRootOrgUsr().get("sequence_nbr")));
return analysisReportLogMapper.allPage(page, analysisReportLog, rootParentId); return analysisReportLogMapper.allPage(page, analysisReportLog);
} }
@Override @Override
......
...@@ -163,9 +163,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -163,9 +163,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override @Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction,
String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyId) { String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize, String controBoxBuildId,String companyId, String nameOrCode) {
Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode, Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode,
construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId, companyId); construction, maintenance, bizOrgCode, formGroupId, current, pageSize, controBoxBuildId, companyId, nameOrCode);
List<EquipmentManageVo> dataList = (List<EquipmentManageVo>) map.get("dataList"); List<EquipmentManageVo> dataList = (List<EquipmentManageVo>) map.get("dataList");
StringBuilder stb = new StringBuilder(); StringBuilder stb = new StringBuilder();
dataList.forEach(y -> { dataList.forEach(y -> {
......
...@@ -432,8 +432,8 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For ...@@ -432,8 +432,8 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For
} }
@Override @Override
public List<Map<String, Object>> getSpecialChildrenList(String parentId) { public List<Map<String, Object>> getSpecialChildrenList(String parentId, String bizOrgCode) {
return this.baseMapper.querySpecialChildrenList(parentId); return this.baseMapper.querySpecialChildrenList(parentId, bizOrgCode);
} }
@Override @Override
...@@ -559,4 +559,9 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For ...@@ -559,4 +559,9 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For
public List<Map<String, Long>> getBuildVideoCount() { public List<Map<String, Long>> getBuildVideoCount() {
return formInstanceMapper.getBuildVideoCount(); return formInstanceMapper.getBuildVideoCount();
} }
@Override
public List<Map<String, Object>> getSpecialChildrenListByName(String parentId, String bizOrgCode, String name) {
return this.baseMapper.querySpecialChildrenListByName(parentId, bizOrgCode, name);
}
} }
...@@ -15,6 +15,7 @@ import java.util.stream.Collectors; ...@@ -15,6 +15,7 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.equipmanage.common.entity.*;
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.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
...@@ -34,11 +35,6 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult; ...@@ -34,11 +35,6 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSystemSourceStatistics;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentStateVo; import com.yeejoin.equipmanage.common.entity.vo.EquipmentStateVo;
import com.yeejoin.equipmanage.common.entity.vo.MainIotMonitorItemContentVo; import com.yeejoin.equipmanage.common.entity.vo.MainIotMonitorItemContentVo;
import com.yeejoin.equipmanage.common.entity.vo.MainIotMonitorItemVo; import com.yeejoin.equipmanage.common.entity.vo.MainIotMonitorItemVo;
...@@ -264,7 +260,7 @@ public class MainIotMonitorServiceImpl implements IMainIotMonitorSerivce { ...@@ -264,7 +260,7 @@ public class MainIotMonitorServiceImpl implements IMainIotMonitorSerivce {
type = EquipmentStateEnum.PB.getType(); type = EquipmentStateEnum.PB.getType();
statusType = "shield"; statusType = "shield";
} }
EquipmentSpecificAlarm idvo = confirmAlarmMapper.getIdAndConfirmType(id); EquipmentSpecificAlarmLog idvo = confirmAlarmMapper.getIdAndConfirmType(id);
Date time = new Date(); Date time = new Date();
if (idvo != null && idvo.getId() != null){ if (idvo != null && idvo.getId() != null){
itemVo.setAlamId(idvo.getId().toString()); itemVo.setAlamId(idvo.getId().toString());
...@@ -327,7 +323,7 @@ public class MainIotMonitorServiceImpl implements IMainIotMonitorSerivce { ...@@ -327,7 +323,7 @@ public class MainIotMonitorServiceImpl implements IMainIotMonitorSerivce {
String equSystemId = jsonObj.getString("systemId"); String equSystemId = jsonObj.getString("systemId");
/* 设备id */ /* 设备id */
String speId = jsonObj.getString("speId"); String speId = jsonObj.getString("speId");
EquipmentSpecificAlarm idvo = confirmAlarmMapper.getIdAndConfirmType(speId); EquipmentSpecificAlarmLog idvo = confirmAlarmMapper.getIdAndConfirmType(speId);
if (systemId.equals(equSystemId) && StringUtil.isNotEmpty(speId)) { if (systemId.equals(equSystemId) && StringUtil.isNotEmpty(speId)) {
/* 设备名称 */ /* 设备名称 */
String speName = jsonObj.getString("speName"); String speName = jsonObj.getString("speName");
......
...@@ -57,8 +57,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -57,8 +57,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private static Map<String, TemperatureAlarmDto> temperatureMap = new HashMap<>(); private static Map<String, TemperatureAlarmDto> temperatureMap = new HashMap<>();
static IEquipmentSpecificIndexService equipmentSpecificIndexService;
@Autowired @Autowired
IEquipmentSpecificIndexService equipmentSpecificIndexService; public void setEquipmentSpecificIndexService(IEquipmentSpecificIndexService equipmentSpecificIndexService){
MqttReceiveServiceImpl.equipmentSpecificIndexService = equipmentSpecificIndexService;
}
@Autowired @Autowired
ICarPropertyService carPropertyService; ICarPropertyService carPropertyService;
...@@ -82,17 +85,27 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -82,17 +85,27 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Autowired @Autowired
EquipmentSpecificIndexMapper equipmentSpecificIndexMapper; EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
static EquipmentSpecificMapper equipmentSpecificMapper;
@Autowired @Autowired
EquipmentSpecificMapper equipmentSpecificMapper; public void setEquipmentSpecificMapper(EquipmentSpecificMapper equipmentSpecificMapper){
MqttReceiveServiceImpl.equipmentSpecificMapper = equipmentSpecificMapper;
}
@Autowired @Autowired
FireFightingSystemMapper FireFightingSystemMapper; FireFightingSystemMapper FireFightingSystemMapper;
static IFireFightingSystemService fireFightingSystemService;
@Autowired @Autowired
IFireFightingSystemService fireFightingSystemService; public void setFireFightingSystemService(IFireFightingSystemService fireFightingSystemService){
MqttReceiveServiceImpl.fireFightingSystemService = fireFightingSystemService;
}
static MqttSendGateway mqttSendGateway;
@Autowired @Autowired
MqttSendGateway mqttSendGateway; public void setMqttSendGateway(MqttSendGateway mqttSendGateway){
MqttReceiveServiceImpl.mqttSendGateway = mqttSendGateway;
}
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
...@@ -118,8 +131,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -118,8 +131,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Autowired @Autowired
private SystemctlFeign systemctlFeign; private SystemctlFeign systemctlFeign;
private static RemoteSecurityService remoteSecurityService;
@Autowired @Autowired
private RemoteSecurityService remoteSecurityService; public void setRemoteSecurityService(RemoteSecurityService remoteSecurityService){
MqttReceiveServiceImpl.remoteSecurityService = remoteSecurityService;
}
@Autowired @Autowired
private TopographyService topographyService; private TopographyService topographyService;
...@@ -133,8 +149,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -133,8 +149,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${mqtt.vehicle.topic}") @Value("${mqtt.vehicle.topic}")
private String carTopic; private String carTopic;
private static String canvasTopic;
@Value("${equip.point.equipmentdata.topic}") @Value("${equip.point.equipmentdata.topic}")
private String canvasTopic; public void setCanvasTopic(String canvasTopic){
MqttReceiveServiceImpl.canvasTopic = canvasTopic;
}
@Value("${equip.index.topic}") @Value("${equip.index.topic}")
private String indexTopic; private String indexTopic;
...@@ -154,6 +173,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -154,6 +173,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${isSendIot:false}") @Value("${isSendIot:false}")
private Boolean isSendIot; private Boolean isSendIot;
private static Boolean jcsSwitch;
@Value("${systemctl.jcs.switch}")
public void setJcsSwitch(Boolean jcsSwitch){
MqttReceiveServiceImpl.jcsSwitch = jcsSwitch;
}
private static Boolean bool = Boolean.FALSE; private static Boolean bool = Boolean.FALSE;
@Override @Override
...@@ -308,7 +333,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -308,7 +333,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
mqttSendGateway.sendToMqtt(TopicEnum.EQDQR.getTopic(), JSONArray.toJSON(action).toString()); mqttSendGateway.sendToMqtt(TopicEnum.EQDQR.getTopic(), JSONArray.toJSON(action).toString());
} else { } else {
alarmLogs.addAll(upAlarmLogStatus(action.getIotCode(), action.getEquipmentSpecificIndexKey(), action.getTraceId(), alarmLogs.addAll(upAlarmLogStatus(action.getIotCode(), action.getEquipmentSpecificIndexKey(), action.getTraceId(),
equipmentSpecificAlarmLogService)); equipmentSpecificAlarmLogService, false));
mqttSendGateway.sendToMqtt(TopicEnum.EQYQR.getTopic(), JSONArray.toJSON(action).toString()); mqttSendGateway.sendToMqtt(TopicEnum.EQYQR.getTopic(), JSONArray.toJSON(action).toString());
bool = Boolean.TRUE; bool = Boolean.TRUE;
} }
...@@ -386,23 +411,69 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -386,23 +411,69 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
public static List<EquipmentSpecificAlarmLog> upAlarmLogStatus(String iotCode, String equipmentSpecificIndexKey, public static List<EquipmentSpecificAlarmLog> upAlarmLogStatus(String iotCode, String equipmentSpecificIndexKey,
String traceId, IEquipmentSpecificAlarmLogService equipmentSpecificAlarmLogService) { String traceId, IEquipmentSpecificAlarmLogService equipmentSpecificAlarmLogService, boolean flag) {
LambdaQueryWrapper<EquipmentSpecificAlarmLog> queryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<EquipmentSpecificAlarmLog> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(EquipmentSpecificAlarmLog::getIotCode, iotCode); queryWrapper.eq(EquipmentSpecificAlarmLog::getIotCode, iotCode);
queryWrapper.eq(EquipmentSpecificAlarmLog::getEquipmentSpecificIndexKey, equipmentSpecificIndexKey); queryWrapper.eq(EquipmentSpecificAlarmLog::getEquipmentSpecificIndexKey, equipmentSpecificIndexKey);
queryWrapper.ne(EquipmentSpecificAlarmLog::getStatus, AlarmStatusEnum.HF.getCode()); queryWrapper.ne(EquipmentSpecificAlarmLog::getStatus, AlarmStatusEnum.HF.getCode());
List<EquipmentSpecificAlarmLog> logs = equipmentSpecificAlarmLogService.getBaseMapper() List<EquipmentSpecificAlarmLog> logs = equipmentSpecificAlarmLogService.getBaseMapper()
.selectList(queryWrapper); .selectList(queryWrapper);
logs.forEach(x -> { if (0 < logs.size()) {
x.setCleanTime(new Date()); EquipmentSpecificAlarmLog log = logs.get(0);
x.setStatus(AlarmStatusEnum.HF.getCode()); String cleanType = equipmentSpecificMapper.getEquipmentBySpecificId(log.getEquipmentSpecificId());
if (!StringUtils.isEmpty(traceId)) { EquipmentSpecific specific = equipmentSpecificMapper.selectById(log.getEquipmentSpecificId());
x.setTraceId(traceId); Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(date);
logs.forEach(x -> {
x.setCleanTime(new Date());
x.setStatus(AlarmStatusEnum.HF.getCode());
x.setEquipmentSpecificIndexValue(TrueOrFalseEnum.fake.value);
if (!StringUtils.isEmpty(traceId)) {
x.setTraceId(traceId);
}
// 自动确警处理
if (StringUtil.isNotEmpty(cleanType) && AlarmCleanTypeEnum.ZDXC.getCode().equals(cleanType)){
x.setConfirmType(x.getType());
x.setConfirmTypeName(ConfirmAlamEnum.getTypeByCode(x.getType()));
String equipmentName = StringUtil.isNotEmpty(specific.getCode()) ? specific.getName() + "(" + specific.getCode() + ")" : specific.getName();
if (x.getType().equals(AlarmTypeEnum.PB.getCode())) {
x.setAlarmReason(equipmentName + "频繁故障/误报,将设备报警信息屏蔽。");
} else {
x.setAlarmReason(equipmentName + "引起设备报警");
}
x.setResolveResult(dateString + "系统收到设备复归(已消除)信号,系统自动处理。");
x.setConfirmUser("");
x.setConfirmUserName("系统自动处理");
x.setConfirmDate(date);
}
});
if (jcsSwitch && AlarmTypeEnum.HZGJ.getCode().equals(log.getType())) {
Token token = remoteSecurityService.getServerToken();
String toke = token.getToke();
String appKey = token.getAppKey();
String product = token.getProduct();
String userId = remoteSecurityService.getAgencyUser().getUserId();
// 确警消息发送
if (org.apache.commons.lang3.StringUtils.isNotBlank(userId)) {
new Thread(new Runnable() {
@Override
public void run() {
try {
ConfirmAlarmServiceImpl.sendIotSystemAlarm(log, userId, appKey, product, toke);
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
}
} }
});
if (!logs.isEmpty()) {
equipmentSpecificAlarmLogService.updateBatchById(logs); equipmentSpecificAlarmLogService.updateBatchById(logs);
} }
if (flag) {
List<EquipmentSpecificIndex> indexList = equipmentSpecificIndexService.getEquipmentSpeIndexBySpeIotCode(iotCode);
publishDataToCanvas(indexList);
}
return logs; return logs;
} }
...@@ -411,7 +482,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -411,7 +482,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
* *
* @param indexList * @param indexList
*/ */
public void publishDataToCanvas(List<EquipmentSpecificIndex> indexList) { public static void publishDataToCanvas(List<EquipmentSpecificIndex> indexList) {
if (!ObjectUtils.isEmpty(indexList)) { if (!ObjectUtils.isEmpty(indexList)) {
EquipmentSpecificIndex index = indexList.stream().filter(x -> x.getUpdateDate() != null) EquipmentSpecificIndex index = indexList.stream().filter(x -> x.getUpdateDate() != null)
.sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed()) .sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
......
...@@ -534,7 +534,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -534,7 +534,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
date="上传成功:"+(equipmentDetailDownloadVOS.size()-(split!=null?split.length:0))+"条---上传失败:"+(split!=null?split.length:0)+"条(失败编号:"+errBufferName+"详情:"+erryy+")"; date="上传成功:"+(equipmentDetailDownloadVOS.size()-(split!=null?split.length:0))+"条---上传失败:"+(split!=null?split.length:0)+"条(失败编号:"+errBufferName+"详情:"+erryy+")";
}else{ }else{
date="上传成功:"+(equipmentDetailDownloadVOS.size())+"条---上传失败:"+"0条(失败编号:"+errBufferName+"详情:"+erryy+")"; date="上传成功:"+(equipmentDetailDownloadVOS.size())+"条";
} }
log.error(date); log.error(date);
......
...@@ -45,5 +45,16 @@ ...@@ -45,5 +45,16 @@
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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