mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-03-06 12:23:44 +08:00
feat: 查询领取的优惠券时,增加couponMation返回字段
This commit is contained in:
parent
cdd0b8e861
commit
a4be9373da
3 changed files with 15 additions and 2 deletions
|
@ -14,6 +14,7 @@ import com.skyeye.common.entity.features.OperatorUserInfo;
|
|||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: CouponUse
|
||||
|
@ -36,6 +37,10 @@ public class CouponUse extends OperatorUserInfo {
|
|||
@ApiModelProperty(value = "优惠券id", required = "required")
|
||||
private String couponId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Property(value = "优惠券信息")
|
||||
private Map<String, Object> couponMation;
|
||||
|
||||
@TableField(value = "state")
|
||||
@Property(value = "状态,参考#CouponUseState")
|
||||
private Integer state;
|
||||
|
|
|
@ -185,8 +185,8 @@ public class CouponServiceImpl extends SkyeyeBusinessServiceImpl<CouponDao, Coup
|
|||
}
|
||||
|
||||
@Override
|
||||
public Coupon getFromCache(String id) {
|
||||
Coupon coupon = super.getFromCache(id);
|
||||
public Coupon getDataFromDb(String id) {
|
||||
Coupon coupon = super.getDataFromDb(id);
|
||||
coupon.setCouponMaterialList(couponMaterialService.queryListByCouponId(id));
|
||||
setDrawState(Collections.singletonList(coupon));// 设置是否可以领取状态
|
||||
return coupon;
|
||||
|
|
|
@ -149,6 +149,13 @@ public class CouponUseServiceImpl extends SkyeyeBusinessServiceImpl<CouponUseDao
|
|||
queryWrapper.eq(MybatisPlusUtil.toColumns(CouponUse::getState), CouponUseState.USED.getKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<Map<String, Object>> queryPageDataList(InputObject inputObject) {
|
||||
List<Map<String, Object>> mapList = super.queryPageDataList(inputObject);
|
||||
couponService.setMationForMap(mapList, "couponId", "couponMation");
|
||||
return mapList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> queryDataList(InputObject inputObject) {
|
||||
Map<String, Object> params = inputObject.getParams();
|
||||
|
@ -159,6 +166,7 @@ public class CouponUseServiceImpl extends SkyeyeBusinessServiceImpl<CouponUseDao
|
|||
}
|
||||
// 查询时获取数据
|
||||
List<CouponUse> list = list(queryWrapper);
|
||||
couponService.setDataMation(list, CouponUse::getCouponId);
|
||||
return JSONUtil.toList(JSONUtil.toJsonStr(list), null);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue