|
|
@@ -14,8 +14,11 @@ import org.springblade.sing.point.entity.CmccPointRecord;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
+
|
|
|
/**
|
|
|
* @Author: Silent
|
|
|
* @Description
|
|
|
@@ -37,8 +40,13 @@ public class AppHelpGoodsController {
|
|
|
@PostMapping("/exchangeProps")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiOperation(value = "兑换道具", notes = "传入pointRecord")
|
|
|
- public R exchangeProps(CmccPointRecord cmccPointRecord, CmccDectOrderRequest cmccDectOrderRequest){
|
|
|
+ public R exchangeProps(@RequestParam Long helpGoodsId,
|
|
|
+ @RequestParam Long userId,
|
|
|
+ CmccDectOrderRequest cmccDectOrderRequest){
|
|
|
try {
|
|
|
+ CmccPointRecord cmccPointRecord = new CmccPointRecord();
|
|
|
+ cmccPointRecord.setHelpGoodsId(helpGoodsId);
|
|
|
+ cmccPointRecord.setUserId(userId);
|
|
|
appHelpGoodsService.exchangeProps(cmccPointRecord,cmccDectOrderRequest);
|
|
|
return R.success("兑换成功");
|
|
|
} catch (Exception e) {
|
|
|
@@ -53,8 +61,24 @@ public class AppHelpGoodsController {
|
|
|
@PostMapping("/createPropsOrder")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiOperation(value = "创建道具订单", notes = "传入cmccPointRecord")
|
|
|
- public R createPropsOrder(CmccPointRecord cmccPointRecord, CmccPlaceOrderRequest cmccPlaceOrderRequest){
|
|
|
+ public R createPropsOrder(@RequestParam Long helpGoodsId,
|
|
|
+ @RequestParam Long userId,
|
|
|
+ @RequestParam String phone,
|
|
|
+ @RequestParam BigDecimal num,
|
|
|
+ @RequestParam String fingerprint,
|
|
|
+ @RequestParam String sessionId){
|
|
|
try {
|
|
|
+ CmccPlaceOrderRequest cmccPlaceOrderRequest = CmccPlaceOrderRequest
|
|
|
+ .builder()
|
|
|
+ .fingerprint(fingerprint)
|
|
|
+ .sessionId(sessionId)
|
|
|
+ .build();
|
|
|
+
|
|
|
+ CmccPointRecord cmccPointRecord = new CmccPointRecord();
|
|
|
+ cmccPointRecord.setHelpGoodsId(helpGoodsId);
|
|
|
+ cmccPointRecord.setNum(num);
|
|
|
+ cmccPointRecord.setPhone(phone);
|
|
|
+ cmccPointRecord.setUserId(userId);
|
|
|
//创建随机单号
|
|
|
appHelpGoodsService.createPropsOrder(cmccPointRecord, cmccPlaceOrderRequest);
|
|
|
return R.data(cmccPlaceOrderRequest.getOutOrderId());
|
|
|
@@ -70,9 +94,14 @@ public class AppHelpGoodsController {
|
|
|
@PostMapping("/sendCmccSms")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiOperation(value = "创建道具订单", notes = "传入cmccPlaceOrderRequest")
|
|
|
- public R sendCmccSms(CmccPlaceOrderRequest cmccPlaceOrderRequest){
|
|
|
+ public R sendCmccSms(@RequestParam String mobile,
|
|
|
+ @RequestParam String outOrderId){
|
|
|
try {
|
|
|
- //创建随机单号
|
|
|
+ CmccPlaceOrderRequest cmccPlaceOrderRequest = CmccPlaceOrderRequest
|
|
|
+ .builder()
|
|
|
+ .mobile(mobile)
|
|
|
+ .outOrderId(outOrderId)
|
|
|
+ .build();
|
|
|
CmccUtil.sendCmccSms(cmccPlaceOrderRequest);
|
|
|
return R.data(cmccPlaceOrderRequest.getOutOrderId());
|
|
|
} catch (Exception e) {
|