Commit e58da9e4 by 吕明尚

修改次卡,月卡计算

parent e8c49f10
package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
......@@ -25,6 +23,7 @@ public class MonthlyCardConf extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
......
package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
......@@ -27,6 +25,7 @@ public class MonthlyCardLog extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
......
package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
......@@ -23,6 +21,7 @@ public class SecondaryCardConf extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
......
package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
......@@ -26,6 +24,7 @@ public class SecondaryCardLog extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
......
......@@ -130,7 +130,7 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
if (ObjectUtil.isNotEmpty(consumerMember)) {
SRoom room = roomService.getById(monthlyCardRequest.getRoomId());
consumerMonthlyCard = baseMapper.selectOne(new LambdaQueryWrapper<ConsumerMonthlyCard>().eq(ConsumerMonthlyCard::getConsumerId, user.getId()));
consumerMonthlyCard = baseMapper.selectOne(new LambdaQueryWrapper<ConsumerMonthlyCard>().eq(ConsumerMonthlyCard::getConsumerId, user.getId()).gt(ConsumerMonthlyCard::getFreeDuration, 0));
consumerSecondaryCard = consumerSecondaryCardService.list(new LambdaQueryWrapper<ConsumerSecondaryCard>().eq(ConsumerSecondaryCard::getConsumerId, user.getId()).orderByAsc(ConsumerSecondaryCard::getNumber));
if (!ObjectUtils.isEmpty(monthlyCardRequest.getRoomLabelId())) {
RoomLabel roomLabel = roomLabelService.selectRoomLabelById(monthlyCardRequest.getRoomLabelId());
......@@ -165,6 +165,10 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
}
});
}
if (ObjectUtil.isNotEmpty(consumerMonthlyCard) && consumerMonthlyCard.getFreeDuration().compareTo(new BigDecimal(byId.getDuration())) == 0) {
consumerMonthlyCardList.add(consumerMonthlyCard.getId());
map.put("consumerMonthlyCard", consumerMonthlyCardList);
}
return map;
//标签绑定了套餐,套餐没开启,小时
} else {
......@@ -188,6 +192,10 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
}
});
}
if (ObjectUtil.isNotEmpty(consumerMonthlyCard) && consumerMonthlyCard.getFreeDuration().compareTo(new BigDecimal(pack.getDuration())) == 0) {
consumerMonthlyCardList.add(consumerMonthlyCard.getId());
map.put("consumerMonthlyCard", consumerMonthlyCardList);
}
}
}
return new HashMap<>();
......
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