Merge remote-tracking branch 'origin/master'
# Conflicts: # xhpc-modules/xhpc-user/pom.xml
This commit is contained in:
commit
b1bc04129a
@ -9,7 +9,10 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<modules>
|
||||
<module>xhpc-common</module>
|
||||
<module>xhpc-general</module>
|
||||
<module>xhpc-power-pile</module>
|
||||
<module>xhpc-charging-station</module>
|
||||
<module>xhpc-user</module>
|
||||
</modules>
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
||||
import com.xhpc.charging.station.dto.XhpcChargingStationDto;
|
||||
import com.xhpc.charging.station.service.IXhpcChargingStationService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -138,4 +139,34 @@ public class XhpcChargingStationController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加场点
|
||||
* @param xhpcChargingStationDto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/addXhpcChargingStation")
|
||||
public AjaxResult addXhpcChargingStation(@Param("xhpcChargingStationDto") XhpcChargingStationDto xhpcChargingStationDto)
|
||||
{
|
||||
return xhpcChargingStationService.addXhpcChargingStation(xhpcChargingStationDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序电站列表
|
||||
* @param name 电站名称
|
||||
* @param serviceFacilities 标签(服务设施)
|
||||
* @param code 城市id
|
||||
* @param longitude 经度
|
||||
* @param latitude 维度
|
||||
* @return
|
||||
*/
|
||||
//@PreAuthorize(hasPermi = "system:station:list")
|
||||
@GetMapping("/wxList")
|
||||
public TableDataInfo wxList(String name,String serviceFacilities,Integer code,String longitude,String latitude)
|
||||
{
|
||||
startPage();
|
||||
List<Map<String,Object>> list = xhpcChargingStationService.wxList(name,serviceFacilities,code,longitude,latitude);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -84,6 +84,10 @@ public class XhpcChargingStation extends BaseEntity {
|
||||
@Excel(name = "当前计费模型id")
|
||||
private Long rateModelId;
|
||||
|
||||
/** 图片id */
|
||||
@Excel(name = "图片id")
|
||||
private String imgId;
|
||||
|
||||
public void setChargingStationId(Long chargingStationId)
|
||||
{
|
||||
this.chargingStationId = chargingStationId;
|
||||
@ -246,4 +250,15 @@ public class XhpcChargingStation extends BaseEntity {
|
||||
{
|
||||
return rateModelId;
|
||||
}
|
||||
|
||||
public String getImgId() {
|
||||
|
||||
return imgId;
|
||||
}
|
||||
|
||||
public void setImgId(String imgId) {
|
||||
|
||||
this.imgId = imgId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
package com.xhpc.charging.station.domain;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import org.apache.poi.hpsf.Decimal;
|
||||
|
||||
/**
|
||||
* 费率对象 xhpc_rate
|
||||
*
|
||||
* @author yuyang
|
||||
* @date 2021-07-21
|
||||
*/
|
||||
public class XhpcRate extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 费率id */
|
||||
private Long rateId;
|
||||
|
||||
/** 电站id */
|
||||
private Long chargingStationId;
|
||||
|
||||
/** 电费 */
|
||||
private Decimal powerFee;
|
||||
|
||||
/** 服务费 */
|
||||
private Decimal serviceFee;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
private Integer status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private Integer delFlag;
|
||||
|
||||
/** 费率模型id */
|
||||
private Long rateModelId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.xhpc.charging.station.dto;
|
||||
|
||||
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
||||
import com.xhpc.charging.station.domain.XhpcRate;
|
||||
import com.xhpc.charging.station.domain.XhpcRateTime;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class XhpcChargingStationDto extends XhpcChargingStation {
|
||||
|
||||
//费率
|
||||
List<XhpcRate> xhpcRateList;
|
||||
|
||||
//费率时段
|
||||
List<XhpcRateTime> xhpcRateTimeList;
|
||||
|
||||
public List<XhpcRate> getXhpcRateList() {
|
||||
|
||||
return xhpcRateList;
|
||||
}
|
||||
|
||||
public void setXhpcRateList(List<XhpcRate> xhpcRateList) {
|
||||
|
||||
this.xhpcRateList = xhpcRateList;
|
||||
}
|
||||
|
||||
public List<XhpcRateTime> getXhpcRateTimeList() {
|
||||
|
||||
return xhpcRateTimeList;
|
||||
}
|
||||
|
||||
public void setXhpcRateTimeList(List<XhpcRateTime> xhpcRateTimeList) {
|
||||
|
||||
this.xhpcRateTimeList = xhpcRateTimeList;
|
||||
}
|
||||
|
||||
}
|
||||
@ -87,4 +87,28 @@ public interface XhpcChargingStationMapper {
|
||||
* @return 电站
|
||||
*/
|
||||
List<Map<String,Object>> stationInternetBlackList(Long chargingStationId);
|
||||
|
||||
/**
|
||||
* 微信小程序电站列表
|
||||
* @param name 电站名称
|
||||
* @param serviceFacilities 标签集合(服务设施)
|
||||
* @param code 城市id
|
||||
* @param longitude 经度
|
||||
* @param latitude 维度
|
||||
* @param clientVisible 微信小程序是否可见 2可见
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> wxList(@Param("name") String name,@Param("serviceFacilities")List<String> serviceFacilities,@Param("code")Integer code,@Param("longitude")String longitude,@Param("latitude")String latitude,@Param("clientVisible")Integer clientVisible);
|
||||
|
||||
|
||||
/**
|
||||
* 根据code获取数据
|
||||
*
|
||||
* @param code 字典code
|
||||
* @param serviceFacilities 筛选条件
|
||||
* @return 电站
|
||||
*/
|
||||
List<Map<String,Object>> getCode(@Param("code")String code,@Param("serviceFacilities")List<String> serviceFacilities);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
package com.xhpc.charging.station.mapper;
|
||||
/**
|
||||
* 费率Mapper接口
|
||||
*
|
||||
* @author yuyang
|
||||
* @date 2021-07-19
|
||||
*/
|
||||
public interface XhpcRateMapper {
|
||||
|
||||
}
|
||||
@ -1,6 +1,8 @@
|
||||
package com.xhpc.charging.station.service;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
||||
import com.xhpc.charging.station.dto.XhpcChargingStationDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -88,4 +90,25 @@ public interface IXhpcChargingStationService {
|
||||
* @return 电站
|
||||
*/
|
||||
public List<Map<String,Object>> stationInternetBlackList(Long chargingStationId);
|
||||
|
||||
/**
|
||||
* 添加场点
|
||||
* @param xhpcChargingStationDto
|
||||
* @return
|
||||
*/
|
||||
AjaxResult addXhpcChargingStation(XhpcChargingStationDto xhpcChargingStationDto);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 微信小程序电站列表
|
||||
* @param name 电站名称
|
||||
* @param serviceFacilities 标签(服务设施)
|
||||
* @param code 城市id
|
||||
* @param longitude 经度
|
||||
* @param latitude 维度
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> wxList(String name,String serviceFacilities,Integer code,String longitude,String latitude);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
package com.xhpc.charging.station.service;
|
||||
/**
|
||||
* 费率Service接口
|
||||
*
|
||||
* @author yuyang
|
||||
* @date 2021-07-21
|
||||
*/
|
||||
public interface IXhpcRateService {
|
||||
|
||||
}
|
||||
@ -2,7 +2,10 @@ package com.xhpc.charging.station.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
||||
import com.xhpc.charging.station.domain.XhpcRateTime;
|
||||
import com.xhpc.charging.station.dto.XhpcChargingStationDto;
|
||||
import com.xhpc.charging.station.mapper.XhpcChargingStationMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -176,4 +179,76 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
return xhpcChargingStationMapper.stationInternetBlackList(chargingStationId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult addXhpcChargingStation(XhpcChargingStationDto xhpcChargingStationDto) {
|
||||
|
||||
//判断费率和费率时间段 是否有值
|
||||
if(xhpcChargingStationDto.getXhpcRateList() ==null && xhpcChargingStationDto.getXhpcRateList().size()==0){
|
||||
return AjaxResult.error(1001,"费率不能为空");
|
||||
}
|
||||
if(xhpcChargingStationDto.getXhpcRateTimeList() ==null && xhpcChargingStationDto.getXhpcRateTimeList().size()==0){
|
||||
return AjaxResult.error(1001,"费率时段不能为空");
|
||||
}
|
||||
List<XhpcRateTime> xhpcRateTimeList = xhpcChargingStationDto.getXhpcRateTimeList();
|
||||
|
||||
boolean s =false;
|
||||
for (int i = 0; i < xhpcRateTimeList.size(); i++) {
|
||||
XhpcRateTime xhpcRateTime = xhpcRateTimeList.get(i);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//判断开始时间是否有00:00
|
||||
|
||||
|
||||
|
||||
|
||||
//判断结束时间是否小于开始时间
|
||||
//检查格式是否正确
|
||||
//冒泡排序(结束时间小于开始时间)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> wxList(String name, String serviceFacilities, Integer code, String longitude, String latitude) {
|
||||
|
||||
List<String> stringList =new ArrayList<>();
|
||||
if(serviceFacilities !=null && serviceFacilities !=""){
|
||||
String[] split = serviceFacilities.split(",");
|
||||
stringList=Arrays.asList(split);
|
||||
}
|
||||
List<Map<String, Object>> list = xhpcChargingStationMapper.wxList(name, stringList, code, longitude, latitude,2);
|
||||
if(list !=null && list.size()>0){
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Map<String,Object> map = list.get(i);
|
||||
Long chargingStationId = Long.valueOf(map.get("chargingStationId").toString());
|
||||
//获取该时段电费
|
||||
//HH:mm:ss
|
||||
String tiem = DateUtil.formatTime(new Date());
|
||||
Map<String, Object> xhpcRateTime = xhpcRateTimeService.getXhpcRateTime(tiem, chargingStationId);
|
||||
if(xhpcRateTime!=null){
|
||||
map.putAll(xhpcRateTime);
|
||||
}
|
||||
List<String> serviceFacilitiesList =new ArrayList<>();
|
||||
if(map.get("serviceFacilities") !=null && map.get("serviceFacilities").toString() !=""){
|
||||
String[] split = map.get("serviceFacilities").toString().split(",");
|
||||
serviceFacilitiesList=Arrays.asList(split);
|
||||
}
|
||||
//获取标签
|
||||
List<Map<String, Object>> label_type = xhpcChargingStationMapper.getCode("label_type",serviceFacilitiesList);
|
||||
map.put("serviceFacilities",label_type);
|
||||
//桩(空闲和使用从redis获取)
|
||||
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
package com.xhpc.charging.station.service;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 费率Service业务层处理
|
||||
*
|
||||
* @author yuyang
|
||||
* @date 2021-07-21
|
||||
*/
|
||||
@Service
|
||||
public class XhpcRateServiceImpl implements IXhpcRateService{
|
||||
|
||||
}
|
||||
@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="rateModelId" column="rate_model_id" />
|
||||
<result property="imgId" column="img_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectXhpcChargingStationVo">
|
||||
@ -41,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
cs.name as name,
|
||||
ope.name as operatorName,
|
||||
cs.address as address,
|
||||
(select url from xhpc_img where charging_station_id = cs.charging_station_id limit 1) as url,
|
||||
(select url from xhpc_img where img_id = cs.img_id and del_flag =0 limit 1) as url,
|
||||
cs.client_visible as clientVisible,
|
||||
cs.status as status
|
||||
from xhpc_charging_station as cs
|
||||
@ -166,4 +167,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="stationInternetBlackList" resultType="map">
|
||||
select name from xhpc_internet_user where del_flag=0 and internet_user_id not in (select internet_user_id from xhpc_station_internet_blacklist where charging_station_id=#{chargingStationId})
|
||||
</select>
|
||||
|
||||
<select id="wxList" resultType="map">
|
||||
select
|
||||
charging_station_id as chargingStationId,
|
||||
name as name,
|
||||
parking_instructions as parkingInstructions,
|
||||
detailed_address as detailedAddress,
|
||||
service_facilities as serviceFacilities,
|
||||
ROUND(ACOS(SIN((#{latitude} * 3.141593) / 180 ) *SIN((latitude * 3.141593) / 180 ) +
|
||||
COS((#{latitude} * 3.141593) / 180 ) * COS((latitude * 3.141593) / 180 ) *
|
||||
COS((#{longitude} * 3.141593) / 180 - (longitude * 3.141593) / 180 ) ) * 6370.9968,4)AS distance
|
||||
from xhpc_charging_station
|
||||
where del_flag =0 and status =0
|
||||
and FIND_IN_SET(#{clientVisible},client_visible)>0
|
||||
<if test="name !=null and name !=''">
|
||||
and name like CONCAT('%',#{name},'%')
|
||||
</if>
|
||||
<if test="serviceFacilities !=null and serviceFacilities.size()>0 ">
|
||||
and
|
||||
<foreach collection="serviceFacilities" item="item" index="index" open="(" close=")" separator="or">
|
||||
service_facilities like CONCAT('%',#{item},'%')
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="code !=null and code !=''">
|
||||
and area_code=#{code}
|
||||
</if>
|
||||
ORDER BY distance asc
|
||||
</select>
|
||||
|
||||
<select id="getCode" resultType="map">
|
||||
select code, dict_key, dict_value
|
||||
from xhpc_dict_biz
|
||||
where code = #{code} and parent_id > 0 and del_flag = 0
|
||||
<if test="serviceFacilities !=null and serviceFacilities.size()>0 ">
|
||||
and
|
||||
<foreach collection="serviceFacilities" item="item" index="index" open="(" close=")" separator="or">
|
||||
dict_biz_id like CONCAT('%',#{item},'%')
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,22 @@
|
||||
<?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="com.xhpc.charging.station.mapper.XhpcRateMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xhpc.charging.station.domain.XhpcRate">
|
||||
<result property="rateId" column="rate_id" />
|
||||
<result property="chargingStationId" column="charging_station_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="powerFee" column="power_fee" />
|
||||
<result property="serviceFee" column="service_fee" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
@ -12,7 +12,7 @@
|
||||
<artifactId>xhpc-common</artifactId>
|
||||
|
||||
<description>
|
||||
公共服务
|
||||
公共复用代码
|
||||
</description>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
@ -20,80 +20,10 @@
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.7.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
||||
_ __ _ _
|
||||
(_) / _|(_)| |
|
||||
_ __ _ _ ___ _ _ _ ______ | |_ _ | | ___
|
||||
| '__|| | | | / _ \ | | | || ||______|| _|| || | / _ \
|
||||
| | | |_| || (_) || |_| || | | | | || || __/
|
||||
|_| \__,_| \___/ \__, ||_| |_| |_||_| \___|
|
||||
__/ |
|
||||
|___/
|
||||
132
xhpc-modules/xhpc-general/pom.xml
Normal file
132
xhpc-modules/xhpc-general/pom.xml
Normal file
@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>xhpc-modules</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>xhpc-general</artifactId>
|
||||
|
||||
<description>
|
||||
通用服务
|
||||
</description>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>xhpc-common</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.7.5</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.4.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.yml</include>
|
||||
<include>**/*.xml</include>
|
||||
<include>**/*.properties</include>
|
||||
</includes>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
@ -1,4 +1,4 @@
|
||||
package com.xhpc.common;
|
||||
package com.xhpc.general;
|
||||
|
||||
import com.ruoyi.common.security.annotation.EnableCustomConfig;
|
||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||
@ -11,13 +11,13 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.xhpc.common.mapper")
|
||||
public class XhpcCommon {
|
||||
@MapperScan("com.xhpc.general.mapper")
|
||||
public class XhpcGeneralApplication {
|
||||
|
||||
public static void main(String [] args){
|
||||
public static void main(String[] args) {
|
||||
|
||||
SpringApplication.run(XhpcCommon.class,args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 公共模块模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
SpringApplication.run(XhpcGeneralApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 通用模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
@ -1,8 +1,8 @@
|
||||
package com.xhpc.common.controller;
|
||||
package com.xhpc.general.controller;
|
||||
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.service.IXhpcDictBizService;
|
||||
import com.xhpc.general.service.IXhpcDictBizService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -1,9 +1,8 @@
|
||||
package com.xhpc.common.mapper;
|
||||
package com.xhpc.general.mapper;
|
||||
|
||||
import com.xhpc.common.domain.XhpcDictBiz;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 业务字典Mapper接口
|
||||
@ -1,9 +1,8 @@
|
||||
package com.xhpc.common.service;
|
||||
package com.xhpc.general.service;
|
||||
|
||||
import com.xhpc.common.domain.XhpcDictBiz;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 业务字典Service接口
|
||||
@ -1,12 +1,11 @@
|
||||
package com.xhpc.common.service;
|
||||
package com.xhpc.general.service;
|
||||
|
||||
import com.xhpc.common.domain.XhpcDictBiz;
|
||||
import com.xhpc.common.mapper.XhpcDictBizMapper;
|
||||
import com.xhpc.general.mapper.XhpcDictBizMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 业务字典Service业务层处理
|
||||
8
xhpc-modules/xhpc-general/src/main/resources/banner.txt
Normal file
8
xhpc-modules/xhpc-general/src/main/resources/banner.txt
Normal file
@ -0,0 +1,8 @@
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
||||
_____ _
|
||||
/ ____| | |
|
||||
| | __ ___ _ __ ___ _ __ __ _ | |
|
||||
| | |_ | / _ \ | '_ \ / _ \ | '__| / _` | | |
|
||||
| |__| | | __/ | | | | | __/ | | | (_| | | |
|
||||
\_____| \___| |_| |_| \___| |_| \__,_| |_|
|
||||
@ -6,7 +6,7 @@ server:
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: xhpc-common
|
||||
name: xhpc-general
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/xphc-charging-station"/>
|
||||
<property name="log.path" value="logs/xphc-general"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<appender name="general_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
@ -35,7 +35,7 @@
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<appender name="general_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
@ -68,7 +68,7 @@
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
<appender-ref ref="general_info"/>
|
||||
<appender-ref ref="general_error"/>
|
||||
</root>
|
||||
</configuration>
|
||||
@ -2,17 +2,17 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xhpc.common.mapper.XhpcDictBizMapper">
|
||||
<mapper namespace="com.xhpc.general.mapper.XhpcDictBizMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xhpc.common.domain.XhpcDictBiz">
|
||||
<result property="dictBizId" column="dict_biz_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="code" column="code" />
|
||||
<result property="dictKey" column="dict_key" />
|
||||
<result property="dictValue" column="dict_value" />
|
||||
<result property="sort" column="sort" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="dictBizId" column="dict_biz_id"/>
|
||||
<result property="parentId" column="parent_id"/>
|
||||
<result property="code" column="code"/>
|
||||
<result property="dictKey" column="dict_key"/>
|
||||
<result property="dictValue" column="dict_value"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
@ -3,8 +3,8 @@
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>xhpc-modules</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@ -76,9 +76,10 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>leaf-boot-starter</artifactId>
|
||||
<groupId>com.sankuai.inf.leaf</groupId>
|
||||
<version>1.0.1-RELEASE</version>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>xhpc-common</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@ -31,8 +31,9 @@ public class RateModelRequestLogic implements ServiceLogic {
|
||||
Object cacheStation = stations.get(stationId); //todo
|
||||
String resultCode = ServiceResult.OK;
|
||||
String hexCode = ServiceResult.HEX_OK;
|
||||
|
||||
// Integer rateModelIdCache = cacheStation.get("rateModelId");
|
||||
// Object rateModelId = station.getRateModelId() ;
|
||||
// Object rateModelId = station.getRateModelId();
|
||||
// if (rateModelId==null) {
|
||||
// hexCode = ServiceResult.HEX_FAIL;
|
||||
// resultCode = ServiceResult.FAIL;
|
||||
@ -44,5 +45,4 @@ public class RateModelRequestLogic implements ServiceLogic {
|
||||
resultStr = resultStr.concat(CRCCalculator.calcCrc(resultStr));
|
||||
return new ServiceResult(HexUtils.toBytes(resultStr), resultCode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
package com.xhpc.pp.service;
|
||||
|
||||
//import com.xhpc.common.domain.XhpcChargeOrderStatus;
|
||||
|
||||
import com.xhpc.pp.tx.ServiceParameter;
|
||||
import com.xhpc.pp.tx.ServiceResult;
|
||||
import com.xhpc.pp.tx.logic.ServiceLogic;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static com.xhpc.pp.server.ChargingPileServer.REDIS;
|
||||
|
||||
@Lazy
|
||||
@Component("RealtimeDataLogic")
|
||||
public class RealtimeDataLogic implements ServiceLogic {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(RealtimeDataLogic.class);
|
||||
|
||||
@Override
|
||||
public ServiceResult service(ServiceParameter sp) throws Exception {
|
||||
|
||||
Map<String, Object> req = sp.getParameters();
|
||||
String pileNo = (String) req.get("pileNo");
|
||||
String gunId = (String) req.get("gunId");
|
||||
String status = (String) req.get("status");
|
||||
String pileGun = pileNo.concat(gunId);
|
||||
Map<String, Object> cacheGun = REDIS.getCacheMap(pileGun);
|
||||
cacheGun.put("status", status);
|
||||
// List<XhpcChargeOrderStatus> realTimeDataList = (List<XhpcChargeOrderStatus>) cacheGun.get("realTimeData");
|
||||
// XhpcChargeOrderStatus newData = new XhpcChargeOrderStatus();
|
||||
// newData.setStatus(Integer.parseInt(status));
|
||||
// if(realTimeDataList==null) realTimeDataList = new ArrayList<>();
|
||||
// realTimeDataList.add(newData);
|
||||
// cacheGun.put("realTimeData", realTimeDataList);
|
||||
REDIS.setCacheMap(pileGun, cacheGun);
|
||||
return new ServiceResult(false);
|
||||
}
|
||||
|
||||
}
|
||||
@ -12,5 +12,6 @@
|
||||
<entry key="03" value-ref="HBLogic"/>
|
||||
<entry key="05" value-ref="RateModelValidateLogic"/>
|
||||
<entry key="09" value-ref="RateModelRequestLogic"/>
|
||||
<entry key="13" value-ref="RealtimeDataLogic"/>
|
||||
</util:map>
|
||||
</beans>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user