This commit is contained in:
wangh 2023-12-22 15:34:06 +08:00
commit 0c222c88a5
40 changed files with 1481 additions and 165 deletions

View File

@ -17,11 +17,21 @@
:on-preview="handlePictureCardPreview"
:class="{hide: this.fileList.length >= this.limit}"
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto;height: 100%"
/>
<i class="el-icon-plus"></i>
<!-- <div style="display: flex;height: 100%;">-->
<!-- <img v-if="doorList!=[]"-->
<!-- v-for="(item,index) in doorList"-->
<!-- :src="item"-->
<!-- style="display: block; max-width: 100%; margin: 0 auto;margin-right: 20px"-->
<!-- />-->
<!-- </div>-->
<!-- <div v-else>-->
<img
v-if="dialogImageUrl"
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto;height: 100%"
/>
<i v-else class="el-icon-plus"></i>
<!-- </div>-->
</el-upload>
<!-- 上传提示 -->
@ -72,7 +82,8 @@ export default {
type: Boolean,
default: true
},
imgUrl:""
imgUrl:"",
doorUrl:"",
},
data() {
return {
@ -86,7 +97,8 @@ export default {
headers: {
"Access-Token" : getToken(),
},
fileList: []
fileList: [],
doorList:[],
};
},
watch: {
@ -118,6 +130,7 @@ export default {
},
},
created() {
// this.dialogImageUrl = this.baseUrl + this.imgUrl;
this.handlePictureCardPreview();
},
methods: {
@ -194,7 +207,6 @@ export default {
},
//
handlePictureCardPreview(file) {
// console.log(file,this.baseUrl , this.imgUrl)
if (this.imgUrl != "" && this.imgUrl != undefined){
this.dialogImageUrl = this.baseUrl + this.imgUrl;
}else {
@ -202,6 +214,21 @@ export default {
this.dialogImageUrl = file.url;
}
}
if (this.doorUrl != "" && this.doorUrl != undefined && this.doorUrl != []){
let list = JSON.parse(this.doorUrl)
list.forEach(item => {
let data = {name:"",url:""}
data.name = item.split("/")[item.split("/").length-1]
data.url = this.baseUrl + item
this.fileList.push(data)
// this.dialogImageUrl = this.baseUrl + item;
// this.doorList.push(this.baseUrl + item);
})
}else {
if (file!=undefined){
this.dialogImageUrl = file.url;
}
}
// this.dialogVisible = true;
},
//

View File

@ -7,12 +7,12 @@
<!-- 上传图片-->
<div style="display: flex">
<span>店铺logo</span>
<imgUpload1 :imgUrl="store.logo" :limit="1" @input="getImgUrl"></imgUpload1>
<imgUpload1 v-if="flag" :imgUrl="store.logo" :limit="1" @input="getImgUrl"></imgUpload1>
</div>
<!-- 上传图片-->
<div style="display: flex">
<span>门头照</span>
<imgUpload1 :limit="1" @input="getDoorImgUrl"></imgUpload1>
<imgUpload1 v-if="flag" :doorUrl="store.doorstepPhoto" @input="getDoorImgUrl"></imgUpload1>
</div>
<map-componment :pform="form" ref="mapRef" @pform="getForm"></map-componment>
@ -62,7 +62,6 @@ import {listQRCode} from "@/api/staff/qrcode";
import {ljStoreInfo, updateStore} from "@/api/staff/store";
import mapComponment from "@/components/map/mapComponent.vue";
import imgUpload from "@/components/ImageUpload/index.vue"
import { getToken } from '@/utils/auth'
import imgUpload1 from "@/components/map/imgUpload.vue"
export default {
@ -80,15 +79,7 @@ export default {
},
data(){
return{
testImgUrl:"",
//
imagePath: process.env.VUE_APP_SERVER_URL,
dataForm:{},
//
uploadAction: process.env.VUE_APP_SERVER_URL + 'backendApi/file/upload',
uploadHeader: { 'Access-Token' : getToken() },
//
hideUpload: false,
flag:false,
//
uploadFiles: [
{name:"nihao",
@ -138,15 +129,17 @@ export default {
getImgUrl(val){
let list = val.split("/static")
this.store.logo = "/static"+list[list.length-1]
// this.store.logo = val
console.log(this.store.logo)
},
// url
getDoorImgUrl(val){
// console.log(val)
// let list = val.split("/")
// this.form.logo = list[list.length-1]
this.store.doorstepPhoto = val
let list = val.split(",")
let doorUrl = []
list.forEach(item => {
doorUrl.push("/static"+item.split("/static")[1])
})
// console.log(list,doorUrl)
this.store.doorstepPhoto = JSON.stringify(doorUrl)
// this.store.doorstepPhoto = val
},
getForm(data){
if (data != undefined){
@ -160,6 +153,7 @@ export default {
ljStoreInfo().then(response => {
this.store = response.data
console.log(response.data)
this.$emit("getUrl",this.store)
this.form.lat = this.store.latitude;
this.form.lng = this.store.longitude;
this.form.address = this.store.address;
@ -167,6 +161,7 @@ export default {
this.welfare = this.store.welfare.split(",")
}
this.$refs.mapRef.initAMap();
this.flag = true;
})
},

View File

@ -1,4 +1,4 @@
# 数据库配置
# \u6570\u636E\u5E93\u914D\u7F6E
spring.datasource.url=jdbc:mysql://192.168.1.3:3306/fuint-db?useUnicode=true&characterEncoding=UTF8&useSSL=false&allowMultiQueries=true
@ -10,102 +10,114 @@ spring.datasource.password=qqzcy@1014
#spring.datasource.password=root
# Redis配置
# Redis\u914D\u7F6E
spring.session.store-type=redis
spring.session.redis.namespace=fuint
# Redis数据库索引默认为0
# Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA4\u4E3A0\uFF09
spring.redis.database=0
# Redis服务器地址(生产)
# Redis\u670D\u52A1\u5668\u5730\u5740(\u751F\u4EA7)
spring.redis.host=localhost
# Redis服务器连接端口
# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3
spring.redis.port=6379
# Redis服务器连接密码(默认为空)
# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
spring.redis.password=
# 连接池最大连接数(使用负值表示没有限制)
# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09
spring.redis.pool.max-active=-1
# 连接池最大阻塞等待时间(使用负值表示没有限制)
# \u8FDE\u63A5\u6C60\u6700\u5927\u963B\u585E\u7B49\u5F85\u65F6\u95F4\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09
spring.redis.pool.max-wait=-1
# 连接池中的最大空闲连接
# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5
spring.redis.pool.max-idle=8
# 连接池中的最小空闲连接
# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5
spring.redis.pool.min-idle=0
# 连接超时时间(毫秒)
# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09
spring.redis.timeout=5000
# 系统名称
system.name = 蓝鲸智慧油站系统
# \u7CFB\u7EDF\u540D\u79F0
system.name = \u84DD\u9CB8\u667A\u6167\u6CB9\u7AD9\u7CFB\u7EDF
# 前端h5地址
# \u524D\u7AEFh5\u5730\u5740
website.url=https://www.fuint.cn/h5/
# 上传图片本地地址
# \u4E0A\u4F20\u56FE\u7247\u672C\u5730\u5730\u5740
images.root=C:/fuintV3.0.1/fuintBackend/fuint-application/target/classes
images.path=/static/uploadImages/
# 上传图片服务器域名
images.upload.url=http://192.168.1.6:8008
# \u4E0A\u4F20\u56FE\u7247\u670D\u52A1\u5668\u57DF\u540D
images.upload.url=http://localhost:8080
# 上传图片允许的大小单位MB
# \u4E0A\u4F20\u56FE\u7247\u5141\u8BB8\u7684\u5927\u5C0F\uFF08\u5355\u4F4D\uFF1AMB\uFF09
images.upload.maxSize=5
################## 定时脚本配置 #########################
# 定时发送消息
################## \u5B9A\u65F6\u811A\u672C\u914D\u7F6E #########################
# \u5B9A\u65F6\u53D1\u9001\u6D88\u606F
message.job.switch = 1
message.job.time = 0 0/1 * * * ?
# 卡券到期处理
# \u5361\u5238\u5230\u671F\u5904\u7406
couponExpire.job.switch = 1
couponExpire.job.time = 0 0/1 * * * ?
# 订单超时取消
# \u8BA2\u5355\u8D85\u65F6\u53D6\u6D88
orderCancel.job.switch = 1
orderCancel.job.time = 0 0/1 * * * ?
################## 阿里云短信配置 #######################
# 短信接口模式[0-关闭 1-打开]
################## \u963F\u91CC\u4E91\u77ED\u4FE1\u914D\u7F6E #######################
# \u77ED\u4FE1\u63A5\u53E3\u6A21\u5F0F[0-\u5173\u95ED 1-\u6253\u5F00]
aliyun.sms.mode = 0
aliyun.sms.accessKeyId=LTAI4GJMjV123oXsrQJLnPZt
aliyun.sms.accessKeySecret=eGVBL30u5Ypj234d7XODlwYKWTaGT
# 阿里云短信签名
aliyun.sms.signName=延禾技术
# \u963F\u91CC\u4E91\u77ED\u4FE1\u7B7E\u540D
aliyun.sms.signName=\u5EF6\u79BE\u6280\u672F
################## 阿里云OSS存储配置######################
# 模式[0-关闭 1-打开]
################## \u963F\u91CC\u4E91OSS\u5B58\u50A8\u914D\u7F6E######################
# \u6A21\u5F0F[0-\u5173\u95ED 1-\u6253\u5F00]
aliyun.oss.mode = 0
aliyun.oss.accessKeyId = LTAI4GJMjVhBa212rQJLnPZtt
aliyun.oss.accessKeySecret = eGVBL30u53456gXd7XODlwYKWTaGT
aliyun.oss.endpoint = https://oss-cn-shenzhen.aliyuncs.com
aliyun.oss.bucketName = fuint-application
# 上传文件夹
# \u4E0A\u4F20\u6587\u4EF6\u5939
aliyun.oss.folder = uploads
# 访问域名
# \u8BBF\u95EE\u57DF\u540D
aliyun.oss.domain = https://fuint-application.oss-cn-shenzhen.aliyuncs.com
################## 微信相关配置 ##########################
# 公众号配置
################## \u5FAE\u4FE1\u76F8\u5173\u914D\u7F6E ##########################
# \u516C\u4F17\u53F7\u914D\u7F6E
weixin.official.appId=wxf4327ef05c27a0
weixin.official.appSecret=1f55e8749332234d9a074873d8e6a3
# 小程序配置
wxpay.appId = wxba517a9bac38fe92
wxpay.appSecret = 8bfcce86abc4e2a461ecc781a09249a5
# \u5C0F\u7A0B\u5E8F\u914D\u7F6E
#wxpay.appId = wxba517a9bac38fe92
#wxpay.appSecret = 8bfcce86abc4e2a461ecc781a09249a5
# \u8D22\u5229\u5B9D
#wxpay.appId = wx033c30e366eff6ac
#wxpay.appSecret = e46a9a5947380fb70a1aa33a5b427ba4
# \u6765\u4E2A\u6CB9\u6167
wxpay.appId = wxd8014eaf9bd72e93
wxpay.appSecret = 0194125b13cece10d5f6cdd664847b55
wxpay.mchId=1636980812
wxpay.apiV2=34354320201030y323e432342343
wxpay.certPath=/usr/local/fuint/cert/apiclient_cert.p12
wxpay.domain=https://www.fuint.cn/fuint-application
################## 支付宝支付相关配置 ######################
alipay.appId = 应用编号
alipay.privateKey = 应用私钥
alipay.publicKey = 支付宝公钥(通过应用公钥上传到支付宝开放平台换取支付宝公钥)
################## \u652F\u4ED8\u5B9D\u652F\u4ED8\u76F8\u5173\u914D\u7F6E ######################
alipay.appId = \u5E94\u7528\u7F16\u53F7
alipay.privateKey = \u5E94\u7528\u79C1\u94A5
alipay.publicKey = \u652F\u4ED8\u5B9D\u516C\u94A5\uFF08\u901A\u8FC7\u5E94\u7528\u516C\u94A5\u4E0A\u4F20\u5230\u652F\u4ED8\u5B9D\u5F00\u653E\u5E73\u53F0\u6362\u53D6\u652F\u4ED8\u5B9D\u516C\u94A5\uFF09
alipay.serverUrl=https://openapi.alipay.com/gateway.do
alipay.domain=https://www.fuint.cn/fuint-application/clientApi/pay/aliPayCallback
################ 微信订阅模板消息配置 ######################
weixin.subMessage.orderCreated=[{'key':'time', 'name':'订单时间'},{'key':'orderSn', 'name':'订单号'},{'key':'remark', 'name':'备注信息'}]
weixin.subMessage.deliverGoods=[{'key':'receiver', 'name':'收货人'}, {'key':'orderSn', 'name':'订单号'}, {'key':'expressCompany', 'name':'快递公司'}, {'key':'expressNo', 'name':'快递单号'}]
weixin.subMessage.couponExpire=[{'key':'name', 'name':'卡券名称'}, {'key':'expireTime', 'name':'到期时间'},{'key':'tips', 'name':'温馨提示'}]
weixin.subMessage.couponArrival=[{'key':'name', 'name':'卡券名称'},{'key':'amount', 'name':'金额'},{'key':'tips', 'name':'温馨提示'}]
weixin.subMessage.balanceChange=[{'key':'amount', 'name':'变动金额'},{'key':'time', 'name':'变动时间'},{'key':'tips', 'name':'温馨提示'}]
weixin.subMessage.couponConfirm=[{'key':'name', 'name':'卡券名称'},{'key':'time', 'name':'核销时间'}]
weixin.subMessage.pointChange=[{'key':'amount', 'name':'变动数量'},{'key':'time', 'name':'变动时间'},{'key':'remark', 'name':'备注信息'}]
################ \u5FAE\u4FE1\u8BA2\u9605\u6A21\u677F\u6D88\u606F\u914D\u7F6E ######################
weixin.subMessage.orderCreated=[{'key':'time', 'name':'\u8BA2\u5355\u65F6\u95F4'},{'key':'orderSn', 'name':'\u8BA2\u5355\u53F7'},{'key':'remark', 'name':'\u5907\u6CE8\u4FE1\u606F'}]
weixin.subMessage.deliverGoods=[{'key':'receiver', 'name':'\u6536\u8D27\u4EBA'}, {'key':'orderSn', 'name':'\u8BA2\u5355\u53F7'}, {'key':'expressCompany', 'name':'\u5FEB\u9012\u516C\u53F8'}, {'key':'expressNo', 'name':'\u5FEB\u9012\u5355\u53F7'}]
weixin.subMessage.couponExpire=[{'key':'name', 'name':'\u5361\u5238\u540D\u79F0'}, {'key':'expireTime', 'name':'\u5230\u671F\u65F6\u95F4'},{'key':'tips', 'name':'\u6E29\u99A8\u63D0\u793A'}]
weixin.subMessage.couponArrival=[{'key':'name', 'name':'\u5361\u5238\u540D\u79F0'},{'key':'amount', 'name':'\u91D1\u989D'},{'key':'tips', 'name':'\u6E29\u99A8\u63D0\u793A'}]
weixin.subMessage.balanceChange=[{'key':'amount', 'name':'\u53D8\u52A8\u91D1\u989D'},{'key':'time', 'name':'\u53D8\u52A8\u65F6\u95F4'},{'key':'tips', 'name':'\u6E29\u99A8\u63D0\u793A'}]
weixin.subMessage.couponConfirm=[{'key':'name', 'name':'\u5361\u5238\u540D\u79F0'},{'key':'time', 'name':'\u6838\u9500\u65F6\u95F4'}]
weixin.subMessage.pointChange=[{'key':'amount', 'name':'\u53D8\u52A8\u6570\u91CF'},{'key':'time', 'name':'\u53D8\u52A8\u65F6\u95F4'},{'key':'remark', 'name':'\u5907\u6CE8\u4FE1\u606F'}]
# rocketmq\u914D\u7F6E
//1
rocketmq.name-server=127.0.0.1:9876
//2
rocketmq.producer.group=provider

View File

@ -1,38 +1,39 @@
package com.fuint.api.fuyou.controller;
import com.fuint.api.fuyou.entity.Const;
import com.fuint.api.fuyou.service.FyPayService;
import com.fuint.api.fuyou.util.Utils;
import com.fuint.business.order.service.OilOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Enumeration;
import java.util.HashMap;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Map;
@RestController
@RequestMapping("/api/fyPay")
public class FyPayController {
@Autowired
private FyPayService payService;
@Lazy
private OilOrderService orderService;
// 接收支付平台异步通知的接口
@PostMapping("/notify")
public String notifyUrl(HttpServletRequest request,HttpServletResponse response) {
System.out.println("111+"+request);
System.out.println("222+"+response);
// Map paramMap = new HashMap<>();
// Enumeration parameterNames = request.getParameterNames();
// while(parameterNames.hasMoreElements()) {
// String parameterName = (String) parameterNames.nextElement();
// paramMap.put(parameterName, request.getParameter(parameterName));
// }
// boolean isSuccess = processNotify(paramMap); // 处理支付结果并返回成功或失败状态
// if(isSuccess) {
// return "success"; // 返回成功状态通知支付平台异步通知已成功接收
// } else {
// return "fail"; // 返回失败状态通知支付平台异步通知已失败
// }
return "11111111";
public String notifyUrl(HttpServletRequest request,HttpServletResponse response) throws UnsupportedEncodingException {
System.out.println("----------------收到支付回调--------"+request.getParameter("req"));
String notifyData = request.getParameter("req");
String decode = URLDecoder.decode(notifyData, Const.charset);
Map<String, String> reqMap = Utils.xmlStr2Map(decode);
if (reqMap.get("result_msg").equals("SUCCESS")){
String orderNo = reqMap.get("mchnt_order_no");
orderService.updateOrderStatus(orderNo,"paid");
return "1";
}else {
return "0";
}
}
}

View File

@ -0,0 +1,115 @@
package com.fuint.business.marketingActivity.activeNewlyweds.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsRecords;
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsRecordsService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
/**
* 新人有礼记录表(ActiveNewlywedsRecords)表控制层
*
* @author makejava
* @since 2023-12-20 14:12:53
*/
@RestController
@RequestMapping("business/marketingActivity/activeNewlywedsRecords")
public class ActiveNewlywedsRecordsController extends BaseController {
/**
* 服务对象
*/
@Resource
private ActiveNewlywedsRecordsService activeNewlywedsRecordsService;
/**
* 分页查询所有数据
* @param pageNo
* @param pageSize
* @param activeNewlywedsRecords
* @return
*/
@GetMapping
public ResponseObject selectAll(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("activeNewlywedsRecords") ActiveNewlywedsRecords activeNewlywedsRecords) {
Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.activeNewlywedsRecordsService.page(page, new QueryWrapper<>(activeNewlywedsRecords)));
}
/**
* 判断是否已经参加过新人有礼活动接口
* @param activeNewlywedsRecords
* @return
*/
@GetMapping("applet")
public ResponseObject isJoined(@Param("activeNewlywedsRecords") ActiveNewlywedsRecords activeNewlywedsRecords) {
LambdaQueryWrapper<ActiveNewlywedsRecords> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveNewlywedsRecords::getUserId,TokenUtil.getNowAccountInfo().getId());
List<ActiveNewlywedsRecords> list = this.activeNewlywedsRecordsService.list(queryWrapper);
if (list.size() == 0){
return getSuccessResult("1");
}else {
return getSuccessResult("0");
}
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
public ResponseObject selectOne(@PathVariable Serializable id) {
return getSuccessResult(this.activeNewlywedsRecordsService.getById(id));
}
/**
* 新增数据
*
* @param activeNewlywedsRecords 实体对象
* @return 新增结果
*/
@PostMapping
public ResponseObject insert(@RequestBody ActiveNewlywedsRecords activeNewlywedsRecords) {
return getSuccessResult(this.activeNewlywedsRecordsService.add(activeNewlywedsRecords));
}
/**
* 修改数据
*
* @param activeNewlywedsRecords 实体对象
* @return 修改结果
*/
@PutMapping
public ResponseObject update(@RequestBody ActiveNewlywedsRecords activeNewlywedsRecords) {
return getSuccessResult(this.activeNewlywedsRecordsService.updateById(activeNewlywedsRecords));
}
/**
* 删除数据
*
* @param idList 主键结合
* @return 删除结果
*/
@DeleteMapping
public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
return getSuccessResult(this.activeNewlywedsRecordsService.removeByIds(idList));
}
}

View File

@ -0,0 +1,44 @@
package com.fuint.business.marketingActivity.activeNewlyweds.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
/**
* 新人有礼记录表(ActiveNewlywedsRecords)表实体类
*
* @author makejava
* @since 2023-12-20 14:12:54
*/
@SuppressWarnings("serial")
@Data
public class ActiveNewlywedsRecords extends Model<ActiveNewlywedsRecords> {
//主键id
@TableId(type = IdType.AUTO)
private Integer id;
//活动id
private Integer activeNewlywedsId;
//所属连锁店id
private Integer chainStoreId;
//所属店铺id
private Integer storeId;
//用户id
private Integer userId;
//创建者
private String createBy;
//创建时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
//更新者
private String updateBy;
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
}

View File

@ -0,0 +1,15 @@
package com.fuint.business.marketingActivity.activeNewlyweds.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsRecords;
/**
* 新人有礼记录表(ActiveNewlywedsRecords)表数据库访问层
*
* @author makejava
* @since 2023-12-20 14:12:53
*/
public interface ActiveNewlywedsRecordsMapper extends BaseMapper<ActiveNewlywedsRecords> {
}

View File

@ -0,0 +1,21 @@
package com.fuint.business.marketingActivity.activeNewlyweds.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsRecords;
/**
* 新人有礼记录表(ActiveNewlywedsRecords)表服务接口
*
* @author makejava
* @since 2023-12-20 14:12:54
*/
public interface ActiveNewlywedsRecordsService extends IService<ActiveNewlywedsRecords> {
/**
* 新增数据
* @param activeNewlywedsRecords
* @return
*/
boolean add(ActiveNewlywedsRecords activeNewlywedsRecords);
}

View File

@ -0,0 +1,105 @@
package com.fuint.business.marketingActivity.activeNewlyweds.service.impl;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeNewlyweds.controller.vo.ActiveNewlywedsVO;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlyweds;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild;
import com.fuint.business.marketingActivity.activeNewlyweds.mapper.ActiveNewlywedsRecordsMapper;
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsRecords;
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsRecordsService;
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsService;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableRecordMapper;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.sun.xml.bind.v2.TODO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* 新人有礼记录表(ActiveNewlywedsRecords)表服务实现类
*
* @author makejava
* @since 2023-12-20 14:12:54
*/
@Service("activeNewlywedsRecordsService")
public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl<ActiveNewlywedsRecordsMapper, ActiveNewlywedsRecords> implements ActiveNewlywedsRecordsService {
@Resource
private ActiveNewlywedsService activeNewlywedsService;
@Resource
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
@Resource
private LJUserService userService;
/**
* 新增数据
* @param activeNewlywedsRecords
* @return
*/
@Override
@Transactional
public boolean add(ActiveNewlywedsRecords activeNewlywedsRecords) {
boolean save = false;
//用户信息
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
LJUserVo ljUserVo = userService.selectUserById(userId);
//保存新人有礼记录
ActiveNewlywedsVO activeNewlyweds = activeNewlywedsService.getOneById(1);
activeNewlywedsRecords.setActiveNewlywedsId(activeNewlyweds.getId());
activeNewlywedsRecords.setChainStoreId(nowAccountInfo.getChainStoreId());
activeNewlywedsRecords.setStoreId(nowAccountInfo.getStoreId());
activeNewlywedsRecords.setUserId(userId);
save = save(activeNewlywedsRecords);
//优惠券
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlyweds.getActiveNewlywedsChildList();
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsChildList) {
if (activeNewlywedsChild.getActiveGift().equals("1")){
cardFavorableRecord.setCardFavorableId(activeNewlywedsChild.getActiveNewlywedsId());
cardFavorableRecord.setChainStorId(nowAccountInfo.getChainStoreId());
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
cardFavorableRecord.setMtUserId(userId);
cardFavorableRecord.setName(ljUserVo.getName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setName(nowAccountInfo.getRealName());
cardFavorableRecord.setExchangeFrom("新人发券");
save = cardFavorableRecordService.save(cardFavorableRecord);
}else {
//兑换券
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardExchangeRecord.setCardExchangeId(activeNewlywedsChild.getActiveNewlywedsId());
cardExchangeRecord.setChainStorId(nowAccountInfo.getChainStoreId());
cardExchangeRecord.setStoreId(nowAccountInfo.getStoreId());
cardExchangeRecord.setMtUserId(userId);
cardExchangeRecord.setName(ljUserVo.getName());
cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setExchangeName(activeNewlywedsChild.getGiftCardName());
cardExchangeRecord.setExchangeFrom("新人领券");
cardExchangeRecord.setGiftName(activeNewlywedsChild.getGiftCardName());
cardExchangeRecord.setDescription(activeNewlywedsChild.getGiftCardDetail());
save = cardExchangeRecordService.save(cardExchangeRecord);
}
}
//积分
//成长值 TODO
}
//
return save;
}
}

View File

@ -0,0 +1,99 @@
package com.fuint.business.marketingActivity.activeRecommend.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendRecords;
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendRecordsService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
/**
* 邀请有礼记录表(ActiveRecommendRecords)表控制层
*
* @author makejava
* @since 2023-12-20 14:13:16
*/
@RestController
@RequestMapping("business/marketingActivity/activeRecommendRecords")
public class ActiveRecommendRecordsController extends BaseController {
/**
* 服务对象
*/
@Resource
private ActiveRecommendRecordsService activeRecommendRecordsService;
/**
* 小程序端查询邀请记录
* @param pageNo
* @param pageSize
* @param activeRecommendRecords
* @return
*/
@GetMapping
public ResponseObject selectAll(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("activeRecommendRecords") ActiveRecommendRecords activeRecommendRecords) {
Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.activeRecommendRecordsService.select(page, activeRecommendRecords));
}
/**
* 小程序端查询券总额
* @return
*/
@GetMapping("selectAllAmount")
public ResponseObject selectAllAmount() {
return getSuccessResult(this.activeRecommendRecordsService.selectAllAmount());
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
public ResponseObject selectOne(@PathVariable Serializable id) {
return getSuccessResult(this.activeRecommendRecordsService.getById(id));
}
/**
* 新增邀请记录接口
* @param activeRecommendRecords 实体对象
* @return 新增结果
*/
@PostMapping
public ResponseObject insert(@RequestBody ActiveRecommendRecords activeRecommendRecords) {
return getSuccessResult(this.activeRecommendRecordsService.add(activeRecommendRecords));
}
/**
* 修改数据
*
* @param activeRecommendRecords 实体对象
* @return 修改结果
*/
@PutMapping
public ResponseObject update(@RequestBody ActiveRecommendRecords activeRecommendRecords) {
return getSuccessResult(this.activeRecommendRecordsService.updateById(activeRecommendRecords));
}
/**
* 删除数据
*
* @param idList 主键结合
* @return 删除结果
*/
@DeleteMapping
public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
return getSuccessResult(this.activeRecommendRecordsService.removeByIds(idList));
}
}

View File

@ -0,0 +1,139 @@
package com.fuint.business.marketingActivity.activeRecommend.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
/**
* 邀请有礼记录表(ActiveRecommendRecords)表实体类
*
* @author makejava
* @since 2023-12-20 14:13:16
*/
@SuppressWarnings("serial")
@Data
public class ActiveRecommendRecords extends Model<ActiveRecommendRecords> {
//主键id
@TableId(type = IdType.AUTO)
private Integer id;
//活动id
private Integer activeNewlywedsId;
//所属连锁店id
private Integer chainStoreId;
//所属店铺id
private Integer storeId;
//用户id
private String userId;
//被邀请人id
private String inviteeUserId;
//被邀请人姓名
private String inviteeUserName;
//创建者
private String createBy;
//创建时间
@JsonFormat(pattern = "yyyy-MM-dd ")
private Date createTime;
//更新者
private String updateBy;
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getActiveNewlywedsId() {
return activeNewlywedsId;
}
public void setActiveNewlywedsId(Integer activeNewlywedsId) {
this.activeNewlywedsId = activeNewlywedsId;
}
public Integer getChainStoreId() {
return chainStoreId;
}
public void setChainStoreId(Integer chainStoreId) {
this.chainStoreId = chainStoreId;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getInviteeUserId() {
return inviteeUserId;
}
public void setInviteeUserId(String inviteeUserId) {
this.inviteeUserId = inviteeUserId;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -0,0 +1,15 @@
package com.fuint.business.marketingActivity.activeRecommend.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendRecords;
/**
* 邀请有礼记录表(ActiveRecommendRecords)表数据库访问层
*
* @author makejava
* @since 2023-12-20 14:13:16
*/
public interface ActiveRecommendRecordsMapper extends BaseMapper<ActiveRecommendRecords> {
}

View File

@ -0,0 +1,37 @@
package com.fuint.business.marketingActivity.activeRecommend.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendRecords;
/**
* 邀请有礼记录表(ActiveRecommendRecords)表服务接口
*
* @author makejava
* @since 2023-12-20 14:13:16
*/
public interface ActiveRecommendRecordsService extends IService<ActiveRecommendRecords> {
/**
* 小程序端查询邀请记录
* @param page
* @param activeRecommendRecords
* @return
*/
IPage select(Page page, ActiveRecommendRecords activeRecommendRecords);
/**
* 小程序端查询券总额
* @return
*/
double selectAllAmount();
/**
* 新增邀请记录接口
* @param activeRecommendRecords
* @return
*/
boolean add(ActiveRecommendRecords activeRecommendRecords);
}

View File

@ -0,0 +1,138 @@
package com.fuint.business.marketingActivity.activeRecommend.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
import com.fuint.business.marketingActivity.activeRecommend.mapper.ActiveRecommendRecordsMapper;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendRecords;
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendRecordsService;
import com.fuint.business.marketingActivity.activeRecommend.service.ActiveRecommendService;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendRecordsVO;
import com.fuint.business.marketingActivity.activeRecommend.vo.ActiveRecommendVO;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* 邀请有礼记录表(ActiveRecommendRecords)表服务实现类
*
* @author makejava
* @since 2023-12-20 14:13:16
*/
@Service("activeRecommendRecordsService")
public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecommendRecordsMapper, ActiveRecommendRecords> implements ActiveRecommendRecordsService {
@Resource
private ActiveRecommendService activeRecommendService;
@Resource
private CardFavorableService cardFavorableService;
/**
* 小程序端查询邀请记录
* @param page
* @param activeRecommendRecords
* @return
*/
@Override
public IPage select(Page page, ActiveRecommendRecords activeRecommendRecords) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
Integer storeId = nowAccountInfo.getStoreId();
LambdaQueryWrapper<ActiveRecommendRecords> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveRecommendRecords::getUserId,userId);
queryWrapper.eq(ActiveRecommendRecords::getStoreId,storeId);
/*IPage page1 = page(page, queryWrapper);
List<ActiveRecommendRecords> records = page1.getRecords();
List<ActiveRecommendRecordsVO> collect = records.stream().map(s -> {
ActiveRecommendRecordsVO activeRecommendRecordsVO = new ActiveRecommendRecordsVO();
s.getActiveNewlywedsId()
BeanUtils.copyProperties(s, activeRecommendRecordsVO);
return activeRecommendRecordsVO;
}).collect(Collectors.toList());
page1.setRecords(collect);*/
/*//券总额
double discountAmount = 0.0;
//推荐有礼活动
ActiveRecommendVO activeRecommendVO = activeRecommendService.getOneById(1);
//活动所送推荐人的优惠券
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendVO.getActiveRecommendChildList();
if(CollectionUtils.isNotEmpty(activeRecommendChildList)){
for (ActiveRecommendChild activeRecommendChild : activeRecommendChildList) {
if (activeRecommendChild.getActiveGift().equals("0")){
//券数量
Integer giftCardTotal = activeRecommendChild.getGiftCardTotal();
//券id
Integer vouchersId = activeRecommendChild.getVouchersId();
//券总额
discountAmount += (cardFavorableService.getById(vouchersId).getDiscountAmount() * giftCardTotal);
}
}
}
IPage page1 = page(page, queryWrapper);
List<ActiveRecommendRecords> records = page1.getRecords();*/
return page(page, queryWrapper);
}
@Override
public double selectAllAmount() {
//券总额
double discountAmount = 0.0;
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
Integer storeId = nowAccountInfo.getStoreId();
LambdaQueryWrapper<ActiveRecommendRecords> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveRecommendRecords::getUserId,userId);
queryWrapper.eq(ActiveRecommendRecords::getStoreId,storeId);
List<ActiveRecommendRecords> list = list(queryWrapper);
if (CollectionUtils.isNotEmpty(list)){
//邀请人数
int size = list.size();
//推荐有礼活动
ActiveRecommendVO activeRecommendVO = activeRecommendService.getOneById(1);
//活动所送推荐人的优惠券
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendVO.getActiveRecommendChildList();
if(CollectionUtils.isNotEmpty(activeRecommendChildList)){
for (ActiveRecommendChild activeRecommendChild : activeRecommendChildList) {
if (activeRecommendChild.getActiveGift().equals("1")){
//券数量
Integer giftCardTotal = activeRecommendChild.getGiftCardTotal();
//券id
Integer vouchersId = activeRecommendChild.getVouchersId();
//券总额
discountAmount += (cardFavorableService.getById(vouchersId).getDiscountAmount() * giftCardTotal * size);
}
}
}
}
return discountAmount;
}
/**
* 新增邀请记录接口
* @param activeRecommendRecords
* @return
*/
@Override
public boolean add(ActiveRecommendRecords activeRecommendRecords) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
Integer storeId = nowAccountInfo.getStoreId();
//邀请人id TODO
activeRecommendRecords.setUserId(userId.toString());
activeRecommendRecords.setStoreId(storeId);
//被邀请人id
activeRecommendRecords.setInviteeUserId(userId.toString());
activeRecommendRecords.setInviteeUserName(nowAccountInfo.getRealName());
return save(activeRecommendRecords);
}
}

View File

@ -197,9 +197,13 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
//活动时间
activeRecommendAppletVO.setTime("永久有效");
//积分
activeRecommendAppletVO.setPoint(activeRecommendVO.getPoints().toString());
if (ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){
activeRecommendAppletVO.setPoint(activeRecommendVO.getPoints().toString());
}
//成长值
activeRecommendAppletVO.setGrowValue(activeRecommendVO.getGrowthValue().toString());
if (ObjectUtils.isNotEmpty(activeRecommendVO.getGrowthValue())){
activeRecommendAppletVO.setGrowValue(activeRecommendVO.getGrowthValue().toString());
}
activeRecommendAppletVO.setRecommendActiveDescribeIn("欢迎各位亲朋好友来参加本店的推荐有礼活动,对于邀请人,参加即送:优惠券:"+cardi1+"兑换券:"+cardo1);
//被邀请人的券
activeRecommendAppletVO.setRecommendActiveDescribeOut("对于被邀请人,参加即送:优惠券:"+cardi2);

View File

@ -0,0 +1,11 @@
package com.fuint.business.marketingActivity.activeRecommend.vo;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommend;
import lombok.Data;
import java.io.Serializable;
@Data
public class ActiveRecommendRecordsVO extends ActiveRecommend implements Serializable {
//优惠券总额
private Integer allAmout;
}

View File

@ -90,12 +90,26 @@ public class CardFavorableController extends BaseController {
return getSuccessResult(this.cardFavorableService.removeByIds(idList));
}
/**
*查询优惠券接口(小程序端)
*查询本店优惠券接口(小程序端)
* @param pageNo
* @param pageSize
* @param cardFavorable
* @param cardFavorableDTO
* @return
@GetMapping("OwnApplet")
public ResponseObject selectAllOwnStore(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("cardFuelDiesel") CardFavorableDTO cardFavorableDTO) {
Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.cardFavorableService.selectAllOwnStore(page,cardFavorableDTO));
}*/
/**
*查询我的优惠券接口(小程序端)
* @param pageNo
* @param pageSize
* @param cardFavorableDTOS
* @return
*/
@GetMapping("applet")

View File

@ -83,6 +83,26 @@ public class CardFavorableRecordController extends BaseController {
return getSuccessResult(this.cardFavorableRecordService.save(cardFavorableRecord));
}
/**
* 小程序端优惠券领取接口
*
* @param idList 优惠券ids
* @return 新增结果
*/
@PostMapping("drawDown")
public ResponseObject drawDown(@RequestParam("idList") List<Integer> idList) {
return getSuccessResult(this.cardFavorableRecordService.drawDown(idList));
}
/**
* 小程序端判断是否领取优惠券
* @return 新增结果
*/
@GetMapping("isDrawDown")
public ResponseObject isDrawDown() {
return getSuccessResult(this.cardFavorableRecordService.isDrawDown());
}
/**
* 修改数据
*

View File

@ -7,6 +7,7 @@ import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRe
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
@ -34,5 +35,17 @@ public interface CardFavorableRecordService extends IService<CardFavorableRecord
*/
Map<String,Integer> selectCount(CardFavorableRecord cardFavorableRecord);
/**
* 小程序端优惠券领取接口
* @param idList
* @return
*/
boolean drawDown(List<Integer> idList);
/**
* 小程序端判断是否领取优惠券
* @return
*/
boolean isDrawDown();
}

View File

@ -2,6 +2,7 @@ package com.fuint.business.marketingActivity.cardFavorable.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
@ -9,6 +10,9 @@ import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableRe
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
@ -30,6 +34,8 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
@Resource
private CardFavorableRecordMapper cardFavorableRecordMapper;
@Resource
private LJUserService userService;
/**
* 分页查询所有数据
* @param page
@ -73,12 +79,9 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
return cardFavorableRecordMapper.getCardFavorableList(page,cardFavorableRecord);
}
/**
* 统计优惠券使用数量
*/
/**
*
* 统计优惠券使用数量
* @param cardFavorableRecord
* @return
*/
@Override
@ -86,5 +89,52 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
return cardFavorableRecordMapper.selectTotal(storeId,cardFavorableRecord.getId());
}
/**
* 小程序端优惠券领取接口
* @param idList
* @return
*/
@Override
public boolean drawDown(List<Integer> idList) {
boolean save = false;
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
LJUserVo ljUserVo = userService.selectUserById(userId);
//优惠券
for (Integer id : idList) {
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(id);
cardFavorableRecord.setChainStorId(nowAccountInfo.getChainStoreId());
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
cardFavorableRecord.setMtUserId(userId);
cardFavorableRecord.setName(ljUserVo.getName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setName(nowAccountInfo.getRealName());
cardFavorableRecord.setExchangeFrom("店铺发券");
save = save(cardFavorableRecord);
}
return save;
}
/**
* 小程序端判断是否领取优惠券
* @return
*/
@Override
public boolean isDrawDown() {
boolean isDrawDown = false;
//登录用户信息
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LambdaQueryWrapper<CardFavorableRecord> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardFavorableRecord::getMtUserId,nowAccountInfo.getId());
queryWrapper.eq(CardFavorableRecord::getStoreId,nowAccountInfo.getStoreId());
//如果领过券 就不让领了
List<CardFavorableRecord> list = list(queryWrapper);
if (CollectionUtils.isNotEmpty(list) && list.size() == 0){
isDrawDown = true;
}
return isDrawDown;
}
}

View File

@ -74,7 +74,7 @@ public class CardValueRecordController extends BaseController {
/**
* 储值卡充值
*
* @param cardValueRecord 实体对象
* @param cardValueRecordDTO 实体对象
* @return 新增结果
*/
@PostMapping

View File

@ -26,6 +26,8 @@ import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.RocketUtil;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.mapper.MtStaffMapper;
import com.fuint.repository.model.MtStaff;
import io.lettuce.core.dynamic.annotation.Param;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -73,6 +75,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
@Resource
RocketUtil rocketUtil;
@Resource
private MtStaffMapper mtStaffMapper;
/**
* 储值卡充值新增
* @param cardValueRecordDTO
@ -80,9 +84,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
*/
@Override
public boolean insert(CardValueRecordDTO cardValueRecordDTO) {
boolean pay = false;
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
boolean pay = false;
// 添加储存充值
cardValueRecordDTO.setPayStatus("unpaid");
// 根据日期生成支付编号
@ -131,8 +134,11 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
} catch (Exception e){
e.printStackTrace();
}
// 支付 payment_type
//支付成功之后添加充值记录
pay = addCardValueRecord(cardValueRecordDTO);
// 支付 payment_type
return pay;
}
@Override
@ -416,6 +422,42 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
}
}
private boolean addCardValueRecord(CardValueRecordDTO cardValueRecordDTO){
CardValueRecord cardValueRecord = new CardValueRecord();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
Integer storId = nowAccountInfo.getStoreId();
//用户信息
LJUserVo ljUserVo = ljUserMapper.selectAllInfoById2(userId, storId);
cardValueRecord.setName(ljUserVo.getName());
cardValueRecord.setMtUserId(userId);
cardValueRecord.setMobile(ljUserVo.getMobile());
//员工信息
Integer mtStaffId = cardValueRecordDTO.getMtStaffId();
MtStaff mtStaff = mtStaffMapper.selectById(mtStaffId);
String realName = mtStaff.getRealName();
String mobile = mtStaff.getMobile();
cardValueRecord.setMobile(mobile);
cardValueRecord.setRealName(realName);
cardValueRecord.setMtStaffId(mtStaffId);
//储值卡信息
Integer cardValueId = cardValueRecordDTO.getCardValueId();
cardValueRecord.setCardValueId(cardValueId);
//充值类型自定义金额
if (cardValueRecordDTO.getRechargeType().equals("1")){
cardValueRecord.setAmount(cardValueRecordDTO.getAmount());
//充值类型
}else if (cardValueRecordDTO.getRechargeType().equals("0")){
cardValueRecord.setAmount(cardValueRecordDTO.getBidBalance());
}
/*cardValueRecordDTO.get*/
return true;
}
}

View File

@ -160,6 +160,18 @@ public class OilOrderController extends BaseController {
return getSuccessResult(orderService.addOilOrder(oilOrder));
}
/**
* 根据订单号修改订单支付状态
* @param map
* @return
*/
@PostMapping("/orderStatus")
public ResponseObject editStatus(@RequestBody Map<String,String> map){
String orderNo = map.get("orderNo");
String status = map.get("status");
return getSuccessResult(orderService.updateOrderStatus(orderNo,status));
}
/**
* 信息统计

View File

@ -84,7 +84,15 @@ public interface OilOrderService extends IService<OilOrder> {
* 小程序订单支付
* @param map
*/
public boolean appletPay(Map<String,String> map);
public Map<String, String> appletPay(Map<String,String> map);
/**
* 根据订单号修改订单支付状态
* @param orderNo
* @param status
* @return
*/
public int updateOrderStatus(String orderNo,String status);
/**
* 添加油品跟踪信息

View File

@ -435,7 +435,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
private OilNumberService oilNumberService;
@Override
public boolean appletPay(Map<String, String> map) {
public Map<String, String> appletPay(Map<String, String> map) {
String orderNo = map.get("orderNo");
// 支付金额
Integer payAmount = (int) (Double.valueOf(map.get("payAmount"))*100);
@ -482,10 +482,13 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
if (result){
return false;
return null;
}
oilOrder.setTankId(tankId);
Map<String, String> applet = null;
if (!map.get("payAmount").equals("0")) {
// 调用支付接口
// 判断是否开启支付规则
@ -522,7 +525,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 调用支付接口
try {
fyPayService.applet(map1);
applet = fyPayService.applet(map1);
applet.put("orderNo",orderNo);
} catch (Exception e) {
e.printStackTrace();
}
@ -536,7 +540,21 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
oilOrder.setOrderStatus("paid");
baseMapper.updateById(oilOrder);
}
return true;
return applet;
}
@Override
public int updateOrderStatus(String orderNo, String status) {
int row = 0;
OilOrder oilOrder = this.selectOilOrderByOrderNo(orderNo);
if (ObjectUtil.isNotEmpty(oilOrder)){
oilOrder.setOrderStatus(status);
if (status.equals("paid")){
oilOrder.setPayTime(new Date());
}
row = baseMapper.updateById(oilOrder);
}
return 0;
}
@Autowired
@ -625,7 +643,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Integer dieselGrowthValue = null;
Integer naturalGrowthValue = null;
LJStore store = storeService.selectStoreByStoreId(storeId);
UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId());
UserBalance balance = userBalanceService.selectUserBalance(userid);
int growth = balance.getGrowthValue();
balance.setRefuelMoney(refuelMoney);
// 查询会员等级列表信息
@ -685,7 +703,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// 根据用户id查询用户余额信息
LJStore store = storeService.selectStoreByStoreId(storeId);
UserBalance balance = userBalanceService.selectUserBalance(userId,store.getChainStoreId());
UserBalance balance = userBalanceService.selectUserBalance(userId);
// 修改余额信息
Double beforeBalance = balance.getCardBalance();
Double afterBalance = beforeBalance - amount;

View File

@ -1,7 +1,8 @@
# \u57FA\u672C\u914D\u7F6E
server.port=8008
server.port=8080
env.profile=dev
env.properties.path=D:/code/oilSystem/fuintBackend/configure/
env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
# \u6570\u636E\u5E93\u914D\u7F6E
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
@ -20,7 +21,7 @@ spring.servlet.multipart.max-request-size=10MB
# mybatis\u914D\u7F6E
mybatis-plus.mapper-locations = classpath*:/mapper/*Mapper.xml,classpath*:com/fuint/**/xml/*Mapper.xml
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
# \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0536\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
mybatis-plus.configuration.intercepts=com.example.MyInterceptor
# \u9ED8\u8BA4\u65F6\u95F4\u683C\u5F0F
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss

View File

@ -50,7 +50,7 @@
/* */
"mp-weixin" : {
"output-path" : "dist/myapp",
"appid" : "wxba517a9bac38fe92",
"appid" : "wxd8014eaf9bd72e93",
"setting" : {
"urlCheck" : false,
"es6" : true,

View File

@ -151,6 +151,13 @@
"navigationBarTitleText": "支付订单",
"navigationStyle": "custom"
}
},
{
"path": "orderSuccess/index",
"style": {
"navigationBarTitleText": "支付完成页",
"navigationStyle": "custom"
}
}
]
},

View File

@ -104,7 +104,7 @@
<image src="../../static/imgs/zzxryl.png"
style="width: 280px; height: 350px; margin: 20px auto; margin-top: 200px; ">
</image>
<view class="anniuprp" @click="onOverlay()">
<view class="anniuprp" @click="drawDown()">
<text>立即领取</text>
</view>
</u-overlay>
@ -122,9 +122,10 @@
export default {
data() {
return {
joinmsg: '',
msg: "1",
show: false,
shows: true,
shows: '',
title: '',
oilTypeList: '',
columns: [
@ -184,12 +185,66 @@
this.getOilType();
},
onShow() {
this.isJoined()
// this.isExistStoreId();
},
components: {
tabbar
},
methods: {
//
isJoined() {
request({
url: 'business/marketingActivity/activeNewlywedsRecords/applet',
method: 'get',
}).then(res => {
console.log("11111" + res)
if (res.code == 200 && res.data == 1) {
this.shows = true
} else {
this.shows = false
}
})
},
//
drawDown() {
/* this.shows = false */
request({
url: 'business/marketingActivity/activeNewlywedsRecords',
method: 'post',
data: {
}
}).then(res => {
console.log("11111" + res)
if (res.code == 200 && res.data == true) {
this.shows = false
uni.showToast({
title: '领取成功!'
})
} else {
this.shows = false
uni.showToast({
title: '领取失败!'
})
}
/* if (res.code == 200 && res.data == 1) {
this.shows = true
} else {
this.shows = false
} */
})
},
//
selectActiveNewlyweds() {
request({
url: 'business/marketingActivity/activeNewlyweds/applet',
method: 'get',
}).then(res => {
console.log("11111" + res)
})
},
isExistStoreId() {
if (uni.getStorageSync("storeId") != "") {
this.getStore(uni.getStorageSync("storeId"));
@ -243,6 +298,14 @@
_this.welfare.push(response.data.welfare)
}
}
if (response.data.doorstepPhoto != undefined && response.data
.doorstepPhoto != null && response.data.doorstepPhoto != "") {
let list = JSON.parse(response.data.doorstepPhoto)
_this.list3 = [];
list.forEach(item => {
_this.list3.push(_this.baseUrl + item)
})
}
}).catch((res) => {
uni.showLoading({
title: res + "---" + 1
@ -268,14 +331,18 @@
"lat": res.latitude
},
}).then((response) => {
_this.distance = (Math.ceil(response.data.distance)).toFixed(1)
_this.distance = (Math.ceil(response.data.distance))
.toFixed(1)
_this.store = response.data.store
uni.setStorageSync("storeId", response.data.store.id)
uni.setStorageSync("chainStoreId", response.data.store.chainStoreId)
uni.setStorageSync("chainStoreId", response.data.store
.chainStoreId)
let welfare = response.data.store.welfare
if (welfare != undefined && welfare != null && welfare != "") {
if (welfare != undefined && welfare != null &&
welfare != "") {
if (welfare.includes(",")) {
_this.welfare = response.data.store.welfare.split(",")
_this.welfare = response.data.store.welfare
.split(",")
} else {
_this.welfare.push(response.data.store.welfare)
}
@ -342,12 +409,13 @@
cancel() {
this.show = false
},
onOverlay() {
/* onOverlay() {
this.drawDown();
this.shows = false
uni.showToast({
title: '领取成功'
})
},
}, */
goActivity() {
//
uni.navigateTo({
@ -667,4 +735,4 @@
color: white;
margin: 0 auto;
}
</style>
</style>

View File

@ -263,9 +263,12 @@
url: '/business/userManager/user/getUserBalance',
method: 'get',
}).then(res => {
console.log(res)
// console.log(res,111222)
if (res.code == 200) {
this.cardBalance = res.data.cardBalance,
/* if (res.data.refuelMoney!=null && res.data.refuelMoney!=""){
this.refuelMoney = JSON.parse(res.data.refuelMoney);
} */
this.refuelMoney = JSON.parse(res.data.refuelMoney);
}
})
@ -276,7 +279,7 @@
method: 'get',
params: this.query
}).then(res => {
console.log(res)
// console.log(res)
if (res.code == 200) {
this.cardsList = res.data.records
}
@ -285,13 +288,13 @@
//
getUserInfoList() {
request({
url: '/business/userManager/user/getByUniApp',
url: 'business/userManager/user/getByUniApp',
method: 'get',
params: {
chainStoreId: this.chainStoreId
}
}).then((res) => {
if (res.code == 200) {
if (res.code == 200 && res.data!=null) {
this.myPoints = res.data.points
}
})
@ -469,4 +472,4 @@
.centenr-size {
font-size: 14px;
}
</style>
</style>

View File

@ -8,7 +8,8 @@
<view class="top-box">
<view class="dis">
<view class="top-img">
<image src="../../static/logo.png" mode=""></image>
<image v-if="store.logo==''||store.logo==null||store.logo==undefined" src="../../static/logo.png" mode=""></image>
<image v-else :src="baseUrl+store.logo" mode=""></image>
</view>
<view style="width: 80%;">
<view class="top-title">{{store.name}}{{store.description ? "("+store.description+")" : ""}}

View File

@ -158,7 +158,7 @@
</view>
</view>
</view>
<view class="anniu">
<view class="anniu" @click="goTopup()">
去参与
</view>
<!-- <view class="g-box" v-for="(item,index) in datas" :key="index" v-if="title == '消费有礼活动'">
@ -205,6 +205,11 @@
this.getData(option.name);
},
methods: {
goTopup() {
uni.navigateTo({
url: '/pagesHome/oilRecharge/oilRecharge'
})
},
getData(name) {
uni.showLoading({
//title: ''
@ -416,4 +421,4 @@
left: 50%;
transform: translate(-50%, -50%);
}
</style>
</style>

View File

@ -73,7 +73,7 @@
userInfo: {
storeId: 0,
staffId: "",
phone: '17753808121'
phone: '15426845715'
},
type: 'phone',

View File

@ -35,17 +35,17 @@
<u-overlay :show="shows">
<view class="boxck">
<view class="coupbox" v-for="(item,index) in 3" :key="index">
<view class="left_coup">188</view>
<view class="coupbox" v-for="(item,index) in cardFavorableList" :key="index">
<view class="left_coup">{{item.discountAmount}}</view>
<view class="right_liu">
<view class="">
<view class="c_name">优惠券名称</view>
<view class="c_time">有效期2023/12/03</view>
<view class="c_name">{{item.name}}</view>
<view class="c_time">2023/12/03</view>
</view>
</view>
</view>
<view class="_anniuprp" @click="onCoupons()">立即领取</view>
<view class="_anniuprp" @click="drawDownCardFavorables()">立即领取</view>
</view>
</u-overlay>
@ -60,6 +60,8 @@
export default {
data() {
return {
idList: [18, 19],
cardFavorableList: [],
cardsList: [],
shows: true,
query: {
@ -99,9 +101,59 @@
},
onShow() {
this.getGiftRecords()
this.getGiftRecords();
this.getAllCardFavorables();
this.isDrawDown();
},
methods: {
getAllCardFavorables() {
request({
url: 'business/marketingActivity/cardFavorable',
method: 'get',
params: this.query
}).then(res => {
if (res.code == 200) {
this.cardFavorableList = res.data.records;
console.log("555" + this.cardFavorableList)
/* this.cardFavorableList.forEach(item => this.idList.push(item.id));
console.log("333" + idList) */
}
})
},
drawDownCardFavorables() {
request({
url: 'business/marketingActivity/cardFavorableRecord/drawDown',
method: 'post',
/* data: {
idList: [18, 19]
} */
}).then(res => {
console.log("222" + res)
if (res.code == 200 && res.data == true) {
this.shows = false
uni.showToast({
title: '领取成功!'
})
} else {
this.shows = false
uni.showToast({
title: '领取失败!'
})
}
})
},
isDrawDown() {
request({
url: 'business/marketingActivity/cardFavorableRecord/isDrawDown',
method: 'get',
}).then(res => {
if (res.code == 200 && res.data == true) {
this.shows = true
} else {
this.shows = false
}
})
},
goRecharge() {
uni.navigateTo({
url: '/pagesHome/oilRecharge/oilRecharge'
@ -130,12 +182,12 @@
},
onCoupons() {
/* onCoupons() {
this.shows = false
uni.showToast({
title: '领取成功'
})
},
}, */
goback() {
uni.navigateBack()
},
@ -362,4 +414,4 @@
font-weight: bold;
color: #7D592C;
}
</style>
</style>

View File

@ -14,11 +14,11 @@
<view class="hbbox">
<view class="h-box">
<view class="or-box">
<view class="max-size">120.00</view>
<view class="max-size">{{allAmount}}</view>
<view class="min-size">优惠券总额</view>
</view>
<view class="or-box">
<view class="max-size">3</view>
<view class="max-size">{{this.activeRecommendRecordsList.length}}</view>
<view class="min-size">邀请人数</view>
</view>
</view>
@ -41,18 +41,21 @@
<view class="bai-top">
邀请记录
</view>
<view class="t-box" v-for="(item,index) in 3" :key="index">
<view class="t-box" v-for="(item,index) in activeRecommendRecordsList" :key="index">
<view class="diss">
<view class="touxiang">
<image src="../../static/imgs/myx.png" mode=""></image>
</view>
<view class="">
<view class="name-t">泸沽寻梦</view>
<view class="h-size">2023-11-02</view>
<view class="name-t">{{item.inviteeUserName}}</view>
<!-- <view class="h-size"></view> -->
</view>
</view>
<view class="hong-size">
<!-- <view class="hong-size">
+100
</view> -->
<view class="hong-size">
{{item.createTime}}
</view>
</view>
</view>
@ -62,9 +65,12 @@
</template>
<script>
import request from "../../utils/request";
export default {
data() {
return {
allAmount: 0.0,
activeRecommendRecordsList: [],
title: '',
@ -73,8 +79,34 @@
components: {
},
onShow() {
this.getAllAmount();
this.getActiveRecommendRecords();
},
methods: {
getAllAmount() {
request({
url: 'business/marketingActivity/activeRecommendRecords/selectAllAmount',
method: 'get',
}).then(res => {
console.log(res)
if (res.code == 200) {
this.allAmount = res.data
}
})
},
getActiveRecommendRecords() {
request({
url: 'business/marketingActivity/activeRecommendRecords',
method: 'get',
}).then(res => {
console.log(res)
if (res.code == 200) {
this.activeRecommendRecordsList = res.data.records
}
})
},
goback() {
uni.navigateBack()
}
@ -280,4 +312,4 @@
font-weight: 400;
color: #999999;
}
</style>
</style>

View File

@ -11,10 +11,10 @@
<view class="kuangbox">使用规则 </view>
<view class="box-title">储值余额</view>
<view class="box-nmb">{{cardBalance}}</view>
<view class="dis-bt">
<!-- <view class="dis-bt">
<view class="">累计获得0.00</view>
<view class="">已经抵用0.00</view>
</view>
</view> -->
</view>
<view class="box-gang">
<view class="">明细</view>
@ -22,22 +22,22 @@
</view>
<view class="fuji">
<view class="mx-box" @click="godetails()">
<view class="mx-box" @click="godetails()" v-for="(item,index) in list" :key="index">
<view class="m-b-box">
<view class="box-name">加油站名称</view>
<view class="moneyname">充值成功</view>
</view>
<view class="y-bt">
<view class="sizehui">订单金额</view>
<view class="sizehei">0.01</view>
<view class="sizehei">{{item.rechargeBalance}}</view>
</view>
<view class="y-bt">
<view class="sizehui">优惠合计</view>
<view class="sizehong">0.01</view>
<view class="sizehong">{{item.obtain}}</view>
</view>
<view class="y-bt">
<view class="sizehui">订单时间</view>
<view class="sizehei">2023.01.23</view>
<view class="sizehei">{{item.createTime}}</view>
</view>
<view class="dibu">
<view class="xiaanniu">评价有礼</view>
@ -56,6 +56,16 @@
export default {
data() {
return {
list: [],
totalDetail: '',
show: false,
query: {
mtUserId: '',
storeId: '',
recordName: '储值卡',
pageNo: 1,
pageSize: 10
},
cardBalance: 0.00,
title: '',
@ -67,9 +77,31 @@
},
onShow() {
this.getUserBalance()
this.list = []
this.getUserBalance();
this.getAllOrderList();
},
methods: {
//
getAllOrderList() {
request({
url: 'business/marketingActivity/cardValueRecord/selectAllRecord',
method: 'get',
params: this.query
}).then((res) => {
if (res.code == 200) {
if (this.pageNo != 1) {
this.list = this.list.concat(res.data.records)
} else {
this.list = res.data.records
}
this.totalDetail = res.data.total
this.show = false
uni.hideLoading();
}
})
},
godetails() {
uni.navigateTo({
url: '/pagesMy/details/details'

View File

@ -26,7 +26,7 @@
<view>
<scroll-view scroll-y="true" :scroll-top="scrollTop" id="scrollList" style="height: 78vh;"
@scrolltolower="scrolltolower">
<!-- 列表 -->
<!-- 油品订单列表 -->
<view class="box-order" v-for="(item,index) in list" :key="index">
<view class="or-box-top">
<view class="">{{getStoreName(storeList,item.storeId)}}</view>
@ -52,6 +52,32 @@
</view>
</view>
</view>
<!-- 储值卡订单列表 -->
<view class="box-order" v-for="(item,index) in balanceList" :key="index">
<view class="or-box-top">
<view class="">{{getStoreName(storeList,item.storeId)}}</view>
<view class="chengg">{{getPayName(payList,item.orderStatus)}}</view>
</view>
<view class="but-box">
<view class="huis">订单金额</view>
<view class="">{{item.orderAmount}}</view>
</view>
<view class="but-box">
<view class="huis">优惠合计</view>
<view class="reds">{{item.discountAmount}}</view>
</view>
<view class="but-box">
<view class="huis">订单时间</view>
<view class="" v-if="item.orderStatus=='paid'">{{parseTime(item.payTime)}}</view>
<view class="" v-else>{{item.createTime}}</view>
</view>
<view class="end-box" @click="goComment()">
<view class="anniu">
<text>评价有礼</text>
</view>
</view>
</view>
<!-- 状态加载更多没有更多了... -->
<u-load-more :status="status"></u-load-more>
</scroll-view>
@ -84,6 +110,8 @@
//
orderList: [],
list: [],
//
balanceList:[],
map: {
page: 1,
pageSize: 5,

View File

@ -21,7 +21,7 @@
<view class="">明细</view>
<!-- <view class="hui-anniu">全部 <u-icon name="arrow-down-fill" size="18"></u-icon> </view> -->
</view>
<view class="fuji">
<view class="fuji" v-for="(item,index) in list" :key="index">
<view class="mx-box">
<view class="m-b-box">
@ -30,15 +30,15 @@
</view>
<view class="y-bt">
<view class="sizehui">订单金额</view>
<view class="sizehei">0.01</view>
<view class="sizehei">{{item.rechargeBalance}}</view>
</view>
<view class="y-bt">
<view class="sizehui">优惠合计</view>
<view class="sizehong">0.01</view>
<view class="sizehong">{{item.obtain}}</view>
</view>
<view class="y-bt">
<view class="sizehui">订单时间</view>
<view class="sizehei">2023.01.23</view>
<view class="sizehei">{{item.createTime}}</view>
</view>
<view class="dibu">
<view class="xiaanniu">评价有礼</view>
@ -57,6 +57,16 @@
export default {
data() {
return {
list: [],
totalDetail: '',
show: false,
query: {
mtUserId: '',
storeId: '',
recordName: '升数卡',
pageNo: 1,
pageSize: 10
},
refuelMoney: [],
title: '',
@ -68,9 +78,31 @@
},
onShow() {
this.list = []
this.getAllOrderList();
this.getUserBalance()
},
methods: {
//
getAllOrderList() {
request({
url: 'business/marketingActivity/cardValueRecord/selectAllRecord',
method: 'get',
params: this.query
}).then((res) => {
if (res.code == 200) {
if (this.pageNo != 1) {
this.list = this.list.concat(res.data.records)
} else {
this.list = res.data.records
}
this.totalDetail = res.data.total
this.show = false
uni.hideLoading();
}
})
},
goback() {
uni.navigateBack()
},

View File

@ -282,11 +282,12 @@
isOilStorageCard:false,
// 使
isUseGrade:false,
orderInfo:{},
}
},
onLoad(e) {
// this.orderNo = e.orderNo
this.orderNo = "20231201114800ebe24b"
this.orderNo = e.orderNo
// this.orderNo = "2345202312191043054f3328"
},
onShow() {
this.getOilOrder();
@ -393,6 +394,41 @@
data: map,
}).then(res => {
console.log(res)
let payProvider = "wxpay"
// if (_this.appltType== "WECHAT"){
// payProvider = "wxpay"
// }else{
// payProvider = "alipay"
// }
_this.orderInfo = JSON.parse(res.data.reserved_pay_info);
uni.requestPayment({
// provider: 'wxpay' 'alipay'
provider: payProvider,
timeStamp: _this.orderInfo.timeStamp,
nonceStr: _this.orderInfo.nonceStr,
package: _this.orderInfo.package,
signType: 'MD5',
paySign: _this.orderInfo.paySign,
success: function (res) {
console.log('success:',res);
uni.reLaunch({
url: '/pagesRefuel/orderSuccess/index'
})
},
fail: function (err) {
request({
url: "business/oilOrder/orderStatus",
method: 'post',
data: {"orderNo":res.data.orderNo,"status":"payFail"},
}).then((res)=>{
uni.showToast({
title:"支付失败!",
icon:"error"
})
})
console.log('fail:',err);
}
});
})
},
//

View File

@ -0,0 +1,64 @@
<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goBack"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">支付完成</view>
<view class="my-icons"></view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
goBack() {
uni.reLaunch({
url: '/pages/index/index'
})
}
}
}
</script>
<style scoped lang="scss">
.content {
background: #f4f5f6;
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
}
.my-header {
width: 100%;
height: 88px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
</style>