bug修改
This commit is contained in:
parent
4e676c7e8b
commit
ae9ee648c6
@ -364,8 +364,10 @@
|
|||||||
<el-radio :label="'1'">不可用时间段</el-radio>
|
<el-radio :label="'1'">不可用时间段</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</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">
|
<el-radio-group v-model="ruleForm.availableType">
|
||||||
<div style="display: flex; width: 500px;margin-bottom: 15px;">
|
<div style="display: flex; width: 500px;margin-bottom: 15px;">
|
||||||
<el-radio :label="'1'">每周</el-radio>
|
<el-radio :label="'1'">每周</el-radio>
|
||||||
@ -387,8 +389,8 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
|
||||||
<div style="margin-top: 20px">
|
</el-form-item>
|
||||||
<el-form-item label="时间段" label-width="70px" prop="availablePeriodStart" required>
|
<el-form-item label="时间段" label-width="70px" prop="availablePeriodStart" required>
|
||||||
<el-time-picker
|
<el-time-picker
|
||||||
v-model="ruleForm.availablePeriodStart"
|
v-model="ruleForm.availablePeriodStart"
|
||||||
@ -405,19 +407,22 @@
|
|||||||
</el-time-picker>
|
</el-time-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-else label="不适用时间段" prop="unAvailableType" required>
|
<div v-if="ruleForm.availableOrUn == '1'" style="margin-right: 220px">
|
||||||
<div>
|
<el-form-item label="不适用时间段" prop="unAvailableType" required>
|
||||||
|
|
||||||
<el-radio-group v-model="ruleForm.unAvailableType">
|
<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"
|
<el-checkbox-group v-model="weekDay1" style="margin-left: 20px"
|
||||||
:disabled="ruleForm.unAvailableType!='1'">
|
:disabled="ruleForm.unAvailableType!='1'">
|
||||||
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
|
<el-checkbox v-for="(item,index) in weekList" :key="index" :label="item"></el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-radio>
|
</div>
|
||||||
|
|
||||||
<el-radio :label="'2'">每月
|
<el-radio :label="'2'">每月
|
||||||
<el-select :disabled="ruleForm.unAvailableType!='2'" v-model="monthDay1" placeholder="请选择每月固定日期"
|
<el-select :disabled="ruleForm.unAvailableType!='2'" v-model="monthDay1" placeholder="请选择每月固定日期" multiple
|
||||||
multiple style="margin-left: 20px">
|
style="margin-left: 20px">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in 31"
|
v-for="item in 31"
|
||||||
:key="item+''"
|
:key="item+''"
|
||||||
@ -427,9 +432,9 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
|
||||||
<div style="margin-top: 20px">
|
</el-form-item>
|
||||||
<el-form-item label="时间段" prop="unAvailablePeriodStart" label-width="70px" required>
|
<el-form-item label="时间段" label-width="70px" prop="unAvailablePeriodStart" required>
|
||||||
<el-time-picker
|
<el-time-picker
|
||||||
v-model="ruleForm.unAvailablePeriodStart"
|
v-model="ruleForm.unAvailablePeriodStart"
|
||||||
format="HH:mm"
|
format="HH:mm"
|
||||||
@ -445,7 +450,7 @@
|
|||||||
</el-time-picker>
|
</el-time-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="d-s" style="justify-content: space-between">
|
<div class="d-s" style="justify-content: space-between">
|
||||||
<el-form-item label="每人领券限制" required style="width: 45%;" prop="getNumLimit">
|
<el-form-item label="每人领券限制" required style="width: 45%;" prop="getNumLimit">
|
||||||
|
@ -66,7 +66,7 @@ public class CardCouponUserController extends BaseController {
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
public ResponseObject insert(@RequestBody CardCouponUser cardCouponUser) {
|
public ResponseObject insert(@RequestBody CardCouponUser cardCouponUser) {
|
||||||
|
|
||||||
return getSuccessResult(this.cardCouponUserService.save(cardCouponUser));
|
return getSuccessResult(this.cardCouponUserService.insert(cardCouponUser));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,6 +56,8 @@ public class CardCouponUser extends Model<CardCouponUser> {
|
|||||||
private String updateBy;
|
private String updateBy;
|
||||||
//更新时间
|
//更新时间
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
//核销码
|
||||||
|
private String verificationCode;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,8 @@ public interface CardCouponUserService extends IService<CardCouponUser> {
|
|||||||
*/
|
*/
|
||||||
boolean userCanGet(Integer couponId,Integer userId);
|
boolean userCanGet(Integer couponId,Integer userId);
|
||||||
|
|
||||||
|
Boolean insert(CardCouponUser cardCouponUser);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查会员在某店铺当前时间可用的所有优惠券
|
* 查会员在某店铺当前时间可用的所有优惠券
|
||||||
* @author vinjor-M
|
* @author vinjor-M
|
||||||
|
@ -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.CardCouponMapper;
|
||||||
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper;
|
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper;
|
||||||
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponService;
|
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.CardCouponUniVo;
|
||||||
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO;
|
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO;
|
||||||
import com.fuint.business.petrolStationManagement.entity.OilName;
|
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.common.util.TokenUtil;
|
||||||
import com.fuint.framework.web.ResponseObject;
|
import com.fuint.framework.web.ResponseObject;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -50,6 +52,9 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CardCouponUserMapper cardCouponUserMapper;
|
private CardCouponUserMapper cardCouponUserMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
private CardCouponUserService cardCouponUserService;
|
||||||
|
@Autowired
|
||||||
private LJUserService userService;
|
private LJUserService userService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserBalanceMapper userBalanceMapper;
|
private UserBalanceMapper userBalanceMapper;
|
||||||
@ -191,7 +196,7 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
|
|||||||
cardCouponUser.setStartTime(cardCoupon.getEffectiveDateStart());
|
cardCouponUser.setStartTime(cardCoupon.getEffectiveDateStart());
|
||||||
cardCouponUser.setEndTime(cardCoupon.getEffectiveDateEnd());
|
cardCouponUser.setEndTime(cardCoupon.getEffectiveDateEnd());
|
||||||
}
|
}
|
||||||
cardCouponUserMapper.insert(cardCouponUser);
|
cardCouponUserService.insert(cardCouponUser);
|
||||||
return new ResponseObject(200, "领取成功", null);
|
return new ResponseObject(200, "领取成功", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,7 +261,7 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
|
|||||||
cardCouponUser.setEndTime(effectiveDateEnd);
|
cardCouponUser.setEndTime(effectiveDateEnd);
|
||||||
cardCouponUser.setCreateTime(new Date());
|
cardCouponUser.setCreateTime(new Date());
|
||||||
cardCouponUser.setCreateBy(TokenUtil.getNowAccountInfo().getId().toString());
|
cardCouponUser.setCreateBy(TokenUtil.getNowAccountInfo().getId().toString());
|
||||||
cardCouponUserMapper.insert(cardCouponUser);
|
cardCouponUserService.insert(cardCouponUser);
|
||||||
|
|
||||||
//更新优惠券表
|
//更新优惠券表
|
||||||
if (cardCoupon.getTfGetNum() == null) cardCoupon.setTfGetNum(0);
|
if (cardCoupon.getTfGetNum() == null) cardCoupon.setTfGetNum(0);
|
||||||
|
@ -73,6 +73,15 @@ public class CardCouponUserServiceImpl extends ServiceImpl<CardCouponUserMapper,
|
|||||||
return count < cardCoupon.getDayGetLimit();
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查会员在某店铺当前时间可用的所有优惠券
|
* 查会员在某店铺当前时间可用的所有优惠券
|
||||||
*
|
*
|
||||||
|
@ -922,8 +922,12 @@ export default {
|
|||||||
this.sendCoupon.mtUserId = this.chooseVipUser.id
|
this.sendCoupon.mtUserId = this.chooseVipUser.id
|
||||||
this.sendCoupon.fromType = "4"
|
this.sendCoupon.fromType = "4"
|
||||||
this.sendCoupon.cardCouponId = this.sendCoupon.id
|
this.sendCoupon.cardCouponId = this.sendCoupon.id
|
||||||
//优惠卷 初始化状态应该是未使用
|
//清除 一些 重复字段
|
||||||
this.sendCoupon.status = null
|
this.sendCoupon.status = null
|
||||||
|
this.sendCoupon.createTime = null
|
||||||
|
this.sendCoupon.updateTime = null
|
||||||
|
this.sendCoupon.updateBy = null
|
||||||
|
this.sendCoupon.createBy = null
|
||||||
sendCouponFun(this.sendCoupon).then(
|
sendCouponFun(this.sendCoupon).then(
|
||||||
res => {
|
res => {
|
||||||
if (res.code == 200){
|
if (res.code == 200){
|
||||||
|
Loading…
Reference in New Issue
Block a user