Răsfoiți Sursa

添加账单查询

silent 4 ani în urmă
părinte
comite
89da117153

+ 4 - 0
ldt-core/src/main/java/org/springblade/gateway/common_gateway/entity/vo/AppBillsVO.java

@@ -1,6 +1,7 @@
 package org.springblade.gateway.common_gateway.entity.vo;
 
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springblade.ldt.bills.entity.Bills;
@@ -26,4 +27,7 @@ public class AppBillsVO extends Bills {
 	private String receiverName;
 	private String receiverLogo;
 
+	@ApiModelProperty("赠送积分费用")
+	private Double sendPoint;
+
 }

+ 13 - 3
ldt-core/src/main/java/org/springblade/gateway/common_gateway/wrapper/AppBillsWrapper.java

@@ -16,18 +16,21 @@
  */
 package org.springblade.gateway.common_gateway.wrapper;
 
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springblade.common.utils.SpringContextHolder;
 import org.springblade.core.mp.support.BaseEntityWrapper;
-import org.springblade.core.tenant.annotation.TenantIgnore;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.gateway.common_gateway.entity.vo.AppBillsVO;
 import org.springblade.ldt.bills.entity.Bills;
+import org.springblade.ldt.bills.entity.PointBills;
+import org.springblade.ldt.bills.service.IPointBillsService;
 import org.springblade.ldt.shop.entity.Shop;
 import org.springblade.ldt.shop.service.IShopService;
 import org.springblade.ldt.user.entity.LoginUser;
 import org.springblade.ldt.user.service.ILoginUserService;
 
 import java.util.Objects;
-import java.util.Optional;
 
 /**
  * 包装类,返回视图层所需的字段
@@ -39,6 +42,7 @@ public class AppBillsWrapper extends BaseEntityWrapper<Bills, AppBillsVO>  {
 
 	private ILoginUserService loginUserService;
 	private IShopService shopService;
+	private final static IPointBillsService pointBillsService = SpringContextHolder.getBean(IPointBillsService.class);
 
 	public AppBillsWrapper(ILoginUserService loginUserService) {
 		this.loginUserService = loginUserService;
@@ -76,7 +80,13 @@ public class AppBillsWrapper extends BaseEntityWrapper<Bills, AppBillsVO>  {
 				appBillsVO.setReceiverLogo(shop.getCover());
 			}
 		}
-
+		//查询积分账单
+		PointBills pointBills = pointBillsService.getOne(
+			Wrappers.<PointBills>lambdaQuery()
+				.eq(PointBills::getTradeNo, appBillsVO.getId()));
+		if(ObjectUtils.isNotEmpty(pointBills)){
+			appBillsVO.setSendPoint(-pointBills.getPrice().doubleValue());
+		}
 		return appBillsVO;
 	}