Commit 9134c415 authored by 李腾威's avatar 李腾威

公众号接口根据电梯id或电梯应急救援识别码获取电梯信息

parent 3bf50c54
......@@ -7,6 +7,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* 警情接警填报记录
......@@ -143,4 +144,10 @@ public class AlertCalledDto extends BaseDto {
@ApiModelProperty(value = "是否辅屏查询")
private String isAuxiliaryScreen;
@ApiModelProperty(value = "投诉描述/故障报修描述")
private String describe;
@ApiModelProperty(value = "图片")
private List<String> images;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author litw
* @date 2021-09-22.
*/
@Data
@ApiModel(value = "ElevatorBaseInfoDto", description = "ElevatorBaseInfoDto")
public class ElevatorBaseInfoDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "电梯应急救援识别码")
private Integer rescueCode;
@ApiModelProperty(value = "设备注册代码")
private String registerCode;
@ApiModelProperty(value = "所属省")
private String province;
@ApiModelProperty(value = "所属地市")
private String city;
@ApiModelProperty(value = "所属区县")
private String district;
@ApiModelProperty(value = "所属区域代码")
private String regionCode;
@ApiModelProperty(value = "电梯品牌")
private String brand;
@ApiModelProperty(value = "使用单位")
private String useUnit;
@ApiModelProperty(value = "维保单位")
private String maintainUnit;
@ApiModelProperty(value = "安装地址")
private String address;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* @author fengwang
* @date 2021-09-22.
*/
@Data
@ApiModel(value = "ElevatorInfoDto", description = "ElevatorInfoDto")
public class ElevatorInfoDto {
ElevatorBaseInfoDto elevatorBaseInfoDto;
ElevatorMaintenanceInfoDto elevatorMaintenanceInfoDto;
ElevatorTestInfoDto elevatorTestInfoDto;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author litw
* @date 2021-09-22.
*/
@Data
@ApiModel(value = "ElevatorMaintenanceInfo", description = "ElevatorMaintenanceInfo")
public class ElevatorMaintenanceInfoDto {
@ApiModelProperty(value = "最新维保日期")
private Date maintenanceTime;
@ApiModelProperty(value = "下次维保日期")
private Date nextMaintenanceTime;
@ApiModelProperty(value = "维保单位")
private String maintenanceUnit;
@ApiModelProperty(value = "维保人员")
private String maintenancePerson;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author fengwang
* @date 2021-09-22.
*/
@Data
@ApiModel(value="ElevatorTestInfoDto", description="检验信息表")
public class ElevatorTestInfoDto {
@ApiModelProperty(value = "最新检验时间")
private Date testTime;
@ApiModelProperty(value = "检验单位")
private String testUnit;
@ApiModelProperty(value = "检验人员")
private String testPerson;
@ApiModelProperty(value = "检验结论")
private String testResult;
}
......@@ -103,6 +103,29 @@ public class AlertCalledController extends BaseController {
}
/**
* 公众号投诉建议与故障报销
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveMobile")
@ApiOperation(httpMethod = "POST", value = "新增警情接警填报记录", notes = "新增警情接警填报记录")
public ResponseModel<AlertCalledDto> saveMobile(@RequestBody AlertCalledDto alertCalledDto, @RequestParam String openid) {
if (ValidationUtil.isEmpty(alertCalledDto)){
throw new BadRequest("参数校验失败.");
}
// 校验openid 是否存在
// 校验电梯识别码是否正确
// alertCalledObjsDto =iAlertCalledService.createAlertCalled(alertCalledObjsDto,reginParams.getUserModel());
return ResponseHelper.buildResponse(alertCalledDto);
}
/**
*
* <pre>
* 相似警情分页查询
......
......@@ -6,11 +6,19 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorBaseInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorMaintenanceInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorNewDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorTestInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.MaintainInfo;
import com.yeejoin.amos.boot.module.tzs.api.entity.TestInfo;
import com.yeejoin.amos.boot.module.tzs.api.service.IElevatorService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.MaintainInfoServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TestInfoServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import io.swagger.annotations.Api;
......@@ -26,7 +34,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -56,6 +66,12 @@ public class ElevatorController extends BaseController {
@Autowired
private AmosFeignService amosFeignService;
@Autowired
private MaintainInfoServiceImpl maintainInfoService;
@Autowired
private TestInfoServiceImpl testInfoService;
/**
* 新增电梯
*
......@@ -271,5 +287,57 @@ public class ElevatorController extends BaseController {
}
return ResponseHelper.buildResponse(elevatorUseSiteCategory);
}
/**
* 根据电梯id或电梯救援识别码获取电梯信息
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getElevatorInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取电梯使用单位", notes = "获取电梯使用单位")
public ResponseModel<ElevatorInfoDto> getElevatorInfo(Long sequenceNbr,String rescueCode) {
if(StringUtils.isBlank(rescueCode) && sequenceNbr == null) {
throw new BadRequest("参数错误");
}
ElevatorInfoDto elevatorInfoDto = new ElevatorInfoDto();
if(null != sequenceNbr) {
ElevatorBaseInfoDto baseInfoDto = new ElevatorBaseInfoDto();
Elevator elevator = elevatorService.getById(sequenceNbr);
Bean.toPo(elevator,baseInfoDto);
elevatorInfoDto.setElevatorBaseInfoDto(baseInfoDto);
} else {
QueryWrapper<Elevator> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("rescue_code",rescueCode);
Elevator elevator = elevatorService.getOne(queryWrapper);
if(null == elevator) {
throw new BadRequest("电梯应急救援码错误");
}
ElevatorBaseInfoDto baseInfoDto = new ElevatorBaseInfoDto();
Bean.toPo(elevator,baseInfoDto);
elevatorInfoDto.setElevatorBaseInfoDto(baseInfoDto);
}
QueryWrapper<MaintainInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("enevator_id", null == sequenceNbr ? rescueCode : String.valueOf(sequenceNbr));
MaintainInfo maintainInfo = maintainInfoService.getOne(queryWrapper);
if(null != maintainInfo) {
ElevatorMaintenanceInfoDto elevatorMaintenanceInfoDto = new ElevatorMaintenanceInfoDto();
Bean.toPo(maintainInfo,elevatorMaintenanceInfoDto);
elevatorInfoDto.setElevatorMaintenanceInfoDto(elevatorMaintenanceInfoDto);
}
QueryWrapper<TestInfo> queryWrapper1 = new QueryWrapper<>();
queryWrapper.eq("enevator_id", null == sequenceNbr ? rescueCode : String.valueOf(sequenceNbr));
TestInfo testInfo = testInfoService.getOne(queryWrapper1);
if(null != testInfo) {
ElevatorTestInfoDto elevatorTestInfoDto = new ElevatorTestInfoDto();
Bean.toPo(testInfo,elevatorTestInfoDto);
elevatorInfoDto.setElevatorTestInfoDto(elevatorTestInfoDto);
}
return ResponseHelper.buildResponse(elevatorInfoDto);
}
}
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