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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
<module>xhpc-common</module>
|
||||||
|
<module>xhpc-general</module>
|
||||||
<module>xhpc-power-pile</module>
|
<module>xhpc-power-pile</module>
|
||||||
|
<module>xhpc-charging-station</module>
|
||||||
<module>xhpc-user</module>
|
<module>xhpc-user</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import com.ruoyi.common.log.annotation.Log;
|
|||||||
import com.ruoyi.common.log.enums.BusinessType;
|
import com.ruoyi.common.log.enums.BusinessType;
|
||||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||||
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
||||||
|
import com.xhpc.charging.station.dto.XhpcChargingStationDto;
|
||||||
import com.xhpc.charging.station.service.IXhpcChargingStationService;
|
import com.xhpc.charging.station.service.IXhpcChargingStationService;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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")
|
@Excel(name = "当前计费模型id")
|
||||||
private Long rateModelId;
|
private Long rateModelId;
|
||||||
|
|
||||||
|
/** 图片id */
|
||||||
|
@Excel(name = "图片id")
|
||||||
|
private String imgId;
|
||||||
|
|
||||||
public void setChargingStationId(Long chargingStationId)
|
public void setChargingStationId(Long chargingStationId)
|
||||||
{
|
{
|
||||||
this.chargingStationId = chargingStationId;
|
this.chargingStationId = chargingStationId;
|
||||||
@ -246,4 +250,15 @@ public class XhpcChargingStation extends BaseEntity {
|
|||||||
{
|
{
|
||||||
return rateModelId;
|
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 电站
|
* @return 电站
|
||||||
*/
|
*/
|
||||||
List<Map<String,Object>> stationInternetBlackList(Long chargingStationId);
|
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;
|
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.domain.XhpcChargingStation;
|
||||||
|
import com.xhpc.charging.station.dto.XhpcChargingStationDto;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -88,4 +90,25 @@ public interface IXhpcChargingStationService {
|
|||||||
* @return 电站
|
* @return 电站
|
||||||
*/
|
*/
|
||||||
public List<Map<String,Object>> stationInternetBlackList(Long chargingStationId);
|
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 cn.hutool.core.date.DateUtil;
|
||||||
import com.ruoyi.common.core.utils.DateUtils;
|
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.XhpcChargingStation;
|
||||||
|
import com.xhpc.charging.station.domain.XhpcRateTime;
|
||||||
|
import com.xhpc.charging.station.dto.XhpcChargingStationDto;
|
||||||
import com.xhpc.charging.station.mapper.XhpcChargingStationMapper;
|
import com.xhpc.charging.station.mapper.XhpcChargingStationMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -176,4 +179,76 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
|||||||
return xhpcChargingStationMapper.stationInternetBlackList(chargingStationId);
|
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="updateBy" column="update_by" />
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
<result property="rateModelId" column="rate_model_id" />
|
<result property="rateModelId" column="rate_model_id" />
|
||||||
|
<result property="imgId" column="img_id" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectXhpcChargingStationVo">
|
<sql id="selectXhpcChargingStationVo">
|
||||||
@ -41,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
cs.name as name,
|
cs.name as name,
|
||||||
ope.name as operatorName,
|
ope.name as operatorName,
|
||||||
cs.address as address,
|
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.client_visible as clientVisible,
|
||||||
cs.status as status
|
cs.status as status
|
||||||
from xhpc_charging_station as cs
|
from xhpc_charging_station as cs
|
||||||
@ -166,4 +167,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="stationInternetBlackList" resultType="map">
|
<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 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>
|
||||||
|
|
||||||
|
<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>
|
</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>
|
<artifactId>xhpc-common</artifactId>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
公共服务
|
公共复用代码
|
||||||
</description>
|
</description>
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
@ -20,80 +20,10 @@
|
|||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<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>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-core</artifactId>
|
<artifactId>ruoyi-common-core</artifactId>
|
||||||
</dependency>
|
</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>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
@ -112,4 +42,4 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -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.EnableCustomConfig;
|
||||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||||
@ -11,13 +11,13 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||||||
@EnableCustomSwagger2
|
@EnableCustomSwagger2
|
||||||
@EnableRyFeignClients
|
@EnableRyFeignClients
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@MapperScan("com.xhpc.common.mapper")
|
@MapperScan("com.xhpc.general.mapper")
|
||||||
public class XhpcCommon {
|
public class XhpcGeneralApplication {
|
||||||
|
|
||||||
public static void main(String [] args){
|
public static void main(String[] args) {
|
||||||
|
|
||||||
SpringApplication.run(XhpcCommon.class,args);
|
SpringApplication.run(XhpcGeneralApplication.class, args);
|
||||||
System.out.println("(♥◠‿◠)ノ゙ 公共模块模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
System.out.println("(♥◠‿◠)ノ゙ 通用模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||||
" .-------. ____ __ \n" +
|
" .-------. ____ __ \n" +
|
||||||
" | _ _ \\ \\ \\ / / \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.controller.BaseController;
|
||||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
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.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -31,6 +31,6 @@ public class XhpcDictBizController extends BaseController {
|
|||||||
{
|
{
|
||||||
return AjaxResult.success(xhpcDictBizService.getCode(code));
|
return AjaxResult.success(xhpcDictBizService.getCode(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,9 +1,8 @@
|
|||||||
package com.xhpc.common.mapper;
|
package com.xhpc.general.mapper;
|
||||||
|
|
||||||
import com.xhpc.common.domain.XhpcDictBiz;
|
import com.xhpc.common.domain.XhpcDictBiz;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务字典Mapper接口
|
* 业务字典Mapper接口
|
||||||
@ -1,9 +1,8 @@
|
|||||||
package com.xhpc.common.service;
|
package com.xhpc.general.service;
|
||||||
|
|
||||||
import com.xhpc.common.domain.XhpcDictBiz;
|
import com.xhpc.common.domain.XhpcDictBiz;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务字典Service接口
|
* 业务字典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.domain.XhpcDictBiz;
|
||||||
import com.xhpc.common.mapper.XhpcDictBizMapper;
|
import com.xhpc.general.mapper.XhpcDictBizMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务字典Service业务层处理
|
* 业务字典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}
|
||||||
|
_____ _
|
||||||
|
/ ____| | |
|
||||||
|
| | __ ___ _ __ ___ _ __ __ _ | |
|
||||||
|
| | |_ | / _ \ | '_ \ / _ \ | '__| / _` | | |
|
||||||
|
| |__| | | __/ | | | | | __/ | | | (_| | | |
|
||||||
|
\_____| \___| |_| |_| \___| |_| \__,_| |_|
|
||||||
@ -3,10 +3,10 @@ server:
|
|||||||
port: 9802
|
port: 9802
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: xhpc-common
|
name: xhpc-general
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
<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"/>
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
</appender>
|
</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>
|
<file>${log.path}/info.log</file>
|
||||||
<!-- 循环政策:基于时间创建日志文件 -->
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
@ -35,7 +35,7 @@
|
|||||||
</filter>
|
</filter>
|
||||||
</appender>
|
</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>
|
<file>${log.path}/error.log</file>
|
||||||
<!-- 循环政策:基于时间创建日志文件 -->
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
<!--系统操作日志-->
|
<!--系统操作日志-->
|
||||||
<root level="info">
|
<root level="info">
|
||||||
<appender-ref ref="file_info"/>
|
<appender-ref ref="general_info"/>
|
||||||
<appender-ref ref="file_error"/>
|
<appender-ref ref="general_error"/>
|
||||||
</root>
|
</root>
|
||||||
</configuration>
|
</configuration>
|
||||||
@ -2,17 +2,17 @@
|
|||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"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">
|
<resultMap id="BaseResultMap" type="com.xhpc.common.domain.XhpcDictBiz">
|
||||||
<result property="dictBizId" column="dict_biz_id" />
|
<result property="dictBizId" column="dict_biz_id"/>
|
||||||
<result property="parentId" column="parent_id" />
|
<result property="parentId" column="parent_id"/>
|
||||||
<result property="code" column="code" />
|
<result property="code" column="code"/>
|
||||||
<result property="dictKey" column="dict_key" />
|
<result property="dictKey" column="dict_key"/>
|
||||||
<result property="dictValue" column="dict_value" />
|
<result property="dictValue" column="dict_value"/>
|
||||||
<result property="sort" column="sort" />
|
<result property="sort" column="sort"/>
|
||||||
<result property="delFlag" column="del_flag" />
|
<result property="delFlag" column="del_flag"/>
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time"/>
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
@ -24,4 +24,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
select code, dict_key, dict_value, sort, remark from xhpc_dict_biz where code = #{code} and parent_id > 0 and del_flag = 0
|
select code, dict_key, dict_value, sort, remark from xhpc_dict_biz where code = #{code} and parent_id > 0 and del_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -3,8 +3,8 @@
|
|||||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
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">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
|
||||||
<artifactId>xhpc-modules</artifactId>
|
<artifactId>xhpc-modules</artifactId>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
<version>3.0.0</version>
|
<version>3.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
@ -76,9 +76,10 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<artifactId>leaf-boot-starter</artifactId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<groupId>com.sankuai.inf.leaf</groupId>
|
<artifactId>xhpc-common</artifactId>
|
||||||
<version>1.0.1-RELEASE</version>
|
<version>3.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@ -31,8 +31,9 @@ public class RateModelRequestLogic implements ServiceLogic {
|
|||||||
Object cacheStation = stations.get(stationId); //todo
|
Object cacheStation = stations.get(stationId); //todo
|
||||||
String resultCode = ServiceResult.OK;
|
String resultCode = ServiceResult.OK;
|
||||||
String hexCode = ServiceResult.HEX_OK;
|
String hexCode = ServiceResult.HEX_OK;
|
||||||
|
|
||||||
// Integer rateModelIdCache = cacheStation.get("rateModelId");
|
// Integer rateModelIdCache = cacheStation.get("rateModelId");
|
||||||
// Object rateModelId = station.getRateModelId() ;
|
// Object rateModelId = station.getRateModelId();
|
||||||
// if (rateModelId==null) {
|
// if (rateModelId==null) {
|
||||||
// hexCode = ServiceResult.HEX_FAIL;
|
// hexCode = ServiceResult.HEX_FAIL;
|
||||||
// resultCode = ServiceResult.FAIL;
|
// resultCode = ServiceResult.FAIL;
|
||||||
@ -44,5 +45,4 @@ public class RateModelRequestLogic implements ServiceLogic {
|
|||||||
resultStr = resultStr.concat(CRCCalculator.calcCrc(resultStr));
|
resultStr = resultStr.concat(CRCCalculator.calcCrc(resultStr));
|
||||||
return new ServiceResult(HexUtils.toBytes(resultStr), resultCode);
|
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="03" value-ref="HBLogic"/>
|
||||||
<entry key="05" value-ref="RateModelValidateLogic"/>
|
<entry key="05" value-ref="RateModelValidateLogic"/>
|
||||||
<entry key="09" value-ref="RateModelRequestLogic"/>
|
<entry key="09" value-ref="RateModelRequestLogic"/>
|
||||||
|
<entry key="13" value-ref="RealtimeDataLogic"/>
|
||||||
</util:map>
|
</util:map>
|
||||||
</beans>
|
</beans>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user