Merge branch 'master' of https://gitee.com/nny_1/oilSystem
This commit is contained in:
commit
289b04f406
@ -109,7 +109,7 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
|
||||
*/
|
||||
@Override
|
||||
public IPage<CardExchangeRecordVO> selectCancelRecords(Page page, CardExchangeRecordDTO cardExchangeRecordDTO) {
|
||||
cardExchangeRecordDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
||||
/*cardExchangeRecordDTO.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());*/
|
||||
cardExchangeRecordDTO.setMtUserId(TokenUtil.getNowAccountInfo().getId());
|
||||
return cardExchangeRecordMapper.selectCancelRecords(page,cardExchangeRecordDTO);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ public class CardFavorableRecordController extends BaseController {
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping("drawDown")
|
||||
public ResponseObject drawDown(@RequestBody IdListDTO idList) {
|
||||
public ResponseObject drawDown(@RequestBody IdListDTO idList) throws Exception {
|
||||
return getSuccessResult(this.cardFavorableRecordService.drawDown(idList));
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ public interface CardFavorableRecordService extends IService<CardFavorableRecord
|
||||
* @param idList
|
||||
* @return
|
||||
*/
|
||||
boolean drawDown(IdListDTO idList);
|
||||
boolean drawDown(IdListDTO idList) throws Exception;
|
||||
|
||||
/**
|
||||
* 小程序端判断是否领取优惠券
|
||||
|
@ -100,7 +100,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean drawDown(IdListDTO idList) {
|
||||
public boolean drawDown(IdListDTO idList) throws Exception {
|
||||
boolean save = false;
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer userId = nowAccountInfo.getId();
|
||||
@ -109,6 +109,11 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
|
||||
//优惠券
|
||||
for (Integer id : idList.getIdList()) {
|
||||
CardFavorable cardFavorable = cardFavorableService.getById(id);
|
||||
//优惠券的数量
|
||||
Integer count = cardFavorable.getCount();
|
||||
if (count < 1){
|
||||
throw new Exception("优惠券已领完");
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(cardFavorable) && ObjectUtils.isNotEmpty(cardFavorable.getTimeType())){
|
||||
if (cardFavorable.getTimeType().equals("0")){
|
||||
cardFavorableRecord.setStartTime(new Date());
|
||||
@ -133,6 +138,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
|
||||
cardFavorableRecord.setExchangeFrom("店铺发券");
|
||||
cardFavorableRecord.setStatus("0");
|
||||
save = save(cardFavorableRecord);
|
||||
cardFavorable.setCount(count-1);
|
||||
}
|
||||
}
|
||||
return save;
|
||||
|
@ -58,8 +58,10 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
storeId: '',
|
||||
cardsList: [],
|
||||
query: {
|
||||
storeId: '',
|
||||
cardType: '兑换券',
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
@ -86,6 +88,7 @@
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.query.storeId = uni.getStorageSync("storeId");
|
||||
this.getGiftRecords()
|
||||
},
|
||||
methods: {
|
||||
|
Loading…
Reference in New Issue
Block a user