Merge branch 'master' of https://gitea.zianxin.com/zax/biz-api-cloud-zax
# Conflicts: # pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/controller/order/HardOrderController.java
This commit is contained in:
commit
6cdc873a02
55 files changed
+1229
-85
No files matched your search
@@ -332,6 +332,32 @@ CREATE TABLE hard_order_address
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='订单地址';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_take_out_appt
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `hard_take_out_appt`;
|
||||
CREATE TABLE hard_take_out_appt
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
order_id bigint NOT NULL COMMENT '订单id',
|
||||
|
||||
expect_delivery_type varchar(16) NOT NULL COMMENT 'IMMEDIATE:立即送;SCHEDULED:预约时段;',
|
||||
expect_delivery_date date DEFAULT NULL COMMENT '预约送达日历日(仅SCHEDULED使用)',
|
||||
expect_delivery_start time DEFAULT NULL COMMENT '预约时段开始时间',
|
||||
expect_delivery_end time DEFAULT NULL COMMENT '预约时段结束时间',
|
||||
expect_arrive_time datetime DEFAULT NULL COMMENT '立即送时预计送达时间点可选',
|
||||
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='外卖送达时间';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_after_sale
|
||||
-- ----------------------------
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.hard;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HandCancelActCodeDto {
|
||||
|
||||
@Schema(description = "用户id不能为空")
|
||||
@NotNull(message = "核销活动子id不能为空")
|
||||
private Long actItemId;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
+4
-2
@@ -4,7 +4,6 @@ import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardPayTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -56,7 +55,10 @@ public class HardAppCreateOrderDto {
|
||||
private Long apptId;
|
||||
|
||||
// 地址
|
||||
private HardAppTakeOutAddress address;
|
||||
private HardAppTakeOutAddressDto address;
|
||||
|
||||
// 预约时间信息
|
||||
private HardAppTakeOutApptDto appt;
|
||||
|
||||
@Schema(description = "IMMEDIATE立即送 | SCHEDULED预约时段")
|
||||
private String expectDeliveryType;
|
||||
|
||||
+7
-1
@@ -26,7 +26,13 @@ public class HardAppCreateTakeOutOrderDto {
|
||||
* 外卖地址
|
||||
*/
|
||||
@NotNull(message = "外卖地址不能为空")
|
||||
private HardAppTakeOutAddress address;
|
||||
private HardAppTakeOutAddressDto address;
|
||||
|
||||
/**
|
||||
* 外卖预约信息
|
||||
*/
|
||||
@NotNull(message = "预约时间信息不能为空")
|
||||
private HardAppTakeOutApptDto appt;
|
||||
|
||||
@Schema(description = "IMMEDIATE立即送(默认)| SCHEDULED预约时段")
|
||||
private String expectDeliveryType;
|
||||
|
||||
+1
-2
@@ -1,11 +1,10 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.order.app;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardAppTakeOutAddress {
|
||||
public class HardAppTakeOutAddressDto {
|
||||
|
||||
/**
|
||||
* 地址id
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.order.app;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
@Data
|
||||
public class HardAppTakeOutApptDto {
|
||||
|
||||
/**
|
||||
* IMMEDIATE:立即送;SCHEDULED:预约时段;
|
||||
*/
|
||||
@Schema(description = "IMMEDIATE:立即送;SCHEDULED:预约时段;")
|
||||
private String expectDeliveryType;
|
||||
|
||||
/**
|
||||
* 预约送达日历日(仅SCHEDULED使用)
|
||||
*/
|
||||
@Schema(description = "预约送达日历日(仅SCHEDULED使用)")
|
||||
private LocalDate expectDeliveryDate;
|
||||
|
||||
/**
|
||||
* 预约时段开始时间
|
||||
*/
|
||||
@Schema(description = "预约时段开始时间")
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime expectDeliveryStart;
|
||||
|
||||
/**
|
||||
* 预约时段结束时间
|
||||
*/
|
||||
@Schema(description = "预约时段结束时间")
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime expectDeliveryEnd;
|
||||
|
||||
/**
|
||||
* 立即送时预计送达时间点可选
|
||||
*/
|
||||
@Schema(description = "立即送时预计送达时间点可选")
|
||||
private LocalDateTime expectArriveTime;
|
||||
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
package com.bsd.pjcloud.hard.api.entity.order;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 外卖送达时间
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("hard_take_out_appt")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "外卖送达时间")
|
||||
public class HardTakeOutApptEntity extends Model<HardTakeOutApptEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@Schema(description = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* IMMEDIATE:立即送;SCHEDULED:预约时段;
|
||||
*/
|
||||
@Schema(description = "IMMEDIATE:立即送;SCHEDULED:预约时段;")
|
||||
private String expectDeliveryType;
|
||||
|
||||
/**
|
||||
* 预约送达日历日(仅SCHEDULED使用)
|
||||
*/
|
||||
@Schema(description = "预约送达日历日(仅SCHEDULED使用)")
|
||||
private LocalDate expectDeliveryDate;
|
||||
|
||||
/**
|
||||
* 预约时段开始时间
|
||||
*/
|
||||
@Schema(description = "预约时段开始时间")
|
||||
private LocalTime expectDeliveryStart;
|
||||
|
||||
/**
|
||||
* 预约时段结束时间
|
||||
*/
|
||||
@Schema(description = "预约时段结束时间")
|
||||
private LocalTime expectDeliveryEnd;
|
||||
|
||||
/**
|
||||
* 立即送时预计送达时间点可选
|
||||
*/
|
||||
@Schema(description = "立即送时预计送达时间点可选")
|
||||
private LocalDateTime expectArriveTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+8
-4
@@ -9,10 +9,7 @@ import com.bsd.pjcloud.hard.api.constant.HardProductNatureEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardPayTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.async.SyncOfflineReqVo;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HandCancelCodeDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HardBindDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HardCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HardDoneHardQrCodeScanOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.*;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardChartLatitudeVo;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardCreateCarDto;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardInvoiceVo;
|
||||
@@ -129,6 +126,13 @@ public class HardApiController {
|
||||
return R.ok(hardwareOrderService.handCancelCode(dto));
|
||||
}
|
||||
|
||||
@PostMapping("/cancel-act-code")
|
||||
@Operation(summary = "核销二维码")
|
||||
@Idempotent(expireTime = 10, key = "'/hard-api/ad/cancel-act-code' + #dto.getActItemId() ", info = "正在核销中,请勿重复操作")
|
||||
public R<Boolean> handCancelActCode(@Validated @RequestBody HandCancelActCodeDto dto) {
|
||||
return R.ok(hardwareOrderService.handCancelActCode(dto));
|
||||
}
|
||||
|
||||
@GetMapping("/generate-invoice")
|
||||
@Operation(summary = "生成发票")
|
||||
@Idempotent(expireTime = 10, info = "正在生成中,请勿重复操作")
|
||||
|
||||
+1
-5
@@ -221,11 +221,7 @@ public class HardOrderController {
|
||||
.apptId(null)
|
||||
.address(dto.getAddress())
|
||||
.deliveryPrice(dto.getDeliveryPrice())
|
||||
.expectDeliveryType(dto.getExpectDeliveryType())
|
||||
.expectDeliveryDate(dto.getExpectDeliveryDate())
|
||||
.expectDeliveryStart(dto.getExpectDeliveryStart())
|
||||
.expectDeliveryEnd(dto.getExpectDeliveryEnd())
|
||||
.expectArriveTime(dto.getExpectArriveTime())
|
||||
.appt(dto.getAppt())
|
||||
.build();
|
||||
return R.ok(hardwareOrderService.appCreateTakeOutOrder(createOrderDto));
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.bsd.pjcloud.hard.mapper.order;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardTakeOutApptEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface HardTakeOutApptMapper extends PjcloudBaseMapper<HardTakeOutApptEntity> {
|
||||
|
||||
}
|
||||
+6
@@ -10,6 +10,7 @@ import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardPayTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HandCancelActCodeDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HandCancelCodeDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HardCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HardDoneHardQrCodeScanOrderDto;
|
||||
@@ -159,6 +160,11 @@ public interface HardOrderService extends IService<HardOrderEntity> {
|
||||
*/
|
||||
Boolean handCancelCode(HandCancelCodeDto dto);
|
||||
|
||||
/**
|
||||
* 核销二维码
|
||||
*/
|
||||
Boolean handCancelActCode(HandCancelActCodeDto dto);
|
||||
|
||||
/**
|
||||
* 创建订单后发送mq消息
|
||||
*/
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.hard.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardTakeOutApptEntity;
|
||||
|
||||
public interface HardTakeOutApptService extends IService<HardTakeOutApptEntity> {
|
||||
|
||||
}
|
||||
+101
-5
@@ -45,6 +45,7 @@ import com.bsd.pjcloud.hard.api.constant.order.HardPayTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.xfj.HardXfjTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.ali.AliMicropayDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.ali.AliReverseDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HandCancelActCodeDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HardDoneHardQrCodeScanOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.manager.HardManagerDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HandCancelCodeDto;
|
||||
@@ -62,10 +63,7 @@ import com.bsd.pjcloud.hard.api.dto.wechat.WechatMicropayDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardApptEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardThirdMiOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.manager.HardManagerEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardCarEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderAddressEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardParentCarEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.*;
|
||||
import com.bsd.pjcloud.hard.api.entity.spu.HardSpuEntity;
|
||||
import com.bsd.pjcloud.hard.api.utils.HardUtil;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardDoorFlowVo;
|
||||
@@ -93,6 +91,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;
|
||||
@@ -102,6 +101,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;
|
||||
@@ -148,6 +148,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
private final AlipayService alipayService;
|
||||
private final MiniAlipayService miniAlipayService;
|
||||
private final HardOrderAddressService hardOrderAddressService;
|
||||
private final HardTakeOutApptService hardTakeOutApptService;
|
||||
|
||||
private final RemoteOnlineCanteenSpuService remoteOnlineCanteenSpuService;
|
||||
private final RemoteMchService remoteMchService;
|
||||
@@ -165,6 +166,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
private final RemoteShopSkuService remoteShopSkuService;
|
||||
private final RemoteActCancelService remoteActCancelService;
|
||||
private final RemoteMallProductService remoteMallProductService;
|
||||
private final RemoteComActService remoteComActService;
|
||||
|
||||
private final HardManagerMapper hardManagerMapper;
|
||||
|
||||
@@ -618,7 +620,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
|
||||
//效验是否有选择必选品
|
||||
R<OnlineSpuChoiceGroupsVO> choiceGroups = remoteOnlineCanteenSpuService.getChoiceGroups(String.valueOf(parentCar.getMerchantId()));
|
||||
if (!choiceGroups.isOk()){
|
||||
if (!choiceGroups.isOk()) {
|
||||
throw new RuntimeException("未选择必选菜品");
|
||||
}
|
||||
|
||||
@@ -702,6 +704,18 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
addressEntity.setFullAddress(dto.getAddress().getFullAddress());
|
||||
hardOrderAddressService.save(addressEntity);
|
||||
}
|
||||
// 添加预约时间信息
|
||||
if (ObjectUtil.isNotEmpty(dto.getAppt())) {
|
||||
HardTakeOutApptEntity apptEntity = new HardTakeOutApptEntity();
|
||||
apptEntity.setUserId(orderObj.getUserId());
|
||||
apptEntity.setOrderId(orderObj.getId());
|
||||
apptEntity.setExpectDeliveryType(dto.getAppt().getExpectDeliveryType());
|
||||
apptEntity.setExpectDeliveryDate(dto.getAppt().getExpectDeliveryDate());
|
||||
apptEntity.setExpectDeliveryStart(dto.getAppt().getExpectDeliveryStart());
|
||||
apptEntity.setExpectDeliveryEnd(dto.getAppt().getExpectDeliveryEnd());
|
||||
apptEntity.setExpectArriveTime(dto.getAppt().getExpectArriveTime());
|
||||
hardTakeOutApptService.save(apptEntity);
|
||||
}
|
||||
//调用外卖下单
|
||||
CanteenDeliveryOrderSyncDTO canteenDeliveryOrderSyncDTO = new CanteenDeliveryOrderSyncDTO();
|
||||
canteenDeliveryOrderSyncDTO.setBuyerUserId(dto.getUserId());
|
||||
@@ -1411,6 +1425,88 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
return baseMapper.updateById(updateObj) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 核销二维码
|
||||
*/
|
||||
@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. 查询商户
|
||||
MchManageVo mch = remoteMchService.getById(detail.getMchId()).getData();
|
||||
if (ObjectUtil.isEmpty(mch)) {
|
||||
throw new RuntimeException("商户不存在");
|
||||
}
|
||||
// 4. 是否已经核销过
|
||||
String errorMsg = remoteComActService.remoteIsCanCancel(dto.getActItemId(), dto.getUserId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(errorMsg)) {
|
||||
throw new RuntimeException(errorMsg);
|
||||
}
|
||||
// 5. 钱包(默认饭卡钱包)
|
||||
WalletManageEntity wallet = remoteWalletService.getWallet(dto.getUserId(), WalletTypeEnum.EAT).getData();
|
||||
|
||||
// 6. 创建订单
|
||||
|
||||
// 是否需要支付
|
||||
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(HardTypeEnum.NONE.getType())
|
||||
.hourType("-1")
|
||||
.parentCarId(null)
|
||||
// .hardId()
|
||||
.orderStatus(HardOrderStatusEnum.CREATE.getType())
|
||||
.merchantId(mch.getId())
|
||||
.merchantType(mch.getTypes())
|
||||
.merchantDeptId(mch.getDeptId())
|
||||
.deptId(mch.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 (ObjectUtil.isEmpty(isCancelSuccess) || !isCancelSuccess) {
|
||||
throw new RuntimeException("核销失败");
|
||||
}
|
||||
// 钱包扣款
|
||||
getSelf().fastReduceBalance(orderObj);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
// @GlobalTransactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.hard.service.impl.order;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardTakeOutApptEntity;
|
||||
import com.bsd.pjcloud.hard.mapper.order.HardTakeOutApptMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardTakeOutApptService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 外卖送达时间
|
||||
*/
|
||||
@Service
|
||||
public class HardTakeOutApptServiceImpl extends ServiceImpl<HardTakeOutApptMapper, HardTakeOutApptEntity> implements HardTakeOutApptService {
|
||||
|
||||
}
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.hard.mapper.order.HardTakeOutApptMapper">
|
||||
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.user_id,
|
||||
a.order_id,
|
||||
a.expect_delivery_type,
|
||||
a.expect_delivery_date,
|
||||
a.expect_delivery_start,
|
||||
a.expect_delivery_end,
|
||||
a.expect_arrive_time,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.tenant_id
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
a.del_flag = '0'
|
||||
<if test="dto.userId != null">
|
||||
and a.user_id = #{dto.userId}
|
||||
</if>
|
||||
<if test="dto.orderId != null">
|
||||
and a.order_id = #{dto.orderId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
@@ -48,5 +48,9 @@
|
||||
<version>5.7.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-upms-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.bsd.pjcloud.integrated.api.feign;
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import com.bsd.pjcloud.integrated.dto.ad.AdRecordDto;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@FeignClient(contextId = "remoteAdRecordService", value = ServiceNameConstants.INTEGRATED_SERVICE)
|
||||
public interface RemoteAdRecordService {
|
||||
|
||||
@NoToken
|
||||
@PostMapping("/ad-record/remote/count")
|
||||
R<Long> remoteCount(@RequestBody AdRecordDto dto);
|
||||
|
||||
}
|
||||
+6
-1
@@ -1,10 +1,14 @@
|
||||
package com.bsd.pjcloud.integrated.dto.ad;
|
||||
|
||||
import com.bsd.pjcloud.integrated.entity.ad.AdRecordEntity;
|
||||
import com.bsd.pjcloud.integrated.entity.AdRecordEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author liusiyang_dxm
|
||||
* @since 2026/4/10
|
||||
*/
|
||||
@Data
|
||||
public class AdRecordDto extends AdRecordEntity {
|
||||
|
||||
@@ -13,3 +17,4 @@ public class AdRecordDto extends AdRecordEntity {
|
||||
private LocalDateTime[] createTimeList;
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
package com.bsd.pjcloud.integrated.entity.ad;
|
||||
package com.bsd.pjcloud.integrated.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
+3
-2
@@ -1,9 +1,10 @@
|
||||
package com.bsd.pjcloud.integrated.vo.ad;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseUserDeptInterface;
|
||||
import com.bsd.pjcloud.integrated.entity.ad.AdRecordEntity;
|
||||
import com.bsd.pjcloud.integrated.entity.AdRecordEntity;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class AdRecordVo extends AdRecordEntity implements BaseUserDeptInterface {
|
||||
|
||||
@@ -16,4 +17,4 @@ public class AdRecordVo extends AdRecordEntity implements BaseUserDeptInterface
|
||||
private Long userDeptId;
|
||||
private String userDeptName;
|
||||
|
||||
}
|
||||
}
|
||||
+1
@@ -1 +1,2 @@
|
||||
com.bsd.pjcloud.integrated.api.feign.RemoteAdRecordService
|
||||
com.bsd.pjcloud.integrated.api.feign.RemoterIntegratedAdService
|
||||
+9
-3
@@ -11,10 +11,9 @@ import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.integrated.dto.ad.AdRecordDto;
|
||||
import com.bsd.pjcloud.integrated.entity.AdRecordEntity;
|
||||
import com.bsd.pjcloud.integrated.service.AdRecordService;
|
||||
import com.bsd.pjcloud.integrated.vo.ad.AdIntegralTotalVo;
|
||||
import com.bsd.pjcloud.integrated.vo.ad.AdRecordVo;
|
||||
import com.bsd.pjcloud.integrated.entity.ad.AdRecordEntity;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ad.UniappAdCallbackDto;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
@@ -42,13 +41,20 @@ public class AdRecordController {
|
||||
|
||||
/* ************************************* start 远程调用 start ************************************* */
|
||||
|
||||
@Operation(summary = "uniapp广告回调", description = "uniapp广告回调")
|
||||
@Inner
|
||||
@Operation(summary = "uniapp广告回调", description = "uniapp广告回调")
|
||||
@PostMapping("/uniapp-ad-callback")
|
||||
public R<Boolean> uniappAdCallback(@RequestBody UniappAdCallbackDto body) {
|
||||
return R.ok(adRecordService.uniappAdCallback(body));
|
||||
}
|
||||
|
||||
@Inner
|
||||
@Operation(summary = "观看广告列表", description = "观看广告列表")
|
||||
@PostMapping("/remote/count")
|
||||
public R<Long> remoteCount(@RequestBody AdRecordDto dto) {
|
||||
return R.ok(adRecordService.count(dto));
|
||||
}
|
||||
|
||||
/* ************************************* start 远程调用 start ************************************* */
|
||||
|
||||
/* ************************************* start app start ************************************* */
|
||||
|
||||
+4
-1
@@ -3,14 +3,17 @@ package com.bsd.pjcloud.integrated.mapper.ad;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.integrated.dto.ad.AdRecordDto;
|
||||
import com.bsd.pjcloud.integrated.entity.ad.AdRecordEntity;
|
||||
import com.bsd.pjcloud.integrated.entity.AdRecordEntity;
|
||||
import com.bsd.pjcloud.integrated.vo.ad.AdRecordVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ThirdAdRecordMapper extends PjcloudBaseMapper<AdRecordEntity> {
|
||||
|
||||
Page<AdRecordVo> selectPage(Page page, @Param("dto") AdRecordDto dto);
|
||||
|
||||
Long count(@Param("dto") AdRecordDto dto);
|
||||
}
|
||||
+8
-2
@@ -3,11 +3,12 @@ package com.bsd.pjcloud.integrated.service;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.integrated.dto.ad.AdRecordDto;
|
||||
import com.bsd.pjcloud.integrated.vo.ad.AdIntegralTotalVo;
|
||||
import com.bsd.pjcloud.integrated.entity.AdRecordEntity;
|
||||
import com.bsd.pjcloud.integrated.vo.ad.AdRecordVo;
|
||||
import com.bsd.pjcloud.integrated.entity.ad.AdRecordEntity;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ad.UniappAdCallbackDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AdRecordService extends IService<AdRecordEntity> {
|
||||
|
||||
/**
|
||||
@@ -21,4 +22,9 @@ public interface AdRecordService extends IService<AdRecordEntity> {
|
||||
Boolean reportAdView(AdRecordDto dto);
|
||||
|
||||
Page<AdRecordVo> pageList(Page page, AdRecordDto dto);
|
||||
|
||||
/**
|
||||
* 观看广告列表
|
||||
*/
|
||||
Long count(AdRecordDto dto);
|
||||
}
|
||||
+6
-1
@@ -13,10 +13,10 @@ import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.integrated.constant.ad.AdRecordStatus;
|
||||
import com.bsd.pjcloud.integrated.constant.ad.AdTypeEnum;
|
||||
import com.bsd.pjcloud.integrated.dto.ad.AdRecordDto;
|
||||
import com.bsd.pjcloud.integrated.entity.AdRecordEntity;
|
||||
import com.bsd.pjcloud.integrated.mapper.ad.ThirdAdRecordMapper;
|
||||
import com.bsd.pjcloud.integrated.service.AdRecordService;
|
||||
import com.bsd.pjcloud.integrated.vo.ad.AdRecordVo;
|
||||
import com.bsd.pjcloud.integrated.entity.ad.AdRecordEntity;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ad.UniappAdCallbackDto;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -88,6 +88,11 @@ public class AdRecordServiceImpl extends ServiceImpl<ThirdAdRecordMapper, AdReco
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long count(AdRecordDto dto) {
|
||||
return baseMapper.count(dto);
|
||||
}
|
||||
|
||||
public void disposePageList(List<AdRecordVo> records) {
|
||||
if (ObjectUtil.isEmpty(records)) return;
|
||||
List<Long> userIdList = records.stream().map(AdRecordVo::getUserId).distinct().filter(ObjectUtil::isNotNull).toList();
|
||||
|
||||
+26
-17
@@ -4,23 +4,23 @@
|
||||
<mapper namespace="com.bsd.pjcloud.integrated.mapper.ad.ThirdAdRecordMapper">
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.user_id,
|
||||
a.trans_id,
|
||||
a.ad_id,
|
||||
a.ad_type,
|
||||
a.ad_provider,
|
||||
a.visit_platform,
|
||||
a.visit_start_time,
|
||||
a.visit_end_time,
|
||||
a.visit_duration,
|
||||
a.status,
|
||||
a.extra,
|
||||
a.create_time,
|
||||
a.update_time,
|
||||
a.create_by,
|
||||
a.update_by,
|
||||
a.del_flag,
|
||||
a.tenant_id
|
||||
a.user_id,
|
||||
a.trans_id,
|
||||
a.ad_id,
|
||||
a.ad_type,
|
||||
a.ad_provider,
|
||||
a.visit_platform,
|
||||
a.visit_start_time,
|
||||
a.visit_end_time,
|
||||
a.visit_duration,
|
||||
a.status,
|
||||
a.extra,
|
||||
a.create_time,
|
||||
a.update_time,
|
||||
a.create_by,
|
||||
a.update_by,
|
||||
a.del_flag,
|
||||
a.tenant_id
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
@@ -53,4 +53,13 @@
|
||||
</where>
|
||||
order by a.create_time desc , a.id desc
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from ad_record a
|
||||
<where>
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
order by a.create_time desc , a.id desc
|
||||
</select>
|
||||
</mapper>
|
||||
+2
-1
@@ -9,13 +9,14 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 积分业务枚举
|
||||
* 积分业务枚举 exchange
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum WalletIntegralBizEnum {
|
||||
REWARDED_AD("1", "激励广告"),
|
||||
UPDATE("5", "更新积分"),
|
||||
EXCHANGE("10", "兑换"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.api.constant.act;
|
||||
|
||||
|
||||
public class ActUniqueCodeConstant {
|
||||
|
||||
public static final String REWARDED_AD_UNIQUE_CODE = "wbcHjM";
|
||||
|
||||
}
|
||||
+3
@@ -26,6 +26,9 @@ public enum ActUserReceiveEnum {
|
||||
PLEASE_RECEIVE_IN_BIRTH_MONTH("-100", "请在生日当月领取"),
|
||||
PLEASE_FILL_BIRTH_DATE("-101", "请填写出生日期"),
|
||||
BIRTHDAY_PERIOD_ENDED("-102", "生日已结束"),
|
||||
|
||||
// 积分不足
|
||||
INTEGRAL_NOT_ENOUGH("-200", "积分不足"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto.act;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ActComCancelDto {
|
||||
|
||||
/**
|
||||
* 活动子id
|
||||
*/
|
||||
@NotNull(message = "活动子id不能为空")
|
||||
private Long actItemId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 活动抵扣金额
|
||||
*/
|
||||
private Integer useAmountPrice;
|
||||
|
||||
}
|
||||
+2
@@ -20,4 +20,6 @@ public class ActCouponRecordDto extends ActCouponRecordEntity {
|
||||
|
||||
private Long parentActId;
|
||||
|
||||
private Long mchId;
|
||||
|
||||
}
|
||||
+6
@@ -26,6 +26,12 @@ public class ActAdEntity extends Model<ActAdEntity> {
|
||||
@Schema(description = "广告活动id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商户id
|
||||
*/
|
||||
@Schema(description = "商户id")
|
||||
private Long mchId;
|
||||
|
||||
/**
|
||||
* 广告活动唯一code
|
||||
*/
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.bsd.pjcloud.wallet.api.feign;
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActComCancelDto;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActComItemVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(contextId = "RemoteComActService", value = ServiceNameConstants.WALLET_SERVICE)
|
||||
public interface RemoteComActService {
|
||||
|
||||
/**
|
||||
* 根据活动id查询对应的活动
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/act/com/remote/get-act")
|
||||
R<ActComItemVo> remoteGetComAct(@RequestParam Long actItemId, @RequestParam Long userId);
|
||||
|
||||
/**
|
||||
* 活动是否能够核销
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/act/com/remote/is-can-cancel")
|
||||
R<String> remoteIsCanCancel(@RequestParam Long actItemId, @RequestParam Long userId);
|
||||
|
||||
/**
|
||||
* 核销活动
|
||||
*/
|
||||
@NoToken
|
||||
@PostMapping("/act/com/remote/do-cancel")
|
||||
R<Boolean> remoteDoCancel(@Validated @RequestBody ActComCancelDto body);
|
||||
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.act;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ActComItemVo<T> {
|
||||
|
||||
private String actType;
|
||||
|
||||
private Long actItemId;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Long mchId;
|
||||
|
||||
private String username;
|
||||
|
||||
private String userAvatar;
|
||||
|
||||
private T detail;
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.act;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ActSimpleNotfiyVo<T> {
|
||||
|
||||
private ActTypeEnum actType;
|
||||
|
||||
private Long actId;
|
||||
|
||||
private T detail;
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.act;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ActUserTotalVo {
|
||||
|
||||
/**
|
||||
* 所有活动总数
|
||||
*/
|
||||
private Long allCount;
|
||||
|
||||
/**
|
||||
* 核销活动总数
|
||||
*/
|
||||
private Long cancelCount;
|
||||
|
||||
/**
|
||||
* 优惠券活动总数
|
||||
*/
|
||||
private Long couponCount;
|
||||
|
||||
}
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
com.bsd.pjcloud.wallet.api.feign.RemoteActCancelService
|
||||
com.bsd.pjcloud.wallet.api.feign.RemoteWalletService
|
||||
com.bsd.pjcloud.wallet.api.feign.RemoteComActService
|
||||
com.bsd.pjcloud.wallet.api.feign.RemoteIntegralTransactionService
|
||||
com.bsd.pjcloud.wallet.api.feign.RemoteMchPickUpService
|
||||
com.bsd.pjcloud.wallet.api.feign.RemoteMchRuleJoinService
|
||||
|
||||
@@ -118,6 +118,12 @@
|
||||
<version>5.7.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-integrated-api</artifactId>
|
||||
<version>5.7.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<profiles>
|
||||
<profile>
|
||||
|
||||
+9
-6
@@ -50,17 +50,20 @@ public class ActAdController {
|
||||
|
||||
|
||||
@Operation(summary = "激励广告兑换券领取分页", description = "激励广告兑换券领取分页")
|
||||
@GetMapping("/app/rewarded-ad0-apply-coupon-page")
|
||||
public R<Page<ActCouponRecordVo>> rewardedAdApplyCouponPage(@ParameterObject Page page) {
|
||||
|
||||
@GetMapping("/app/rewarded-ad-apply-coupon-page")
|
||||
public R<Page<ActCouponRecordVo>> rewardedAdApplyCouponPage(@ParameterObject Page page, @ParameterObject ActCouponRecordDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
|
||||
ActCouponRecordDto dto = new ActCouponRecordDto();
|
||||
dto.setUserId(user.getId());
|
||||
|
||||
return R.ok(actAdService.rewardedAdApplyCouponPage(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "激励广告兑换券兑换", description = "激励广告兑换券兑换")
|
||||
@GetMapping("/app/rewarded-ad-apply-coupon")
|
||||
public R<Long> rewardedAdApplyCoupon(@RequestParam Long couponId) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
return R.ok(actAdService.appReceive(couponId, user.getId()));
|
||||
}
|
||||
|
||||
|
||||
/* ************************************* end app end ************************************* */
|
||||
|
||||
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.bsd.pjcloud.wallet.controller.act;
|
||||
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActComCancelDto;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActComItemVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActSimpleNotfiyVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActUserTotalVo;
|
||||
import com.bsd.pjcloud.wallet.service.ActComService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 活动公用方法
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/act/com")
|
||||
@Tag(description = "act-com", name = "活动公用方法")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class ActComController {
|
||||
|
||||
private final ActComService actComService;
|
||||
|
||||
/* ************************************* start 远程调用 start ************************************* */
|
||||
@Operation(summary = "根据公告id查询对应的活动", description = "根据公告id查询对应的活动")
|
||||
@GetMapping("/remote/get-act")
|
||||
@Inner
|
||||
public R<ActComItemVo> remoteGetComAct(@RequestParam Long actItemId, @RequestParam Long userId) {
|
||||
return R.ok(actComService.getComAct(actItemId, userId));
|
||||
}
|
||||
|
||||
@Operation(summary = "活动是否能够核销", description = "活动是否能够核销")
|
||||
@GetMapping("/remote/is-can-cancel")
|
||||
@Inner
|
||||
public R<String> remoteIsCanCancel(@RequestParam Long actItemId, @RequestParam Long userId) {
|
||||
return R.ok(actComService.actIsCanCancel(actItemId, userId));
|
||||
}
|
||||
|
||||
@Operation(summary = "核销活动", description = "核销活动")
|
||||
@PostMapping("/remote/do-cancel")
|
||||
@Inner
|
||||
public R<Boolean> remoteDoCancel(@Validated @RequestBody ActComCancelDto body) {
|
||||
return R.ok(actComService.doCancel(body));
|
||||
}
|
||||
/* ************************************* end 远程调用 end ************************************* */
|
||||
|
||||
|
||||
/* ************************************* start ad start ************************************* */
|
||||
@Operation(summary = "根据公告id查询对应的活动", description = "根据公告id查询对应的活动")
|
||||
@GetMapping("/ad/get-act")
|
||||
public R<ActComItemVo> getComAct(@RequestParam Long actItemId, @RequestParam Long userId) {
|
||||
return R.ok(actComService.getComAct(actItemId, userId));
|
||||
}
|
||||
/* ************************************* end ad end ************************************* */
|
||||
|
||||
@Operation(summary = "根据公告id查询对应的活动", description = "根据公告id查询对应的活动")
|
||||
@GetMapping("/app/get-act-by-notify-id")
|
||||
public R<ActSimpleNotfiyVo> getActByNotifyId(@RequestParam Long notifyId) {
|
||||
return R.ok(actComService.getActByNotifyId(notifyId));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取活动详情", description = "获取活动详情")
|
||||
@GetMapping("/app/get-act-detail")
|
||||
public R<ActSimpleNotfiyVo> getActDetail(@RequestParam ActTypeEnum actType, @RequestParam Long actId) {
|
||||
return R.ok(actComService.getActDetail(actType, actId));
|
||||
}
|
||||
|
||||
@Operation(summary = "判断用户是否可以参加活动", description = "判断用户是否可以参加活动")
|
||||
@GetMapping("/app/is-eligible-for-act")
|
||||
public R<String> isEligibleForAct(@RequestParam ActTypeEnum actType, @RequestParam Long actId) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
return R.ok(actComService.isEligibleForAct(actType, actId, user.getId()));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户参加活动的数量统计", description = "用户参加活动的数量统计")
|
||||
@GetMapping("/app/user-total")
|
||||
public R<ActUserTotalVo> userTotal() {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
return R.ok(actComService.userTotal(user.getId()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+7
@@ -66,6 +66,13 @@ public class ActCouponRecordController {
|
||||
return R.ok(actCouponRecordService.pageList(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app查询本店优惠券列表", description = "app查询本店优惠券列表")
|
||||
@GetMapping("/app/mch/page")
|
||||
public R<Page<ActCouponRecordVo>> appMchPage(@ParameterObject Page page, @ParameterObject ActCouponRecordDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
return R.ok(actCouponRecordService.appMchPage(page, user, dto));
|
||||
}
|
||||
|
||||
/* ************************************* end app end ************************************* */
|
||||
|
||||
/**
|
||||
|
||||
+8
-14
@@ -135,21 +135,15 @@ public class MchManageController {
|
||||
public R<Page<MchManageVo>> appPageJoin(@ParameterObject Page page, @ParameterObject MchManageDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
dto.setVisibleMobile(YesNoEnum.YES.getCode());
|
||||
if (ObjectUtil.equals(dto.getType(), MerchantTypeEnum.CANTEEN.getType())) {
|
||||
// 查询用户
|
||||
UserInfo userInfo = remoteUserService.getByUserId(user.getId()).getData();
|
||||
// 如果是食堂判断用户是否能查看到所有食堂
|
||||
boolean isConsumeUser = mchManageService.getIsConsumeUser(user.getId());
|
||||
if (isConsumeUser) {
|
||||
dto.setCanteenIsOpen(YesNoEnum.YES.getCode());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(userInfo)) {
|
||||
// 只能查到自己部门下面的食堂
|
||||
MchManageVo mch = mchManageService.getFirstMchByDeptId(userInfo.getSysUser().getDeptId(), List.of(MerchantTypeEnum.CANTEEN));
|
||||
if (ObjectUtil.isNotEmpty(mch)) {
|
||||
dto.setId(mch.getId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(user) && ObjectUtil.isNotEmpty(user.getDeptId())) {
|
||||
UserInfo userInfo = remoteUserService.getInnerByUserId(user.getId()).getData();
|
||||
List<SysDept> pageList = remoteDeptService.getDescendantList(userInfo.getSysUser().getDeptId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(pageList)) {
|
||||
List<Long> deptList = pageList.stream().map(SysDept::getDeptId).distinct().toList();
|
||||
dto.setDeptIds(deptList);
|
||||
}
|
||||
} else {
|
||||
R.ok(new Page<>());
|
||||
}
|
||||
return R.ok(mchManageService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public interface IntegralManageMapper extends PjcloudBaseMapper<IntegralManageEn
|
||||
.setSql(" integral_num = integral_num - " + integral + ", total_expense = total_expense + " + integral)
|
||||
.eq(IntegralManageEntity::getId, id);
|
||||
if (ObjectUtil.isEmpty(force) || !force) {
|
||||
lambdaUpdateWrapper.ge(IntegralManageEntity::getIntegralFreeze, integral);
|
||||
lambdaUpdateWrapper.ge(IntegralManageEntity::getIntegralNum, integral);
|
||||
}
|
||||
return update(null, lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
+5
@@ -29,4 +29,9 @@ public interface ActAdService extends IService<ActAdEntity> {
|
||||
* 激励广告兑换券领取分页
|
||||
*/
|
||||
Page<ActCouponRecordVo> rewardedAdApplyCouponPage(Page page, ActCouponRecordDto dto);
|
||||
|
||||
/**
|
||||
* 激励广告兑换券兑换
|
||||
*/
|
||||
Long appReceive(Long couponId, Long receiveUserId);
|
||||
}
|
||||
+18
@@ -3,6 +3,7 @@ package com.bsd.pjcloud.wallet.service;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActUserReceiveEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCancelItemDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCancelItemEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActCancelItemVo;
|
||||
@@ -22,6 +23,11 @@ public interface ActCancelItemService extends IService<ActCancelItemEntity> {
|
||||
*/
|
||||
ActCancelItemVo appFindUnique(Long actId, PjcloudUser user);
|
||||
|
||||
/**
|
||||
* 判断用户是否可以参加活动
|
||||
*/
|
||||
ActUserReceiveEnum isEligibleForAct(Long actId, Long userId);
|
||||
|
||||
/**
|
||||
* app查询本店优惠券列表
|
||||
*/
|
||||
@@ -32,8 +38,20 @@ public interface ActCancelItemService extends IService<ActCancelItemEntity> {
|
||||
*/
|
||||
Boolean cancel(ActCancelItemDto dto);
|
||||
|
||||
/**
|
||||
* 活动是否能够核销
|
||||
*/
|
||||
String actIsCanCancel(ActCancelItemDto detail);
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
ActCancelItemVo getDetail(Long cancelId);
|
||||
|
||||
ActCancelItemVo getDetail(Long actItemId, Long userId);
|
||||
|
||||
/**
|
||||
* 用户参加活动的数量统计
|
||||
*/
|
||||
Long userTotal(Long userId);
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActComCancelDto;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActComItemVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActSimpleNotfiyVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActUserTotalVo;
|
||||
|
||||
public interface ActComService {
|
||||
|
||||
/**
|
||||
* 获取活动
|
||||
*/
|
||||
ActComItemVo getComAct(Long actId, Long userId);
|
||||
|
||||
/**
|
||||
* 活动是否能够核销
|
||||
*
|
||||
* @return 错误信息
|
||||
*/
|
||||
String actIsCanCancel(Long actItemId, Long userId);
|
||||
|
||||
/**
|
||||
* 核销活动
|
||||
*/
|
||||
Boolean doCancel(ActComCancelDto body);
|
||||
|
||||
/**
|
||||
* 根据公告id查询对应的活动
|
||||
*/
|
||||
ActSimpleNotfiyVo getActByNotifyId(Long notifyId);
|
||||
|
||||
/**
|
||||
* 获取活动详情
|
||||
*/
|
||||
ActSimpleNotfiyVo getActDetail(ActTypeEnum actType, Long actId);
|
||||
|
||||
/**
|
||||
* 判断用户是否可以参加活动
|
||||
*/
|
||||
String isEligibleForAct(ActTypeEnum actType, Long actId, Long userId);
|
||||
|
||||
/**
|
||||
* 用户参加活动的数量统计
|
||||
*/
|
||||
ActUserTotalVo userTotal(Long userId);
|
||||
}
|
||||
+6
@@ -2,6 +2,7 @@ package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActUserReceiveEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCouponReceiveDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCouponRecordDto;
|
||||
@@ -46,4 +47,9 @@ public interface ActCouponRecordService extends IService<ActCouponRecordEntity>
|
||||
* 用户参加活动的数量统计
|
||||
*/
|
||||
Long userTotal(Long userId);
|
||||
|
||||
/**
|
||||
* app查询本店优惠券列表
|
||||
*/
|
||||
Page<ActCouponRecordVo> appMchPage(Page page, PjcloudUser user, ActCouponRecordDto dto);
|
||||
}
|
||||
+13
-6
@@ -8,10 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.*;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActAdDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCouponDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCouponRecordDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCreateAdCouponDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.*;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActAdEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActAdVo;
|
||||
@@ -24,6 +21,7 @@ import com.bsd.pjcloud.wallet.service.ActCouponService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -36,8 +34,6 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
public class ActAdServiceImpl extends ServiceImpl<ActAdMapper, ActAdEntity> implements ActAdService {
|
||||
|
||||
private final static String REWARDED_AD_UNIQUE_CODE = "wbcHjM";
|
||||
|
||||
private final ActCouponService actCouponService;
|
||||
private final ActCouponRecordService actCouponRecordService;
|
||||
|
||||
@@ -103,6 +99,17 @@ public class ActAdServiceImpl extends ServiceImpl<ActAdMapper, ActAdEntity> impl
|
||||
return actCouponRecordService.pageList(page, dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 激励广告兑换券兑换
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long appReceive(Long couponId, Long receiveUserId) {
|
||||
ActCouponReceiveDto dto = new ActCouponReceiveDto();
|
||||
dto.setReceiveUserId(receiveUserId);
|
||||
dto.setCouponId(couponId);
|
||||
return actCouponRecordService.appReceive(dto);
|
||||
}
|
||||
|
||||
/* ************************************* end app end ************************************* */
|
||||
|
||||
|
||||
+61
@@ -16,6 +16,7 @@ import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActCancelStatusEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActStatusEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActUserReceiveEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCancelItemDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCancelEntity;
|
||||
@@ -289,6 +290,66 @@ public class ActCancelItemServiceImpl extends ServiceImpl<ActCancelItemMapper, A
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 活动是否能够核销
|
||||
*/
|
||||
@Override
|
||||
public String actIsCanCancel(ActCancelItemDto dto) {
|
||||
if (ObjectUtil.isEmpty(dto.getId()) || ObjectUtil.isEmpty(dto.getCancelUserId())) {
|
||||
return "核销失败,参数错误";
|
||||
}
|
||||
// 查询活动
|
||||
ActCancelItemEntity detail = baseMapper.selectById(dto.getId());
|
||||
if (ObjectUtil.isEmpty(detail)) {
|
||||
return "核销失败,活动不存在";
|
||||
}
|
||||
// 查询核销用户
|
||||
UserInfo userDetail = remoteUserService.getInnerByUserId(dto.getCancelUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userDetail)) {
|
||||
return "核销失败,核销用户不存在";
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(detail.getExpireTime())) {
|
||||
if (detail.getExpireTime().isBefore(LocalDateTime.now())) {
|
||||
return "核销失败,您领取的优惠券已过期";
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.equals(detail.getActStatus(), ActCancelStatusEnum.CANCEL_SUCCESS.getCode())) {
|
||||
return "核销失败,您领取的优惠券已核销";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断用户是否可以参加活动
|
||||
*/
|
||||
@Override
|
||||
public ActUserReceiveEnum isEligibleForAct(Long actId, Long userId) {
|
||||
// 查询活动
|
||||
ActCancelEntity act = actCancelMapper.selectById(actId);
|
||||
if (ObjectUtil.isEmpty(act)) {
|
||||
return ActUserReceiveEnum.ACT_NOT_EXIST;
|
||||
}
|
||||
ActCancelItemEntity detail = baseMapper.selectOne(new LambdaQueryWrapper<ActCancelItemEntity>()
|
||||
.eq(ActCancelItemEntity::getActId, actId)
|
||||
.eq(ActCancelItemEntity::getReceiverUserId, userId)
|
||||
);
|
||||
if (ObjectUtil.isEmpty(detail)) {
|
||||
return ActUserReceiveEnum.USER_CAN_JOIN_ACT;
|
||||
}
|
||||
return ActUserReceiveEnum.USER_LIMIT_REACHED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActCancelItemVo getDetail(Long actItemId, Long userId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long userTotal(Long userId) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
// 判断车牌号是否重复
|
||||
private boolean existAct(Long userId, Long actId) {
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<ActCancelItemEntity>()
|
||||
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.act;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActCouponUseScopeTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActUserReceiveEnum;
|
||||
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.act.ActCancelEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponRecordEntity;
|
||||
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.act.ActSimpleNotfiyVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActUserTotalVo;
|
||||
import com.bsd.pjcloud.wallet.service.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 活动公用方法
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ActComServiceImpl implements ActComService {
|
||||
|
||||
private final ActCancelService actCancelService;
|
||||
private final ActCancelItemService actCancelItemService;
|
||||
|
||||
private final ActCouponService actCouponService;
|
||||
private final ActCouponRecordService actCouponRecordService;
|
||||
|
||||
private final RemoteUserService remoteUserService;
|
||||
|
||||
/**
|
||||
* 获取活动
|
||||
*/
|
||||
@Override
|
||||
public ActComItemVo getComAct(Long actItemId, Long userId) {
|
||||
ActComItemVo result = new ActComItemVo<>();
|
||||
List<ActTypeEnum> actEnumList = ActTypeEnum.sortList();
|
||||
for (ActTypeEnum act : actEnumList) {
|
||||
if (ObjectUtil.equals(act, ActTypeEnum.CANCEL_ACT)) {
|
||||
ActCancelItemVo detail = actCancelItemService.getDetail(actItemId, userId);
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
result.setActItemId(detail.getId());
|
||||
result.setActType(act.getCode());
|
||||
result.setMchId(detail.getMchId());
|
||||
result.setDetail(detail);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.equals(act, ActTypeEnum.COUPON_ACT)) {
|
||||
ActCouponRecordEntity detail = actCouponRecordService.getDetail(actItemId, userId);
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
ActCouponEntity actCouponDetail = actCouponService.getById(detail.getCouponId());
|
||||
result.setActItemId(detail.getId());
|
||||
result.setActType(act.getCode());
|
||||
if (ObjectUtil.isNotEmpty(actCouponDetail) && ObjectUtil.equals(actCouponDetail.getUseScopeType(), ActCouponUseScopeTypeEnum.SPECIFIED_MERCHANT.getCode())) {
|
||||
result.setMchId(Long.valueOf(actCouponDetail.getScopeId()));
|
||||
}
|
||||
result.setDetail(detail);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(result)) return null;
|
||||
// 查询用户
|
||||
UserInfo userInfo = remoteUserService.getInnerByUserId(userId).getData();
|
||||
if (ObjectUtil.isNotEmpty(userInfo)) {
|
||||
SysUser sysUser = userInfo.getSysUser();
|
||||
result.setUserId(sysUser.getUserId());
|
||||
result.setUsername(sysUser.getName());
|
||||
result.setUserAvatar(sysUser.getAvatar());
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动是否能够核销
|
||||
*
|
||||
* @return 错误信息
|
||||
*/
|
||||
@Override
|
||||
public String actIsCanCancel(Long actItemId, Long userId) {
|
||||
ActComItemVo comAct = getComAct(actItemId, userId);
|
||||
ActTypeEnum actType = ActTypeEnum.valueOfByType(comAct.getActType());
|
||||
switch (actType) {
|
||||
case CANCEL_ACT:
|
||||
return actCancelItemService.actIsCanCancel((ActCancelItemDto) comAct.getDetail());
|
||||
case COUPON_ACT:
|
||||
return actCouponRecordService.actIsCanCancel((ActCouponRecordEntity) comAct.getDetail());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 核销活动
|
||||
*/
|
||||
@Override
|
||||
public Boolean doCancel(ActComCancelDto body) {
|
||||
ActComItemVo comAct = getComAct(body.getActItemId(), body.getUserId());
|
||||
ActTypeEnum actType = ActTypeEnum.valueOfByType(comAct.getActType());
|
||||
switch (actType) {
|
||||
case CANCEL_ACT:
|
||||
actCancelItemService.cancel((ActCancelItemDto) comAct.getDetail());
|
||||
return true;
|
||||
case COUPON_ACT:
|
||||
actCouponRecordService.cancel((ActCouponRecordEntity) comAct.getDetail(), body.getOrderId(), body.getUseAmountPrice());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据公告id查询对应的活动
|
||||
*/
|
||||
@Override
|
||||
public ActSimpleNotfiyVo getActByNotifyId(Long notifyId) {
|
||||
ActSimpleNotfiyVo result = new ActSimpleNotfiyVo<>();
|
||||
List<ActTypeEnum> actEnumList = ActTypeEnum.sortList();
|
||||
for (ActTypeEnum act : actEnumList) {
|
||||
if (ObjectUtil.equals(act, ActTypeEnum.CANCEL_ACT)) {
|
||||
ActCancelEntity detail = actCancelService.getDetailByNoticeId(notifyId);
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
result.setActId(detail.getId());
|
||||
result.setActType(act);
|
||||
result.setDetail(detail);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.equals(act, ActTypeEnum.COUPON_ACT)) {
|
||||
ActCouponEntity detail = actCouponService.getDetailByNoticeId(notifyId);
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
result.setActId(detail.getId());
|
||||
result.setActType(act);
|
||||
result.setDetail(detail);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活动详情
|
||||
*/
|
||||
@Override
|
||||
public ActSimpleNotfiyVo getActDetail(ActTypeEnum actType, Long actId) {
|
||||
ActSimpleNotfiyVo result = new ActSimpleNotfiyVo<>();
|
||||
result.setActId(actId);
|
||||
if (ObjectUtil.equals(actType, ActTypeEnum.CANCEL_ACT)) {
|
||||
ActCancelEntity detail = actCancelService.getById(actId);
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
result.setActType(actType);
|
||||
result.setDetail(detail);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.equals(actType, ActTypeEnum.COUPON_ACT)) {
|
||||
ActCouponEntity detail = actCouponService.getById(actId);
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
result.setActType(actType);
|
||||
result.setDetail(detail);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断用户是否可以参加活动
|
||||
*/
|
||||
@Override
|
||||
public String isEligibleForAct(ActTypeEnum actType, Long actId, Long userId) {
|
||||
ActUserReceiveEnum status = ActUserReceiveEnum.USER_CANNOT_PARTICIPATE;
|
||||
// 核销活动目前只能参加一次
|
||||
if (ObjectUtil.equals(actType, ActTypeEnum.CANCEL_ACT)) {
|
||||
status = actCancelItemService.isEligibleForAct(actId, userId);
|
||||
}
|
||||
if (ObjectUtil.equals(actType, ActTypeEnum.COUPON_ACT)) {
|
||||
status = actCouponRecordService.isEligibleForAct(actId, userId);
|
||||
}
|
||||
return status.getCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户参加活动的数量统计
|
||||
*/
|
||||
@Override
|
||||
public ActUserTotalVo userTotal(Long userId) {
|
||||
ActUserTotalVo result = new ActUserTotalVo();
|
||||
// 查询用户参加核销活动的总数
|
||||
Long cancelCount = actCancelItemService.userTotal(userId);
|
||||
// 查询用户参加优惠券活动的总数
|
||||
Long couponCount = actCouponRecordService.userTotal(userId);
|
||||
result.setCancelCount(cancelCount);
|
||||
result.setCouponCount(couponCount);
|
||||
result.setAllCount(cancelCount + couponCount);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+71
-4
@@ -2,6 +2,7 @@ package com.bsd.pjcloud.wallet.service.impl.act;
|
||||
|
||||
import cn.hutool.core.collection.IterUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -10,17 +11,26 @@ import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.admin.api.utils.DataUtil;
|
||||
import com.bsd.pjcloud.admin.api.vo.UserVO;
|
||||
import com.bsd.pjcloud.common.core.constant.CommonRoleConstant;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.MerchantTypeEnum;
|
||||
import com.bsd.pjcloud.common.core.exception.ServiceException;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.wallet.api.constant.Integral.WalletIntegralBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActCouponRecordStatusEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActUniqueCodeConstant;
|
||||
import com.bsd.pjcloud.wallet.api.constant.act.ActUserReceiveEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCouponReceiveDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.act.ActCouponRecordDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActAdEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.act.ActCouponRecordEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.act.ActCouponRecordVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.act.ActAdMapper;
|
||||
import com.bsd.pjcloud.wallet.mapper.act.ActCouponMapper;
|
||||
import com.bsd.pjcloud.wallet.mapper.act.ActCouponRecordMapper;
|
||||
import com.bsd.pjcloud.wallet.service.*;
|
||||
@@ -31,6 +41,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -50,6 +61,11 @@ public class ActCouponRecordServiceImpl extends ServiceImpl<ActCouponRecordMappe
|
||||
private final ActCouponComUtilService actCouponComUtilService;
|
||||
private final ActCouponService actCouponService;
|
||||
private final WalletCodeUseService walletCodeUseService;
|
||||
private final IntegralManageService integralManageService;
|
||||
private final IntegralTransactionService integralTransactionService;
|
||||
private final MchManageService mchManageService;
|
||||
|
||||
private final ActAdMapper actAdMapper;
|
||||
|
||||
private final RemoteUserService remoteUserService;
|
||||
|
||||
@@ -106,7 +122,7 @@ public class ActCouponRecordServiceImpl extends ServiceImpl<ActCouponRecordMappe
|
||||
// 6. 领取后特殊处理
|
||||
specialReceive(actCouponEntity, record, sysUser);
|
||||
// 7. 生成核销二维码
|
||||
walletCodeUseService.generate(record.getId(), record.getUserId(), WalletCodeBizEnum.ACT, 1);
|
||||
// walletCodeUseService.generate(record.getId(), record.getUserId(), WalletCodeBizEnum.ACT, 1);
|
||||
return record.getId();
|
||||
}
|
||||
|
||||
@@ -155,14 +171,45 @@ public class ActCouponRecordServiceImpl extends ServiceImpl<ActCouponRecordMappe
|
||||
* 特殊处理领取后
|
||||
*/
|
||||
public void specialReceive(ActCouponEntity act, ActCouponRecordEntity record, SysUser sysUser) {
|
||||
String uniqueCode = act.getUniqueCode();
|
||||
ActAdEntity actAd = actAdMapper.selectById(act.getParentActId());
|
||||
// 我要赚米广告
|
||||
if (ObjectUtil.isNotEmpty(actAd) && ObjectUtil.equals(actAd.getUniqueCode(), ActUniqueCodeConstant.REWARDED_AD_UNIQUE_CODE)) {
|
||||
String json = act.getExtraJson();
|
||||
if (ObjectUtil.isEmpty(json)) return;
|
||||
ActCouponEntity.ActAdExtraJson actAdExtraJson = JSONUtil.toBean(json, ActCouponEntity.ActAdExtraJson.class);
|
||||
if (ObjectUtil.isEmpty(actAdExtraJson) || ObjectUtil.isEmpty(actAdExtraJson.getIntegralNum())) return;
|
||||
IntegralTransactionEntity integralTransaction = integralTransactionService.reduceIntegral(sysUser.getUserId(), actAdExtraJson.getIntegralNum(), WalletIntegralBizEnum.EXCHANGE, String.valueOf(record.getId()), false);
|
||||
if (ObjectUtil.isEmpty(integralTransaction)) {
|
||||
throw new RuntimeException("扣减积分错误");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 特殊领取规则
|
||||
*/
|
||||
public ActUserReceiveEnum specialCoupon(ActCouponEntity actCouponEntity, SysUser sysUser) {
|
||||
String uniqueCode = actCouponEntity.getUniqueCode();
|
||||
ActAdEntity actAd = actAdMapper.selectById(actCouponEntity.getParentActId());
|
||||
// 我要赚米广告
|
||||
if (ObjectUtil.isNotEmpty(actAd) && ObjectUtil.equals(actAd.getUniqueCode(), ActUniqueCodeConstant.REWARDED_AD_UNIQUE_CODE)) {
|
||||
String json = actCouponEntity.getExtraJson();
|
||||
if (ObjectUtil.isEmpty(json)) {
|
||||
return ActUserReceiveEnum.ACT_NOT_EXIST;
|
||||
}
|
||||
ActCouponEntity.ActAdExtraJson actAdExtraJson = JSONUtil.toBean(json, ActCouponEntity.ActAdExtraJson.class);
|
||||
if (ObjectUtil.isEmpty(actAdExtraJson)) {
|
||||
return ActUserReceiveEnum.ACT_NOT_EXIST;
|
||||
}
|
||||
// 查询积分
|
||||
IntegralManageEntity integralManage = integralManageService.getOrCreateIntegral(sysUser.getUserId());
|
||||
if (ObjectUtil.isEmpty(integralManage)) {
|
||||
return ActUserReceiveEnum.ACT_NOT_EXIST;
|
||||
}
|
||||
if (integralManage.getIntegralNum() < actAdExtraJson.getIntegralNum()) {
|
||||
return ActUserReceiveEnum.INTEGRAL_NOT_ENOUGH;
|
||||
}
|
||||
return ActUserReceiveEnum.USER_CAN_JOIN_ACT;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -197,6 +244,26 @@ public class ActCouponRecordServiceImpl extends ServiceImpl<ActCouponRecordMappe
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* app查询本店优惠券列表
|
||||
*/
|
||||
@Override
|
||||
public Page<ActCouponRecordVo> appMchPage(Page page, PjcloudUser user, ActCouponRecordDto dto) {
|
||||
if (ObjectUtil.isEmpty(user.getDeptId())) return null;
|
||||
// 查询用户
|
||||
UserInfo userInfo = remoteUserService.getByUserId(user.getId()).getData();
|
||||
if (ObjectUtil.isEmpty(userInfo)) return null;
|
||||
// 查询商户
|
||||
MchManageVo mchDetail = mchManageService.getByDeptId(userInfo.getSysUser().getDeptId(), MerchantTypeEnum.SUPERMARKET);
|
||||
if (ObjectUtil.isEmpty(mchDetail)) return null;
|
||||
// 判断是否有商户权限
|
||||
if (ObjectUtil.isEmpty(userInfo.getRoleCodes()) || !Arrays.asList(userInfo.getRoleCodes()).contains(CommonRoleConstant.MCH_USER)) {
|
||||
return null;
|
||||
}
|
||||
dto.setMchId(mchDetail.getId());
|
||||
return baseMapper.pageList(page, dto);
|
||||
}
|
||||
|
||||
private void disposePageList(List<ActCouponRecordVo> list) {
|
||||
// 用户
|
||||
List<Long> userIds = list.stream().map(ActCouponRecordVo::getUserId).distinct().toList();
|
||||
|
||||
+8
-4
@@ -74,16 +74,20 @@ public class ActCouponServiceImpl extends ServiceImpl<ActCouponMapper, ActCoupon
|
||||
entiy.setParentActId(actAdDetail.getId());
|
||||
entiy.setUniqueCode(generateUniqueCode());
|
||||
entiy.setName(actAdDetail.getName() + "-优惠券活动");
|
||||
entiy.setType(ActCouponTypeEnum.DUIHUAN_QUAN.getCode());
|
||||
entiy.setType(ActCouponTypeEnum.LIJIAN_QUAN.getCode());
|
||||
entiy.setMinPoint(null);
|
||||
entiy.setTotalCount(-1);
|
||||
entiy.setSurplusCount(-1);
|
||||
entiy.setLimitCount(1);
|
||||
entiy.setLimitType(ActCouponLimitTypeEnum.ONCE.getCode());
|
||||
entiy.setLimitCount(999);
|
||||
entiy.setLimitType(ActCouponLimitTypeEnum.EVERY_DAY.getCode());
|
||||
entiy.setValidType(ActCouponValidTypeEnum.FIXED_DATE.getCode());
|
||||
entiy.setValidStartTime(actAdDetail.getStartTime());
|
||||
entiy.setValidEndTime(actAdDetail.getEndTime());
|
||||
entiy.setUseScopeType(ActCouponUseScopeTypeEnum.ALL_USE.getCode());
|
||||
entiy.setUseScopeType(ActCouponUseScopeTypeEnum.SPECIFIED_MERCHANT.getCode());
|
||||
entiy.setScopeId(String.valueOf(actAdDetail.getMchId()));
|
||||
if (ObjectUtil.isEmpty(dto.getStatus())) {
|
||||
entiy.setStatus(ActCouponStatusEnum.JINXINGZHONG.getCode());
|
||||
}
|
||||
baseMapper.insert(entiy);
|
||||
return entiy.getId();
|
||||
}
|
||||
|
||||
+20
-1
@@ -11,6 +11,10 @@ import com.bsd.pjcloud.admin.api.utils.DataUtil;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.integrated.api.feign.RemoteAdRecordService;
|
||||
import com.bsd.pjcloud.integrated.constant.ad.AdRecordStatus;
|
||||
import com.bsd.pjcloud.integrated.constant.ad.AdTypeEnum;
|
||||
import com.bsd.pjcloud.integrated.dto.ad.AdRecordDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.integral.IntegralManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.integral.IntegralManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletSettingVo;
|
||||
@@ -24,6 +28,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -39,6 +44,7 @@ public class IntegralManageServiceImpl extends ServiceImpl<IntegralManageMapper,
|
||||
private final WalletSettingService walletSettingService;
|
||||
|
||||
private final RemoteUserService remoteUserService;
|
||||
private final RemoteAdRecordService remoteAdRecordService;
|
||||
|
||||
/**
|
||||
* 创建或获取用户积分
|
||||
@@ -61,6 +67,8 @@ public class IntegralManageServiceImpl extends ServiceImpl<IntegralManageMapper,
|
||||
*/
|
||||
@Override
|
||||
public IntegralMakeMoneyTotalVo makeMoneyTotal(Long userId) {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
IntegralMakeMoneyTotalVo result = new IntegralMakeMoneyTotalVo();
|
||||
// 积分
|
||||
IntegralManageEntity integral = getSelf().getOrCreateIntegral(userId);
|
||||
@@ -74,7 +82,18 @@ public class IntegralManageServiceImpl extends ServiceImpl<IntegralManageMapper,
|
||||
result.setViewAdIntegralNum(setting.getRewardedAdIntegral());
|
||||
}
|
||||
// 今日已看视频
|
||||
|
||||
AdRecordDto queryDto = new AdRecordDto();
|
||||
queryDto.setUserId(userId);
|
||||
queryDto.setAdType(AdTypeEnum.UNIAPP_REWARDED.getType());
|
||||
queryDto.setCreateTimeList(new LocalDateTime[]{
|
||||
now.withHour(0).withMinute(0).withSecond(0),
|
||||
now.withHour(23).withMinute(59).withSecond(59)
|
||||
});
|
||||
queryDto.setStatus(AdRecordStatus.SUCCESS.getType());
|
||||
Long todayViewAdNum = remoteAdRecordService.remoteCount(queryDto).getData();
|
||||
if (ObjectUtil.isNotEmpty(todayViewAdNum)) {
|
||||
result.setTodayViewAdNum(todayViewAdNum.intValue());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<mapper namespace="com.bsd.pjcloud.wallet.mapper.act.ActAdMapper">
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.mch_id,
|
||||
a.unique_code,
|
||||
a.name,
|
||||
a.description,
|
||||
@@ -23,6 +24,9 @@
|
||||
|
||||
<sql id="whereA">
|
||||
a.del_flag = '0'
|
||||
<if test="dto.mchId != null">
|
||||
and a.mch_id = #{dto.mchId}
|
||||
</if>
|
||||
<if test="dto.uniqueCode != null and dto.uniqueCode != '' ">
|
||||
and a.unique_code = #{dto.uniqueCode}
|
||||
</if>
|
||||
|
||||
+3
@@ -34,6 +34,9 @@
|
||||
<if test="dto.userId != null">
|
||||
and a.user_id = #{dto.userId}
|
||||
</if>
|
||||
<if test="dto.userName != null and dto.userName != '' ">
|
||||
and a.user_name LIKE concat('%',#{dto.userName},'%')
|
||||
</if>
|
||||
<if test="dto.status != null and dto.status != '' ">
|
||||
and a.status = #{dto.status}
|
||||
</if>
|
||||
|
||||
Reference in new issue
Block a user