7 Commits

Author SHA1 Message Date
Lemon
cc532bfcec 新增 发票导出接口 2026-07-16 15:21:42 +08:00
Lemon
a7d838cdb1 add 开票接口新增 email字段 2026-07-15 14:36:32 +08:00
jsowell
4986239cd4 update 停车优惠配置接口 2026-07-08 16:41:15 +08:00
Guoqs
cace7f692f Merge branch 'dev' of codeup.aliyun.com:67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web into dev
# Conflicts:
#	jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java
2026-07-08 10:24:57 +08:00
Lemon
c9749a1816 bugfix 修复查询站点停车配置信息报错 2026-07-08 10:19:23 +08:00
Lemon
df761d1785 bugfix. 修复希晓运营商无法查看会员详情 2026-07-08 10:07:58 +08:00
Guoqs
6a0e4d6ea7 页面配置停车平台信息 2026-07-03 16:22:39 +08:00
14 changed files with 367 additions and 28 deletions

View File

@@ -132,13 +132,13 @@ public class MemberBasicInfoController extends BaseController {
/**
* 获取会员基础信息详细信息
*/
@PreAuthorize("@ss.hasPermi('member:memberGroup:list')")
@PreAuthorize("@ss.hasPermi('member:info:query')")
@GetMapping(value = "/{memberId}")
public AjaxResult getInfo(@PathVariable("memberId") String memberId) {
return AjaxResult.success(memberBasicInfoService.queryMemberInfoByMemberId(memberId));
}
@PreAuthorize("@ss.hasPermi('member:memberGroup:list')")
@PreAuthorize("@ss.hasPermi('member:info:query')")
@GetMapping(value = "/getMemberPersonPileInfo/{memberId}")
public AjaxResult getMemberPersonPileInfo(@PathVariable("memberId") String memberId) {
return AjaxResult.success(memberBasicInfoService.getMemberPersonPileInfo(memberId));

View File

@@ -10,6 +10,7 @@ import com.jsowell.pile.domain.OrderInvoiceRecord;
import com.jsowell.pile.dto.GetInvoiceInfoDTO;
import com.jsowell.pile.service.OrderInvoiceRecordService;
import com.jsowell.pile.service.PileMerchantInfoService;
import com.jsowell.pile.vo.web.OrderInvoiceExportVO;
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -64,6 +66,18 @@ public class OrderInvoiceRecordController extends BaseController {
util.exportExcel(response, list, "申请开票数据");
}
/**
* 导出所选申请开票详情
*/
@PreAuthorize("@ss.hasPermi('order:invoice:export')")
@Log(title = "申请开票", businessType = BusinessType.EXPORT)
@PostMapping("/export/selected")
public void exportSelected(HttpServletResponse response, @RequestParam("ids") Integer[] ids) {
List<OrderInvoiceExportVO> list = orderInvoiceRecordService.selectInvoiceExportList(ids);
ExcelUtil<OrderInvoiceExportVO> util = new ExcelUtil<OrderInvoiceExportVO>(OrderInvoiceExportVO.class);
util.exportExcel(response, list, "所选申请开票详情数据");
}
/**
* 获取申请开票详细信息
*/

View File

@@ -32,6 +32,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
/**
@@ -422,7 +423,81 @@ public class PileStationInfoController extends BaseController {
return response;
}
/**
* 保存停车平台配置
*
* @param config 停车平台配置
* @return
*/
@PostMapping("/saveParkingConfig")
public RestApiResponse<?> saveParkingConfig(@RequestBody ThirdpartyParkingConfig config) {
logger.info("保存停车平台配置 params:{}", JSON.toJSONString(config));
RestApiResponse<?> response = null;
try {
if (config == null) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
}
if (StringUtils.isBlank(config.getParkingName())
|| StringUtils.isBlank(config.getPlatformType())
|| StringUtils.isBlank(config.getSecretKey())
|| StringUtils.isBlank(config.getParkId())
|| StringUtils.isBlank(config.getApiUrl())) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
}
if ("4".equals(config.getPlatformType()) && StringUtils.isBlank(config.getAppId())) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
}
Date now = new Date();
if (config.getId() == null) {
config.setCreateTime(now);
config.setCreateBy(getUsername());
if (StringUtils.isBlank(config.getDelFlag())) {
config.setDelFlag("0");
}
parkingConfigService.insertSelective(config);
} else {
config.setUpdateTime(now);
config.setUpdateBy(getUsername());
parkingConfigService.updateByPrimaryKeySelective(config);
}
response = new RestApiResponse<>(config);
} catch (BusinessException e) {
logger.error("保存停车平台配置 error,", e);
response = new RestApiResponse<>(e.getCode(), e.getMessage());
} catch (Exception e) {
logger.error("保存停车平台配置 error", e);
response = new RestApiResponse<>(e);
}
logger.info("保存停车平台配置 result:{}", response);
return response;
}
/**
* 根据站点获取已绑定停车平台配置
*
* @param stationId 站点ID
*
* @return
*/
@GetMapping("/getParkingConfigByStationId/{stationId}")
public RestApiResponse<?> getParkingConfigByStationId(@PathVariable("stationId") String stationId) {
RestApiResponse<?> response = null;
try {
if (StringUtils.isBlank(stationId)) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
}
ThirdpartyParkingConfig config = parkingConfigService.selectByStationId(stationId);
response = new RestApiResponse<>(config);
} catch (BusinessException e) {
logger.error("根据站点获取停车平台配置 error,", e);
response = new RestApiResponse<>(e.getCode(), e.getMessage());
} catch (Exception e) {
logger.error("根据站点获取停车平台配置 error", e);
response = new RestApiResponse<>(e);
}
logger.info("根据站点获取停车平台配置 result:{}", response);
return response;
}
// public AjaxResult checkStationAmap
}

View File

@@ -7,11 +7,8 @@ import com.jsowell.common.util.Cp56Time2a.Cp56Time2aUtil;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.YKCUtils;
import com.jsowell.netty.factory.YKCOperateFactory;
import com.jsowell.pile.dto.SavePileMsgDTO;
import com.jsowell.pile.service.PileMsgRecordService;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
@@ -27,9 +24,6 @@ import java.util.Date;
public class TimeCheckSettingResponseHandler extends AbstractYkcHandler {
private final String type = YKCUtils.frameType2Str(YKCFrameTypeCode.TIME_CHECK_SETTING_ANSWER_CODE.getBytes());
@Autowired
private PileMsgRecordService pileMsgRecordService;
@Override
public void afterPropertiesSet() throws Exception {
YKCOperateFactory.register(type, this);
@@ -58,15 +52,7 @@ public class TimeCheckSettingResponseHandler extends AbstractYkcHandler {
Date date = Cp56Time2aUtil.byte2Hdate(currentTimeByteArr);
String deviceTime = DateUtils.formatDateTime(date);
String platformTime = DateUtils.getDateTime();
SavePileMsgDTO dto = SavePileMsgDTO.builder()
.pileSn(pileSn)
.connectorCode("")
.transactionCode("")
.frameType(type)
.jsonMsg("对时设置应答: deviceTime=" + deviceTime + ", platformTime=" + platformTime)
.originalMsg(ykcDataProtocol.getHEXString())
.build();
pileMsgRecordService.save(dto);
// 对时应答(0x55)仅记录日志,不再保存到 pile_msg_record避免日志表持续膨胀。
log.info("[===对时设置充电桩应答===], pileSn:{}, channelId:{}, 充电桩当前时间:{}, 平台当前时间:{}", pileSn, channel.channel().id().asShortText(), deviceTime, platformTime);
return null;
}

View File

@@ -64,4 +64,9 @@ public class InvoiceTitleDTO {
* 接收方式
*/
private String reception;
/**
* 邮箱地址
*/
private String email;
}

View File

@@ -24,4 +24,9 @@ public interface ChargeParkingDiscountMapper {
int insertOrUpdateSelective(ChargeParkingDiscount record);
ChargeParkingDiscount selectByStationId(String stationId);
}
int logicDeleteByStationIdExcludeId(@Param("stationId") String stationId,
@Param("keepId") Integer keepId,
@Param("updateBy") String updateBy,
@Param("updateTime") java.util.Date updateTime);
}

View File

@@ -4,6 +4,7 @@ import com.jsowell.pile.domain.OrderInvoiceRecord;
import com.jsowell.pile.dto.GetInvoiceInfoDTO;
import com.jsowell.pile.dto.QueryInvoiceRecordDTO;
import com.jsowell.pile.vo.web.InvoiceRecordVO;
import com.jsowell.pile.vo.web.OrderInvoiceExportVO;
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
import java.time.LocalDateTime;
@@ -26,6 +27,8 @@ public interface OrderInvoiceRecordService {
InvoiceRecordVO selectInvoiceTitleVO(Integer id);
List<OrderInvoiceExportVO> selectInvoiceExportList(Integer[] ids);
/**
* 查询申请开票列表
*

View File

@@ -9,6 +9,7 @@ import com.jsowell.pile.vo.web.ChargeParkingDiscountVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Service
public class ChargeParkingDiscountServiceImpl implements ChargeParkingDiscountService{
@@ -81,12 +82,26 @@ public class ChargeParkingDiscountServiceImpl implements ChargeParkingDiscountSe
@Override
public int insertOrUpdateSelective(ChargeParkingDiscount record) {
if (record.getId() == null) {
record.setCreateBy(SecurityUtils.getUsername());
} else {
record.setUpdateBy(SecurityUtils.getUsername());
if (record == null || StringUtils.isBlank(record.getStationId())) {
return 0;
}
return chargeParkingDiscountMapper.insertOrUpdateSelective(record);
String username = SecurityUtils.getUsername();
Date now = new Date();
record.setDelFlag("0");
ChargeParkingDiscount latestRecord = this.selectByStationId(record.getStationId());
if (latestRecord == null) {
record.setCreateBy(username);
record.setCreateTime(now);
return chargeParkingDiscountMapper.insertSelective(record);
}
record.setId(latestRecord.getId());
record.setUpdateBy(username);
record.setUpdateTime(now);
int result = chargeParkingDiscountMapper.updateByPrimaryKeySelective(record);
chargeParkingDiscountMapper.logicDeleteByStationIdExcludeId(record.getStationId(), latestRecord.getId(), username, now);
return result;
}
}

View File

@@ -13,6 +13,8 @@ import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
import com.jsowell.pile.vo.uniapp.customer.InvoiceTitleVO;
import com.jsowell.pile.vo.web.InvoiceRecordVO;
import com.jsowell.pile.vo.web.OrderInvoiceExportVO;
import com.jsowell.pile.vo.web.OrderInvoiceOrderExportVO;
import com.jsowell.pile.vo.web.OrderInvoiceRecordVO;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -20,7 +22,11 @@ import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 申请开票Service业务层处理
@@ -76,6 +82,82 @@ public class OrderInvoiceRecordServiceImpl implements OrderInvoiceRecordService
.build();
}
@Override
public List<OrderInvoiceExportVO> selectInvoiceExportList(Integer[] ids) {
if (ids == null || ids.length == 0) {
return Collections.emptyList();
}
return Arrays.stream(ids)
.filter(Objects::nonNull)
.distinct()
.map(this::selectInvoiceTitleVO)
.filter(Objects::nonNull)
.map(this::buildOrderInvoiceExportVO)
.collect(Collectors.toList());
}
private OrderInvoiceExportVO buildOrderInvoiceExportVO(InvoiceRecordVO invoiceRecordVO) {
InvoiceTitleVO invoiceTitle = invoiceRecordVO.getInvoiceTitle();
return OrderInvoiceExportVO.builder()
.id(invoiceRecordVO.getId())
.memberId(invoiceRecordVO.getMemberId())
.phoneNumber(invoiceRecordVO.getPhoneNumber())
.status(invoiceRecordVO.getStatus())
.createTime(invoiceRecordVO.getCreateTime())
.updateTime(invoiceRecordVO.getUpdateTime())
.titleId(invoiceTitle == null ? null : invoiceTitle.getTitleId())
.titleName(invoiceTitle == null ? null : invoiceTitle.getTitleName())
.titleType(invoiceTitle == null ? null : invoiceTitle.getTitleType())
.taxId(invoiceTitle == null ? null : invoiceTitle.getTaxId())
.unitAddress(invoiceTitle == null ? null : invoiceTitle.getUnitAddress())
.email(invoiceTitle == null ? null : invoiceTitle.getEmail())
.reception(invoiceTitle == null ? null : invoiceTitle.getReception())
.titlePhoneNumber(invoiceTitle == null ? null : invoiceTitle.getPhoneNumber())
.bankName(invoiceTitle == null ? null : invoiceTitle.getBankName())
.bankAccountNumber(invoiceTitle == null ? null : invoiceTitle.getBankAccountNumber())
.defaultFlag(invoiceTitle == null ? null : invoiceTitle.getDefaultFlag())
.orderList(buildOrderExportList(invoiceRecordVO.getOrderList()))
.build();
}
private List<OrderInvoiceOrderExportVO> buildOrderExportList(List<OrderAmountDetailVO> orderList) {
if (CollectionUtils.isEmpty(orderList)) {
List<OrderInvoiceOrderExportVO> emptyOrderList = new ArrayList<>();
emptyOrderList.add(new OrderInvoiceOrderExportVO());
return emptyOrderList;
}
List<OrderInvoiceOrderExportVO> exportList = orderList.stream()
.filter(Objects::nonNull)
.map(this::buildOrderInvoiceOrderExportVO)
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(exportList)) {
exportList.add(new OrderInvoiceOrderExportVO());
}
return exportList;
}
private OrderInvoiceOrderExportVO buildOrderInvoiceOrderExportVO(OrderAmountDetailVO orderAmountDetailVO) {
return OrderInvoiceOrderExportVO.builder()
.orderCode(orderAmountDetailVO.getOrderCode())
.totalUsedElectricity(orderAmountDetailVO.getTotalUsedElectricity())
.totalOrderAmount(orderAmountDetailVO.getTotalOrderAmount())
.totalElectricityAmount(orderAmountDetailVO.getTotalElectricityAmount())
.totalServiceAmount(orderAmountDetailVO.getTotalServiceAmount())
.sharpUsedElectricity(orderAmountDetailVO.getSharpUsedElectricity())
.sharpElectricityPrice(orderAmountDetailVO.getSharpElectricityPrice())
.sharpServicePrice(orderAmountDetailVO.getSharpServicePrice())
.peakUsedElectricity(orderAmountDetailVO.getPeakUsedElectricity())
.peakElectricityPrice(orderAmountDetailVO.getPeakElectricityPrice())
.peakServicePrice(orderAmountDetailVO.getPeakServicePrice())
.flatUsedElectricity(orderAmountDetailVO.getFlatUsedElectricity())
.flatElectricityPrice(orderAmountDetailVO.getFlatElectricityPrice())
.flatServicePrice(orderAmountDetailVO.getFlatServicePrice())
.valleyUsedElectricity(orderAmountDetailVO.getValleyUsedElectricity())
.valleyElectricityPrice(orderAmountDetailVO.getValleyElectricityPrice())
.valleyServicePrice(orderAmountDetailVO.getValleyServicePrice())
.build();
}
/**
* 查询申请开票列表
*

View File

@@ -76,8 +76,9 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
YKCUtils.frameType2Str(YKCFrameTypeCode.REMOTE_CONTROL_START_CHARGING_CODE.getBytes()),
YKCUtils.frameType2Str(YKCFrameTypeCode.REMOTE_CONTROL_STOP_CHARGING_CODE.getBytes()),
YKCUtils.frameType2Str(YKCFrameTypeCode.RESERVATION_CHARGING_SETUP_CODE.getBytes()),
YKCUtils.frameType2Str(YKCFrameTypeCode.YUXIN_RESERVATION_CHARGING_SETUP_CODE.getBytes()),
YKCUtils.frameType2Str(YKCFrameTypeCode.TIME_CHECK_SETTING_CODE.getBytes())
YKCUtils.frameType2Str(YKCFrameTypeCode.YUXIN_RESERVATION_CHARGING_SETUP_CODE.getBytes())
// 对时帧(0x56)不再保存到 pile_msg_record避免日志表持续膨胀。
// YKCUtils.frameType2Str(YKCFrameTypeCode.TIME_CHECK_SETTING_CODE.getBytes())
);
/**

View File

@@ -0,0 +1,72 @@
package com.jsowell.pile.vo.web;
import com.jsowell.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* 发票详情导出数据
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class OrderInvoiceExportVO {
@Excel(name = "申请记录ID", sort = 1, needMerge = true)
private String id;
@Excel(name = "会员ID", sort = 2, needMerge = true, width = 20)
private String memberId;
@Excel(name = "申请人电话", sort = 3, needMerge = true, width = 18)
private String phoneNumber;
@Excel(name = "状态", sort = 4, needMerge = true, readConverterExp = "0=未开票,1=已开票")
private String status;
@Excel(name = "申请时间", sort = 5, needMerge = true, width = 20)
private String createTime;
@Excel(name = "开票时间", sort = 6, needMerge = true, width = 20)
private String updateTime;
@Excel(name = "抬头ID", sort = 7, needMerge = true)
private String titleId;
@Excel(name = "抬头名称", sort = 8, needMerge = true, width = 30)
private String titleName;
@Excel(name = "抬头类型", sort = 9, needMerge = true)
private String titleType;
@Excel(name = "税号", sort = 10, needMerge = true, width = 24)
private String taxId;
@Excel(name = "单位地址", sort = 11, needMerge = true, width = 30)
private String unitAddress;
@Excel(name = "抬头邮箱", sort = 12, needMerge = true, width = 24)
private String email;
@Excel(name = "接收方式", sort = 13, needMerge = true)
private String reception;
@Excel(name = "抬头电话", sort = 14, needMerge = true, width = 18)
private String titlePhoneNumber;
@Excel(name = "开户银行", sort = 15, needMerge = true, width = 24)
private String bankName;
@Excel(name = "银行账户", sort = 16, needMerge = true, width = 24)
private String bankAccountNumber;
@Excel(name = "默认抬头", sort = 17, needMerge = true, readConverterExp = "0=否,1=是")
private String defaultFlag;
@Excel(name = "订单明细", sort = 18)
private List<OrderInvoiceOrderExportVO> orderList;
}

View File

@@ -0,0 +1,69 @@
package com.jsowell.pile.vo.web;
import com.jsowell.common.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* 发票关联订单导出明细
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class OrderInvoiceOrderExportVO {
@Excel(name = "订单号", sort = 1, width = 24)
private String orderCode;
@Excel(name = "总用电量", sort = 2)
private BigDecimal totalUsedElectricity;
@Excel(name = "订单总金额", sort = 3)
private BigDecimal totalOrderAmount;
@Excel(name = "电费总金额", sort = 4)
private BigDecimal totalElectricityAmount;
@Excel(name = "服务费总金额", sort = 5)
private BigDecimal totalServiceAmount;
@Excel(name = "尖时段用电量", sort = 6)
private BigDecimal sharpUsedElectricity;
@Excel(name = "尖时段电费单价", sort = 7)
private BigDecimal sharpElectricityPrice;
@Excel(name = "尖时段服务费单价", sort = 8)
private BigDecimal sharpServicePrice;
@Excel(name = "峰时段用电量", sort = 9)
private BigDecimal peakUsedElectricity;
@Excel(name = "峰时段电费单价", sort = 10)
private BigDecimal peakElectricityPrice;
@Excel(name = "峰时段服务费单价", sort = 11)
private BigDecimal peakServicePrice;
@Excel(name = "平时段用电量", sort = 12)
private BigDecimal flatUsedElectricity;
@Excel(name = "平时段电费单价", sort = 13)
private BigDecimal flatElectricityPrice;
@Excel(name = "平时段服务费单价", sort = 14)
private BigDecimal flatServicePrice;
@Excel(name = "谷时段用电量", sort = 15)
private BigDecimal valleyUsedElectricity;
@Excel(name = "谷时段电费单价", sort = 16)
private BigDecimal valleyElectricityPrice;
@Excel(name = "谷时段服务费单价", sort = 17)
private BigDecimal valleyServicePrice;
}

View File

@@ -485,11 +485,23 @@
</trim>
</insert>
<update id="logicDeleteByStationIdExcludeId">
update charge_parking_discount
set del_flag = '1',
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where station_id = #{stationId,jdbcType=VARCHAR}
and del_flag = '0'
and id != #{keepId,jdbcType=INTEGER}
</update>
<select id="selectByStationId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from charge_parking_discount
where del_flag = '0'
and station_id = #{stationId,jdbcType=VARCHAR}
order by ifnull(update_time, create_time) desc, id desc
limit 1
</select>
</mapper>
</mapper>

View File

@@ -68,7 +68,7 @@
#{updateBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsowell.pile.domain.ThirdpartyParkingConfig">
<insert id="insertSelective" parameterType="com.jsowell.pile.domain.ThirdpartyParkingConfig" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
<!--@mbg.generated-->
insert into thirdparty_parking_config
<trim prefix="(" suffix=")" suffixOverrides=",">