From 8d093226fde9d24b1105644801146c17497793bd Mon Sep 17 00:00:00 2001 From: Lemon Date: Tue, 6 Jun 2023 08:57:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=20=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E3=80=81=E7=AC=AC=E4=B8=89=E6=96=B9=E6=8E=A8=E9=80=81=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E9=85=8D=E7=BD=AE=E5=AF=B9=E5=BA=94=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ConfirmStartChargingRequestHandler.java | 7 ++ .../pile/domain/StationSettingRelation.java | 84 ++++++++++++++ .../mapper/StationSettingRelationMapper.java | 71 ++++++++++++ .../IStationSettingRelationService.java | 68 +++++++++++ .../StationSettingRelationServiceImpl.java | 100 +++++++++++++++++ .../vo/base/StationSettingRelationVO.java | 23 ++++ .../pile/StationSettingRelationMapper.xml | 106 ++++++++++++++++++ 7 files changed, 459 insertions(+) create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/domain/StationSettingRelation.java create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/mapper/StationSettingRelationMapper.java create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/service/IStationSettingRelationService.java create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/service/impl/StationSettingRelationServiceImpl.java create mode 100644 jsowell-pile/src/main/java/com/jsowell/pile/vo/base/StationSettingRelationVO.java create mode 100644 jsowell-pile/src/main/resources/mapper/pile/StationSettingRelationMapper.xml diff --git a/jsowell-netty/src/main/java/com/jsowell/netty/handler/ConfirmStartChargingRequestHandler.java b/jsowell-netty/src/main/java/com/jsowell/netty/handler/ConfirmStartChargingRequestHandler.java index 72be931d8..f1e0cb6b0 100644 --- a/jsowell-netty/src/main/java/com/jsowell/netty/handler/ConfirmStartChargingRequestHandler.java +++ b/jsowell-netty/src/main/java/com/jsowell/netty/handler/ConfirmStartChargingRequestHandler.java @@ -98,6 +98,9 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{ length = 17; byte[] vinCodeByteArr = BytesUtil.copyBytes(msgBody, startIndex, length); + /** + * 刷卡启动充电 + */ String logicCard = ""; byte[] authenticationFlagByteArr = Constants.zeroByteArray; byte[] accountBalanceByteArr = Constants.zeroByteArray; @@ -138,6 +141,10 @@ public class ConfirmStartChargingRequestHandler extends AbstractHandler{ log.error("刷卡启动充电鉴权 error", e); } + /** + * TODO VIN码启动充电 + */ + // 应答 // 交易流水号 // String transactionCode = IdUtils.generateTransactionCode(pileSn, connectorCode); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/StationSettingRelation.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/StationSettingRelation.java new file mode 100644 index 000000000..0908bc2cf --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/StationSettingRelation.java @@ -0,0 +1,84 @@ +package com.jsowell.pile.domain; + +import com.jsowell.common.annotation.Excel; +import com.jsowell.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 站点、第三方推送平台配置对应对象 station_setting_relation + * + * @author jsowell + * @date 2023-06-06 + */ +public class StationSettingRelation extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + + /** + * 站点id + */ + @Excel(name = "站点id") + private Long stationId; + + /** + * 三方配置类型 + */ + @Excel(name = "三方配置类型") + private String thirdPartyType; + + /** + * 删除标识 + */ + private String delFlag; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setStationId(Long stationId) { + this.stationId = stationId; + } + + public Long getStationId() { + return stationId; + } + + public void setThirdPartyType(String thirdPartyType) { + this.thirdPartyType = thirdPartyType; + } + + public String getThirdPartyType() { + return thirdPartyType; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDelFlag() { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.JSON_STYLE) + .append("id", getId()) + .append("stationId", getStationId()) + .append("thirdPartyType", getThirdPartyType()) + .append("createTime", getCreateTime()) + .append("createBy", getCreateBy()) + .append("updateTime", getUpdateTime()) + .append("updateBy", getUpdateBy()) + .append("delFlag", getDelFlag()) + .toString(); + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/StationSettingRelationMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/StationSettingRelationMapper.java new file mode 100644 index 000000000..172248bb3 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/StationSettingRelationMapper.java @@ -0,0 +1,71 @@ +package com.jsowell.pile.mapper; + +import java.util.List; + +import com.jsowell.pile.domain.StationSettingRelation; +import com.jsowell.pile.vo.base.StationSettingRelationVO; +import org.springframework.stereotype.Component; + +/** + * 站点、第三方推送平台配置对应Mapper接口 + * + * @author jsowell + * @date 2023-06-06 + */ +@Component +public interface StationSettingRelationMapper { + /** + * 查询站点、第三方推送平台配置对应 + * + * @param id 站点、第三方推送平台配置对应主键 + * @return 站点、第三方推送平台配置对应 + */ + public StationSettingRelation selectStationSettingRelationById(Long id); + + /** + * 查询站点、第三方推送平台配置对应列表 + * + * @param stationSettingRelation 站点、第三方推送平台配置对应 + * @return 站点、第三方推送平台配置对应集合 + */ + public List selectStationSettingRelationList(StationSettingRelation stationSettingRelation); + + /** + * 查询站点、第三方推送平台配置 + * @param stationSettingRelation + * @return + */ + StationSettingRelationVO selectRelationInfo(StationSettingRelation stationSettingRelation); + + /** + * 新增站点、第三方推送平台配置对应 + * + * @param stationSettingRelation 站点、第三方推送平台配置对应 + * @return 结果 + */ + public int insertStationSettingRelation(StationSettingRelation stationSettingRelation); + + /** + * 修改站点、第三方推送平台配置对应 + * + * @param stationSettingRelation 站点、第三方推送平台配置对应 + * @return 结果 + */ + public int updateStationSettingRelation(StationSettingRelation stationSettingRelation); + + /** + * 删除站点、第三方推送平台配置对应 + * + * @param id 站点、第三方推送平台配置对应主键 + * @return 结果 + */ + public int deleteStationSettingRelationById(Long id); + + /** + * 批量删除站点、第三方推送平台配置对应 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteStationSettingRelationByIds(Long[] ids); +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/IStationSettingRelationService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/IStationSettingRelationService.java new file mode 100644 index 000000000..be1bae0db --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/IStationSettingRelationService.java @@ -0,0 +1,68 @@ +package com.jsowell.pile.service; + +import java.util.List; + +import com.jsowell.pile.domain.StationSettingRelation; + +/** + * 站点、第三方推送平台配置对应Service接口 + * + * @author jsowell + * @date 2023-06-06 + */ +public interface IStationSettingRelationService { + /** + * 查询站点、第三方推送平台配置对应 + * + * @param id 站点、第三方推送平台配置对应主键 + * @return 站点、第三方推送平台配置对应 + */ + public StationSettingRelation selectStationSettingRelationById(Long id); + + /** + * 查询站点、第三方推送平台配置对应列表 + * + * @param stationSettingRelation 站点、第三方推送平台配置对应 + * @return 站点、第三方推送平台配置对应集合 + */ + public List selectStationSettingRelationList(StationSettingRelation stationSettingRelation); + + /** + * 查询站点、第三方推送平台配置 + * @param stationSettingRelation + * @return + */ + StationSettingRelation selectRelationInfo(StationSettingRelation stationSettingRelation); + + /** + * 新增站点、第三方推送平台配置对应 + * + * @param stationSettingRelation 站点、第三方推送平台配置对应 + * @return 结果 + */ + public int insertStationSettingRelation(StationSettingRelation stationSettingRelation); + + /** + * 修改站点、第三方推送平台配置对应 + * + * @param stationSettingRelation 站点、第三方推送平台配置对应 + * @return 结果 + */ + public int updateStationSettingRelation(StationSettingRelation stationSettingRelation); + + /** + * 批量删除站点、第三方推送平台配置对应 + * + * @param ids 需要删除的站点、第三方推送平台配置对应主键集合 + * @return 结果 + */ + public int deleteStationSettingRelationByIds(Long[] ids); + + /** + * 删除站点、第三方推送平台配置对应信息 + * + * @param id 站点、第三方推送平台配置对应主键 + * @return 结果 + */ + public int deleteStationSettingRelationById(Long id); +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/StationSettingRelationServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/StationSettingRelationServiceImpl.java new file mode 100644 index 000000000..357618dd7 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/StationSettingRelationServiceImpl.java @@ -0,0 +1,100 @@ +package com.jsowell.pile.service.impl; + +import java.util.List; + +import com.jsowell.common.util.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.jsowell.pile.mapper.StationSettingRelationMapper; +import com.jsowell.pile.domain.StationSettingRelation; +import com.jsowell.pile.service.IStationSettingRelationService; + +/** + * 站点、第三方推送平台配置对应Service业务层处理 + * + * @author jsowell + * @date 2023-06-06 + */ +@Service +public class StationSettingRelationServiceImpl implements IStationSettingRelationService { + @Autowired + private StationSettingRelationMapper stationSettingRelationMapper; + + /** + * 查询站点、第三方推送平台配置对应 + * + * @param id 站点、第三方推送平台配置对应主键 + * @return 站点、第三方推送平台配置对应 + */ + @Override + public StationSettingRelation selectStationSettingRelationById(Long id) { + return stationSettingRelationMapper.selectStationSettingRelationById(id); + } + + /** + * 查询站点、第三方推送平台配置对应列表 + * + * @param stationSettingRelation 站点、第三方推送平台配置对应 + * @return 站点、第三方推送平台配置对应 + */ + @Override + public List selectStationSettingRelationList(StationSettingRelation stationSettingRelation) { + return stationSettingRelationMapper.selectStationSettingRelationList(stationSettingRelation); + } + + /** + * 查询站点、第三方推送平台配置 + * @param stationSettingRelation + * @return + */ + @Override + public StationSettingRelation selectRelationInfo(StationSettingRelation stationSettingRelation) { + return stationSettingRelationMapper.selectRelationInfo(stationSettingRelation); + } + + /** + * 新增站点、第三方推送平台配置对应 + * + * @param stationSettingRelation 站点、第三方推送平台配置对应 + * @return 结果 + */ + @Override + public int insertStationSettingRelation(StationSettingRelation stationSettingRelation) { + stationSettingRelation.setCreateTime(DateUtils.getNowDate()); + return stationSettingRelationMapper.insertStationSettingRelation(stationSettingRelation); + } + + /** + * 修改站点、第三方推送平台配置对应 + * + * @param stationSettingRelation 站点、第三方推送平台配置对应 + * @return 结果 + */ + @Override + public int updateStationSettingRelation(StationSettingRelation stationSettingRelation) { + stationSettingRelation.setUpdateTime(DateUtils.getNowDate()); + return stationSettingRelationMapper.updateStationSettingRelation(stationSettingRelation); + } + + /** + * 批量删除站点、第三方推送平台配置对应 + * + * @param ids 需要删除的站点、第三方推送平台配置对应主键 + * @return 结果 + */ + @Override + public int deleteStationSettingRelationByIds(Long[] ids) { + return stationSettingRelationMapper.deleteStationSettingRelationByIds(ids); + } + + /** + * 删除站点、第三方推送平台配置对应信息 + * + * @param id 站点、第三方推送平台配置对应主键 + * @return 结果 + */ + @Override + public int deleteStationSettingRelationById(Long id) { + return stationSettingRelationMapper.deleteStationSettingRelationById(id); + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/StationSettingRelationVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/StationSettingRelationVO.java new file mode 100644 index 000000000..baae4898f --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/StationSettingRelationVO.java @@ -0,0 +1,23 @@ +package com.jsowell.pile.vo.base; + +import lombok.Data; + +/** + * 站点、配置信息VO + * + * @author JS-ZZA + * @date 2023/6/6 8:48 + */ +@Data +public class StationSettingRelationVO { + private String stationId; + + private String thirdPartyType; + + private String urlAddress; + private String operatorId; + private String operatorSecret; + private String signSecret; + private String dataSecret; + private String dataSecretIv; +} diff --git a/jsowell-pile/src/main/resources/mapper/pile/StationSettingRelationMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/StationSettingRelationMapper.xml new file mode 100644 index 000000000..4ba7d508a --- /dev/null +++ b/jsowell-pile/src/main/resources/mapper/pile/StationSettingRelationMapper.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + select id, station_id, third_party_type, create_time, create_by, update_time, update_by, del_flag from station_setting_relation + + + + id, station_id, third_party_type, create_time, create_by, update_time, update_by, del_flag + + + + + + + + insert into station_setting_relation + + station_id, + third_party_type, + create_time, + create_by, + update_time, + update_by, + del_flag, + + + #{stationId}, + #{thirdPartyType}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + #{delFlag}, + + + + + update station_setting_relation + + station_id = #{stationId}, + third_party_type = #{thirdPartyType}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from station_setting_relation where id = #{id} + + + + delete from station_setting_relation where id in + + #{id} + + + + + \ No newline at end of file From 6da2f3adffb1fe88454b179c66a66ded8d89e5bc Mon Sep 17 00:00:00 2001 From: Lemon Date: Tue, 6 Jun 2023 09:01:10 +0800 Subject: [PATCH 2/2] update --- .../web/controller/pile/PileStationInfoController.java | 9 +++++++-- .../pile/service/IStationSettingRelationService.java | 3 ++- .../service/impl/StationSettingRelationServiceImpl.java | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java index b52e54d4e..79dbe12a2 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java @@ -12,11 +12,13 @@ import com.jsowell.common.response.RestApiResponse; import com.jsowell.common.util.StringUtils; import com.jsowell.common.util.poi.ExcelUtil; import com.jsowell.pile.domain.PileStationInfo; +import com.jsowell.pile.domain.StationSettingRelation; import com.jsowell.pile.domain.ThirdPartySettingInfo; import com.jsowell.pile.dto.FastCreateStationDTO; import com.jsowell.pile.dto.LianLianPushStationInfoDTO; import com.jsowell.pile.dto.QueryStationDTO; import com.jsowell.pile.service.IPileStationInfoService; +import com.jsowell.pile.service.IStationSettingRelationService; import com.jsowell.pile.service.IThirdPartySettingInfoService; import com.jsowell.pile.vo.web.PileStationVO; import com.jsowell.service.PileService; @@ -49,6 +51,9 @@ public class PileStationInfoController extends BaseController { @Autowired private LianLianService lianLianService; + @Autowired + private IStationSettingRelationService stationSettingRelationService; + /** * 查询充电站信息列表NEW @@ -196,8 +201,8 @@ public class PileStationInfoController extends BaseController { */ @PreAuthorize("@ss.hasPermi('pile:station:query')") @PostMapping("/getSettingInfo") - public AjaxResult getSettingInfo(@RequestBody ThirdPartySettingInfo info) { - return AjaxResult.success(thirdPartySettingInfoService.selectSettingInfo(info)); + public AjaxResult getSettingInfo(@RequestBody StationSettingRelation info) { + return AjaxResult.success(stationSettingRelationService.selectRelationInfo(info)); } /** diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/IStationSettingRelationService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/IStationSettingRelationService.java index be1bae0db..ec815ebf7 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/IStationSettingRelationService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/IStationSettingRelationService.java @@ -3,6 +3,7 @@ package com.jsowell.pile.service; import java.util.List; import com.jsowell.pile.domain.StationSettingRelation; +import com.jsowell.pile.vo.base.StationSettingRelationVO; /** * 站点、第三方推送平台配置对应Service接口 @@ -32,7 +33,7 @@ public interface IStationSettingRelationService { * @param stationSettingRelation * @return */ - StationSettingRelation selectRelationInfo(StationSettingRelation stationSettingRelation); + StationSettingRelationVO selectRelationInfo(StationSettingRelation stationSettingRelation); /** * 新增站点、第三方推送平台配置对应 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/StationSettingRelationServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/StationSettingRelationServiceImpl.java index 357618dd7..47720c896 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/StationSettingRelationServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/StationSettingRelationServiceImpl.java @@ -3,6 +3,7 @@ package com.jsowell.pile.service.impl; import java.util.List; import com.jsowell.common.util.DateUtils; +import com.jsowell.pile.vo.base.StationSettingRelationVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.jsowell.pile.mapper.StationSettingRelationMapper; @@ -48,7 +49,7 @@ public class StationSettingRelationServiceImpl implements IStationSettingRelatio * @return */ @Override - public StationSettingRelation selectRelationInfo(StationSettingRelation stationSettingRelation) { + public StationSettingRelationVO selectRelationInfo(StationSettingRelation stationSettingRelation) { return stationSettingRelationMapper.selectRelationInfo(stationSettingRelation); }