Commit e2a0a991 authored by suhuiguang's avatar suhuiguang

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

parents f989602b 907a60f8
package com.yeejoin.amos.boot.module.tzs.flc.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -8,6 +9,7 @@ import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 气瓶基本信息
......@@ -143,4 +145,6 @@ public class CylinderInfoDto extends BaseDto {
@ApiModelProperty(value = "企业负责人")
private String unitPerson;
@ApiModelProperty(value = "附件")
private Map<String, List<AttachmentDto>> attachments;
}
......@@ -65,9 +65,9 @@ public class CylWarningMsgAction{
msgLog.setRelationCode(cylWarningMsgDto.getCylSeq());
msgLog.setMsgType(EarlyWarningLevelEnum.getEumByLevel(level).getCode());
msgLog.setMsgTypeName(EarlyWarningLevelEnum.getEumByLevel(level).getName());
msgLog.setBody(text);
msgLog.setTargetCode(phone);
msgLog.setTargetName(orgUserName);
msgLog.setBody(instedParams(text,cylWarningMsgDto));
msgLog.setTargetCode(instedParams(phone,cylWarningMsgDto));
msgLog.setTargetName(instedParams(orgUserName,cylWarningMsgDto));
msgLog.setTerminalType("WEB");
msgLog.setSendTime(new Date());
msgLogServiceImpl.save(msgLog);
......@@ -93,9 +93,9 @@ public class CylWarningMsgAction{
msgLog.setRelationCode(cylWarningMsgDto.getCylSeq());
msgLog.setMsgType(EarlyWarningLevelEnum.getEumByLevel(level).getCode());
msgLog.setMsgTypeName(EarlyWarningLevelEnum.getEumByLevel(level).getName());
msgLog.setBody(text);
msgLog.setTargetCode(phone);
msgLog.setTargetName(orgUserName);
msgLog.setBody(instedParams(text,cylWarningMsgDto));
msgLog.setTargetCode(instedParams(phone,cylWarningMsgDto));
msgLog.setTargetName(instedParams(orgUserName,cylWarningMsgDto));
msgLog.setTerminalType("APP");
msgLog.setSendTime(new Date());
msgLogServiceImpl.save(msgLog);
......@@ -120,7 +120,9 @@ public class CylWarningMsgAction{
// Map<String, String> strengthMap = this.getStrengthMap(contingencyRo);
// for (String key : strengthMap.keySet())
// content = content.replaceAll("\\$\\{" + key + "}", strengthMap.get(key));
if(null == content || !content.contains("$")) {
return content;
}
Field[] fields = contingencyRo.getClass().getDeclaredFields();
Method getMethod = null;
try {
......@@ -130,7 +132,7 @@ public class CylWarningMsgAction{
String fileNameInMethod = String.valueOf(field.getName().charAt(0)).toUpperCase() + field.getName().substring(1);
getMethod = contingencyRo.getClass().getMethod("get" + fileNameInMethod);
String value = String.valueOf(getMethod.invoke(contingencyRo));
content = content.replaceAll("\\$\\{" + field.getName() + "}", value);
content = content.replaceAll("\\$\\{" + field.getName() + "}", value.equals("null")?"":value);
}
content = getNative(content);
......
......@@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import com.yeejoin.amos.boot.module.tzs.api.entity.MsgLog;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ESCylinderServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
......@@ -20,6 +23,7 @@ import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.CylinderUnitService
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.recycler.Recycler;
......@@ -74,6 +78,8 @@ public class CylinderInfoController extends BaseController {
private Map<Integer, String> regionMap;
@Autowired
private SourceFileServiceImpl sourceFileService;
/**
* 新增气瓶基本信息
......@@ -554,6 +560,8 @@ public class CylinderInfoController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "获取气瓶详细信息", notes = "获取气瓶详细信息")
public ResponseModel<CylinderInfoDto> cyinderInfoList(@PathVariable Long sequenceNbr) {
CylinderInfo cylinderInfo = cylinderInfoServiceImpl.getById(sequenceNbr);
Map<String, List<AttachmentDto>> imgMap = sourceFileService.getAttachments(cylinderInfo.getSequenceNbr());
CylinderInfoDto target = new CylinderInfoDto();
// 把原对象数据拷贝到新对象
BeanUtils.copyProperties(cylinderInfo, target);
......@@ -591,7 +599,7 @@ public class CylinderInfoController extends BaseController {
} else {
target.setInspectionStatas(0);
}
target.setAttachments(imgMap);
return ResponseHelper.buildResponse(target);
}
......
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