Commit e729b789 authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/dev' into jrz_dev

parents 3acd0fc7 3e80895d
......@@ -91,6 +91,26 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
log.error(userId+"----已领优惠卷");
return null;
}
falg=checkLed(userId,couponId,coupon.getLimitCollar(),coupon.getQuota());
if(falg){
log.error(userId+"----已超过领取限制");
return null;
}
return led(coupon,userId);
}
//后台领劵(一个劵可以发多张)
public String adminUserLedCoupon(Integer userId,Integer couponId){
Coupon coupon=couponBiz.selectById(couponId);
if (coupon==null||coupon.getIsDel()!=0||coupon.getStatus()!=1){
log.error(userId+"----无可领取优惠卷");
return null;
}
boolean falg=checkLed(userId,couponId,coupon.getLimitCollar(),coupon.getQuota());
if(falg){
log.error(userId+"----已超过领取限制");
return null;
}
return led(coupon,userId);
}
......@@ -123,7 +143,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
//检查用户是否领卷
public boolean checkUserLed(Integer userId,Integer id){
Example example=new Example(UserCoupon.class);
example.createCriteria().andEqualTo("userId",userId).andEqualTo("couponId",id);
example.createCriteria().andEqualTo("userId",userId).andEqualTo("couponId",id).andEqualTo("isDel",0);
List<UserCoupon> list=selectByExample(example);
if(list.size()>0){
log.error(userId+"----已领优惠卷");
......@@ -132,6 +152,31 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
return false;
}
//检查用户是否可领卷
public boolean checkLed(Integer userId,Integer id,Integer limitCollar,Integer quota){
Example example=new Example(UserCoupon.class);
example.createCriteria().andEqualTo("userId",userId).andEqualTo("couponId",id).andEqualTo("isDel",0);
Integer num=selectCountByExample(example);
log.info("-用户已领劵--userId==="+userId+"----num==="+num+"----couponid==="+id);
if(num==null||num==0){
log.error(userId+"----无领此优惠卷----couponid==="+id);
return false;
}
if (limitCollar==null||num>=limitCollar){
log.error(userId+"----此优惠卷超过每人限领次数----couponid==="+id+"----limitCollar==="+limitCollar);
return true;
}
example.clear();
example.createCriteria().andEqualTo("couponId",id).andEqualTo("isDel",0);
num=selectCountByExample(example);
log.info("---发劵数量----num==="+num+"----limitCollar==="+limitCollar+"----quota==="+quota+"----couponid==="+id);
if (quota==null||quota==0||(num!=null&&num>0&&num>=quota)){
log.error(userId+"----此优惠卷超过发券数量----couponid==="+id+"----quota==="+quota);
return true;
}
return false;
}
//获取我的优惠卷
public ObjectRestResponse getCouponList(Integer userId,int type,Integer channel,BigDecimal amout){
if (userId==null||userId==0){
......@@ -206,7 +251,6 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
result.put("array",array);
return ObjectRestResponse.succ(result);
}
//获取我的优惠卷
public ObjectRestResponse getUserCouponList(Integer userId,int type,Integer channel,BigDecimal amout) {
if (userId == null || userId == 0) {
......@@ -386,7 +430,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
userCoupon.setExpireTime(couponVo.getValidEndTime());
userCoupon.setTickerNo(Snowflake.build()+"");
userCoupons.add(userCoupon);*/
userLedCoupon(appUserLogin.getId(),userCouponSendDTO.getCouponId());
adminUserLedCoupon(appUserLogin.getId(),userCouponSendDTO.getCouponId());
}
return 1;
}
......@@ -427,6 +471,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
UserCoupon userCoupon=new UserCoupon();
userCoupon.setUserId(userId);
userCoupon.setIsUse(0);
userCoupon.setIsDel(0);
Long couponNumber=selectCount(userCoupon);
userInfoDTO.setCouponNumber(couponNumber);
return userInfoDTO;
......
......@@ -162,6 +162,9 @@ public class OrderCancelBiz {
}
//退款流程
orderRefundBiz.rentRefundProcess(hasUpdateOrder, timeLag, APP_ORDER+ "_"+ key);
//站点总人数减少
tourFeign.updateTourGoodPersonNum(otd.getVerificationId(), TourFeign.TOTAL_PERSON, (otd.getTotalNumber() * -1));
}
}
......
......@@ -51,7 +51,7 @@ public class VehicleJobHandler extends IJobHandler {
int betweenMonth = Integer.valueOf(dictionary.getDetail()).intValue();
int month = nowMonth + betweenMonth> 12 ? (betweenMonth + nowMonth) - 12 : nowMonth + betweenMonth;
year = month > nowMonth ? year : year + 1;
String yearAndMonth = String.format("%d-%s", year, month>10?month:"0"+month);
String yearAndMonth = String.format("%d-%s", year, month>=10?month:"0"+month);
XxlJobLogger.log("----查询到的车型ids:【{}】",existVehicleIds);
if (CollectionUtils.isNotEmpty(existVehicleIds)) {
List<VehicleBookInfo> bookInfos = existVehicleIds.stream().map(vehicleId -> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment