Commit 8668906d authored by duanruiming's avatar duanruiming

[add] 添加海信oracle数据库视图;海信路口信息、调度信息;

parent 77827f7f
......@@ -19,6 +19,11 @@
</properties>
<dependencies>
<dependency>
<groupId>oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
......
......@@ -13,7 +13,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
* @date 2023/05/08 13:37
*/
@SpringBootApplication(scanBasePackages = {"net.wanji.utc.hisense", "net.wanji.databus", "net.wanji.common"})
@MapperScan(basePackages = {"net.wanji.databus.dao.mapper"})
@MapperScan(basePackages = {"net.wanji.databus.dao.mapper", "net.wanji.utc.hisense.mapper"})
@EnableTransactionManagement
@EnableScheduling
@SuppressWarnings("all")
......
......@@ -9,10 +9,8 @@ import net.wanji.common.annotation.aspect.AspectLog;
import net.wanji.common.enums.BaseEnum;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.dao.entity.CrossSchedulesPO;
import net.wanji.databus.dto.CrossSchedulesDTO;
import net.wanji.databus.dto.CrossSchemeRingsDTO;
import net.wanji.databus.dto.PlanSectionDTO;
import net.wanji.databus.dto.SchemePhaseLightsDTO;
import net.wanji.databus.dto.*;
import net.wanji.databus.po.CrossInfoPO;
import net.wanji.databus.vo.PlanSectionVO;
import net.wanji.databus.vo.SchemePhaseLightsVO;
import net.wanji.utc.hisense.pojo.result.CoordinationStatus;
......@@ -39,6 +37,20 @@ public class StaticInfoController {
private final StaticInfoService staticInfoService;
@AspectLog(description = "根据厂商查询信号机信息", operationType = BaseEnum.OperationTypeEnum.QUERY)
@PostMapping(value = "/crossBasicInfo",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiOperation(value = "根据厂商查询信号机信息", notes = "根据厂商查询信号机信息",
response = SchemePhaseLightsVO.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = SchemePhaseLightsVO.class)
})
public JsonViewObject crossBasicInfo(@RequestBody @Validated CrossInfoDTO crossInfoDTO) throws Exception {
List<CrossInfoPO> result = staticInfoService.crossBasicInfo(crossInfoDTO);
return JsonViewObject.newInstance().success(result);
}
@AspectLog(description = "方案数据-方案信息、相位信息、灯组信息", operationType = BaseEnum.OperationTypeEnum.QUERY)
@PostMapping(value = "/schemePhaseLights",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
......
package net.wanji.utc.hisense.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wanji.utc.hisense.pojo.view.VIntersectionEntity;
/**
* @author duanruiming
* @date 2024/11/07 9:50
*/
@DS("oracle")
public interface VIntersectionMapper extends BaseMapper<VIntersectionEntity> {
}
package net.wanji.utc.hisense.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wanji.utc.hisense.pojo.view.VNtcipTimeBaseSchedule;
/**
* @author duanruiming
* @date 2024/11/07 11:23
*/
@DS("oracle")
public interface VNtcipTimeBaseScheduleMapper extends BaseMapper<VNtcipTimeBaseSchedule> {
}
package net.wanji.utc.hisense.pojo.view;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
* @author duanruiming
* @date 2024/11/07 9:52
* @description 海信路口信息视图
*/
@Data
@TableName("hicon.v_intersection")
public class VIntersectionEntity {
@TableField("CINTSID")
private String cIntsID;
@TableField("CINTSNAME")
private String cIntsName;
@TableField("CCONTROLLERMODEL")
private String cControllerModel;
@TableField("CPRODUCEFACTORY")
private String cProducefactory;
@TableField("CSERVICEDEPT")
private String cServicedept;
// ip
@TableField("CCONTROLLERIP")
private String CCONTROLLERIP;
@TableField("LONGITUDE")
private Double longitude;
@TableField("LATITUDE")
private Double latitude;
}
package net.wanji.utc.hisense.pojo.view;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
* @author duanruiming
* @date 2024/11/07 11:15
*/
@Data
@TableName("hicon.V_NTCIPTIMEBASESCHEDULE")
public class VNtcipTimeBaseSchedule {
@TableField("CINTSID")
private String cIntsID;
@TableField("NTIMEBASESCHEDULENUMBER")
private Integer nTimeBaseScheduleNumber;
@TableField("NTIMEBASESCHEDULEMONTH")
private Integer nTimeBaseScheduleMonth;
@TableField("NTIMEBASESCHEDULEDAY")
private Integer nTimeBaseScheduleDay;
@TableField("NTIMEBASESCHEDULEDATE")
private Integer nTimeBaseScheduleDate;
@TableField("NTIMEBASESCHEDULEDAYPLAN")
private Integer nTimeBaseScheduleDayPlan;
}
package net.wanji.utc.hisense.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.wanji.common.utils.tool.StringUtils;
......@@ -13,8 +14,12 @@ import net.wanji.databus.vo.PlanSectionVO;
import net.wanji.databus.vo.SchemePhaseLightsVO;
import net.wanji.utc.hisense.common.OperationBaseDom;
import net.wanji.utc.hisense.common.constants.HttpConstants;
import net.wanji.utc.hisense.mapper.VIntersectionMapper;
import net.wanji.utc.hisense.mapper.VNtcipTimeBaseScheduleMapper;
import net.wanji.utc.hisense.pojo.result.CoordinationStatus;
import net.wanji.utc.hisense.pojo.result.CrossSchemeRings;
import net.wanji.utc.hisense.pojo.view.VIntersectionEntity;
import net.wanji.utc.hisense.pojo.view.VNtcipTimeBaseSchedule;
import net.wanji.utc.hisense.service.StaticInfoService;
import net.wanji.utc.hisense.util.OkHttpClientUtil;
import org.dom4j.Document;
......@@ -23,10 +28,12 @@ import org.dom4j.Element;
import org.dom4j.Node;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* @author duanruiming
......@@ -41,9 +48,27 @@ public class StaticInfoServiceImpl implements StaticInfoService {
private String hisenseUrl;
@Resource
private CrossInfoMapper crossInfoMapper;
@Resource
private VIntersectionMapper vIntersectionMapper;
@Resource
private VNtcipTimeBaseScheduleMapper vNtcipTimeBaseScheduleMapper;
@Override
public List<CrossInfoPO> crossBasicInfo(CrossInfoDTO crossInfoDTO) throws Exception {
return null;
List<VIntersectionEntity> vIntersectionEntities = vIntersectionMapper.selectList(null);
List<CrossInfoPO> crossInfoPOS = new ArrayList<>();
for (VIntersectionEntity vIntersectionEntity : vIntersectionEntities) {
CrossInfoPO crossInfoPO = new CrossInfoPO();
crossInfoPO.setCode(vIntersectionEntity.getCIntsID());
crossInfoPO.setName(vIntersectionEntity.getCIntsName());
crossInfoPO.setIp(vIntersectionEntity.getCCONTROLLERIP());
String [] array = {String.valueOf(vIntersectionEntity.getLongitude()), String.valueOf(vIntersectionEntity.getLatitude())};
crossInfoPO.setLocation(StringUtils.join(array, ","));
crossInfoPO.setVersion(vIntersectionEntity.getCControllerModel());
crossInfoPO.setManufacturerId(22);
crossInfoPOS.add(crossInfoPO);
}
return crossInfoPOS;
}
@Override
......@@ -58,6 +83,33 @@ public class StaticInfoServiceImpl implements StaticInfoService {
@Override
public List<CrossSchedulesPO> crossSchedules(CrossSchedulesDTO crossSchedulesDTO) throws Exception {
String manufacturerCode = crossSchedulesDTO.getManufacturerCode();
List<String> crossIdList = crossSchedulesDTO.getCrossIdList();
if (!CollectionUtils.isEmpty(crossIdList)) {
List<CrossSchedulesPO> result = new ArrayList<>(crossIdList.size());
for (String crossId : crossIdList) {
LambdaQueryWrapper<VNtcipTimeBaseSchedule> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(VNtcipTimeBaseSchedule::getCIntsID, crossId);
List<VNtcipTimeBaseSchedule> vNtcipTimeBaseSchedules = vNtcipTimeBaseScheduleMapper.selectList(queryWrapper);
if (!CollectionUtils.isEmpty(vNtcipTimeBaseSchedules)) {
for (VNtcipTimeBaseSchedule vNtcipTimeBaseSchedule : vNtcipTimeBaseSchedules) {
if (Objects.nonNull(vNtcipTimeBaseSchedule)) {
CrossSchedulesPO crossSchedulesPO = new CrossSchedulesPO();
crossSchedulesPO.setCrossId(crossId);
crossSchedulesPO.setScheduleNo(vNtcipTimeBaseSchedule.getNTimeBaseScheduleNumber());
crossSchedulesPO.setName("海信调度" + vNtcipTimeBaseSchedule.getNTimeBaseScheduleNumber());
if (8190 == vNtcipTimeBaseSchedule.getNTimeBaseScheduleMonth()) {
Integer nTimeBaseScheduleDay = vNtcipTimeBaseSchedule.getNTimeBaseScheduleDay();
//crossSchedulesPO.setWeek();
}
}
}
}
}
}
return null;
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wanji.utc.hisense.mapper.VIntersectionMapper">
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wanji.utc.hisense.mapper.VNtcipTimeBaseScheduleMapper">
</mapper>
\ No newline at end of file
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