|
|
@@ -16,7 +16,10 @@ import org.springblade.payment.cmcc.exception.CmccRequestException;
|
|
|
import org.springblade.payment.cmcc.request.CmccDectOrderRequest;
|
|
|
import org.springblade.payment.cmcc.request.CmccPlaceOrderRequest;
|
|
|
import org.springblade.payment.cmcc.util.CmccUtil;
|
|
|
+import org.springblade.sing.goods.entity.GoodsRecord;
|
|
|
import org.springblade.sing.goods.entity.HelpGoods;
|
|
|
+import org.springblade.sing.goods.enums.GoodsRecordType;
|
|
|
+import org.springblade.sing.goods.service.IGoodsRecordService;
|
|
|
import org.springblade.sing.goods.service.IHelpGoodsService;
|
|
|
import org.springblade.sing.point.entity.CmccPointRecord;
|
|
|
import org.springblade.sing.point.entity.PointRecord;
|
|
|
@@ -48,6 +51,8 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
|
|
|
private IHelpGoodsService helpGoodsService;
|
|
|
@Autowired
|
|
|
private ICmccPointRecordService cmccPointRecordService;
|
|
|
+ @Autowired
|
|
|
+ private IGoodsRecordService goodsRecordService;
|
|
|
|
|
|
/**
|
|
|
* 移动积分兑换道具
|
|
|
@@ -106,6 +111,12 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
|
|
|
//修改用户信息
|
|
|
Assert.isTrue(loginUserService.updateById(loginUser),"兑换失败");
|
|
|
|
|
|
+ //添加道具兑换记录
|
|
|
+ GoodsRecord goodsRecord = new GoodsRecord();
|
|
|
+ goodsRecord.setHelpGoodsId(helpGoods.getId());
|
|
|
+ goodsRecord.setType(GoodsRecordType.HELP_GOODS_EXCHANGE);
|
|
|
+ Assert.isTrue(goodsRecordService.save(goodsRecord),"兑换失败");
|
|
|
+
|
|
|
//TODO 对接移动积分接口
|
|
|
if(ObjectUtils.isNotEmpty(helpGoods.getPoint()) && helpGoods.getPoint().longValue()>0L){
|
|
|
Assert.notNull(cmccDectOrderRequest.getOutOrderId(),"订单号不能为空");
|