Commit 31517fa4 authored by 高建强's avatar 高建强

Merge branch 'develop_dl_plan6' into develop_dl_plan6_temp

# Conflicts: # amos-boot-system-equip/src/main/resources/application.properties # amos-boot-system-jcs/src/main/resources/application.properties
parents 89ea7161 834a792d
package com.yeejoin.equipmanage.common.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@TableName("wl_marquee_data")
@ApiModel(value = "marquee_data对象", description = "")
public class MarqueeData extends BaseEntity {
/**
* 类型
*/
private String type;
/**
* 设备名称
*/
private String name;
/**
* 位置
*/
private String position;
/**
* 消息类型
*/
private String messageType;
/**
* 是否已读【0:未读;1:已读】
*/
private int isRead;
/**
* 设备id
*/
private Long equipmentSpecificId;
}
......@@ -7,7 +7,8 @@ import java.util.Map;
public enum PressurePumpEnum {
// ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "ge", "5", "", "aaa", "bbb", "last"),
ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC","", "0 0/5 * * * ?", "5",
PressurePumpValueEnum.PUMP_START_TIME.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getCode()),
ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5",
PressurePumpValueEnum.LAST_STOP.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode()),
ALONE_STOP_QT("FHS_PressurePump_Stop_ALONE_STOP_QT", PressurePumpCheckEnum.GE.getCode(), "5", "",
......
......@@ -2,10 +2,10 @@ package com.yeejoin.equipmanage.common.enums;
public enum PressurePumpMessageEnum {
MESSAGE_LEVEL_YB("YB", "【%s】分钟内,启停间隔较小", "","名称:稳压泵启停异常提醒;时间:%s;内容:【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"),
MESSAGE_LEVEL_YZ("YZ", "【%s】分钟内,启停间隔较小", "", "名称:稳压泵启停异常提醒;时间:%s;内容:【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"),
MESSAGE_LEVEL_QT_WJ("QT_WJ", "【%s】分钟内,设备启停频繁", "", "名称:漏水提醒; 时间:%s;内容:【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,可能存在漏水,请及时查看处理"),
MESSAGE_LEVEL_QT_WJ_YXSC("WJ_YXSC", "运行时长超过【%s】分钟,存在漏水可能", "", "名称:漏水提醒; 时间:%s;内容:【%s】- 【%s】 - 运行时长超过【%s】分钟,存在漏水可能,请及时查看处理");
MESSAGE_LEVEL_YB("YB", "【%s】分钟内,启停间隔较小", "","【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"),
MESSAGE_LEVEL_YZ("YZ", "【%s】分钟内,启停间隔较小", "", "【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,请及时查看处理"),
MESSAGE_LEVEL_QT_WJ("QT_WJ", "【%s】分钟内,设备启停频繁", "类型:漏水提醒 ;设备位置:【稳压泵设备位置】; 设备名称:【稳压泵设备名称】 ; 时间:系统推送时间", "【%s】- 【%s】 - 【%s】分钟内,设备启停频繁,可能存在漏水,请及时查看处理"),
MESSAGE_LEVEL_QT_WJ_YXSC("WJ_YXSC", "运行时长超过【%s】分钟,存在漏水可能", "类型:漏水提醒 ;设备位置:【稳压泵设备位置】; 设备名称:【稳压泵设备名称】 ; 时间:系统推送时间", "【%s】- 【%s】 - 运行时长超过【%s】分钟,存在漏水可能,请及时查看处理");
private String code;
private String allMessage;
private String marqueeMessage;
......
......@@ -5,6 +5,7 @@ public enum PressurePumpValueEnum {
LAST_STOP("lastStop", "上次停泵时间"),
LAST_START("lastStart", "上次启泵时间"),
LATELY_STOP("latelyStop", "所有泵最近一次停泵时间"),
PUMP_START_TIME("pumpStartTime", "计算启动时常"),
LATELY_START("latelyStart", "所有泵最近一次启泵时间");
private String code;
......
package com.yeejoin.amos.boot.module.common.biz.enums;
public enum DataDictionaryTypeEnum {
PERSON_TYPE("人员类型", "DLRYLX");
private String name;
private String code;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
DataDictionaryTypeEnum(String name, String code) {
this.name = name;
this.code = code;
}
}
package com.yeejoin.amos.boot.module.common.biz.enums;
public enum DynamicGroupCode {
public enum DynamicGroupCodeEnum {
JCS_PERSON("机场人员", "246");
......@@ -23,7 +23,7 @@ public enum DynamicGroupCode {
this.code = code;
}
DynamicGroupCode(String name, String code) {
DynamicGroupCodeEnum(String name, String code) {
this.name = name;
this.code = code;
}
......
......@@ -11,7 +11,10 @@ import java.util.stream.Stream;
import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCode;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService;
import com.yeejoin.amos.boot.module.common.biz.enums.DataDictionaryTypeEnum;
import com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCodeEnum;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
......@@ -74,6 +77,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
@Autowired
IDataDictionaryService dataDictionaryService;
/**
* 每天单个班次执勤人数全部小于等于3人
*/
......@@ -182,7 +189,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
});
}
// 获取人员详细信息
List<Map<String, Object>> personInfoList = dynamicFormInstanceService.personInfoList(DynamicGroupCode.JCS_PERSON.getCode(), userIdSet);
List<Map<String, Object>> personInfoList = dynamicFormInstanceService.personInfoList(DynamicGroupCodeEnum.JCS_PERSON.getCode(), userIdSet);
if (!CollectionUtils.isEmpty(personInfoList)) {
Map<String, List<Map<String, Object>>> listMap = personInfoList.stream().collect(Collectors.groupingBy((Map m) -> String.valueOf(m.get("userId"))));
records.forEach(x -> {
......@@ -619,9 +626,17 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "peopleType")
.eq(DynamicFormInstance::getInstanceId, userId)
.eq(DynamicFormInstance::getGroupCode, DynamicGroupCode.JCS_PERSON.getCode()));
.eq(DynamicFormInstance::getGroupCode, DynamicGroupCodeEnum.JCS_PERSON.getCode()));
if (!CollectionUtils.isEmpty(instances)) {
d.put("personType", instances.get(0).getFieldValue());
String fieldValue = instances.get(0).getFieldValue();
List<DataDictionary> dictionaryList = dataDictionaryService.getByType(DataDictionaryTypeEnum.PERSON_TYPE.getCode());
if (StringUtils.isNotBlank(fieldValue) && !CollectionUtils.isEmpty(dictionaryList)) {
Map<String, List<DataDictionary>> map = dictionaryList.stream().collect(Collectors.groupingBy(DataDictionary::getCode));
List<DataDictionary> list = map.get(fieldValue);
if (!CollectionUtils.isEmpty(list)) {
d.put("personType", list.get(0).getName());
}
}
}
}
return d;
......
......@@ -218,9 +218,10 @@ public class BuildingController extends AbstractBaseController {
@PutMapping(value = "/commonUpdate")
public Object update(
@RequestParam Long instanceId,
@RequestParam(value = "groupCode", required = false) String groupCode,
@RequestBody Map<String, Object> map) {
String orgCode = getOrgCode();
return buildService.updateForm(instanceId, orgCode, map);
return buildService.updateForm(instanceId, orgCode, map, groupCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
package com.yeejoin.equipmanage.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.common.vo.AlarmDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmEquipMockDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmListDataVO;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -23,20 +24,11 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.utils.CommonPageInfoParam;
import com.yeejoin.equipmanage.common.utils.CommonPageParamUtil;
import com.yeejoin.equipmanage.common.utils.CommonPageable;
import com.yeejoin.equipmanage.common.utils.CommonRequest;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.AlarmDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmEquipMockDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmListDataVO;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author keyong
......@@ -181,6 +173,108 @@ public class EquipmentAlarmController extends AbstractBaseController {
}
/**
* 稳压泵跑马灯消息已读列表分页查询
*
* @return
*/
@RequestMapping(value = "/listPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", produces = "application/json;charset=UTF-8", notes = "列表分页查询")
public ResponseModel list(@RequestParam(value = "beginDate", required = false) String beginDate,
@RequestParam(value = "endDate", required = false) String endDate,
@RequestParam(value = "warehouseStructureName", required = false) String warehouseStructureName,
@RequestParam(value = "equipCode", required = false) String equipCode,
@RequestParam(value = "handleStatus", required = false) String handleStatus,
@RequestParam(value = "system", required = false) String system,
@RequestParam(value = "alarmType", required = false) String alarmType,
@RequestParam(value = "type", required = false) String type,
@RequestParam(value = "buildIds", required = false) List<String> buildIds,
@RequestParam(value = "id", required = false) String id,
@RequestParam(value = "cleanStatus", required = false) String cleanStatus,
@RequestParam(value = "isRemoveShield", required = false) String isRemoveShield,
CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
ReginParams reginParams = getSelectedOrgInfo();
List<CommonRequest> queryRequests = new ArrayList<>();
CommonRequest request = new CommonRequest();
request.setName("beginDate");
request.setValue(StringUtil.isNotEmpty(beginDate) ? StringUtils.trimToNull(beginDate).substring(0, 10) + " 00:00:00" : null);
queryRequests.add(request);
CommonRequest request1 = new CommonRequest();
request1.setName("endDate");
request1.setValue(StringUtil.isNotEmpty(endDate) ? StringUtils.trimToNull(endDate).substring(0, 10) + " 23:59:59" : null);
queryRequests.add(request1);
CommonRequest request2 = new CommonRequest();
request2.setName("warehouseStructureName");
request2.setValue(StringUtil.isNotEmpty(warehouseStructureName) ? StringUtils.trimToNull(warehouseStructureName) : null);
queryRequests.add(request2);
CommonRequest request3 = new CommonRequest();
request3.setName("equipCode");
request3.setValue(StringUtil.isNotEmpty(equipCode) ? StringUtils.trimToNull(equipCode) : null);
queryRequests.add(request3);
CommonRequest request4 = new CommonRequest();
request4.setName("alarmType");
request4.setValue(StringUtil.isNotEmpty(alarmType) ? StringUtils.trimToNull(alarmType) : null);
queryRequests.add(request4);
CommonRequest request5 = new CommonRequest();
request5.setName("orgCode");
request5.setValue(null);
queryRequests.add(request5);
CommonRequest request6 = new CommonRequest();
request6.setName("handleStatus");
request6.setValue(StringUtil.isNotEmpty(handleStatus) ? StringUtils.trimToNull(handleStatus) : null);
queryRequests.add(request6);
CommonRequest request7 = new CommonRequest();
request7.setName("system");
request7.setValue(StringUtil.isNotEmpty(system) ? StringUtils.trimToNull(system) : null);
queryRequests.add(request7);
CommonRequest request8 = new CommonRequest();
request8.setName("type");
request8.setValue(StringUtil.isNotEmpty(type) ? StringUtils.trimToNull(type) : null);
queryRequests.add(request8);
CommonRequest request9 = new CommonRequest();
request9.setName("buildIds");
request9.setValue(ObjectUtils.isEmpty(buildIds) ? null : buildIds);
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);
CommonRequest request12 = new CommonRequest();
request12.setName("isRemoveShield");
request12.setValue(StringUtil.isNotEmpty(isRemoveShield) ? StringUtils.trimToNull(isRemoveShield) : null);
queryRequests.add(request12);
if (equioEnabled) {
if (!ValidationUtil.isEmpty(reginParams.getPersonIdentity())) {
CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode");
request13.setValue(StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null);
queryRequests.add(request13);
}
}else {
CommonRequest request13 = new CommonRequest();
request13.setName("bizOrgCode");
request13.setValue("");
}
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<Map<String, Object>> list = iEquipmentSpecificAlarmService.pageList(param);
return CommonResponseUtil.success(list);
}
@RequestMapping(value = "/updateReadStatus", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "修改消息已读状态", produces = "application/json;charset=UTF-8", notes = "修改消息已读状态")
public ResponseModel updateReadStatus(@RequestParam(value = "messageId") String messageId) {
return CommonResponseUtil.success(iEquipmentSpecificAlarmService.updateReadStatus(messageId));
}
/**
* 通过id获取告警详情
*
* @return
......
......@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.vo.*;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -609,4 +610,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Map<String, Object> getPipeNetwork(@Param("equipSpeId") Long equipSpeId);
Map<String, Object> getWaterPoolLevel(@Param("equipSpeId") Long equipSpeId);
BigDecimal getWaterPoolLevelByEquipSpeId(@Param("equipSpeId") String equipSpeId);
}
......@@ -212,4 +212,6 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> {
* @return
*/
List<String> selectChildListdate(@Param("id")Long id);
int updateFormFieldValue(@Param("id") Long id, @Param("name") String name, @Param("value") String value);
}
package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.MarqueeData;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface MarqueeDataMapper extends BaseMapper<MarqueeData> {
List<Map<String, Object>> selectAll();
}
package com.yeejoin.equipmanage.quartz;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.MarqueeData;
import com.yeejoin.equipmanage.common.enums.PressurePumpEnum;
import com.yeejoin.equipmanage.common.enums.PressurePumpMessageEnum;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.Token;
import com.yeejoin.equipmanage.fegin.SystemctlFeign;
import com.yeejoin.equipmanage.mapper.MarqueeDataMapper;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.text.SimpleDateFormat;
import java.util.*;
@Slf4j
public class PumpSendMessage implements Job {
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
Map jobDataMap = (Map) jobExecutionContext.getJobDetail().getJobDataMap().get("parameterList");
String jobName = String.valueOf(jobDataMap.get("jobName"));
String triggerName = String.valueOf(jobDataMap.get("triggerName"));
String triggerGroupName = String.valueOf(jobDataMap.get("triggerGroupName"));
String jobGroupName = String.valueOf(jobDataMap.get("jobGroupName"));
EquipmentSpecific equipmentSpecific = (EquipmentSpecific)jobDataMap.get("equipmentSpecific");
PressurePumpEnum pressurePumpEnum = (PressurePumpEnum)jobDataMap.get("pressurePumpEnum");
SystemctlFeign systemctlFeign = (SystemctlFeign)jobDataMap.get("systemctlFeign");
RemoteSecurityService remoteSecurityService = (RemoteSecurityService)jobDataMap.get("remoteSecurityService");
MarqueeDataMapper marqueeDataMapper = (MarqueeDataMapper)jobDataMap.get("marqueeDataMapper");
MessageModel model = new MessageModel();
model.setSendTime(new Date());
String body = "";
Map<String, String> map = new HashMap<>(4);
String allMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getAllMessage();
if (StringUtil.isNotEmpty(allMessage)) {
String content = String.format(allMessage, pressurePumpEnum.getRightValue());
map.put("content", content);
map.put("type", "漏水提醒");
map.put("time", new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(new Date()));
map.put("name", equipmentSpecific.getName());
}
String recordMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getRecordMessage();
if (StringUtil.isNotEmpty(recordMessage)) {
body = String.format(recordMessage, equipmentSpecific.getName(), equipmentSpecific.getPosition(), pressurePumpEnum.getRightValue());
}
String marqueeMessage = PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ_YXSC.getMarqueeMessage();
if (StringUtil.isNotEmpty(marqueeMessage)) {
MarqueeData marqueeData = new MarqueeData();
marqueeData.setIsRead(0);
marqueeData.setEquipmentSpecificId(equipmentSpecific.getId());
marqueeData.setMessageType("pressurePump");
marqueeData.setName(equipmentSpecific.getName());
marqueeData.setPosition(equipmentSpecific.getPosition());
marqueeData.setType("漏水提醒");
marqueeData.setCreateDate(new Date());
marqueeDataMapper.insert(marqueeData);
}
model.setBody(body);
model.setTitle("漏水提醒");
model.setExtras(map);
model.setRelationId(String.valueOf(equipmentSpecific.getId()));
model.setMsgType("pressurePump");
model.setIsSendApp(false);
model.setTerminal("WEB");
model.setIsSendWeb(true);
model.setCategory(1);
List<String> receive = new ArrayList<>();
receive.add("system");
model.setRecivers(receive);
Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
QuartzManager.removeJob(jobName,jobGroupName,triggerName,triggerGroupName);
} catch (Exception e) {
log.error("稳压泵运行时常消息发送失败"+ e.getMessage());
}
}
}
package com.yeejoin.equipmanage.quartz;
import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;
import java.util.Map;
public class QuartzManager {
private static SchedulerFactory gSchedulerFactory = new StdSchedulerFactory();
private static String JOB_GROUP_NAME = "EQUIP_JOBGROUP_NAME";
private static String TRIGGER_GROUP_NAME = "EQUIP_TRIGGERGROUP_NAME";
/**
* @Description: 添加一个定时任务,使用默认的任务组名,触发器名,触发器组名
* @param jobName 任务名
* @param cls 任务
* @param time 时间设置,参考quartz说明文档
*/
public static void addJob(String jobName, Class cls, String time,Object scheduleJob) {
try {
Scheduler sched = gSchedulerFactory.getScheduler();
JobDetail job = JobBuilder.newJob(cls)
.withIdentity(jobName, JOB_GROUP_NAME)
.build();
// 添加具体任务方法
job.getJobDataMap().put("scheduleJob", scheduleJob);
// 表达式调度构建器
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(time);
// 按新的cronExpression表达式构建一个新的trigger
Trigger trigger = TriggerBuilder
.newTrigger()
.withIdentity(jobName, TRIGGER_GROUP_NAME)
.withSchedule(scheduleBuilder).build();
//交给scheduler去调度
sched.scheduleJob(job, trigger);
// 启动
if (!sched.isShutdown()) {
sched.start();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 添加一个定时任务
* @param jobName 任务名
* @param jobGroupName 任务组名
* @param triggerName 触发器名
* @param triggerGroupName 触发器组名
* @param jobClass 任务
* @param time 时间设置,参考quartz说明文档
*/
public static void addJob(String jobName, String jobGroupName,
String triggerName, String triggerGroupName, Class jobClass,
String time, Map<String,Object> parameter) {
try {
Scheduler sched = gSchedulerFactory.getScheduler();
JobDetail job = JobBuilder.newJob(jobClass)
.withIdentity(jobName, jobGroupName)
.build();
job.getJobDataMap().put("parameterList", parameter);
// 表达式调度构建器
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(time);
// 按新的cronExpression表达式构建一个新的trigger
Trigger trigger = TriggerBuilder
.newTrigger()
.withIdentity(triggerName, triggerGroupName)
.withSchedule(scheduleBuilder).build();
sched.scheduleJob(job, trigger);
// 启动
if (!sched.isShutdown()) {
sched.start();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 修改一个任务的触发时间(使用默认的任务组名,触发器名,触发器组名)
* @param jobName
* @param time
*/
public static void modifyJobTime(String jobName, String time) {
TriggerKey triggerKey = TriggerKey.triggerKey(
jobName, TRIGGER_GROUP_NAME);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
CronTrigger trigger =(CronTrigger) sched.getTrigger(triggerKey);
if (trigger == null) {
return;
}
String oldTime = trigger.getCronExpression();
if (!oldTime.equalsIgnoreCase(time)) {
CronScheduleBuilder scheduleBuilder =CronScheduleBuilder.cronSchedule(time);
//按新的cronExpression表达式重新构建trigger
trigger = trigger.getTriggerBuilder().withIdentity(triggerKey)
.withSchedule(scheduleBuilder).build();
//按新的trigger重新设置job执行
sched.rescheduleJob(triggerKey, trigger);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 修改一个任务的触发时间
* @param triggerName
* @param triggerGroupName
* @param time
* @author qgw
* @date 2016年1月27日 下午4:45:15 ^_^
*/
public static void modifyJobTime(String triggerName,String triggerGroupName, String time) {
TriggerKey triggerKey = TriggerKey.triggerKey(
triggerName, triggerGroupName);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
CronTrigger trigger = (CronTrigger) sched.getTrigger(triggerKey);
if (trigger == null) {
return;
}
String oldTime = trigger.getCronExpression();
if (!oldTime.equalsIgnoreCase(time)) {
// trigger已存在,则更新相应的定时设置
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder
.cronSchedule(time);
// 按新的cronExpression表达式重新构建trigger
trigger = trigger.getTriggerBuilder().withIdentity(triggerKey)
.withSchedule(scheduleBuilder).build();
// 按新的trigger重新设置job执行
sched.resumeTrigger(triggerKey);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description 移除一个任务(使用默认的任务组名,触发器名,触发器组名)
* @param jobName
* @author qgw
* @date 2016年1月29日 下午2:21:16 ^_^
*/
public static void removeJob(String jobName) {
TriggerKey triggerKey = TriggerKey.triggerKey(
jobName, TRIGGER_GROUP_NAME);
JobKey jobKey = JobKey.jobKey(jobName, JOB_GROUP_NAME);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
Trigger trigger = (Trigger) sched.getTrigger(triggerKey);
if (trigger == null) {
return;
}
sched.pauseTrigger(triggerKey);;// 停止触发器
sched.unscheduleJob(triggerKey);// 移除触发器
sched.deleteJob(jobKey);// 删除任务
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description: 移除一个任务
* @param jobName
* @param jobGroupName
* @param triggerName
* @param triggerGroupName
* @author qgw
* @date 2016年1月29日 下午2:21:16 ^_^
*/
public static void removeJob(String jobName, String jobGroupName,
String triggerName, String triggerGroupName) {
TriggerKey triggerKey = TriggerKey.triggerKey(
jobName, triggerGroupName);
JobKey jobKey = JobKey.jobKey(jobName, jobGroupName);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
sched.pauseTrigger(triggerKey);// 停止触发器
sched.unscheduleJob(triggerKey);// 移除触发器
sched.deleteJob(jobKey);// 删除任务
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description:暂停一个任务
* @param jobName
* @param jobGroupName
*/
public static void pauseJob(String jobName, String jobGroupName) {
JobKey jobKey =JobKey.jobKey(jobName, jobName);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
sched.pauseJob(jobKey);
} catch (SchedulerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* @Description:暂停一个任务(使用默认组名)
* @param jobName
*/
public static void pauseJob(String jobName) {
JobKey jobKey =JobKey.jobKey(jobName, JOB_GROUP_NAME);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
sched.pauseJob(jobKey);
} catch (SchedulerException e) {
e.printStackTrace();
}
}
/**
* @Description:启动所有定时任务
* @author qgw
* @date 2016年1月29日 下午2:21:16 ^_^
*/
public static void startJobs() {
try {
Scheduler sched = gSchedulerFactory.getScheduler();
sched.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* @Description 关闭所有定时任务
* @author qgw
* @date 2016年1月25日 下午2:26:54 ^_^
*/
public static void shutdownJobs() {
try {
Scheduler sched = gSchedulerFactory.getScheduler();
if (!sched.isShutdown()) {
sched.shutdown();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 任务是否存在
* @param jobName 任务名
* @param jobGroupName 任务组名
* @return 是否存在
*/
public static boolean checkExists(String jobName, String jobGroupName){
try {
Scheduler sched = gSchedulerFactory.getScheduler();
return sched.checkExists( new JobKey(jobName,
jobGroupName));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
......@@ -108,7 +108,7 @@ public interface IBuilldService extends IService<Building> {
* @param map form
* @return Object
*/
Object updateForm(Long instanceId, String companyCode, Map<String, Object> map);
Object updateForm(Long instanceId, String companyCode, Map<String, Object> map, String groupCode);
/**
* 获取 建筑装备树
......
......@@ -95,4 +95,8 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
Page<Map<String, Object>> fireAlarmLogPage(CommonPageInfoParam param);
List<Map<String, Object>> alarmTrend(String bizOrgCode);
Page<Map<String, Object>> pageList(CommonPageInfoParam param);
int updateReadStatus(String messageId);
}
......@@ -19,6 +19,7 @@ import com.yeejoin.equipmanage.common.entity.dto.BuildIsRiskDTO;
import com.yeejoin.equipmanage.common.entity.dto.BuildSearchDTO;
import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.enums.*;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.EnumsUtils;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.AlarmDataVO;
......@@ -45,6 +46,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.CommonUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -165,6 +167,8 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
final String ALL_BUILDING = "allBuilding";
final static String[] list = {"92031900", "92011000", "92010700"};
/**
* @param groupCode
* @Description 根据groupCode查询allowOperation对应的操作菜单
......@@ -326,6 +330,9 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}
Map<String, Object> formKeyMap = iFormInstanceService.createByMap(groupCode, companyCode, map, caseId);
if (StringUtil.isNotEmpty(caseId)) {
return CommonResponseUtil.success(formKeyMap);
}
if (formKeyMap.get(instanceId) != null) {
//2.保存图片
this.saveFiles(Long.parseLong(formKeyMap.get("instanceId").toString()), map);
......@@ -357,7 +364,13 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
@Transactional(rollbackFor = {Exception.class, BaseException.class})
public Object updateForm(Long instanceId, String orgCode, Map<String, Object> map) {
public Object updateForm(Long instanceId, String orgCode, Map<String, Object> map, String groupCode) {
if (StringUtil.isNotEmpty(groupCode)) {
map.keySet().forEach(x -> {
formInstanceMapper.updateFormFieldValue(instanceId, x, String.valueOf(map.get(x)));
});
return CommonResponseUtil.success();
}
Long id = formInstanceMapper.getStructureParentId(String.valueOf(instanceId));
//1.保存图片
this.saveFiles(instanceId, map);
......@@ -683,6 +696,15 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
@Transactional
public Boolean deleteBuilding(Long instanceId) {
List<FormInstance> lists = formInstanceMapper.selectList(new QueryWrapper<FormInstance>().eq("instance_id", instanceId));
if (0 < lists.size()) {
String groupCode = lists.get(0).getGroupCode();
if (!ValidationUtil.isEmpty(Arrays.stream(list).filter(x -> x.equals(groupCode)).collect(Collectors.toList()))) {
formInstanceMapper.delete(new QueryWrapper<FormInstance>().eq("group_code", groupCode).eq("instance_id", instanceId));
return true;
}
}
List<StockDetail> list = stockDetailMapper.selectList(new QueryWrapper<StockDetail>().eq("warehouse_structure_id", instanceId));
if (list != null && list.size() > 0) {
throw new BadRequest("该建筑存在入库装备,无法直接删除");
......
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm;
import com.yeejoin.equipmanage.common.dto.OrgUsrDto;
import com.yeejoin.equipmanage.common.entity.*;
......@@ -21,7 +22,9 @@ import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.fegin.SystemctlFeign;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -81,6 +84,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
@Autowired
private ISignalClassifyService signalClassifyService;
@Autowired
MarqueeDataMapper marqueeDataMapper;
@Autowired
private RemoteSecurityService remoteSecurityService;
@Autowired
private SystemctlFeign systemctlFeign;
@Value("${window.vedioFormat}")
String vedioFormat;
......@@ -739,4 +749,54 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
public List<Map<String, Object>> alarmTrend(String bizOrgCode) {
return this.baseMapper.alarmTrend(bizOrgCode);
}
@Override
public Page<Map<String, Object>> pageList(CommonPageInfoParam param) {
Page result = new Page<>(param.getPageNumber(), param.getPageSize());
if (AlarmTypeEnum.GZGJ.getCode().equals(param.getAlarmType())) {
param.setAlarmType("");
param.setIsFireAlarm("false");
}
Page<Map<String, Object>> resultPage = this.baseMapper.page(result, param);
if (resultPage.getTotal() > 0) {
for (Map<String, Object> x : resultPage.getRecords()) {
LocalDateTime createDate = (LocalDateTime) x.get("createDate");
x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant()));
if (ObjectUtils.isEmpty(x.get("handleType"))) {
x.put("handleType", null);
} else {
String handleType = ConfirmAlamEnum.getTypeByCode(String.valueOf(x.get("handleType")));
x.put("handleType", StringUtil.isNotEmpty(handleType) ? handleType : signalClassifyService.getTypeNameByCode(String.valueOf(x.get("handleType"))).getTypeName());
}
// 冗余统一跑马灯显示字段取值
x.put("equipmentSpecificIndexName", x.get("fireEquipmentSpecificIndexName"));
}
}
List<Map<String, Object>> list = marqueeDataMapper.selectAll();
List<Map<String, Object>> records = resultPage.getRecords();
for (Map<String, Object> stringObjectMap : list) {
records.add(stringObjectMap);
}
resultPage.setRecords(records);
return resultPage;
}
@Override
public int updateReadStatus(String messageId) {
MarqueeData marqueeData = marqueeDataMapper.selectById(messageId);
marqueeData.setIsRead(1);
int i = marqueeDataMapper.updateById(marqueeData);
MessageModel model = new MessageModel();
model.setMsgType("pressurePump");
model.setSendTime(new Date());
model.setIsSendWeb(true);
model.setCategory(1);
model.setIsSendApp(false);
model.setTerminal("WEB");
Map<String, String> ext = new HashMap<>();
ext.put("isRead", "1");
Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
return i;
}
}
......@@ -10,7 +10,9 @@ import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.fegin.SystemctlFeign;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*;
import org.apache.catalina.util.IOTools;
import org.apache.commons.lang.StringUtils;
......@@ -98,6 +100,10 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired
IEquPropertyService equPropertyService;
@Autowired
private RemoteSecurityService remoteSecurityService;
@Autowired
private SystemctlFeign systemctlFeign;
@Autowired
@Lazy
IEquipmentSpecificIndexSerivce equipmentSpecificIndexSerivce;
@Autowired
......@@ -1878,7 +1884,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipSpecificScrap.forEach(e->{
try {
int year = e.get("weExpiry") != null ? Integer.parseInt(e.get("weExpiry").toString()) : Integer.parseInt(e.get("wesExpiry").toString());
Date productDate = DateUtils.dateParse(e.get("product").toString(),DateUtils.DATE_TIME_PATTERN);
Date productDate = DateUtils.dateParse(e.get("product").toString(),"yyyy-MM-dd'T'HH:mm");
Calendar calendar = Calendar.getInstance();
calendar.setTime(productDate);
calendar.add(Calendar.YEAR, year);
......@@ -1886,7 +1892,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
Date now = new Date();
String scrapTime = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(calendar.getTime());
int i = 0;
int i = -1;
while (now.after(calendar.getTime())) {
calendar.add(Calendar.DAY_OF_MONTH,1);
i++;
......@@ -1908,7 +1914,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
model.setTitle("报废到期提醒");
String equipName = map.get("name").toString();
String location = map.get("sName").toString() + map.get("position").toString() ;
String location = map.get("sname").toString() + map.get("position").toString() ;
String body = String.format("%s-%s于%s报废,请提前更换处理", equipName, location, scrapTime);
String join = String.format("设备还剩%s天报废,请提前更换", i);
......@@ -1929,7 +1935,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
ext.put("time", new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(new Date()));
model.setExtras(ext);
model.setRecivers(receive);
Systemctl.messageClient.create(model);
// Systemctl.messageClient.create(model);
Token token = remoteSecurityService.getServerToken();
systemctlFeign.create(token.getAppKey(), token.getProduct(), token.getToke(), model);
} catch (Exception e) {
e.printStackTrace();
}
......
package com.yeejoin.amos;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
// 授权
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.headers()
.frameOptions()
.disable()
.and()
.authorizeRequests()
.regexMatchers("^(?!/actuator).*$").permitAll()
.regexMatchers("/actuator/health").permitAll()
.regexMatchers("/actuator/info").permitAll()
.anyRequest().authenticated().and()
.formLogin();
}
}
......@@ -120,4 +120,9 @@ auth-key-fire-iot-equip=fire_iot-equip_info
# app离线同步装备数据开关
auth-open-fire-equip=false
fxkgtId=1522051112935387138
\ No newline at end of file
fxkgtId=1522051112935387138
management.security.enabled=true
management.endpoint.health.show-details=always
spring.security.user.name=admin
spring.security.user.password=a1234560
\ No newline at end of file
......@@ -2371,18 +2371,18 @@
(
CASE
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) IS NULL THEN
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) IS NULL THEN
'--'
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) >= IFNULL( rp.min_water_level, 0 )
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) >= IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN
'100'
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) &lt; IFNULL( rp.min_water_level, 0 )
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) &lt; IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN
'--' ELSE IFNULL((
FORMAT(
abs(
IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ),
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),
IFNULL( rp.min_water_level, 0 )) /
IF
(
......@@ -2396,15 +2396,15 @@
)
END
) AS levelAbs,
IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
(
CASE
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) IS NULL
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) IS NULL
OR rp.min_water_level IS NULL THEN
'--'
WHEN IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ),
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),
IFNULL( rp.min_water_level, 0 )) &lt; IFNULL( rp.min_water_level, 0 ) THEN
'缺水' ELSE '正常'
END
......@@ -2493,7 +2493,7 @@
ou.`code`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
avg( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ) AS nowLevel,
avg( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ) AS nowLevel,
IFNULL( rp.volume, 0 ) AS volume,
ec.image,
r.resource_type,
......@@ -2970,7 +2970,7 @@
SELECT
ifnull( `rp`.`min_water_level`, 0 ) AS `minLevel`,
ifnull( `rp`.`max_water_level`, 0 ) AS `maxLevel`,
IFNULL(avg( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ),0) AS nowLevel
IFNULL(avg( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ),0) AS nowLevel
FROM
`cb_water_resource` `r`
LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
......@@ -3006,7 +3006,7 @@
SELECT
ifnull( `rp`.`min_water_level`, 0 ) AS `minLevel`,
ifnull( `rp`.`max_water_level`, 0 ) AS `maxLevel`,
ifnull(MAX( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ), 0) AS nowLevel
ifnull(MAX( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ), 0) AS nowLevel
FROM
`cb_water_resource` `r`
LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
......@@ -4536,18 +4536,18 @@
(
CASE
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) IS NULL THEN
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) IS NULL THEN
'--'
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) >= IFNULL( rp.min_water_level, 0 )
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) >= IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN
'100'
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) &lt; IFNULL( rp.min_water_level, 0 )
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) &lt; IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN
'--' ELSE IFNULL((
FORMAT(
abs(
IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ),
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),
IFNULL( rp.min_water_level, 0 )) /
IF
(
......@@ -4561,15 +4561,15 @@
)
END
) AS levelAbs,
IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
(
CASE
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) IS NULL
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) IS NULL
OR rp.min_water_level IS NULL THEN
'--'
WHEN IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ),
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),
IFNULL( rp.min_water_level, 0 )) &lt; IFNULL( rp.min_water_level, 0 ) THEN
'缺水' ELSE '正常'
END
......@@ -4655,7 +4655,7 @@
ou.`code`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
avg( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ) AS nowLevel,
avg( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN IFNULL( ei.`value`, 0 ) END ) AS nowLevel,
IFNULL( rp.volume, 0 ) AS volume,
ec.image,
r.resource_type,
......@@ -4808,7 +4808,7 @@
r.`name`,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`value` END ) AS nowLevel,
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) AS nowLevel,
ec.image,
r.resource_type AS type,
r.sequence_nbr AS id
......@@ -4987,4 +4987,31 @@
WHERE
fi.instance_id = #{equipSpeId}
</select>
<select id="getWaterPoolLevel" resultType="java.util.Map">
SELECT
ifnull(r.`name`, '') as name,
r.sequence_nbr AS id,
ifnull(r.resource_type, '') as resourceType,
ifnull(rp.min_water_level, 0) AS minValues,
ifnull(rp.max_water_level, 0) AS maxValues,
ifnull(rp.level_device_id, '') as levelDeviceId
FROM
cb_water_resource_pool rp
LEFT JOIN cb_water_resource r ON r.sequence_nbr = rp.resource_id
WHERE
FIND_IN_SET( #{equipSpeId}, rp.level_device_id )
ORDER BY
rp.rec_date DESC
LIMIT 1
</select>
<select id="getWaterPoolLevelByEquipSpeId" resultType="java.math.BigDecimal">
SELECT
IFNULL( max( CASE WHEN equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN `value` END ), 0 )
FROM
wl_equipment_specific_index
WHERE
equipment_specific_id = #{equipSpeId}
</select>
</mapper>
......@@ -456,6 +456,12 @@
biz_org_name= #{bizOrgName}
where id = #{id}
</update>
<update id="updateFormFieldValue">
update wl_form_instance
set
field_value = #{value}
where instance_id = #{id} AND field_name = #{name}
</update>
<update id="updateStrFullName">
update wl_warehouse_structure
set full_name=replace(full_name,#{name},#{fullName})
......
<?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.MarqueeDataMapper">
<select id="selectAll" resultType="java.util.Map">
select
id message_id,
type fireEquipmentSpecificIndexName,
position,
name equipmentSpecificName,
create_date createDate,
message_type,
is_read,
equipment_specific_id id
from
wl_marquee_data
where
is_read = '0'
</select>
</mapper>
package com.yeejoin.amos;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
// 授权
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.headers()
.frameOptions()
.disable()
.and()
.authorizeRequests()
.regexMatchers("^(?!/actuator).*$").permitAll()
.regexMatchers("/actuator/health").permitAll()
.regexMatchers("/actuator/info").permitAll()
.anyRequest().authenticated().and()
.formLogin();
}
}
......@@ -129,4 +129,8 @@ speech-config.access-key-id=LTAI5t62oH95jgbjRiNXPsho
speech-config.access-key-secret=shy9SpogYgcdDoyTB3bvP21VSRmz8n
speech-config.app-key=FC84bGUpbNFrexoL
mqtt.topic.command.car.jw=carCoordinates
\ No newline at end of file
mqtt.topic.command.car.jw=carCoordinates
management.security.enabled=true
spring.security.user.name=admin
spring.security.user.password=a1234560
\ No newline at end of file
......@@ -2257,7 +2257,7 @@
<w:sz-cs w:val="28"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:rPr>
<w:t>是否合格</w:t>
<w:t>检验结果</w:t>
</w:r>
</w:p>
</w:tc>
......@@ -2291,7 +2291,7 @@
<w:sz-cs w:val="28"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:rPr>
<w:t>标准原文</w:t>
<w:t>规范标准值</w:t>
</w:r>
</w:p>
</w:tc>
......
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