Commit 5f97e321 by 吕明尚

修改计算订单价格

parent e396b965
......@@ -10,7 +10,17 @@ public enum PayTypeEnum {
WECHAT(1,"wechat","微信支付"),
ALIPAY(2,"alipay","支付宝"),
SAOBEI(3,"saobei","扫呗");
SAOBEI(3, "saobei", "扫呗"),
//时长
DURATION(4, "duration", "时长"),
//积分
INTEGRAL(5, "integral", "积分"),
//余额
BALANCE(6, "balance", "余额"),
//余额+微信支付
BALANCE_WECHAT(7, "balance_wechat", "余额+微信支付"),
//时长+微信支付
DURATION_WECHAT(8, "duration_wechat", "时长+微信支付");
private Integer code;
private String value;
......
......@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/activity")
@RequestMapping("/activity")
public class ActivityController extends BaseController {
@Autowired
private ActivityService activityService;
......
......@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/balanceLog")
@RequestMapping("/balanceLog")
public class BalanceLogController extends BaseController {
@Autowired
private BalanceLogService balanceLogService;
......
......@@ -22,7 +22,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/member")
@RequestMapping("/member")
public class ConsumerMemberController extends BaseController {
@Autowired
private ConsumerMemberService consumerMemberService;
......
......@@ -22,7 +22,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/wallet")
@RequestMapping("/wallet")
public class ConsumerWalletController extends BaseController {
@Autowired
private ConsumerWalletService consumerWalletService;
......@@ -37,6 +37,11 @@ public class ConsumerWalletController extends BaseController {
return getDataTable(list);
}
@GetMapping("/query")
public ConsumerWalletVo selectByConsumerId() {
return consumerWalletService.selectByConsumerId();
}
/**
* 导出会员钱包列表
*/
......
......@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/equityMembersOrderConfig")
@RequestMapping("/equityMembersOrderConfig")
public class EquityMembersOrderConfigController extends BaseController {
@Autowired
private EquityMembersOrderConfigService equityMembersOrderConfigService;
......
......@@ -22,7 +22,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/equityMembersOrder")
@RequestMapping("/equityMembersOrder")
public class EquityMembersOrderController extends BaseController {
@Autowired
private EquityMembersOrderService equityMembersOrderService;
......
......@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/integralLog")
@RequestMapping("/integralLog")
public class IntegralLogController extends BaseController {
@Autowired
private IntegralLogService integralLogService;
......
......@@ -22,7 +22,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/memberConfig")
@RequestMapping("/memberConfig")
public class MemberConfigController extends BaseController {
@Autowired
private MemberConfigService memberConfigService;
......
......@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/rechargeConf")
@RequestMapping("/rechargeConf")
public class RechargeConfController extends BaseController {
@Autowired
private RechargeConfService rechargeConfService;
......
......@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/recharge")
@RequestMapping("/recharge")
public class RechargeController extends BaseController {
@Autowired
private RechargeService rechargeService;
......
......@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/rechargeCouponConf")
@RequestMapping("/rechargeCouponConf")
public class RechargeCouponConfController extends BaseController {
@Autowired
private RechargeCouponConfService rechargeCouponConfService;
......
......@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24
*/
@RestController
@RequestMapping("/system/rechargeRefund")
@RequestMapping("/rechargeRefund")
public class RechargeRefundController extends BaseController {
@Autowired
private RechargeRefundService rechargeRefundService;
......
......@@ -60,4 +60,6 @@ public interface ConsumerWalletMapper extends BaseMapper<ConsumerWallet> {
* @return 结果
*/
public int deleteConsumerWalletByIds(Long[] ids);
ConsumerWalletVo selectByConsumerId(ConsumerWalletVo consumerWallet);
}
......@@ -60,4 +60,6 @@ public interface ConsumerWalletService extends IService<ConsumerWallet> {
* @return 结果
*/
public int deleteConsumerWalletById(Long id);
ConsumerWalletVo selectByConsumerId();
}
......@@ -5,9 +5,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.utils.DateUtils;
import share.system.domain.ConsumerWallet;
import share.system.domain.SConsumer;
import share.system.domain.vo.ConsumerWalletVo;
import share.system.mapper.ConsumerWalletMapper;
import share.system.service.ConsumerWalletService;
import share.system.service.SConsumerService;
import java.util.List;
......@@ -22,6 +24,9 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
@Autowired
private ConsumerWalletMapper consumerWalletMapper;
@Autowired
private SConsumerService sConsumerService;
/**
* 查询会员钱包
*
......@@ -89,4 +94,12 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
public int deleteConsumerWalletById(Long id) {
return consumerWalletMapper.deleteConsumerWalletById(id);
}
@Override
public ConsumerWalletVo selectByConsumerId() {
SConsumer info = sConsumerService.getInfo();
ConsumerWalletVo consumerWallet = new ConsumerWalletVo();
consumerWallet.setConsumerId(info.getId());
return consumerWalletMapper.selectByConsumerId(consumerWallet);
}
}
......@@ -1854,7 +1854,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
// 计算各种价格
ComputedOrderPriceResponse priceResponse = new ComputedOrderPriceResponse();
Activity activity;
ConsumerMember consumerMember = new ConsumerMember();
ConsumerMember consumerMember = null;
LambdaQueryWrapper<Activity> queryWrapper = new LambdaQueryWrapper<>();
if (ObjectUtil.isNotEmpty(user)) {
consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, user.getId()));
......@@ -1946,15 +1946,17 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
private BigDecimal getBigDecimal(OrderComputedPriceRequest request, Activity activity, BigDecimal payPrice, SConsumer user) {
if (ObjectUtil.isNotEmpty(activity)) {
if (ObjectUtil.isNotEmpty(activity) && ObjectUtil.isNotEmpty(user)) {
CronParser cronParser = new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ));
Cron cron = cronParser.parse(activity.getCronExpression());
ExecutionTime executionTime = ExecutionTime.forCron(cron);
LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SOrder::getConsumerId, user.getId());
queryWrapper.in(SOrder::getStatus, OrderStatusEnum.getUnfinishOrderStatus());
queryWrapper.in(SOrder::getStatus, OrderStatusEnum.getValidOrderStatus());
queryWrapper.eq(SOrder::getPayStatus, YesNoEnum.yes.getIndex());
queryWrapper.ne(SOrder::getPayPrice, new BigDecimal(0));
//预约结束时间大于等于今天的年月日
queryWrapper.ge(SOrder::getPreEndDate, DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, new Date())));
queryWrapper.isNull(SOrder::getCouponId);
List<SOrder> orderList = list(queryWrapper);
if (CollectionUtils.isEmpty(orderList)) {
......
......@@ -69,6 +69,34 @@
<include refid="selectConsumerWalletVo"/>
where id = #{id}
</select>
<select id="selectByConsumerId" resultType="share.system.domain.vo.ConsumerWalletVo">
select w.id,
w.consumer_id,
c.nick_name,
c.phone,
c.avatar,
w.balance,
w.remaining_duration,
w.remaining_integral,
w.is_delete,
w.create_by,
w.create_time,
w.update_by,
w.update_time,
w.remark
from s_consumer_wallet w join s_consumer c on w.consumer_id = c.id
<where>
<if test="nickName != null and nickName != ''">and c.nick_name like concat('%', #{nickName},'%')
</if>
<if test="phone != null and phone != ''">and c.phone like concat('%', #{phone},'%')
</if>
<if test="consumerId != null ">and w.consumer_id = #{consumerId}</if>
<if test="balance != null ">and w.balance = #{balance}</if>
<if test="remainingDuration != null ">and w.remaining_duration = #{remainingDuration}</if>
<if test="remainingIntegral != null ">and w.remaining_integral = #{remainingIntegral}</if>
<if test="isDelete != null ">and w.is_delete = #{isDelete}</if>
</where>
</select>
<insert id="insertConsumerWallet" parameterType="ConsumerWallet" useGeneratedKeys="true" keyProperty="id">
insert into s_consumer_wallet
......
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