diff --git a/xhpc-modules/pom.xml b/xhpc-modules/pom.xml index 5f53c21f..5d3cfe79 100644 --- a/xhpc-modules/pom.xml +++ b/xhpc-modules/pom.xml @@ -9,7 +9,10 @@ 4.0.0 + xhpc-common + xhpc-general xhpc-power-pile + xhpc-charging-station xhpc-user diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java index f37a2aa3..7a50284b 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java @@ -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> list = xhpcChargingStationService.wxList(name,serviceFacilities,code,longitude,latitude); + return getDataTable(list); + } + + } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/domain/XhpcChargingStation.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/domain/XhpcChargingStation.java index a0b346bb..4272b955 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/domain/XhpcChargingStation.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/domain/XhpcChargingStation.java @@ -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; + } + } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/domain/XhpcRate.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/domain/XhpcRate.java new file mode 100644 index 00000000..f42b0395 --- /dev/null +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/domain/XhpcRate.java @@ -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; + +} diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/dto/XhpcChargingStationDto.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/dto/XhpcChargingStationDto.java new file mode 100644 index 00000000..1cfab8a3 --- /dev/null +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/dto/XhpcChargingStationDto.java @@ -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 xhpcRateList; + + //费率时段 + List xhpcRateTimeList; + + public List getXhpcRateList() { + + return xhpcRateList; + } + + public void setXhpcRateList(List xhpcRateList) { + + this.xhpcRateList = xhpcRateList; + } + + public List getXhpcRateTimeList() { + + return xhpcRateTimeList; + } + + public void setXhpcRateTimeList(List xhpcRateTimeList) { + + this.xhpcRateTimeList = xhpcRateTimeList; + } + +} diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java index aad58189..95372111 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcChargingStationMapper.java @@ -87,4 +87,28 @@ public interface XhpcChargingStationMapper { * @return 电站 */ List> stationInternetBlackList(Long chargingStationId); + + /** + * 微信小程序电站列表 + * @param name 电站名称 + * @param serviceFacilities 标签集合(服务设施) + * @param code 城市id + * @param longitude 经度 + * @param latitude 维度 + * @param clientVisible 微信小程序是否可见 2可见 + * @return + */ + List> wxList(@Param("name") String name,@Param("serviceFacilities")List 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> getCode(@Param("code")String code,@Param("serviceFacilities")List serviceFacilities); + + } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcRateMapper.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcRateMapper.java new file mode 100644 index 00000000..de324bee --- /dev/null +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/mapper/XhpcRateMapper.java @@ -0,0 +1,10 @@ +package com.xhpc.charging.station.mapper; +/** + * 费率Mapper接口 + * + * @author yuyang + * @date 2021-07-19 + */ +public interface XhpcRateMapper { + +} diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java index 5ec9b9ed..f9722832 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java @@ -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> stationInternetBlackList(Long chargingStationId); + + /** + * 添加场点 + * @param xhpcChargingStationDto + * @return + */ + AjaxResult addXhpcChargingStation(XhpcChargingStationDto xhpcChargingStationDto); + + + + /** + * 微信小程序电站列表 + * @param name 电站名称 + * @param serviceFacilities 标签(服务设施) + * @param code 城市id + * @param longitude 经度 + * @param latitude 维度 + * @return + */ + public List> wxList(String name,String serviceFacilities,Integer code,String longitude,String latitude); + } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcRateService.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcRateService.java new file mode 100644 index 00000000..9748474b --- /dev/null +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcRateService.java @@ -0,0 +1,10 @@ +package com.xhpc.charging.station.service; +/** + * 费率Service接口 + * + * @author yuyang + * @date 2021-07-21 + */ +public interface IXhpcRateService { + +} diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java index d0e9ea65..ef55983b 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java @@ -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 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> wxList(String name, String serviceFacilities, Integer code, String longitude, String latitude) { + + List stringList =new ArrayList<>(); + if(serviceFacilities !=null && serviceFacilities !=""){ + String[] split = serviceFacilities.split(","); + stringList=Arrays.asList(split); + } + List> list = xhpcChargingStationMapper.wxList(name, stringList, code, longitude, latitude,2); + if(list !=null && list.size()>0){ + for (int i = 0; i < list.size(); i++) { + Map map = list.get(i); + Long chargingStationId = Long.valueOf(map.get("chargingStationId").toString()); + //获取该时段电费 + //HH:mm:ss + String tiem = DateUtil.formatTime(new Date()); + Map xhpcRateTime = xhpcRateTimeService.getXhpcRateTime(tiem, chargingStationId); + if(xhpcRateTime!=null){ + map.putAll(xhpcRateTime); + } + List serviceFacilitiesList =new ArrayList<>(); + if(map.get("serviceFacilities") !=null && map.get("serviceFacilities").toString() !=""){ + String[] split = map.get("serviceFacilities").toString().split(","); + serviceFacilitiesList=Arrays.asList(split); + } + //获取标签 + List> label_type = xhpcChargingStationMapper.getCode("label_type",serviceFacilitiesList); + map.put("serviceFacilities",label_type); + //桩(空闲和使用从redis获取) + + } + } + return list; + } + + } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcRateServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcRateServiceImpl.java new file mode 100644 index 00000000..8457ed33 --- /dev/null +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcRateServiceImpl.java @@ -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{ + +} diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml index 0d5e8da8..07d8171a 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml @@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -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" + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcRateMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcRateMapper.xml new file mode 100644 index 00000000..51ce7eda --- /dev/null +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcRateMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xhpc-modules/xhpc-common/pom.xml b/xhpc-modules/xhpc-common/pom.xml index 76166ff5..92e639e3 100644 --- a/xhpc-modules/xhpc-common/pom.xml +++ b/xhpc-modules/xhpc-common/pom.xml @@ -12,7 +12,7 @@ xhpc-common - 公共服务 + 公共复用代码 8 @@ -20,80 +20,10 @@ - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-discovery - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-config - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-sentinel - - - - - org.springframework.boot - spring-boot-starter-actuator - - - - - io.springfox - springfox-swagger-ui - ${swagger.fox.version} - - - - - mysql - mysql-connector-java - - - - - com.ruoyi - ruoyi-common-datasource - - - - - com.ruoyi - ruoyi-common-datascope - - - - - com.ruoyi - ruoyi-common-log - - - - - com.ruoyi - ruoyi-common-swagger - com.ruoyi ruoyi-common-core - - com.squareup.okhttp3 - okhttp - - - - cn.hutool - hutool-all - 5.7.5 - ${project.artifactId} @@ -112,4 +42,4 @@ - \ No newline at end of file + diff --git a/xhpc-modules/xhpc-common/src/main/resources/banner.txt b/xhpc-modules/xhpc-common/src/main/resources/banner.txt deleted file mode 100644 index 27cacb9c..00000000 --- a/xhpc-modules/xhpc-common/src/main/resources/banner.txt +++ /dev/null @@ -1,10 +0,0 @@ -Spring Boot Version: ${spring-boot.version} -Spring Application Name: ${spring.application.name} - _ __ _ _ - (_) / _|(_)| | - _ __ _ _ ___ _ _ _ ______ | |_ _ | | ___ -| '__|| | | | / _ \ | | | || ||______|| _|| || | / _ \ -| | | |_| || (_) || |_| || | | | | || || __/ -|_| \__,_| \___/ \__, ||_| |_| |_||_| \___| - __/ | - |___/ \ No newline at end of file diff --git a/xhpc-modules/xhpc-general/pom.xml b/xhpc-modules/xhpc-general/pom.xml new file mode 100644 index 00000000..737e8ac6 --- /dev/null +++ b/xhpc-modules/xhpc-general/pom.xml @@ -0,0 +1,132 @@ + + + + xhpc-modules + com.ruoyi + 3.0.0 + + 4.0.0 + + xhpc-general + + + 通用服务 + + + 8 + 8 + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.springframework.boot + spring-boot-starter-web + + + + + mysql + mysql-connector-java + + + + + com.ruoyi + ruoyi-common-datasource + + + + + com.ruoyi + ruoyi-common-datascope + + + + + com.ruoyi + ruoyi-common-log + + + + + com.ruoyi + ruoyi-common-swagger + + + com.ruoyi + ruoyi-common-core + + + com.squareup.okhttp3 + okhttp + + + + com.ruoyi + xhpc-common + 3.0.0 + compile + + + + cn.hutool + hutool-all + 5.7.5 + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + 2.4.0 + + + + repackage + + + + + + + + src/main/resources + + **/*.yml + **/*.xml + **/*.properties + + true + + + + diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/XhpcCommon.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/XhpcGeneralApplication.java similarity index 75% rename from xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/XhpcCommon.java rename to xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/XhpcGeneralApplication.java index cde83391..90b278a6 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/XhpcCommon.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/XhpcGeneralApplication.java @@ -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" + diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/controller/XhpcDictBizController.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcDictBizController.java similarity index 91% rename from xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/controller/XhpcDictBizController.java rename to xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcDictBizController.java index b3b7a579..398cd72c 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/controller/XhpcDictBizController.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/controller/XhpcDictBizController.java @@ -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; @@ -31,6 +31,6 @@ public class XhpcDictBizController extends BaseController { { return AjaxResult.success(xhpcDictBizService.getCode(code)); } - - + + } diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/mapper/XhpcDictBizMapper.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/mapper/XhpcDictBizMapper.java similarity index 86% rename from xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/mapper/XhpcDictBizMapper.java rename to xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/mapper/XhpcDictBizMapper.java index 09e55437..17562f19 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/mapper/XhpcDictBizMapper.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/mapper/XhpcDictBizMapper.java @@ -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接口 diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/service/IXhpcDictBizService.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/IXhpcDictBizService.java similarity index 86% rename from xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/service/IXhpcDictBizService.java rename to xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/IXhpcDictBizService.java index fdc74917..220d391e 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/service/IXhpcDictBizService.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/IXhpcDictBizService.java @@ -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接口 diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/service/XhpcDictBizServiceImpl.java b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcDictBizServiceImpl.java similarity index 83% rename from xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/service/XhpcDictBizServiceImpl.java rename to xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcDictBizServiceImpl.java index a6827633..d42b1d00 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/service/XhpcDictBizServiceImpl.java +++ b/xhpc-modules/xhpc-general/src/main/java/com/xhpc/general/service/XhpcDictBizServiceImpl.java @@ -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业务层处理 diff --git a/xhpc-modules/xhpc-general/src/main/resources/banner.txt b/xhpc-modules/xhpc-general/src/main/resources/banner.txt new file mode 100644 index 00000000..7dc07932 --- /dev/null +++ b/xhpc-modules/xhpc-general/src/main/resources/banner.txt @@ -0,0 +1,8 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} + _____ _ + / ____| | | + | | __ ___ _ __ ___ _ __ __ _ | | + | | |_ | / _ \ | '_ \ / _ \ | '__| / _` | | | + | |__| | | __/ | | | | | __/ | | | (_| | | | + \_____| \___| |_| |_| \___| |_| \__,_| |_| diff --git a/xhpc-modules/xhpc-common/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml similarity index 94% rename from xhpc-modules/xhpc-common/src/main/resources/bootstrap.yml rename to xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml index 7ef869c5..d1cc6f1e 100644 --- a/xhpc-modules/xhpc-common/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml @@ -3,10 +3,10 @@ server: port: 9802 # Spring -spring: +spring: application: # 应用名称 - name: xhpc-common + name: xhpc-general profiles: # 环境配置 active: dev diff --git a/xhpc-modules/xhpc-common/src/main/resources/logback.xml b/xhpc-modules/xhpc-general/src/main/resources/logback.xml similarity index 88% rename from xhpc-modules/xhpc-common/src/main/resources/logback.xml rename to xhpc-modules/xhpc-general/src/main/resources/logback.xml index 2795b2fe..09dad152 100644 --- a/xhpc-modules/xhpc-common/src/main/resources/logback.xml +++ b/xhpc-modules/xhpc-general/src/main/resources/logback.xml @@ -1,7 +1,7 @@ - + @@ -13,7 +13,7 @@ - + ${log.path}/info.log @@ -35,7 +35,7 @@ - + ${log.path}/error.log @@ -68,7 +68,7 @@ - - + + diff --git a/xhpc-modules/xhpc-common/src/main/resources/mapper/XhpcDictBizMapper.xml b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcDictBizMapper.xml similarity index 54% rename from xhpc-modules/xhpc-common/src/main/resources/mapper/XhpcDictBizMapper.xml rename to xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcDictBizMapper.xml index e9d519ff..3fc9c5a9 100644 --- a/xhpc-modules/xhpc-common/src/main/resources/mapper/XhpcDictBizMapper.xml +++ b/xhpc-modules/xhpc-general/src/main/resources/mapper/XhpcDictBizMapper.xml @@ -2,17 +2,17 @@ - - + + - - - - - - - - + + + + + + + + @@ -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 - \ No newline at end of file + diff --git a/xhpc-modules/xhpc-power-pile/pom.xml b/xhpc-modules/xhpc-power-pile/pom.xml index 65314660..721c542c 100644 --- a/xhpc-modules/xhpc-power-pile/pom.xml +++ b/xhpc-modules/xhpc-power-pile/pom.xml @@ -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"> - com.ruoyi xhpc-modules + com.ruoyi 3.0.0 4.0.0 @@ -76,9 +76,10 @@ - leaf-boot-starter - com.sankuai.inf.leaf - 1.0.1-RELEASE + com.ruoyi + xhpc-common + 3.0.0 + compile diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/RateModelRequestLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/RateModelRequestLogic.java index ac79d61b..282bced6 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/RateModelRequestLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/RateModelRequestLogic.java @@ -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); } - } diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/RealtimeDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/RealtimeDataLogic.java new file mode 100644 index 00000000..eecdd56e --- /dev/null +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/service/RealtimeDataLogic.java @@ -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 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 cacheGun = REDIS.getCacheMap(pileGun); + cacheGun.put("status", status); +// List realTimeDataList = (List) 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); + } + +} diff --git a/xhpc-modules/xhpc-power-pile/src/main/resources/svcmainlogic.xml b/xhpc-modules/xhpc-power-pile/src/main/resources/svcmainlogic.xml index 9aee48b3..4aefe650 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/resources/svcmainlogic.xml +++ b/xhpc-modules/xhpc-power-pile/src/main/resources/svcmainlogic.xml @@ -12,5 +12,6 @@ +