bug修改

This commit is contained in:
zhaohengkun 2024-10-22 13:35:39 +08:00
parent 4e676c7e8b
commit ae9ee648c6
7 changed files with 78 additions and 51 deletions

View File

@ -364,8 +364,10 @@
<el-radio :label="'1'">不可用时间段</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="ruleForm.availableOrUn == '0'" label="适用时间段" prop="availableType" required>
<div style="width: 100px;margin-top: 10px">
<div v-if="ruleForm.availableOrUn == '0'" style="margin-right: 220px">
<el-form-item label="适用时间段" prop="availableType" required>
<el-radio-group v-model="ruleForm.availableType">
<div style="display: flex; width: 500px;margin-bottom: 15px;">
<el-radio :label="'1'">每周</el-radio>
@ -387,8 +389,8 @@
</el-select>
</el-radio>
</el-radio-group>
</div>
<div style="margin-top: 20px">
</el-form-item>
<el-form-item label="时间段" label-width="70px" prop="availablePeriodStart" required>
<el-time-picker
v-model="ruleForm.availablePeriodStart"
@ -405,19 +407,22 @@
</el-time-picker>
</el-form-item>
</div>
</el-form-item>
<el-form-item v-else label="不适用时间段" prop="unAvailableType" required>
<div>
<div v-if="ruleForm.availableOrUn == '1'" style="margin-right: 220px">
<el-form-item label="不适用时间段" prop="unAvailableType" required>
<el-radio-group v-model="ruleForm.unAvailableType">
<el-radio :label="'1'">每周
<div style="display: flex; width: 500px;margin-bottom: 15px;">
<el-radio :label="'1'">每周</el-radio>
<el-checkbox-group v-model="weekDay1" style="margin-left: 20px"
:disabled="ruleForm.unAvailableType!='1'">
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
</el-checkbox-group>
</el-radio>
</div>
<el-radio :label="'2'">每月
<el-select :disabled="ruleForm.unAvailableType!='2'" v-model="monthDay1" placeholder="请选择每月固定日期"
multiple style="margin-left: 20px">
<el-select :disabled="ruleForm.unAvailableType!='2'" v-model="monthDay1" placeholder="请选择每月固定日期" multiple
style="margin-left: 20px">
<el-option
v-for="item in 31"
:key="item+''"
@ -427,9 +432,9 @@
</el-select>
</el-radio>
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-form-item label="时间段" prop="unAvailablePeriodStart" label-width="70px" required>
</el-form-item>
<el-form-item label="时间段" label-width="70px" prop="unAvailablePeriodStart" required>
<el-time-picker
v-model="ruleForm.unAvailablePeriodStart"
format="HH:mm"
@ -445,7 +450,7 @@
</el-time-picker>
</el-form-item>
</div>
</el-form-item>
</div>
<div class="d-s" style="justify-content: space-between">
<el-form-item label="每人领券限制" required style="width: 45%;" prop="getNumLimit">

View File

@ -66,7 +66,7 @@ public class CardCouponUserController extends BaseController {
@PostMapping
public ResponseObject insert(@RequestBody CardCouponUser cardCouponUser) {
return getSuccessResult(this.cardCouponUserService.save(cardCouponUser));
return getSuccessResult(this.cardCouponUserService.insert(cardCouponUser));
}
/**

View File

@ -56,6 +56,8 @@ public class CardCouponUser extends Model<CardCouponUser> {
private String updateBy;
//更新时间
private Date updateTime;
//核销码
private String verificationCode;
}

View File

@ -31,6 +31,8 @@ public interface CardCouponUserService extends IService<CardCouponUser> {
*/
boolean userCanGet(Integer couponId,Integer userId);
Boolean insert(CardCouponUser cardCouponUser);
/**
* 查会员在某店铺当前时间可用的所有优惠券
* @author vinjor-M

View File

@ -15,6 +15,7 @@ import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponMapper;
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper;
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponService;
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponUserService;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo;
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO;
import com.fuint.business.petrolStationManagement.entity.OilName;
@ -29,6 +30,7 @@ import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -50,6 +52,9 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
@Autowired
private CardCouponUserMapper cardCouponUserMapper;
@Autowired
@Lazy
private CardCouponUserService cardCouponUserService;
@Autowired
private LJUserService userService;
@Autowired
private UserBalanceMapper userBalanceMapper;
@ -191,7 +196,7 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
cardCouponUser.setStartTime(cardCoupon.getEffectiveDateStart());
cardCouponUser.setEndTime(cardCoupon.getEffectiveDateEnd());
}
cardCouponUserMapper.insert(cardCouponUser);
cardCouponUserService.insert(cardCouponUser);
return new ResponseObject(200, "领取成功", null);
}
@ -256,7 +261,7 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
cardCouponUser.setEndTime(effectiveDateEnd);
cardCouponUser.setCreateTime(new Date());
cardCouponUser.setCreateBy(TokenUtil.getNowAccountInfo().getId().toString());
cardCouponUserMapper.insert(cardCouponUser);
cardCouponUserService.insert(cardCouponUser);
//更新优惠券表
if (cardCoupon.getTfGetNum() == null) cardCoupon.setTfGetNum(0);

View File

@ -73,6 +73,15 @@ public class CardCouponUserServiceImpl extends ServiceImpl<CardCouponUserMapper,
return count < cardCoupon.getDayGetLimit();
}
@Override
public Boolean insert(CardCouponUser cardCouponUser) {
// 生成核销码 获取 年月日时分秒 + 随机三位数 基本可以保证不重复
String verificationCode = DateUtil.format(new Date(), "yyyyMMddHHmmss") + String.valueOf((int) ((Math.random() * 9 + 1) * 100));
cardCouponUser.setVerificationCode(verificationCode);
boolean save = super.save(cardCouponUser);
return save;
}
/**
* 查会员在某店铺当前时间可用的所有优惠券
*

View File

@ -922,8 +922,12 @@ export default {
this.sendCoupon.mtUserId = this.chooseVipUser.id
this.sendCoupon.fromType = "4"
this.sendCoupon.cardCouponId = this.sendCoupon.id
// 使
//
this.sendCoupon.status = null
this.sendCoupon.createTime = null
this.sendCoupon.updateTime = null
this.sendCoupon.updateBy = null
this.sendCoupon.createBy = null
sendCouponFun(this.sendCoupon).then(
res => {
if (res.code == 200){