Commit 5f97e321 by 吕明尚

修改计算订单价格

parent e396b965
...@@ -10,7 +10,17 @@ public enum PayTypeEnum { ...@@ -10,7 +10,17 @@ public enum PayTypeEnum {
WECHAT(1,"wechat","微信支付"), WECHAT(1,"wechat","微信支付"),
ALIPAY(2,"alipay","支付宝"), 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 Integer code;
private String value; private String value;
......
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/activity") @RequestMapping("/activity")
public class ActivityController extends BaseController { public class ActivityController extends BaseController {
@Autowired @Autowired
private ActivityService activityService; private ActivityService activityService;
......
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/balanceLog") @RequestMapping("/balanceLog")
public class BalanceLogController extends BaseController { public class BalanceLogController extends BaseController {
@Autowired @Autowired
private BalanceLogService balanceLogService; private BalanceLogService balanceLogService;
......
...@@ -22,7 +22,7 @@ import java.util.List; ...@@ -22,7 +22,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/member") @RequestMapping("/member")
public class ConsumerMemberController extends BaseController { public class ConsumerMemberController extends BaseController {
@Autowired @Autowired
private ConsumerMemberService consumerMemberService; private ConsumerMemberService consumerMemberService;
......
...@@ -22,7 +22,7 @@ import java.util.List; ...@@ -22,7 +22,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/wallet") @RequestMapping("/wallet")
public class ConsumerWalletController extends BaseController { public class ConsumerWalletController extends BaseController {
@Autowired @Autowired
private ConsumerWalletService consumerWalletService; private ConsumerWalletService consumerWalletService;
...@@ -37,6 +37,11 @@ public class ConsumerWalletController extends BaseController { ...@@ -37,6 +37,11 @@ public class ConsumerWalletController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/query")
public ConsumerWalletVo selectByConsumerId() {
return consumerWalletService.selectByConsumerId();
}
/** /**
* 导出会员钱包列表 * 导出会员钱包列表
*/ */
......
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/equityMembersOrderConfig") @RequestMapping("/equityMembersOrderConfig")
public class EquityMembersOrderConfigController extends BaseController { public class EquityMembersOrderConfigController extends BaseController {
@Autowired @Autowired
private EquityMembersOrderConfigService equityMembersOrderConfigService; private EquityMembersOrderConfigService equityMembersOrderConfigService;
......
...@@ -22,7 +22,7 @@ import java.util.List; ...@@ -22,7 +22,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/equityMembersOrder") @RequestMapping("/equityMembersOrder")
public class EquityMembersOrderController extends BaseController { public class EquityMembersOrderController extends BaseController {
@Autowired @Autowired
private EquityMembersOrderService equityMembersOrderService; private EquityMembersOrderService equityMembersOrderService;
......
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/integralLog") @RequestMapping("/integralLog")
public class IntegralLogController extends BaseController { public class IntegralLogController extends BaseController {
@Autowired @Autowired
private IntegralLogService integralLogService; private IntegralLogService integralLogService;
......
...@@ -22,7 +22,7 @@ import java.util.List; ...@@ -22,7 +22,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/memberConfig") @RequestMapping("/memberConfig")
public class MemberConfigController extends BaseController { public class MemberConfigController extends BaseController {
@Autowired @Autowired
private MemberConfigService memberConfigService; private MemberConfigService memberConfigService;
......
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/rechargeConf") @RequestMapping("/rechargeConf")
public class RechargeConfController extends BaseController { public class RechargeConfController extends BaseController {
@Autowired @Autowired
private RechargeConfService rechargeConfService; private RechargeConfService rechargeConfService;
......
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/recharge") @RequestMapping("/recharge")
public class RechargeController extends BaseController { public class RechargeController extends BaseController {
@Autowired @Autowired
private RechargeService rechargeService; private RechargeService rechargeService;
......
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/rechargeCouponConf") @RequestMapping("/rechargeCouponConf")
public class RechargeCouponConfController extends BaseController { public class RechargeCouponConfController extends BaseController {
@Autowired @Autowired
private RechargeCouponConfService rechargeCouponConfService; private RechargeCouponConfService rechargeCouponConfService;
......
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
* @date 2024-06-24 * @date 2024-06-24
*/ */
@RestController @RestController
@RequestMapping("/system/rechargeRefund") @RequestMapping("/rechargeRefund")
public class RechargeRefundController extends BaseController { public class RechargeRefundController extends BaseController {
@Autowired @Autowired
private RechargeRefundService rechargeRefundService; private RechargeRefundService rechargeRefundService;
......
...@@ -60,4 +60,6 @@ public interface ConsumerWalletMapper extends BaseMapper<ConsumerWallet> { ...@@ -60,4 +60,6 @@ public interface ConsumerWalletMapper extends BaseMapper<ConsumerWallet> {
* @return 结果 * @return 结果
*/ */
public int deleteConsumerWalletByIds(Long[] ids); public int deleteConsumerWalletByIds(Long[] ids);
ConsumerWalletVo selectByConsumerId(ConsumerWalletVo consumerWallet);
} }
...@@ -60,4 +60,6 @@ public interface ConsumerWalletService extends IService<ConsumerWallet> { ...@@ -60,4 +60,6 @@ public interface ConsumerWalletService extends IService<ConsumerWallet> {
* @return 结果 * @return 结果
*/ */
public int deleteConsumerWalletById(Long id); public int deleteConsumerWalletById(Long id);
ConsumerWalletVo selectByConsumerId();
} }
...@@ -5,9 +5,11 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -5,9 +5,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.common.utils.DateUtils; import share.common.utils.DateUtils;
import share.system.domain.ConsumerWallet; import share.system.domain.ConsumerWallet;
import share.system.domain.SConsumer;
import share.system.domain.vo.ConsumerWalletVo; import share.system.domain.vo.ConsumerWalletVo;
import share.system.mapper.ConsumerWalletMapper; import share.system.mapper.ConsumerWalletMapper;
import share.system.service.ConsumerWalletService; import share.system.service.ConsumerWalletService;
import share.system.service.SConsumerService;
import java.util.List; import java.util.List;
...@@ -22,6 +24,9 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -22,6 +24,9 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
@Autowired @Autowired
private ConsumerWalletMapper consumerWalletMapper; private ConsumerWalletMapper consumerWalletMapper;
@Autowired
private SConsumerService sConsumerService;
/** /**
* 查询会员钱包 * 查询会员钱包
* *
...@@ -89,4 +94,12 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -89,4 +94,12 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
public int deleteConsumerWalletById(Long id) { public int deleteConsumerWalletById(Long id) {
return consumerWalletMapper.deleteConsumerWalletById(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 ...@@ -1854,7 +1854,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
// 计算各种价格 // 计算各种价格
ComputedOrderPriceResponse priceResponse = new ComputedOrderPriceResponse(); ComputedOrderPriceResponse priceResponse = new ComputedOrderPriceResponse();
Activity activity; Activity activity;
ConsumerMember consumerMember = new ConsumerMember(); ConsumerMember consumerMember = null;
LambdaQueryWrapper<Activity> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Activity> queryWrapper = new LambdaQueryWrapper<>();
if (ObjectUtil.isNotEmpty(user)) { if (ObjectUtil.isNotEmpty(user)) {
consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, user.getId())); consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, user.getId()));
...@@ -1946,15 +1946,17 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -1946,15 +1946,17 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
} }
private BigDecimal getBigDecimal(OrderComputedPriceRequest request, Activity activity, BigDecimal payPrice, SConsumer user) { 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)); CronParser cronParser = new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ));
Cron cron = cronParser.parse(activity.getCronExpression()); Cron cron = cronParser.parse(activity.getCronExpression());
ExecutionTime executionTime = ExecutionTime.forCron(cron); ExecutionTime executionTime = ExecutionTime.forCron(cron);
LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SOrder::getConsumerId, user.getId()); 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.eq(SOrder::getPayStatus, YesNoEnum.yes.getIndex());
queryWrapper.ne(SOrder::getPayPrice, new BigDecimal(0)); 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); queryWrapper.isNull(SOrder::getCouponId);
List<SOrder> orderList = list(queryWrapper); List<SOrder> orderList = list(queryWrapper);
if (CollectionUtils.isEmpty(orderList)) { if (CollectionUtils.isEmpty(orderList)) {
......
...@@ -69,6 +69,34 @@ ...@@ -69,6 +69,34 @@
<include refid="selectConsumerWalletVo"/> <include refid="selectConsumerWalletVo"/>
where id = #{id} where id = #{id}
</select> </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 id="insertConsumerWallet" parameterType="ConsumerWallet" useGeneratedKeys="true" keyProperty="id">
insert into s_consumer_wallet 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