Commit f68386a1 authored by tangwei's avatar tangwei

Merge branch 'developer' into develop_ccs

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgUsrController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/EquipmentSpecificController.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/mapper/EquipmentSpecificMapper.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IEquipmentSpecificSerivce.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/BuildingServiceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/AlertSubmittedServiceImpl.java # amos-boot-system-equip/src/main/resources/application-docker.properties # amos-boot-system-equip/src/main/resources/application-jcs.properties # amos-boot-system-equip/src/main/resources/application-qa.properties # amos-boot-system-equip/src/main/resources/application-test.properties # amos-boot-system-equip/src/main/resources/changelog/wl-3.0.1.xml # amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificMapper.xml ---------合并dev 到css
parents d7b0565f 3eba64b3
...@@ -104,7 +104,12 @@ public class PermissionInterceptor implements Interceptor { ...@@ -104,7 +104,12 @@ public class PermissionInterceptor implements Interceptor {
BoundSql boundSql = (BoundSql) metaObject.getValue("delegate.boundSql"); BoundSql boundSql = (BoundSql) metaObject.getValue("delegate.boundSql");
String sql = boundSql.getSql(); String sql = boundSql.getSql();
// 将权限规则拼接到原始sql // 将权限规则拼接到原始sql
sql = processSelectSql(sql, dataAuthorization, reginParam, boundSql); try {
sql = processSelectSql(sql, dataAuthorization, reginParam, boundSql);
} catch (Exception e) {
PermissionInterceptorContext.clean();
logger.debug(e.getMessage());
}
metaObject.setValue("delegate.boundSql.sql", sql); metaObject.setValue("delegate.boundSql.sql", sql);
PermissionInterceptorContext.clean(); PermissionInterceptorContext.clean();
return invocation.proceed(); return invocation.proceed();
......
...@@ -60,8 +60,11 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -60,8 +60,11 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
@Param("appKey") String appKey, @Param("appKey") String appKey,
@Param("groupCode") String groupCode @Param("groupCode") String groupCode
); );
List<Map<String, Object>> newStationViewData(
@Param("dutyDate") String dutyDate,
@Param("groupCode") String groupCode
);
/** /**
* 利用mysql 生成连续时间区间 * 利用mysql 生成连续时间区间
* *
...@@ -137,4 +140,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -137,4 +140,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
List<Map<String, Object>> queryByCompanyId(@Param(value="bizNames") List<String> bizNames); List<Map<String, Object>> queryByCompanyId(@Param(value="bizNames") List<String> bizNames);
List<Map<String, Object>> queryByCompanyNew(String bizOrgName); List<Map<String, Object>> queryByCompanyNew(String bizOrgName);
List<Map<String, Object>> getNewEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String groupByName);
String getFirstAidCompanyId ();
} }
package com.yeejoin.amos.boot.module.common.api.mapper; package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.oracle.webservices.internal.api.databinding.DatabindingMode;
import com.yeejoin.amos.boot.biz.common.annotations.DataAuth; import com.yeejoin.amos.boot.biz.common.annotations.DataAuth;
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.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
......
...@@ -30,7 +30,14 @@ public interface IDutyCommonService { ...@@ -30,7 +30,14 @@ public interface IDutyCommonService {
* @return ResponseModel * @return ResponseModel
*/ */
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 endDate
* @return
* @throws ParseException
*/
List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate) throws ParseException;
/** /**
* 不分页查询 * 不分页查询
* *
......
...@@ -87,6 +87,21 @@ ...@@ -87,6 +87,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="newStationViewData" 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 = 'postTypeName'
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,
...@@ -187,6 +202,50 @@ select * from ( ...@@ -187,6 +202,50 @@ select * from (
group by ${groupByName} group by ${groupByName}
</if> </if>
</select> </select>
<select id='getNewEquipmentForSpecifyDate' resultType='map'>
select * from (
SELECT
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentId} THEN
cd.FIELD_VALUE
END
) AS #{equipmentId},
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName',
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentName} THEN
cd.FIELD_VALUE
END
) AS #{equipmentName}
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate} and dp.is_delete=0
) cds ON cd.instance_id = cds.instance_id
where cd.group_code =#{groupCode} and cds.instance_id is not null and
cd.is_delete=0
group by cd.instance_id
) result
<if test="groupByName != null and groupByName!='' ">
group by ${groupByName}
</if>
</select>
<select id='getInstanceIdForSpecifyDateAndEquipment' <select id='getInstanceIdForSpecifyDateAndEquipment'
resultType='map'> resultType='map'>
SELECT SELECT
...@@ -288,7 +347,7 @@ FROM ...@@ -288,7 +347,7 @@ FROM
GROUP BY GROUP BY
cd.instance_id cd.instance_id
) ss ) ss
LEFT JOIN ( <!-- LEFT JOIN (
SELECT SELECT
dp.instance_id, dp.instance_id,
ds.`name` ds.`name`
...@@ -301,7 +360,7 @@ LEFT JOIN ( ...@@ -301,7 +360,7 @@ LEFT JOIN (
AND NAME IS NOT NULL AND NAME IS NOT NULL
) cds ON ss.instance_id = cds.instance_id ) cds ON ss.instance_id = cds.instance_id
WHERE WHERE
cds.NAME =#{duty} cds.NAME =#{duty} -->
GROUP BY GROUP BY
ss.postTypeName ss.postTypeName
</select> </select>
...@@ -331,6 +390,16 @@ WHERE ...@@ -331,6 +390,16 @@ WHERE
</select> </select>
<select id='getFirstAidCompanyId' resultType="string">
SELECT
sequence_nbr
FROM
cb_org_usr a
WHERE
a.is_delete = 0
AND
a.biz_org_name = '消防救援保障部'
</select>
<select id='getFirstAidForTypeCodeAndCompanyId' resultType="map"> <select id='getFirstAidForTypeCodeAndCompanyId' resultType="map">
SELECT SELECT
......
...@@ -519,6 +519,7 @@ AND instance_id = ( ...@@ -519,6 +519,7 @@ AND instance_id = (
jc_user_car jc_user_car
WHERE WHERE
car_id = #{carId} car_id = #{carId}
and is_delete = 0
) )
) and field_code='telephone' ) and field_code='telephone'
) ss ) ss
......
...@@ -101,4 +101,10 @@ public class Equipment extends BaseEntity { ...@@ -101,4 +101,10 @@ public class Equipment extends BaseEntity {
*/ */
@TableField(value = "is_iot") @TableField(value = "is_iot")
private String isIot = "0"; private String isIot = "0";
/**
* 警情消除策略 【0:收到复位信号自动消除;1:警情处理确认后消除】
*/
@TableField(value = "clean_type")
private String cleanType = "0";
} }
...@@ -180,4 +180,12 @@ public class EquipmentSpecificAlarmLog extends BaseEntity { ...@@ -180,4 +180,12 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField("build_id") @TableField("build_id")
@ApiModelProperty(value = "建筑id") @ApiModelProperty(value = "建筑id")
private String buildId; private String buildId;
@TableField("clean_time")
@ApiModelProperty(value = "消除时间")
private Date cleanTime;
@ApiModelProperty(value = "消除状态")
@TableField(exist = false)
private String cleanStatus;
} }
...@@ -23,4 +23,6 @@ public class AlamVideoVO { ...@@ -23,4 +23,6 @@ public class AlamVideoVO {
private String presetPosition; private String presetPosition;
private String vedioFormat;
} }
...@@ -43,5 +43,6 @@ public class BuildingVideoVO { ...@@ -43,5 +43,6 @@ public class BuildingVideoVO {
@ApiModelProperty("详细地址") @ApiModelProperty("详细地址")
private String presetPosition; private String presetPosition;
@ApiModelProperty("视频转码")
private String vedioFormat;
} }
...@@ -28,4 +28,6 @@ public class EquipmentAlarmBySystemIdOrSourceIdVO { ...@@ -28,4 +28,6 @@ public class EquipmentAlarmBySystemIdOrSourceIdVO {
* 告警类型 * 告警类型
*/ */
private String type; private String type;
private Integer cleanStatus;
} }
package com.yeejoin.equipmanage.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author keyong
* @title: AlarmCleanTypeEnum
* <pre>
* @description: TODO
* </pre>
* @date 2022/01/05 12:04
*/
@AllArgsConstructor
@Getter
public enum AlarmCleanTypeEnum {
ZDXC("0", "收到复位信号自动消除"), QRXC("1", "警情处理确认后消除");
private String code;
private String name;
}
...@@ -111,6 +111,16 @@ public class CommonPageInfoParam extends CommonPageable { ...@@ -111,6 +111,16 @@ public class CommonPageInfoParam extends CommonPageable {
private String status; private String status;
public void setCleanStatus(String cleanStatus) {
this.cleanStatus = cleanStatus;
}
public String getCleanStatus() {
return cleanStatus;
}
private String cleanStatus;
public void setStatus(String status) { public void setStatus(String status) {
this.status = status; this.status = status;
} }
......
...@@ -57,6 +57,8 @@ public class CommonPageParamUtil { ...@@ -57,6 +57,8 @@ public class CommonPageParamUtil {
param.setBuildIds((List<String>)queryRequests.get(i).getValue()); param.setBuildIds((List<String>)queryRequests.get(i).getValue());
} else if("status".equals(name)){ } else if("status".equals(name)){
param.setStatus(toString(queryRequests.get(i).getValue())); param.setStatus(toString(queryRequests.get(i).getValue()));
} else if("cleanStatus".equals(name)){
param.setCleanStatus(toString(queryRequests.get(i).getValue()));
} }
} }
if(commonPageable !=null){ if(commonPageable !=null){
......
...@@ -23,6 +23,8 @@ public class AlarmListDataVO { ...@@ -23,6 +23,8 @@ public class AlarmListDataVO {
private String alarmEquip; private String alarmEquip;
private String type;
private String alarmType; private String alarmType;
private String alarmInfo; private String alarmInfo;
...@@ -32,4 +34,8 @@ public class AlarmListDataVO { ...@@ -32,4 +34,8 @@ public class AlarmListDataVO {
private Long alarmId; private Long alarmId;
private String alarmTypeCode; private String alarmTypeCode;
}
private String cleanStatus;
private String cleanStatusVal;
}
\ No newline at end of file
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
import java.util.List;
/**
* @ProjectName: amos-biz-boot
* @Package: com.yeejoin.equipmanage.common.vo
* @ClassName: VideoOnEquipmentSpecificVo
* @Author: Jianqiang Gao
* @Description: 摄像头绑定设备
* @Date: 2022/1/7 17:35
* @Version: 1.0
*/
@Data
public class VideoOnEquipmentSpecificVo {
/**
* 设备ID
*/
private Long equipmentSpecificId;
/**
* 摄像头Id集合
*/
private List<Long> videoIdList;
}
\ No newline at end of file
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
</select> </select>
<select id="getOther" resultType="Map"> <select id="getOther" resultType="Map">
SELECT distinct SELECT distinct
a.rec_date recDate , a.rec_date recDate ,
b.company_name companyName, b.company_name companyName,
c.resources_name carName, c.resources_name carName,
...@@ -161,9 +161,9 @@ ...@@ -161,9 +161,9 @@
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr
where a.sequence_nbr = (select sequence_nbr from jc_power_transfer where alert_called_id where a.sequence_nbr in (select sequence_nbr from (select sequence_nbr from jc_power_transfer where alert_called_id
= #{alertId} = #{alertId}
order by rec_date asc limit 1,100) order by rec_date asc limit 1,100) as t )
</select> </select>
......
package com.yeejoin.amos.latentdanger.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum AuditEnum {
AUDIT("待审核","audit"),
REVIEW("待复核","review");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
AuditEnum(String name, String code){
this.name = name;
this.code = code;
}
public static AuditEnum getEnum(String code) {
AuditEnum auditEnum = null;
for(AuditEnum type: AuditEnum.values()) {
if (type.getCode().equals(code)) {
auditEnum = type;
break;
}
}
return auditEnum;
}
public static List<Map<String,String>> getEnumList() {
List<Map<String,String>> nameList = new ArrayList<>();
for (AuditEnum c: AuditEnum.values()) {
Map<String, String> map = new HashMap<String, String>();
map.put("name", c.getName());
map.put("code", c.getCode());
nameList.add(map);
}
return nameList;
}
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;
}
}
...@@ -90,7 +90,7 @@ public class LatentDanger extends BasicEntity { ...@@ -90,7 +90,7 @@ public class LatentDanger extends BasicEntity {
/** /**
* 限制时间 * 限制时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reformLimitDate; private Date reformLimitDate;
private Integer overtimeState; private Integer overtimeState;
......
...@@ -5,6 +5,7 @@ public enum ExecuteStateEnum { ...@@ -5,6 +5,7 @@ public enum ExecuteStateEnum {
未执行("未执行", 1, ""), 未执行("未执行", 1, ""),
通过("通过", 2, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"), 通过("通过", 2, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
完毕("完毕", 2, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
驳回("驳回", 3, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"), 驳回("驳回", 3, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"),
已确认("已确认", 4, ""), 已确认("已确认", 4, ""),
停止执行("停止执行", 5, ""), 停止执行("停止执行", 5, ""),
......
...@@ -7,7 +7,7 @@ public enum LatentDangerExcuteTypeEnum { ...@@ -7,7 +7,7 @@ public enum LatentDangerExcuteTypeEnum {
"{\"reviewResult\": \"通过\"}"), "{\"reviewResult\": \"通过\"}"),
隐患评审拒绝("隐患评审拒绝", 3, ExecuteStateEnum.驳回, LatentDangerStateEnum.已撤销, 隐患评审拒绝("隐患评审拒绝", 3, ExecuteStateEnum.驳回, LatentDangerStateEnum.已撤销,
"{\"reviewResult\": \"不通过\"}"), "{\"reviewResult\": \"不通过\"}"),
隐患常规治理("隐患常规治理", 4, ExecuteStateEnum.通过, LatentDangerStateEnum.待验证, 隐患常规治理("隐患常规治理", 4, ExecuteStateEnum.完毕, LatentDangerStateEnum.待验证,
"{\"rectifyResult\": \"常规整改\"}"), "{\"rectifyResult\": \"常规整改\"}"),
隐患安措计划("隐患安措计划", 5, ExecuteStateEnum.通过, LatentDangerStateEnum.安措计划中, 隐患安措计划("隐患安措计划", 5, ExecuteStateEnum.通过, LatentDangerStateEnum.安措计划中,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rectification\",\"value\": \"plan\"}]}"), "{\"action\": \"complete\",\"variables\": [{\"name\": \"rectification\",\"value\": \"plan\"}]}"),
......
package com.yeejoin.amos.boot.module.tzs.flc.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 设备使用信息表
*
* @author system_generator
* @date 2022-01-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="EquipmentUseInfoDto", description="设备使用信息表")
public class EquipmentUseInfoDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "使用单位名称")
private String useUnitName;
@ApiModelProperty(value = "使用单位id")
private Long useUnitId;
@ApiModelProperty(value = "使用单位统一信用代码")
private String useOrganizationCode;
@ApiModelProperty(value = "产权单位名称")
private String propertyUnitName;
@ApiModelProperty(value = "产权单位id")
private Long propertyUnitId;
@ApiModelProperty(value = "产权统一信用代码")
private String propertyOrganizationCode;
@ApiModelProperty(value = "使用地址")
private String useAddress;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
@ApiModelProperty(value = "使用场所")
private String useSite;
@ApiModelProperty(value = "使用场所编码")
private String useSiteCode;
@ApiModelProperty(value = "特设编码")
private String specialCode;
@ApiModelProperty(value = "设备注册代码")
private String registerCode;
@ApiModelProperty(value = "96333识别码")
private String rescueCode;
@ApiModelProperty(value = "使用登记证编码")
private String registerLicenceCode;
@ApiModelProperty(value = "登记机关")
private String registerOrg;
@ApiModelProperty(value = "登记机关id")
private Long registerOrgId;
@ApiModelProperty(value = "登记日期")
private Date registerTime;
@ApiModelProperty(value = "发证日期")
private Date issueLicenceTime;
@ApiModelProperty(value = "投入使用日期")
private Date startUseTime;
@ApiModelProperty(value = "设备id")
private Long equipmentId;
}
package com.yeejoin.amos.boot.module.tzs.flc.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 设备使用信息表
*
* @author system_generator
* @date 2022-01-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tcb_equipment_use_info")
public class EquipmentUseInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 使用单位名称
*/
@TableField("use_unit_name")
private String useUnitName;
/**
* 使用单位id
*/
@TableField("use_unit_id")
private Long useUnitId;
/**
* 使用单位统一信用代码
*/
@TableField("use_organization_code")
private String useOrganizationCode;
/**
* 产权单位名称
*/
@TableField("property_unit_name")
private String propertyUnitName;
/**
* 产权单位id
*/
@TableField("property_unit_id")
private Long propertyUnitId;
/**
* 产权统一信用代码
*/
@TableField("property_organization_code")
private String propertyOrganizationCode;
/**
* 使用地址
*/
@TableField("use_address")
private String useAddress;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 纬度
*/
@TableField("latitude")
private String latitude;
/**
* 使用场所
*/
@TableField("use_site")
private String useSite;
/**
* 使用场所编码
*/
@TableField("use_site_code")
private String useSiteCode;
/**
* 特设编码
*/
@TableField("special_code")
private String specialCode;
/**
* 设备注册代码
*/
@TableField("register_code")
private String registerCode;
/**
* 96333识别码
*/
@TableField("rescue_code")
private String rescueCode;
/**
* 使用登记证编码
*/
@TableField("register_licence_code")
private String registerLicenceCode;
/**
* 登记机关
*/
@TableField("register_org")
private String registerOrg;
/**
* 登记机关id
*/
@TableField("register_org_id")
private Long registerOrgId;
/**
* 登记日期
*/
@TableField("register_time")
private Date registerTime;
/**
* 发证日期
*/
@TableField("issue_licence_time")
private Date issueLicenceTime;
/**
* 投入使用日期
*/
@TableField("start_use_time")
private Date startUseTime;
/**
* 设备id
*/
@TableField("equipment_id")
private Long equipmentId;
}
package com.yeejoin.amos.boot.module.tzs.flc.api.mapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentUseInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 设备使用信息表 Mapper 接口
*
* @author system_generator
* @date 2022-01-05
*/
public interface EquipmentUseInfoMapper extends BaseMapper<EquipmentUseInfo> {
}
package com.yeejoin.amos.boot.module.tzs.flc.api.service; package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentAssociatedDto;
/** /**
* 配套设备/设施/部件接口类 * 配套设备/设施/部件接口类
* *
...@@ -9,4 +11,5 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service; ...@@ -9,4 +11,5 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
*/ */
public interface IEquipmentAssociatedService { public interface IEquipmentAssociatedService {
EquipmentAssociatedDto updateAssociated(EquipmentAssociatedDto model);
} }
package com.yeejoin.amos.boot.module.tzs.flc.api.service;
/**
* 设备使用信息表接口类
*
* @author system_generator
* @date 2022-01-05
*/
public interface IEquipmentUseInfoService {
}
<?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.boot.module.tzs.flc.api.mapper.EquipmentUseInfoMapper">
</mapper>
...@@ -94,6 +94,20 @@ public class DutyCarController extends BaseController { ...@@ -94,6 +94,20 @@ public class DutyCarController extends BaseController {
} }
/** /**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-statistics-day")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyCarService.newStatisticsDay(beginDate, endDate));
}
/**
* 调班 * 调班
* *
* @return ResponseModel * @return ResponseModel
......
...@@ -92,7 +92,20 @@ public class DutyFireFightingController extends BaseController{ ...@@ -92,7 +92,20 @@ public class DutyFireFightingController extends BaseController{
) throws ParseException { ) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.statisticsDay(beginDate, endDate)); return ResponseHelper.buildResponse(iDutyFireFightingService.statisticsDay(beginDate, endDate));
} }
/**
* 新值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-statistics-day")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.newStatisticsDay(beginDate, endDate));
}
/** /**
* 调班 * 调班
* *
......
...@@ -84,7 +84,15 @@ public class DutyFirstAidController extends BaseController{ ...@@ -84,7 +84,15 @@ public class DutyFirstAidController extends BaseController{
) throws ParseException { ) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.statisticsDay(beginDate, endDate)); return ResponseHelper.buildResponse(iDutyFirstAidService.statisticsDay(beginDate, endDate));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-statistics-day")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.newStatisticsDay(beginDate, endDate));
}
/** /**
* 调班 * 调班
* *
......
...@@ -93,7 +93,20 @@ public class DutyPersonController extends BaseController { ...@@ -93,7 +93,20 @@ public class DutyPersonController extends BaseController {
) throws ParseException { ) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.statisticsDay(beginDate, endDate)); return ResponseHelper.buildResponse(iDutyPersonService.statisticsDay(beginDate, endDate));
} }
/**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/new-duty-detail")
@ApiOperation(httpMethod = "GET", value = "新值班月视图", notes = "新值班月视图")
public ResponseModel<List<Map<String, Object>>> newDutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.newStatisticsDay(beginDate, endDate));
}
/** /**
* 调班 * 调班
...@@ -168,7 +181,14 @@ public class DutyPersonController extends BaseController { ...@@ -168,7 +181,14 @@ public class DutyPersonController extends BaseController {
@ApiParam(value = "岗位") @RequestParam(required = false) String postType) { @ApiParam(value = "岗位") @RequestParam(required = false) String postType) {
return ResponseHelper.buildResponse(iDutyPersonService.dayDutyPersonList(dutyDay, shiftId, postType)); return ResponseHelper.buildResponse(iDutyPersonService.dayDutyPersonList(dutyDay, shiftId, postType));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("新查询指定日期值班人信息列表")
@GetMapping("/new-person/{dutyDay}/list")
public ResponseModel newListDutyPerson(@ApiParam(value = "值班日期", required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType) {
return ResponseHelper.buildResponse(iDutyPersonService.getSchedulingDutyForSpecifyDate(dutyDay, shiftId, postType));
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询当前值班人信息列表") @ApiOperation("查询当前值班人信息列表")
@GetMapping("/person/on_duty/list") @GetMapping("/person/on_duty/list")
......
...@@ -91,7 +91,7 @@ public class OrgPersonController { ...@@ -91,7 +91,7 @@ public class OrgPersonController {
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.PUT) @RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据") @ApiOperation(httpMethod = "PUT", value = "更新人员数据", notes = "更新人员数据")
public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgPersonDto OrgPersonVo, public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgPersonDto OrgPersonVo,
@PathVariable Long id) throws Exception { @PathVariable Long id) throws Exception {
OrgPersonVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON); OrgPersonVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
......
...@@ -257,6 +257,55 @@ public class OrgUsrController extends BaseController { ...@@ -257,6 +257,55 @@ public class OrgUsrController extends BaseController {
page = iOrgUsrService.page(pageBean, orgUsrQueryWrapper); page = iOrgUsrService.page(pageBean, orgUsrQueryWrapper);
return page; return page;
} }
/**
* 列表分页查询
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/new-list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "新列表分页查询---只查询当前登录人本单位下的对应数据信息", notes = "新列表分页查询---只查询当前登录人本单位下的对应数据信息")
public IPage<OrgUsr> newlistPage(String pageNum, String pageSize, OrgUsr orgUsr) {
ReginParams reginParams = getSelectedOrgInfo();
String companyIdString= reginParams.getPersonIdentity().getCompanyId();
orgUsr.setParentId(companyIdString);
Page<OrgUsr> pageBean;
QueryWrapper<OrgUsr> orgUsrQueryWrapper = new QueryWrapper<>();
Class<? extends OrgUsr> aClass = orgUsr.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
Object o = field.get(orgUsr);
if (o != null) {
Class<?> type = field.getType();
String name = NameUtils.camel2Underline(field.getName());
if (type.equals(Integer.class)) {
Integer fileValue = (Integer) field.get(orgUsr);
orgUsrQueryWrapper.eq(name, fileValue);
} else if (type.equals(Long.class)) {
Long fileValue = (Long) field.get(orgUsr);
orgUsrQueryWrapper.eq(name, fileValue);
} else if (type.equals(String.class)) {
String fileValue = (String) field.get(orgUsr);
orgUsrQueryWrapper.eq(name, fileValue);
} else {
String fileValue = (String) field.get(orgUsr);
orgUsrQueryWrapper.eq(name, fileValue);
}
}
} catch (Exception e) {
}
});
orgUsrQueryWrapper.eq("is_delete", 0);
IPage<OrgUsr> page;
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
} else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = iOrgUsrService.page(pageBean, orgUsrQueryWrapper);
return page;
}
/** /**
* 导入部门信息 * 导入部门信息
...@@ -597,6 +646,7 @@ public class OrgUsrController extends BaseController { ...@@ -597,6 +646,7 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse(iOrgUsrService.getOrgUserByAmosUserId(amosUserId)); return ResponseHelper.buildResponse(iOrgUsrService.getOrgUserByAmosUserId(amosUserId));
} }
/** /**
* 根据机构类型和登陆人bizOrgCode获取列表不分页 * 根据机构类型和登陆人bizOrgCode获取列表不分页
* *
...@@ -645,4 +695,5 @@ public class OrgUsrController extends BaseController { ...@@ -645,4 +695,5 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse(menus); return ResponseHelper.buildResponse(menus);
} }
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import java.util.ArrayList;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import java.util.List;
import com.yeejoin.amos.boot.module.common.api.dto.ContractDto; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.common.api.entity.Contract;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.mapper.ContractMapper;
import com.yeejoin.amos.boot.module.common.api.service.IContractService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.FileInfoModel;
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.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -23,10 +16,17 @@ import org.typroject.tyboot.core.rdbms.annotation.Operator; ...@@ -23,10 +16,17 @@ import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.DataNotFound; import org.typroject.tyboot.core.restful.exception.instance.DataNotFound;
import java.util.ArrayList; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.Date; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import com.yeejoin.amos.boot.module.common.api.dto.ContractDto;
import java.util.stream.Collectors; import com.yeejoin.amos.boot.module.common.api.entity.Contract;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.mapper.ContractMapper;
import com.yeejoin.amos.boot.module.common.api.service.IContractService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.FileInfoModel;
/** /**
* 维保合同服务实现类 * 维保合同服务实现类
...@@ -53,8 +53,6 @@ public class ContractServiceImpl extends BaseService<ContractDto, Contract, Cont ...@@ -53,8 +53,6 @@ public class ContractServiceImpl extends BaseService<ContractDto, Contract, Cont
MaintenanceCompany company = maintenanceCompanyService.getMaintenanceCompany(amosUserId); MaintenanceCompany company = maintenanceCompanyService.getMaintenanceCompany(amosUserId);
companyId = company.getSequenceNbr(); companyId = company.getSequenceNbr();
} }
//
Page<ContractDto> resultPage= queryForContractPageByParam(page, isDelete, companyId, signedCompanyId, name, typeCode, Page<ContractDto> resultPage= queryForContractPageByParam(page, isDelete, companyId, signedCompanyId, name, typeCode,
signedDate); signedDate);
List<ContractDto> resultContractDtos= resultPage.getRecords(); List<ContractDto> resultContractDtos= resultPage.getRecords();
......
...@@ -170,21 +170,23 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -170,21 +170,23 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
if (StringUtils.isNotBlank(instanceId)) { if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(","); String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay); // List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if(dutyList!=null && dutyList.size()>0) { // if(dutyList!=null && dutyList.size()>0) {
for (Map<String, Object> dutyDetail : dutyList) { // for (Map<String, Object> dutyDetail : dutyList) {
if(!dutyDetail.containsKey("name")) { // if(!dutyDetail.containsKey("name")) {
continue; // continue;
} // }
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay, List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,dutyDetail.get("name").toString()); this.getGroupCode(), instanceIds,null);
if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) { if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue; continue;
} }
LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>(); LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), ""); //取消掉班次的显示---2022-01-16 by chenhao ---start
resultList.add(infoMap_1); //infoMap_1.put(dutyDetail.get("name").toString(), "");
//resultList.add(infoMap_1);
//取消掉班次的显示---2022-01-16 by chenhao ---end
for (Map<String, Object> specify : specifyDateList) { for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>(); LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
// infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString()); // infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
...@@ -194,32 +196,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -194,32 +196,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
resultList.add(infoMap_2); resultList.add(infoMap_2);
} }
} }
} // }
} //}
// 获取当前装备ID下的排版数据
// List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getSpecifyDateList(dutyDay,
// this.getGroupCode(), instanceIds,null);
// for (Map<String, Object> specify : specifyDateList) {
//
// if(!specify.containsKey("name") || specify.get("name").toString()==null) {
// continue;
// }
// LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
// infoMap_1.put(specify.get("name").toString(), "");
// resultList.add(infoMap_1);
// Map<String, Object> equipmentOperatorMap = dutyPersonShiftMapper.getEquipmentOperator(dutyDay,
// this.getGroupCode(), instanceIds, "消防车驾驶员", specify.get("name").toString());
// String operator =null;
// if (equipmentOperatorMap!=null && equipmentOperatorMap.containsKey("userName")) {
// operator = equipmentOperatorMap.get("equipmentOperatorMap").toString();
// }
// LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
// infoMap_2.put("驾驶员", operator!=null?operator:"");
// resultList.add(infoMap_2);
// LinkedHashMap<String, Object> infoMap_3 =new LinkedHashMap<String, Object>();
// infoMap_3.put("战斗员",specify.get("value").toString());
// resultList.add(infoMap_3);
// }
} }
detailList.add(resultList); detailList.add(resultList);
} }
......
...@@ -46,6 +46,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; ...@@ -46,6 +46,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum; import com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService; import com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService;
/** /**
...@@ -75,6 +76,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -75,6 +76,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Autowired @Autowired
OrgUsrServiceImpl orgUsrService; OrgUsrServiceImpl orgUsrService;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
/** /**
* 每天单个班次执勤人数全部小于等于3人 * 每天单个班次执勤人数全部小于等于3人
...@@ -213,7 +217,126 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -213,7 +217,126 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return resultMap; return resultMap;
/*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 结束*/ /*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 结束*/
} }
public List<Map<String, Object>> newStatisticsDay(String beginDate, String endDate) throws ParseException {
Date dateBegin = DateUtils.dateParse(beginDate, DateUtils.DATE_PATTERN);
String timeStart = DateUtils.dateTimeToDateString(dateBegin);
Date dateEnd = DateUtils.dateParse(endDate, DateUtils.DATE_PATTERN);
String timeEnd = DateUtils.dateTimeToDateString(dateEnd);
List<String> betweenDate = getBetweenDate(timeStart, timeEnd);
//拿到每一天的视图展示
String beginTime = null;
String endTime = null;
List<Map<String, Object>> viewTypeResult = new ArrayList<>();
for (String time : betweenDate) {
beginTime = time + " 00:00:00";
endTime = time + " 23:59:59";
Map<String, Object> viewTypeMap = new HashMap<>();
viewTypeMap.put("date",time);
viewTypeResult.add(viewTypeMap);
}
List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate);
List<Map<String, Object>> resultMap = new ArrayList<>();
for (Map<String, Object> stringObjectMap : viewTypeResult) {
for (Map<String, Object> objectMap : rangeDate) {
if (stringObjectMap.get("date").equals(objectMap.get("date"))){
Map<String, Object> result = new LinkedHashMap<>();
result.put("key", objectMap.get("date"));
String dateString = objectMap.get("date").toString();
if(this.getGroupCode().equals("dutyPerson")) {
result.put("data", getPersonPostTypeNameAndCount(dateString));
}else if(this.getGroupCode().equals("dutyCar")) {
result.put("data", getCarPostTypeNameAndCount(dateString));
}else if(this.getGroupCode().equals("dutyFireFighting")) {
result.put("data", getFireFightingPostTypeNameAndCount(dateString));
}else if(this.getGroupCode().equals("dutyFirstAid")) {
result.put("data", getFirstAidPostTypeNameAndCount(dateString));
}
resultMap.add(result);
}
}
}
return resultMap;
}
/**
* 排班值班人员的统计类型为:
* 岗位: 岗位人员数量
* @param dutyDate
* @return
*/
public Object getPersonPostTypeNameAndCount(String dutyDate) {
return dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
}
/**
* 车辆值班人员左侧的统计: 只有几辆车
* @param dutyDate
* @return
*/
public Object getCarPostTypeNameAndCount(String dutyDate) {
Map<String, Object> map = new HashMap<String, Object>();
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "carId", "carName", "teamName","result.carId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
}
map.put("person", person);
return map;
}
public Object getFireFightingPostTypeNameAndCount(String dutyDate) {
Map<String, Object> map = new HashMap<String, Object>();
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "fireFightingId", "fireFighting", "teamName","result.fireFightingId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
}
map.put("person", person);
return map;
}
public Object getFirstAidPostTypeNameAndCount(String dutyDate) {
Map<String, Object> map = new HashMap<String, Object>();
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "firstAidId", "firstAid", "teamName", "result.firstAidId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
}
map.put("person", person);
return map;
}
private Object buildViewData(DutyViewTypeEnum viewTypeEnum, String dutyDate, String appKey) { private Object buildViewData(DutyViewTypeEnum viewTypeEnum, String dutyDate, String appKey) {
List<Map<String, Object>> result = new ArrayList<>(); List<Map<String, Object>> result = new ArrayList<>();
switch (viewTypeEnum) { switch (viewTypeEnum) {
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import static org.hamcrest.CoreMatchers.nullValue;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
...@@ -15,7 +13,6 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -15,7 +13,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
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.dto.DynamicFormInstanceDto; import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto; import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
...@@ -85,29 +82,29 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement ...@@ -85,29 +82,29 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
if (StringUtils.isNotBlank(instanceId)) { if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(","); String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay); // List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if(dutyList!=null && dutyList.size()>0) { // if(dutyList!=null && dutyList.size()>0) {
for (Map<String, Object> dutyDetail : dutyList) { // for (Map<String, Object> dutyDetail : dutyList) {
if(!dutyDetail.containsKey("name")) { // if(!dutyDetail.containsKey("name")) {
continue; // continue;
} // }
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay, List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,dutyDetail.get("name").toString()); this.getGroupCode(), instanceIds,null);
if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) { if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue; continue;
} }
LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>(); // LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), ""); // infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList.add(infoMap_1); // resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) { for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>(); LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
if( specify.containsKey("postTypeName")&& specify.get("postTypeName")!=null && specify.containsKey("userName")&& specify.get("userName")!=null ) { if( specify.containsKey("postTypeName")&& specify.get("postTypeName")!=null && specify.containsKey("userName")&& specify.get("userName")!=null ) {
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString()); infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
resultList.add(infoMap_2); resultList.add(infoMap_2);
} }
} // }
} // }
} }
} }
detailList.add(resultList); detailList.add(resultList);
......
...@@ -7,6 +7,7 @@ import java.util.List; ...@@ -7,6 +7,7 @@ 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;
...@@ -18,8 +19,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; ...@@ -18,8 +19,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper; import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService; import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService;
import ch.qos.logback.core.joran.conditional.IfAction;
@Service @Service
public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements IDutyFirstAidService { public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements IDutyFirstAidService {
...@@ -67,15 +66,15 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -67,15 +66,15 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
} }
List<Object> detailList = new ArrayList<Object>(); List<Object> detailList = new ArrayList<Object>();
for (Map<String, Object> map : equipmentList) { for (Map<String, Object> map : equipmentList) {
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>(); List<Object> resultList = new ArrayList<Object>();
LinkedHashMap<String, Object> titleMap_1 = new LinkedHashMap<String, Object>(); //LinkedHashMap<String, Object> titleMap_1 = new LinkedHashMap<String, Object>();
titleMap_1.put("120急救站", map.get("firstAid").toString()); //titleMap_1.put("120急救站", map.get("firstAid").toString());
resultList.add(titleMap_1); resultList.add( map.get("firstAid").toString());
LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>(); // LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
if(map.containsKey("teamName") && map.get("teamName") != null){ // if(map.containsKey("teamName") && map.get("teamName") != null){
titleMap_2.put("单位/部门", map.get("teamName").toString()); // titleMap_2.put("单位/部门", map.get("teamName").toString());
} // }
resultList.add(titleMap_2); // resultList.add(titleMap_2);
String carId = map.get("firstAidId").toString(); String carId = map.get("firstAidId").toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay, Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId); this.getGroupCode(), carId);
...@@ -86,22 +85,22 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -86,22 +85,22 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
if (StringUtils.isNotBlank(instanceId)) { if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(","); String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay); // List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if (dutyList != null && dutyList.size() > 0) { // if (dutyList != null && dutyList.size() > 0) {
for (Map<String, Object> dutyDetail : dutyList) { // for (Map<String, Object> dutyDetail : dutyList) {
if (!dutyDetail.containsKey("name")) { // if (!dutyDetail.containsKey("name")) {
continue; // continue;
} // }
// 获取当前装备ID下的排版数据 // 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds, .getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
dutyDetail.get("name").toString()); null);
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) { if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue; continue;
} }
LinkedHashMap<String, Object> infoMap_1 = new LinkedHashMap<String, Object>(); // LinkedHashMap<String, Object> infoMap_1 = new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), ""); // infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList.add(infoMap_1); // resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) { for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>(); LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>();
// infoMap_2.put(specify.get("postTypeName").toString(), specify.get("userName").toString()); // infoMap_2.put(specify.get("postTypeName").toString(), specify.get("userName").toString());
...@@ -110,9 +109,9 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -110,9 +109,9 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString()); infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
resultList.add(infoMap_2); resultList.add(infoMap_2);
} }
} // }
//
} // }
} }
} }
detailList.add(resultList); detailList.add(resultList);
...@@ -125,6 +124,11 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -125,6 +124,11 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
List< Map<String, Object>> result = new ArrayList<Map<String, Object>>(); List< Map<String, Object>> result = new ArrayList<Map<String, Object>>();
List<String> userNameList= new ArrayList<String>(); List<String> userNameList= new ArrayList<String>();
String firstAidCompanyId = dutyPersonShiftMapper.getFirstAidCompanyId();
if (firstAidCompanyId != "" && firstAidCompanyId != null){
ids.add(firstAidCompanyId);
}
List<String> firstAidSimpleList = new ArrayList<String>(); List<String> firstAidSimpleList = new ArrayList<String>();
List<String> companyNameList = new ArrayList<String>(); List<String> companyNameList = new ArrayList<String>();
String typeString = "JJZ"; String typeString = "JJZ";
...@@ -157,10 +161,19 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID ...@@ -157,10 +161,19 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
}); });
if( firstAidSimpleList != null && firstAidSimpleList.size() >= 1 ) { if( firstAidSimpleList != null && firstAidSimpleList.size() >= 1 ) {
detailMap.put("firstAidName", firstAidSimpleList); detailMap.put("firstAidName", firstAidSimpleList);
resultList.add(detailMap);
} }
resultList.add(detailMap);
}); });
result.add(resultList.get(0)); for (int i = 0; i < resultList.size(); i++) {
if (resultList.get(i).size() == 4){
result.add(resultList.get(i));
}
if (result.size()>0){
break;
}
}
return result; return result;
} }
......
...@@ -304,7 +304,48 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType ...@@ -304,7 +304,48 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
} }
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "deptId", "deptName", "result.deptId");
if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) {
return null;
}
List<Object> detailList = new ArrayList<Object>();
for (Map<String, Object> map : equipmentList) {
List<Object> resultList = new ArrayList<Object>();
LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
if(map.containsKey("deptName") && map.get("deptName") != null){
resultList.add( map.get("deptName").toString());
}
String carId = map.get("deptId").toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId);
if (instanceMap == null) {
continue;
}
String instanceId = instanceMap.get("instanceIds").toString();
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
null);
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue;
}
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>();
if( specify.containsKey("postTypeName")&& specify.get("postTypeName")!=null && specify.containsKey("userName")&& specify.get("userName")!=null ) {
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
resultList.add(infoMap_2);
}
}
}
detailList.add(resultList);
}
return detailList;
}
......
...@@ -323,6 +323,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -323,6 +323,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// 发起主表流程 并添加至报修日志 // 发起主表流程 并添加至报修日志
failureDetailsDto.setSubmissionTime(new Date()); failureDetailsDto.setSubmissionTime(new Date());
failureDetailsDto.setCurrentStatus(FailureStatuEnum.WAITING_AUDIT.getCode());
FailureDetailsDto model = this.updateWithModel(failureDetailsDto); FailureDetailsDto model = this.updateWithModel(failureDetailsDto);
if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) { if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) {
......
...@@ -85,10 +85,15 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail ...@@ -85,10 +85,15 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
FailureDetailsDto failureDetailsDto = failureDetailsService.queryBySeq(model.getFaultId()); FailureDetailsDto failureDetailsDto = failureDetailsService.queryBySeq(model.getFaultId());
List<FailureVerify> byfaultId = findByfaultId(failureDetailsDto.getSequenceNbr()); List<FailureVerify> byfaultId = findByfaultId(failureDetailsDto.getSequenceNbr());
if (byfaultId.size() != 0) { if (byfaultId.size() != 0 && status.getCode().equals(FailureStatuEnum.FINISH.getCode())) {
failureDetailsDto.setCurrentStatus(status.getCode()); failureDetailsDto.setCurrentStatus(status.getCode());
} }
if (condition == AuditResultEnum.REFUSE.getCode()){
failureDetailsDto.setCurrentStatus(status.getCode());
}
failureDetailsDto.setSequenceNbr(model.getFaultId()); failureDetailsDto.setSequenceNbr(model.getFaultId());
failureDetailsService.updateWithModel(failureDetailsDto); failureDetailsService.updateWithModel(failureDetailsDto);
......
...@@ -642,7 +642,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -642,7 +642,7 @@ public class MaintenanceCompanyServiceImpl
MaintenanceCompany maintenanceCompany = new MaintenanceCompany(); MaintenanceCompany maintenanceCompany = new MaintenanceCompany();
if (ValidationUtil.isEmpty(seq)) { if (ValidationUtil.isEmpty(seq)) {
maintenanceCompany = getMaintenanceCompany(amosUserId); maintenanceCompany = getMaintenanceCompany(amosUserId);
seq = maintenanceCompany.getParentId(); seq = maintenanceCompany.getSequenceNbr();
} }
// 机场单位列表基本信息 // 机场单位列表基本信息
if (pageNum == -1 || pageSize == -1) { if (pageNum == -1 || pageSize == -1) {
...@@ -674,11 +674,11 @@ public class MaintenanceCompanyServiceImpl ...@@ -674,11 +674,11 @@ public class MaintenanceCompanyServiceImpl
LambdaQueryWrapper<MaintenanceCompany> wrapper = new LambdaQueryWrapper<MaintenanceCompany>(); LambdaQueryWrapper<MaintenanceCompany> wrapper = new LambdaQueryWrapper<MaintenanceCompany>();
wrapper.eq(MaintenanceCompany::getIsDelete, false); wrapper.eq(MaintenanceCompany::getIsDelete, false);
wrapper.eq(MaintenanceCompany::getAmosId, amosUserId); wrapper.eq(MaintenanceCompany::getAmosId, amosUserId);
MaintenanceCompany maintenanceCompany = this.baseMapper.selectOne(wrapper); MaintenanceCompany maintenancePerson = this.baseMapper.selectOne(wrapper);
// DynamicFormInstance dyFormInstance = dynamicFormInstanceService.getOne( // DynamicFormInstance dyFormInstance = dynamicFormInstanceService.getOne(
// new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "amosAccount") // new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "amosAccount")
// .eq(DynamicFormInstance::getFieldValue, amosUserId)); // .eq(DynamicFormInstance::getFieldValue, amosUserId));
if (ValidationUtil.isEmpty(maintenanceCompany)) { if (ValidationUtil.isEmpty(maintenancePerson)) {
throw new BadRequest("维保账号不存在或未关联系统账号."); throw new BadRequest("维保账号不存在或未关联系统账号.");
} }
// MaintenanceCompany person = this.getOne(new LambdaQueryWrapper<MaintenanceCompany>() // MaintenanceCompany person = this.getOne(new LambdaQueryWrapper<MaintenanceCompany>()
...@@ -686,11 +686,11 @@ public class MaintenanceCompanyServiceImpl ...@@ -686,11 +686,11 @@ public class MaintenanceCompanyServiceImpl
// if (ValidationUtil.isEmpty(person)) { // if (ValidationUtil.isEmpty(person)) {
// throw new BadRequest("维保账号不存在或未关联系统账号."); // throw new BadRequest("维保账号不存在或未关联系统账号.");
// } // }
// maintenanceCompany = this.getOne(new LambdaQueryWrapper<MaintenanceCompany>() MaintenanceCompany maintenanceCompany = this.getOne(new LambdaQueryWrapper<MaintenanceCompany>()
// .eq(MaintenanceCompany::getSequenceNbr, person.getParentId())); .eq(MaintenanceCompany::getSequenceNbr, maintenancePerson.getParentId()));
// if (ValidationUtil.isEmpty(maintenanceCompany)) { if (ValidationUtil.isEmpty(maintenanceCompany)) {
// throw new BadRequest("维保账号不存在或未关联系统账号."); throw new BadRequest("维保公司不存在或未关联系统账号.");
// } }
return maintenanceCompany; return maintenanceCompany;
} }
...@@ -817,7 +817,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -817,7 +817,7 @@ public class MaintenanceCompanyServiceImpl
// 查询公司下人列表 // 查询公司下人列表
List<MaintenanceCompany> personList = list(new LambdaQueryWrapper<MaintenanceCompany>() List<MaintenanceCompany> personList = list(new LambdaQueryWrapper<MaintenanceCompany>()
.eq(MaintenanceCompany::getIsDelete, false).eq(MaintenanceCompany::getType, PERSON) .eq(MaintenanceCompany::getIsDelete, false).eq(MaintenanceCompany::getType, PERSON)
.likeRight(MaintenanceCompany::getCode, company.getCode())); .eq(MaintenanceCompany::getParentId,company.getParentId()));
List<Long> instanceIdList = Lists.transform(personList, MaintenanceCompany::getInstanceId); List<Long> instanceIdList = Lists.transform(personList, MaintenanceCompany::getInstanceId);
// 查询手机号 // 查询手机号
List<DynamicFormInstance> dynamicFormInstanceList = dynamicFormInstanceService List<DynamicFormInstance> dynamicFormInstanceList = dynamicFormInstanceService
...@@ -830,7 +830,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -830,7 +830,7 @@ public class MaintenanceCompanyServiceImpl
Map<String, Object> map = Maps.newHashMap(); Map<String, Object> map = Maps.newHashMap();
map.put("sequenceNbr", person.getSequenceNbr()); map.put("sequenceNbr", person.getSequenceNbr());
map.put("name", person.getName()); map.put("name", person.getName());
map.put("tel", dyMap.get(person.getInstanceId()).get(0).getFieldValue()); map.put("tel", dyMap.get(person.getInstanceId()) != null ? dyMap.get(person.getInstanceId()).get(0).getFieldValue() : null);
resultList.add(map); resultList.add(map);
}); });
return resultList; return resultList;
......
...@@ -41,6 +41,8 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -41,6 +41,8 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -51,7 +53,14 @@ import java.lang.reflect.Method; ...@@ -51,7 +53,14 @@ import java.lang.reflect.Method;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* 机构/部门/人员表 服务实现类 * 机构/部门/人员表 服务实现类
...@@ -495,8 +504,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -495,8 +504,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
@Override @Override
public OrgUsrDto saveOrgUsrDynamicFormInstance(OrgUsr orgUsr, List<DynamicFormInstance> alertFromValuelist) public OrgUsrDto saveOrgUsrDynamicFormInstance(OrgUsr orgUsr, List<DynamicFormInstance> alertFromValuelist) {
throws Exception {
orgUsr.setRecDate(new Date()); orgUsr.setRecDate(new Date());
AgencyUserModel user = Privilege.agencyUserClient.getme().getResult(); AgencyUserModel user = Privilege.agencyUserClient.getme().getResult();
orgUsr.setRecUserName(user.getRealName()); orgUsr.setRecUserName(user.getRealName());
...@@ -517,19 +525,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -517,19 +525,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}); });
// 保存动态表单数据 // 保存动态表单数据
alertFormValueServiceImpl.saveBatch(alertFromValuelist); alertFormValueServiceImpl.saveBatch(alertFromValuelist);
OrgUsrFormDto formDto = this.selectCompanyById(orgUsrDto.getSequenceNbr());
if (OrgPersonEnum.公司.getKey().equals(orgUsrDto.getBizOrgType())) {
try {
emqKeeper.getMqttClient().publish(airportAddTopic, JSON.toJSONString(formDto).getBytes(), 2, false);
} catch (Exception e) {
e.getMessage();
}
}
return model; return model;
} }
@Override @Override
public void updateDynamicFormInstance(Long instanceId, List<DynamicFormInstance> fromValueList) { public void updateDynamicFormInstance(Long instanceId, List<DynamicFormInstance> fromValueList) {
if (ValidationUtil.isEmpty(fromValueList)) {
return;
}
// 填充主键 // 填充主键
fromValueList.forEach(alertFromValue -> { fromValueList.forEach(alertFromValue -> {
alertFromValue.setInstanceId(instanceId); alertFromValue.setInstanceId(instanceId);
...@@ -679,6 +682,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -679,6 +682,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
* 同步保存ES * 同步保存ES
*/ */
eSOrgUsrService.saveAlertCalledToES(orgUsr); eSOrgUsrService.saveAlertCalledToES(orgUsr);
syncCompany2Supervision(Lists.newArrayList(orgUsrDto.getSequenceNbr()));
return orgUsrDto; return orgUsrDto;
} }
...@@ -720,17 +725,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -720,17 +725,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue()); saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
public OrgUsrDto updateByIdOrgUsr(OrgUsrDto OrgUsrVo, Long id) throws Exception { public OrgUsrDto updateByIdOrgUsr(OrgUsrDto orgUsrVo, Long id) throws Exception {
// 修改单位信息 // 修改单位信息
OrgUsr orgUsr = new OrgUsr(); OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id); OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgUsrVo, orgUsr); BeanUtils.copyProperties(orgUsrVo, orgUsr);
// 判断是否修改所属单位 // 判断是否修改所属单位
if (!(oriOrgUsr.getParentId() != null ? oriOrgUsr.getParentId() : "").equals(OrgUsrVo.getParentId())) { if (!(oriOrgUsr.getParentId() != null ? oriOrgUsr.getParentId() : "").equals(orgUsrVo.getParentId())) {
/* 单位编辑后 code值也应做出修改 2021-09-09 陈召 开始 */ /* 单位编辑后 code值也应做出修改 2021-09-09 陈召 开始 */
OrgUsr parent = getById(OrgUsrVo.getParentId()); OrgUsr parent = getById(orgUsrVo.getParentId());
if (parent != null) { if (parent != null) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr()); orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
} }
...@@ -752,13 +758,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -752,13 +758,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// saveOrgUsr(orgUsr, oriOrgUsr); // saveOrgUsr(orgUsr, oriOrgUsr);
// 保存动态表单数据 // 保存动态表单数据
updateDynamicFormInstance(orgUsr.getSequenceNbr(), OrgUsrVo.getDynamicFormValue()); updateDynamicFormInstance(orgUsr.getSequenceNbr(), orgUsrVo.getDynamicFormValue());
/** /**
* 同步保存ES * 同步保存ES
*/ */
eSOrgUsrService.saveAlertCalledToES(orgUsr); eSOrgUsrService.saveAlertCalledToES(orgUsr);
OrgUsrVo.setBizOrgCode(orgUsr.getBizOrgCode()); orgUsrVo.setBizOrgCode(orgUsr.getBizOrgCode());
return OrgUsrVo;
syncCompany2Supervision(Lists.newArrayList(orgUsr.getSequenceNbr()));
return orgUsrVo;
} }
@Override @Override
...@@ -870,13 +878,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -870,13 +878,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
@Override @Override
public void saveCompany(List<OrgUsrDto> OrgUsrVo) throws Exception { public void saveCompany(List<OrgUsrDto> OrgUsrVo) {
List<Long> companyIdList = Lists.newArrayList();
for (int i = 0; i < OrgUsrVo.size(); i++) { for (int i = 0; i < OrgUsrVo.size(); i++) {
OrgUsr orgUsr = new OrgUsr(); OrgUsr orgUsr = new OrgUsr();
BeanUtils.copyProperties(OrgUsrVo.get(i), orgUsr); BeanUtils.copyProperties(OrgUsrVo.get(i), orgUsr);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY); orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
saveOrgUsrDynamicFormInstance(orgUsr, OrgUsrVo.get(i).getDynamicFormValue()); OrgUsrDto orgUsrDto = saveOrgUsrDynamicFormInstance(orgUsr, OrgUsrVo.get(i).getDynamicFormValue());
companyIdList.add(orgUsrDto.getSequenceNbr());
} }
syncCompany2Supervision(companyIdList);
} }
@Override @Override
...@@ -2080,6 +2091,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -2080,6 +2091,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
@Override @Override
public List<OrgUsr> getListByBizOrgTypeCode(String orgTypes, String orgCode) { public List<OrgUsr> getListByBizOrgTypeCode(String orgTypes, String orgCode) {
List<String> orgTypeList = new ArrayList<>(); List<String> orgTypeList = new ArrayList<>();
...@@ -2098,4 +2110,31 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -2098,4 +2110,31 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
List<OrgUsr> list = orgUsrMapper.companyDeptListWithPersonCount(param); List<OrgUsr> list = orgUsrMapper.companyDeptListWithPersonCount(param);
return buildTreeParallel(list); return buildTreeParallel(list);
} }
/**
* 同步单位信息到防火监督point表
*
* @param companyIdList
*/
protected void syncCompany2Supervision(List<Long> companyIdList) {
if (ValidationUtil.isEmpty(companyIdList)) {
return;
}
String token = RequestContext.getToken();
String appKey = RequestContext.getAppKey();
String product = RequestContext.getProduct();
new Thread(() -> companyIdList.forEach(id -> {
try {
RequestContext.setAppKey(appKey);
RequestContext.setToken(token);
RequestContext.setProduct(product);
OrgUsrFormDto formDto = this.selectCompanyById(id);
if (!ValidationUtil.isEmpty(formDto) && OrgPersonEnum.公司.getKey().equals(formDto.getBizOrgType())) {
emqKeeper.getMqttClient().publish(airportAddTopic, JSON.toJSONString(formDto).getBytes(), 2, false);
}
} catch (Exception e) {
logger.debug("syncCompany2Supervision error:", e.getMessage());
e.printStackTrace();
}
})).start();
}
} }
...@@ -94,6 +94,8 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -94,6 +94,8 @@ public class EquipmentAlarmController extends AbstractBaseController {
@RequestParam(value = "alarmType", required = false) String alarmType, @RequestParam(value = "alarmType", required = false) String alarmType,
@RequestParam(value = "type", required = false) String type, @RequestParam(value = "type", required = false) String type,
@RequestParam(value = "buildIds", required = false) List<String> buildIds, @RequestParam(value = "buildIds", required = false) List<String> buildIds,
@RequestParam(value = "id", required = false) String id,
@RequestParam(value = "cleanStatus", required = false) String cleanStatus,
CommonPageable commonPageable) { CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) { if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1); commonPageable.setPageNumber(1);
...@@ -139,6 +141,14 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -139,6 +141,14 @@ public class EquipmentAlarmController extends AbstractBaseController {
request9.setName("buildIds"); request9.setName("buildIds");
request9.setValue(ObjectUtils.isEmpty(buildIds) ? null : buildIds); request9.setValue(ObjectUtils.isEmpty(buildIds) ? null : buildIds);
queryRequests.add(request9); queryRequests.add(request9);
CommonRequest request10 = new CommonRequest();
request10.setName("id");
request10.setValue(StringUtil.isNotEmpty(id) ? StringUtils.trimToNull(id) : null);
queryRequests.add(request10);
CommonRequest request11 = new CommonRequest();
request11.setName("cleanStatus");
request11.setValue(StringUtil.isNotEmpty(cleanStatus) ? StringUtils.trimToNull(cleanStatus) : null);
queryRequests.add(request11);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<Map<String, Object>> list = iEquipmentSpecificAlarmService.listPage(param); Page<Map<String, Object>> list = iEquipmentSpecificAlarmService.listPage(param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
...@@ -200,6 +210,8 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -200,6 +210,8 @@ public class EquipmentAlarmController extends AbstractBaseController {
@RequestParam(value = "systemCode", required = false) String systemCode, @RequestParam(value = "systemCode", required = false) String systemCode,
@RequestParam(value = "buildId", required = false) String buildId, @RequestParam(value = "buildId", required = false) String buildId,
// @RequestParam(value = "equipmentCode", required = false) String equipmentCode, // @RequestParam(value = "equipmentCode", required = false) String equipmentCode,
@RequestParam(value = "id", required = false) String id,
@RequestParam(value = "cleanStatus", required = false) String cleanStatus,
CommonPageable commonPageable) { CommonPageable commonPageable) {
List<CommonRequest> queryRequests = new ArrayList<>(); List<CommonRequest> queryRequests = new ArrayList<>();
CommonRequest request = new CommonRequest(); CommonRequest request = new CommonRequest();
...@@ -235,6 +247,14 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -235,6 +247,14 @@ public class EquipmentAlarmController extends AbstractBaseController {
request9.setName("buildId"); request9.setName("buildId");
request9.setValue(StringUtil.isNotEmpty(buildId) ? StringUtils.trimToNull(buildId) : null); request9.setValue(StringUtil.isNotEmpty(buildId) ? StringUtils.trimToNull(buildId) : null);
queryRequests.add(request9); queryRequests.add(request9);
CommonRequest request10 = new CommonRequest();
request10.setName("id");
request10.setValue(StringUtil.isNotEmpty(id) ? StringUtils.trimToNull(id) : null);
queryRequests.add(request10);
CommonRequest request11 = new CommonRequest();
request11.setName("cleanStatus");
request11.setValue(StringUtil.isNotEmpty(cleanStatus) ? StringUtils.trimToNull(cleanStatus) : null);
queryRequests.add(request11);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
org.springframework.data.domain.Page<AlarmListDataVO> list = iEquipmentSpecificAlarmService.listAlarmsPage(param); org.springframework.data.domain.Page<AlarmListDataVO> list = iEquipmentSpecificAlarmService.listAlarmsPage(param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
......
...@@ -35,6 +35,7 @@ import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO; ...@@ -35,6 +35,7 @@ import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO; import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo; import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo;
import com.yeejoin.equipmanage.common.vo.VideoOnEquipmentSpecificVo;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.service.IEquipmentDetailService; import com.yeejoin.equipmanage.service.IEquipmentDetailService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce; import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
...@@ -42,6 +43,19 @@ import com.yeejoin.equipmanage.service.impl.FireFightingSystemServiceImpl; ...@@ -42,6 +43,19 @@ import com.yeejoin.equipmanage.service.impl.FireFightingSystemServiceImpl;
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.Value;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -159,8 +173,8 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -159,8 +173,8 @@ public class EquipmentSpecificController extends AbstractBaseController {
@RequestMapping(value = "/getOneCard", method = RequestMethod.GET) @RequestMapping(value = "/getOneCard", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "组装组态使用装备卡片数据") @ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "组装组态使用装备卡片数据")
public Object getOneCard(Long id , String type) { public Object getOneCard(Long id, String type) {
return equipmentSpecificSerivce.getOneCard(id , type); return equipmentSpecificSerivce.getOneCard(id, type);
} }
/** /**
...@@ -246,12 +260,13 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -246,12 +260,13 @@ public class EquipmentSpecificController extends AbstractBaseController {
/** /**
* 根据specificId删除装备相关数据 * 根据specificId删除装备相关数据
*
* @param specificId id * @param specificId id
* @return ResponseModel * @return ResponseModel
*/ */
@DeleteMapping(value = "/delEquipmentBySpecificId") @DeleteMapping(value = "/delEquipmentBySpecificId")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation( value = "删除装备相关所有数据", notes = "删除装备相关所有数据") @ApiOperation(value = "删除装备相关所有数据", notes = "删除装备相关所有数据")
public ResponseModel delEquipmentBySpecificId(@RequestParam Long specificId) { public ResponseModel delEquipmentBySpecificId(@RequestParam Long specificId) {
EquipmentSpecific equipmentSpecific = equipmentSpecificSerivce.getById(specificId); EquipmentSpecific equipmentSpecific = equipmentSpecificSerivce.getById(specificId);
Boolean result = equipmentSpecificSerivce.delEquipmentSpecific(specificId); Boolean result = equipmentSpecificSerivce.delEquipmentSpecific(specificId);
...@@ -268,22 +283,23 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -268,22 +283,23 @@ public class EquipmentSpecificController extends AbstractBaseController {
log.error("刷新装备分类树缓存失败" + e.getMessage()); log.error("刷新装备分类树缓存失败" + e.getMessage());
} }
} }
/** /**
* 根据specificIds删除装备相关数据 * 根据specificIds删除装备相关数据
*
* @param specificIds id * @param specificIds id
* @return ResponseModel * @return ResponseModel
*/ */
@DeleteMapping(value = "/delAllEquipmentBySpecificIds") @DeleteMapping(value = "/delAllEquipmentBySpecificIds")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation( value = "批量删除装备相关所有数据", notes = "批量删除装备相关所有数据") @ApiOperation(value = "批量删除装备相关所有数据", notes = "批量删除装备相关所有数据")
public ResponseModel delEquipmentBySpecificId(@RequestBody List<Long> specificIds) { public ResponseModel delEquipmentBySpecificId(@RequestBody List<Long> specificIds) {
if(ObjectUtils.isEmpty(specificIds)){ if (ObjectUtils.isEmpty(specificIds)) {
return CommonResponseUtil.failure("参数为空"); return CommonResponseUtil.failure("参数为空");
} }
specificIds.forEach(specificId->{ specificIds.forEach(specificId -> {
equipmentSpecificSerivce.delEquipmentBySpecificId(specificId); equipmentSpecificSerivce.delEquipmentBySpecificId(specificId);
}); });
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
...@@ -293,4 +309,11 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -293,4 +309,11 @@ public class EquipmentSpecificController extends AbstractBaseController {
public ResponseModel getFessIndexDetails() { public ResponseModel getFessIndexDetails() {
return CommonResponseUtil.success(equipmentSpecificSerivce.getFessIndexDetails()); return CommonResponseUtil.success(equipmentSpecificSerivce.getFessIndexDetails());
} }
@RequestMapping(value = "/videoOnEquipmentSpecific", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "摄像头绑定设备", notes = "摄像头绑定设备")
public ResponseModel videoOnEquipmentSpecific(@RequestBody VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo) {
return CommonResponseUtil.success(equipmentSpecificSerivce.videoOnEquipmentSpecific(videoOnEquipmentSpecificVo));
}
} }
...@@ -629,7 +629,7 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -629,7 +629,7 @@ public class FireFightingSystemController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "按照组态格式获取系统报警,或者建筑报警列表", notes = "按照组态格式获取系统报警,或者建筑报警列表") @ApiOperation(value = "按照组态格式获取系统报警,或者建筑报警列表", notes = "按照组态格式获取系统报警,或者建筑报警列表")
@GetMapping(value = "/getEquipmentAlarmBySystemIdOrSourceIdVO/{Systemtype}/{id}") @GetMapping(value = "/getEquipmentAlarmBySystemIdOrSourceIdVO/{Systemtype}/{id}")
public IPage<EquipmentAlarmBySystemIdOrSourceIdVO> getEquipmentAlarmBySystemIdOrSourceIdVO(int pageSize, int current, Integer confirmType, String createDate, String type, @PathVariable String Systemtype, @PathVariable Long id) { public IPage<EquipmentAlarmBySystemIdOrSourceIdVO> getEquipmentAlarmBySystemIdOrSourceIdVO(Integer pageSize, Integer current, Integer confirmType, String createDate, String type, @PathVariable String Systemtype, @PathVariable Long id) {
Page<EquipmentAlarmBySystemIdOrSourceIdVO> page = new Page(); Page<EquipmentAlarmBySystemIdOrSourceIdVO> page = new Page();
page.setCurrent(current); page.setCurrent(current);
page.setSize(pageSize); page.setSize(pageSize);
......
...@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipment; import com.yeejoin.equipmanage.common.datasync.entity.FireEquipment;
import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto; import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto;
import com.yeejoin.equipmanage.common.dto.UserDto; import com.yeejoin.equipmanage.common.dto.UserDto;
import com.yeejoin.equipmanage.common.entity.EquipmentCategory; import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.MaintenanceResourceData;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO; import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo; import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
...@@ -201,9 +198,13 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -201,9 +198,13 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
*/ */
List<Map<String, String>> getBoxTropicsIndexDetails(); List<Map<String, String>> getBoxTropicsIndexDetails();
/** /**
* 统计数据 * 统计数据
* @return * @return
*/ */
List<Map<String, Object>> queryCompanyStaData(); List<Map<String, Object>> queryCompanyStaData();
String getEquipmentBySpecificId(@Param("specificId") Long specificId);
} }
...@@ -3,6 +3,9 @@ package com.yeejoin.equipmanage.mapper; ...@@ -3,6 +3,9 @@ package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific; import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -11,4 +14,5 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -11,4 +14,5 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface VideoEquipmentSpecificMapper extends BaseMapper<VideoEquipmentSpecific> { public interface VideoEquipmentSpecificMapper extends BaseMapper<VideoEquipmentSpecific> {
List<VideoEquipmentSpecific> findBySpecificIdAndVideoIdIn(@Param("equipmentSpecificId") Long equipmentSpecificId, @Param("list") List<Long> videoIdList);
} }
package com.yeejoin.equipmanage.service; package com.yeejoin.equipmanage.service;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
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;
...@@ -16,14 +12,13 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific; ...@@ -16,14 +12,13 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO; import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import com.yeejoin.equipmanage.common.entity.vo.DetailPaneVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo; import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO; import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO;
import com.yeejoin.equipmanage.common.vo.EquipFor3DVO; import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.common.vo.EquipmentDate;
import com.yeejoin.equipmanage.common.vo.EquipmentDetailVo; import java.util.LinkedHashMap;
import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo; import java.util.List;
import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo; import java.util.Map;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -168,35 +163,47 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -168,35 +163,47 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
/** /**
* 根据specificId删除相关数据 * 根据specificId删除相关数据
*
* @param specificId specificId * @param specificId specificId
* @return Boolean * @return Boolean
*/ */
Boolean delEquipmentBySpecificId(Long specificId); Boolean delEquipmentBySpecificId(Long specificId);
/** /**
* 集成页面刷新,发送数据时调用 * 集成页面刷新,发送数据时调用
* @param systemTypeCode *
*/ * @param systemTypeCode
void integrationPageSysDataRefresh(String systemTypeCode); */
void integrationPageSysDataRefresh(String systemTypeCode);
/**
* 更新设备表实时指标状态 /**
* @param indexs * 更新设备表实时指标状态
*/ *
void updateEquipmentSpecIndexRealtimeData(List<EquipmentSpecificIndex> indexs); * @param indexs
*/
void updateEquipmentSpecIndexRealtimeData(List<EquipmentSpecificIndex> indexs);
List<EquipmentSpecificVo> getEquipAndCarIotcodeByIotcode(String iotCode); List<EquipmentSpecificVo> getEquipAndCarIotcodeByIotcode(String iotCode);
/** /**
* 获取中州环境监测指标详情 * 获取中州环境监测指标详情
*
* @return * @return
*/ */
Map<String, List<Map<String, String>>> getFessIndexDetails(); Map<String, List<Map<String, String>>> getFessIndexDetails();
/** /**
* 更新redis 统计数据 * 更新redis 统计数据
*/ */
void refreshStaData(); void refreshStaData();
/* 设备绑定摄像头
*
* @param videoOnEquipmentSpecificVo
* @return
*/
Boolean videoOnEquipmentSpecific(VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo);
} }
...@@ -3,10 +3,19 @@ package com.yeejoin.equipmanage.service; ...@@ -3,10 +3,19 @@ package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific; import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific;
import java.util.List;
/** /**
* @author ZeHua Li * @author ZeHua Li
* @date 2020/11/23 15:42 * @date 2020/11/23 15:42
* @since v2.0 * @since v2.0
*/ */
public interface IVideoEquipmentSpecificService extends IService<VideoEquipmentSpecific> { public interface IVideoEquipmentSpecificService extends IService<VideoEquipmentSpecific> {
/**
* 获取设备或摄像头ID绑定集合
* @param equipmentSpecificId
* @param videoIdList
* @return
*/
List<VideoEquipmentSpecific> findBySpecificIdAndVideoIdIn(Long equipmentSpecificId, List<Long> videoIdList);
} }
...@@ -126,6 +126,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -126,6 +126,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Autowired @Autowired
private JCSRemoteService jcsRemoteService; private JCSRemoteService jcsRemoteService;
@Value("${window.vedioFormat}")
private String vedioFormat;
@Autowired @Autowired
private SourceSceneMapper sourceSceneMapper; private SourceSceneMapper sourceSceneMapper;
...@@ -780,6 +782,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -780,6 +782,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
x.setLocation(x.getAddress()); x.setLocation(x.getAddress());
} }
} }
x.setVedioFormat(vedioFormat);
x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode())); x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode()));
}); });
} }
......
...@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.service.impl;
import com.alibaba.fastjson.JSON; 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.extension.service.impl.ServiceImpl; 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;
...@@ -11,16 +12,22 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific; ...@@ -11,16 +12,22 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog;
import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO; import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO;
import com.yeejoin.equipmanage.common.enums.AlarmCleanTypeEnum;
import com.yeejoin.equipmanage.common.enums.AlarmStatusEnum;
import com.yeejoin.equipmanage.common.enums.AlarmTypeEnum; import com.yeejoin.equipmanage.common.enums.AlarmTypeEnum;
import com.yeejoin.equipmanage.common.enums.TopicEnum; import com.yeejoin.equipmanage.common.enums.TopicEnum;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.fegin.JcsFeign; import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.ConfirmAlarmMapper; import com.yeejoin.equipmanage.mapper.ConfirmAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.VideoMapper; import com.yeejoin.equipmanage.mapper.VideoMapper;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.remote.WebMqttHandler; 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.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -28,6 +35,7 @@ import org.springframework.util.ObjectUtils; ...@@ -28,6 +35,7 @@ import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -74,9 +82,20 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -74,9 +82,20 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Value("${systemctl.jcs.switch}") @Value("${systemctl.jcs.switch}")
private Boolean jcsSwitch; private Boolean jcsSwitch;
@Value("${window.vedioFormat}")
String vedioFormat;
@Autowired @Autowired
private RuleConfirmAlarmService ruleConfirmAlamService; private RuleConfirmAlarmService ruleConfirmAlamService;
@Autowired
private EquipmentSpecificMapper equipmentSpecificMapper;
@Autowired
private EquipmentSpecificAlarmMapper equipmentSpecificAlarmMapper;
@Override @Override
public Map<String, Object> getDetailsById(Long alarmId, Long equipId, String type, String area) { public Map<String, Object> getDetailsById(Long alarmId, Long equipId, String type, String area) {
final String videoType = "video"; final String videoType = "video";
...@@ -85,6 +104,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -85,6 +104,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
if (videoType.equals(type)) { if (videoType.equals(type)) {
List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipId); List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipId);
video.forEach(action -> { video.forEach(action -> {
action.setVedioFormat(vedioFormat);
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode())); action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
}); });
res.put("video", video); res.put("video", video);
...@@ -103,6 +123,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -103,6 +123,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
} }
videoBySpeId.forEach(action -> { videoBySpeId.forEach(action -> {
action.setVedioFormat(vedioFormat);
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode())); action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
}); });
res.put("data", specificAlarm); res.put("data", specificAlarm);
...@@ -122,6 +143,27 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -122,6 +143,27 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
if (!ObjectUtils.isEmpty(alarmLog)) { if (!ObjectUtils.isEmpty(alarmLog)) {
Long equipmentSpecificAlarmId = alarmLog.getEquipmentSpecificAlarmId(); Long equipmentSpecificAlarmId = alarmLog.getEquipmentSpecificAlarmId();
ent.setEquipmentSpecificAlarmId(equipmentSpecificAlarmId); ent.setEquipmentSpecificAlarmId(equipmentSpecificAlarmId);
String cleanType = equipmentSpecificMapper.getEquipmentBySpecificId(alarmLog.getEquipmentSpecificId());
if (StringUtil.isNotEmpty(cleanType) && AlarmCleanTypeEnum.QRXC.getCode().equals(cleanType)) {
EquipmentSpecificAlarm alarm = equipmentSpecificAlarmMapper.selectById(alarmLog.getEquipmentSpecificAlarmId());
alarm.setStatus(AlarmStatusEnum.HF.getCode());
equipmentSpecificAlarmMapper.updateById(alarm);
if (isBatch == 1) {
List<EquipmentSpecificAlarmLog> logs = equipmentSpecificAlarmLogService.getIsConfirmByAlarmId(equipmentSpecificAlarmId, "0");
logs = logs.stream().map(x -> {
BeanUtils.copyProperties(ent, x);
x.setCleanTime(new Date());
x.setStatus(AlarmStatusEnum.HF.getCode());
return x;
}).collect(Collectors.toList());
equipmentSpecificAlarmLogService.updateBatchById(logs);
} else {
ent.setCleanTime(new Date());
ent.setStatus(AlarmStatusEnum.HF.getCode());
equipmentSpecificAlarmLogService.updateById(ent);
}
return;
}
// 如果是批量确警,先查询,再确警,用于批量消息推送 // 如果是批量确警,先查询,再确警,用于批量消息推送
isBatch = ent.getIsBatch(); isBatch = ent.getIsBatch();
if (isBatch == 1) { if (isBatch == 1) {
......
...@@ -126,7 +126,7 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe ...@@ -126,7 +126,7 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
equipmentDetail.setEquPropertyList(equPropertyList); equipmentDetail.setEquPropertyList(equPropertyList);
ManufacturerInfo manufacturerInfo = manufacturerInfoMapper.selectById(equipmentDetail.getManufacturerId()); ManufacturerInfo manufacturerInfo = manufacturerInfoMapper.selectById(equipmentDetail.getManufacturerId());
if (manufacturerInfo != null) { if (manufacturerInfo != null) {
manufacturerInfo.setImg(fileServer + manufacturerInfo.getImg()); manufacturerInfo.setImg(manufacturerInfo.getImg());
} }
equipmentDetail.setManufacturerInfo(manufacturerInfo); equipmentDetail.setManufacturerInfo(manufacturerInfo);
equipmentDetail.setImg(getEquipFileList(id, FileTypeEnum.image.toString())); equipmentDetail.setImg(getEquipFileList(id, FileTypeEnum.image.toString()));
......
...@@ -126,8 +126,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -126,8 +126,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
@Override @Override
public boolean addEquipmentDef(Equipment equipment) throws IllegalArgumentException { public boolean addEquipmentDef(Equipment equipment) throws IllegalArgumentException {
try {
// 查询装备定义名陈是否重复 // 查询装备定义名陈是否重复
nameDuplicate(equipment); nameDuplicate(equipment);
// 设置code属性 // 设置code属性
...@@ -138,19 +136,20 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -138,19 +136,20 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
equipment.setCode(code); equipment.setCode(code);
} }
int num = equipmentMapper.insert(equipment); int num = equipmentMapper.insert(equipment);
// saveEquipmentQRCodes(equipment); // saveEquipmentQRCodes(equipment);
JSONObject equipRuleParams = new JSONObject(); JSONObject equipRuleParams = new JSONObject();
equipRuleParams.put("name", equipment.getName()); equipRuleParams.put("name", equipment.getName());
equipRuleParams.put("inspectionSpecId", equipment.getInspectionSpec()); equipRuleParams.put("inspectionSpecId", equipment.getInspectionSpec());
patrolFeign.getEquipDetail(equipRuleParams.toJSONString()); try {
patrolFeign.getEquipDetail(equipRuleParams.toJSONString());
} catch (Exception e) {
log.error("新增装备定义操作中,检测到巡检服务未启动或启动出错!");
}
if (num > 0) { if (num > 0) {
return true; return true;
} }
} catch (Exception e) { return false;
e.printStackTrace();
throw new RuntimeException("录入的装备名称重复!");
}
return false;
} }
// public void saveEquipmentQRCodes(Equipment equipment) { // public void saveEquipmentQRCodes(Equipment equipment) {
...@@ -232,7 +231,11 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -232,7 +231,11 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
JSONObject equipRuleParams = new JSONObject(); JSONObject equipRuleParams = new JSONObject();
equipRuleParams.put("name", equipment1.getName()); equipRuleParams.put("name", equipment1.getName());
equipRuleParams.put("inspectionSpecId", equipment1.getInspectionSpec()); equipRuleParams.put("inspectionSpecId", equipment1.getInspectionSpec());
patrolFeign.getEquipDetail(equipRuleParams.toJSONString()); try {
patrolFeign.getEquipDetail(equipRuleParams.toJSONString());
} catch (Exception e) {
log.error("编辑装备定义操作中,检测到巡检服务未启动或启动出错!");
}
if (savedEquipment > 0) { if (savedEquipment > 0) {
return true; return true;
} }
......
...@@ -208,10 +208,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -208,10 +208,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
|| AlarmTypeEnum.PB.getCode().equals(type)) { || AlarmTypeEnum.PB.getCode().equals(type)) {
dataVO.setAlarmType(AlarmTypeEnum.getTypeByCode(String.valueOf(type))); dataVO.setAlarmType(AlarmTypeEnum.getTypeByCode(String.valueOf(type)));
} }
dataVO.setType(String.valueOf(x.get("type")));
dataVO.setAlarmInfo(x.get("fireEquipmentName") + dataVO.getAlarmType()); dataVO.setAlarmInfo(x.get("fireEquipmentName") + dataVO.getAlarmType());
dataVO.setEquipSpeId(Long.valueOf(String.valueOf(x.get("fireEquipmentId")))); dataVO.setEquipSpeId(Long.valueOf(String.valueOf(x.get("fireEquipmentId"))));
dataVO.setAlarmId(Long.valueOf(String.valueOf(x.get("alarmId")))); dataVO.setAlarmId(Long.valueOf(String.valueOf(x.get("alarmId"))));
dataVO.setAlarmTypeCode(String.valueOf(x.get("fireEquipmentSpecificIndexKey"))); dataVO.setAlarmTypeCode(String.valueOf(x.get("fireEquipmentSpecificIndexKey")));
dataVO.setCleanStatus(String.valueOf(x.get("cleanStatus")));
dataVO.setCleanStatusVal(String.valueOf(x.get("cleanStatusVal")));
res.add(dataVO); res.add(dataVO);
}); });
} }
......
...@@ -115,6 +115,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -115,6 +115,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
private ICarService carService; private ICarService carService;
@Autowired
private IVideoEquipmentSpecificService videoEquipmentSpecificService;
@Value("${systemctl.dict.iot-core-param}") @Value("${systemctl.dict.iot-core-param}")
private String iotCoreParam; private String iotCoreParam;
...@@ -1604,4 +1606,33 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1604,4 +1606,33 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
return SourcesStatisticsImpl.PREFIX_CATEGORY_COUNT + row.get("bizOrgCode").toString() + "_" + SourceTypeEnum.EQUIPMENT.getCode() + "_" + row.get("categoryCode").toString(); return SourcesStatisticsImpl.PREFIX_CATEGORY_COUNT + row.get("bizOrgCode").toString() + "_" + SourceTypeEnum.EQUIPMENT.getCode() + "_" + row.get("categoryCode").toString();
} }
public Boolean videoOnEquipmentSpecific(VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo) {
Long equipmentSpecificId = videoOnEquipmentSpecificVo.getEquipmentSpecificId();
List<Long> videoIdList = videoOnEquipmentSpecificVo.getVideoIdList();
if (equipmentSpecificId != null) {
EquipmentSpecific equipmentSpecific = this.baseMapper.selectById(equipmentSpecificId);
if (!ObjectUtils.isEmpty(equipmentSpecific)) {
QueryWrapper<VideoEquipmentSpecific> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("equipment_specific_id", equipmentSpecificId);
boolean remove = videoEquipmentSpecificService.remove(queryWrapper);
if (remove) {
List<VideoEquipmentSpecific> videoSpecificList = new ArrayList<>();
videoIdList.parallelStream().forEach(x -> {
VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
videoEquipmentSpecific.setVideoId(x);
videoEquipmentSpecific.setEquipmentSpecificId(equipmentSpecificId);
videoSpecificList.add(videoEquipmentSpecific);
});
videoEquipmentSpecificService.saveBatch(videoSpecificList);
return Boolean.TRUE;
} else {
throw new RuntimeException("移除设备摄像头绑定关系失败!");
}
} else {
throw new RuntimeException("未获取到此设备!");
}
} else {
throw new RuntimeException("设备ID为空!");
}
}
} }
...@@ -179,8 +179,8 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou ...@@ -179,8 +179,8 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou
public List<MaintenanceResourceDto> findTreeById(Long id) { public List<MaintenanceResourceDto> findTreeById(Long id) {
List<MaintenanceResourceDto> list = maintenanceResourceMapper.findTreeById(id); List<MaintenanceResourceDto> list = maintenanceResourceMapper.findTreeById(id);
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
List<MaintenanceResourceDto> dtoList = TreeNodeUtil.assembleTreeNotFilter(list); List<MaintenanceResourceDto> dtoList = TreeNodeUtil.assembleTreeNotFilter(list);//&& x.getId().equals(Long.toString(id)) 这一段用于生成树之后并没有把树子节点数据从list列表删除造成的脏数据的问题 by chenhao 2022-01-12
List<MaintenanceResourceDto> collect = dtoList.stream().filter(x -> !MaintenanceResourceEnum.CLASSIFY.getValue().equals(x.getType())).collect(Collectors.toList()); List<MaintenanceResourceDto> collect = dtoList.stream().filter(x -> !MaintenanceResourceEnum.CLASSIFY.getValue().equals(x.getType()) && x.getId().equals(Long.toString(id))).collect(Collectors.toList());
return collect; return collect;
} }
return Lists.newArrayList(); return Lists.newArrayList();
......
...@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific; import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific;
import com.yeejoin.equipmanage.mapper.VideoEquipmentSpecificMapper; import com.yeejoin.equipmanage.mapper.VideoEquipmentSpecificMapper;
import com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService; import com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @author ZeHua Li * @author ZeHua Li
* @date 2020/11/23 15:43 * @date 2020/11/23 15:43
...@@ -13,4 +16,11 @@ import org.springframework.stereotype.Service; ...@@ -13,4 +16,11 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class VideoEquipmentSpecificImpl extends ServiceImpl<VideoEquipmentSpecificMapper,VideoEquipmentSpecific> implements IVideoEquipmentSpecificService { public class VideoEquipmentSpecificImpl extends ServiceImpl<VideoEquipmentSpecificMapper,VideoEquipmentSpecific> implements IVideoEquipmentSpecificService {
@Autowired
private VideoEquipmentSpecificMapper videoEquipmentSpecificMapper;
@Override
public List<VideoEquipmentSpecific> findBySpecificIdAndVideoIdIn(Long equipmentSpecificId, List<Long> videoIdList) {
return videoEquipmentSpecificMapper.findBySpecificIdAndVideoIdIn(equipmentSpecificId, videoIdList);
}
} }
...@@ -67,8 +67,8 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -67,8 +67,8 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Value("${equip.security.code}") @Value("${equip.security.code}")
String securityMonitorCode; String securityMonitorCode;
@Value("${param.isUseVideoTranscoding}") @Value("${window.vedioFormat}")
String isUseVideoTranscoding; String vedioFormat;
@Autowired @Autowired
VideoMapper videoMapper; VideoMapper videoMapper;
...@@ -501,7 +501,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -501,7 +501,7 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Override @Override
public String getVideoUrl(String videoId, String presetIndex, String defaultUrl, String code) { public String getVideoUrl(String videoId, String presetIndex, String defaultUrl, String code) {
if ("off".equals(isUseVideoTranscoding)) { if ("hls".equals(vedioFormat)) {
String url = getVideoUrl(code); String url = getVideoUrl(code);
return ObjectUtils.isEmpty(url) ? defaultUrl : url; return ObjectUtils.isEmpty(url) ? defaultUrl : url;
} }
......
...@@ -121,7 +121,11 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc ...@@ -121,7 +121,11 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
String aircraft = ""; String aircraft = "";
List<AlertFormValue> list1 = list.stream().filter(formValue -> formValue.getFieldCode().equals("aircraft") || formValue.getFieldCode().equals("aircraftModel")).collect(Collectors.toList()); List<AlertFormValue> list1 = list.stream().filter(formValue -> formValue.getFieldCode().equals("aircraft") || formValue.getFieldCode().equals("aircraftModel")).collect(Collectors.toList());
if(list1.size() > 0) { if(list1.size() > 0) {
aircraft = list1.get(0).getFieldValueCode(); if(!ValidationUtil.isEmpty(list1.get(0).getFieldValue())) {
aircraft = list1.get(0).getFieldValue();
} else {
aircraft = list1.get(0).getFieldValueCode();
}
} }
LambdaQueryWrapper<Aircraft> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Aircraft> queryWrapper = new LambdaQueryWrapper<>();
......
...@@ -640,11 +640,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -640,11 +640,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/* /*
* if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); } * if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); }
*/ */
// if("flightNumber".equals(alertFormValue.getFieldCode()) || "aircraftModel".equals(alertFormValue.getFieldCode())) { if("flightNumber".equals(alertFormValue.getFieldCode())) {
// listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), alertFormValue.getFieldValueCode())); listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), alertFormValue.getFieldValueCode()));
// } else { } else {
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), valueCode)); if( "aircraftModel".equals(alertFormValue.getFieldCode())) {
// } if(ValidationUtil.isEmpty(valueCode)) {
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), alertFormValue.getFieldValueCode()));
} else {
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), valueCode));
}
} else {
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), valueCode));
}
}
}); });
map.put("data", listdate); map.put("data", listdate);
......
...@@ -517,10 +517,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -517,10 +517,10 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
responseLevel = list1.get(0).getFieldValue(); responseLevel = list1.get(0).getFieldValue();
} }
definitions.put("rescueGrid", alertCalled.getAddress()); definitions.put("rescueGrid", ValidationUtil.isEmpty(alertCalled.getAddress() ) ? "" : alertCalled.getAddress());
definitions.put("type", alertCalled.getAlertType()); definitions.put("type", alertCalled.getAlertType());
definitions.put("contactUser", alertCalled.getContactUser()); definitions.put("contactUser", ValidationUtil.isEmpty(alertCalled.getContactUser() ) ? "" : alertCalled.getContactUser());
definitions.put("contactPhone", alertCalled.getContactPhone()); definitions.put("contactPhone", ValidationUtil.isEmpty(alertCalled.getContactPhone() ) ? "" : alertCalled.getContactPhone());
definitions.put("replaceContent", replaceContent); definitions.put("replaceContent", replaceContent);
definitions.put("responseLevel", responseLevel); definitions.put("responseLevel", responseLevel);
definitions.put("callTime", definitions.put("callTime",
......
...@@ -53,6 +53,7 @@ import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo; ...@@ -53,6 +53,7 @@ import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailRiskVo; import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailRiskVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailVo; import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerListVo; import com.yeejoin.amos.latentdanger.business.vo.LatentDangerListVo;
import com.yeejoin.amos.latentdanger.common.enums.AuditEnum;
import com.yeejoin.amos.latentdanger.common.enums.DangerHandleStateEnum; import com.yeejoin.amos.latentdanger.common.enums.DangerHandleStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.DictTypeEnum; import com.yeejoin.amos.latentdanger.common.enums.DictTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.ExecuteStateEnum; import com.yeejoin.amos.latentdanger.common.enums.ExecuteStateEnum;
...@@ -97,17 +98,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -97,17 +98,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
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 java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.yeejoin.amos.latentdanger.business.util.RandomUtil.buildOrderNo; import static com.yeejoin.amos.latentdanger.business.util.RandomUtil.buildOrderNo;
...@@ -251,7 +242,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -251,7 +242,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
if (ValidationUtil.isEmpty(dangerTypeEnum)) { if (ValidationUtil.isEmpty(dangerTypeEnum)) {
throw new Exception("检查类型参数有误"); throw new Exception("检查类型参数有误");
} }
Date endTime = this.GetTargetEndTime(param.getReformLimitDate());
param.setReformLimitDate(endTime);
// 保存隐患 // 保存隐患
LatentDanger latentDanger = saveLatentDanger(param, userId, departmentId, businessKey, orgCode, LatentDanger latentDanger = saveLatentDanger(param, userId, departmentId, businessKey, orgCode,
dangerTypeEnum); dangerTypeEnum);
...@@ -326,6 +318,16 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -326,6 +318,16 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
// riskFactorMapper.updateControlStatus(riskFactorBo); // riskFactorMapper.updateControlStatus(riskFactorBo);
// } // }
public static Date GetTargetEndTime(Date target) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(target);
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
Date end = calendar.getTime();
return end;
}
// TODO 使用远程调用替换 // TODO 使用远程调用替换
private void updateCheckInputDangerState(Long id, int code) { private void updateCheckInputDangerState(Long id, int code) {
latentDangerMapper.updateCheckInputDangerState(id, code); latentDangerMapper.updateCheckInputDangerState(id, code);
...@@ -369,18 +371,18 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -369,18 +371,18 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
Bean.copyExistPropertis(dangerDto, latentDanger); Bean.copyExistPropertis(dangerDto, latentDanger);
if (ValidationUtil.isEmpty(dangerDto.getId())) { if (ValidationUtil.isEmpty(dangerDto.getId())) {
// 新增 // 新增
latentDanger.setBusinessKey(businessKey == null?"":businessKey); latentDanger.setBusinessKey(businessKey == null ? "" : businessKey);
latentDanger.setDiscovererDepartmentId(departmentId == null?"":departmentId); latentDanger.setDiscovererDepartmentId(departmentId == null ? "" : departmentId);
latentDanger.setDiscovererUserId(userId == null?"": userId); latentDanger.setDiscovererUserId(userId == null ? "" : userId);
latentDanger.setOrgCode(orgCode == null?"":orgCode); latentDanger.setOrgCode(orgCode == null ? "" : orgCode);
latentDanger.setDangerType(dangerTypeEnum.getCode() == null?"":dangerTypeEnum.getCode()); latentDanger.setDangerType(dangerTypeEnum.getCode() == null ? "" : dangerTypeEnum.getCode());
latentDanger.setDangerTypeName(dangerTypeEnum.getName() == null?"":dangerTypeEnum.getName()); latentDanger.setDangerTypeName(dangerTypeEnum.getName() == null ? "" : dangerTypeEnum.getName());
if (LatentDangerBizTypeEnum.防火监督.getCode().equals(bizType)) { if (LatentDangerBizTypeEnum.防火监督.getCode().equals(bizType)) {
latentDanger.setDangerState(LatentDangerState.SupervisionDangerStateEnum.提交隐患.getCode() == null?"":LatentDangerState.SupervisionDangerStateEnum.提交隐患.getCode() ); latentDanger.setDangerState(LatentDangerState.SupervisionDangerStateEnum.提交隐患.getCode() == null ? "" : LatentDangerState.SupervisionDangerStateEnum.提交隐患.getCode());
latentDanger.setDangerStateName(LatentDangerState.SupervisionDangerStateEnum.提交隐患.getName() == null?"":LatentDangerState.SupervisionDangerStateEnum.提交隐患.getName()); latentDanger.setDangerStateName(LatentDangerState.SupervisionDangerStateEnum.提交隐患.getName() == null ? "" : LatentDangerState.SupervisionDangerStateEnum.提交隐患.getName());
} else if (LatentDangerBizTypeEnum.巡检.getCode().equals(bizType)) { } else if (LatentDangerBizTypeEnum.巡检.getCode().equals(bizType)) {
latentDanger.setDangerState(LatentDangerState.PatrolDangerStateEnum.待评审.getCode() == null?"":LatentDangerState.PatrolDangerStateEnum.待评审.getCode()); latentDanger.setDangerState(LatentDangerState.PatrolDangerStateEnum.待评审.getCode() == null ? "" : LatentDangerState.PatrolDangerStateEnum.待评审.getCode());
latentDanger.setDangerStateName(LatentDangerState.PatrolDangerStateEnum.待评审.getName() == null?"":LatentDangerState.PatrolDangerStateEnum.待评审.getName() ); latentDanger.setDangerStateName(LatentDangerState.PatrolDangerStateEnum.待评审.getName() == null ? "" : LatentDangerState.PatrolDangerStateEnum.待评审.getName());
} }
if (ValidationUtil.isEmpty(dangerDto.getDangerName())) { if (ValidationUtil.isEmpty(dangerDto.getDangerName())) {
latentDanger.setDangerName(dangerDto.getInputItemName()); latentDanger.setDangerName(dangerDto.getInputItemName());
...@@ -403,13 +405,16 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -403,13 +405,16 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
record.setExecuteUserName(userName); record.setExecuteUserName(userName);
record.setExecuteDepartmentId(departmentId); record.setExecuteDepartmentId(departmentId);
record.setExecuteDepartmentName(departmentName); record.setExecuteDepartmentName(departmentName);
record.setFlowJson(flowJson != null ? flowJson.toJSONString() : null);
record.setFlowTaskName(taskName); record.setFlowTaskName(taskName);
record.setDangerId(dangerId); record.setDangerId(dangerId);
record.setExecuteState(executeState); record.setExecuteState(executeState);
record.setExecuteResult(executeResult); record.setExecuteResult(executeResult);
record.setActionFlag(dangerState); record.setActionFlag(dangerState);
record.setRemark(remark); record.setRemark(remark);
if (!ValidationUtil.isEmpty(flowJson)) {
record.setFlowJson(flowJson.toJSONString());
record.setRemark(ValidationUtil.isEmpty(remark) ? flowJson.getString("remark") : remark);
}
record.setUpdateDate(new Date()); record.setUpdateDate(new Date());
latentDangerFlowRecordService.saveOrUpdate(record); latentDangerFlowRecordService.saveOrUpdate(record);
return record; return record;
...@@ -1148,13 +1153,14 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1148,13 +1153,14 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
ReginParams reginParams) throws Exception { ReginParams reginParams) throws Exception {
// 隐患的巡查信息 // 隐患的巡查信息
JSONObject bizInfo = latentDanger.getBizInfo(); JSONObject bizInfo = latentDanger.getBizInfo();
if (ValidationUtil.isEmpty(bizInfo) || ValidationUtil.isEmpty(bizInfo.get("planType")) || ValidationUtil.isEmpty(bizInfo.get("accompanyingUserId"))) { if (ValidationUtil.isEmpty(bizInfo) || ValidationUtil.isEmpty(bizInfo.get("planType")) || ValidationUtil.isEmpty(bizInfo.get("leadPeopleId"))) {
executeSubmitDto.setIsOk(false); executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("业务信息错误"); executeSubmitDto.setMsg("业务信息错误");
return executeSubmitDto; return executeSubmitDto;
} }
String planType = bizInfo.get("planType").toString(); String planType = bizInfo.get("planType").toString();
AgencyUserModel userModel = jcsFeignClient.getAmosIdByUserId((String) bizInfo.get("accompanyingUserId")).getResult(); // 获取检查组长
AgencyUserModel userModel = jcsFeignClient.getAmosIdByUserId((String) bizInfo.get("leadPeopleId")).getResult();
if (ValidationUtil.isEmpty(userModel)) { if (ValidationUtil.isEmpty(userModel)) {
executeSubmitDto.setIsOk(false); executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("业务信息错误"); executeSubmitDto.setMsg("业务信息错误");
...@@ -1264,6 +1270,20 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1264,6 +1270,20 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
return executeSubmitDto; return executeSubmitDto;
} }
// 当隐患当前节点状态是现场确认,在执行完节点后需要将检查组长设置为下个节点执行人
if (LatentDangerState.SupervisionDangerStateEnum.现场确认.getCode().equals(latentDanger.getDangerState()) &&
!ValidationUtil.isEmpty(latentDanger.getInstanceId()) && ExecuteTypeEnum.驳回.getCode().equals(preRecord.getExecuteState())) {
// 在检查组长驳回后再现场确认需要将检查组长id设置为下个节点执行人
Object resultObj = workflowExecuteService.setTaskAssign(latentDanger.getInstanceId(), checkLeaderId);
executeSubmitDto.setCheckLeaderId(userModel.getUserId());
if (!(Boolean) resultObj) {
executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("设置节点执行人失败");
return executeSubmitDto;
}
}
String nextState = ""; String nextState = "";
String nextStateName = ""; String nextStateName = "";
if (ExecuteTypeEnum.通过.getCode().equals(param.getExecuteType())) { if (ExecuteTypeEnum.通过.getCode().equals(param.getExecuteType())) {
...@@ -1292,18 +1312,32 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1292,18 +1312,32 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
nextStateName = LatentDangerState.SupervisionDangerStateEnum.整改完毕.getName(); nextStateName = LatentDangerState.SupervisionDangerStateEnum.整改完毕.getName();
} }
executeResultMsg = currentStateEnum.getName() + ExecuteTypeEnum.通过.getName(); executeResultMsg = currentStateEnum.getName() + ExecuteTypeEnum.通过.getName();
} else { } else {// 审核驳回
LatentDangerState.SupervisionDangerStateEnum nextStateEnum = LatentDangerState.SupervisionDangerStateEnum nextStateEnum =
LatentDangerState.SupervisionDangerStateEnum.getEnumByCode(currentStateEnum.getRejectNext()); LatentDangerState.SupervisionDangerStateEnum.getEnumByCode(currentStateEnum.getRejectNext());
nextState = nextStateEnum.getCode(); nextState = nextStateEnum.getCode();
nextStateName = nextStateEnum.getName(); nextStateName = nextStateEnum.getName();
executeResultMsg = currentStateEnum.getName() + ExecuteTypeEnum.驳回.getName(); executeResultMsg = currentStateEnum.getName() + ExecuteTypeEnum.驳回.getName();
// 驳回到提交整改资料节点需重新设置工作流节点执行人为整改责任人
if (nextStateEnum == LatentDangerState.SupervisionDangerStateEnum.提交整改资料) {
JSONObject reformJson = latentDanger.getReformJson();
AgencyUserModel checkLeader =
jcsFeignClient.getAmosIdByUserId((String) reformJson.get("reformLeaderId")).getResult();
Object result = workflowExecuteService.setTaskAssign(processInstanceId, checkLeader.getUserName());
if (!(Boolean) result) {
executeSubmitDto.setIsOk(false);
executeResultMsg = "设置节点执行人失败";
executeSubmitDto.setMsg(executeResultMsg);
return executeSubmitDto;
}
}
} }
latentDanger.setDangerState(nextState); latentDanger.setDangerState(nextState);
latentDanger.setDangerStateName(nextStateName); latentDanger.setDangerStateName(nextStateName);
// 当隐患状态当前节点是整改任务分配时,在执行完节点后需要将整改分配责任人设置为下个节点执行人 // 当隐患状态当前节点是整改任务分配时,在执行完节点后需要将整改分配责任人设置为下个节点执行人
// TODO 整改责任人需要保存(如果下一步审核驳回,需要能获取到这个指定的整改责任人) // 整改责任人需要保存(如果下一步审核驳回,需要能获取到这个指定的整改责任人)
if (LatentDangerState.SupervisionDangerStateEnum.整改任务分配.getCode().equals(currentStateEnum.getCode())) { if (LatentDangerState.SupervisionDangerStateEnum.整改任务分配.getCode().equals(currentStateEnum.getCode())) {
if (ValidationUtil.isEmpty(param.getReformLeaderId())) { if (ValidationUtil.isEmpty(param.getReformLeaderId())) {
executeSubmitDto.setIsOk(false); executeSubmitDto.setIsOk(false);
...@@ -1740,7 +1774,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1740,7 +1774,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
@Override @Override
public Set<Map<String, String>> getAllDangerState() { public Set<Map<String, String>> getAllDangerState() {
Set<Map<String, String>> levelList = new HashSet<Map<String, String>>(); Set<Map<String, String>> levelList = new HashSet<Map<String, String>>();
List<LatentDangerState.SupervisionDangerStateEnum> supervisionDangerStateList = Lists.newArrayList(LatentDangerState.SupervisionDangerStateEnum.values()); List<LatentDangerState.SupervisionDangerStateEnum> supervisionDangerStateList = Lists.newArrayList(LatentDangerState.SupervisionDangerStateEnum.values());
List<LatentDangerState.PatrolDangerStateEnum> patrolDangerStateEnumList = Lists.newArrayList(LatentDangerState.PatrolDangerStateEnum.values()); List<LatentDangerState.PatrolDangerStateEnum> patrolDangerStateEnumList = Lists.newArrayList(LatentDangerState.PatrolDangerStateEnum.values());
...@@ -1854,13 +1888,15 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1854,13 +1888,15 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
dangerIdList = Lists.newArrayList(idsStr.split(",")); dangerIdList = Lists.newArrayList(idsStr.split(","));
} }
if (OwerEnum.MY.getCode().equals(pageParam.get("my"))) { if (OwerEnum.MY.getCode().equals(pageParam.get("my"))) {
// 不指定隐患id-我的任务 // 查询工作流待登录人执行的任务
JSONObject allTaskResult = workflowFeignService.getCurrentUserAllTaskList(workflowProcessDefinitionKey); JSONObject allTaskResult = workflowFeignService.getCurrentUserAllTaskList(workflowProcessDefinitionKey);
allTaskList = (List) allTaskResult.get("data"); allTaskList = (List) allTaskResult.get("data");
// 待执行任务对应instanceId列表
List<String> instanceIdList = Lists.newArrayList(); List<String> instanceIdList = Lists.newArrayList();
List<LatentDanger> dangers; List<LatentDanger> dangers;
if (!ValidationUtil.isEmpty(allTaskList)) { if (!ValidationUtil.isEmpty(allTaskList)) {
allTaskList.forEach(m -> instanceIdList.add(((Map) m).get("processInstanceId").toString())); allTaskList.forEach(m -> instanceIdList.add(((Map) m).get("processInstanceId").toString()));
// 查询对应instanceId的隐患数据
dangers = dangers =
this.baseMapper.selectList(new LambdaQueryWrapper<LatentDanger>().in(LatentDanger::getInstanceId, instanceIdList)); this.baseMapper.selectList(new LambdaQueryWrapper<LatentDanger>().in(LatentDanger::getInstanceId, instanceIdList));
List<String> finalDangerIdList = dangerIdList; List<String> finalDangerIdList = dangerIdList;
...@@ -1875,6 +1911,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1875,6 +1911,10 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
pageParam.put("dangerState", LatentDangerState.PatrolDangerStateEnum.待评审.getCode()); pageParam.put("dangerState", LatentDangerState.PatrolDangerStateEnum.待评审.getCode());
} }
} }
// app待审核隐患须加上“提交隐患”状态的数据
if (AuditEnum.AUDIT.getCode().equals(pageParam.get("type"))) {
pageParam.put("submitDangerState", LatentDangerState.SupervisionDangerStateEnum.提交隐患.getCode());
}
} }
// 获取隐患地点的子节点 // 获取隐患地点的子节点
Object structureId = pageParam.get("structureId"); Object structureId = pageParam.get("structureId");
...@@ -2090,9 +2130,9 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2090,9 +2130,9 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
lambdaQueryWrapper.le(LatentDanger::getCreateDate, searchParam.getEndTime()); lambdaQueryWrapper.le(LatentDanger::getCreateDate, searchParam.getEndTime());
} }
lambdaQueryWrapper.and(o -> lambdaQueryWrapper.and(o ->
o.likeRight(LatentDanger::getOrgCode, searchParam.getOrgCode() + "*") o.likeRight(LatentDanger::getOrgCode, searchParam.getOrgCode() + "*")
.or().likeRight(LatentDanger::getOrgCode, searchParam.getOrgCode() + "-") .or().likeRight(LatentDanger::getOrgCode, searchParam.getOrgCode() + "-")
.or().eq(LatentDanger::getOrgCode, searchParam.getOrgCode())); .or().eq(LatentDanger::getOrgCode, searchParam.getOrgCode()));
List<LatentDanger> latentDangerList = this.baseMapper.selectList(lambdaQueryWrapper); List<LatentDanger> latentDangerList = this.baseMapper.selectList(lambdaQueryWrapper);
if (!ValidationUtil.isEmpty(latentDangerList)) { if (!ValidationUtil.isEmpty(latentDangerList)) {
// 防火监督报告用该字段(复核执行人名称) // 防火监督报告用该字段(复核执行人名称)
...@@ -2106,7 +2146,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2106,7 +2146,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
LatentDangerState.SupervisionDangerStateEnum::getCode); LatentDangerState.SupervisionDangerStateEnum::getCode);
stateSet.addAll(stateList); stateSet.addAll(stateList);
List<LatentDangerFlowRecordBo> firstRecord = List<LatentDangerFlowRecordBo> firstRecord =
recordList.stream().filter(r -> LatentDangerState.SupervisionDangerStateEnum.提交隐患.getCode().equals(r.getActionFlag())).collect(Collectors.toList()); recordList.stream().filter(r -> LatentDangerState.SupervisionDangerStateEnum.提交隐患.getCode().equals(r.getActionFlag())).collect(Collectors.toList());
danger.setCheckUserName(firstRecord.get(0).getExecuteUserName()); danger.setCheckUserName(firstRecord.get(0).getExecuteUserName());
recordList = recordList =
recordList.stream().filter(r -> stateSet.contains(r.getDangerState())).collect(Collectors.toList()); recordList.stream().filter(r -> stateSet.contains(r.getDangerState())).collect(Collectors.toList());
...@@ -2166,7 +2206,11 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2166,7 +2206,11 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
throw new Exception("隐患不存"); throw new Exception("隐患不存");
} }
latentDangerDto.setDangerPosition(null); latentDangerDto.setDangerPosition(null);
Bean.copyExistPropertis(latentDangerDto, latentDanger); //以下方法存在bug会将数值类型的默认值0拷贝到对象上造成数据覆盖
//Bean.copyExistPropertis(latentDangerDto, latentDanger);
latentDanger.setId(latentDangerDto.getId());
latentDanger.setFlowJson(latentDangerDto.getFlowJson());
if (!ValidationUtil.isEmpty(latentDangerDto.getPhotoUrl())) { if (!ValidationUtil.isEmpty(latentDangerDto.getPhotoUrl())) {
latentDanger.setPhotoUrls(Joiner.on(",").join(latentDangerDto.getPhotoUrl())); latentDanger.setPhotoUrls(Joiner.on(",").join(latentDangerDto.getPhotoUrl()));
} }
...@@ -2199,7 +2243,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2199,7 +2243,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
@Override @Override
public IPage<LatentDanger> reviewListDanger(PageParam pageParam) throws Exception { public IPage<LatentDanger> reviewListDanger(PageParam pageParam) throws Exception {
String type = pageParam.get("type").toString(); String type = pageParam.get("type").toString();
if ("audit".equals(type)) { if (AuditEnum.AUDIT.getCode().equals(type)) {
List<LatentDangerState.SupervisionDangerStateEnum> stateEnums = List<LatentDangerState.SupervisionDangerStateEnum> stateEnums =
LatentDangerState.SupervisionDangerStateEnum.getEnumListByProcessState(LatentDangerProcessStateEnum.待审核.getCode()); LatentDangerState.SupervisionDangerStateEnum.getEnumListByProcessState(LatentDangerProcessStateEnum.待审核.getCode());
List<String> dangerState = stateEnums.stream().map(stateEnum -> stateEnum != null ? List<String> dangerState = stateEnums.stream().map(stateEnum -> stateEnum != null ?
...@@ -2207,7 +2251,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2207,7 +2251,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
dangerState.add(LatentDangerState.SupervisionDangerStateEnum.提交隐患.getCode()); dangerState.add(LatentDangerState.SupervisionDangerStateEnum.提交隐患.getCode());
// 审核状态 // 审核状态
pageParam.put("dangerState", Joiner.on(",").join(dangerState)); pageParam.put("dangerState", Joiner.on(",").join(dangerState));
} else if ("review".equals(type)) { } else if (AuditEnum.REVIEW.getCode().equals(type)) {
List<LatentDangerState.SupervisionDangerStateEnum> stateEnums = List<LatentDangerState.SupervisionDangerStateEnum> stateEnums =
LatentDangerState.SupervisionDangerStateEnum.getEnumListByProcessState(LatentDangerProcessStateEnum.待复核.getCode()); LatentDangerState.SupervisionDangerStateEnum.getEnumListByProcessState(LatentDangerProcessStateEnum.待复核.getCode());
List<String> dangerState = stateEnums.stream().map(stateEnum -> stateEnum != null ? stateEnum.getCode() : null).collect(Collectors.toList()); List<String> dangerState = stateEnums.stream().map(stateEnum -> stateEnum != null ? stateEnum.getCode() : null).collect(Collectors.toList());
......
...@@ -586,4 +586,14 @@ public class CheckController extends AbstractBaseController { ...@@ -586,4 +586,14 @@ public class CheckController extends AbstractBaseController {
return CommonResponseUtil.success(page); return CommonResponseUtil.success(page);
} }
/**
* 根据检查记录查询照片
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据检查记录查询照片", notes = "根据检查记录查询照片")
@RequestMapping(value = "/getPictureByCheckId", method = RequestMethod.GET)
public CommonResponse getPictureByCheckId(@ApiParam(value = "检查记录ID") @RequestParam String checkId) {
List<String> pictures = checkService.getPictureByCheckId(checkId);
return CommonResponseUtil.success(pictures);
}
} }
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.supervision.business.vo.CheckInfoVo; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.business.vo.CheckVo; import com.yeejoin.amos.supervision.business.vo.CheckVo;
import com.yeejoin.amos.supervision.core.common.response.PointCheckInfoBusinessRespone; import com.yeejoin.amos.supervision.core.common.response.PointCheckInfoBusinessRespone;
import com.yeejoin.amos.supervision.core.common.response.PointCheckInfoRespone; import com.yeejoin.amos.supervision.core.common.response.PointCheckInfoRespone;
import com.yeejoin.amos.supervision.dao.entity.Check;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.HashMap; import java.util.HashMap;
...@@ -295,4 +296,14 @@ public interface CheckMapper extends BaseMapper { ...@@ -295,4 +296,14 @@ public interface CheckMapper extends BaseMapper {
long queryPageCount(CheckPageParam param); long queryPageCount(CheckPageParam param);
List<CheckVo> queryPage(CheckPageParam param); List<CheckVo> queryPage(CheckPageParam param);
/**
* 根据任务id获取相关检查记录
*
* @param id
* @return
*/
List<Check> getCheckListByTaskId(@Param(value = "planTaskId") long id);
List<String> getPictureByCheckId(String checkId);
} }
package com.yeejoin.amos.supervision.business.feign; package com.yeejoin.amos.supervision.business.feign;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -54,4 +55,13 @@ public interface JCSFeignClient { ...@@ -54,4 +55,13 @@ public interface JCSFeignClient {
*/ */
@RequestMapping(value = "jcs/org-usr/getUnit/{id}", method = RequestMethod.GET) @RequestMapping(value = "jcs/org-usr/getUnit/{id}", method = RequestMethod.GET)
FeignClientResult<Map<String, Object>> getCompanyById(@PathVariable("id") String companyId); FeignClientResult<Map<String, Object>> getCompanyById(@PathVariable("id") String companyId);
/**
* 根据机场单位id获取单位人员列表
*
* @param companyId 机场单位id
* @return
*/
@RequestMapping(value = "jcs/org-usr/{companyId}/person/list", method = RequestMethod.GET)
FeignClientResult<List<OrgUsrFormDto>> getPersonListByCompanyId(@PathVariable("companyId") String companyId);
} }
...@@ -41,17 +41,18 @@ import org.springframework.beans.BeanUtils; ...@@ -41,17 +41,18 @@ import org.springframework.beans.BeanUtils;
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.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; 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 javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.ParseException; import java.text.ParseException;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -160,36 +161,45 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep ...@@ -160,36 +161,45 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
// 获取隐患信息 // 获取隐患信息
Map<String, String> dangerParamMap = Maps.newHashMap(); Map<String, String> dangerParamMap = Maps.newHashMap();
// 本次隐患id // 本次隐患id
List<String> dangerIdList = Arrays.asList(checkReportDto.getDangerIds().split(",")); List<String> dangerIdList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(checkReportDto.getDangerIds())) {
dangerIdList = Arrays.asList(checkReportDto.getDangerIds().split(","));
}
// 复核隐患id // 复核隐患id
List<String> reviewDangerIdList = Arrays.asList(checkReportDto.getReviewDangerIds().split(",")); List<String> reviewDangerIdList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(checkReportDto.getReviewDangerIds())) {
reviewDangerIdList = Arrays.asList(checkReportDto.getReviewDangerIds().split(","));
}
Set<String> allDangerIdSet = Sets.newHashSet(); Set<String> allDangerIdSet = Sets.newHashSet();
allDangerIdSet.addAll(dangerIdList); allDangerIdSet.addAll(dangerIdList);
allDangerIdSet.addAll(reviewDangerIdList); allDangerIdSet.addAll(reviewDangerIdList);
dangerParamMap.put("dangerIds", Joiner.on(",").join(allDangerIdSet)); if (!ValidationUtil.isEmpty(allDangerIdSet)) {
List<DangerDto> dangerDtoList = dangerFeignClient.listAll(dangerParamMap).getResult(); dangerParamMap.put("dangerIds", Joiner.on(",").join(allDangerIdSet));
List<CheckReportDangerDto> dangerList = Lists.newArrayList(); List<DangerDto> dangerDtoList = dangerFeignClient.listAll(dangerParamMap).getResult();
List<CheckReportDangerDto> reviewDangerList = Lists.newArrayList(); List<CheckReportDangerDto> dangerList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(dangerDtoList)) { List<CheckReportDangerDto> reviewDangerList = Lists.newArrayList();
dangerDtoList.forEach(dangerDto -> { if (!ValidationUtil.isEmpty(dangerDtoList)) {
CheckReportDangerDto checkReportDangerDto = new CheckReportDangerDto(); List<String> finalDangerIdList = dangerIdList;
BeanUtils.copyProperties(dangerDto, checkReportDangerDto); List<String> finalReviewDangerIdList = reviewDangerIdList;
Map<String, String> bizInfo = dangerDto.getBizInfo(); dangerDtoList.forEach(dangerDto -> {
checkReportDangerDto.setCompanyId(bizInfo.get("pointId")); CheckReportDangerDto checkReportDangerDto = new CheckReportDangerDto();
checkReportDangerDto.setCompanyName(bizInfo.get("pointName")); BeanUtils.copyProperties(dangerDto, checkReportDangerDto);
Map<String, String> bizInfo = dangerDto.getBizInfo();
if (dangerIdList.contains(dangerDto.getId().toString())) { checkReportDangerDto.setCompanyId(bizInfo.get("pointId"));
dangerList.add(checkReportDangerDto); checkReportDangerDto.setCompanyName(bizInfo.get("pointName"));
}
if (reviewDangerIdList.contains(dangerDto.getId().toString())) { if (finalDangerIdList.contains(dangerDto.getId().toString())) {
checkReportDangerDto.setReviewUser(dangerDto.getExecuteUserName()); dangerList.add(checkReportDangerDto);
reviewDangerList.add(checkReportDangerDto); }
} if (finalReviewDangerIdList.contains(dangerDto.getId().toString())) {
}); checkReportDangerDto.setReviewUser(dangerDto.getExecuteUserName());
reviewDangerList.add(checkReportDangerDto);
}
});
}
checkReportDto.setCheckDangerList(dangerList);
checkReportDto.setReviewDangerList(reviewDangerList);
} }
checkReportDto.setCheckDangerList(dangerList);
checkReportDto.setReviewDangerList(reviewDangerList);
} }
return checkReportDto; return checkReportDto;
} }
......
...@@ -1578,7 +1578,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1578,7 +1578,7 @@ public class CheckServiceImpl implements ICheckService {
Plan plan = planService.queryPlanById(planTask.getPlanId()); Plan plan = planService.queryPlanById(planTask.getPlanId());
// 计划完成,规则推送消息 // 计划完成,规则推送消息
if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){ if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划完成); rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划完成, null);
} }
// p_plan_task_detail更新隐患个数 // p_plan_task_detail更新隐患个数
...@@ -1685,5 +1685,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1685,5 +1685,8 @@ public class CheckServiceImpl implements ICheckService {
return result; return result;
} }
@Override
public List<String> getPictureByCheckId(String checkId) {
return checkMapper.getPictureByCheckId(checkId);
}
} }
...@@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.DataNotFound; import org.typroject.tyboot.core.restful.exception.instance.DataNotFound;
...@@ -207,14 +208,15 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService { ...@@ -207,14 +208,15 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
//组织业务基本数据 对应bizInfo //组织业务基本数据 对应bizInfo
HiddenDangerDto hiddenDangerDto = new HiddenDangerDto(); HiddenDangerDto hiddenDangerDto = new HiddenDangerDto();
hiddenDangerDto.setPlanId(planId); hiddenDangerDto.setPlanId(planId);
hiddenDangerDto.setPointId(pointArray.length > 1 ? Long.parseLong(pointArray[1]) : null); hiddenDangerDto.setPointId(pointArray.length > 1 ? Long.parseLong(StringUtils.trimAllWhitespace(pointArray[1])) : null);
hiddenDangerDto.setPointName(pointArray.length > 1 ? pointArray[0] : null);
hiddenDangerDto.setCheckInputId(seq); hiddenDangerDto.setCheckInputId(seq);
hiddenDangerDto.setDangerType(DangerHandleTypeEnum.SELF.getCode()); hiddenDangerDto.setDangerType(DangerHandleTypeEnum.SELF.getCode());
try { try {
dangerDto.setBizInfo(this.buildBizInfo(hiddenDangerDto)); dangerDto.setBizInfo(this.buildBizInfo(hiddenDangerDto));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(), e);
throw new RuntimeException("组织数据失败"); throw new RuntimeException("组织数据失败!" + e.getMessage());
} }
return dangerDto; return dangerDto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
...@@ -273,6 +275,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService { ...@@ -273,6 +275,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
Point point = new Point(); Point point = new Point();
if (!ObjectUtils.isEmpty(hiddenDangerDto.getPointId())) { if (!ObjectUtils.isEmpty(hiddenDangerDto.getPointId())) {
point = iPointDao.findById(hiddenDangerDto.getPointId()).orElseThrow(() -> new RuntimeException("单位不存在")); point = iPointDao.findById(hiddenDangerDto.getPointId()).orElseThrow(() -> new RuntimeException("单位不存在"));
} else {
throw new RuntimeException("单位不存在");
} }
//检查级别 //检查级别
DangerCheckTypeLevelEnum dangerCheckTypeLevelEnum = DangerCheckTypeLevelEnum.getEumByCode(plan.getCheckLevel()); DangerCheckTypeLevelEnum dangerCheckTypeLevelEnum = DangerCheckTypeLevelEnum.getEumByCode(plan.getCheckLevel());
...@@ -288,10 +292,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService { ...@@ -288,10 +292,8 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
result.put("bizId", hiddenDangerDto.getCheckInputId()); result.put("bizId", hiddenDangerDto.getCheckInputId());
result.put("bizName", hiddenDangerDto.getInputItemName()); result.put("bizName", hiddenDangerDto.getInputItemName());
result.put("routeId", plan.getRouteId()); result.put("routeId", plan.getRouteId());
result.put("accompanyingUserId", plan.getLeadPeopleIds()); // 检查陪同人id result.put("checkUnitId", plan.getCheckUnitId()); // 检查人所在单位id逗号隔开
result.put("accompanyingUserName", plan.getLeadPeopleNames()); // 检查陪同人名称 result.put("checkUnitName", plan.getCheckUnitName());// 检查人所在单位名称逗号隔开
result.put("checkUnitId",plan.getCheckUnitId());
result.put("checkUnitName",plan.getCheckUnitName());
result.put("leadPeopleId", plan.getLeadPeopleIds()); // 牵头人id result.put("leadPeopleId", plan.getLeadPeopleIds()); // 牵头人id
result.put("leadPeopleName", plan.getLeadPeopleNames()); // 牵头人名称 result.put("leadPeopleName", plan.getLeadPeopleNames()); // 牵头人名称
result.put("makerUserId", plan.getMakerUserId()); // 计划制定人id result.put("makerUserId", plan.getMakerUserId()); // 计划制定人id
...@@ -313,13 +315,11 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService { ...@@ -313,13 +315,11 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
return; return;
} }
List<CheckShot> shotList = iCheckShotDao.findAllByCheckIdAndCheckInputId(checkInput.getCheckId(), checkInput.getId()); List<CheckShot> shotList = iCheckShotDao.findAllByCheckIdAndCheckInputId(checkInput.getCheckId(), checkInput.getId());
result.put("checkUserId", checkInput.getUserId()); result.put("checkUserId", checkInput.getUserId()); // 任务执行人id
result.put("checkUserName", checkInput.getUserName()); result.put("checkUserName", checkInput.getUserName()); // 任务执行人名称
result.put("accompanyUserId", checkInput.getAccompanyUserId()); result.put("accompanyingUserId", checkInput.getAccompanyUserId()); // 检查陪同人id
result.put("accompanyUserName", checkInput.getAccompanyUserName()); result.put("accompanyingUserName", checkInput.getAccompanyUserName()); // 检查陪同人名称
result.put("accompanyingUserId", checkInput.getAccompanyUserId()); result.put("planExecuteTime", checkInput.getCreateDate()); // 计划任务执行时间
result.put("accompanyingUserName",checkInput.getAccompanyUserName());
result.put("planExecuteTime", checkInput.getCreateDate());
result.put("checkPhotoUrl", shotList.stream().map(CheckShot::getPhotoData).collect(Collectors.joining(","))); result.put("checkPhotoUrl", shotList.stream().map(CheckShot::getPhotoData).collect(Collectors.joining(",")));
} }
} }
...@@ -237,7 +237,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -237,7 +237,7 @@ public class PlanServiceImpl implements IPlanService {
} }
try { try {
if (ValidationUtil.isEmpty(status)){ if (ValidationUtil.isEmpty(status)){
rulePlanService.addPlanRule(plan, userIds, RuleTypeEnum.计划提交); // 计划提交 rulePlanService.addPlanRule(plan, userIds, RuleTypeEnum.计划提交, null); // 计划提交
} else { } else {
if (PlanStatusEnum.EXAMINE_THREE.getValue() != status){ if (PlanStatusEnum.EXAMINE_THREE.getValue() != status){
rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核 rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核
......
...@@ -536,8 +536,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -536,8 +536,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 2.保存执行数据明细表 // 2.保存执行数据明细表
planTaskDetail.saveAndFlush(planTaskDetailInstance); planTaskDetail.saveAndFlush(planTaskDetailInstance);
// 规则推送消息 // 规则推送消息
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划生成); rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划生成, pointId.longValue());
} }
// 定时任务监控 // 定时任务监控
jobService.planTaskAddJob(planTask); jobService.planTaskAddJob(planTask);
......
package com.yeejoin.amos.supervision.business.service.impl; package com.yeejoin.amos.supervision.business.service.impl;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.gson.JsonObject;
import com.yeejoin.amos.boot.biz.common.constants.RuleConstant; import com.yeejoin.amos.boot.biz.common.constants.RuleConstant;
import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum; import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum;
import com.yeejoin.amos.component.rule.RuleTrigger; import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.supervision.business.dao.mapper.PointMapper;
import com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto;
import com.yeejoin.amos.supervision.business.dto.PlanRo; import com.yeejoin.amos.supervision.business.dto.PlanRo;
import com.yeejoin.amos.supervision.business.feign.JCSFeignClient; import com.yeejoin.amos.supervision.business.feign.JCSFeignClient;
import com.yeejoin.amos.supervision.business.util.DateUtil; import com.yeejoin.amos.supervision.business.util.DateUtil;
import com.yeejoin.amos.supervision.business.util.Toke;
import com.yeejoin.amos.supervision.dao.entity.Plan; import com.yeejoin.amos.supervision.dao.entity.Plan;
import com.yeejoin.amos.supervision.dao.entity.Point;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import org.bouncycastle.cert.ocsp.Req;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Date; import java.util.Date;
...@@ -28,28 +43,47 @@ public class RulePlanService { ...@@ -28,28 +43,47 @@ public class RulePlanService {
private final String packageId = "消息/addPlanRule"; private final String packageId = "消息/addPlanRule";
private final String msgType = "supervision"; private final String msgType = "supervision";
@Value("${supervision.person.charger.role:Person_charge_unit_fire_protection_supervision_inspection}")
private String supervisionPersonChargerRole;
@Autowired @Autowired
private RuleTrigger ruleTrigger; private RuleTrigger ruleTrigger;
@Autowired @Autowired
private JCSFeignClient jcsFeignClient; private JCSFeignClient jcsFeignClient;
public Boolean addPlanRule(Plan plan, List<String> userIds, RuleTypeEnum ruleType) throws Exception { @Autowired
PlanRo planRo = buildPlanRo(plan, userIds, ruleType); private RemoteSecurityService remoteSecurityService;
@Autowired
private PointServiceImpl pointService;
@Async
public Boolean addPlanRule(Plan plan, List<String> userIds, RuleTypeEnum ruleType, Long pointId) throws Exception {
PlanRo planRo = buildPlanRo(plan, userIds, ruleType, pointId);
//触发规则 //触发规则
ruleTrigger.publish(planRo, packageId, new String[0]); ruleTrigger.publish(planRo, packageId, new String[0]);
return true; return true;
} }
@Async
public Boolean addPlanAuditRule(Plan plan, List<String> userIds, RuleTypeEnum ruleType, String excuteStateName) throws Exception { public Boolean addPlanAuditRule(Plan plan, List<String> userIds, RuleTypeEnum ruleType, String excuteStateName) throws Exception {
PlanRo planRo = buildPlanRo(plan, userIds, ruleType); PlanRo planRo = buildPlanRo(plan, userIds, ruleType, null);
planRo.setExcuteStateName(excuteStateName); planRo.setExcuteStateName(excuteStateName);
//触发规则 //触发规则
ruleTrigger.publish(planRo, packageId, new String[0]); ruleTrigger.publish(planRo, packageId, new String[0]);
return true; return true;
} }
private PlanRo buildPlanRo(Plan plan, List<String> userIds, RuleTypeEnum ruleType) { private PlanRo buildPlanRo(Plan plan, List<String> userIds, RuleTypeEnum ruleType, Long pointId) {
// 设置token
if (ValidationUtil.isEmpty(RequestContext.getToken())) {
Toke tokenObj = remoteSecurityService.getServerToken();
RequestContext.setProduct(tokenObj.getProduct());
RequestContext.setAppKey(tokenObj.getAppKey());
RequestContext.setToken(tokenObj.getToke());
}
PlanRo planRo = new PlanRo(); PlanRo planRo = new PlanRo();
BeanUtils.copyProperties(plan, planRo); BeanUtils.copyProperties(plan, planRo);
planRo.setMsgType(msgType); planRo.setMsgType(msgType);
...@@ -74,11 +108,35 @@ public class RulePlanService { ...@@ -74,11 +108,35 @@ public class RulePlanService {
} }
if (ValidationUtil.isEmpty(userIds)) { if (ValidationUtil.isEmpty(userIds)) {
// 计划牵头责任人
String leadPeopleIds = plan.getLeadPeopleIds(); String leadPeopleIds = plan.getLeadPeopleIds();
if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())) { if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())) {
leadPeopleIds += "," + plan.getUserId(); leadPeopleIds += "," + plan.getUserId();
} }
userIds = (List<String>) jcsFeignClient.getAmosIdListByUserIds(leadPeopleIds).getResult(); userIds = (List<String>) jcsFeignClient.getAmosIdListByUserIds(leadPeopleIds).getResult();
// pointId是被检查单位id
if (!ValidationUtil.isEmpty(pointId)) {
List<String> userIdList = Lists.newArrayList();
Point point = pointService.queryPointById(pointId);
List<OrgUsrFormDto> personList =
jcsFeignClient.getPersonListByCompanyId(point.getOriginalId()).getResult();
List<String> personIdList = Lists.transform(personList, OrgUsrFormDto::getAmosOrgId);
List<RoleModel> roleList =
Privilege.roleClient.queryRoleList(supervisionPersonChargerRole, null).getResult();
if (!ValidationUtil.isEmpty(roleList)) {
List<AgencyUserModel> agencyUserModelList = Privilege.agencyUserClient.queryByRoleId(
String.valueOf(roleList.get(0).getSequenceNbr()), null).getResult();
if (!ValidationUtil.isEmpty(agencyUserModelList)) {
List<String> finalUserIds = userIds;
agencyUserModelList.forEach(userModel -> {
if (personIdList.contains(userModel.getUserId()) && !finalUserIds.contains(userModel.getUserId())) {
finalUserIds.add(userModel.getUserId());
}
});
userIds = finalUserIds;
}
}
}
} }
planRo.setSendTime(DateUtil.date2LongStr(new Date())); planRo.setSendTime(DateUtil.date2LongStr(new Date()));
planRo.setRecivers(userIds); planRo.setRecivers(userIds);
......
...@@ -282,4 +282,6 @@ public interface ICheckService { ...@@ -282,4 +282,6 @@ public interface ICheckService {
int checkHasRecord(Long planTaskId, Long pointId); int checkHasRecord(Long planTaskId, Long pointId);
Page<CheckVo> queryPage(CheckPageParam criterias); Page<CheckVo> queryPage(CheckPageParam criterias);
List<String> getPictureByCheckId(String checkId);
} }
...@@ -9,7 +9,10 @@ import java.util.Date; ...@@ -9,7 +9,10 @@ import java.util.Date;
*/ */
@Data @Data
public class CheckVo { public class CheckVo {
/**
* checkId
*/
private Long checkId;
/** /**
* 主键id * 主键id
*/ */
......
...@@ -43,10 +43,12 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -43,10 +43,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Service("jobService") @Service("jobService")
public class JobService implements IJobService { public class JobService implements IJobService {
...@@ -215,7 +217,13 @@ public class JobService implements IJobService { ...@@ -215,7 +217,13 @@ public class JobService implements IJobService {
private void createOmissionCheckRecord(PlanTask planTask) { private void createOmissionCheckRecord(PlanTask planTask) {
List<PlanTaskPointInputItemBo> planTaskPointInputItems = planTaskMapper List<PlanTaskPointInputItemBo> planTaskPointInputItems = planTaskMapper
.getPlanTaskPointInputItemByPlanTaskId(planTask.getId(), PlanTaskDetailStatusEnum.OMISSION.getValue()); .getPlanTaskPointInputItemByPlanTaskId(planTask.getId(), PlanTaskDetailStatusEnum.OMISSION.getValue());
List<Check> checkList = checkMapper.getCheckListByTaskId(planTask.getId());
Map<Long, Check> checkMap = new HashMap<>(); Map<Long, Check> checkMap = new HashMap<>();
if (!ValidationUtil.isEmpty(checkList)) {
checkList.stream().collect(Collectors.groupingBy(Check::getPointId)).forEach((e,v) -> {
checkMap.put(e, v.get(0));
});
}
Set<Long> checkIds = new HashSet<Long>(); Set<Long> checkIds = new HashSet<Long>();
//查询用户名字 //查询用户名字
for (PlanTaskPointInputItemBo arg : planTaskPointInputItems) { for (PlanTaskPointInputItemBo arg : planTaskPointInputItems) {
......
...@@ -2,19 +2,25 @@ package com.yeejoin.amos.boot.module.tzs.flc.biz.controller; ...@@ -2,19 +2,25 @@ package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
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.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentAssociated; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentAssociated;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.EquipmentAssociatedServiceImpl; import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.EquipmentAssociatedServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
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 org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -48,10 +54,64 @@ public class EquipmentAssociatedController extends BaseController { ...@@ -48,10 +54,64 @@ public class EquipmentAssociatedController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增配套设备设施部件", notes = "新增配套设备设施部件") @ApiOperation(httpMethod = "POST", value = "新增配套设备设施部件", notes = "新增配套设备设施部件")
public ResponseModel<EquipmentAssociatedDto> save(@RequestBody EquipmentAssociatedDto model) { public ResponseModel<EquipmentAssociatedDto> save(@RequestBody EquipmentAssociatedDto model) {
model.setIsDelete(false);
model = equipmentAssociatedServiceImpl.createWithModel(model); model = equipmentAssociatedServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
/**
* 根据sequenceNbr删除
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "删除配套设施", notes = "删除配套设施")
public ResponseModel<Boolean> deleteBySequenceNbr(@PathVariable(value = "sequenceNbr") Long sequenceNbr){
Boolean flag = equipmentAssociatedServiceImpl.update(new LambdaUpdateWrapper<EquipmentAssociated>().eq(EquipmentAssociated::getSequenceNbr,sequenceNbr).set(EquipmentAssociated::getIsDelete,true));
return ResponseHelper.buildResponse(flag);
}
/**
* 根据sequenceNbr更新
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/updateAssociated")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新配套设备设施部件", notes = "根据sequenceNbr配套设备设施部件")
public ResponseModel<EquipmentAssociatedDto> updateAssociated(@RequestBody EquipmentAssociatedDto model) {
if (ValidationUtil.isEmpty(model)
|| ValidationUtil.isEmpty(model.getSequenceNbr())) {
throw new BadRequest("参数校验失败.");
}
model = equipmentAssociatedServiceImpl.updateAssociated(model);
return ResponseHelper.buildResponse(model);
}
/**
* 新增配套设备/设施/部件
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据设备id返回配套设施信息", notes = "根据设备id返回配套设施信息")
public ResponseModel<List<EquipmentAssociatedDto>> getAssociatedByEquipmentId(@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
List<EquipmentAssociated> entity = equipmentAssociatedServiceImpl.list(new LambdaQueryWrapper<EquipmentAssociated>().eq(EquipmentAssociated::getIsDelete,false).eq(EquipmentAssociated::getEquipmentId,sequenceNbr));
List<EquipmentAssociatedDto> result = new ArrayList<>();
entity.stream().forEach(t -> {
EquipmentAssociatedDto temp = new EquipmentAssociatedDto();
BeanUtils.copyProperties(t,temp);
result.add(temp);
});
return ResponseHelper.buildResponse(result);
}
/** /**
* *
......
...@@ -96,7 +96,7 @@ public class EquipmentController extends BaseController { ...@@ -96,7 +96,7 @@ public class EquipmentController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/updateEquipment") @PutMapping(value = "/updateEquipment")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新装备信息表", notes = "根据sequenceNbr更新装备信息表") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新装备信息表", notes = "根据sequenceNbr更新装备信息表")
public ResponseModel<EquipmentDto> updateBySequenceNbrEquipment(@RequestBody EquipmentDto model) { public ResponseModel<EquipmentDto> updateEquip20ment(@RequestBody EquipmentDto model) {
if (ValidationUtil.isEmpty(model) if (ValidationUtil.isEmpty(model)
|| ValidationUtil.isEmpty(model.getSequenceNbr())) { || ValidationUtil.isEmpty(model.getSequenceNbr())) {
throw new BadRequest("参数校验失败."); throw new BadRequest("参数校验失败.");
......
package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.EquipmentUseInfoServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentUseInfoDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 设备使用信息表
*
* @author system_generator
* @date 2022-01-05
*/
@RestController
@Api(tags = "设备使用信息表Api")
@RequestMapping(value = "/equipment-use-info")
public class EquipmentUseInfoController extends BaseController {
@Autowired
EquipmentUseInfoServiceImpl equipmentUseInfoServiceImpl;
/**
* 新增设备使用信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增设备使用信息表", notes = "新增设备使用信息表")
public ResponseModel<EquipmentUseInfoDto> save(@RequestBody EquipmentUseInfoDto model) {
model = equipmentUseInfoServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新设备使用信息表", notes = "根据sequenceNbr更新设备使用信息表")
public ResponseModel<EquipmentUseInfoDto> updateBySequenceNbrEquipmentUseInfo(@RequestBody EquipmentUseInfoDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(equipmentUseInfoServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除设备使用信息表", notes = "根据sequenceNbr删除设备使用信息表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(equipmentUseInfoServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个设备使用信息表", notes = "根据sequenceNbr查询单个设备使用信息表")
public ResponseModel<EquipmentUseInfoDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(equipmentUseInfoServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "设备使用信息表分页查询", notes = "设备使用信息表分页查询")
public ResponseModel<Page<EquipmentUseInfoDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<EquipmentUseInfoDto> page = new Page<EquipmentUseInfoDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(equipmentUseInfoServiceImpl.queryForEquipmentUseInfoPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "设备使用信息表列表全部数据查询", notes = "设备使用信息表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<EquipmentUseInfoDto>> selectForList() {
return ResponseHelper.buildResponse(equipmentUseInfoServiceImpl.queryForEquipmentUseInfoList());
}
}
...@@ -30,4 +30,10 @@ public class EquipmentAssociatedServiceImpl extends BaseService<EquipmentAssocia ...@@ -30,4 +30,10 @@ public class EquipmentAssociatedServiceImpl extends BaseService<EquipmentAssocia
public List<EquipmentAssociatedDto> queryForEquipmentAssociatedList() { public List<EquipmentAssociatedDto> queryForEquipmentAssociatedList() {
return this.queryForList("" , false); return this.queryForList("" , false);
} }
@Override
public EquipmentAssociatedDto updateAssociated(EquipmentAssociatedDto model) {
this.updateWithModel(model);
return model;
}
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,7 @@ 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.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
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.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService; import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto; import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto; import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
...@@ -16,11 +17,14 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto; ...@@ -16,11 +17,14 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.enums.InformWorkFlowEnum; import com.yeejoin.amos.boot.module.tzs.api.enums.InformWorkFlowEnum;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentIndexDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentIndexDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentUseInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndex; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndex;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndexInform; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndexInform;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentUseInfo;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentInformStatusEnum; import com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentInformStatusEnum;
import com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentStatusEnum; import com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentStatusEnum;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.EquipmentInformMapper; import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.EquipmentInformMapper;
...@@ -51,6 +55,7 @@ import java.util.HashMap; ...@@ -51,6 +55,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
import java.util.UUID;
/** /**
* 设备告知单服务实现类 * 设备告知单服务实现类
...@@ -89,7 +94,11 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E ...@@ -89,7 +94,11 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
@Autowired @Autowired
EquipmentIndexInformServiceImpl iEquipmentIndexInformService; EquipmentIndexInformServiceImpl iEquipmentIndexInformService;
@Autowired
EquipmentUseInfoServiceImpl equipmentUseInfoServiceImpl;
@Autowired
UnitInfoServiceImpl unitInfoServiceImpl;
/** /**
* 分页查询 * 分页查询
...@@ -199,7 +208,8 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E ...@@ -199,7 +208,8 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
public Boolean acceptInform(Long sequenceNbr) { public Boolean acceptInform(Long sequenceNbr) {
// 接收告知书 更新告知书状态 // 接收告知书 更新告知书状态
Boolean flag = false; Boolean flag = false;
flag = this.update(new LambdaUpdateWrapper<EquipmentInform>().eq(EquipmentInform::getSequenceNbr,sequenceNbr).set(EquipmentInform::getInformStatus,"9")); EquipmentInform inform = this.getById(sequenceNbr);
flag = this.updateById(inform);
if(flag) { if(flag) {
// 更新设备相关参数 // 更新设备相关参数
List<InformEquipmentDto> equipmentList = informEquipmentServiceImpl.getEquipListByInformId(sequenceNbr); List<InformEquipmentDto> equipmentList = informEquipmentServiceImpl.getEquipListByInformId(sequenceNbr);
...@@ -209,6 +219,44 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E ...@@ -209,6 +219,44 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
BeanUtils.copyProperties(t,sourceEquip); BeanUtils.copyProperties(t,sourceEquip);
sourceEquip.setSequenceNbr(t.getSourceEquipmentId()); sourceEquip.setSequenceNbr(t.getSourceEquipmentId());
equipmentServiceImpl.updateById(sourceEquip); equipmentServiceImpl.updateById(sourceEquip);
// 保存设备相关使用信息
EquipmentUseInfo useInfo = equipmentUseInfoServiceImpl.getOne(new LambdaQueryWrapper<EquipmentUseInfo>().eq(EquipmentUseInfo::getEquipmentId,t.getSourceEquipmentId()));
if(useInfo == null) {
useInfo = new EquipmentUseInfo();
}
useInfo.setLatitude(t.getLatitude());
useInfo.setLongitude(t.getLongitude());
useInfo.setUseAddress(t.getAddress());
useInfo.setUseSite(inform.getUseSite());
useInfo.setUseSiteCode(inform.getUseSiteCode());
//useInfo.setSpecialCode(UUID.randomUUID().toString().replaceAll("-",""));
//if(StringUtils.isEmpty(useInfo.getRegisterCode())) {
// useInfo.setRegisterCode(sourceEquip.getTypeId()+inform.getRegionCode()+ DateUtils.getYear(new Date())+"01");
//}
//useInfo.setRescueCode(UUID.randomUUID().toString().replaceAll("-",""));
//useInfo.setRegisterLicenceCode(UUID.randomUUID().toString().replaceAll("-",""));
if(useInfo.getRegisterTime() != null) {
useInfo.setRegisterTime(new Date());
}
useInfo.setStartUseTime(new Date());
useInfo.setIssueLicenceTime(new Date());
useInfo.setEquipmentId(t.getSourceEquipmentId());
useInfo.setUseUnitName(inform.getUseUnit());
useInfo.setUseUnitId(inform.getUseUnitId());
UnitInfo useUnit = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrgUserId,inform.getUseUnitId()));
useInfo.setUseOrganizationCode(useUnit.getOrganizationCode());
useInfo.setPropertyUnitName(inform.getPropertyUnit());
useInfo.setPropertyUnitId(inform.getPropertyUnitId());
UnitInfo propertyUnit = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrgUserId,inform.getPropertyUnitId()));
useInfo.setPropertyOrganizationCode(propertyUnit.getOrganizationCode());
equipmentUseInfoServiceImpl.saveOrUpdate(useInfo);
// 获取设备附件信息 保存附件信息 // 获取设备附件信息 保存附件信息
// 原附件信息 // 原附件信息
Map<String, List<AttachmentDto>> sourceAttach = sourceFileService.getAttachments(t.getSequenceNbr()); Map<String, List<AttachmentDto>> sourceAttach = sourceFileService.getAttachments(t.getSequenceNbr());
...@@ -283,6 +331,7 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E ...@@ -283,6 +331,7 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
} }
} }
} }
model.setProcessStatus("0");
return model; return model;
} }
...@@ -333,7 +382,6 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E ...@@ -333,7 +382,6 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
@Transactional @Transactional
public Boolean acceptInform(Long sequenceNbr, ReginParams userInfo) throws Exception { public Boolean acceptInform(Long sequenceNbr, ReginParams userInfo) throws Exception {
EquipmentInformDto model = this.queryBySeq(sequenceNbr); EquipmentInformDto model = this.queryBySeq(sequenceNbr);
model.setInformStatus("9");
InformWorkFlowEnum submit = InformWorkFlowEnum.接收方接收告知书; InformWorkFlowEnum submit = InformWorkFlowEnum.接收方接收告知书;
model.setProcessStatus(submit.getProcessStatus()); model.setProcessStatus(submit.getProcessStatus());
// 流程流转 // 流程流转
......
package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentUseInfo;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.EquipmentUseInfoMapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.IEquipmentUseInfoService;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentUseInfoDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 设备使用信息表服务实现类
*
* @author system_generator
* @date 2022-01-05
*/
@Service
public class EquipmentUseInfoServiceImpl extends BaseService<EquipmentUseInfoDto,EquipmentUseInfo,EquipmentUseInfoMapper> implements IEquipmentUseInfoService {
/**
* 分页查询
*/
public Page<EquipmentUseInfoDto> queryForEquipmentUseInfoPage(Page<EquipmentUseInfoDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<EquipmentUseInfoDto> queryForEquipmentUseInfoList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
...@@ -66,8 +66,8 @@ dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm ...@@ -66,8 +66,8 @@ dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间 #系统上线时间
param.system.online.date = 2019-02-12 param.system.online.date = 2019-02-12
# 视频转码服务开关 off/on,默认关闭,数字换流站使用时开启 # 视频转码服务开关 hls(关)/flv(开),默认关闭,数字换流站使用时开启
param.isUseVideoTranscoding = off window.vedioFormat = hls
# 航天视频服务地址 # 航天视频服务地址
param.htvideo.url="http://192.168.4.174:9001"; param.htvideo.url="http://192.168.4.174:9001";
# 南瑞视频转码服务地址 # 南瑞视频转码服务地址
......
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.11.20:3306/autosys_business_v3.0.0.2?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.minimum-idle= 3
spring.datasource.hikari.maximum-pool-size= 30
spring.datasource.hikari.auto-commit= true
spring.datasource.hikari.idle-timeout= 10000
spring.datasource.hikari.max-lifetime= 1800000
spring.datasource.hikari.connection-timeout= 30000
spring.datasource.hikari.connection-test-query= SELECT 1
# 文件服务器地址
fileserver_domain=http://39.98.246.31:8888/
eureka.instance.hostname= 172.16.11.20
eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3056965
#redis
spring.redis.database=1
spring.redis.host=172.16.11.20
spring.redis.port=6379
spring.redis.password=1234560
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.11.33:1883
emqx.user-name=admin
emqx.password=public
mqtt.scene.host=mqtt://172.16.11.33:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
#数据同步开关
systemctl.sync.switch=false
#数据JCS开关
systemctl.jcs.switch=false
#平台数据开关
systemctl.amos.switch=false
#报表数据地址
equip.report.url=/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token=http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date = 2019-02-12
# 视频转码服务开关 hls(关)/flv(开),默认关闭,数字换流站使用时开启
window.vedioFormat = hls
# 航天视频服务地址
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.10.66:3306/safety-business-3.0.1?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.minimum-idle= 3
spring.datasource.hikari.maximum-pool-size= 30
spring.datasource.hikari.auto-commit= true
spring.datasource.hikari.idle-timeout= 10000
spring.datasource.hikari.max-lifetime= 1800000
spring.datasource.hikari.connection-timeout= 30000
spring.datasource.hikari.connection-test-query= SELECT 1
fdfs.so-timeout=1501
fdfs.connect-timeout=601
fdfs.thumb-image.height=200
fdfs.thumb-image.width=200
fdfs.tracker-list[0]=39.98.246.31:22122
# 文件服务器地址
fileserver_domain=http://39.98.246.31:8888/
eureka.instance.hostname= 172.16.10.72
eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3157169
#redis
spring.redis.database=0
spring.redis.host=172.16.10.85
spring.redis.port=6379
spring.redis.password=amos2019Redis
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
mqtt.scene.host=mqtt://172.16.10.85:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.85:1883
emqx.user-name=super
emqx.password=a123456
#数据同步开关
systemctl.sync.switch=false
#数据JCS开关
systemctl.jcs.switch=true
#平台数据开关
systemctl.amos.switch=true
#报表数据地址
equip.report.url=/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token=http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date = 2019-02-12
# 视频转码服务开关 hls(关)/flv(开),默认关闭,数字换流站使用时开启
window.vedioFormat = hls
# 航天视频服务地址
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.11.20:3306/autosys_business_v3.0.0.2?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.minimum-idle= 3
spring.datasource.hikari.maximum-pool-size= 30
spring.datasource.hikari.auto-commit= true
spring.datasource.hikari.idle-timeout= 10000
spring.datasource.hikari.max-lifetime= 1800000
spring.datasource.hikari.connection-timeout= 30000
spring.datasource.hikari.connection-test-query= SELECT 1
# 文件服务器地址
fileserver_domain=http://39.98.246.31:8888/
eureka.instance.hostname= 172.16.11.20
eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3056965
#redis
spring.redis.database=1
spring.redis.host=172.16.11.20
spring.redis.port=6379
spring.redis.password=1234560
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.11.33:1883
emqx.user-name=admin
emqx.password=public
mqtt.scene.host=mqtt://172.16.11.33:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
#数据同步开关
systemctl.sync.switch=false
#数据JCS开关
systemctl.jcs.switch=false
#平台数据开关
systemctl.amos.switch=false
#报表数据地址
equip.report.url=/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token=http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date = 2019-02-12
# 视频转码服务开关 hls(关)/flv(开),默认关闭,数字换流站使用时开启
window.vedioFormat = hls
# 航天视频服务地址
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.11.20:3306/autosys_business_v3.0.0.2?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.minimum-idle= 3
spring.datasource.hikari.maximum-pool-size= 30
spring.datasource.hikari.auto-commit= true
spring.datasource.hikari.idle-timeout= 10000
spring.datasource.hikari.max-lifetime= 1800000
spring.datasource.hikari.connection-timeout= 30000
spring.datasource.hikari.connection-test-query= SELECT 1
# 文件服务器地址
fileserver_domain=http://39.98.246.31:8888/
eureka.instance.hostname= 172.16.11.20
eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3056965
#redis
spring.redis.database=1
spring.redis.host=172.16.11.20
spring.redis.port=6379
spring.redis.password=1234560
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.11.33:1883
emqx.user-name=admin
emqx.password=public
mqtt.scene.host=mqtt://172.16.11.33:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
#报表数据地址
equip.report.url=/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token=http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date = 2019-02-12
# 视频转码服务开关 hls(关)/flv(开),默认关闭,数字换流站使用时开启
window.vedioFormat = hls
# 航天视频服务地址
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
...@@ -632,23 +632,18 @@ ORDER BY ...@@ -632,23 +632,18 @@ ORDER BY
-- ---------------------------- -- ----------------------------
DROP VIEW IF EXISTS `v_equip_alarm_today_statistics`; DROP VIEW IF EXISTS `v_equip_alarm_today_statistics`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equip_alarm_today_statistics` AS SELECT CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equip_alarm_today_statistics` AS SELECT
count( (
`confirm_type` count(1) - count(
) AS `confirmed`, `clean_time`
)
) AS `unCleaned`,
( (
count(1) - count( count(1) - count(
`confirm_type` `confirm_type`
) )
) AS `pending` ) AS `pending`
FROM FROM
`wl_equipment_specific_alarm_log` `wl_equipment_specific_alarm_log`;
WHERE
(
cast(now() AS date) = cast(
`create_date` AS date
)
);
-- ---------------------------- -- ----------------------------
-- View structure for v_equip_fire_control_water -- View structure for v_equip_fire_control_water
...@@ -674,10 +669,8 @@ SELECT ...@@ -674,10 +669,8 @@ SELECT
`sal`.`equipment_specific_index_key` AS `indexKey`, `sal`.`equipment_specific_index_key` AS `indexKey`,
`sal`.`equipment_specific_index_name` AS `indexName`, `sal`.`equipment_specific_index_name` AS `indexName`,
`sal`.`equipment_specific_id` AS `specificId`, `sal`.`equipment_specific_id` AS `specificId`,
concat( IF
sal.equipment_specific_name, ( `sal`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
sal.equipment_specific_index_name
) AS alamReason,
`sal`.`iot_code` AS `iotCode`, `sal`.`iot_code` AS `iotCode`,
date_format( date_format(
`sal`.`create_date`, `sal`.`create_date`,
...@@ -5794,27 +5787,153 @@ CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equip ...@@ -5794,27 +5787,153 @@ CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equip
-- 火灾报警系统4小告警列表前60 -- 火灾报警系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_alarm`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_alarm`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_alarm` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('029026401813010000000016',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_alarm` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '029026401813010000000016', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- CAFS系统4小告警列表前60 -- CAFS系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_cafs`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_cafs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_cafs` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('029026401813010000000023',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_cafs` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '029026401813010000000023', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- 预混泡沫灭火系统4小告警列表前60 -- 预混泡沫灭火系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_foam`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_foam`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_foam` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('029026401813010000000054',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_foam` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '029026401813010000000054', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- 细水雾涡扇炮系统4小告警列表前60 -- 细水雾涡扇炮系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_foam_mist`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_foam_mist`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_foam_mist` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('011023306003010000000082',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_foam_mist` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '011023306003010000000082', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- 排油系统4小告警列表前60 -- 排油系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_ONL`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_onl`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_onl` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('029026401813010000000030',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_onl` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '029026401813010000000030', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- 消防给水系统4小告警列表前60 -- 消防给水系统4小告警列表前60
DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_water`; DROP VIEW IF EXISTS `v_fire_equip_alarm_60list_water`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_water` AS select `sa`.`id` AS `id`,`ec`.`code` AS `mRid`,`sa`.`equipment_specific_name` AS `specificName`,`sa`.`equipment_specific_index_key` AS `indexKey`,`sa`.`equipment_specific_index_name` AS `indexName`,`sa`.`equipment_specific_id` AS `specificId`,concat(`sa`.`equipment_specific_name`,`sa`.`equipment_specific_index_name`) AS `alamReason`,`sa`.`iot_code` AS `iotCode`,`sa`.`create_date` AS `createDate` from (`wl_equipment_specific_alarm_log` `sa` left join `wl_equipment_specific` `ec` on((`sa`.`equipment_specific_id` = `ec`.`id`))) where find_in_set('029026401813010000000047',`sa`.`system_codes`) order by `sa`.`create_date` desc limit 60; CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `v_fire_equip_alarm_60list_water` AS SELECT
`sa`.`id` AS `id`,
`ec`.`code` AS `mRid`,
`sa`.`equipment_specific_name` AS `specificName`,
`sa`.`equipment_specific_index_key` AS `indexKey`,
`sa`.`equipment_specific_index_name` AS `indexName`,
`sa`.`equipment_specific_id` AS `specificId`,
IF
( `sa`.`clean_time` IS NOT NULL, '已消除', '未消除' ) `cleanStatus`,
`sa`.`iot_code` AS `iotCode`,
`sa`.`create_date` AS `createDate`
FROM
(
`wl_equipment_specific_alarm_log` `sa`
LEFT JOIN `wl_equipment_specific` `ec` ON ((
`sa`.`equipment_specific_id` = `ec`.`id`
)))
WHERE
find_in_set( '029026401813010000000047', `sa`.`system_codes` )
ORDER BY
`sa`.`create_date` DESC
LIMIT 60;
-- 消防人员视图 -- 消防人员视图
DROP VIEW IF EXISTS `v_fire_fighter`; DROP VIEW IF EXISTS `v_fire_fighter`;
......
...@@ -2238,6 +2238,7 @@ ...@@ -2238,6 +2238,7 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="tw" id="20220104-5"> <changeSet author="tw" id="20220104-5">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<not> <not>
...@@ -2275,4 +2276,26 @@ ...@@ -2275,4 +2276,26 @@
<changeSet author="keyong" id="1641367742-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_specific_alarm_log" columnName="clean_time"/>
</not>
</preConditions>
<comment>wl_equipment_specific_alarm_log add column clean_time</comment>
<sql>
alter table `wl_equipment_specific_alarm_log` add column `clean_time` datetime DEFAULT NULL COMMENT '消除时间';
</sql>
</changeSet>
<changeSet author="keyong" id="1641367742-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment" columnName="clean_type"/>
</not>
</preConditions>
<comment>wl_equipment add column clean_type</comment>
<sql>
ALTER TABLE wl_equipment ADD COLUMN clean_type varchar(50) DEFAULT NULL COMMENT '警情消除方式(0:收到复位信号自动消除;1:警情处理确认后消除)';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -44,7 +44,9 @@ ...@@ -44,7 +44,9 @@
confirm_user, confirm_user,
confirm_user_name, confirm_user_name,
confirm_date, confirm_date,
(SELECT GROUP_CONCAT(fem.name) FROM `f_fire_fighting_system` fem WHERE find_in_set(fem.id,spe.system_id)) as systemName (SELECT GROUP_CONCAT(fem.name) FROM `f_fire_fighting_system` fem WHERE find_in_set(fem.id,spe.system_id)) as systemName,
if(ala.clean_time is null, '未清除', '已清除') AS cleanStatus,
ala.clean_time
from from
wl_equipment_specific_alarm_log as ala wl_equipment_specific_alarm_log as ala
left join wl_equipment_specific as spe on spe.id = ala.equipment_specific_id left join wl_equipment_specific as spe on spe.id = ala.equipment_specific_id
......
...@@ -180,6 +180,11 @@ ...@@ -180,6 +180,11 @@
fireEquipmentName, fireEquipmentName,
concat(wlesal.equipment_specific_name,wlesal.equipment_specific_index_name) as alamContent, concat(wlesal.equipment_specific_name,wlesal.equipment_specific_index_name) as alamContent,
if(confirm_type is null,'未处理','已处理') handleStatus, if(confirm_type is null,'未处理','已处理') handleStatus,
IF (
wlesal.clean_time IS NOT NULL,
'已消除',
'未消除'
) cleanStatus,
confirm_type as handleType, confirm_type as handleType,
wlesal.equipment_index_id AS fireEquipmentIndexId, wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey, wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
...@@ -237,6 +242,13 @@ ...@@ -237,6 +242,13 @@
open="(" close=")" index="">#{item} open="(" close=")" index="">#{item}
</foreach> </foreach>
</if> </if>
<if test="param.id!=null and param.id!=''">AND d.fireEquipmentId = #{param.id}</if>
<if test="param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 1">AND
d.cleanStatus = '已消除'
</if>
<if test="param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 2">AND
d.cleanStatus = '未消除'
</if>
</where> </where>
ORDER BY d.createDate DESC ORDER BY d.createDate DESC
</select> </select>
...@@ -294,6 +306,16 @@ ...@@ -294,6 +306,16 @@
'已处理', '已处理',
'去确认' '去确认'
) handleStatus, ) handleStatus,
IF (
wlesal.clean_time IS NOT NULL,
'已消除',
'未消除'
) cleanStatus,
IF (
wlesal.clean_time IS NOT NULL,
'1',
'2'
) cleanStatusVal,
wlesal.confirm_type AS handleType, wlesal.confirm_type AS handleType,
wlesal.system_codes AS systemCodes, wlesal.system_codes AS systemCodes,
wlesal.equipment_index_id AS fireEquipmentIndexId, wlesal.equipment_index_id AS fireEquipmentIndexId,
...@@ -344,10 +366,16 @@ ...@@ -344,10 +366,16 @@
<when test="param.confirmType != null and param.confirmType != '' and param.confirmType == 0"> <when test="param.confirmType != null and param.confirmType != '' and param.confirmType == 0">
AND d.handleType IS NULL AND d.handleType IS NULL
</when> </when>
<when test="param.confirmType != null and param.confirmType != '' and param.confirmType == 2">
AND d.cleanStatus = '未消除'
</when>
<when test="param.confirmType != null and param.confirmType != '' and param.confirmType == 3">
AND d.cleanStatus = '已消除'
</when>
</choose> </choose>
<if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if> <if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if>
<if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if> <if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if>
<if test="param.alarmType == 'BREAKDOWN' or param.alarmType == 'FIREALARM'">AND d.type = #{param.alarmType}</if> <if test="param.alarmType != null and param.alarmType != ''">AND d.type = #{param.alarmType}</if>
<if test="param.systemCode != null and param.systemCode != ''"> <if test="param.systemCode != null and param.systemCode != ''">
AND find_in_set(#{param.systemCode},d.systemCodes) AND find_in_set(#{param.systemCode},d.systemCodes)
</if> </if>
...@@ -358,6 +386,12 @@ ...@@ -358,6 +386,12 @@
</if> </if>
<if test="param.id!=null and param.id!=''">AND d.fireEquipmentId = #{param.id}</if> <if test="param.id!=null and param.id!=''">AND d.fireEquipmentId = #{param.id}</if>
<if test="param.status!=null and param.status!=3">AND d.status = #{param.status}</if> <if test="param.status!=null and param.status!=3">AND d.status = #{param.status}</if>
<if test="param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 1">AND
d.cleanStatus = '已消除'
</if>
<if test="param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 2">AND
d.cleanStatus = '未消除'
</if>
ORDER BY d.createDate DESC ORDER BY d.createDate DESC
</select> </select>
<select id="getAlarmList" resultType="java.util.HashMap"> <select id="getAlarmList" resultType="java.util.HashMap">
......
...@@ -1453,5 +1453,15 @@ ...@@ -1453,5 +1453,15 @@
and e.category_id = c.id and e.category_id = c.id
and s.biz_org_code <![CDATA[<>]]> '' and s.biz_org_code <![CDATA[<>]]> ''
GROUP BY s.biz_org_code ,c.code GROUP BY s.biz_org_code ,c.code
<select id="getEquipmentBySpecificId" resultType="String">
select
we.clean_type
from
wl_Equipment we
LEFT JOIN `wl_equipment_detail` wed ON wed.equipment_id = we.id
LEFT JOIN `wl_equipment_specific` wes ON wes.equipment_detail_id = wed.id
where
wes.id = #{specificId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -489,8 +489,10 @@ ...@@ -489,8 +489,10 @@
d.fireEquipmentName, d.fireEquipmentName,
d.warehouseStructureName, d.warehouseStructureName,
d.fireEquipmentSpecificIndexName, d.fireEquipmentSpecificIndexName,
d.createDate,d.confirmType, d.createDate,
d.type d.confirmType,
d.type,
d.cleanStatus
FROM FROM
( (
SELECT SELECT
...@@ -501,7 +503,8 @@ ...@@ -501,7 +503,8 @@
wlesal.equipment_index_id AS fireEquipmentIndexId, wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey, wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName, wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
if(wlesal.confirm_type IS NULL,0,1) AS confirmType, if(wlesal.confirm_type IS NULL, 0, 1) AS confirmType,
if(wlesal.clean_time IS NULL, 0, 1) AS cleanStatus,
CASE CASE
wlesal.equipment_specific_index_value wlesal.equipment_specific_index_value
WHEN 'true' THEN WHEN 'true' THEN
...@@ -549,6 +552,12 @@ ...@@ -549,6 +552,12 @@
<if test='confirmType != null and confirmType == 1'> <if test='confirmType != null and confirmType == 1'>
and wlesal.confirm_type IS NOT NULL and wlesal.confirm_type IS NOT NULL
</if> </if>
<if test='confirmType != null and confirmType == 2'>
and wlesal.clean_time IS NULL
</if>
<if test='confirmType != null and confirmType == 3'>
and wlesal.clean_time IS NOT NULL
</if>
</where> </where>
) d ) d
<where> <where>
......
<?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.equipmanage.mapper.VideoEquipmentSpecificMapper">
<select id="findBySpecificIdAndVideoIdIn" resultType="com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific">
SELECT
v.id,
v.equipment_specific_id AS equipmentSpecificId,
v.video_id AS videoId
FROM
`wl_video_equipment_specific` v
<where>
<if test="equipmentSpecificId != null">
v.equipment_specific_id = #{equipmentSpecificId}
</if>
<if test="list != null and list.size() >0">
AND v.video_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
...@@ -967,10 +967,13 @@ ...@@ -967,10 +967,13 @@
and a.biz_type = #{value} and a.biz_type = #{value}
</if> </if>
<if test="key == 'dangerIds' and value != null"> <if test="key == 'dangerIds' and value != null">
and a.id IN and (a.id IN
<foreach collection="value" item="id" open="(" separator="," close=")"> <foreach collection="value" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
<if test="paramMap['my'] == 0">
or a.danger_state = #{paramMap[submitDangerState]}
</if>)
</if> </if>
<if test="key == 'dangerState' and value != null and !value.isEmpty()"> <if test="key == 'dangerState' and value != null and !value.isEmpty()">
and a.danger_state IN and a.danger_state IN
......
...@@ -289,4 +289,15 @@ ...@@ -289,4 +289,15 @@
ALTER TABLE p_check add COLUMN `owner_name` varchar(255) DEFAULT NULL COMMENT '业主单位名称' after `owner_id`; ALTER TABLE p_check add COLUMN `owner_name` varchar(255) DEFAULT NULL COMMENT '业主单位名称' after `owner_id`;
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="suhuiguang" id="1641519644827-01">
<preConditions onFail="MARK_RAN">
<columnExists tableName="p_check" columnName="point_no"/>
</preConditions>
<comment>p_check MODIFY `point_no`</comment>
<sql>
alter table p_check MODIFY `point_no` varchar(100) DEFAULT NULL COMMENT '编号';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
ci.input_name as inputItemName, ci.input_name as inputItemName,
ci.user_name as checkUserName, ci.user_name as checkUserName,
ci.create_date as checkTime, ci.create_date as checkTime,
c.point_name pp.name as pointName
FROM `p_hidden_danger` phd FROM `p_hidden_danger` phd
left join p_check_input ci on phd.check_input_id = ci.id left join p_check_input ci on phd.check_input_id = ci.id
left join p_check c on c.id = phd.check_id left join p_point pp on pp.id = phd.point_id
<where> <where>
<if test="planId !=null and planId != ''">and phd.plan_id=#{planId}</if> <if test="planId !=null and planId != ''">and phd.plan_id=#{planId}</if>
<if test="pointId !=null and pointId != ''">and phd.point_id=#{pointId}</if> <if test="pointId !=null and pointId != ''">and phd.point_id=#{pointId}</if>
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<if test="catalogId!=null">and b.Catalog_Id = #{catalogId}</if> <if test="catalogId!=null">and b.Catalog_Id = #{catalogId}</if>
<if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if> <if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if> <if test="pointId!=null">and a.point_id = #{pointId}</if>
<if test="departmentId!=null and departmentId!='-1'"> and find_in_set(#{departmentId}, a.dep_id) > 0</if> <if test="departmentId!=null and departmentId!='-1'">and find_in_set(#{departmentId}, a.dep_id) > 0</if>
<choose> <choose>
<when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is <when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is
null) null)
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
THEN '2' THEN '2'
END END
) AS `Finish_Status`, ) AS `Finish_Status`,
a.is_ok is_ok, a.is_ok is_ok,
a.score, a.score,
d.`name` AS `route_name`, d.`name` AS `route_name`,
a.check_mode, a.check_mode,
...@@ -109,7 +109,8 @@ ...@@ -109,7 +109,8 @@
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id` LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id`
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id` LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id`
<if test="dangerId != null and dangerId != ''"> <if test="dangerId != null and dangerId != ''">
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY
check_id ) t ON t.check_id = a.id
</if> </if>
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if> <if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if>
...@@ -127,7 +128,7 @@ ...@@ -127,7 +128,7 @@
<if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if> <if test="orgCode!=null">and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if> <if test="pointId!=null">and a.point_id = #{pointId}</if>
<if test="checkTime!=null">and TO_DAYS(a.check_time) = TO_DAYS('${checkTime}')</if> <if test="checkTime!=null">and TO_DAYS(a.check_time) = TO_DAYS('${checkTime}')</if>
<if test="departmentId!=null and departmentId!='-1'"> and find_in_set(#{departmentId}, a.dep_id) > 0</if> <if test="departmentId!=null and departmentId!='-1'">and find_in_set(#{departmentId}, a.dep_id) > 0</if>
<if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if> <if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if>
<if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if> <if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if>
<choose> <choose>
...@@ -211,7 +212,8 @@ ...@@ -211,7 +212,8 @@
order by ci.order_no order by ci.order_no
</select> </select>
<select id="findCheckPointInputItem" resultType="com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo" <select id="findCheckPointInputItem"
resultType="com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo"
parameterType="long"> parameterType="long">
SELECT SELECT
pp.id pointId, pp.id pointId,
...@@ -250,16 +252,16 @@ ...@@ -250,16 +252,16 @@
order by pci.order_no order by pci.order_no
</select> </select>
<!-- <select id="checkHasRecord" resultType="int">--> <!-- <select id="checkHasRecord" resultType="int">-->
<!-- SELECT--> <!-- SELECT-->
<!-- count(1) num--> <!-- count(1) num-->
<!-- FROM--> <!-- FROM-->
<!-- p_check c--> <!-- p_check c-->
<!-- WHERE--> <!-- WHERE-->
<!-- is_ok in (1,2)--> <!-- is_ok in (1,2)-->
<!-- and c.point_id = #{pointId}--> <!-- and c.point_id = #{pointId}-->
<!-- and c.plan_task_id = #{planTaskId}--> <!-- and c.plan_task_id = #{planTaskId}-->
<!-- </select>--> <!-- </select>-->
<select id="pieChartData" resultType="Map"> <select id="pieChartData" resultType="Map">
SELECT SELECT
...@@ -334,7 +336,7 @@ ...@@ -334,7 +336,7 @@
<if test="orgCode!=null">AND (c.org_code LIKE concat(#{orgCode},"-%") or c.org_code = #{orgCode})</if> <if test="orgCode!=null">AND (c.org_code LIKE concat(#{orgCode},"-%") or c.org_code = #{orgCode})</if>
<if test="departmentId!=null">AND FIND_IN_SET(#{departmentId}, c.dep_id) > 0</if> <if test="departmentId!=null">AND FIND_IN_SET(#{departmentId}, c.dep_id) > 0</if>
<if test="userId != null and userId != '' "> <if test="userId != null and userId != '' ">
AND FIND_IN_SET(#{userId}, c.user_id) > 0 AND FIND_IN_SET(#{userId}, c.user_id) > 0
</if> </if>
<if test="planId != null and planId != '' "> <if test="planId != null and planId != '' ">
AND c.plan_id = #{planId} AND c.plan_id = #{planId}
...@@ -475,7 +477,7 @@ ...@@ -475,7 +477,7 @@
<when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when> <when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when>
<when test="finishStatus == 2">and `a`.`is_ok` = 3</when> <when test="finishStatus == 2">and `a`.`is_ok` = 3</when>
</choose> </choose>
<if test="departmentId!=null"> and find_in_set(#{departmentId},a.dep_id)>0 </if> <if test="departmentId!=null">and find_in_set(#{departmentId},a.dep_id)>0</if>
</trim> </trim>
</select> </select>
...@@ -658,12 +660,12 @@ ...@@ -658,12 +660,12 @@
sum(missed_check_num) forNum sum(missed_check_num) forNum
FROM FROM
p_plan_exec_statistics p_plan_exec_statistics
<where> <where>
<if test="orgCode!=null">AND LOCATE(#{orgCode}, org_Code) <![CDATA[>]]>0</if> <if test="orgCode!=null">AND LOCATE(#{orgCode}, org_Code) <![CDATA[>]]>0</if>
<if test="userId !=null">and user_id = #{userId}</if> <if test="userId !=null">and user_id = #{userId}</if>
AND check_time <![CDATA[>=]]> #{startDate} AND check_time <![CDATA[>=]]> #{startDate}
AND check_time <![CDATA[<=]]> #{endDate} AND check_time <![CDATA[<=]]> #{endDate}
</where> </where>
GROUP BY check_time GROUP BY check_time
) fa ) fa
...@@ -795,12 +797,13 @@ ...@@ -795,12 +797,13 @@
FROM FROM
p_point_classify classify p_point_classify classify
<where> <where>
classify.id IN ( SELECT pci.point_classify_id FROM p_check_input pci WHERE <if test="checkID != null">pci.check_id = #{checkID}</if> ) classify.id IN ( SELECT pci.point_classify_id FROM p_check_input pci WHERE <if test="checkID != null">
pci.check_id = #{checkID}
</if> )
</where> </where>
</select> </select>
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 --> <!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<select id="getCheckInputByCheckId" resultMap="checkInputResultMap"> <select id="getCheckInputByCheckId" resultMap="checkInputResultMap">
SELECT SELECT
...@@ -831,32 +834,33 @@ ...@@ -831,32 +834,33 @@
LEFT JOIN p_input_item ii ON ci.input_id = ii.id LEFT JOIN p_input_item ii ON ci.input_id = ii.id
LEFT JOIN p_check c ON ci.check_id = c.id LEFT JOIN p_check c ON ci.check_id = c.id
<where> <where>
<if test="checkID != null"> <if test="checkID != null">
AND ci.check_id = #{checkID} AND ci.check_id = #{checkID}
</if> </if>
<if test="pointID != null"> <if test="pointID != null">
AND c.point_id = #{pointID} AND c.point_id = #{pointID}
</if> </if>
</where> </where>
</select> </select>
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 --> <!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<select id="getCheckEquipByCheckID" resultType="java.util.HashMap" parameterType="java.lang.Long"> <select id="getCheckEquipByCheckID" resultType="java.util.HashMap" parameterType="java.lang.Long">
SELECT SELECT
classify.id as classifyId, classify.id as classifyId,
classify.name as equipmentName, classify.name as equipmentName,
classify.equipment_id as equipmentId, classify.equipment_id as equipmentId,
(SELECT create_date FROM p_check WHERE id = #{checkID}) as createDate (SELECT create_date FROM p_check WHERE id = #{checkID}) as createDate
FROM FROM
p_point_classify classify p_point_classify classify
WHERE WHERE
classify.id IN ( classify.id IN (
SELECT SELECT
pci.point_classify_id pci.point_classify_id
FROM p_check_input pci WHERE FROM p_check_input pci WHERE
<if test="pointID != null"> <if test="pointID != null">
pci.check_id = #{checkID} pci.check_id = #{checkID}
</if> ) </if>
)
</select> </select>
<!-- 根据巡检记录ID和巡检点ID获取巡检项信息 --> <!-- 根据巡检记录ID和巡检点ID获取巡检项信息 -->
<select id="getEquipInputByCheckId" resultType="java.util.HashMap"> <select id="getEquipInputByCheckId" resultType="java.util.HashMap">
...@@ -899,7 +903,7 @@ ...@@ -899,7 +903,7 @@
AND c.point_id = #{pointID} AND c.point_id = #{pointID}
</if> </if>
<if test="classifyId != null"> <if test="classifyId != null">
AND ci.point_classify_id = #{classifyId} AND ci.point_classify_id = #{classifyId}
</if> </if>
</where> </where>
</select> </select>
...@@ -937,7 +941,7 @@ ...@@ -937,7 +941,7 @@
<!-- 根据巡检记录ID和巡检点ID获取巡检详情 --> <!-- 根据巡检记录ID和巡检点ID获取巡检详情 -->
<select id="getCheckDetailByID" resultMap="checkDetailResultMap"> <select id="getCheckDetailByID" resultMap="checkDetailResultMap">
SELECT SELECT
c.user_id AS userId, c.user_id AS userId,
c.dep_id AS depId, c.dep_id AS depId,
c.check_time AS CheckTime, c.check_time AS CheckTime,
...@@ -975,12 +979,12 @@ ...@@ -975,12 +979,12 @@
LEFT JOIN p_plan pl ON c.plan_id = pl.id LEFT JOIN p_plan pl ON c.plan_id = pl.id
LEFT JOIN p_route r ON r.id = c.route_id LEFT JOIN p_route r ON r.id = c.route_id
<where> <where>
<if test="checkID != null and checkID!= -1"> <if test="checkID != null and checkID!= -1">
AND c.id = #{checkID} AND c.id = #{checkID}
</if> </if>
<if test="pointID != null"> <if test="pointID != null">
AND c.point_id = #{pointID} AND c.point_id = #{pointID}
</if> </if>
</where> </where>
ORDER BY ORDER BY
c.check_time DESC c.check_time DESC
...@@ -1092,7 +1096,8 @@ ...@@ -1092,7 +1096,8 @@
<!-- 风险点最新巡检信息查询,3d屏使用 --> <!-- 风险点最新巡检信息查询,3d屏使用 -->
<resultMap id="planRoutePointResultMap" type="com.yeejoin.amos.supervision.business.entity.mybatis.PlanRoutePointBo"> <resultMap id="planRoutePointResultMap"
type="com.yeejoin.amos.supervision.business.entity.mybatis.PlanRoutePointBo">
<result property="routeName" column="route_name"/> <result property="routeName" column="route_name"/>
<result property="planName" column="plan_name"/> <result property="planName" column="plan_name"/>
<result property="deptName" column="department_name"/> <result property="deptName" column="department_name"/>
...@@ -1189,7 +1194,7 @@ ...@@ -1189,7 +1194,7 @@
) sa ) sa
<where> <where>
c.plan_id = sa.id c.plan_id = sa.id
<if test="userId != null">AND find_in_set(#{userId}, sa.user_id) >0 </if> <if test="userId != null">AND find_in_set(#{userId}, sa.user_id) >0</if>
<if test="checkDate != null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = DATE_FORMAT(#{checkDate}, '%Y%m%d') <if test="checkDate != null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = DATE_FORMAT(#{checkDate}, '%Y%m%d')
</if> </if>
</where> </where>
...@@ -1218,13 +1223,13 @@ ...@@ -1218,13 +1223,13 @@
a.route_id AS routeID, a.route_id AS routeID,
b.name AS name, b.name AS name,
(SELECT (SELECT
GROUP_CONCAT( GROUP_CONCAT(
`name` `name`
) )
FROM FROM
s_user u s_user u
WHERE WHERE
find_in_set(u.id,a.user_id)>0 ) AS realName, find_in_set(u.id,a.user_id)>0 ) AS realName,
a.id AS planID a.id AS planID
FROM FROM
p_plan a, p_plan a,
...@@ -1235,7 +1240,7 @@ ...@@ -1235,7 +1240,7 @@
) sa ) sa
WHERE WHERE
d.plan_id = sa.planID d.plan_id = sa.planID
<if test="userId != null">AND find_in_set(#{userId}, sa.userID)>0 </if> <if test="userId != null">AND find_in_set(#{userId}, sa.userID)>0</if>
<if test="checkDate != null">AND DATE_FORMAT(d.check_time, '%y%m%d') = #{checkDate}</if> <if test="checkDate != null">AND DATE_FORMAT(d.check_time, '%y%m%d') = #{checkDate}</if>
ORDER BY d.id DESC ORDER BY d.id DESC
) temp_row ) temp_row
...@@ -1523,7 +1528,7 @@ ...@@ -1523,7 +1528,7 @@
a.checkMonth a.checkMonth
</when> </when>
</choose> --> </choose> -->
select select
<choose> <choose>
<when test=" statisticsTyle == 0 "> <when test=" statisticsTyle == 0 ">
a.planName name, a.planName name,
...@@ -1571,7 +1576,7 @@ ...@@ -1571,7 +1576,7 @@
pt.id pointId, pt.id pointId,
c.user_id userName, c.user_id userName,
c.dep_id deptName, c.dep_id deptName,
c.user_id userId, c.user_id userId,
c.dep_id departmentId, c.dep_id departmentId,
c.score, c.score,
c.id checkId, c.id checkId,
...@@ -1612,7 +1617,7 @@ ...@@ -1612,7 +1617,7 @@
LEFT JOIN p_point pt ON c.point_id = pt.id LEFT JOIN p_point pt ON c.point_id = pt.id
WHERE 1=1 WHERE 1=1
<if test="orgCode!=null"> <if test="orgCode!=null">
and (c.org_code LIKE CONCAT( #{orgCode}, '-%' ) or c.org_code= #{orgCode} ) and (c.org_code LIKE CONCAT( #{orgCode}, '-%' ) or c.org_code= #{orgCode} )
</if> </if>
<choose> <choose>
<when test=" statisticsTyle == 1 "> <when test=" statisticsTyle == 1 ">
...@@ -1685,110 +1690,110 @@ ...@@ -1685,110 +1690,110 @@
ADDDATE(#{startTime} , INTERVAL @d DAY)<![CDATA[ < ]]> DATE_FORMAT(#{endTime}, '%Y-%m-%d') ADDDATE(#{startTime} , INTERVAL @d DAY)<![CDATA[ < ]]> DATE_FORMAT(#{endTime}, '%Y-%m-%d')
) d LEFT JOIN p_check c ON DATE_FORMAT(c.check_time, '%Y-%m-%d') = d.date ) d LEFT JOIN p_check c ON DATE_FORMAT(c.check_time, '%Y-%m-%d') = d.date
<if test=" orgCode != null and orgCode != '' ">and position( #{orgCode} in c.org_code )</if> <if test=" orgCode != null and orgCode != '' ">and position( #{orgCode} in c.org_code )</if>
<if test=" userId != null and userId != '' ">and find_in_set(#{userId}, c.user_id)>0 </if> <if test=" userId != null and userId != '' ">and find_in_set(#{userId}, c.user_id)>0</if>
<if test="type == 1">and c.is_ok != #{param}</if> <if test="type == 1">and c.is_ok != #{param}</if>
<if test="type == 2">and c.plan_id != #{param}</if> <if test="type == 2">and c.plan_id != #{param}</if>
<if test="type == 3">and c.is_ok = #{param}</if> <if test="type == 3">and c.is_ok = #{param}</if>
<where> <where>
<if test="startTime !=null and startTime!= '' "> <![CDATA[ AND d.date >= #{startTime} ]]> </if> <if test="startTime !=null and startTime!= '' "> <![CDATA[ AND d.date >= #{startTime} ]]> </if>
<if test="endTime !=null and endTime!='' "><![CDATA[AND d.date < #{endTime} ]]></if> <if test="endTime !=null and endTime!='' "><![CDATA[AND d.date < #{endTime} ]]></if>
</where> </where>
group by d.date group by d.date
order BY d.date order BY d.date
</select> </select>
<!-- 巡检记录查询 --> <!-- 巡检记录查询 -->
<!-- <select id="getCheckInfoList1" resultMap="CheckInfoResultMap">--> <!-- <select id="getCheckInfoList1" resultMap="CheckInfoResultMap">-->
<!-- select * from (--> <!-- select * from (-->
<!-- SELECT--> <!-- SELECT-->
<!-- DATE_FORMAT(c.check_time, '%Y-%m-%d %T') as checkTime,--> <!-- DATE_FORMAT(c.check_time, '%Y-%m-%d %T') as checkTime,-->
<!-- c.user_id as UserID,--> <!-- c.user_id as UserID,-->
<!-- c.point_id as PointID,--> <!-- c.point_id as PointID,-->
<!-- c.id as CheckID,--> <!-- c.id as CheckID,-->
<!-- c.is_ok as IsOK,--> <!-- c.is_ok as IsOK,-->
<!-- c.error as ErrorMsg,--> <!-- c.error as ErrorMsg,-->
<!-- c.plan_task_id as ErrorID,--> <!-- c.plan_task_id as ErrorID,-->
<!-- p.name as pointName,--> <!-- p.name as pointName,-->
<!-- c.dep_name as NAME,--> <!-- c.dep_name as NAME,-->
<!-- c.dep_id as GroupID,--> <!-- c.dep_id as GroupID,-->
<!-- c.user_name as RealName,--> <!-- c.user_name as RealName,-->
<!-- (SELECT--> <!-- (SELECT-->
<!-- GROUP_CONCAT(--> <!-- GROUP_CONCAT(-->
<!-- IFNULL(case when u.mobile = '' or u.mobile is null then null else u.mobile END,u.telephone)--> <!-- IFNULL(case when u.mobile = '' or u.mobile is null then null else u.mobile END,u.telephone)-->
<!-- )--> <!-- )-->
<!-- FROM--> <!-- FROM-->
<!-- s_user u--> <!-- s_user u-->
<!-- WHERE--> <!-- WHERE-->
<!-- find_in_set(u.id,c.user_id)>0) as LoginName,--> <!-- find_in_set(u.id,c.user_id)>0) as LoginName,-->
<!-- c.org_code as orgCode--> <!-- c.org_code as orgCode-->
<!-- FROM--> <!-- FROM-->
<!-- p_check c,--> <!-- p_check c,-->
<!-- p_point p--> <!-- p_point p-->
<!-- where--> <!-- where-->
<!-- p.id =c.point_id ) as a--> <!-- p.id =c.point_id ) as a-->
<!-- <trim prefix="WHERE" prefixOverrides="AND ">--> <!-- <trim prefix="WHERE" prefixOverrides="AND ">-->
<!-- <if test="pointID!=null">AND a.PointID = #{pointID}</if>--> <!-- <if test="pointID!=null">AND a.PointID = #{pointID}</if>-->
<!-- <if test="checkTime!=null">AND DATE_FORMAT(a.CheckTime, '%Y%m%d') = #{checkTime}</if>--> <!-- <if test="checkTime!=null">AND DATE_FORMAT(a.CheckTime, '%Y%m%d') = #{checkTime}</if>-->
<!-- <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, a.userID)>0 </if>--> <!-- <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, a.userID)>0 </if>-->
<!-- <if test="status!=null">AND a.IsOK = #{status}</if>--> <!-- <if test="status!=null">AND a.IsOK = #{status}</if>-->
<!-- <if test="userName!=null">AND a.RealName LIKE concat(concat("%",#{userName}),"%")</if>--> <!-- <if test="userName!=null">AND a.RealName LIKE concat(concat("%",#{userName}),"%")</if>-->
<!-- <if test="groupId!=null">AND find_in_set(#{groupId}, a.GroupID)>0</if>--> <!-- <if test="groupId!=null">AND find_in_set(#{groupId}, a.GroupID)>0</if>-->
<!-- <if test="pointName!=null">AND a.pointName LIKE concat(concat("%",#{pointName}),"%")</if>--> <!-- <if test="pointName!=null">AND a.pointName LIKE concat(concat("%",#{pointName}),"%")</if>-->
<!-- <if test="orgCode!=null">AND a.orgCode LIKE #{orgCode}</if>--> <!-- <if test="orgCode!=null">AND a.orgCode LIKE #{orgCode}</if>-->
<!-- </trim>--> <!-- </trim>-->
<!-- <choose>--> <!-- <choose>-->
<!-- <when test="pageSize==-1"></when>--> <!-- <when test="pageSize==-1"></when>-->
<!-- <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>--> <!-- <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>-->
<!-- </choose>--> <!-- </choose>-->
<!-- </select>!&ndash;&gt;--> <!-- </select>!&ndash;&gt;-->
<select id="getCheckInfoList1" resultType="Map"> <select id="getCheckInfoList1" resultType="Map">
select select
c.id as checkID, c.id as checkID,
c.dep_name as name, c.dep_name as name,
c.dep_id as groupID, c.dep_id as groupID,
c.user_name as realName, c.user_name as realName,
c.org_code as orgCode, c.org_code as orgCode,
c.user_id as userID, c.user_id as userID,
c.point_id as pointID, c.point_id as pointID,
c.is_ok as isOK, c.is_ok as isOK,
c.error as errorMsg, c.error as errorMsg,
c.plan_task_id as errorID, c.plan_task_id as errorID,
date_format(c.check_time, '%Y-%m-%d %T') as checkTime, date_format(c.check_time, '%Y-%m-%d %T') as checkTime,
p.name as pointName p.name as pointName
from from
p_check c, p_check c,
p_point p p_point p
where c.point_id = p.id where c.point_id = p.id
<if test="pointID!=null">AND c.point_id = #{pointID}</if> <if test="pointID!=null">AND c.point_id = #{pointID}</if>
<if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if> <if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if>
<if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0 </if> <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0</if>
<if test="status!=null">AND c.is_ok = #{status}</if> <if test="status!=null">AND c.is_ok = #{status}</if>
<if test="userName!=null">AND c.error LIKE concat(concat("%",#{userName}),"%")</if> <if test="userName!=null">AND c.error LIKE concat(concat("%",#{userName}),"%")</if>
<if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if> <if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if>
<if test="pointName!=null">AND p.name LIKE concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null">AND p.name LIKE concat(concat("%",#{pointName}),"%")</if>
<if test="orgCode!=null">AND c.org_code LIKE #{orgCode}</if> <if test="orgCode!=null">AND c.org_code LIKE #{orgCode}</if>
order by c.create_date DESC order by c.create_date DESC
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose>
</select> </select>
<!-- 巡检记录统计 --> <!-- 巡检记录统计 -->
<select id="countCheckInfoListData1" resultType="long"> <select id="countCheckInfoListData1" resultType="long">
select select
count(1) count(1)
from from
p_check c, p_check c,
p_point p p_point p
where c.point_id = p.id where c.point_id = p.id
<if test="pointID!=null">AND c.point_id = #{pointID}</if> <if test="pointID!=null">AND c.point_id = #{pointID}</if>
<if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if> <if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if>
<if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0 </if> <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0</if>
<if test="status!=null">AND c.is_ok = #{status}</if> <if test="status!=null">AND c.is_ok = #{status}</if>
<if test="userName!=null">AND c.user_name LIKE concat(concat("%",#{userName}),"%")</if> <if test="userName!=null">AND c.user_name LIKE concat(concat("%",#{userName}),"%")</if>
<if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if> <if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if>
...@@ -1883,11 +1888,11 @@ ...@@ -1883,11 +1888,11 @@
) d ) d
LEFT JOIN p_plan_task c ON DATE_FORMAT(c.check_date, '%Y-%m-%d') = d.date LEFT JOIN p_plan_task c ON DATE_FORMAT(c.check_date, '%Y-%m-%d') = d.date
<if test="orgCode !=null and orgCode!='' "> <if test="orgCode !=null and orgCode!='' ">
AND (c.org_code=#{orgCode} or c.org_code like CONCAT(#{orgCode},'-%')) AND (c.org_code=#{orgCode} or c.org_code like CONCAT(#{orgCode},'-%'))
</if> </if>
WHERE 1=1 WHERE 1=1
<if test="startTime !=null and startTime!= '' "> AND d.date <![CDATA[ >= ]]> #{startTime}</if> <if test="startTime !=null and startTime!= '' ">AND d.date <![CDATA[ >= ]]> #{startTime}</if>
<if test="endTime !=null and endTime!='' "> AND d.date <![CDATA[ < ]]> #{endTime} </if> <if test="endTime !=null and endTime!='' ">AND d.date <![CDATA[ < ]]> #{endTime}</if>
GROUP BY GROUP BY
d.date d.date
ORDER BY ORDER BY
...@@ -1896,22 +1901,22 @@ ...@@ -1896,22 +1901,22 @@
<select id="getItemCount" resultType="long"> <select id="getItemCount" resultType="long">
SELECT SELECT
count(1) count(1)
FROM FROM
p_input_item pii p_input_item pii
LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id
LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id
LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id
LEFT JOIN p_point pp ON ppi.point_id =pp.id LEFT JOIN p_point pp ON ppi.point_id =pp.id
WHERE WHERE
prp.route_id = #{routeId} prp.route_id = #{routeId}
<if test="pointId != null and pointId != '' and pointId != -1"> <if test="pointId != null and pointId != '' and pointId != -1">
AND ppi.point_id = #{pointId} AND ppi.point_id = #{pointId}
</if> </if>
<choose> <choose>
<when test="status != null and status != '' and status==0"> <when test="status != null and status != '' and status==0">
AND pci.id IS NULL AND pci.id IS NULL
</when> </when>
<when test="status != null and status != '' and status==1"> <when test="status != null and status != '' and status==1">
AND pci.id IS NOT NULL AND pci.id IS NOT NULL
...@@ -1924,43 +1929,43 @@ ...@@ -1924,43 +1929,43 @@
<select id="getCheckItems" resultType="Map"> <select id="getCheckItems" resultType="Map">
SELECT SELECT
ppi.id inputItemId, ppi.id inputItemId,
pii.name itemName, pii.name itemName,
pci.id IS NOT NULL finishStatus, pci.id IS NOT NULL finishStatus,
pci.safety_danger_num safetyNum, pci.safety_danger_num safetyNum,
pci.major_danger_num majorNum, pci.major_danger_num majorNum,
DATE_FORMAT(pci.create_date,'%Y-%m-%d %H:%i:%s') checkTime, DATE_FORMAT(pci.create_date,'%Y-%m-%d %H:%i:%s') checkTime,
pp.name companyName, pp.name companyName,
pci.user_name executeName pci.user_name executeName
FROM FROM
p_input_item pii p_input_item pii
LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id
LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id
LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id
LEFT JOIN p_point pp ON ppi.point_id =pp.id LEFT JOIN p_point pp ON ppi.point_id =pp.id
WHERE WHERE
prp.route_id = #{routeId} prp.route_id = #{routeId}
<if test="pointId != null and pointId != '' and pointId != -1"> <if test="pointId != null and pointId != '' and pointId != -1">
AND ppi.point_id = #{pointId} AND ppi.point_id = #{pointId}
</if> </if>
<choose> <choose>
<when test="status != null and status != '' and status==0"> <when test="status != null and status != '' and status==0">
AND pci.id IS NULL AND pci.id IS NULL
</when> </when>
<when test="status != null and status != '' and status==1"> <when test="status != null and status != '' and status==1">
AND pci.id IS NOT NULL AND pci.id IS NOT NULL
</when> </when>
</choose> </choose>
<if test="teamId != null and teamId != ''"> <if test="teamId != null and teamId != ''">
AND pp.original_id = #{teamId} AND pp.original_id = #{teamId}
</if> </if>
<!-- <if test="status != null and status != ''">--> <!-- <if test="status != null and status != ''">-->
<!-- AND pc.point_id = #{status}--> <!-- AND pc.point_id = #{status}-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="companyName != null and companyName != ''">--> <!-- <if test="companyName != null and companyName != ''">-->
<!-- AND pc.company_name = #{company_name}--> <!-- AND pc.company_name = #{company_name}-->
<!-- </if>--> <!-- </if>-->
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</select> </select>
...@@ -1983,12 +1988,12 @@ ...@@ -1983,12 +1988,12 @@
</select> </select>
<select id="queryPageCount" resultType="long"> <select id="queryPageCount" resultType="long">
SELECT SELECT
COUNT(1) COUNT(1)
FROM FROM
p_check c p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_input_item i ON i.id = ci.input_id LEFT JOIN p_input_item i ON i.id = ci.input_id
LEFT JOIN p_point pp ON pp.id = c.point_id LEFT JOIN p_point pp ON pp.id = c.point_id
<where> <where>
<if test="planId != null"> <if test="planId != null">
c.plan_id = #{planId} c.plan_id = #{planId}
...@@ -1999,30 +2004,30 @@ ...@@ -1999,30 +2004,30 @@
<if test="pointId != null and pointId != -1"> <if test="pointId != null and pointId != -1">
AND pp.id = #{pointId} AND pp.id = #{pointId}
</if> </if>
<!-- <if test="orgCode != null">--> <!-- <if test="orgCode != null">-->
<!-- AND c.org_code = #{orgCode}--> <!-- AND c.org_code = #{orgCode}-->
<!-- </if>--> <!-- </if>-->
</where> </where>
</select> </select>
<select id="queryPage" resultType="com.yeejoin.amos.supervision.business.vo.CheckVo"> <select id="queryPage" resultType="com.yeejoin.amos.supervision.business.vo.CheckVo">
SELECT SELECT
i.id, c.id checkId,
i.`name` inputItemName, i.id,
ci.safety_danger_num, i.`name` inputItemName,
ci.major_danger_num, ci.safety_danger_num,
ci.create_date checkTime, ci.major_danger_num,
ci.user_name, ci.create_date checkTime,
ci.accompany_user_name, ci.user_name,
pp.original_id, ci.accompany_user_name,
pp.name companyName, pp.original_id,
pp.name companyName,
IF IF
( c.check_time IS NULL, 0, 1 ) AS ext ( c.check_time IS NULL, 0, 1 ) AS ext
FROM FROM
p_check c p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_input_item i ON i.id = ci.input_id LEFT JOIN p_input_item i ON i.id = ci.input_id
LEFT JOIN p_point pp ON pp.id = c.point_id LEFT JOIN p_point pp ON pp.id = c.point_id
<where> <where>
<if test="planId != null"> <if test="planId != null">
c.plan_id = #{planId} c.plan_id = #{planId}
...@@ -2033,9 +2038,9 @@ ...@@ -2033,9 +2038,9 @@
<if test="pointId != null and pointId != -1"> <if test="pointId != null and pointId != -1">
AND pp.id = #{pointId} AND pp.id = #{pointId}
</if> </if>
<!-- <if test="orgCode != null">--> <!-- <if test="orgCode != null">-->
<!-- AND c.org_code = #{orgCode}--> <!-- AND c.org_code = #{orgCode}-->
<!-- </if>--> <!-- </if>-->
ORDER BY c.check_time DESC ORDER BY c.check_time DESC
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
...@@ -2043,4 +2048,17 @@ ...@@ -2043,4 +2048,17 @@
</choose> </choose>
</where> </where>
</select> </select>
<select id="getCheckListByTaskId" resultType="com.yeejoin.amos.supervision.dao.entity.Check">
select * from p_check where plan_task_id = #{planTaskId}
</select>
<select id="getPictureByCheckId" resultType="java.lang.String">
SELECT
photo_data
FROM
p_check_shot
WHERE
check_id = #{checkId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -361,6 +361,7 @@ ...@@ -361,6 +361,7 @@
p.id pointId, p.id pointId,
p.point_no pointNO, p.point_no pointNO,
p.offline, p.offline,
p.original_id originalId,
ptd.status, ptd.status,
ptd.is_finish finish, ptd.is_finish finish,
p.is_fixed isFixed, p.is_fixed isFixed,
......
...@@ -805,5 +805,55 @@ ...@@ -805,5 +805,55 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="kongfm" id="2022-01-05-01">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="tcb_equipment_use_info"/>
</not>
</preConditions>
<comment>add tcb_equipment_use_info table </comment>
<sql>
CREATE TABLE `tcb_equipment_use_info` (
`sequence_nbr` bigint(30) NOT NULL,
`use_unit_name` varchar(200) DEFAULT NULL COMMENT '使用单位名称',
`use_unit_id` bigint(30) DEFAULT NULL COMMENT '使用单位id',
`use_organization_code` varchar(30) DEFAULT NULL COMMENT '使用单位统一信用代码',
`property_unit_name` varchar(50) DEFAULT NULL COMMENT '产权单位名称',
`property_unit_id` bigint(30) DEFAULT NULL COMMENT '产权单位id',
`property_organization_code` varchar(30) DEFAULT NULL COMMENT '产权统一信用代码',
`use_address` varchar(300) DEFAULT NULL COMMENT '使用地址',
`longitude` varchar(50) DEFAULT NULL COMMENT '经度',
`latitude` varchar(255) DEFAULT NULL COMMENT '纬度',
`use_site` varchar(30) DEFAULT NULL COMMENT '使用场所',
`use_site_code` varchar(30) DEFAULT NULL COMMENT '使用场所编码',
`special_code` varchar(50) DEFAULT NULL COMMENT '特设编码',
`register_code` varchar(50) DEFAULT NULL COMMENT '设备注册代码',
`rescue_code` varchar(50) DEFAULT NULL COMMENT '96333识别码',
`register_licence_code` varchar(50) DEFAULT NULL COMMENT '使用登记证编码',
`register_org` varchar(30) DEFAULT NULL COMMENT '登记机关',
`register_org_id` bigint(30) DEFAULT NULL COMMENT '登记机关id',
`register_time` datetime DEFAULT NULL COMMENT '登记日期',
`issue_licence_time` datetime DEFAULT NULL COMMENT '发证日期',
`start_use_time` datetime DEFAULT NULL COMMENT '投入使用日期',
`rec_user_id` bigint(30) DEFAULT NULL COMMENT '更新人id',
`rec_user_name` varchar(100) DEFAULT NULL COMMENT '更新人名称',
`rec_date` datetime DEFAULT NULL COMMENT '更新时间',
`is_delete` bit(1) DEFAULT b'0' COMMENT '是否删除(0:未删除,1:已删除)',
PRIMARY KEY (`sequence_nbr`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备使用信息表';
</sql>
</changeSet>
<changeSet author="kongfm" id="2022-01-05-02">
<preConditions onFail="MARK_RAN">
<tableExists tableName="tcb_equipment_use_info"/>
</preConditions>
<comment>modify table tcb_equipment_use_info add equipment_id columns</comment>
<sql>
ALTER TABLE `tcb_equipment_use_info` add equipment_id bigint(50) COMMENT '设备ID';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment