Commit 1f0f1d08 authored by maoying's avatar maoying

Merge branch 'develop_dl_plan6' into develop_dl_plan6_temp

parents f71b1240 e934188e
......@@ -86,26 +86,27 @@ public class EquipmentSpecificAlarm extends BaseEntity {
private Long equipmentIndexId;
@ApiModelProperty(value = "确认类型")
@TableField("confirm_type")
@TableField(exist = false)
private String confirmType;
@ApiModelProperty(value = "报警原因")
@TableField("alam_reason")
@TableField(exist = false)
private String alamReason;
@ApiModelProperty(value = "处理情况")
@TableField("resolve_result")
@TableField(exist = false)
private String resolveResult;
@ApiModelProperty(value = "确警人员")
@TableField("confirm_user")
@TableField(exist = false)
private String confirmUser;
@ApiModelProperty(value = "确警人员姓名")
@TableField(exist = false)
private String confirmUserName;
@ApiModelProperty(value = "确警时间")
@TableField("confirm_date")
@TableField(exist = false)
private Date confirmDate;
@ApiModelProperty(value = "iot数据上报唯一id")
......
......@@ -12,7 +12,7 @@ public interface ConfirmAlarmMapper extends BaseMapper<EquipmentSpecificAlarm> {
int confirmAlam(EquipmentSpecificAlarmLog ent);
EquipmentSpecificAlarm getIdAndConfirmType(String id);
EquipmentSpecificAlarmLog getIdAndConfirmType(String id);
int getFireAlarm();
......
......@@ -15,6 +15,7 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import com.yeejoin.equipmanage.common.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
......@@ -34,11 +35,6 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSystemSourceStatistics;
import com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentStateVo;
import com.yeejoin.equipmanage.common.entity.vo.MainIotMonitorItemContentVo;
import com.yeejoin.equipmanage.common.entity.vo.MainIotMonitorItemVo;
......@@ -264,7 +260,7 @@ public class MainIotMonitorServiceImpl implements IMainIotMonitorSerivce {
type = EquipmentStateEnum.PB.getType();
statusType = "shield";
}
EquipmentSpecificAlarm idvo = confirmAlarmMapper.getIdAndConfirmType(id);
EquipmentSpecificAlarmLog idvo = confirmAlarmMapper.getIdAndConfirmType(id);
Date time = new Date();
if (idvo != null && idvo.getId() != null){
itemVo.setAlamId(idvo.getId().toString());
......@@ -327,7 +323,7 @@ public class MainIotMonitorServiceImpl implements IMainIotMonitorSerivce {
String equSystemId = jsonObj.getString("systemId");
/* 设备id */
String speId = jsonObj.getString("speId");
EquipmentSpecificAlarm idvo = confirmAlarmMapper.getIdAndConfirmType(speId);
EquipmentSpecificAlarmLog idvo = confirmAlarmMapper.getIdAndConfirmType(speId);
if (systemId.equals(equSystemId) && StringUtil.isNotEmpty(speId)) {
/* 设备名称 */
String speName = jsonObj.getString("speName");
......
......@@ -422,9 +422,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
String cleanType = equipmentSpecificMapper.getEquipmentBySpecificId(log.getEquipmentSpecificId());
EquipmentSpecific specific = equipmentSpecificMapper.selectById(log.getEquipmentSpecificId());
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(date);
logs.forEach(x -> {
x.setCleanTime(new Date());
x.setStatus(AlarmStatusEnum.HF.getCode());
x.setEquipmentSpecificIndexValue(TrueOrFalseEnum.fake.value);
if (!StringUtils.isEmpty(traceId)) {
x.setTraceId(traceId);
}
......@@ -438,18 +441,18 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} else {
x.setAlarmReason(equipmentName + "引起设备报警");
}
x.setResolveResult(date + "系统收到设备复归(已消除)信号,系统自动处理。");
x.setResolveResult(dateString + "系统收到设备复归(已消除)信号,系统自动处理。");
x.setConfirmUser("");
x.setConfirmUserName("系统自动处理");
x.setConfirmDate(date);
}
});
Token token = remoteSecurityService.getServerToken();
String toke = token.getToke();
String appKey = token.getAppKey();
String product = token.getProduct();
String userId = remoteSecurityService.getAgencyUser().getUserId();
if (jcsSwitch && AlarmTypeEnum.HZGJ.getCode().equals(log.getType())) {
Token token = remoteSecurityService.getServerToken();
String toke = token.getToke();
String appKey = token.getAppKey();
String product = token.getProduct();
String userId = remoteSecurityService.getAgencyUser().getUserId();
// 确警消息发送
if (org.apache.commons.lang3.StringUtils.isNotBlank(userId)) {
new Thread(new Runnable() {
......
......@@ -17,7 +17,7 @@ public interface CheckResultMapper extends BaseMapper<CheckResult> {
IPage<CheckResultDto> selectResult(IPage<CheckResultDto> page,String code);
List<CheckResultDto> selectTotal(String modelId, String batchNo);
Map<String, Object> selectTotal(String modelId, String batchNo);
Map<String, Object> getTables(String tableName, String amosOrgCode);
......@@ -25,7 +25,7 @@ public interface CheckResultMapper extends BaseMapper<CheckResult> {
List<CheckResultDto> selectDetails(String batchNo,Integer modelId);
String select(String amosOrgCode);
String saveSql(String amosOrgCode);
List<CheckResultDto> getOne(String amosOrgCode);
......
......@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.tdc.api.entity.CheckResult;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
......@@ -18,13 +19,13 @@ public interface CheckResultService extends IService<CheckResult> {
List<CheckResult> selectCheckResult(String modelId,String batchNo);
List<CheckResultDto> selectTotal(String modelId, String batchNo);
Map<String, Object> selectTotal(String modelId, String batchNo);
List<CheckResultDto> selectStatistion(String batchNo,String amosOrgCode);
List<CheckResultDto> selectDetails(String batchNo,Integer modelId);
String select(String amosOrgCode,String userName);
String saveSql(String amosOrgCode,String userName);
/**
* 根据机构code获取模型数据树
......
......@@ -3,11 +3,17 @@
<mapper namespace="com.yeejoin.amos.boot.module.tdc.api.mapper.CheckResultMapper">
<select id="selectResult" resultType="com.yeejoin.amos.boot.module.tdc.api.dto.CheckResultDto">
select check_date, case when check_type="1" then '全站校验' else `model_name` end as `name`
from `tdc_check_result` where amos_org_code=#{code} GROUP BY batch_no
from `tdc_check_result`
<where>
<if test="code != '' and code != null">
and amos_org_code=#{code}
</if>
</where>
GROUP BY batch_no
</select>
<select id="selectTotal" resultType="com.yeejoin.amos.boot.module.tdc.api.dto.CheckResultDto">
SELECT count(1) as total, COUNT(CASE WHEN (check_item_result=1) THEN check_item_result END) AS aaa
<select id="selectTotal" resultType="java.util.Map">
SELECT count(1) as total, COUNT(CASE WHEN (check_item_result=1) THEN check_item_result END) AS unqualified
FROM tdc_check_result WHERE model_id = #{modelId} and batch_no = #{batchNo}
</select>
......
......@@ -20,6 +20,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
/**
......@@ -59,7 +60,7 @@ public class CheckResultController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/selectTotal")
@ApiOperation(httpMethod = "GET", value = "result", notes = "result")
public ResponseModel<List<CheckResultDto>> selectTotal(String modelId, String batchNo) {
public ResponseModel<Map<String, Object>> selectTotal(String modelId, String batchNo) {
return ResponseHelper.buildResponse(checkResultService.selectTotal(modelId, batchNo));
}
......@@ -93,11 +94,11 @@ public class CheckResultController extends BaseController {
* cs
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/select")
@GetMapping(value = "/saveSql")
@ApiOperation(httpMethod = "GET", value = "result", notes = "result")
public ResponseModel<String> select(String amosOrgCode) {
public ResponseModel<String> saveSql(String amosOrgCode) {
AgencyUserModel user = getUserInfo();
return ResponseHelper.buildResponse(checkResultService.select(amosOrgCode,user.getUserName()));
return ResponseHelper.buildResponse(checkResultService.saveSql(amosOrgCode,user.getUserName()));
}
......
......@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckModel;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckReport;
import com.yeejoin.amos.boot.module.tdc.api.entity.CheckResult;
import com.yeejoin.amos.boot.module.tdc.api.feign.IdxFeignService;
import com.yeejoin.amos.boot.module.tdc.api.mapper.CheckModelMapper;
......@@ -20,10 +21,14 @@ import com.yeejoin.amos.boot.module.tdc.biz.action.model.IdxProjectModel;
import com.yeejoin.amos.component.rule.RuleTrigger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
/**
* @author xxz
*/
......@@ -42,10 +47,17 @@ public class CheckModelImpl extends ServiceImpl<CheckModelMapper, CheckModel> im
@Override
public IPage<CheckModel> selectByOrgCode(int current, int size, String amosOrgCode) {
Page page = new Page(current,size);
LambdaQueryWrapper<CheckModel> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CheckModel::getAmosOrgCode, amosOrgCode);
if(ValidationUtil.isEmpty(amosOrgCode)){
return this.page(page);
}else{
LambdaQueryWrapper<CheckModel> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CheckModel::getAmosOrgCode, amosOrgCode);
// return baseMapper.selectList(wrapper);
return this.page(page,wrapper);
return this.page(page,wrapper);
}
}
@Override
......
......@@ -35,6 +35,7 @@ import org.codehaus.jettison.json.JSONString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.File;
......@@ -65,10 +66,12 @@ public class CheckResultImpl extends ServiceImpl<CheckResultMapper, CheckResult>
@Override
public IPage<CheckResultDto> selectResult(int current,int size,String code) {
Page page = new Page(current,size);
return checkResultMapper.selectResult(page,code);
// return checkResultMapper.selectResult(page,code);
}
@Override
public List<CheckResult> selectCheckResult(String modelId,String batchNo) {
LambdaQueryWrapper<CheckResult> wrapper = new LambdaQueryWrapper<>();
......@@ -79,10 +82,9 @@ public class CheckResultImpl extends ServiceImpl<CheckResultMapper, CheckResult>
}
@Override
public List<CheckResultDto> selectTotal(String modelId, String batchNo) {
public Map<String, Object> selectTotal(String modelId, String batchNo) {
return checkResultMapper.selectTotal(modelId, batchNo);
}
@Override
public List<CheckResultDto> selectStatistion(String batchNo, String amosOrgCode) {
return checkResultMapper.selectStatistion(batchNo, amosOrgCode);
......@@ -278,7 +280,7 @@ public class CheckResultImpl extends ServiceImpl<CheckResultMapper, CheckResult>
* @return
*/
@Override
public String select(String amosOrgCode,String userName){
public String saveSql(String amosOrgCode,String userName){
String url = getUrl(amosOrgCode);
CheckReport checkReport = new CheckReport();
checkReport.setReportUrl(url);
......
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