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