silent пре 4 година
родитељ
комит
290e98abb6
26 измењених фајлова са 1098 додато и 25 уклоњено
  1. 6 0
      pom.xml
  2. 72 0
      src/main/java/org/springblade/common/utils/SpringContextHolder.java
  3. 21 3
      src/main/java/org/springblade/gateway/goods_gateway/controller/AppHelpGoodsController.java
  4. 6 2
      src/main/java/org/springblade/gateway/goods_gateway/service/AppHelpGoodsService.java
  5. 59 14
      src/main/java/org/springblade/gateway/goods_gateway/service/impl/AppHelpGoodsServiceImpl.java
  6. 23 0
      src/main/java/org/springblade/gateway/point_gateway/enums/CmccPayStatus.java
  7. 39 0
      src/main/java/org/springblade/payment/cmcc/callback/CmccPayMentCallbackController.java
  8. 40 0
      src/main/java/org/springblade/payment/cmcc/config/CmccPointConfig.java
  9. 28 0
      src/main/java/org/springblade/payment/cmcc/enums/CmccResponseStatus.java
  10. 22 0
      src/main/java/org/springblade/payment/cmcc/exception/CmccRequestException.java
  11. 36 0
      src/main/java/org/springblade/payment/cmcc/request/CmccDectOrderRequest.java
  12. 38 0
      src/main/java/org/springblade/payment/cmcc/request/CmccPlaceOrderRequest.java
  13. 37 0
      src/main/java/org/springblade/payment/cmcc/request/CmccRequest.java
  14. 27 0
      src/main/java/org/springblade/payment/cmcc/response/CmccResponse.java
  15. 147 0
      src/main/java/org/springblade/payment/cmcc/util/CmccUtil.java
  16. 129 0
      src/main/java/org/springblade/sing/point/controller/CmccPointRecordController.java
  17. 34 0
      src/main/java/org/springblade/sing/point/dto/CmccPointRecordDTO.java
  18. 80 0
      src/main/java/org/springblade/sing/point/entity/CmccPointRecord.java
  19. 0 6
      src/main/java/org/springblade/sing/point/entity/PointRecord.java
  20. 42 0
      src/main/java/org/springblade/sing/point/mapper/CmccPointRecordMapper.java
  21. 28 0
      src/main/java/org/springblade/sing/point/mapper/CmccPointRecordMapper.xml
  22. 41 0
      src/main/java/org/springblade/sing/point/service/ICmccPointRecordService.java
  23. 41 0
      src/main/java/org/springblade/sing/point/service/impl/CmccPointRecordServiceImpl.java
  24. 36 0
      src/main/java/org/springblade/sing/point/vo/CmccPointRecordVO.java
  25. 49 0
      src/main/java/org/springblade/sing/point/wrapper/CmccPointRecordWrapper.java
  26. 17 0
      src/main/resources/application-dev.yml

+ 6 - 0
pom.xml

@@ -200,6 +200,12 @@
             <artifactId>lombok</artifactId>
             <scope>provided</scope>
         </dependency>
+        <!-- Hutool -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.7.16</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 72 - 0
src/main/java/org/springblade/common/utils/SpringContextHolder.java

@@ -0,0 +1,72 @@
+package org.springblade.common.utils;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+/**
+ * @ClassName SpringContextHolder
+ * @Description: 以静态变量保存Spring ApplicationContext, 可在任何代码任何地方任何时候取出ApplicaitonContext
+ * @Auther: Silent
+ * @Date: 2019/1/11 21:15
+ * @version: 1.0
+ */
+@Component
+public class SpringContextHolder implements ApplicationContextAware {
+
+    private static ApplicationContext applicationContext = null;
+
+    /**
+     * 实现ApplicationContextAware接口, 注入Context到静态变量中.
+     */
+	@Override
+    public void setApplicationContext(ApplicationContext appContext) {
+        applicationContext = appContext;
+    }
+
+    /**
+     * 取得存储在静态变量中的ApplicationContext.
+     */
+    public static ApplicationContext getApplicationContext() {
+        checkApplicationContext();
+        return applicationContext;
+    }
+
+    /**
+     * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型.
+     */
+    public static <T> T getBean(String name) {
+        checkApplicationContext();
+        return (T) applicationContext.getBean(name);
+    }
+
+
+    /**
+     * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型.
+     */
+    public static <T> T getBean(Class<T> requiredType) {
+        checkApplicationContext();
+        return applicationContext.getBean(requiredType);
+    }
+
+    /**
+     * 清除SpringContextHolder中的ApplicationContext为Null.
+     */
+    public static void clearHolder() {
+        applicationContext = null;
+    }
+
+    /**
+     * @Description check applicationContext 是否为null
+     * @Author Silent
+     * @Date 2019/1/13 14:29
+     * @Param []
+     * @return void
+     */
+    private static void checkApplicationContext() {
+        if (applicationContext == null) {
+            throw new IllegalStateException("applicaitonContext未注入,请在applicationContext.xml中定义SpringContextHolder");
+        }
+    }
+
+}

+ 21 - 3
src/main/java/org/springblade/gateway/goods_gateway/controller/AppHelpGoodsController.java

@@ -7,7 +7,9 @@ import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springblade.core.tool.api.R;
 import org.springblade.gateway.goods_gateway.service.AppHelpGoodsService;
-import org.springblade.sing.point.entity.PointRecord;
+import org.springblade.payment.cmcc.request.CmccDectOrderRequest;
+import org.springblade.payment.cmcc.request.CmccPlaceOrderRequest;
+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;
@@ -34,13 +36,29 @@ public class AppHelpGoodsController {
 	@PostMapping("/exchangeProps")
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "兑换道具", notes = "传入pointRecord")
-	public R exchangeProps(PointRecord pointRecord){
+	public R exchangeProps(CmccPointRecord cmccPointRecord, CmccDectOrderRequest cmccDectOrderRequest){
 		try {
-			appHelpGoodsService.exchangeProps(pointRecord);
+			appHelpGoodsService.exchangeProps(cmccPointRecord,cmccDectOrderRequest);
 			return R.success("兑换成功");
 		} catch (Exception e) {
 			log.error(e.getMessage());
 			return R.fail(e.getMessage());
 		}
 	}
+
+	/**
+	 * 创建道具订单
+	 */
+	@PostMapping("/exchangeProps")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "兑换道具", notes = "传入pointRecord")
+	public R exchangeProps(CmccPointRecord cmccPointRecord, CmccPlaceOrderRequest cmccPlaceOrderRequest){
+		try {
+			appHelpGoodsService.createPropsOrder(cmccPointRecord, cmccPlaceOrderRequest);
+			return R.success("创建订单成功");
+		} catch (Exception e) {
+			log.error(e.getMessage());
+			return R.fail(e.getMessage());
+		}
+	}
 }

+ 6 - 2
src/main/java/org/springblade/gateway/goods_gateway/service/AppHelpGoodsService.java

@@ -1,6 +1,8 @@
 package org.springblade.gateway.goods_gateway.service;
 
-import org.springblade.sing.point.entity.PointRecord;
+import org.springblade.payment.cmcc.request.CmccDectOrderRequest;
+import org.springblade.payment.cmcc.request.CmccPlaceOrderRequest;
+import org.springblade.sing.point.entity.CmccPointRecord;
 
 /**
  * @Author: Silent
@@ -9,5 +11,7 @@ import org.springblade.sing.point.entity.PointRecord;
  * @Modified By:
  */
 public interface AppHelpGoodsService {
-	void exchangeProps(PointRecord pointRecord);
+	void exchangeProps(CmccPointRecord cmccPointRecord, CmccDectOrderRequest cmccDectOrderRequest);
+
+	void createPropsOrder(CmccPointRecord cmccPointRecord, CmccPlaceOrderRequest cmccPlaceOrderRequest);
 }

+ 59 - 14
src/main/java/org/springblade/gateway/goods_gateway/service/impl/AppHelpGoodsServiceImpl.java

@@ -2,15 +2,24 @@ package org.springblade.gateway.goods_gateway.service.impl;
 
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import io.jsonwebtoken.lang.Assert;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springblade.common.utils.BeanPropertyUtil;
 import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.gateway.active_gateway.exception.AppActiveProductException;
 import org.springblade.gateway.goods_gateway.exception.HelpGoodsException;
 import org.springblade.gateway.goods_gateway.service.AppHelpGoodsService;
+import org.springblade.gateway.point_gateway.enums.CmccPayStatus;
 import org.springblade.gateway.point_gateway.enums.PointTypeEnum;
+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.HelpGoods;
 import org.springblade.sing.goods.service.IHelpGoodsService;
+import org.springblade.sing.point.entity.CmccPointRecord;
 import org.springblade.sing.point.entity.PointRecord;
+import org.springblade.sing.point.service.ICmccPointRecordService;
 import org.springblade.sing.point.service.IPointRecordService;
 import org.springblade.sing.user.entity.LoginUser;
 import org.springblade.sing.user.service.ILoginUserService;
@@ -27,6 +36,7 @@ import java.math.BigDecimal;
  * @Modified By:
  */
 @Service
+@Slf4j
 public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
 	@Autowired
 	private ILoginUserService loginUserService;
@@ -34,20 +44,22 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
 	private IPointRecordService pointRecordService;
 	@Autowired
 	private IHelpGoodsService helpGoodsService;
+	@Autowired
+	private ICmccPointRecordService cmccPointRecordService;
 
 	/**
 	 * 移动积分兑换道具
-	 * @param pointRecord
+	 * @param cmccPointRecord
 	 * @return
 	 */
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void exchangeProps(PointRecord pointRecord) {
+	public void exchangeProps(CmccPointRecord cmccPointRecord,CmccDectOrderRequest cmccDectOrderRequest) {
 		//获取道具商品
-		HelpGoods helpGoods = helpGoodsService.getById(pointRecord.getHelpGoodsId());
+		HelpGoods helpGoods = helpGoodsService.getById(cmccPointRecord.getHelpGoodsId());
 		Assert.notNull(helpGoods,"没有找到该道具");
 		//获取用户信息
-		LoginUser loginUser = loginUserService.getById(pointRecord.getUserId());
+		LoginUser loginUser = loginUserService.getById(cmccPointRecord.getUserId());
 		Assert.notNull(loginUser,"没有找到该用户");
 
 		//判断用户今天购买该商品次数是否超过限制(-1标识不限制次数)
@@ -60,14 +72,14 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
 					.append(",\"%Y-%m-%d\")=\"")
 					.append(DateUtil.format(DateUtil.now(),"yyyy-MM-dd").trim()).append("\"").toString()));
 			//购买次数>=允许购买的次数
-			if(count>=helpGoods.getTotal()){
-				throw new HelpGoodsException("您今日购买次数达到上限");
+			if((cmccPointRecord.getNum().longValue()+count)>helpGoods.getTotal()){
+				throw new HelpGoodsException("您购买次数超过上限");
 			}
 		}
 
 		//判断是否赠送积分
 		if(ObjectUtils.isNotEmpty(helpGoods.getPufaPointRate()) && helpGoods.getPufaPointRate().intValue()>0){
-			loginUser.setPufaPoint(loginUser.getPufaPoint().add(helpGoods.getPufaPointRate()));
+			loginUser.setPufaPoint(loginUser.getPufaPoint().add(helpGoods.getPufaPointRate().multiply(cmccPointRecord.getNum())));
 
 			//添加普法积分增加
 			PointRecord pufaPointRecord = new PointRecord();
@@ -80,7 +92,7 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
 
 		//判断是否赠送票数
 		if(ObjectUtils.isNotEmpty(helpGoods.getVotePointRate()) && helpGoods.getVotePointRate().intValue()>0){
-			loginUser.setVoteCount(BigDecimal.valueOf(loginUser.getVoteCount()).add(helpGoods.getVotePointRate()).longValue());
+			loginUser.setVoteCount(BigDecimal.valueOf(loginUser.getVoteCount()).add(helpGoods.getVotePointRate().multiply(cmccPointRecord.getNum())).longValue());
 		}
 
 		//修改用户信息
@@ -88,13 +100,46 @@ public class AppHelpGoodsServiceImpl implements AppHelpGoodsService {
 
 		//TODO 对接移动积分接口
 		if(ObjectUtils.isNotEmpty(helpGoods.getPoint()) && helpGoods.getPoint().longValue()>0L){
+			//查询移动订单记录
+			CmccPointRecord oldCmccPointRecord = cmccPointRecordService.getOne(Wrappers.<CmccPointRecord>lambdaQuery().eq(CmccPointRecord::getOutOrderId, cmccPointRecord.getOutOrderId()));
+			Assert.notNull(oldCmccPointRecord,"没有找到移动支付订单");
+
 			//添加移动积分兑换记录
-			PointRecord cmccPointRecord = new PointRecord();
-			cmccPointRecord.setPoint(helpGoods.getPoint());
-			cmccPointRecord.setHelpGoodsId(helpGoods.getId());
-			cmccPointRecord.setPointType(PointTypeEnum.CMCC_POINT_EXCHANGE);
-			cmccPointRecord.setUserId(loginUser.getId());
-			Assert.isTrue(pointRecordService.save(cmccPointRecord),"兑换失败");
+			PointRecord pointRecord = new PointRecord();
+			pointRecord.setPoint(helpGoods.getPoint());
+			pointRecord.setHelpGoodsId(helpGoods.getId());
+			pointRecord.setUserId(loginUser.getId());
+			Assert.isTrue(pointRecordService.save(pointRecord),"兑换失败");
+
+			//设置状态为支付成功
+			oldCmccPointRecord.setPayStatus(CmccPayStatus.SUCCESS);
+
+			//更新支付状态
+			Assert.isTrue(cmccPointRecordService.updateById(oldCmccPointRecord));
+
+			// TODO 移动支付逻辑
+			cmccDectOrderRequest.setOutOrderId(cmccPointRecord.getOutOrderId());
+			try {
+				CmccUtil.dectOrder(cmccDectOrderRequest);
+			} catch (CmccRequestException e) {
+				throw new AppActiveProductException(e.getMessage());
+			}
 		}
 	}
+
+	/**
+	 * 创建道具订单
+	 * @param cmccPointRecord
+	 */
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void createPropsOrder(CmccPointRecord cmccPointRecord, CmccPlaceOrderRequest cmccPlaceOrderRequest) {
+		//获取道具id
+		HelpGoods helpGoods = helpGoodsService.getById(cmccPointRecord.getHelpGoodsId());
+		Assert.notNull(helpGoods,"没有找到该道具");
+
+		//设置状态为待支付
+		cmccPointRecord.setPayStatus(CmccPayStatus.WAIT);
+
+	}
 }

+ 23 - 0
src/main/java/org/springblade/gateway/point_gateway/enums/CmccPayStatus.java

@@ -0,0 +1,23 @@
+package org.springblade.gateway.point_gateway.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @Author: Silent
+ * @Description
+ * @Date: Created in 17:40 2021/11/11
+ * @Modified By:
+ */
+@AllArgsConstructor
+@Getter
+public enum CmccPayStatus {
+	SUCCESS("支付成功"),
+	WAIT("待支付"),
+	FAIL("支付失败");
+
+	/**
+	 * 描述
+	 */
+	private String describe;
+}

+ 39 - 0
src/main/java/org/springblade/payment/cmcc/callback/CmccPayMentCallbackController.java

@@ -0,0 +1,39 @@
+package org.springblade.payment.cmcc.callback;
+
+import com.alibaba.fastjson.JSONObject;
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.payment.cmcc.exception.CmccRequestException;
+import org.springblade.payment.cmcc.request.CmccRequest;
+import org.springblade.payment.cmcc.response.CmccResponse;
+import org.springblade.payment.cmcc.util.CmccUtil;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.PostConstruct;
+
+/**
+ * @Author: Silent
+ * @Description
+ * @Date: Created in 15:43 2021/11/11
+ * @Modified By:
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("payment/cmcc")
+@Api(value = "移动支付回调", tags = "移动支付回调接口")
+@Slf4j
+public class CmccPayMentCallbackController {
+
+//	@PostConstruct
+//	public void test(){
+//		try {
+//			CmccResponse cmccResponse = CmccUtil.queryCmccBalance(CmccRequest.builder()
+//				.callbackUrl("/abc").mobile("13433464174").build());
+//			log.info(JSONObject.toJSONString(cmccResponse));
+//		} catch (CmccRequestException e) {
+//			log.error(e.getMessage());
+//		}
+//	}
+}

+ 40 - 0
src/main/java/org/springblade/payment/cmcc/config/CmccPointConfig.java

@@ -0,0 +1,40 @@
+package org.springblade.payment.cmcc.config;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Author: Silent
+ * @Description 移动积分支付配置
+ * @Date: Created in 11:35 2021/11/11
+ * @Modified By:
+ */
+@Data
+@Component
+@ConfigurationProperties(prefix = "cmcc.pay")
+@ApiModel("移动积分支付配置")
+public class CmccPointConfig {
+	@ApiModelProperty("请求地址")
+	private String url;
+
+	@ApiModelProperty("专区号")
+	private String storeId;
+
+	@ApiModelProperty("AesKey")
+	private String aesKey;
+
+	@ApiModelProperty("aesIv")
+	private String aesIv;
+
+	@ApiModelProperty("签名key")
+	private String signKey;
+
+	@ApiModelProperty("商户号")
+	private String partnerId;
+
+	@ApiModelProperty("回调地址,移动授权完成后,会回调到该地址,一般设置为首页地址,注意该地址不能有参数")
+	private String callbackUrl;
+}

+ 28 - 0
src/main/java/org/springblade/payment/cmcc/enums/CmccResponseStatus.java

@@ -0,0 +1,28 @@
+package org.springblade.payment.cmcc.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @Author: Silent
+ * @Description
+ * @Date: Created in 13:48 2021/11/11
+ * @Modified By:
+ */
+@Getter
+@AllArgsConstructor
+public enum CmccResponseStatus {
+	SUCCESS("0000","成功"),
+	FAIL("9999","失败"),
+	AUTH("0001","需要跳转到移动授权页");
+
+	/**
+	 * 状态码
+	 */
+	private String code;
+
+	/**
+	 * 消息
+	 */
+	private String message;
+}

+ 22 - 0
src/main/java/org/springblade/payment/cmcc/exception/CmccRequestException.java

@@ -0,0 +1,22 @@
+package org.springblade.payment.cmcc.exception;
+
+import org.apache.http.HttpException;
+
+/**
+ * @Author: Silent
+ * @Description 移动请求异常类
+ * @Date: Created in 14:00 2021/11/11
+ * @Modified By:
+ */
+public class CmccRequestException extends HttpException {
+	public CmccRequestException() {
+	}
+
+	public CmccRequestException(String message) {
+		super(message);
+	}
+
+	public CmccRequestException(String message, Throwable cause) {
+		super(message, cause);
+	}
+}

+ 36 - 0
src/main/java/org/springblade/payment/cmcc/request/CmccDectOrderRequest.java

@@ -0,0 +1,36 @@
+package org.springblade.payment.cmcc.request;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @Author: Silent
+ * @Description
+ * @Date: Created in 16:48 2021/11/11
+ * @Modified By:
+ */
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+@ApiModel("移动订单支付参数")
+public class CmccDectOrderRequest extends CmccRequest{
+	@ApiModelProperty("商户订单号全局唯一")
+	private String outOrderId;
+
+	@ApiModelProperty("验证码")
+	private String smsCode;
+
+	@ApiModelProperty("设备型号")
+	private String machinetype;
+
+	@ApiModelProperty("同盾设备指纹")
+	private String fingerprint;
+
+	@ApiModelProperty("通付盾参数")
+	private String sessionId;
+}

+ 38 - 0
src/main/java/org/springblade/payment/cmcc/request/CmccPlaceOrderRequest.java

@@ -0,0 +1,38 @@
+package org.springblade.payment.cmcc.request;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * @Author: Silent
+ * @Description
+ * @Date: Created in 16:48 2021/11/11
+ * @Modified By:
+ */
+@Data
+@Builder
+@ApiModel("移动订单创建参数")
+public class CmccPlaceOrderRequest extends CmccRequest{
+	@ApiModelProperty("商户订单号全局唯一")
+	private String outOrderId;
+
+	@ApiModelProperty("订单总扣减积分值")
+	private String points;
+
+	@ApiModelProperty("通付盾参数")
+	private String sessionId;
+
+	@ApiModelProperty("同盾设备指纹")
+	private String fingerprint;
+
+	@ApiModelProperty("商品列表")
+	private String productItemList;
+
+	@ApiModelProperty("商品 ID,坤彪会ᨀ供商品列表")
+	private String productId;
+
+	@ApiModelProperty("数量")
+	private String num;
+}

+ 37 - 0
src/main/java/org/springblade/payment/cmcc/request/CmccRequest.java

@@ -0,0 +1,37 @@
+package org.springblade.payment.cmcc.request;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * @Author: Silent
+ * @Description 移动参数
+ * @Date: Created in 11:46 2021/11/11
+ * @Modified By:
+ */
+@Data
+@ApiModel("移动参数")
+public class CmccRequest{
+	@ApiModelProperty("签名")
+	private String sign;
+
+	@ApiModelProperty("请求时间,格式为 yyyyMMddHHmmss")
+	private String reqTime;
+
+	@ApiModelProperty("商户号,与各渠道联调测试时届时ᨀ供")
+	private String partnerId;
+
+	@ApiModelProperty("专区号,用来游戏标识,根据对接的渠道、合作的产品具体分配")
+	private String storeId;
+
+	@ApiModelProperty("本次请求的流水号,字符串,全局唯一,最大长度不超过 50")
+	private String requestId;
+
+	@ApiModelProperty("手机号")
+	private String mobile;
+
+	@ApiModelProperty("回调地址,移动授权完成后,会回调到该地址,一般设置为首页地址,注意该地址不能有参数")
+	private String callbackUrl;
+}

+ 27 - 0
src/main/java/org/springblade/payment/cmcc/response/CmccResponse.java

@@ -0,0 +1,27 @@
+package org.springblade.payment.cmcc.response;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @Author: Silent
+ * @Description 移动响应参数
+ * @Date: Created in 13:45 2021/11/11
+ * @Modified By:
+ */
+@Data
+@ApiModel("移动响应参数")
+public class CmccResponse {
+	@ApiModelProperty("请求中的requestId值")
+	private String requestId;
+
+	@ApiModelProperty("响应码(0000:成功,0001:需要跳转到移动授权页,9999:失败")
+	private String resultCode;
+
+	@ApiModelProperty("返回响应信息")
+	private String message;
+
+	@ApiModelProperty("返回数据,异常时该数据可能为空")
+	private String data;
+}

+ 147 - 0
src/main/java/org/springblade/payment/cmcc/util/CmccUtil.java

@@ -0,0 +1,147 @@
+package org.springblade.payment.cmcc.util;
+
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.crypto.SecureUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springblade.common.utils.SpringContextHolder;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.payment.cmcc.config.CmccPointConfig;
+import org.springblade.payment.cmcc.enums.CmccResponseStatus;
+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.request.CmccRequest;
+import org.springblade.payment.cmcc.response.CmccResponse;
+
+import java.text.SimpleDateFormat;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ * @Author: Silent
+ * @Description 移动对接工具
+ * @Date: Created in 11:43 2021/11/11
+ * @Modified By:
+ */
+public class CmccUtil {
+	/**
+	 * cmcc配置
+	 */
+	private static final CmccPointConfig cmccPointConfig = SpringContextHolder.getBean(CmccPointConfig.class);
+
+	/**
+	 * 日期时间格式
+	 */
+	private static final SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyyMMddHHmmss");
+
+	/**
+	 * 签名
+	 * @param cmccRequest 请求参数
+	 */
+	private static <T extends CmccRequest> T sign(T cmccRequest){
+		//转化为参数
+		Map<String, Object> stringObjectMap = BeanUtil.toMap(cmccRequest);
+		//参数集合
+		Set<String> param = new TreeSet<>();
+		for (Map.Entry<String, Object> stringObjectEntry : stringObjectMap.entrySet()) {
+			if(ObjectUtils.isNotEmpty(stringObjectEntry.getValue())){
+				param.add((String) stringObjectEntry.getValue());
+			}
+		}
+		//添加SignKey
+		param.add(cmccPointConfig.getSignKey());
+		//拼接字符串
+		String paramValue = ArrayUtil.join(param.toArray(), "");
+		//进行签名
+		cmccRequest.setSign(SecureUtil.md5(paramValue));
+		return cmccRequest;
+	}
+
+	/**
+	 * 添加参数
+	 * @param cmccRequest
+	 */
+	private static <T extends CmccRequest> T checkParam(T cmccRequest){
+		cmccRequest.setPartnerId(cmccPointConfig.getPartnerId());
+		cmccRequest.setStoreId(cmccPointConfig.getStoreId());
+		//判断reuqestId是否为空
+		if(StringUtils.isEmpty(cmccRequest.getRequestId())){
+			cmccRequest.setRequestId(IdUtil.randomUUID());
+		}
+		//判断reqTime是否为空
+		if(StringUtils.isEmpty(cmccRequest.getReqTime())){
+			cmccRequest.setReqTime(dateTimeFormat.format(DateUtil.now()));
+		}
+		return cmccRequest;
+	}
+
+	/**
+	 * 查询移动积分
+	 * @param cmccRequest
+	 * @return
+	 */
+	public static CmccResponse queryCmccBalance(CmccRequest cmccRequest) throws CmccRequestException {
+		if(ObjectUtils.isEmpty(cmccRequest) || StringUtils.isEmpty(cmccRequest.getMobile())){
+			throw new CmccRequestException("参数不能为空");
+		}
+		//设置请求
+		HttpResponse httpResponse = HttpRequest.post(new StringBuilder(cmccPointConfig.getUrl()).append("/api/kb/queryCmccBalance").toString())
+			//添加参数,进行签名
+			.body(JSONObject.toJSONString(sign(checkParam(cmccRequest)))).execute();
+		return JSONObject.parseObject(httpResponse.body(),CmccResponse.class);
+	}
+
+	/**
+	 * 移动积分订单创建
+	 * @param cmccPlaceOrderRequest
+	 * @return
+	 */
+	public static CmccResponse placeOrder(CmccPlaceOrderRequest cmccPlaceOrderRequest) throws CmccRequestException {
+		if(ObjectUtils.isEmpty(cmccPlaceOrderRequest) || StringUtils.isEmpty(cmccPlaceOrderRequest.getMobile())
+			|| StringUtils.isEmpty(cmccPlaceOrderRequest.getOutOrderId()) || StringUtils.isEmpty(cmccPlaceOrderRequest.getPoints())
+			|| StringUtils.isEmpty(cmccPlaceOrderRequest.getSessionId()) || StringUtils.isEmpty(cmccPlaceOrderRequest.getFingerprint())
+			|| StringUtils.isEmpty(cmccPlaceOrderRequest.getProductItemList()) || StringUtils.isEmpty(cmccPlaceOrderRequest.getProductId())
+			|| StringUtils.isEmpty(cmccPlaceOrderRequest.getNum())){
+			throw new CmccRequestException("参数不能为空");
+		}
+		//设置请求
+		HttpResponse httpResponse = HttpRequest.post(new StringBuilder(cmccPointConfig.getUrl()).append("/api/kb/placeOrder").toString())
+			//添加参数,进行签名
+			.body(JSONObject.toJSONString(sign(checkParam(cmccPlaceOrderRequest)))).execute();
+		CmccResponse cmccResponse = JSONObject.parseObject(httpResponse.body(), CmccResponse.class);
+		if(StringUtils.equals(cmccResponse.getResultCode(), CmccResponseStatus.SUCCESS.name())){
+			throw new CmccRequestException(cmccResponse.getMessage());
+		}
+		return cmccResponse;
+	}
+
+	/**
+	 * 订单支付接口
+	 * @param cmccDectOrderRequest
+	 * @return
+	 */
+	public static CmccResponse dectOrder(CmccDectOrderRequest cmccDectOrderRequest) throws CmccRequestException {
+		if(ObjectUtils.isEmpty(cmccDectOrderRequest) || StringUtils.isEmpty(cmccDectOrderRequest.getMobile())
+			|| StringUtils.isEmpty(cmccDectOrderRequest.getOutOrderId()) || StringUtils.isEmpty(cmccDectOrderRequest.getSmsCode())
+			|| StringUtils.isEmpty(cmccDectOrderRequest.getSessionId()) || StringUtils.isEmpty(cmccDectOrderRequest.getFingerprint())
+			|| StringUtils.isEmpty(cmccDectOrderRequest.getMachinetype())){
+			throw new CmccRequestException("参数不能为空");
+		}
+		//设置请求
+		HttpResponse httpResponse = HttpRequest.post(new StringBuilder(cmccPointConfig.getUrl()).append("/api/kb/dectOrder").toString())
+			//添加参数,进行签名
+			.body(JSONObject.toJSONString(sign(checkParam(cmccDectOrderRequest)))).execute();
+		CmccResponse cmccResponse = JSONObject.parseObject(httpResponse.body(), CmccResponse.class);
+		if(StringUtils.equals(cmccResponse.getResultCode(), CmccResponseStatus.SUCCESS.name())){
+			throw new CmccRequestException(cmccResponse.getMessage());
+		}
+		return cmccResponse;
+	}
+}

+ 129 - 0
src/main/java/org/springblade/sing/point/controller/CmccPointRecordController.java

@@ -0,0 +1,129 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.point.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.sing.point.entity.CmccPointRecord;
+import org.springblade.sing.point.vo.CmccPointRecordVO;
+import org.springblade.sing.point.wrapper.CmccPointRecordWrapper;
+import org.springblade.sing.point.service.ICmccPointRecordService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 移动积分兑换道具记录表 控制器
+ *
+ * @author BladeX
+ * @since 2021-11-11
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("sing_point/cmccpointrecord")
+@Api(value = "移动积分兑换道具记录表", tags = "移动积分兑换道具记录表接口")
+public class CmccPointRecordController extends BladeController {
+
+	private final ICmccPointRecordService cmccPointRecordService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入cmccPointRecord")
+	public R<CmccPointRecordVO> detail(CmccPointRecord cmccPointRecord) {
+		CmccPointRecord detail = cmccPointRecordService.getOne(Condition.getQueryWrapper(cmccPointRecord));
+		return R.data(CmccPointRecordWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页 移动积分兑换道具记录表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入cmccPointRecord")
+	public R<IPage<CmccPointRecordVO>> list(CmccPointRecord cmccPointRecord, Query query) {
+		IPage<CmccPointRecord> pages = cmccPointRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(cmccPointRecord));
+		return R.data(CmccPointRecordWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页 移动积分兑换道具记录表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入cmccPointRecord")
+	public R<IPage<CmccPointRecordVO>> page(CmccPointRecordVO cmccPointRecord, Query query) {
+		IPage<CmccPointRecordVO> pages = cmccPointRecordService.selectCmccPointRecordPage(Condition.getPage(query), cmccPointRecord);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 移动积分兑换道具记录表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入cmccPointRecord")
+	public R save(@Valid @RequestBody CmccPointRecord cmccPointRecord) {
+		return R.status(cmccPointRecordService.save(cmccPointRecord));
+	}
+
+	/**
+	 * 修改 移动积分兑换道具记录表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入cmccPointRecord")
+	public R update(@Valid @RequestBody CmccPointRecord cmccPointRecord) {
+		return R.status(cmccPointRecordService.updateById(cmccPointRecord));
+	}
+
+	/**
+	 * 新增或修改 移动积分兑换道具记录表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入cmccPointRecord")
+	public R submit(@Valid @RequestBody CmccPointRecord cmccPointRecord) {
+		return R.status(cmccPointRecordService.saveOrUpdate(cmccPointRecord));
+	}
+
+	
+	/**
+	 * 删除 移动积分兑换道具记录表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(cmccPointRecordService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	
+}

+ 34 - 0
src/main/java/org/springblade/sing/point/dto/CmccPointRecordDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.point.dto;
+
+import org.springblade.sing.point.entity.CmccPointRecord;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 移动积分兑换道具记录表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-11-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class CmccPointRecordDTO extends CmccPointRecord {
+	private static final long serialVersionUID = 1L;
+
+}

+ 80 - 0
src/main/java/org/springblade/sing/point/entity/CmccPointRecord.java

@@ -0,0 +1,80 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.point.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+import org.springblade.gateway.point_gateway.enums.CmccPayStatus;
+
+import java.math.BigDecimal;
+
+/**
+ * 移动积分兑换道具记录表实体类
+ *
+ * @author BladeX
+ * @since 2021-11-11
+ */
+@Data
+@TableName("sing_cmcc_point_record")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "CmccPointRecord对象", description = "移动积分兑换道具记录表")
+public class CmccPointRecord extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 用户id
+	 */
+	@ApiModelProperty(value = "用户id")
+	private Long userId;
+	/**
+	 * 商户订单号全局唯一
+	 */
+	@ApiModelProperty(value = "商户订单号全局唯一")
+	private String outOrderId;
+	/**
+	 * 数量
+	 */
+	@ApiModelProperty(value = "数量")
+	private BigDecimal num;
+	/**
+	 * 移动积分兑换手机号码
+	 */
+	@ApiModelProperty(value = "移动积分兑换手机号码")
+	private String phone;
+	/**
+	 * 助力道具Id(移动积分兑换,积分赠送)
+	 */
+	@ApiModelProperty(value = "助力道具Id(移动积分兑换,积分赠送)")
+	private Long helpGoodsId;
+	/**
+	 * 积分(普法积分兑换商品、移动积分兑换道具、普法积分赠送)
+	 */
+	@ApiModelProperty(value = "积分(普法积分兑换商品、移动积分兑换道具、普法积分赠送)")
+	private BigDecimal point;
+	/**
+	 * 支付状态(普法积分兑换商品、移动积分兑换道具、普法积分赠送)
+	 */
+	@ApiModelProperty(value = "支付状态")
+	private CmccPayStatus payStatus;
+
+
+}

+ 0 - 6
src/main/java/org/springblade/sing/point/entity/PointRecord.java

@@ -75,10 +75,4 @@ public class PointRecord extends BaseEntity {
 	 */
 	@ApiModelProperty(value = "积分类型(移动积分兑换道具:'CMCC_POINT_EXCHANGE',普法积分赠送:'PUFA_POINT_SEND',普法积分兑换:'PUFA_POINT_EXCHANGE')")
 	private PointTypeEnum pointType;
-
-	/**
-	 * 移动积分兑换手机号码
-	 */
-	@ApiModelProperty(value = "移动积分兑换手机号码")
-	private String phone;
 }

+ 42 - 0
src/main/java/org/springblade/sing/point/mapper/CmccPointRecordMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.point.mapper;
+
+import org.springblade.sing.point.entity.CmccPointRecord;
+import org.springblade.sing.point.vo.CmccPointRecordVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 移动积分兑换道具记录表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-11-11
+ */
+public interface CmccPointRecordMapper extends BaseMapper<CmccPointRecord> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param cmccPointRecord
+	 * @return
+	 */
+	List<CmccPointRecordVO> selectCmccPointRecordPage(IPage page, CmccPointRecordVO cmccPointRecord);
+
+}

+ 28 - 0
src/main/java/org/springblade/sing/point/mapper/CmccPointRecordMapper.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.sing.point.mapper.CmccPointRecordMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="cmccPointRecordResultMap" type="org.springblade.sing.point.entity.CmccPointRecord">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="user_id" property="userId"/>
+        <result column="out_order_id" property="outOrderId"/>
+        <result column="num" property="num"/>
+        <result column="phone" property="phone"/>
+        <result column="help_goods_id" property="helpGoodsId"/>
+        <result column="point" property="point"/>
+    </resultMap>
+
+
+    <select id="selectCmccPointRecordPage" resultMap="cmccPointRecordResultMap">
+        select * from sing_cmcc_point_record where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/sing/point/service/ICmccPointRecordService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.point.service;
+
+import org.springblade.sing.point.entity.CmccPointRecord;
+import org.springblade.sing.point.vo.CmccPointRecordVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 移动积分兑换道具记录表 服务类
+ *
+ * @author BladeX
+ * @since 2021-11-11
+ */
+public interface ICmccPointRecordService extends BaseService<CmccPointRecord> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param cmccPointRecord
+	 * @return
+	 */
+	IPage<CmccPointRecordVO> selectCmccPointRecordPage(IPage<CmccPointRecordVO> page, CmccPointRecordVO cmccPointRecord);
+
+}

+ 41 - 0
src/main/java/org/springblade/sing/point/service/impl/CmccPointRecordServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.point.service.impl;
+
+import org.springblade.sing.point.entity.CmccPointRecord;
+import org.springblade.sing.point.vo.CmccPointRecordVO;
+import org.springblade.sing.point.mapper.CmccPointRecordMapper;
+import org.springblade.sing.point.service.ICmccPointRecordService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 移动积分兑换道具记录表 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-11-11
+ */
+@Service
+public class CmccPointRecordServiceImpl extends BaseServiceImpl<CmccPointRecordMapper, CmccPointRecord> implements ICmccPointRecordService {
+
+	@Override
+	public IPage<CmccPointRecordVO> selectCmccPointRecordPage(IPage<CmccPointRecordVO> page, CmccPointRecordVO cmccPointRecord) {
+		return page.setRecords(baseMapper.selectCmccPointRecordPage(page, cmccPointRecord));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/sing/point/vo/CmccPointRecordVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.point.vo;
+
+import org.springblade.sing.point.entity.CmccPointRecord;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 移动积分兑换道具记录表视图实体类
+ *
+ * @author BladeX
+ * @since 2021-11-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "CmccPointRecordVO对象", description = "移动积分兑换道具记录表")
+public class CmccPointRecordVO extends CmccPointRecord {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/sing/point/wrapper/CmccPointRecordWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.sing.point.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.sing.point.entity.CmccPointRecord;
+import org.springblade.sing.point.vo.CmccPointRecordVO;
+import java.util.Objects;
+
+/**
+ * 移动积分兑换道具记录表包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-11-11
+ */
+public class CmccPointRecordWrapper extends BaseEntityWrapper<CmccPointRecord, CmccPointRecordVO>  {
+
+	public static CmccPointRecordWrapper build() {
+		return new CmccPointRecordWrapper();
+ 	}
+
+	@Override
+	public CmccPointRecordVO entityVO(CmccPointRecord cmccPointRecord) {
+		CmccPointRecordVO cmccPointRecordVO = Objects.requireNonNull(BeanUtil.copy(cmccPointRecord, CmccPointRecordVO.class));
+
+		//User createUser = UserCache.getUser(cmccPointRecord.getCreateUser());
+		//User updateUser = UserCache.getUser(cmccPointRecord.getUpdateUser());
+		//cmccPointRecordVO.setCreateUserName(createUser.getName());
+		//cmccPointRecordVO.setUpdateUserName(updateUser.getName());
+
+		return cmccPointRecordVO;
+	}
+
+}

+ 17 - 0
src/main/resources/application-dev.yml

@@ -49,3 +49,20 @@ blade:
     upload-domain: http://localhost:8999
     remote-path: /usr/share/nginx/html
 
+cmcc:
+  pay:
+    # 地址
+    url: http://api-test.kunbiaowangluo.com/
+    # 商户号
+    partnerId: KB_001
+    # 专区号
+    storeId: S9990141_best_store1
+    # AesKey
+    aesKey: 4a13b832815aaf20
+    # aesIv
+    aesIv: 1234567812345678
+    # 签名key
+    signKey: b47366a9df9d
+    # 回调地址
+    callbackUrl: http://localhost:2888
+