xiaoqiang 4 лет назад
Родитель
Сommit
1ede418c64

+ 2 - 4
src/main/java/org/springblade/gateway/point_gateway/service/impl/PointExchangeServiceImpl.java

@@ -67,8 +67,6 @@ public class PointExchangeServiceImpl implements PointExchangeService {
 	@Autowired
 	private IYeepayOrderService yeepayOrderService;
 	@Autowired
-	private ILoginUserService loginUserService;
-	@Autowired
 	private YeePayConst yeePayConst;
 	@Autowired
 	private BladeLogger bladeLogger;
@@ -422,7 +420,7 @@ public class PointExchangeServiceImpl implements PointExchangeService {
 	@Transactional(rollbackFor = Exception.class)
 	public HashMap<String, Object> merge(YeepayOrder yeepayOrder, int type) throws Exception {
 		HashMap<String, Object> map = new HashMap<>();
-		if (yeepayOrder.getUsePoint() != null && (yeepayOrder.getUsePoint().compareTo(BigDecimal.ZERO) <= 0)) {
+		if (yeepayOrder.getUsePoint() != null && (yeepayOrder.getUsePoint().compareTo(BigDecimal.ZERO) < 0)) {
 			throw new PointExchangeException("请输入有效积分值");
 		}
 		UserPufaPoint user = userPufaPointService.getOne(new LambdaQueryWrapper<UserPufaPoint>().eq(UserPufaPoint::getPhone, yeepayOrder.getPhone()));
@@ -486,7 +484,7 @@ public class PointExchangeServiceImpl implements PointExchangeService {
 				}
 
 				//如果用户输入的积分足够,则使用积分支付
-				if (user.getPufaPoint().compareTo(exchangePoint) > 0) {
+				if (yeepayOrder.getUsePoint().compareTo(exchangePoint) > 0) {
 					type = 1;
 					return this.merge(yeepayOrder,type);
 				}

+ 2 - 0
src/main/java/org/springblade/sing/active/service/IActiveHelpService.java

@@ -21,6 +21,8 @@ import org.springblade.sing.active.vo.ActiveHelpVO;
 import org.springblade.core.mp.base.BaseService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
+import java.util.List;
+
 /**
  * 活动记录 服务类
  *

+ 1 - 0
src/main/java/org/springblade/sing/active/service/impl/ActiveHelpServiceImpl.java

@@ -32,6 +32,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 活动记录 服务实现类

+ 2 - 0
src/main/java/org/springblade/sing/active/vo/ActiveHelpVO.java

@@ -33,4 +33,6 @@ import io.swagger.annotations.ApiModel;
 public class ActiveHelpVO extends ActiveHelp {
 	private static final long serialVersionUID = 1L;
 
+	private String activeName;
+
 }

+ 12 - 0
src/main/java/org/springblade/sing/active/wrapper/ActiveHelpWrapper.java

@@ -16,10 +16,16 @@
  */
 package org.springblade.sing.active.wrapper;
 
+import org.springblade.common.utils.SpringContextHolder;
 import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.sing.active.entity.ActiveHelp;
+import org.springblade.sing.active.entity.ActiveRecord;
+import org.springblade.sing.active.service.IActiveRecordService;
 import org.springblade.sing.active.vo.ActiveHelpVO;
+import org.springblade.sing.user.service.ILoginUserService;
+
 import java.util.Objects;
 
 /**
@@ -30,6 +36,7 @@ import java.util.Objects;
  */
 public class ActiveHelpWrapper extends BaseEntityWrapper<ActiveHelp, ActiveHelpVO>  {
 
+	private static final IActiveRecordService activeRecordService = SpringContextHolder.getBean(IActiveRecordService.class);
 	public static ActiveHelpWrapper build() {
 		return new ActiveHelpWrapper();
  	}
@@ -43,6 +50,11 @@ public class ActiveHelpWrapper extends BaseEntityWrapper<ActiveHelp, ActiveHelpV
 		//activeHelpVO.setCreateUserName(createUser.getName());
 		//activeHelpVO.setUpdateUserName(updateUser.getName());
 
+		ActiveRecord activeRecord = activeRecordService.getById(activeHelp.getActiveId());
+		if (ObjectUtil.isNotEmpty(activeRecord)){
+			activeHelpVO.setActiveName(activeRecord.getTitle());
+		}
+
 		return activeHelpVO;
 	}
 

+ 3 - 3
src/main/java/org/springblade/sing/point/controller/UserPufaPointController.java

@@ -68,7 +68,7 @@ public class UserPufaPointController extends BladeController {
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "分页", notes = "传入userPufaPoint")
 	public R<IPage<UserPufaPointVO>> list(UserPufaPoint userPufaPoint, Query query) {
-		IPage<UserPufaPoint> pages = userPufaPointService.page(Condition.getPage(query), Condition.getQueryWrapper(userPufaPoint));
+		IPage<UserPufaPoint> pages = userPufaPointService.page(Condition.getPage(query), Condition.getQueryWrapper(userPufaPoint).lambda().orderByDesc(UserPufaPoint::getPufaPoint));
 		return R.data(UserPufaPointWrapper.build().pageVO(pages));
 	}
 
@@ -114,7 +114,7 @@ public class UserPufaPointController extends BladeController {
 		return R.status(userPufaPointService.saveOrUpdate(userPufaPoint));
 	}
 
-	
+
 	/**
 	 * 删除 用户普法积分表
 	 */
@@ -125,5 +125,5 @@ public class UserPufaPointController extends BladeController {
 		return R.status(userPufaPointService.deleteLogic(Func.toLongList(ids)));
 	}
 
-	
+
 }