Commit 10e3eebf authored by chenhao's avatar chenhao

Merge branch 'develop_ccs' of http://172.16.10.76/moa/amos-boot-biz into develop_ccs

parents ec860e9c c02647f3
......@@ -104,6 +104,63 @@ public class TreeParser {
return resultList;
}
public static List<Menu> getTreeTeam(Long topId, @SuppressWarnings("rawtypes") Collection entityList, String packageURL, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, List<FirefightersTreeDto> list,String treeCode) throws Exception {
List<Menu> resultList = new ArrayList<>();
@SuppressWarnings("rawtypes")
Class clazz = Class.forName(packageURL);
Method IDMethodNameme = null;
switch (IDHierarchy) {
case 1:
IDMethodNameme = clazz.getDeclaredMethod(IDMethodName);
break;
case 2:
IDMethodNameme = clazz.getSuperclass().getDeclaredMethod(IDMethodName);
break;
case 3:
IDMethodNameme = clazz.getSuperclass().getSuperclass().getDeclaredMethod(IDMethodName);
break;
default:
IDMethodNameme = clazz.getDeclaredMethod(IDMethodName);
break;
}
Method NAMEMethodNameme = clazz.getDeclaredMethod(NAMEMethodName);
Method PARENTIDMethodNameme = clazz.getDeclaredMethod(PARENTIDMethodName);
//获取顶层元素集合
Long parentId;
for (Object ob : entityList) {
Object entity = clazz.cast(ob);
parentId = PARENTIDMethodNameme.invoke(entity) != null ? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity))) : null;
if (parentId == null ) {//陈浩2021-12-01修改 topId == parentId 的判断
String codeString = String.valueOf(IDMethodNameme.invoke(entity));
Integer num = 0;
if (list != null && list.size() > 0) {
for (FirefightersTreeDto map : list) {
if (null != map.getJobTitleCode() && map.getJobTitleCode().equals(codeString)) {
num = Integer.valueOf((String) map.getNum());
break;
}
}
;
}
Menu menu = new Menu(Long.valueOf(codeString), String.valueOf(NAMEMethodNameme.invoke(entity)), parentId, num);
resultList.add(menu);
}
}
//获取每个顶层元素的子数据集合
for (Menu entity : resultList) {
entity.setChildren(getSub(entity.getId(), entityList, packageURL, IDMethodName, IDHierarchy, NAMEMethodName, PARENTIDMethodName, list,treeCode));
}
return resultList;
}
/**
* 获取子数据集合
*/
......
......@@ -86,4 +86,5 @@ public class FireTeam extends BaseEntity {
@ApiModelProperty(value = "树结构层级code")
private String treeCode;
}
......@@ -377,10 +377,10 @@ FROM
SELECT
Max(
CASE
WHEN cbd.field_code = 'administrativePositionCode' THEN
WHEN cbd.field_code = 'positionType' THEN
cbd.field_value
END
) AS administrativePositionCode,
) AS positionType,
Max(
CASE
WHEN cbd.field_code = 'telephone' THEN
......@@ -412,16 +412,16 @@ FROM
biz_org_name = #{departmentName} and is_delete = 0
)
AND cou.biz_org_type = 'PERSON'
AND cou.biz_org_type = 'PERSON' and is_delete = 0
) group by cbd.instance_id
) dd
LEFT JOIN cb_org_usr cour ON dd.instance_id = cour.sequence_nbr
WHERE
<if test="positionType == null ">
dd.administrativePositionCode IS NOT NULL
dd.positionType IS NOT NULL
</if>
<if test="positionType != null">
dd.administrativePositionCode in
dd.positionType in
<foreach collection="positionType" item="item" separator="," open="(" close=")" index="">
#{item, jdbcType=NUMERIC}
</foreach>
......
......@@ -101,4 +101,12 @@ public class EquipmentSpecificIndex extends BaseEntity {
@TableField(exist = false)
private String valueEnum;
@ApiModelProperty(value = "设备CODE")
@TableField(exist = false)
private String equipmentSpecificCode;
@ApiModelProperty(value = "设备所属系统ids")
@TableField(exist = false)
private String systemId;
}
......@@ -111,6 +111,16 @@ public class CommonPageInfoParam extends CommonPageable {
private String status;
private String isRemoveShield;
public void setIsRemoveShield(String isRemoveShield) {
this.isRemoveShield = isRemoveShield;
}
public String getIsRemoveShield() {
return isRemoveShield;
}
public void setCleanStatus(String cleanStatus) {
this.cleanStatus = cleanStatus;
}
......
......@@ -59,6 +59,8 @@ public class CommonPageParamUtil {
param.setStatus(toString(queryRequests.get(i).getValue()));
} else if("cleanStatus".equals(name)){
param.setCleanStatus(toString(queryRequests.get(i).getValue()));
} else if("isRemoveShield".equals(name)){
param.setIsRemoveShield(toString(queryRequests.get(i).getValue()));
}
}
if(commonPageable !=null){
......
......@@ -9,11 +9,14 @@ import lombok.Data;
@Data
@ApiModel(description = "性能指标类")
public class SpeIndexVo {
private String key;
private String name;
private String value;
private String typeCode;
private String key = "";
private String name = "";
private String value = "";
private String typeCode = "";
private Long equipmentSpecificId;
}
......@@ -29,6 +29,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.exception.BaseException;
......@@ -65,6 +66,9 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
@Autowired
private RedisUtils redisUtils;
@Value("${fire-rescue}")
private String fireRescueId;
/**
* 获取监控大队列表
......@@ -494,16 +498,20 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
LambdaQueryWrapper<FireTeam> queryWrapper = new LambdaQueryWrapper<FireTeam>();
queryWrapper.eq(FireTeam::getTypeCode, code);
queryWrapper.eq(FireTeam::getIsDelete, false);
queryWrapper.eq(FireTeam::getCompanyName, "消防救援保障部");
// queryWrapper.eq(FireTeam::getCompanyName, "消防急救保障部");
// 消防救援保障部为保证灵活性以及防止名字变更 通过id查询 ID在配置文件中配置
queryWrapper.eq(FireTeam::getCompany,fireRescueId);
LambdaQueryWrapper<FireTeam> queryWrapper1 = new LambdaQueryWrapper<FireTeam>();
queryWrapper1.eq(FireTeam::getIsDelete, false);
queryWrapper1.eq(FireTeam::getCompanyName, "消防救援保障部");
// queryWrapper1.eq(FireTeam::getCompanyName, "消防急救保障部");
queryWrapper1.eq(FireTeam::getCompany,fireRescueId);
queryWrapper1.isNull(FireTeam::getParent);
queryWrapper1.eq(FireTeam::getTypeCode,code);
FireTeam parentFireTeam = this.baseMapper.selectOne(queryWrapper1);
if (parentFireTeam == null) {
return null;
}
return TreeParser.getTree(parentFireTeam.getSequenceNbr(), this.baseMapper.selectList(queryWrapper), FireTeam.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
return TreeParser.getTreeTeam(parentFireTeam.getSequenceNbr(), this.baseMapper.selectList(queryWrapper), FireTeam.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
null,null);
// TODO Auto-generated method stub
}
......
......@@ -49,6 +49,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource;
......@@ -2052,100 +2053,20 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} else {
result = saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
}
// }*/
// OrgUsrDto result = new OrgUsrDto();
// if (orgUsr.getSequenceNbr() != null) { // 走更新方法
// this.updateById(orgUsr);
// BeanUtils.copyProperties(orgUsr, result);
// } else {
// if(OrgPersonVo.getDynamicFormValue() == null || OrgPersonVo.getDynamicFormValue().size() == 0) {
// throw new BadRequest("人员动态表单信息未填写");
// }
// result = saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
// }
return result;
}
@Override
public void updateByIdOrgPersonFlc(OrgPersonDto OrgPersonVo, Long id) throws Exception {
// 修改人员信息
OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgPersonVo, orgUsr);
orgUsr.setSequenceNbr(id);
updateById(orgUsr);
// 保存动态表单数据
updateDynamicFormInstance(orgUsr.getSequenceNbr(), OrgPersonVo.getDynamicFormValue());
}
@Override
public JSONObject selectPersonByUserId(Long userId) throws Exception {
OrgUsr orgUsr = orgUsrMapper.queryByUserId(userId);
// 动态表单数据
List<FormValue> formValue = getFormValue(orgUsr.getSequenceNbr());
OrgPersonFormDto orgPersonFormVo = new OrgPersonFormDto(formValue);
BeanUtils.copyProperties(orgUsr, orgPersonFormVo);
OrgUsr parent = getById(orgUsr.getParentId());
if (!ObjectUtils.isEmpty(parent)) {
orgPersonFormVo.setParentName(parent.getBizOrgName());
}
List<FormValue> dynamicFormAlert = orgPersonFormVo.getDynamicFormAlert();
Map<String, String> collect = dynamicFormAlert.stream().collect(HashMap::new,
(map, item) -> map.put(item.getKey(), item.getValue()), HashMap::putAll);
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(orgPersonFormVo));
jsonObject.put("map", collect);
return jsonObject;
}
@Override
public UserDto getUserParentInfo(String userId) {
OrgUsr orgUsr = orgUsrMapper.queryByUserId(Long.parseLong(userId));
if (null != orgUsr) {
UserDto userDto = new UserDto();
String parentId = orgUsr.getParentId();
userDto.setPersonSeq(String.valueOf(orgUsr.getSequenceNbr()));
userDto.setPersonName(orgUsr.getBizOrgName());
OrgUsr bizOrg = orgUsrMapper.queryBySequenceNbr(parentId);
if (!ObjectUtils.isEmpty(bizOrg)) {
userDto.setBizOrgType(bizOrg.getBizOrgType());
userDto.setBizOrgCode(bizOrg.getBizOrgCode());
userDto.setCompanyId(String.valueOf(bizOrg.getSequenceNbr()));
userDto.setCompanyName(bizOrg.getBizOrgName());
} else {
throw new RuntimeException("人员所在公司不存在");
}
return userDto;
} else {
return new UserDto();
}
}
public Object getOrgUserByAmosUserId(String amosUserId) throws Exception {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>();
wrapper.eq(OrgUsr::getIsDelete, false);
wrapper.eq(OrgUsr::getBizOrgType, CommonConstant.BIZ_ORG_TYPE_PERSON);
wrapper.like(StringUtils.isNotBlank(amosUserId), OrgUsr::getAmosOrgId, amosUserId);
return this.baseMapper.selectList(wrapper);
}
@Override
public List<OrgUsr> getListByBizOrgTypeCode(String orgTypes, String orgCode) {
List<String> orgTypeList = new ArrayList<>();
if (StringUtils.isNotBlank(orgTypes)) {
orgTypeList = Arrays.asList(orgTypes.split(","));
}
return this.getBaseMapper().listByOrgTypes(orgTypeList, orgCode);
}
@Override
public List<OrgMenuDto> companyTreeByUserNumber(ReginParams reginParams) {
Map<String, Object> param = new HashMap<>();
// 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey);
param.put("bizOrgCode", reginParams.getPersonIdentity().getBizOrgCode());
List<OrgUsr> list = orgUsrMapper.companyDeptListWithPersonCount(param);
return buildTreeParallel(list);
}
@Override
public List<OrgMenuDto> companyTreeByUser(ReginParams reginParams) {
Map<String, Object> param = new HashMap<>();
// 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey);
List<OrgUsr> list = orgUsrMapper.companyTreeByUser(reginParams.getPersonIdentity().getBizOrgCode());
return buildTreeParallel(list);
}
/**
* 同步单位信息到防火监督point表
*
......@@ -2235,4 +2156,130 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return orgUsr1;
}
// orgUsr.setBizOrgCode(getOrgCodeStr());
//
//
//
// return result;
// }
@Override
public void updateByIdOrgPersonFlc(OrgPersonDto OrgPersonVo, Long id) throws Exception {
// 修改人员信息
OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgPersonVo, orgUsr);
orgUsr.setSequenceNbr(id);
updateById(orgUsr);
// 保存动态表单数据
updateDynamicFormInstance(orgUsr.getSequenceNbr(), OrgPersonVo.getDynamicFormValue());
}
@Override
public JSONObject selectPersonByUserId(Long userId) throws Exception {
OrgUsr orgUsr = orgUsrMapper.queryByUserId(userId);
// 动态表单数据
List<FormValue> formValue = getFormValue(orgUsr.getSequenceNbr());
OrgPersonFormDto orgPersonFormVo = new OrgPersonFormDto(formValue);
BeanUtils.copyProperties(orgUsr, orgPersonFormVo);
OrgUsr parent = getById(orgUsr.getParentId());
if (!ObjectUtils.isEmpty(parent)) {
orgPersonFormVo.setParentName(parent.getBizOrgName());
}
List<FormValue> dynamicFormAlert = orgPersonFormVo.getDynamicFormAlert();
Map<String, String> collect = dynamicFormAlert.stream().collect(HashMap::new, (map, item) -> map.put(item.getKey(), item.getValue()), HashMap::putAll);
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(orgPersonFormVo));
jsonObject.put("map", collect);
return jsonObject;
}
@Override
public UserDto getUserParentInfo(String userId) {
OrgUsr orgUsr = orgUsrMapper.queryByUserId(Long.parseLong(userId));
if (null != orgUsr) {
UserDto userDto = new UserDto();
String parentId = orgUsr.getParentId();
userDto.setPersonSeq(String.valueOf(orgUsr.getSequenceNbr()));
userDto.setPersonName(orgUsr.getBizOrgName());
OrgUsr bizOrg = orgUsrMapper.queryBySequenceNbr(parentId);
if (!ObjectUtils.isEmpty(bizOrg)) {
userDto.setBizOrgType(bizOrg.getBizOrgType());
userDto.setBizOrgCode(bizOrg.getBizOrgCode());
userDto.setCompanyId(String.valueOf(bizOrg.getSequenceNbr()));
userDto.setCompanyName(bizOrg.getBizOrgName());
} else {
throw new RuntimeException("人员所在公司不存在");
}
return userDto;
} else {
return new UserDto();
}
}
public Object getOrgUserByAmosUserId(String amosUserId) throws Exception {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>();
wrapper.eq(OrgUsr::getIsDelete, false);
wrapper.eq(OrgUsr::getBizOrgType, CommonConstant.BIZ_ORG_TYPE_PERSON);
wrapper.like(StringUtils.isNotBlank(amosUserId), OrgUsr::getAmosOrgId, amosUserId);
return this.baseMapper.selectList(wrapper);
}
@Override
public List<OrgUsr> getListByBizOrgTypeCode(String orgTypes, String orgCode) {
List<String> orgTypeList = new ArrayList<>();
if (StringUtils.isNotBlank(orgTypes)) {
orgTypeList = Arrays.asList(orgTypes.split(","));
}
return this.getBaseMapper().listByOrgTypes(orgTypeList, orgCode);
}
@Override
public List<OrgMenuDto> companyTreeByUserNumber(ReginParams reginParams) {
Map<String, Object> param = new HashMap<>();
// 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey);
param.put("bizOrgCode", reginParams.getPersonIdentity().getBizOrgCode());
List<OrgUsr> list = orgUsrMapper.companyDeptListWithPersonCount(param);
return buildTreeParallel(list);
}
@Override
public List<OrgMenuDto> companyTreeByUser(ReginParams reginParams) {
Map<String, Object> param = new HashMap<>();
// 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey);
List<OrgUsr> list = orgUsrMapper.companyTreeByUser(reginParams.getPersonIdentity().getBizOrgCode());
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();
// }
}
\ No newline at end of file
......@@ -96,6 +96,7 @@ public class EquipmentAlarmController extends AbstractBaseController {
@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);
......@@ -148,7 +149,11 @@ public class EquipmentAlarmController extends AbstractBaseController {
CommonRequest request11 = new CommonRequest();
request11.setName("cleanStatus");
request11.setValue(StringUtil.isNotEmpty(cleanStatus) ? StringUtils.trimToNull(cleanStatus) : null);
queryRequests.add(request11);
queryRequests.add(request1);
CommonRequest request12 = new CommonRequest();
request12.setName("isRemoveShield");
request12.setValue(StringUtil.isNotEmpty(isRemoveShield) ? StringUtils.trimToNull(isRemoveShield) : null);
queryRequests.add(request12);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<Map<String, Object>> list = iEquipmentSpecificAlarmService.listPage(param);
return CommonResponseUtil.success(list);
......@@ -209,7 +214,7 @@ public class EquipmentAlarmController extends AbstractBaseController {
@RequestParam(value = "alarmType", required = false) String alarmType,
@RequestParam(value = "systemCode", required = false) String systemCode,
@RequestParam(value = "buildId", required = false) String buildId,
// @RequestParam(value = "equipmentCode", required = false) String equipmentCode,
@RequestParam(value = "isRemoveShield", required = false) String isRemoveShield,
@RequestParam(value = "id", required = false) String id,
@RequestParam(value = "cleanStatus", required = false) String cleanStatus,
CommonPageable commonPageable) {
......@@ -255,6 +260,10 @@ public class EquipmentAlarmController extends AbstractBaseController {
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);
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
org.springframework.data.domain.Page<AlarmListDataVO> list = iEquipmentSpecificAlarmService.listAlarmsPage(param);
return CommonResponseUtil.success(list);
......
......@@ -547,7 +547,19 @@ public class FireFightingSystemController extends AbstractBaseController {
/**
* 设备报警信息
* 获取点位图,区域树数据
*/
//重复接口及地址 影响项目启动 若后续有问题需要使用 更改接口地址
/*@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取点位图,区域树数据", notes = "消防系统点位图使用")
@GetMapping(value = "/point/tree")
public List<PointTreeVo> getPointTree(@RequestParam(required = false) String systemId) {
return fireFightingSystemService.getPointTree(systemId, getOrgCode());
}
*/
/**
* 设备指标数据查询
*
* @param id
* @return
......
......@@ -341,7 +341,7 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
equipmentApp.setEquipmentBase(equipmentBaseApp);
//技术文档
QueryWrapper<UploadFile> excelQueryWrapper = new QueryWrapper<>();
excelQueryWrapper.eq("object_id", equipmentBaseApp.getEquipId());
excelQueryWrapper.eq("object_id", equipmentBaseApp.getEquipDetailId());
excelQueryWrapper.eq("file_type", "instruction");
List<UploadFile> uploadFiles1 = uploadFileMapper.selectList(excelQueryWrapper);
for (UploadFile s : uploadFiles1) {
......
package com.yeejoin.equipmanage.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
//import net.sf.json.JSONObject;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipment;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFaultAlarm;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm;
import com.yeejoin.equipmanage.common.dto.TemperatureAlarmDto;
import com.yeejoin.equipmanage.common.entity.CarProperty;
import com.yeejoin.equipmanage.common.entity.EquipmentAlarmReportDay;
import com.yeejoin.equipmanage.common.entity.EquipmentDetail;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.publics.BaseEntity;
import com.yeejoin.equipmanage.common.entity.vo.CarIndexVo;
import com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentStateVo;
import com.yeejoin.equipmanage.common.entity.vo.IndexStateVo;
import com.yeejoin.equipmanage.common.enums.AlarmStatusEnum;
import com.yeejoin.equipmanage.common.enums.AlarmTypeEnum;
import com.yeejoin.equipmanage.common.enums.CarForGisEnum;
import com.yeejoin.equipmanage.common.enums.EquipAndCarEnum;
import com.yeejoin.equipmanage.common.enums.EquipmentIndexLabelsEnum;
import com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum;
import com.yeejoin.equipmanage.common.enums.NBalarmEnum;
import com.yeejoin.equipmanage.common.enums.RiskLeverForAutoSys;
import com.yeejoin.equipmanage.common.enums.TemperatureAlarm;
import com.yeejoin.equipmanage.common.enums.TopicEnum;
import com.yeejoin.equipmanage.common.enums.TrueOrFalseEnum;
import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.enums.*;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.EquipmentStateUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.CarIndexGisVo;
import com.yeejoin.equipmanage.common.vo.EquipmentIndexLabelsVo;
import com.yeejoin.equipmanage.common.vo.EquipmentVo;
import com.yeejoin.equipmanage.common.vo.IotDataVO;
import com.yeejoin.equipmanage.common.vo.Token;
import com.yeejoin.equipmanage.common.vo.TopicEntityVo;
import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.fegin.SystemctlFeign;
import com.yeejoin.equipmanage.mapper.CarMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificIndexMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.ICarPropertyService;
import com.yeejoin.equipmanage.service.IEquipmentAlarmReportDayService;
import com.yeejoin.equipmanage.service.IEquipmentDetailService;
import com.yeejoin.equipmanage.service.IEquipmentIndexService;
import com.yeejoin.equipmanage.service.IEquipmentService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmLogService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import com.yeejoin.equipmanage.service.IMainIotMonitorSerivce;
import com.yeejoin.equipmanage.service.ISyncDataService;
import com.yeejoin.equipmanage.service.MqttReceiveService;
import com.yeejoin.equipmanage.service.MqttSendGateway;
import com.yeejoin.equipmanage.service.*;
import com.yeejoin.equipmanage.utils.BeanUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
//import net.sf.json.JSONObject;
/**
* @author keyong
......@@ -209,8 +154,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${isSendApp}")
private Boolean isSendApp;
private static final String A = "A";
private final static Map staticMap = new HashMap();
private static Boolean bool = Boolean.FALSE;
......@@ -447,7 +390,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentSpecificAlarmService.saveOrUpdate(action);
if (AlarmStatusEnum.BJ.getCode() == action.getStatus()) {
equipmentAlarmLogs.add(addEquipAlarmLogRecord(action));
if (ValidationUtil.isEmpty(action.getAlamContent())){
if (ValidationUtil.isEmpty(action.getAlamContent())) {
action.setAlamContent(action.getEquipmentSpecificName() + action.getEquipmentSpecificIndexName());
}
mqttSendGateway.sendToMqtt(TopicEnum.EQDQR.getTopic(), JSONArray.toJSON(action).toString());
......@@ -759,7 +702,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
x.setCleanTime(new Date());
x.setStatus(AlarmStatusEnum.HF.getCode());
});
if(!logs.isEmpty()){
if (!logs.isEmpty()) {
equipmentSpecificAlarmLogService.updateBatchById(logs);
}
}
......@@ -779,7 +722,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
DateUtils.date2LongStr(equipmentSpecificAlarmLog.getCreateDate()));
model.setBody(body);
model.setMsgType("iotMonitor");
if (isSendApp){
if (isSendApp) {
model.setIsSendApp(true);
model.setTerminal("APP/WEB");
} else {
......@@ -803,7 +746,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
EquipmentSpecificIndex equipmentSpecificIndex = handleTemperatureAlarm(equipmentSpcIndex, iotDatalist);
List<EquipmentSpecificAlarm> equipmentSpecificAlarms = new ArrayList<>();
EquipmentSpecificAlarm equipmentSpecificAlarm = new EquipmentSpecificAlarm();
equipmentSpecificAlarm.setSystemIds(equipmentSpcIndex.getSystemId());
equipmentSpecificAlarm.setSystemCodes(this.getSystemCodeBySpeId(equipmentSpcIndex.getSystemId()));
if (EquipmentRiskTypeEnum.GZ.getCode().equals(equipmentSpecificIndex.getTypeCode()) || EquipmentRiskTypeEnum.HZGJ.getCode().equals(equipmentSpecificIndex.getTypeCode())
|| EquipmentRiskTypeEnum.PB.getCode().equals(equipmentSpecificIndex.getTypeCode())) {
List<EquipmentSpecificAlarm> indexAlarms = equipmentSpecificAlarmMapper.findEquipmentSpecificAlarmByEquipmentSpecificIdAndEquipmentIndexIdAndStatusIstrue(equipmentSpecificIndex.getEquipmentSpecificId(), equipmentSpecificIndex.getEquipmentIndexId());
......@@ -811,7 +755,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if (verifyNB(equipmentSpecificIndex.getNameKey())) {
return getNbEquipAlarmList(indexAlarms, equipmentSpecificIndex, equipmentSpecificAlarm);
}
// 报警表新增信息
if (ObjectUtils.isEmpty(indexAlarms) && (TrueOrFalseEnum.real.value.equals(equipmentSpecificIndex.getValue()))) {
addEquipmentSpecificAlarm(equipmentSpecificAlarms, equipmentSpecificIndex, equipmentSpecificAlarm);
......@@ -828,6 +771,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
action.setStatus(AlarmStatusEnum.HF.getCode());
}
action.setUpdateDate(new Date());
// 更新所在系统,设备可能编辑过
action.setSystemIds(equipmentSpcIndex.getSystemId());
action.setSystemCodes(this.getSystemCodeBySpeId(equipmentSpcIndex.getSystemId()));
equipmentSpecificAlarms.add(action);
});
}
......@@ -836,27 +782,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
return equipmentSpecificAlarms;
}
public String getSystemCodeBySpeId(EquipmentSpecific equipmentSpecific) {
List<FireFightingSystemEntity> sys = new ArrayList<>();
String[] ids;
String sysIds = equipmentSpecific.getSystemId();
private String getSystemCodeBySpeId(String sysIds) {
if (StringUtil.isNotEmpty(sysIds)) {
if (-1 != sysIds.indexOf(",")) {
ids = sysIds.split(",");
sys = fireFightingSystemMapper.getFightingSysByIds(ids);
List<FireFightingSystemEntity> sys = fireFightingSystemMapper.getFightingSysByIds(sysIds.split(","));
return sys.stream().map(FireFightingSystemEntity::getCode).collect(Collectors.joining(","));
} else {
FireFightingSystemEntity entity = fireFightingSystemMapper.selectById(Long.valueOf(sysIds));
sys.add(entity);
}
return null;
}
StringBuilder sb = new StringBuilder();
sys.forEach(x -> {
if (0 < sb.length()) {
sb.append(",");
}
sb.append(x.getCode());
});
return sb.toString();
}
private EquipmentAlarmReportDay addEquipAlarmReportRecord(EquipmentSpecificIndex equipmentSpecificIndex) {
......@@ -943,23 +875,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} else if (EquipmentRiskTypeEnum.PB.getCode().equals(equipmentSpecificIndex.getTypeCode())) {
equipmentSpecificAlarm.setType(EquipmentRiskTypeEnum.PB.getCode());
}
equipmentSpecificAlarm.setCreateDate(new Date());
equipmentSpecificAlarm.setUpdateDate(new Date());
QueryWrapper<EquipmentSpecific> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id", equipmentSpecificIndex.getEquipmentSpecificId());
EquipmentSpecific specific = equipmentSpecificMapper.selectOne(queryWrapper);
equipmentSpecificAlarm.setSystemIds(specific.getSystemId());
if (!ValidationUtil.isEmpty(specific.getSystemId())) {
String codes = this.getSystemCodeBySpeId(specific);
equipmentSpecificAlarm.setSystemCodes(codes);
}
equipmentSpecificAlarm.setEquipmentCode(equipmentSpecificIndex.getEquipmentCode());
equipmentSpecificAlarm.setEquipmentId(equipmentSpecificIndex.getEquipmentId());
equipmentSpecificAlarm.setEquipmentDetailId(equipmentSpecificIndex.getEquipmentDetailId());
equipmentSpecificAlarm.setCode(specific.getCode());
equipmentSpecificAlarm.setCode(equipmentSpecificIndex.getEquipmentSpecificCode());
equipmentSpecificAlarms.add(equipmentSpecificAlarm);
return equipmentSpecificAlarms;
}
......@@ -968,7 +890,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
List<EquipmentSpecificAlarm> equipmentSpecificAlarmList = new ArrayList<>();
if (ValidationUtil.isEmpty(indexAlarms)) { // 告警表为空,新增告警数据
addEquipmentSpecificAlarm(equipmentSpecificAlarmList, equipmentSpecificIndex, equipmentSpecificAlarm);
if (!checkStateIsNormal(equipmentSpecificAlarm, equipmentSpecificIndex)){
if (!checkStateIsNormal(equipmentSpecificAlarm, equipmentSpecificIndex)) {
return equipmentSpecificAlarmList;
} else {
equipmentSpecificAlarmList.clear();
......@@ -988,6 +910,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} else {
action.setFrequency((action.getFrequency() + 1));
}
// 更新所在系统,设备可能编辑过
action.setSystemIds(equipmentSpecificIndex.getSystemId());
action.setSystemCodes(this.getSystemCodeBySpeId(equipmentSpecificIndex.getSystemId()));
action.setUpdateDate(new Date());
equipmentSpecificAlarmList.add(action);
});
......
......@@ -541,7 +541,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams.put("callTimeStr", calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress());
smsParams.put("fireLocation", calledRo.getFireLocation());
smsParams.put("endTimeStr", DateUtils.convertDateToString(alertCalled.getUpdateTime(),DateUtils.DATE_TIME_PATTERN));
smsParams.put("endTimeStr", alertCalled.getUpdateTime() != null ? DateUtils.convertDateToString(alertCalled.getUpdateTime(),DateUtils.DATE_TIME_PATTERN) : "");
smsParams.put("burningMaterial", calledRo.getBurningMaterial());
smsParams.put("fireSituation", calledRo.getFireSituation());
smsParams.put("trappedNum", calledRo.getTrappedNum());
......@@ -1442,8 +1442,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String [] groupCode = jsonObject1.getString("fireBrigade").split(",");
List<String> positionType= Arrays.asList(groupCode);
if (jsonObject1.containsKey("fireBrigade")) { {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(fireTeam.getCompanyName(),positionType);
LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<OrgUsr>();
queryWrapper.eq(OrgUsr::getBizOrgCode, fireTeam.getBizOrgCode());
OrgUsr one = orgUsrService.getOne(queryWrapper);
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(one.getBizOrgName(),positionType);
sendUserIds.addAll(mapList);
}
if(jsonObject1.containsKey("onDuty")) {
......
......@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonDto;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitPersonInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
......@@ -90,11 +91,15 @@ public class UnitPersonController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增人员信息", notes = "新增人员信息")
public ResponseModel<?> saveOrgUsr(@RequestBody UnitPersonInfoDto unitPersonInfoDto) {
public ResponseModel saveOrgUsr(@RequestBody UnitPersonInfoDto unitPersonInfoDto) {
if (ValidationUtil.isEmpty(unitPersonInfoDto.getParentId())) {
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse( iUnitPersonService.saveUser(unitPersonInfoDto));
try {
return CommonResponseUtil.success( iUnitPersonService.saveUser(unitPersonInfoDto));
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
}
/**
......
package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
......@@ -18,13 +16,10 @@ import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.PersonEducationDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.PersonQualityDto;
......@@ -41,7 +36,6 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -213,7 +207,7 @@ public class UnitPersonServiceImpl implements IUnitPersonService {
BeanUtils.copyProperties(result,unitPersonInfoDto);
}
} catch (Exception e) {
e.printStackTrace();
throw new BadRequest(e.getMessage());
}
return unitPersonInfoDto;
}
......
......@@ -1181,7 +1181,7 @@ FROM
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
WHERE wesi.equipment_index_key = 'CAFS_FoamAirCompressor_Fault'
AND wesi.`value` = 'true'
AND wes.equipment_code = '92030500MG644'
AND wes.equipment_code = '92030700SFT44'
) AS kqysjgz,
(
SELECT
......@@ -4218,63 +4218,36 @@ ORDER BY
DROP VIEW IF EXISTS `v_fire_equip_realtime_status`;
CREATE ALGORITHM = UNDEFINED DEFINER = `root`@`%` SQL SECURITY DEFINER VIEW `v_fire_equip_realtime_status` AS
SELECT
temp.*,
fs.`name` as 'fsname',
fs.`code` as 'fscode',
(SELECT
IFNULL(SUM(frequency), 0)
FROM
wl_equipment_alarm_report_day
WHERE
equipment_specific_id = temp.equipment_specific_id
AND report_date = CURRENT_DATE) as 'total'
FROM
(
SELECT
a.equipment_specific_name AS 'equipName',
(
CASE a.`value`
`wes`.`name` AS `equipName`,(
CASE
`wes`.`realtime_iot_index_value`
WHEN 'true' THEN
concat(
a.equipment_index_name,
'(是)'
)
concat( `wes`.`realtime_iot_index_name`, '(是)' )
WHEN 'false' THEN
concat(
a.equipment_index_name,
'(否)'
)
concat( `wes`.`realtime_iot_index_name`, '(否)' ) ELSE concat( `wes`.`realtime_iot_index_name`, '(', `wes`.`realtime_iot_index_value`, ')' )
END
) AS `nowStatus`,
a.equipment_specific_id,
a.update_date
`wes`.`realtime_iot_index_update_date` AS `update_date`,(
SELECT
group_concat( `fs`.`code` SEPARATOR ',' )
FROM
wl_equipment_specific_index a,
`f_fire_fighting_system` `fs`
WHERE
(
0 <> find_in_set( `fs`.`id`, `wes`.`system_id` ))) AS `fscode`,(
SELECT
equipment_specific_id,
MAX(update_date) AS update_date
group_concat( `fs`.`name` SEPARATOR ',' )
FROM
wl_equipment_specific_index
GROUP BY
equipment_specific_id
) b
`f_fire_fighting_system` `fs`
WHERE
a.`value` IS NOT NULL
AND a.equipment_specific_id = b.equipment_specific_id
AND a.update_date = b.update_date
GROUP BY
a.equipment_specific_id
ORDER BY
a.update_date DESC
) temp,
wl_equipment_specific es
LEFT JOIN `f_fire_fighting_system` `fs` ON (
find_in_set(`fs`.`id`, es.system_id)
)
WHERE
temp.equipment_specific_id = es.id
ORDER BY temp.update_date DESC;
(
0 <> find_in_set( `fs`.`id`, `wes`.`system_id` ))) AS `fsname`
FROM
`wl_equipment_specific` `wes`
WHERE
( `wes`.`realtime_iot_es_index_id` IS NOT NULL )
ORDER BY
`wes`.`realtime_iot_index_update_date` DESC
-- 系统信息视图
......
......@@ -109,11 +109,12 @@
<select id="getEquipmentAppMessage" resultMap="EquipmentAppMessage">
SELECT DISTINCT
/*bug 4678 设备详情装备编码错误显示为装备定义的编码 修改原有代码 wled.code as equip_code 为wleq.code as equip_code*/
wle.id as equip_id,
wleq.id as equipmentSpecificId,
wleq.equipment_detail_id,
wled.name as equip_name,
wled.code as equip_code,
wleq.code as equip_code,
wled.expiry_date,
wled.standard,
wlsd.name AS country,
......
......@@ -248,6 +248,9 @@
<if test="param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 2">AND
d.cleanStatus = '未消除'
</if>
<if test="param.isRemoveShield != null and param.isRemoveShield != ''">AND
d.type != 'SHIELD'
</if>
</where>
ORDER BY d.createDate DESC
</select>
......@@ -389,8 +392,10 @@
<if test="param.cleanStatus != null and param.cleanStatus != '' and param.cleanStatus == 2">AND
d.cleanStatus = '未消除'
</if>
<if test="param.isRemoveShield != null and param.isRemoveShield != ''">AND
d.type != 'SHIELD'
</if>
</where>
ORDER BY d.createDate DESC
</select>
<select id="getAlarmList" resultType="java.util.HashMap">
......
......@@ -55,7 +55,9 @@
wesi.update_date AS updateDate,
ed.code AS equipmentCode,
ed.equipment_id AS equipmentId,
ed.id AS equipmentDetailId
ed.id AS equipmentDetailId,
wes.code as equipmentSpecificCode,
wes.system_id as systemId
FROM
wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
......
......@@ -334,21 +334,53 @@
p_point p
</select>
<select id="getSpeIndex" resultType="com.yeejoin.equipmanage.common.vo.SpeIndexVo">
select * from (
select
eqin.name_key as `key`,
eqin.name as name,
SELECT
*
FROM
(
SELECT
eqin.name_key AS `key`,
eqin.`name` AS `name`,
eqin.type_code,
spein.update_date as updateDate,
if (eqin.unit is null, spein.value,concat(spein.value,eqin.unit)) as value
from
wl_equipment_specific_index as spein
left join wl_equipment_index as eqin on spein.equipment_index_id = eqin.id
where
spein.update_date AS updateDate,
spein.equipment_specific_id as equipmentSpecificId,
IF (
eqin.unit IS NULL,
IF (
(
ISNULL(spein.value_label)
OR spein.value_label = ''
),
spein.`value`,
spein.value_label
),
concat(
IF (
(
ISNULL(spein.value_label)
OR spein.value_label = ''
),
spein.`value`,
spein.value_label
),
' ',
eqin.unit
)
) AS `value`
FROM
wl_equipment_specific_index AS spein
LEFT JOIN wl_equipment_index AS eqin ON spein.equipment_index_id = eqin.id
WHERE
spein.equipment_specific_id = #{id}
order by eqin.sort_num) as dat
where `key` is not null and `key` != ''
ORDER BY dat.updateDate DESC
ORDER BY
eqin.sort_num
) AS dat
WHERE
`key` IS NOT NULL
AND `key` != ''
ORDER BY
dat.updateDate DESC
</select>
<select id="getSpeIndexIn" resultType="com.yeejoin.equipmanage.common.vo.SpeIndexVo">
select * from (
......
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