微信付款管理
This commit is contained in:
@ -83,7 +83,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode ORDER_ALREADY_COMPLETE = new ErrorCode(1_004_099_004, "餐盘未绑定");
|
||||
ErrorCode FACE_NOT_BIND_USER = new ErrorCode(1_004_099_005, "人脸未绑定");
|
||||
ErrorCode CARD_NOT_BIND_USER = new ErrorCode(1_004_099_006, "该卡未绑定用户");
|
||||
ErrorCode INSUFFICIENT_BALANCE = new ErrorCode(1_004_099_007, "余额不足10元,请充值");
|
||||
ErrorCode INSUFFICIENT_BALANCE = new ErrorCode(1_004_099_007, "余额不足,请充值");
|
||||
ErrorCode INSUFFICIENT_BALANCE_NEW = new ErrorCode(1_004_099_007, "余额不足,非工作日只能使用微信余额");
|
||||
ErrorCode EXIST_TO_COMPLETE_ORDER = new ErrorCode(1_004_099_008, "存在未支付完的订单");
|
||||
ErrorCode CARD_ALREADY_BIND = new ErrorCode(1_004_099_008, "卡号已绑定");
|
||||
|
@ -71,6 +71,15 @@ public class WxStoreOrderDetailController {
|
||||
return success(BeanUtils.toBean(wxStoreOrderDetail, WxStoreOrderDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getByOrderId")
|
||||
@Operation(summary = "获得微信付款码订单详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<List<WxStoreOrderDetailRespVO>> getWxStoreOrderDetailByOrderId(@RequestParam("orderId") Long orderId) {
|
||||
List<WxStoreOrderDetailDO> wxStoreOrderDetailByOrderId = wxStoreOrderDetailService.getWxStoreOrderDetailByOrderId(orderId);
|
||||
return success(BeanUtils.toBean(wxStoreOrderDetailByOrderId, WxStoreOrderDetailRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得微信付款码订单详情分页")
|
||||
@PreAuthorize("@ss.hasPermission('member:wx-store-order-detail:query')")
|
||||
|
@ -374,7 +374,11 @@ public class DiningPlatesServiceImpl implements DiningPlatesService {
|
||||
cashAmount = BigDecimal.ZERO;
|
||||
}
|
||||
BigDecimal money = memberUserDO.getWxAmount().add(cashAmount);
|
||||
if (money.compareTo(MemberConstants.ALARM_BALANCE) < 0) {
|
||||
BigDecimal compareMoney = MemberConstants.ALARM_BALANCE;
|
||||
if(storeId .equals(MemberConstants.SANXIA_ROAD_COMMUNITY)){
|
||||
compareMoney = MemberConstants.SANXIA_ROAD_COMMUNITY_BALANCE;
|
||||
}
|
||||
if (money.compareTo(compareMoney) < 0) {
|
||||
if(typeHoliday){
|
||||
throw exception(INSUFFICIENT_BALANCE_NEW);
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ public class WxStoreOrderServiceImpl implements WxStoreOrderService {
|
||||
if(b){
|
||||
WxStoreOrderDO wxStoreOrderDO = new WxStoreOrderDO();
|
||||
wxStoreOrderDO.setOutTradeNo(outTradeNo);
|
||||
wxStoreOrderDO.setTotalPrice(vo.getTotalPrice());
|
||||
wxStoreOrderDO.setTotalPrice(totalPrice);
|
||||
wxStoreOrderDO.setAuthCode(vo.getAuthCode());
|
||||
wxStoreOrderDO.setCarteenId(vo.getCarteenId());
|
||||
wxStoreOrderDO.setStatus("SUCCESS");
|
||||
|
@ -44,6 +44,8 @@ public interface WxStoreOrderDetailService {
|
||||
*/
|
||||
WxStoreOrderDetailDO getWxStoreOrderDetail(Long id);
|
||||
|
||||
List<WxStoreOrderDetailDO> getWxStoreOrderDetailByOrderId(Long orderId);
|
||||
|
||||
/**
|
||||
* 获得微信付款码订单详情分页
|
||||
*
|
||||
|
@ -1,5 +1,8 @@
|
||||
package cn.iocoder.yudao.module.member.service.wxstoreorderdetail;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -66,6 +69,11 @@ public class WxStoreOrderDetailServiceImpl implements WxStoreOrderDetailService
|
||||
return wxStoreOrderDetailMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WxStoreOrderDetailDO> getWxStoreOrderDetailByOrderId(Long orderId) {
|
||||
return wxStoreOrderDetailMapper.selectList(new LambdaQueryWrapperX<WxStoreOrderDetailDO>().eq(WxStoreOrderDetailDO::getWxOrderId, orderId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<WxStoreOrderDetailDO> getWxStoreOrderDetailPage(WxStoreOrderDetailPageReqVO pageReqVO) {
|
||||
return wxStoreOrderDetailMapper.selectPage(pageReqVO);
|
||||
|
@ -83,4 +83,14 @@ public class MemberConstants {
|
||||
* 晚餐推荐摄入量
|
||||
*/
|
||||
public static final BigDecimal PROPOSE_NIGHT = new BigDecimal("600");
|
||||
|
||||
/**
|
||||
* 社区门店ID
|
||||
*/
|
||||
public static final Long SANXIA_ROAD_COMMUNITY = 1038L;
|
||||
|
||||
/**
|
||||
* 社区门店ID
|
||||
*/
|
||||
public static final BigDecimal SANXIA_ROAD_COMMUNITY_BALANCE = new BigDecimal("16");
|
||||
}
|
Reference in New Issue
Block a user