#20230510 欣影管理平台装置信息查询代码

jni
18616268358 2 years ago
parent 64cf4d6f1d
commit e0db4ee6d0

@ -5,11 +5,11 @@ import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.model.LineListModel;
import com.shxy.xymanager_common.model.SystemConfigModel;
import com.shxy.xymanager_common.model.UpperComputerInfoModel;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.LineService;
import com.shxy.xymanager_common.vo.SystemConfigReqVo;
import com.shxy.xymanager_common.vo.SystemConfigVo;
import com.shxy.xymanager_common.vo.TerminalUpperComputerVo;
import com.shxy.xymanager_service.service.SystemConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -88,8 +88,8 @@ public class SystemConfigController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getUpperComputerInfo")
@Log(title = "获取上位机信息", type = "查询")
public ResponseReult<UpperComputerInfoModel> getUpperComputerInfo(@RequestParam("requestId") Integer requestId) {
ServiceBody<UpperComputerInfoModel> serviceBody = configService.getUpperComputerInfo(requestId);
public ResponseReult<UpperComputerInfoModel> getUpperComputerInfo(@RequestBody @Validated TerminalUpperComputerVo vo) {
ServiceBody<UpperComputerInfoModel> serviceBody = configService.getUpperComputerInfo(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {

@ -2,9 +2,9 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/xymp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: xymp
password: Xymp@2023
url: jdbc:mysql://127.0.0.1:13306/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
type: com.alibaba.druid.pool.DruidDataSource
#spring:
# # 数据源配置

@ -0,0 +1,18 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
@Data
public class UpperComputerInfoDto {
private Integer termId;
private String cmdId;
private String ip;
private Short port;
private String domain;
}

@ -14,7 +14,7 @@ import java.io.Serializable;
public class UpperComputerInfoModel implements Serializable {
@ApiModelProperty(value = "采集装置ID", example = "120")
private String termId;
private Integer termId;
@ApiModelProperty(value = "监测装置ID", example = "120")
private String cmdId;
@ -28,5 +28,8 @@ public class UpperComputerInfoModel implements Serializable {
@ApiModelProperty(value = "上位机域名", example = "120")
private String domain;
@ApiModelProperty(value = "是否最新", example = "120")
private Boolean isNew = false;
}

@ -0,0 +1,24 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;
@Data
@Validated
@ApiModel(value = "查询上位机信息对象", description = "查询上位机信息对象描述")
public class TerminalUpperComputerVo {
@ApiModelProperty(value = "请求ID", example = "123455")
private Integer requestId;
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer termId;
}

@ -1,6 +1,7 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.TerminalApkInfoDto;
import com.shxy.xymanager_common.dto.UpperComputerInfoDto;
import com.shxy.xymanager_common.entity.TerminalParams;
import com.shxy.xymanager_common.entity.TerminalUpload;
import com.shxy.xymanager_common.vo.SystemConfigVo;
@ -16,4 +17,6 @@ public interface SystemConfigDao {
void updateSystemConfig(TerminalParams vo);
UpperComputerInfoDto getUpperComputerInfo(Integer termId);
}

@ -29,4 +29,13 @@
where id = #{termId}
</update>
<select id="getUpperComputerInfo" resultType="com.shxy.xymanager_common.dto.UpperComputerInfoDto">
select
cma_port as port,
cma_ip_address as ip,
cma_domain_name as domain
from terminal_params
where term_id = #{termId,jdbcType=INTEGER}
</select>
</mapper>

@ -285,7 +285,7 @@
<select id="getRequestResult" resultType="java.lang.String">
select
result
data
from request_results
where request_id = #{requestId,jdbcType=TINYINT}
</select>

@ -28,7 +28,7 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_status
from terminal_positions
where term_id = #{termId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.dto.PhotoParamsDto;
import com.shxy.xymanager_common.dto.UpperComputerInfoDto;
import com.shxy.xymanager_common.entity.TerminalParams;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.SystemConfigModel;
@ -13,6 +14,7 @@ import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.vo.SystemConfigReqVo;
import com.shxy.xymanager_common.vo.SystemConfigVo;
import com.shxy.xymanager_common.vo.TerminalUpperComputerVo;
import com.shxy.xymanager_dao.dao.SystemConfigDao;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_service.service.SystemConfigService;
@ -89,14 +91,16 @@ public class SystemConfigServiceImpl implements SystemConfigService {
}
@Override
public ServiceBody<UpperComputerInfoModel> getUpperComputerInfo(Integer requestId) {
String result = terminalPhotoDao.getRequestResult(requestId);
public ServiceBody<UpperComputerInfoModel> getUpperComputerInfo(TerminalUpperComputerVo vo) {
String result = terminalPhotoDao.getRequestResult(vo.getRequestId());
UpperComputerInfoModel model = new UpperComputerInfoModel();
if(StringUtils.isNotBlank(result)) {
JSONObject resultObj = JSONObject.parseObject(result);
model = JSONObject.parseObject(resultObj.get("groupData").toString(), UpperComputerInfoModel.class);
model.setIsNew(true);
}else{
UpperComputerInfoDto dto = systemConfigDao.getUpperComputerInfo(vo.getTermId());
BeanUtils.copyProperties(dto,model);
}
return Asserts.success(model);
}

@ -426,8 +426,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
String result = terminalPhotoDao.getRequestResult(vo.getRequestId());
TerminalPhotosParamsModel model = new TerminalPhotosParamsModel();
if (StringUtils.isNotBlank(result)) {
JSONObject resultObj = JSONObject.parseObject(result);
model = JSONObject.parseObject(resultObj.get("groupData").toString(), TerminalPhotosParamsModel.class);
model = JSONObject.parseObject(result, TerminalPhotosParamsModel.class);
model.setIsNew(true);
} else {
PhotoParamsDto dto = terminalPhotoDao.selectPhotoParams(vo);

@ -227,8 +227,7 @@ public class TerminalServiceImpl implements TerminalService {
String result = terminalPhotoDao.getRequestResult(vo.getRequestId());
TerminalModel model = new TerminalModel();
if (StringUtils.isNotBlank(result)) {
JSONObject resultObj = JSONObject.parseObject(result);
model = JSONObject.parseObject(resultObj.get("groupData").toString(), TerminalModel.class);
model = JSONObject.parseObject(result, TerminalModel.class);
model.setIsNew(true);
} else {
TerminalInfoDto dto = terminalsDao.getTerminalInfo(vo.getTermId());

@ -5,6 +5,7 @@ import com.shxy.xymanager_common.model.SystemConfigModel;
import com.shxy.xymanager_common.model.UpperComputerInfoModel;
import com.shxy.xymanager_common.vo.SystemConfigReqVo;
import com.shxy.xymanager_common.vo.SystemConfigVo;
import com.shxy.xymanager_common.vo.TerminalUpperComputerVo;
import org.springframework.web.multipart.MultipartFile;
/**
@ -39,6 +40,6 @@ public interface SystemConfigService {
*/
ServiceBody<Integer> upperComputerGet(String cmdId);
ServiceBody<UpperComputerInfoModel> getUpperComputerInfo(Integer requestId);
ServiceBody<UpperComputerInfoModel> getUpperComputerInfo(TerminalUpperComputerVo vo);
}

Loading…
Cancel
Save