pos支付bug
This commit is contained in:
parent
8bcf58ca2b
commit
1f9f076cc1
@ -32,6 +32,7 @@ import com.fuint.business.marketingActivity.cardFuleOrders.service.CardFuleOrder
|
||||
import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord;
|
||||
import com.fuint.business.marketingActivity.cardValue.mapper.CardValueRecordMapper;
|
||||
import com.fuint.business.marketingActivity.cardValue.service.CardValueRecordService;
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.service.CardValueOrdersService;
|
||||
import com.fuint.business.member.entity.LJStaff;
|
||||
import com.fuint.business.member.service.ILJStaffService;
|
||||
import com.fuint.business.order.entity.AllOrderInfo;
|
||||
@ -111,6 +112,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
private ILJStoreService storeService;
|
||||
@Resource
|
||||
private StaffCommissionService staffCommissionService;
|
||||
@Resource
|
||||
private CardValueOrdersService cardValueOrdersService;
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
@ -266,6 +269,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
if ("CASH".equals(cardFuelRecordDTO.getPaymentType())) {
|
||||
AllOrderInfo allOrderInfo = getAllOrderInfo(cardFuelRecordDTO);
|
||||
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
|
||||
cardValueOrdersService.updateBalances(orderNo,"paid");
|
||||
}
|
||||
|
||||
double theAmountToBePaid = 0.0;
|
||||
|
@ -35,5 +35,6 @@ public interface CardValueOrdersService extends IService<CardValueOrders> {
|
||||
void updateOrderStatus(String orderNo,String status);
|
||||
|
||||
void updateBalance(String orderNo,String status);
|
||||
void updateBalances(String orderNo,String status);
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.mapper.CardValueOrdersMapper;
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.service.CardValueOrdersService;
|
||||
import com.fuint.business.order.mapper.AllOrderInfoMapper;
|
||||
import com.fuint.business.order.service.AllOrderInfoService;
|
||||
import com.fuint.business.order.vo.AllOrderInfoVo;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.service.UserBalanceService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
@ -29,6 +32,9 @@ public class CardValueOrdersServiceImpl extends ServiceImpl<CardValueOrdersMappe
|
||||
|
||||
@Resource
|
||||
private UserBalanceService userBalanceService;
|
||||
|
||||
@Resource
|
||||
private AllOrderInfoService allOrderInfoService;
|
||||
/**
|
||||
* 根据订单编号返回订单信息
|
||||
* @param orderNo
|
||||
@ -75,5 +81,23 @@ public class CardValueOrdersServiceImpl extends ServiceImpl<CardValueOrdersMappe
|
||||
baseMapper.updateById(oneByOrderNo);
|
||||
}
|
||||
}
|
||||
@Resource
|
||||
AllOrderInfoMapper allOrderInfoMapper;
|
||||
@Override
|
||||
public void updateBalances(String orderNo, String status) {
|
||||
AllOrderInfoVo oneByOrderNo = allOrderInfoService.getOneByOrderNo(orderNo);
|
||||
if (ObjectUtil.isNotEmpty(oneByOrderNo)){
|
||||
|
||||
if ("paid".equals(status)){
|
||||
UserBalance userBalance = userBalanceService.selectUserBalanceByStorId(oneByOrderNo.getUserId(),oneByOrderNo.getStoreId());
|
||||
Double cardBalance = 0.0;
|
||||
cardBalance = userBalance.getCardBalance() + oneByOrderNo.getPayMoney();
|
||||
userBalance.setCardBalance(cardBalance);
|
||||
userBalanceService.updateUserBalance(userBalance);
|
||||
}
|
||||
oneByOrderNo.setStatus(status);
|
||||
allOrderInfoMapper.updateById(oneByOrderNo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.fuint.business.order.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
|
||||
import com.fuint.business.order.dto.AllOrderInfoDto;
|
||||
import com.fuint.business.order.entity.AllOrderInfo;
|
||||
import com.fuint.business.order.entity.CardBalanceChange;
|
||||
@ -49,4 +50,6 @@ public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
|
||||
AllOrderInfoVo getIndexData4Pos(@Param("allOrderInfo") AllOrderInfoDto allOrderInfo);
|
||||
|
||||
AllOrderInfoVo getHandOverList(HandoverRecord record);
|
||||
|
||||
AllOrderInfoVo getOneByOrderNo(String orderNo);
|
||||
}
|
||||
|
@ -395,6 +395,13 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getOneByOrderNo" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
|
||||
SELECT
|
||||
*
|
||||
from all_order_info
|
||||
where order_no = #{orderNo}
|
||||
</select>
|
||||
<!-- WHERE-->
|
||||
<!-- DATE(pay_time) = CURDATE();-->
|
||||
<!-- <if test="startTime != null "><!– 开始时间检索 –>-->
|
||||
@ -411,4 +418,4 @@
|
||||
<!-- <if test="endTime1 != null and endTime1 != ''">-->
|
||||
<!-- AND pay_time <= #{endTime} -- 结束时间检索-->
|
||||
<!-- </if>-->
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
@ -2,6 +2,7 @@ package com.fuint.business.order.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
|
||||
import com.fuint.business.order.dto.AllOrderInfoDto;
|
||||
import com.fuint.business.order.entity.AllOrderInfo;
|
||||
import com.fuint.business.order.entity.CashierOrder;
|
||||
@ -92,4 +93,5 @@ public interface AllOrderInfoService {
|
||||
AllOrderInfoVo getIndexData4Pos();
|
||||
AllOrderInfoVo getOperatingDataPos(AllOrderInfoDto allOrderInfo);
|
||||
|
||||
AllOrderInfoVo getOneByOrderNo(String orderNo);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import com.fuint.business.convenienceSore.dto.LJGoodsDto;
|
||||
import com.fuint.business.convenienceSore.service.LJGoodsService;
|
||||
import com.fuint.business.convenienceSore.service.StockTrackService;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
|
||||
import com.fuint.business.order.dto.AllOrderInfoDto;
|
||||
import com.fuint.business.order.entity.*;
|
||||
import com.fuint.business.order.mapper.AllOrderInfoMapper;
|
||||
@ -955,6 +956,10 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AllOrderInfoVo getOneByOrderNo(String orderNo) {
|
||||
return allOrderInfoMapper.getOneByOrderNo(orderNo);
|
||||
}
|
||||
|
||||
|
||||
private long dayCount(String beginTimeStr, String endTimeStr ) {
|
||||
|
Loading…
Reference in New Issue
Block a user