feat:出生日期
This commit is contained in:
1 parent
a2623df7e2
commit
6e4aa1a2bb
20 files changed
+216
-21
No files matched your search
+5
-1
@@ -7,10 +7,14 @@ import lombok.Data;
|
||||
@Data
|
||||
public class HandCancelActCodeDto {
|
||||
|
||||
@Schema(description = "核销活动i子d")
|
||||
@Schema(description = "用户id不能为空")
|
||||
@NotNull(message = "核销活动子id不能为空")
|
||||
private Long actItemId;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "设备id")
|
||||
@NotNull(message = "设备id不能为空")
|
||||
private Long hardwareId;
|
||||
|
||||
+94
-11
@@ -33,6 +33,7 @@ import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardProductNatureEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardThirdMiStatusEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardHourTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderStatusEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardPayTypeEnum;
|
||||
@@ -84,6 +85,7 @@ import com.bsd.pjcloud.wallet.api.constant.mch.WalletMchRulePriceTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.mch.WalletMchSupType;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletBalanceTransactionDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCancelItemDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActComCancelDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTransactionEntity;
|
||||
@@ -93,6 +95,7 @@ import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletSettingVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActCancelItemVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActComItemVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.mch.MchPickUpVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.mch.MchRuleJoinDtoVo;
|
||||
import jakarta.validation.Valid;
|
||||
@@ -152,6 +155,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
private final RemoteOnlineCanteenSpuService onlineCanteenSpuService;
|
||||
private final RemoteSupermarketSpuService supermarketSpuService;
|
||||
private final RemoteShopSkuService remoteShopSkuService;
|
||||
private final RemoteComActService remoteComActService;
|
||||
private final RemoteActCancelService remoteActCancelService;
|
||||
private final RemoteMallProductService remoteMallProductService;
|
||||
|
||||
@@ -1024,15 +1028,18 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
// 是否需要核销
|
||||
boolean isVerify = isVerify(hardPayType);
|
||||
if (isWalletPay) {
|
||||
WalletBalanceTransactionDto reduceBuild = new WalletBalanceTransactionDto();
|
||||
reduceBuild.setWalletId(order.getWalletId());
|
||||
reduceBuild.setPrice(order.getPayPrice());
|
||||
reduceBuild.setBizId(String.valueOf(order.getId()));
|
||||
reduceBuild.setBizType(WalletBizEnum.PAYMENT);
|
||||
reduceBuild.setForce(true);
|
||||
R<WalletTransactionEntity> reduceRes = walletTransactionService.reduceWalletBalance(reduceBuild);
|
||||
if (reduceRes.getCode() != 0 || ObjectUtil.isEmpty(reduceRes.getData())) {
|
||||
throw new RuntimeException("钱包扣款错误");
|
||||
int payPrice = order.getTotalPrice() + order.getExtraPrice();
|
||||
if (payPrice > 0) {
|
||||
WalletBalanceTransactionDto reduceBuild = new WalletBalanceTransactionDto();
|
||||
reduceBuild.setWalletId(order.getWalletId());
|
||||
reduceBuild.setPrice(order.getPayPrice());
|
||||
reduceBuild.setBizId(String.valueOf(order.getId()));
|
||||
reduceBuild.setBizType(WalletBizEnum.PAYMENT);
|
||||
reduceBuild.setForce(true);
|
||||
R<WalletTransactionEntity> reduceRes = walletTransactionService.reduceWalletBalance(reduceBuild);
|
||||
if (reduceRes.getCode() != 0 || ObjectUtil.isEmpty(reduceRes.getData())) {
|
||||
throw new RuntimeException("钱包扣款错误");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 订单成功
|
||||
@@ -1150,9 +1157,85 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean handCancelActCode(HandCancelActCodeDto dto) {
|
||||
// 查看该优惠券
|
||||
// 1. 查看活动是否存在
|
||||
ActComItemVo detail = remoteComActService.remoteGetComAct(dto.getActItemId(), dto.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(detail)) {
|
||||
throw new RuntimeException("活动不存在");
|
||||
}
|
||||
// 2. 参加活动人员
|
||||
UserInfo userInfo = userService.getInnerByUserId(detail.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userInfo)) {
|
||||
throw new RuntimeException("参加活动用户不存在");
|
||||
}
|
||||
SysUser sysUser = userInfo.getSysUser();
|
||||
// 3. 查询设备
|
||||
HardManagerVo hardDetail = hardManagerService.getByHardId(dto.getHardwareId());
|
||||
if (ObjectUtil.isEmpty(hardDetail)) {
|
||||
throw new RuntimeException("设备不存在");
|
||||
}
|
||||
// 4. 查询商户
|
||||
MchManageVo mch = remoteMchService.getById(hardDetail.getMerchantId()).getData();
|
||||
if (ObjectUtil.isEmpty(mch)) {
|
||||
throw new RuntimeException("商户不存在");
|
||||
}
|
||||
// 5. 是否已经核销过
|
||||
String errorMsg = remoteComActService.remoteIsCanCancel(dto.getActItemId(), dto.getUserId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(errorMsg)) {
|
||||
throw new RuntimeException(errorMsg);
|
||||
}
|
||||
// 6. 钱包(默认饭卡钱包)
|
||||
WalletManageEntity wallet = remoteWalletService.getWallet(dto.getUserId(), WalletTypeEnum.EAT).getData();
|
||||
|
||||
return null;
|
||||
// 7. 创建订单
|
||||
|
||||
// 是否需要支付
|
||||
boolean isPay = true;
|
||||
// 门槛金额
|
||||
// 减免金额
|
||||
// 商品描述
|
||||
// 优惠金额
|
||||
int useAmountPrice = 0;
|
||||
String orderDesc = "浦江活动商品 x *";
|
||||
// 总金额,额外金额,支付金额
|
||||
int totalPrice = 0, extraPrice = 0, payPrice = 0;
|
||||
// 添加硬件订单
|
||||
HardOrderEntity orderObj = HardOrderEntity.builder()
|
||||
.androidOrderCode(null)
|
||||
.userId(sysUser.getUserId())
|
||||
.userDeptId(sysUser.getDeptId())
|
||||
.walletId(wallet.getId())
|
||||
.sysType(hardDetail.getType())
|
||||
.hourType("-1")
|
||||
.parentCarId(null)
|
||||
.hardId(dto.getHardwareId())
|
||||
.orderStatus(HardOrderStatusEnum.CREATE.getType())
|
||||
.merchantId(mch.getId())
|
||||
.merchantType(mch.getTypes())
|
||||
.merchantDeptId(mch.getDeptId())
|
||||
.deptId(hardDetail.getDeptId())
|
||||
.orderType(HardOrderTypeEnum.RESERVE.getType())
|
||||
.payType(HardPayTypeEnum.ACT_CANCEL.getType())
|
||||
.orderSourceTypeId(dto.getActItemId())
|
||||
.totalPrice(totalPrice)
|
||||
.extraPrice(extraPrice)
|
||||
.payPrice(totalPrice + extraPrice)
|
||||
.isOfflineOrder(YesNoEnum.NO.getCode())
|
||||
.productDesc(orderDesc)
|
||||
.build();
|
||||
baseMapper.insert(orderObj);
|
||||
// 核销
|
||||
ActComCancelDto cancelDto = new ActComCancelDto();
|
||||
cancelDto.setActItemId(dto.getActItemId());
|
||||
cancelDto.setUserId(dto.getUserId());
|
||||
cancelDto.setOrderId(orderObj.getId());
|
||||
cancelDto.setUseAmountPrice(useAmountPrice);
|
||||
Boolean isCancelSuccess = remoteComActService.remoteDoCancel(cancelDto).getData();
|
||||
if (!isCancelSuccess) {
|
||||
throw new RuntimeException("核销失败");
|
||||
}
|
||||
// 钱包扣款
|
||||
getSelf().fastReduceBalance(orderObj);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user