mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
# Conflicts: # jsowell-pile/src/main/java/com/jsowell/pile/service/OrderPileOccupyService.java # jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderPileOccupyServiceImpl.java
This commit is contained in:
@@ -1,7 +1,24 @@
|
||||
package com.jsowell.pile.dto;/**
|
||||
* TODO
|
||||
package com.jsowell.pile.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 生成占桩订单DTO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/8/18 9:00
|
||||
* @author Lemon
|
||||
*/public class GenerateOccupyOrderDTO {
|
||||
*/
|
||||
@Data
|
||||
public class GenerateOccupyOrderDTO {
|
||||
private String memberId;
|
||||
|
||||
/**
|
||||
* 桩号
|
||||
*/
|
||||
private String pileSn;
|
||||
|
||||
/**
|
||||
* 枪口号
|
||||
*/
|
||||
private String connectorCode;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.jsowell.pile.mapper;
|
||||
|
||||
import com.jsowell.pile.domain.OrderPileOccupy;
|
||||
import com.jsowell.pile.dto.QueryOccupyOrderDTO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -83,4 +84,11 @@ public interface OrderPileOccupyMapper {
|
||||
* @return
|
||||
*/
|
||||
List<OrderPileOccupy> queryUnPayOrderByMemberId(@Param("memberId") String memberId);
|
||||
|
||||
/**
|
||||
* 查询占桩订单列表
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<OrderPileOccupyVO> getOccupyOrderInfo(String memberId);
|
||||
}
|
||||
@@ -2,7 +2,9 @@ package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.domain.OrderPileOccupy;
|
||||
import com.jsowell.pile.dto.PayOrderDTO;
|
||||
import com.jsowell.pile.dto.GenerateOccupyOrderDTO;
|
||||
import com.jsowell.pile.dto.QueryOccupyOrderDTO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -37,7 +39,7 @@ public interface OrderPileOccupyService{
|
||||
/**
|
||||
* 生成占桩订单
|
||||
*/
|
||||
void generateOccupyPileOrder(String memberId, String pileSn, String connectorCode);
|
||||
String generateOccupyPileOrder(GenerateOccupyOrderDTO dto);
|
||||
|
||||
/**
|
||||
* 停止并计算占桩订单
|
||||
@@ -54,4 +56,11 @@ public interface OrderPileOccupyService{
|
||||
List<OrderPileOccupy> queryUnPayOrderByMemberId(String memberId);
|
||||
|
||||
Map<String, Object> payOccupyPileOrder(PayOrderDTO dto);
|
||||
|
||||
/**
|
||||
* 查询占桩订单列表
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<OrderPileOccupyVO> getOccupyOrderInfo(String memberId);
|
||||
}
|
||||
|
||||
@@ -8,17 +8,22 @@ import com.jsowell.common.enums.MemberWalletEnum;
|
||||
import com.jsowell.common.enums.ykc.OrderPayModeEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.enums.uniapp.OrderPileOccupyPayStatusEnum;
|
||||
import com.jsowell.common.enums.uniapp.OrderPileOccupyStatusEnum;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.PageUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.id.IdUtils;
|
||||
import com.jsowell.pile.domain.OrderPileOccupy;
|
||||
import com.jsowell.pile.dto.PayOrderDTO;
|
||||
import com.jsowell.pile.dto.GenerateOccupyOrderDTO;
|
||||
import com.jsowell.pile.dto.QueryOccupyOrderDTO;
|
||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
import com.jsowell.pile.mapper.OrderPileOccupyMapper;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderPileOccupyVO;
|
||||
import com.jsowell.pile.vo.web.BillingTemplateVO;
|
||||
import com.jsowell.pile.vo.web.OrderListVO;
|
||||
import com.jsowell.pile.vo.web.UpdateMemberBalanceDTO;
|
||||
@@ -33,7 +38,7 @@ import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class OrderPileOccupyServiceImpl implements OrderPileOccupyService{
|
||||
public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
|
||||
|
||||
@Resource
|
||||
private OrderPileOccupyMapper orderPileOccupyMapper;
|
||||
@@ -110,6 +115,7 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService{
|
||||
|
||||
/**
|
||||
* 根据占桩订单编号查询占桩订单
|
||||
*
|
||||
* @param occupyCode 占桩订单编号
|
||||
* @return
|
||||
*/
|
||||
@@ -123,6 +129,7 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService{
|
||||
|
||||
/**
|
||||
* 查询占桩订单列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@@ -134,12 +141,14 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService{
|
||||
/**
|
||||
* 生成占桩订单
|
||||
* 在会员操作降地锁后,就生成占桩订单
|
||||
* @param memberId 会员id
|
||||
* @param pileSn 充电桩编号
|
||||
* @param connectorCode 充电桩枪口号
|
||||
*
|
||||
* @param dto 会员id 充电桩编号 充电桩枪口号
|
||||
*/
|
||||
@Override
|
||||
public void generateOccupyPileOrder(String memberId, String pileSn, String connectorCode) {
|
||||
public String generateOccupyPileOrder(GenerateOccupyOrderDTO dto) {
|
||||
String memberId = dto.getMemberId();
|
||||
String pileSn = dto.getPileSn();
|
||||
String connectorCode = dto.getConnectorCode();
|
||||
// 创建占桩订单
|
||||
OrderPileOccupy orderPileOccupy = new OrderPileOccupy();
|
||||
String occupyCode = "OP" + IdUtils.getOrderCode();
|
||||
@@ -157,11 +166,14 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService{
|
||||
orderPileOccupy.setStartTime(DateUtils.getNowDate());
|
||||
orderPileOccupy.setDelFlag(DelFlagEnum.NORMAL.getValue());
|
||||
orderPileOccupyMapper.insertSelective(orderPileOccupy);
|
||||
|
||||
return orderPileOccupy.getOccupyCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 收到地锁升起指令,调用这个方法,停止计时
|
||||
* 占桩订单停止计费/停止占桩订单计费
|
||||
*
|
||||
* @param pileSn
|
||||
* @param connectorCode
|
||||
*/
|
||||
@@ -273,8 +285,29 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService{
|
||||
return orderPileOccupyMapper.queryUnPayOrderByMemberId(memberId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询占桩订单列表
|
||||
*
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<OrderPileOccupyVO> getOccupyOrderInfo(String memberId) {
|
||||
// 分页
|
||||
PageUtils.startPage();
|
||||
List<OrderPileOccupyVO> list = orderPileOccupyMapper.getOccupyOrderInfo(memberId);
|
||||
for (OrderPileOccupyVO orderPileOccupyVO : list) {
|
||||
// 订单状态
|
||||
orderPileOccupyVO.setStatus(OrderPileOccupyStatusEnum.getValueByCode(orderPileOccupyVO.getStatus()));
|
||||
// 支付状态
|
||||
orderPileOccupyVO.setPayStatus(OrderPileOccupyPayStatusEnum.getValueByCode(orderPileOccupyVO.getPayStatus()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付占桩订单
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@@ -285,8 +318,6 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService{
|
||||
if (orderPileOccupy == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_QUERY_ORDER_INFO_IS_NULL);
|
||||
}
|
||||
// 校验订单状态
|
||||
|
||||
// 支付方式
|
||||
Map<String, Object> resultMap = Maps.newHashMap();
|
||||
if (StringUtils.equals(dto.getPayMode(), OrderPayModeEnum.PAYMENT_OF_BALANCE.getValue())) {
|
||||
|
||||
@@ -357,7 +357,7 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("通过站点id查询当前时间的收费详情 stationId:{}, result:{}", stationId, JSON.toJSONString(result));
|
||||
// log.info("通过站点id查询当前时间的收费详情 stationId:{}, result:{}", stationId, JSON.toJSONString(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.jsowell.pile.vo.uniapp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 占桩订单列表VO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/8/18 9:34
|
||||
*/
|
||||
@Data
|
||||
public class OrderPileOccupyVO {
|
||||
/**
|
||||
* 占桩订单编号
|
||||
*/
|
||||
private String occupyCode;
|
||||
|
||||
/**
|
||||
* 状态(0-占桩中;1-订单完成; 2-订单挂起)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 站点名称
|
||||
*/
|
||||
private String stationName;
|
||||
|
||||
/**
|
||||
* 占桩开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 占桩结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 支付状态(0-未支付;1-支付完成;2-无需支付)
|
||||
*/
|
||||
private String payStatus;
|
||||
|
||||
/**
|
||||
* 占桩订单金额
|
||||
*/
|
||||
private String orderAmount;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user