This commit is contained in:
齐天大圣 2024-01-24 15:22:16 +08:00
parent 53627e2f41
commit 8215f03ac9
8 changed files with 103 additions and 22 deletions

View File

@ -97,7 +97,7 @@
<!-- <span>{{ scope.row.qrCodeLink }}</span>-->
</template>
</el-table-column>
<el-table-column label="参与次数" align="center" prop="count"/>
<!-- <el-table-column label="参与次数" align="center" prop="count"/>-->
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
@ -171,9 +171,9 @@
<el-form-item label="使用说明" prop="useInstructions">
<el-input type="textarea" v-model="form.useInstructions" placeholder="请输入使用说明"></el-input>
</el-form-item>
<el-form-item label="参与次数" prop="count">
<!-- <el-form-item label="参与次数" prop="count">
<el-input-number v-model="form.count" controls-position="right" :min="1" :max="999"></el-input-number>
</el-form-item>
</el-form-item>-->
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio label="0">启用</el-radio>
@ -275,9 +275,9 @@ export default {
useInstructions: [
{ required: true, message: '请输入使用说明', trigger: 'change' }
],
count: [
/*count: [
{ required: true, message: '请输入参与次数', trigger: 'change' }
],
],*/
status: [
{ required: true, message: '请选择状态', trigger: 'change' }
]

View File

@ -761,6 +761,70 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
}
}
}
//三个优惠都不为空
BigDecimal bigDecimal = new BigDecimal("0.00");
if (ObjectUtils.isNotEmpty(paymentActiveVO.getActiveFavorableAmount()) && ObjectUtils.isNotEmpty(paymentActiveVO.getCardFavorableAmount())&& ObjectUtils.isNotEmpty(paymentActiveVO.getMemberFavorableAmount())) {
BigDecimal add3 = paymentActiveVO.getActiveFavorableAmount().add(paymentActiveVO.getCardFavorableAmount()).add(paymentActiveVO.getMemberFavorableAmount());
if (add3.compareTo(paymentActiveDTO.getAmount()) > 0){
BigDecimal add21 = paymentActiveVO.getActiveFavorableAmount().add(paymentActiveVO.getCardFavorableAmount());
BigDecimal add22 = paymentActiveVO.getActiveFavorableAmount().add(paymentActiveVO.getMemberFavorableAmount());
BigDecimal add23 = paymentActiveVO.getCardFavorableAmount().add(paymentActiveVO.getMemberFavorableAmount());
if (add21.compareTo(add22)>0 && add21.compareTo(add23)>0){
paymentActiveVO.setMemberFavorableAmount(bigDecimal);
}
if (add22.compareTo(add21)>0 && add22.compareTo(add23)>0){
paymentActiveVO.setCardFavorableAmount(bigDecimal);
}
if (add23.compareTo(add21)>0 && add23.compareTo(add22)>0){
paymentActiveVO.setActiveFavorableAmount(bigDecimal);
}
if (paymentActiveVO.getActiveFavorableAmount().compareTo(add23)>0){
paymentActiveVO.setCardFavorableAmount(bigDecimal);
paymentActiveVO.setMemberFavorableAmount(bigDecimal);
}
if (paymentActiveVO.getCardFavorableAmount().compareTo(add22)>0){
paymentActiveVO.setActiveFavorableAmount(bigDecimal);
paymentActiveVO.setMemberFavorableAmount(bigDecimal);
}
if (paymentActiveVO.getMemberFavorableAmount().compareTo(add21)>0){
paymentActiveVO.setActiveFavorableAmount(bigDecimal);
paymentActiveVO.setCardFavorableAmount(bigDecimal);
}
}
}
//有空值
if (ObjectUtils.isEmpty(paymentActiveVO.getActiveFavorableAmount()) || ObjectUtils.isEmpty(paymentActiveVO.getCardFavorableAmount()) || ObjectUtils.isEmpty(paymentActiveVO.getMemberFavorableAmount())){
if (ObjectUtils.isEmpty(paymentActiveVO.getActiveFavorableAmount()) && ObjectUtils.isNotEmpty(paymentActiveVO.getCardFavorableAmount())&& ObjectUtils.isNotEmpty(paymentActiveVO.getMemberFavorableAmount())){
if (paymentActiveVO.getCardFavorableAmount().add(paymentActiveVO.getMemberFavorableAmount()).compareTo(paymentActiveDTO.getAmount())>0){
if (paymentActiveVO.getCardFavorableAmount().compareTo(paymentActiveVO.getMemberFavorableAmount())>0){
paymentActiveVO.setMemberFavorableAmount(bigDecimal);
}else {
paymentActiveVO.setCardFavorableAmount(bigDecimal);
}
}
}
if (ObjectUtils.isEmpty(paymentActiveVO.getCardFavorableAmount()) && ObjectUtils.isNotEmpty(paymentActiveVO.getActiveFavorableAmount())&& ObjectUtils.isNotEmpty(paymentActiveVO.getMemberFavorableAmount())){
if (paymentActiveVO.getActiveFavorableAmount().add(paymentActiveVO.getMemberFavorableAmount()).compareTo(paymentActiveDTO.getAmount())>0){
if (paymentActiveVO.getActiveFavorableAmount().compareTo(paymentActiveVO.getMemberFavorableAmount())>0){
paymentActiveVO.setMemberFavorableAmount(bigDecimal);
}else {
paymentActiveVO.setActiveFavorableAmount(bigDecimal);
}
}
}
if (ObjectUtils.isEmpty(paymentActiveVO.getMemberFavorableAmount()) && ObjectUtils.isNotEmpty(paymentActiveVO.getCardFavorableAmount())&& ObjectUtils.isNotEmpty(paymentActiveVO.getActiveFavorableAmount())){
if (paymentActiveVO.getCardFavorableAmount().add(paymentActiveVO.getActiveFavorableAmount()).compareTo(paymentActiveDTO.getAmount())>0){
if (paymentActiveVO.getCardFavorableAmount().compareTo(paymentActiveVO.getActiveFavorableAmount())>0){
paymentActiveVO.setActiveFavorableAmount(bigDecimal);
}else {
paymentActiveVO.setCardFavorableAmount(bigDecimal);
}
}
}
}
return paymentActiveVO;
}

View File

@ -86,7 +86,7 @@ public class ActiveNewlywedsRecordsController extends BaseController {
* @return 新增结果
*/
@PostMapping
public ResponseObject insert(@RequestBody ActiveNewlywedsRecords activeNewlywedsRecords) {
public ResponseObject insert(@RequestBody ActiveNewlywedsRecords activeNewlywedsRecords) throws Exception {
return getSuccessResult(this.activeNewlywedsRecordsService.add(activeNewlywedsRecords));
}

View File

@ -16,6 +16,6 @@ public interface ActiveNewlywedsRecordsService extends IService<ActiveNewlywedsR
* @param activeNewlywedsRecords
* @return
*/
boolean add(ActiveNewlywedsRecords activeNewlywedsRecords);
boolean add(ActiveNewlywedsRecords activeNewlywedsRecords) throws Exception;
}

View File

@ -55,12 +55,15 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl<ActiveNewlywe
*/
@Override
@Transactional
public boolean add(ActiveNewlywedsRecords activeNewlywedsRecords) {
public boolean add(ActiveNewlywedsRecords activeNewlywedsRecords) throws Exception {
boolean save = false;
//用户信息
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = nowAccountInfo.getId();
LJUserVo ljUserVo = userService.selectUserById(userId,activeNewlywedsRecords.getStoreId());
/*if (ObjectUtils.isEmpty(ljUserVo)){
userBalanceService.initBalance(userId,activeNewlywedsRecords.getChainStoreId());
}*/
//保存新人有礼记录
ActiveNewlywedsVO activeNewlyweds = activeNewlywedsService.getOneByStoreId(activeNewlywedsRecords.getStoreId());
activeNewlywedsRecords.setActiveNewlywedsId(activeNewlyweds.getId());

View File

@ -114,10 +114,14 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
if (CollectionUtils.isNotEmpty(list)){
for (CardFavorableRecord cardFavorableRecord : list) {
for (CardFavorable record : records) {
if(!cardFavorableRecord.getCardFavorableId().equals(record.getId())){
if(record.getClaimRule().equals("0") && !cardFavorableRecord.getCardFavorableId().equals(record.getId())){
CardFavorable one = getById(record.getId());
cardFavorableArrayList.add(one);
}
if (record.getClaimRule().equals("1")){
//查询当天有没有领取这张券
}
}
}
}

View File

@ -10,7 +10,7 @@
:autoplay="autoplay" :interval="interval" :duration="duration">
<swiper-item v-for="(item,index) in list1" :key="index" @click="goPage(item.routeUrl)">
<view class="swiper-item uni-bg-red">
<image style="width: 100%;" :src="item.bannerUrl"></image>
</view>
<!-- <image style="width: 100%;" :src="getBannerUrl(item.bannerUrl)"></image> -->
@ -86,9 +86,9 @@
<view class="station-title" style="display: flex;justify-content: space-between;">
{{store.name}}{{store.description ? "("+store.description+")" : ""}}
<!-- <view class="" @click="goChooseAddress" style="width: 22%;font-size: 14px;font-weight: 400;">
<view class="" @click="goChooseAddress" style="width: 22%;font-size: 14px;font-weight: 400;">
<view>切换位置 <uni-icons type="right" color="#304fff" size="16"></uni-icons> </view>
</view> -->
</view>
</view><!--顺通石化加油站(工业南路站)-->
<view style="display: flex;">
<view class="bule-icon" v-if="welfare.length!=0" v-for="(item,index) in welfare" :key="index">
@ -136,10 +136,13 @@
import tabbar from "../../components/tabbar/tabbar.vue"
import config from '@/config'
import request from '../../utils/request'
import { callWithErrorHandling } from "vue"
import {
callWithErrorHandling
} from "vue"
export default {
data() {
return {
chainStoreId: '',
indicatorDots: true,
autoplay: true,
interval: 2000,
@ -215,6 +218,7 @@ import { callWithErrorHandling } from "vue"
uni.setStorageSync("storeId", storeId)
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("storeId")
this.chainStoreId = uni.getStorageSync("chainStoreId")
this.staffId = uni.getStorageSync("inviteStaffId")
uni.showLoading({
title: uni.getStorageSync("storeId") + "++" + uni.getStorageSync("inviteStaffId") + q
@ -242,11 +246,11 @@ import { callWithErrorHandling } from "vue"
},
methods: {
//
getBannerUrl(url){
getBannerUrl(url) {
let imgurl = ""
if (url.includes("http")){
if (url.includes("http")) {
imgurl = url
}else {
} else {
imgurl = this.baseUrl + url
}
return imgurl;
@ -266,10 +270,10 @@ import { callWithErrorHandling } from "vue"
method: 'get',
}).then(res => {
_this.list1 = res.data
for (let i = 0;i<res.data.length;i++){
if (res.data[i].bannerUrl.includes("http")){
for (let i = 0; i < res.data.length; i++) {
if (res.data[i].bannerUrl.includes("http")) {
_this.list1[i].bannerUrl = res.data[i].bannerUrl
}else{
} else {
_this.list1[i].bannerUrl = _this.baseUrl + res.data[i].bannerUrl
}
}
@ -302,7 +306,8 @@ import { callWithErrorHandling } from "vue"
url: 'business/marketingActivity/activeNewlywedsRecords',
method: 'post',
data: {
storeId: this.storeId
storeId: this.storeId,
chainStoreId: this.chainStoreId,
}
}).then(res => {
console.log("11111" + res)
@ -862,4 +867,4 @@ import { callWithErrorHandling } from "vue"
color: white;
margin: 0 auto;
}
</style>
</style>

View File

@ -56,6 +56,7 @@
export default {
data() {
return {
appltType: "",
title: '',
tindex: 0,
status: 'loading',
@ -68,7 +69,8 @@
storeId: '',
recordName: '',
pageNo: 1,
pageSize: 10
pageSize: 10,
appltType: '',
},
tapList: [{
text: "全部"
@ -88,6 +90,9 @@
components: {
},
onLoad() {
this.appltType = uni.getstorageSync("appltType");
},
onShow() {
this.getAllOrderList();