Commit ae29bc20 authored by chenhao's avatar chenhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 34623b64 c7080c90
...@@ -40,4 +40,8 @@ public class AvicCustomPathService extends BaseService<AvicCustomPathModel,AvicC ...@@ -40,4 +40,8 @@ public class AvicCustomPathService extends BaseService<AvicCustomPathModel,AvicC
public List<AvicCustomPathModel> queryForAvicCustomPathList(String agencyCode) { public List<AvicCustomPathModel> queryForAvicCustomPathList(String agencyCode) {
return this.queryForList("" , false, agencyCode); return this.queryForList("" , false, agencyCode);
} }
public AvicCustomPath queryForAvicCustomPathBySequenceNbr(String path) {
return null;
}
} }
...@@ -25,6 +25,10 @@ public class SourceScene extends BaseEntity { ...@@ -25,6 +25,10 @@ public class SourceScene extends BaseEntity {
@ApiModelProperty(value = "文件名称") @ApiModelProperty(value = "文件名称")
@TableField("source_name") @TableField("source_name")
private String sourceName; private String sourceName;
@ApiModelProperty(value = "数据源类型:building(建筑类),system(系统类)")
@TableField("source_type")
private String sourceType;
@ApiModelProperty(value = "组态工程id") @ApiModelProperty(value = "组态工程id")
@TableField("project_id") @TableField("project_id")
......
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 消息流水表
*
* @author system_generator
* @date 2022-04-20
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="MsgLogDto", description="消息流水表")
public class MsgLogDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "关联编号")
private String relationCode;
@ApiModelProperty(value = "消息类型(超期预警、许可超期、风险预警)")
private String msgType;
@ApiModelProperty(value = "消息内容")
private String body;
@ApiModelProperty(value = "接收者账号")
private String targetCode;
@ApiModelProperty(value = "接收者名称")
private String targetName;
@ApiModelProperty(value = "发送日期")
private Date sendTime;
}
package com.yeejoin.amos.boot.module.tzs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 消息流水表
*
* @author system_generator
* @date 2022-04-20
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tz_msg_log")
public class MsgLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 关联编号
*/
@TableField("relation_code")
private String relationCode;
/**
* 消息类型(超期预警、许可超期、风险预警)
*/
@TableField("msg_type")
private String msgType;
/**
* 消息内容
*/
@TableField("body")
private String body;
/**
* 接收者账号
*/
@TableField("target_code")
private String targetCode;
/**
* 接收者名称
*/
@TableField("target_name")
private String targetName;
/**
* 发送日期
*/
@TableField("send_time")
private Date sendTime;
}
package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.yeejoin.amos.boot.module.tzs.api.entity.MsgLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 消息流水表 Mapper 接口
*
* @author system_generator
* @date 2022-04-20
*/
public interface MsgLogMapper extends BaseMapper<MsgLog> {
}
package com.yeejoin.amos.boot.module.tzs.api.service;
/**
* 消息流水表接口类
*
* @author system_generator
* @date 2022-04-20
*/
public interface IMsgLogService {
}
package com.yeejoin.amos.boot.module.tzs.flc.api.dto; package com.yeejoin.amos.boot.module.tzs.flc.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -16,10 +17,10 @@ import java.util.List; ...@@ -16,10 +17,10 @@ import java.util.List;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value="CylinderInfoDto", description="气瓶基本信息") @ApiModel(value = "CylinderInfoDto", description = "气瓶基本信息")
public class CylinderInfoDto extends BaseDto { public class CylinderInfoDto extends BaseDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "气瓶基本信息ID") @ApiModelProperty(value = "气瓶基本信息ID")
...@@ -103,7 +104,10 @@ public class CylinderInfoDto extends BaseDto { ...@@ -103,7 +104,10 @@ public class CylinderInfoDto extends BaseDto {
@ApiModelProperty(value = "查询单位appid") @ApiModelProperty(value = "查询单位appid")
private List<String> appIds; private List<String> appIds;
@ApiModelProperty(value = "检验状态 0 已超期 1 正常 2 即将超期") @ApiModelProperty(value = "检验状态 0 已超期 1 正常 2 即将超期")
private int inspectionStatas; private int inspectionStatas;
@ApiModelProperty(value = "预警等级")
private String earlyWarningLevel;
} }
...@@ -159,4 +159,9 @@ public class CylinderInfo { ...@@ -159,4 +159,9 @@ public class CylinderInfo {
*/ */
@TableField("integrity") @TableField("integrity")
private Double integrity; private Double integrity;
/**
* 预警等级
*/
private String earlyWarningLevel;
} }
...@@ -56,4 +56,6 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> { ...@@ -56,4 +56,6 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
* @return * @return
*/ */
Integer getMonthBeforeLastInfoTotalUnit(@Param("appId")String appId); Integer getMonthBeforeLastInfoTotalUnit(@Param("appId")String appId);
Integer countOverDateNumber(@Param("threshold") int threshold);
} }
...@@ -53,6 +53,13 @@ ...@@ -53,6 +53,13 @@
<select id="getMonthBeforeLastInfoTotalUnit" resultType="java.lang.Integer"> <select id="getMonthBeforeLastInfoTotalUnit" resultType="java.lang.Integer">
select IFNULL(count(sequence_nbr), 0) from tz_cylinder_info where PERIOD_DIFF( date_format( now( ) , '%Y%m' ) , date_format( sync_date, '%Y%m' ) ) =2 AND app_id = #{appId} select IFNULL(count(sequence_nbr), 0) from tz_cylinder_info where PERIOD_DIFF( date_format( now( ) , '%Y%m' ) , date_format( sync_date, '%Y%m' ) ) =2 AND app_id = #{appId}
</select> </select>
<select id="countOverDateNumber" resultType="java.lang.Integer">
SELECT
count(1)
FROM `tz_cylinder_info` ci
where
DATEDIFF(ci.next_inspection_date,now()) <![CDATA[<=]]> #{threshold}
</select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.tzs.api.mapper.MsgLogMapper">
</mapper>
...@@ -26,6 +26,7 @@ import org.apache.logging.log4j.Logger; ...@@ -26,6 +26,7 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.scheduling.annotation.Async;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -46,6 +47,8 @@ import com.alibaba.fastjson.JSONArray; ...@@ -46,6 +47,8 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.avic.face.model.AvicCustomPathModel; import com.yeejoin.amos.avic.face.model.AvicCustomPathModel;
import com.yeejoin.amos.avic.face.model.TransferModel; import com.yeejoin.amos.avic.face.model.TransferModel;
import com.yeejoin.amos.avic.face.orm.entity.AvicCustomPath;
import com.yeejoin.amos.avic.face.service.AvicCustomPathService;
import com.yeejoin.indicators.feign.IndicatorsManager; import com.yeejoin.indicators.feign.IndicatorsManager;
import com.yeejoin.indicators.feign.request.DataFetchRequest; import com.yeejoin.indicators.feign.request.DataFetchRequest;
import com.yeejoin.indicators.feign.request.DataRecordRequest; import com.yeejoin.indicators.feign.request.DataRecordRequest;
...@@ -69,6 +72,9 @@ public class WebServicesFileFransferResource { ...@@ -69,6 +72,9 @@ public class WebServicesFileFransferResource {
@Autowired @Autowired
WorkflowManager workflowManager; WorkflowManager workflowManager;
@Autowired
private AvicCustomPathService simpleService;
@Value(value = "${upload.temp.dir}") @Value(value = "${upload.temp.dir}")
String tempDir; String tempDir;
...@@ -188,17 +194,29 @@ public class WebServicesFileFransferResource { ...@@ -188,17 +194,29 @@ public class WebServicesFileFransferResource {
public ResponseModel postfile(@RequestBody TransferModel transferModel) { public ResponseModel postfile(@RequestBody TransferModel transferModel) {
Map<String, Object> task = indicatorsManager.indicatorClient.getTaskByTaskId(transferModel.getTaskId()) Map<String, Object> task = indicatorsManager.indicatorClient.getTaskByTaskId(transferModel.getTaskId())
.getResult(); .getResult();
syncSendFile(task, transferModel);
DataReportAuditRequest dataReportAuditRequest = new DataReportAuditRequest();
dataReportAuditRequest.setTaskId(transferModel.getTaskId());
dataReportAuditRequest.setInstanceId(task.get("processInstanceId").toString());
dataReportAuditRequest.setRemark(transferModel.getComment());
dataReportAuditRequest.setCondition("0");
indicatorsManager.indicatorClient.auditWorkFlow(dataReportAuditRequest);
return ResponseHelper.buildResponse(null);
}
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); @Async
Client client = dcf.createClient(webserviceUrl); private void syncSendFile(Map<String, Object> task, TransferModel transferModel) {
AvicCustomPath avicCustomPath = simpleService.getById(transferModel.getPath());
try { try {
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient(webserviceUrl);
if (ObjectUtils.isEmpty(transferModel.getAvicCode())) { if (ObjectUtils.isEmpty(transferModel.getAvicCode())) {
for (String file : transferModel.getFiles().stream().map(m -> m.getUrl()) for (String file : transferModel.getFiles().stream().map(m -> m.getUrl())
.collect(Collectors.toList())) { .collect(Collectors.toList())) {
String filePath = tempDir; String filePath = tempDir;
File dest = new File(filePath + file); File dest = new File(filePath + file);
DataHandler handler = new DataHandler(new FileDataSource(dest)); DataHandler handler = new DataHandler(new FileDataSource(dest));
client.invoke("transferFile", handler, dest.getName(), transferModel.getPath()); client.invoke("transferFile", handler, dest.getName(), avicCustomPath.getPath());
} }
} else { } else {
for (String file : transferModel.getFiles().stream().map(m -> m.getUrl()) for (String file : transferModel.getFiles().stream().map(m -> m.getUrl())
...@@ -206,23 +224,13 @@ public class WebServicesFileFransferResource { ...@@ -206,23 +224,13 @@ public class WebServicesFileFransferResource {
String filePath = tempDir; String filePath = tempDir;
File dest = new File(filePath + file); File dest = new File(filePath + file);
DataHandler handler = new DataHandler(new FileDataSource(dest)); DataHandler handler = new DataHandler(new FileDataSource(dest));
client.invoke("useCodetransferFile", handler, dest.getName(), transferModel.getPath(), client.invoke("useCodetransferFile", handler, dest.getName(), avicCustomPath.getPath(),
transferModel.getAvicCode()); transferModel.getAvicCode());
} }
} }
// JSONObject actTask = workflowManager.workflowClient.getTask(task.get("processInstanceId").toString());
// workflowManager.workflowClient.pickupAndCompleteTask(actTask.getJSONObject("data").getString("id"), new HashMap<>());
DataReportAuditRequest dataReportAuditRequest = new DataReportAuditRequest();
dataReportAuditRequest.setTaskId(transferModel.getTaskId());
dataReportAuditRequest.setInstanceId(task.get("processInstanceId").toString());
dataReportAuditRequest.setRemark(transferModel.getComment());
dataReportAuditRequest.setCondition("0");
indicatorsManager.indicatorClient.auditWorkFlow(dataReportAuditRequest);
} catch (java.lang.Exception e) { } catch (java.lang.Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return ResponseHelper.buildResponse(null);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -25,6 +25,8 @@ public class FileFransferServiceImpl implements FileFransferService { ...@@ -25,6 +25,8 @@ public class FileFransferServiceImpl implements FileFransferService {
@Autowired @Autowired
AvicCustomPathService avicCustomPathService; AvicCustomPathService avicCustomPathService;
String baseDir = "E:\\webservice\\";
@Override @Override
public void useCodetransferFile(DataHandler handler, String fileName, String path, String code) { public void useCodetransferFile(DataHandler handler, String fileName, String path, String code) {
saveFile(handler, fileName, path); saveFile(handler, fileName, path);
...@@ -36,8 +38,8 @@ public class FileFransferServiceImpl implements FileFransferService { ...@@ -36,8 +38,8 @@ public class FileFransferServiceImpl implements FileFransferService {
FileOutputStream os = null; FileOutputStream os = null;
try { try {
is = handler.getInputStream(); is = handler.getInputStream();
File file = new File(String.format("%s%s%s", path, File.separator, fileName)); File file = new File(String.format("%s%s%s%s", baseDir,path.replace(":", ""), File.separator, fileName));
File dir = new File(String.format("%s%s", path, File.separator)); File dir = new File(String.format("%s%s%s", baseDir, path.replace(":", ""), File.separator));
if (!dir.exists()) { if (!dir.exists()) {
dir.mkdirs(); dir.mkdirs();
} }
......
...@@ -793,8 +793,15 @@ public class TopographyController extends AbstractBaseController { ...@@ -793,8 +793,15 @@ public class TopographyController extends AbstractBaseController {
lists.add(dataVO); lists.add(dataVO);
iotVo.setList(lists); iotVo.setList(lists);
try { try {
Date date = DateUtils.dateParse(String.valueOf(timeList.get(j-1).getValue()), DateUtils.DATE_TIME_T_PATTERN); //Date date = DateUtils.dateParse(String.valueOf(timeList.get(j-1).getValue()), DateUtils.DATE_TIME_T_PATTERN);
iotVo.setTime(date);
SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_TIME_T_PATTERN);
SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date1=sdf.parse(String.valueOf(timeList.get(j-1).getValue()));
String time= DateTimeUtil.format(date1, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
iotVo.setTime(sdf1.parse(time));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -803,7 +810,8 @@ public class TopographyController extends AbstractBaseController { ...@@ -803,7 +810,8 @@ public class TopographyController extends AbstractBaseController {
} }
} }
} }
return CommonResponseUtil.success(list); List<TopographyIotVo> result = list.stream().sorted(Comparator.comparing(TopographyIotVo::getTime).reversed()).collect(Collectors.toList());
return CommonResponseUtil.success(result);
} else { } else {
logger.error("查询物联日志数据为空或iotCode为 (" + iotCode + ") 的装备不存在于物联系统中!"); logger.error("查询物联日志数据为空或iotCode为 (" + iotCode + ") 的装备不存在于物联系统中!");
return CommonResponseUtil.success(); return CommonResponseUtil.success();
......
...@@ -238,6 +238,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -238,6 +238,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
model.put("id", String.valueOf(System.currentTimeMillis())); model.put("id", String.valueOf(System.currentTimeMillis()));
model.put("projectId", String.valueOf(projectSeq)); model.put("projectId", String.valueOf(projectSeq));
model.put("creatorId", userId); model.put("creatorId", userId);
model.put("sourceType", "building");
model.put("instanceId", resourceDTO.getCode()); model.put("instanceId", resourceDTO.getCode());
model.put("name", resourceDTO.getName()); model.put("name", resourceDTO.getName());
this.baseMapper.insetSourceScene(model); this.baseMapper.insetSourceScene(model);
......
...@@ -63,6 +63,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -63,6 +63,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Autowired @Autowired
IEquipmentSpecificIndexService equipmentSpecificIndexService; IEquipmentSpecificIndexService equipmentSpecificIndexService;
@Autowired @Autowired
private ISyncDataService syncDataService; private ISyncDataService syncDataService;
...@@ -165,6 +166,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -165,6 +166,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
ent.setEquipmentSpecificId(alarmLog.getEquipmentSpecificId()); ent.setEquipmentSpecificId(alarmLog.getEquipmentSpecificId());
ent.setEquipmentSpecificIndexKey(alarmLog.getEquipmentSpecificIndexKey()); ent.setEquipmentSpecificIndexKey(alarmLog.getEquipmentSpecificIndexKey());
String cleanType = equipmentSpecificMapper.getEquipmentBySpecificId(alarmLog.getEquipmentSpecificId()); String cleanType = equipmentSpecificMapper.getEquipmentBySpecificId(alarmLog.getEquipmentSpecificId());
int i = 0 ; // 是否成功标识
if (StringUtil.isNotEmpty(cleanType) && AlarmCleanTypeEnum.QRXC.getCode().equals(cleanType)) { if (StringUtil.isNotEmpty(cleanType) && AlarmCleanTypeEnum.QRXC.getCode().equals(cleanType)) {
EquipmentSpecificAlarm alarm = equipmentSpecificAlarmMapper.selectById(alarmLog.getEquipmentSpecificAlarmId()); EquipmentSpecificAlarm alarm = equipmentSpecificAlarmMapper.selectById(alarmLog.getEquipmentSpecificAlarmId());
alarm.setStatus(AlarmStatusEnum.HF.getCode()); alarm.setStatus(AlarmStatusEnum.HF.getCode());
...@@ -176,6 +178,12 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -176,6 +178,12 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
eq(EquipmentSpecificIndex::getEquipmentSpecificId,alarm.getEquipmentSpecificId()). eq(EquipmentSpecificIndex::getEquipmentSpecificId,alarm.getEquipmentSpecificId()).
eq(EquipmentSpecificIndex::getEquipmentIndexKey,alarm.getEquipmentSpecificIndexKey()); eq(EquipmentSpecificIndex::getEquipmentIndexKey,alarm.getEquipmentSpecificIndexKey());
iEquipmentSpecificIndexSerivce.update(updateWrapper); iEquipmentSpecificIndexSerivce.update(updateWrapper);
//指标图标显示根据 EquipmentSpecific 表中的 RealtimeIotIndexValue 判断 同步修改
LambdaUpdateWrapper<EquipmentSpecific> wrapper =new LambdaUpdateWrapper<EquipmentSpecific>().
set(EquipmentSpecific::getRealtimeIotIndexValue,"false").
set(EquipmentSpecific::getRealtimeIotIndexUpdateDate,new Date()).
eq(EquipmentSpecific::getId,alarm.getEquipmentSpecificId());
equipmentSpecificSerivce.update(wrapper);
MqttReceiveServiceImpl.upAlarmLogStatus(alarmLog.getIotCode(), alarmLog.getEquipmentSpecificIndexKey(), equipmentSpecificAlarmLogService); MqttReceiveServiceImpl.upAlarmLogStatus(alarmLog.getIotCode(), alarmLog.getEquipmentSpecificIndexKey(), equipmentSpecificAlarmLogService);
} }
// 如果是批量确警,先查询,再确警,用于批量消息推送 // 如果是批量确警,先查询,再确警,用于批量消息推送
......
...@@ -31,6 +31,7 @@ import com.yeejoin.equipmanage.mapper.*; ...@@ -31,6 +31,7 @@ import com.yeejoin.equipmanage.mapper.*;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
...@@ -48,7 +49,7 @@ import java.net.SocketException; ...@@ -48,7 +49,7 @@ import java.net.SocketException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Slf4j
@Service @Service
public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSystemMapper, FireFightingSystemEntity> public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSystemMapper, FireFightingSystemEntity>
implements IFireFightingSystemService { implements IFireFightingSystemService {
...@@ -353,6 +354,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -353,6 +354,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
sourceScene.setSourceId(systemId); sourceScene.setSourceId(systemId);
sourceScene.setSourceName(resourceDTO.getName()); sourceScene.setSourceName(resourceDTO.getName());
sourceScene.setSceneId(resourceDTO.getId()); sourceScene.setSceneId(resourceDTO.getId());
sourceScene.setSourceType("system");
} }
// TODO 获取画布下 绑定的装备点、摄像头,目前消防系统只能绑定装备,不能绑定摄像头(树未返回摄像头) // TODO 获取画布下 绑定的装备点、摄像头,目前消防系统只能绑定装备,不能绑定摄像头(树未返回摄像头)
List<Map> children = (List<Map>) parse.get("children"); List<Map> children = (List<Map>) parse.get("children");
...@@ -637,26 +639,14 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -637,26 +639,14 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
@Override @Override
@Transactional
public Boolean deleteSystem(Long id) { public Boolean deleteSystem(Long id) {
// QueryWrapper<FormInstance> fqw = new QueryWrapper<>();
// fqw.eq("field_value",id);
// fqw.groupBy("instance_id");
// List<FormInstance> formInstances = formInstanceMapper.selectList(fqw);
// if (formInstances != null && formInstances.size()>0){
// QueryWrapper<FormInstance> one = new QueryWrapper<>();
// one.eq("instance_id",formInstances.get(0).getInstanceId());
// one.eq("field_name","name");
// List<FormInstance> formInstances1 = formInstanceMapper.selectList(one);
// FormInstance formInstance = formInstances1.get(0);
// String name = formInstance.getFieldValue();
// throw new BadRequest(name+"建筑与该系统存在绑定关系,请清除后再进行删除!");
// }
FireFightingSystemEntity entity = baseMapper.selectById(id); FireFightingSystemEntity entity = baseMapper.selectById(id);
if (entity.getSceneId() != null) { if (entity.getSceneId() != null) {
try { try {
FeignUtil.remoteCall(() -> Morphic.morphicSubjectClient.delete(entity.getSceneId())); FeignUtil.remoteCall(() -> Morphic.morphicSubjectClient.delete(entity.getSceneId()));
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("远程调用 MORPHIC 服务的删除操作出错"); log.error("远程调用 MORPHIC 服务的删除操作出错:"+e.getMessage().toString(),e);
} }
} }
formInstanceMapper.clearSystemId(id); formInstanceMapper.clearSystemId(id);
...@@ -667,7 +657,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -667,7 +657,11 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
if (i > 0 && syncSwitch) { if (i > 0 && syncSwitch) {
syncDataService.syncDeletedFireFightingSystem(Arrays.asList(id)); syncDataService.syncDeletedFireFightingSystem(Arrays.asList(id));
} }
// 删除动态关联表单实例数据 //删除系统图与设备关系表
QueryWrapper<SourceScene> ssWrapper = new QueryWrapper<SourceScene>();
ssWrapper.lambda().eq(SourceScene::getSourceId, id);
sourceSceneMapper.delete(ssWrapper);
//删除动态关联表单实例数据
if (entity.getInstanceId() != null) { if (entity.getInstanceId() != null) {
instanceService.remove(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceService.remove(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId,
entity.getInstanceId())); entity.getInstanceId()));
......
...@@ -287,7 +287,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements ...@@ -287,7 +287,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
public List<EquipmentSpecific> uploadListByTemplate(List<EquipmentDetailDownloadTemplateDto> equipmentDetailDownloadVOS, ReginParams reginParams, AgencyUserModel agencyUserModel) { public List<EquipmentSpecific> uploadListByTemplate(List<EquipmentDetailDownloadTemplateDto> equipmentDetailDownloadVOS, ReginParams reginParams, AgencyUserModel agencyUserModel) {
StringBuffer fireFightSysIdsBuffer = new StringBuffer(); StringBuffer fireFightSysIdsBuffer = new StringBuffer();
......
package com.yeejoin.amos.boot.module.tzs.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.MsgLogServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.api.dto.MsgLogDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 消息流水表
*
* @author system_generator
* @date 2022-04-20
*/
@RestController
@Api(tags = "消息流水表Api")
@RequestMapping(value = "/msg-log")
public class MsgLogController extends BaseController {
@Autowired
MsgLogServiceImpl msgLogServiceImpl;
/**
* 新增消息流水表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增消息流水表", notes = "新增消息流水表")
public ResponseModel<MsgLogDto> save(@RequestBody MsgLogDto model) {
model = msgLogServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新消息流水表", notes = "根据sequenceNbr更新消息流水表")
public ResponseModel<MsgLogDto> updateBySequenceNbrMsgLog(@RequestBody MsgLogDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(msgLogServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除消息流水表", notes = "根据sequenceNbr删除消息流水表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(msgLogServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个消息流水表", notes = "根据sequenceNbr查询单个消息流水表")
public ResponseModel<MsgLogDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(msgLogServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "消息流水表分页查询", notes = "消息流水表分页查询")
public ResponseModel<Page<MsgLogDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<MsgLogDto> page = new Page<MsgLogDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(msgLogServiceImpl.queryForMsgLogPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "消息流水表列表全部数据查询", notes = "消息流水表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<MsgLogDto>> selectForList() {
return ResponseHelper.buildResponse(msgLogServiceImpl.queryForMsgLogList());
}
}
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.yeejoin.amos.boot.module.tzs.api.entity.MsgLog;
import com.yeejoin.amos.boot.module.tzs.api.mapper.MsgLogMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IMsgLogService;
import com.yeejoin.amos.boot.module.tzs.api.dto.MsgLogDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 消息流水表服务实现类
*
* @author system_generator
* @date 2022-04-20
*/
@Service
public class MsgLogServiceImpl extends BaseService<MsgLogDto,MsgLog,MsgLogMapper> implements IMsgLogService {
/**
* 分页查询
*/
public Page<MsgLogDto> queryForMsgLogPage(Page<MsgLogDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<MsgLogDto> queryForMsgLogList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
...@@ -22,7 +22,6 @@ import io.swagger.annotations.ApiOperation; ...@@ -22,7 +22,6 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -841,4 +840,11 @@ public class CylinderInfoController extends BaseController { ...@@ -841,4 +840,11 @@ public class CylinderInfoController extends BaseController {
return ResponseHelper.buildResponse(true); return ResponseHelper.buildResponse(true);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "气瓶超期数量统计")
@GetMapping(value = "/{threshold}/statistics")
public ResponseModel<Integer> getOverDateStatisticsNumber(@PathVariable int threshold){
return ResponseHelper.buildResponse(cylinderInfoServiceImpl.getOverDateStatisticsNumber(threshold));
}
} }
...@@ -558,4 +558,8 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -558,4 +558,8 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
}); });
} }
} }
public Integer getOverDateStatisticsNumber(int threshold) {
return this.baseMapper.countOverDateNumber(threshold);
}
} }
\ No newline at end of file
spring.application.name=AMOS-BIZ-AVIC-API spring.application.name=AMOS-BIZ-AVIC-API-TARGET
server.servlet.context-path=/avic server.servlet.context-path=/avic
server.port=8808 server.port=8808
spring.profiles.active=dev spring.profiles.active=dev
......
...@@ -2776,4 +2776,40 @@ ...@@ -2776,4 +2776,40 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="my" id="16504254290001-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_source_scene" columnName="source_type"/>
</not>
</preConditions>
<comment>wl_source_scene add column source_type 添加组态页面关系表数据源类型字段</comment>
<sql>
ALTER TABLE `wl_source_scene`
ADD COLUMN `source_type` varchar(255) NULL COMMENT '数据源类型:building(建筑类),system(系统类)' AFTER `source_name`;
UPDATE wl_source_scene ss
SET ss.source_type = 'building'
WHERE
(
SELECT
count(1)
FROM
wl_warehouse_structure ws
WHERE
ws.id = ss.source_id
) > 0;
UPDATE wl_source_scene ss
SET ss.source_type = 'system'
WHERE
(
SELECT
count(1)
FROM
f_fire_fighting_system ffs
WHERE
ffs.id = ss.source_id
) > 0;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
(id, (id,
source_id, source_id,
source_name, source_name,
source_type,
project_id, project_id,
scene_id, scene_id,
point_in_scene, point_in_scene,
...@@ -114,6 +115,7 @@ ...@@ -114,6 +115,7 @@
#{id}, #{id},
#{instanceId}, #{instanceId},
#{name}, #{name},
#{sourceType},
#{projectId}, #{projectId},
#{sceneId}, #{sceneId},
null, null,
......
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