浏览代码

交易处理

lianghanqiang 4 年之前
父节点
当前提交
daa8e35ac8

+ 1 - 1
src/main/java/org/springblade/gateway/shop_gateway/controller/AppShopController.java

@@ -32,7 +32,7 @@ public class AppShopController {
 	@ApiOperation(value = "商户提交审核")
 	@SneakyThrows
 	public R submitAudit(@RequestBody ShopAuditDto shopAuditDto) {
-		shopService.submitAudit(shopAuditDto);
+//		shopService.submitAudit(shopAuditDto);
 		return R.success("提交成功");
 	}
 }

+ 20 - 0
src/main/java/org/springblade/ldt/bills/entity/PointBills.java

@@ -88,6 +88,26 @@ public class PointBills implements Serializable {
 	*/
 		@ApiModelProperty(value = "交易类型")
 		private String type;
+	/**
+	* 渠道id
+	*/
+		@ApiModelProperty(value = "渠道id")
+		private Long channelId;
+	/**
+	* 渠道logo
+	*/
+		@ApiModelProperty(value = "渠道logo")
+		private String channelLog;
+	/**
+	* 渠道名称
+	*/
+		@ApiModelProperty(value = "渠道名称")
+		private String channelName;
+	/**
+	* 是否已经核销
+	*/
+		@ApiModelProperty(value = "是否已经核销")
+		private Integer isCheak;
 
 
 }

+ 4 - 0
src/main/java/org/springblade/ldt/bills/mapper/PointBillsMapper.xml

@@ -14,6 +14,10 @@
         <result column="receive_id" property="receiveId"/>
         <result column="status" property="status"/>
         <result column="type" property="type"/>
+        <result column="channel_id" property="channelId"/>
+        <result column="channel_log" property="channelLog"/>
+        <result column="channel_name" property="channelName"/>
+        <result column="is_cheak" property="isCheak"/>
     </resultMap>
 
 

+ 0 - 8
src/main/java/org/springblade/ldt/shop/service/IShopService.java

@@ -16,8 +16,6 @@
  */
 package org.springblade.ldt.shop.service;
 
-import org.springblade.gateway.shop_gateway.entity.dto.ShopAuditDto;
-import org.springblade.ldt.shop.entity.Audit;
 import org.springblade.ldt.shop.entity.Shop;
 import org.springblade.ldt.shop.vo.ShopVO;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -40,10 +38,4 @@ public interface IShopService extends IService<Shop> {
 	 */
 	IPage<ShopVO> selectShopPage(IPage<ShopVO> page, ShopVO shop);
 
-	/**
-	 * 商户提交审核
-	 * @param shopAuditDto
-
-	 */
-    void submitAudit(ShopAuditDto shopAuditDto);
 }

+ 0 - 19
src/main/java/org/springblade/ldt/shop/service/impl/ShopServiceImpl.java

@@ -16,20 +16,13 @@
  */
 package org.springblade.ldt.shop.service.impl;
 
-import cn.hutool.core.util.RandomUtil;
-import org.springblade.gateway.shop_gateway.entity.dto.ShopAuditDto;
-import org.springblade.ldt.shop.entity.Audit;
 import org.springblade.ldt.shop.entity.Shop;
-import org.springblade.ldt.shop.service.IAuditService;
 import org.springblade.ldt.shop.vo.ShopVO;
 import org.springblade.ldt.shop.mapper.ShopMapper;
 import org.springblade.ldt.shop.service.IShopService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
 
 /**
  *  服务实现类
@@ -40,21 +33,9 @@ import javax.annotation.Resource;
 @Service
 public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements IShopService {
 
-	@Resource
-	private IAuditService auditService;
-
 	@Override
 	public IPage<ShopVO> selectShopPage(IPage<ShopVO> page, ShopVO shop) {
 		return page.setRecords(baseMapper.selectShopPage(page, shop));
 	}
 
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void submitAudit(ShopAuditDto shopAuditDto) {
-		Shop shop = shopAuditDto.getShop();
-		Audit audit = shopAuditDto.getAudit();
-		this.save(shop);
-		auditService.save(audit);
-	}
-
 }

+ 128 - 0
src/main/java/org/springblade/ldt/user/controller/UserChannelPointController.java

@@ -0,0 +1,128 @@
+/*
+ *      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.ldt.user.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 com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.ldt.user.entity.UserChannelPoint;
+import org.springblade.ldt.user.vo.UserChannelPointVO;
+import org.springblade.ldt.user.wrapper.UserChannelPointWrapper;
+import org.springblade.ldt.user.service.IUserChannelPointService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2021-08-30
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("ldt_user/userchannelpoint")
+@Api(value = "", tags = "接口")
+public class UserChannelPointController extends BladeController {
+
+	private final IUserChannelPointService userChannelPointService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入userChannelPoint")
+	public R<UserChannelPointVO> detail(UserChannelPoint userChannelPoint) {
+		UserChannelPoint detail = userChannelPointService.getOne(Condition.getQueryWrapper(userChannelPoint));
+		return R.data(UserChannelPointWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页 
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入userChannelPoint")
+	public R<IPage<UserChannelPointVO>> list(UserChannelPoint userChannelPoint, Query query) {
+		IPage<UserChannelPoint> pages = userChannelPointService.page(Condition.getPage(query), Condition.getQueryWrapper(userChannelPoint));
+		return R.data(UserChannelPointWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页 
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入userChannelPoint")
+	public R<IPage<UserChannelPointVO>> page(UserChannelPointVO userChannelPoint, Query query) {
+		IPage<UserChannelPointVO> pages = userChannelPointService.selectUserChannelPointPage(Condition.getPage(query), userChannelPoint);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入userChannelPoint")
+	public R save(@Valid @RequestBody UserChannelPoint userChannelPoint) {
+		return R.status(userChannelPointService.save(userChannelPoint));
+	}
+
+	/**
+	 * 修改 
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入userChannelPoint")
+	public R update(@Valid @RequestBody UserChannelPoint userChannelPoint) {
+		return R.status(userChannelPointService.updateById(userChannelPoint));
+	}
+
+	/**
+	 * 新增或修改 
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入userChannelPoint")
+	public R submit(@Valid @RequestBody UserChannelPoint userChannelPoint) {
+		return R.status(userChannelPointService.saveOrUpdate(userChannelPoint));
+	}
+
+	
+	/**
+	 * 删除 
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(userChannelPointService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 34 - 0
src/main/java/org/springblade/ldt/user/dto/UserChannelPointDTO.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.ldt.user.dto;
+
+import org.springblade.ldt.user.entity.UserChannelPoint;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-08-30
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class UserChannelPointDTO extends UserChannelPoint {
+	private static final long serialVersionUID = 1L;
+
+}

+ 87 - 0
src/main/java/org/springblade/ldt/user/entity/UserChannelPoint.java

@@ -0,0 +1,87 @@
+/*
+ *      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.ldt.user.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-08-30
+ */
+@Data
+@TableName("ldt_user_channel_point")
+@ApiModel(value = "UserChannelPoint对象", description = "UserChannelPoint对象")
+public class UserChannelPoint implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 用户渠道积分
+	*/
+		@ApiModelProperty(value = "用户渠道积分")
+		private Long id;
+	/**
+	* 用户id
+	*/
+		@ApiModelProperty(value = "用户id")
+		private Long userId;
+	/**
+	* 渠道id
+	*/
+		@ApiModelProperty(value = "渠道id")
+		private Long channelId;
+	/**
+	* 渠道logo
+	*/
+		@ApiModelProperty(value = "渠道logo")
+		private String channelLogo;
+	/**
+	* 积分兑率
+	*/
+		@ApiModelProperty(value = "积分兑率")
+		private BigDecimal pointRate;
+	/**
+	* 渠道名称
+	*/
+		@ApiModelProperty(value = "渠道名称")
+		private String channelName;
+	/**
+	* 总积分数
+	*/
+		@ApiModelProperty(value = "总积分数")
+		private BigDecimal totalPoint;
+	/**
+	* 已经核销的积分数
+	*/
+		@ApiModelProperty(value = "已经核销的积分数")
+		private BigDecimal usedPoint;
+	/**
+	* 可用积分数
+	*/
+		@ApiModelProperty(value = "可用积分数")
+		private BigDecimal available;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/ldt/user/mapper/UserChannelPointMapper.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.ldt.user.mapper;
+
+import org.springblade.ldt.user.entity.UserChannelPoint;
+import org.springblade.ldt.user.vo.UserChannelPointVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-08-30
+ */
+public interface UserChannelPointMapper extends BaseMapper<UserChannelPoint> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param userChannelPoint
+	 * @return
+	 */
+	List<UserChannelPointVO> selectUserChannelPointPage(IPage page, UserChannelPointVO userChannelPoint);
+
+}

+ 23 - 0
src/main/java/org/springblade/ldt/user/mapper/UserChannelPointMapper.xml

@@ -0,0 +1,23 @@
+<?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.ldt.user.mapper.UserChannelPointMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="userChannelPointResultMap" type="org.springblade.ldt.user.entity.UserChannelPoint">
+        <id column="id" property="id"/>
+        <result column="user_id" property="userId"/>
+        <result column="channel_id" property="channelId"/>
+        <result column="channel_logo" property="channelLogo"/>
+        <result column="point_rate" property="pointRate"/>
+        <result column="channel_name" property="channelName"/>
+        <result column="total_point" property="totalPoint"/>
+        <result column="used_point" property="usedPoint"/>
+        <result column="available" property="available"/>
+    </resultMap>
+
+
+    <select id="selectUserChannelPointPage" resultMap="userChannelPointResultMap">
+        select * from ldt_user_channel_point where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/ldt/user/service/IUserChannelPointService.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.ldt.user.service;
+
+import org.springblade.ldt.user.entity.UserChannelPoint;
+import org.springblade.ldt.user.vo.UserChannelPointVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-08-30
+ */
+public interface IUserChannelPointService extends IService<UserChannelPoint> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param userChannelPoint
+	 * @return
+	 */
+	IPage<UserChannelPointVO> selectUserChannelPointPage(IPage<UserChannelPointVO> page, UserChannelPointVO userChannelPoint);
+
+}

+ 41 - 0
src/main/java/org/springblade/ldt/user/service/impl/UserChannelPointServiceImpl.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.ldt.user.service.impl;
+
+import org.springblade.ldt.user.entity.UserChannelPoint;
+import org.springblade.ldt.user.vo.UserChannelPointVO;
+import org.springblade.ldt.user.mapper.UserChannelPointMapper;
+import org.springblade.ldt.user.service.IUserChannelPointService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-08-30
+ */
+@Service
+public class UserChannelPointServiceImpl extends ServiceImpl<UserChannelPointMapper, UserChannelPoint> implements IUserChannelPointService {
+
+	@Override
+	public IPage<UserChannelPointVO> selectUserChannelPointPage(IPage<UserChannelPointVO> page, UserChannelPointVO userChannelPoint) {
+		return page.setRecords(baseMapper.selectUserChannelPointPage(page, userChannelPoint));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/ldt/user/vo/UserChannelPointVO.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.ldt.user.vo;
+
+import org.springblade.ldt.user.entity.UserChannelPoint;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-08-30
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "UserChannelPointVO对象", description = "UserChannelPointVO对象")
+public class UserChannelPointVO extends UserChannelPoint {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/ldt/user/wrapper/UserChannelPointWrapper.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.ldt.user.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.ldt.user.entity.UserChannelPoint;
+import org.springblade.ldt.user.vo.UserChannelPointVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-08-30
+ */
+public class UserChannelPointWrapper extends BaseEntityWrapper<UserChannelPoint, UserChannelPointVO>  {
+
+	public static UserChannelPointWrapper build() {
+		return new UserChannelPointWrapper();
+ 	}
+
+	@Override
+	public UserChannelPointVO entityVO(UserChannelPoint userChannelPoint) {
+		UserChannelPointVO userChannelPointVO = Objects.requireNonNull(BeanUtil.copy(userChannelPoint, UserChannelPointVO.class));
+
+		//User createUser = UserCache.getUser(userChannelPoint.getCreateUser());
+		//User updateUser = UserCache.getUser(userChannelPoint.getUpdateUser());
+		//userChannelPointVO.setCreateUserName(createUser.getName());
+		//userChannelPointVO.setUpdateUserName(updateUser.getName());
+
+		return userChannelPointVO;
+	}
+
+}

+ 1 - 1
src/main/java/org/springblade/modules/resource/utils/SmsUtil.java

@@ -110,7 +110,7 @@ public class SmsUtil {
 	 */
 	public static boolean validateMessage(String code, String id, String value, String phone) {
 		SmsCode smsCode = new SmsCode().setId(id).setValue(value).setPhone(phone);
-		return getBuilder().template(code).validateMessage(smsCode);
+	 	return getBuilder().template(code).validateMessage(smsCode);
 	}
 
 }