Commit 66a1a530 authored by lisong's avatar lisong

Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6

parents cf02e7ac 7cd9874a
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import org.apache.ibatis.annotations.Param;
......@@ -124,4 +125,12 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> selectPersonListByCompanyIdList(@Param("companyIdList") List<String> companyIdList);
Map<String,String> getManagePerson(@Param("name")String name ,@Param("ids")List<Long> ids);
/**
* 检查身份证号码是否存在
* @param certificatesNumber
* @param orgUserId
* @return
*/
List<DynamicFormInstance> checkCertificatesNumber(String certificatesNumber, Long orgUserId);
}
......@@ -111,7 +111,7 @@
IFNULL(b.employee_hierarchy, '无')
employeeHierarchy,
IFNULL(b.areas_expertise, '无') areasExpertise,
IFNULL(a.gender, '无') gender,
IFNULL((SELECT NAME FROM cb_data_dictionary WHERE CODE = a.gender AND type = 'XB'), a.gender) gender,
IFNULL(b.post_qualification, '无')
postQualification, year ( from_days( datediff( now( ),
a.birthday_time))) age
......@@ -255,7 +255,7 @@ SELECT
)
AND cf.is_delete = FALSE
<if test="jobCode != null">
AND cf.job_title_code = #{jobCode}
AND find_in_set(#{jobCode},cf.job_title_code) > 0
</if>
) cff
......
......@@ -42,7 +42,7 @@
max(case v.field_code when 'administrativePositionCode' then IFNULL(v.field_value_label,v.field_value) end) administrativePositionCode,
max(case v.field_code when 'internalPositionCode' then IFNULL(v.field_value_label,v.field_value) end) internalPositionCode,
max(case v.field_code when 'fireManagementPostCode' then IFNULL(v.field_value_label,v.field_value) end) fireManagementPostCode,
max(case v.field_code when 'positionType' then IFNULL(v.field_value_label,v.field_value) end) positionType,
max(case v.field_code when 'positionType' then IFNULL(v.field_value,v.field_value_label) end) positionType,
max(case v.field_code when 'certificateType' then IFNULL(v.field_value_label,v.field_value) end) certificateType,
max(case v.field_code when 'holdingTime' then IFNULL(v.field_value_label,v.field_value) end) holdingTime,
max(case v.field_code when 'auditCycle' then IFNULL(v.field_value_label,v.field_value) end) auditCycle,
......@@ -701,10 +701,10 @@ GROUP BY
FROM cb_dynamic_form_instance GROUP BY instance_id) b
on b.instance_id=a.sequence_nbr
LEFT JOIN cb_firefighters_contacts fc ON a.sequence_nbr = fc.org_usr_id
LEFT JOIN cb_firefighters_workexperience fw ON a.sequence_nbr = fw.org_usr_id
LEFT JOIN cb_firefighters_education fe ON a.sequence_nbr = fe.org_usr_id
LEFT JOIN cb_firefighters_post fp ON a.sequence_nbr = fp.org_usr_id
LEFT JOIN cb_firefighters_contacts fc ON CAST(a.sequence_nbr as char) = fc.org_usr_id
LEFT JOIN cb_firefighters_workexperience fw ON CAST(a.sequence_nbr as char) = fw.org_usr_id
LEFT JOIN cb_firefighters_education fe ON CAST(a.sequence_nbr as char) = fe.org_usr_id
LEFT JOIN cb_firefighters_post fp ON CAST(a.sequence_nbr as char) = fp.org_usr_id
where a.biz_org_name is not null and a.is_delete = 0 and a.biz_org_type = 'PERSON'
<if test="parentId != null and parentId != '' and parentId != '-1'">
......@@ -1037,4 +1037,17 @@ LEFT JOIN (
#{item}
</foreach>;
</select>
<select id="checkCertificatesNumber" resultType="com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance">
SELECT
*
FROM
cb_dynamic_form_instance cdf
LEFT JOIN cb_org_usr cou ON cdf.instance_id = cou.sequence_nbr
WHERE
cdf.field_code = 'certificatesNumber' AND cdf.field_value = #{certificatesNumber}
<if test="orgUserId != null">
AND cdf.instance_id <![CDATA[<>]]> #{orgUserId}
</if>
AND cou.is_delete = 0
</select>
</mapper>
......@@ -146,4 +146,8 @@ public class EquipmentSpecificIndex extends BaseEntity {
@TableField(exist = false)
private String buildId;
@ApiModelProperty(value = "是否遥测")
@TableField(exist = false)
private Integer isTrend;
}
package com.yeejoin.equipmanage.common.entity.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.Date;
/**
* 物联指标日志实体
* @author xxz
*/
@Data
@ApiModel(description = "物联指标日志实体")
public class IotIndexInfoVo {
/**
* 指标类型
*/
private String type;
/**
* 上报内容
*/
private String content;
/**
* 日志编号
*/
private String number;
/**
* 上报时间
*/
private String sendTime;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class IotIndexItemVo {
private String id;
private String key;
private String name;
private String color;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class IotIndexResItemVo {
private String key;
private String name;
private int[] data;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class IotIndexResMinotFinalVo {
private Long id;
private String[] name;
private String[] nameKey;
private String unit;
private List<String> times;
private List<IotIndexItemVo> items;
private List<IotIndexResItemVo> iotData;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class IotIndexResMinotVo {
private Long id;
private String name;
private String nameKey;
private String unit;
private List<String> times;
private List<IotDataVO> iotData;
}
......@@ -168,6 +168,9 @@ public class WaterResourceController extends BaseController {
if (model.getAttachments() != null) {
sourceFileService.saveAttachments(model.getSequenceNbr(), model.getAttachments());
}
if (model.getSequenceNbr() != null) {
model.setResourceId(model.getSequenceNbr());
}
return ResponseHelper.buildResponse(model);
}
......
......@@ -3084,12 +3084,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 获取联系人
QueryWrapper<FirefightersContacts> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("org_usr_id", id);
queryWrapper1.eq("org_usr_id", String.valueOf(id));
FirefightersContacts firefightersContacts = ifirefightersContactsService.getOne(queryWrapper1);
// 获取岗位标签
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_usr_id", id);
queryWrapper.eq("org_usr_id", String.valueOf(id));
FirefightersDataDto firefightersDataDto = new FirefightersDataDto(
ifirefightersWorkexperienceService.getOne(queryWrapper),
ifirefightersEducationService.getOne(queryWrapper), iFirefightersPostService.getOne(queryWrapper));
......@@ -3221,11 +3220,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public boolean checkCertificatesNumber(String certificatesNumber, Long orgUserId) {
LambdaQueryWrapper<DynamicFormInstance> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DynamicFormInstance::getFieldCode, "certificatesNumber");
queryWrapper.eq(DynamicFormInstance::getFieldValue, certificatesNumber);
queryWrapper.ne(orgUserId !=null, DynamicFormInstance::getInstanceId, orgUserId);
List<DynamicFormInstance> list = dynamicFormInstanceService.list(queryWrapper);
List<DynamicFormInstance> list = orgUsrMapper.checkCertificatesNumber(certificatesNumber, orgUserId);
return !list.isEmpty();
}
......
......@@ -38,8 +38,9 @@ public class PersonIdentifyAspect {
@Autowired
private JcsFeign jcsFeignClient;
@Pointcut("execution(public * com.yeejoin.amos.*.business.controller..*(..))")
// package com.yeejoin.equipmanage.controller;
// com.yeejoin.amos.boot.biz.common.controller.BaseController
@Pointcut("execution(public * com.*.equipmanage.controller..*(..))")
public void userDate() {
}
......@@ -49,7 +50,7 @@ public class PersonIdentifyAspect {
public void personIdentity(JoinPoint joinPoint) {
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (reginParam != null) {
if (reginParam.getPersonIdentity() == null) {
if (reginParam.getPersonIdentity() == null || reginParam.getPersonIdentity().getBizOrgCode() == null) {
String userId = reginParam.getUserModel().getUserId();
if (userId != null) {
FeignClientResult responseModel = jcsFeignClient.selectById(userId);
......
......@@ -3,8 +3,10 @@ package com.yeejoin.equipmanage.controller;
import java.util.*;
import java.util.stream.Collectors;
import com.yeejoin.equipmanage.common.constant.Constant;
import com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO;
import com.yeejoin.equipmanage.common.utils.SpringUtils;
import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.fegin.IotFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -31,7 +33,6 @@ import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.dto.SourceNameListDTO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo;
import com.yeejoin.equipmanage.common.vo.VideoOnEquipmentSpecificVo;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
......@@ -66,6 +67,8 @@ import java.util.stream.Collectors;
@RequestMapping(value = "/equipSpecific")
public class EquipmentSpecificController extends AbstractBaseController {
public static final int RESULT_SUCCESS_CODE = 200;
@Autowired
IEquipmentSpecificSerivce equipmentSpecificSerivce;
......@@ -81,6 +84,9 @@ public class EquipmentSpecificController extends AbstractBaseController {
@Autowired
FireFightingSystemServiceImpl fireFightingSystemServiceImpl;
@Autowired
IotFeign iotFeign;
/**
* 补码页面分页
*
......@@ -355,4 +361,41 @@ public class EquipmentSpecificController extends AbstractBaseController {
return equipmentSpecificSerivce.getListByEquipmentCode(code);
}
@RequestMapping(value = "/equipment/iotIndexInfo/{equipSpeId}", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据装备id获取物联日志", notes = "根据装备id获取物联日志")
public ResponseModel getEquipmentIotIndexInfo(@PathVariable String equipSpeId, @RequestParam String beginDate, @RequestParam String endDate,
@RequestParam(required = false) Integer isTrend, @RequestParam(required = false) String fieldKey) {
// 1.根据 equipSpeId 查询装备iotCode
EquipmentSpecific equipmentSpecific = equipmentSpecificMapper.selectById(equipSpeId);
if (ObjectUtils.isEmpty(equipmentSpecific)) {
return CommonResponseUtil.failure("未查询到装备信息!");
}
String iotCode = equipmentSpecific.getIotCode();
String prefix = null;
String suffix = null;
if (StringUtil.isNotEmpty(iotCode) && iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
return CommonResponseUtil.failure("装备物联编码错误,请确认!");
}
ResponseModel entity = null;
try {
entity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), beginDate, endDate, prefix, suffix, null);
} catch (Exception e) {
e.printStackTrace();
log.error("调用iot服务出错");
return CommonResponseUtil.failure("请求失败");
}
if (RESULT_SUCCESS_CODE != entity.getStatus() && ObjectUtils.isEmpty(entity.getResult())) {
log.error("查询物联日志数据为空或iotCode为 (" + iotCode + ") 的装备不存在于物联系统中!");
return CommonResponseUtil.failure("物联日志数据为空");
}
return CommonResponseUtil.success(equipmentSpecificSerivce.getIndexInfoList(iotCode, entity, isTrend, fieldKey));
}
}
......@@ -22,6 +22,7 @@ public interface IotFeign {
@RequestParam(value = "timeStart") String beginDate,
@RequestParam(value = "timeEnd") String endDate,
@RequestParam(value = "productKey") String productKey,
@RequestParam(value = "deviceName") String deviceName);
@RequestParam(value = "deviceName") String deviceName,
@RequestParam(required = false, value = "fieldKey") String fieldKey);
}
......@@ -133,7 +133,7 @@ public interface JcsFeign {
* @return ResponseModel<OrgUsrDto>
*/
@GetMapping(value = "/org-usr/{authKey}/treeWithAuth")
FeignClientResult<List<OrgMenuDto>> getCompanyDeptTreeWithAuth(@PathVariable(value = "authKey") String authKey, @RequestParam(value = "orgTypes", required = false) String orgType);
FeignClientResult<List<OrgMenuDto>> getCompanyDeptTreeWithAuth(@PathVariable(value = "authKey") String authKey, @RequestParam(value = "orgType", required = false) String orgType);
/**
* 查询有权限的公司部门列表
......
......@@ -63,5 +63,7 @@ public interface EquipmentIndexMapper extends BaseMapper<EquipmentIndex> {
List<EquipmentIndexVO> getEquipmentIndexByIot();
List<EquipmentIndex> getPerfQutoaIotList(Long id);
List<String> getGruopName(Long equipmentId);
}
......@@ -108,4 +108,6 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List<Map<String, Object>> getEquipSpecificIndexByUpdateDateDesc();
List<EquipmentSpecificIndex> getEquipmentSpeIndexByIotCodeTrend(String iotCode, Integer isTrend, String fieldKey);
}
......@@ -63,4 +63,12 @@ public interface IEquipmentIndexService extends IService<EquipmentIndex> {
List<String> getGruopName(Long equipmentId);
/**
* 分页查询
* @param id
* @return
*/
List<EquipmentIndex> getPerfQutoaIotList(Long id);
}
......@@ -14,9 +14,11 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.entity.vo.IotIndexInfoVo;
import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO;
import com.yeejoin.equipmanage.common.vo.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap;
import java.util.List;
......@@ -224,4 +226,15 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
* @return 装备list
*/
List<Map<String, Object>> getListByEquipmentCode(String code);
/**
* 根据装备id获取物联日志
* @param iotCode code
* @param entity 日志
* @param isTrend 是否遥测 不传默认查遥测遥信
* @param fieldKey 指标key 不传默认查全部指标
* @return 物联日志list
*/
List<IotIndexInfoVo> getIndexInfoList(String iotCode, ResponseModel entity, Integer isTrend, String fieldKey);
}
package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.feign.morphic.model.ResourceDTO;
......@@ -10,6 +11,8 @@ import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO;
import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.vo.*;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
......@@ -233,5 +236,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Object refreshCarTypeAndCount(String bizOrgCode) throws Exception;
Map<String, Object> getSystemName(HashMap<String, Object> hashMap);
Map<String, Object> getSystemStatus(HashMap<String, Object> hashMap);
Map<String, Object> equipAlarmTOP(HashMap<String, Object> hashMap);
Page<Map<String, Object>> getSmallWaterInfo(Page page, HashMap<String, Object> hashMap);
Page<Map<String, Object>> equipmentState(Page result, HashMap<String, Object> hashMap);
}
......@@ -77,6 +77,11 @@ public class EquipmentIndexImpl extends ServiceImpl<EquipmentIndexMapper, Equipm
}
@Override
public List<EquipmentIndex> getPerfQutoaIotList(Long id) {
return this.baseMapper.getPerfQutoaIotList(id);
}
@Override
public EquipmentIndexVO getOnePrefQuota(Long id) {
return this.baseMapper.getOnePrefQuota(id);
}
......
......@@ -670,35 +670,46 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
List<EquipAlarmLineVo> list = equipmentSpecificAlarmMapper.equipAlarmLine(hashMap);
if (!CollectionUtils.isEmpty(list)) {
LinkedHashSet<String> xAxis = new LinkedHashSet<>();
LinkedHashMap<String, Object> yAxis = new LinkedHashMap<>();
List<Map<String, LinkedList<Object>>> yAxis = new ArrayList<>();
// 取出所有非空indexName
Set<Object> indexKNameSet = list.stream().map(EquipAlarmLineVo::getIndexName).filter(StringUtils::isNotBlank).collect(Collectors.toSet());
Set<String> indexKNameSet = list.stream().map(EquipAlarmLineVo::getIndexName).filter(StringUtils::isNotBlank).collect(Collectors.toSet());
Map<String, List<EquipAlarmLineVo>> dateCollect = list.stream().collect(Collectors.groupingBy(EquipAlarmLineVo::getDate));
Map<String, List<EquipAlarmLineVo>> sortMap = new TreeMap<>((o1, o2) -> o2.compareTo(o1));
sortMap.putAll(dateCollect);
// 迭代器倒序遍历map
ListIterator<Map.Entry<String, List<EquipAlarmLineVo>>> i = new ArrayList<Map.Entry<String, List<EquipAlarmLineVo>>>(dateCollect.entrySet()).listIterator(dateCollect.size());
while (i.hasPrevious()) {
String date = null;
for (String indexName : indexKNameSet) {
HashMap<String, LinkedList<Object>> dataMap = new HashMap<>();
LinkedList<Object> yData = new LinkedList<>();
Map.Entry<String, List<EquipAlarmLineVo>> entry = i.previous();
String key = entry.getKey();
List<EquipAlarmLineVo> value = entry.getValue();
for (EquipAlarmLineVo vo : value) {
String indexName = vo.getIndexName();
if (indexKNameSet.contains(indexName)) {
yData.add(vo.getTotal());
} else {
yData.add(0);
// 解决迭代器遍历一次的问题
ListIterator<Map.Entry<String, List<EquipAlarmLineVo>>> i = new ArrayList<Map.Entry<String, List<EquipAlarmLineVo>>>(sortMap.entrySet()).listIterator(sortMap.size());
while (i.hasPrevious()) {
Map.Entry<String, List<EquipAlarmLineVo>> entry = i.previous();
String key = entry.getKey();
List<EquipAlarmLineVo> value = entry.getValue();
for (EquipAlarmLineVo vo : value) {
String name = vo.getIndexName();
if (key.equals(date)) {
yData = yAxis.get(i.previousIndex()).get("data");
}
if (indexName.equals(name)) {
yData.add(vo.getTotal());
} else {
yData.add(0);
}
}
xAxis.add(key.substring(5));
date = key;
}
yAxis.put(key, yData);
xAxis.add(key);
dataMap.put("data", yData);
yAxis.add(dataMap);
}
resultMap.put("legend", indexKNameSet);
resultMap.put("xAxis", xAxis);
resultMap.put("yAxis", yAxis);
resultMap.put("axisData", xAxis);
resultMap.put("seriesData", yAxis);
}
return resultMap;
}
......
......@@ -5,6 +5,13 @@ import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONArray;
import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.vo.*;
import com.yeejoin.equipmanage.fegin.IotFeign;
import com.yeejoin.equipmanage.mapper.*;
import org.apache.catalina.util.IOTools;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -55,25 +62,6 @@ import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.Warehouse;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.AlarmInfoVO;
import com.yeejoin.equipmanage.common.entity.vo.AlarmVO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
import com.yeejoin.equipmanage.common.entity.vo.CurrAlaramVO;
import com.yeejoin.equipmanage.common.entity.vo.DetailPaneVO;
import com.yeejoin.equipmanage.common.entity.vo.DevInfoVO;
import com.yeejoin.equipmanage.common.entity.vo.DevOverviewVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSecificDetailVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.entity.vo.ManufacturerVO;
import com.yeejoin.equipmanage.common.entity.vo.PartDetailVO;
import com.yeejoin.equipmanage.common.entity.vo.ProductInfoVO;
import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO;
import com.yeejoin.equipmanage.common.entity.vo.SurrVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.TechInfoListVO;
import com.yeejoin.equipmanage.common.entity.vo.TechInfoVO;
import com.yeejoin.equipmanage.common.entity.vo.VideoVO;
import com.yeejoin.equipmanage.common.enums.AlarmStatusEnum;
import com.yeejoin.equipmanage.common.enums.BillContentEnum;
import com.yeejoin.equipmanage.common.enums.BitmapEnum;
......@@ -85,21 +73,6 @@ import com.yeejoin.equipmanage.common.exception.BaseException;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.QRCodeUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.EquipFor3DVO;
import com.yeejoin.equipmanage.common.vo.EquipmentDate;
import com.yeejoin.equipmanage.common.vo.EquipmentDetailVo;
import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo;
import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo;
import com.yeejoin.equipmanage.common.vo.VideoOnEquipmentSpecificVo;
import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.mapper.FormInstanceMapper;
import com.yeejoin.equipmanage.mapper.SignalClassifyMapper;
import com.yeejoin.equipmanage.mapper.UploadFileMapper;
import com.yeejoin.equipmanage.mapper.VideoMapper;
import com.yeejoin.equipmanage.mapper.WarehouseStructureMapper;
import com.yeejoin.equipmanage.service.ICarService;
import com.yeejoin.equipmanage.service.IEquPropertyService;
import com.yeejoin.equipmanage.service.IEquipmentCategoryService;
......@@ -123,6 +96,10 @@ import com.yeejoin.equipmanage.service.IVideoService;
import com.yeejoin.equipmanage.service.IWarehouseService;
import com.yeejoin.equipmanage.service.IWarehouseStructureService;
import com.yeejoin.equipmanage.utils.RelationRedisUtil;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import static org.typroject.tyboot.core.foundation.utils.DateTimeUtil.ISO8601_DATE_HOUR_MIN_SEC;
/**
* @author ZeHua Li
......@@ -233,6 +210,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired
FormInstanceMapper formInstanceMapper;
@Autowired
EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Value("${systemctl.sync.switch}")
private Boolean syncSwitch;
......@@ -1792,4 +1772,48 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
return list;
}
@Override
public List<IotIndexInfoVo> getIndexInfoList(String iotCode, ResponseModel entity, Integer isTrend, String fieldKey) {
List<IotIndexInfoVo> infoVoList = new ArrayList<>();
String json = JSON.toJSONString(entity.getResult());
List<Map<String, String>> listObject = (List<Map<String, String>>) JSONArray.parse(json);
List<EquipmentSpecificIndex> indexes = equipmentSpecificIndexMapper.getEquipmentSpeIndexByIotCodeTrend(iotCode, isTrend, fieldKey);
if (!ObjectUtils.isEmpty(indexes)) {
Map<String, EquipmentSpecificIndex> collect = indexes.stream().collect(Collectors.toMap(EquipmentSpecificIndex::getNameKey, equipmentSpecificIndex -> equipmentSpecificIndex));
for(Map<String, String> mapList : listObject){
String dateStr = null;
String deviceName = String.valueOf(mapList.get("deviceName"));
try {
String value = String.valueOf(mapList.get("time"));
String strDate = value.substring(0, 19);
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date =sdf.parse(strDate);
dateStr = DateTimeUtil.format(date, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
} catch (Exception e) {
log.error("日期转换失败");
}
for (Map.Entry entry : mapList.entrySet()){
if (!ObjectUtils.isEmpty(entry.getValue()) && !"null".equals(entry.getValue())) {
EquipmentSpecificIndex equipmentSpecificIndex = collect.get(entry.getKey());
if (!ObjectUtils.isEmpty(equipmentSpecificIndex)) {
IotIndexInfoVo iotIndexInfoVo = new IotIndexInfoVo();
iotIndexInfoVo.setType(equipmentSpecificIndex.getIndexName());
iotIndexInfoVo.setNumber(deviceName);
if (equipmentSpecificIndex.getIsTrend() == 1) {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getIndexName() + entry.getValue() + equipmentSpecificIndex.getIndexUnitName());
} else {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getEquipmentIndexName());
}
iotIndexInfoVo.setSendTime(dateStr);
infoVoList.add(iotIndexInfoVo);
}
}
}
}
}
return infoVoList;
}
}
......@@ -264,8 +264,7 @@ public class ExcelServiceImpl {
AircraftDto.class, dataSourcesImpl, false);
break;
case "XFDW":
// 暂时先还原代码不加 “非” ,由此原因导致导出队伍没有数据,后续若需修改请排查加了此逻辑的相关导出功能
if(authFalg) {
if(!authFalg) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
FireTeamDto.class, dataSourcesImpl, false);
break;
......@@ -752,11 +751,7 @@ public class ExcelServiceImpl {
logger.error("日期转换失败");
}
}
if ("peopleType".equals(key)) {
dynamicFormInstanceDto.setFieldValue("1");
dynamicFormInstanceDto.setFieldValueLabel("非消防人员");
orgUsrExcelDto.setPeopleType("1");
}
DynamicFormInstance dynamicFormInstance = new DynamicFormInstance();
BeanUtils.copyProperties(dynamicFormInstanceDto, dynamicFormInstance);
dynamicFormInstancelist.add(dynamicFormInstance);
......
......@@ -353,7 +353,9 @@
</select>
<select id="getEquipmentCount" resultType="Long">
select
if(sum(sto.amount) is null,0,sum(sto.amount)) as count from
-- IF ( sum( sto.amount ) IS NULL, 0, sum( sto.amount ) ) AS count
count(1)
from
wl_stock_detail as sto
left join wl_warehouse_structure as war on sto.warehouse_structure_id = war.id
where war.source_id in(
......@@ -523,11 +525,12 @@
</select>
<select id="getEquipCount" resultType="java.lang.Long">
SELECT
IF (
sum(sto.amount) IS NULL,
0,
sum(sto.amount)
) AS count
-- IF (
-- sum(sto.amount) IS NULL,
-- 0,
-- sum(sto.amount)
-- ) AS count
count( 1 )
FROM
wl_stock_detail AS sto
LEFT JOIN wl_warehouse_structure AS war ON sto.warehouse_structure_id = war.id
......
......@@ -223,4 +223,10 @@
GROUP BY
group_name
</select>
<select id="getPerfQutoaIotList" resultType="com.yeejoin.equipmanage.common.entity.EquipmentIndex">
select id,name as perfQuotaName, name_key as perfQuotaDefinitionId,is_trend as isTrend,emergency_level_color as emergencyLevelColor from wl_equipment_index s where equipment_id = (
select equipment_id from wl_equipment_detail wei where id = (
select equipment_detail_id from wl_equipment_specific where id = #{id})
)
</select>
</mapper>
......@@ -259,7 +259,7 @@
</select>
<select id="pageQuery" resultType="java.util.HashMap">
SELECT
`wlesal`.`id` AS `id`,
`wlesal`.`equipment_specific_alarm_id` AS `id`,
`wles`.`code` AS `code`,
`wlesal`.`equipment_specific_name` AS `specificName`,
`wlesal`.`equipment_specific_index_key` AS `indexKey`,
......@@ -268,7 +268,7 @@
IF
( `wlesal`.`clean_time` IS NOT NULL, '已消除', '未消除' ) AS `cleanStatus`,
`wlesal`.`iot_code` AS `iotCode`,
`wlesal`.`create_date` AS `createDate`
CONVERT ( `wlesal`.`create_date`, CHAR ) AS `createDate`
FROM
`wl_equipment_specific_alarm_log` `wlesal`
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesal`.`equipment_specific_id` = `wles`.`id`
......@@ -1238,6 +1238,6 @@
s.date,
s1.equipment_specific_index_key
ORDER BY
s.date
s.date DESC
</select>
</mapper>
\ No newline at end of file
......@@ -456,4 +456,35 @@ WHERE wles.id=#{id}
esi.update_date DESC
LIMIT 50
</select>
<select id="getEquipmentSpeIndexByIotCodeTrend" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT
wei.id AS id,
wei.name_key AS nameKey,
wesi.value AS value,
wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_index_id AS equipmentIndexId,
wes.org_code AS code,
wes.iot_code AS iotCode,
wes.org_code AS orgCode,
wei.type_code AS typeCode,
wei.name AS indexName,
wei.unit AS indexUnitName,
wei.is_trend isTrend,
wesi.value_label,
wesi.equipment_index_name,
wesi.update_date AS updateDate
FROM
wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE
wes.iot_code = #{iotCode}
<if test="isTrend != null">
AND wei.is_trend = #{isTrend}
</if>
<if test="fieldKey != null">
AND wei.name_key = #{fieldKey}
</if>
</select>
</mapper>
\ No newline at end of file
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