11.18
This commit is contained in:
parent
318a762c76
commit
5201736130
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.api.fuyou.entity.ReturnParameter;
|
||||
import com.fuint.business.integral.entity.IntegralDetail;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord;
|
||||
import com.fuint.business.marketingActivity.cardFule.vo.CardValueConditionVo;
|
||||
import com.fuint.business.marketingActivity.cardValue.dto.CardValueRecordDTO;
|
||||
import com.fuint.business.marketingActivity.cardValue.dto.SelectCard;
|
||||
@ -56,6 +57,8 @@ public interface CardValueRecordService extends IService<CardValueRecord> {
|
||||
|
||||
CardValueRecord checkTheStatusOfYourPayment(Integer id) throws Exception;
|
||||
|
||||
CardFuelRecord checkTheStatusOfYourPayments(Integer id) throws Exception;
|
||||
|
||||
boolean editPayStatus(@Param("id") Integer id,@Param("payStates") String payStates);
|
||||
|
||||
|
||||
|
@ -34,6 +34,8 @@ import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableS
|
||||
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO;
|
||||
import com.fuint.business.marketingActivity.cardFule.dto.CardFuelRecordDTO;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord;
|
||||
import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelRecordMapper;
|
||||
import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService;
|
||||
import com.fuint.business.marketingActivity.cardFule.service.CardFuelRecordService;
|
||||
import com.fuint.business.marketingActivity.cardFule.vo.CardValueConditionVo;
|
||||
@ -53,6 +55,7 @@ import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrde
|
||||
import com.fuint.business.member.entity.LJStaff;
|
||||
import com.fuint.business.member.service.ILJStaffService;
|
||||
import com.fuint.business.order.entity.*;
|
||||
import com.fuint.business.order.mapper.AllOrderInfoMapper;
|
||||
import com.fuint.business.order.service.AllOrderInfoService;
|
||||
import com.fuint.business.order.service.CardBalanceChangeService;
|
||||
import com.fuint.business.order.service.GrowthValueChangeService;
|
||||
@ -1443,5 +1446,105 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
}
|
||||
return OrderIPage;
|
||||
}
|
||||
@Resource
|
||||
CardFuelRecordMapper cardFuelRecordMapper;
|
||||
@Resource
|
||||
AllOrderInfoMapper allOrderInfoMapper;
|
||||
|
||||
/**
|
||||
* 囤油卡查询支付状态 修改相关关联表
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public CardFuelRecord checkTheStatusOfYourPayments(Integer id) throws Exception {
|
||||
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
CardFuelRecord cardFuelRecord = cardFuelRecordMapper.selectById(id);
|
||||
if (ObjectUtil.isEmpty(cardFuelRecord.getMtStaffId())) {
|
||||
cardFuelRecord.setMtStaffId(nowAccountInfo.getStaffId());
|
||||
}
|
||||
String lockKey = "CardFuelRecord"+nowAccountInfo.getStoreId()+id;
|
||||
Boolean isLock = redisLock.tryLock(lockKey, 5000, TimeUnit.MILLISECONDS);
|
||||
// 支付成功之后
|
||||
if (isLock && "paid".equals(cardFuelRecord.getPayStatus()) && "0".equals(cardFuelRecord.getStatus())){
|
||||
// 查询用户信息
|
||||
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(cardFuelRecord.getMtUserId(), cardFuelRecord.getChainStoreId());
|
||||
//添加总订单表
|
||||
AllOrderInfo allOrderInfo=new AllOrderInfo();
|
||||
allOrderInfo.setOrderNo(cardFuelRecord.getPaymentNo());
|
||||
allOrderInfo.setType("5");
|
||||
allOrderInfo.setStoreId(cardFuelRecord.getStoreId());
|
||||
allOrderInfo.setGoodsMoney(Double.valueOf(cardFuelRecord.getRechargeBalance()));
|
||||
allOrderInfo.setPayMoney(Double.valueOf(cardFuelRecord.getRechargeBalance()));
|
||||
allOrderInfo.setPayTime(cardFuelRecord.getCreateTime());
|
||||
allOrderInfo.setPayType(cardFuelRecord.getPaymentType());
|
||||
allOrderInfo.setUserId(cardFuelRecord.getMtUserId());
|
||||
allOrderInfo.setPayChannel(cardFuelRecord.getPaymentType());
|
||||
allOrderInfo.setStatus(cardFuelRecord.getPayStatus());
|
||||
allOrderInfo.setCreateTime(cardFuelRecord.getCreateTime());
|
||||
allOrderInfo.setCreateBy(cardFuelRecord.getCreateBy());
|
||||
allOrderInfo.setUpdateTime(cardFuelRecord.getUpdateTime());
|
||||
allOrderInfo.setUpdateBy(cardFuelRecord.getUpdateBy());
|
||||
allOrderInfo.setStaffId(cardFuelRecord.getMtStaffId());
|
||||
allOrderInfo.setContent("囤油卡充值");
|
||||
allOrderInfoMapper.insert(allOrderInfo);
|
||||
// 积分表变动
|
||||
if (!ObjectUtil.isEmpty(cardFuelRecord.getPoints()) && cardFuelRecord.getPoints() != 0) {
|
||||
IntegralDetail integralDetail = changesInPointss(cardFuelRecord,ljUserVos);
|
||||
integralDetail.setStoreId(cardFuelRecord.getStoreId());
|
||||
integralDetail.setChainStoreId(cardFuelRecord.getChainStoreId());
|
||||
integralDetail.setCreateBy(cardFuelRecord.getMtStaffId().toString());
|
||||
integralDetailService.insert2(integralDetail);
|
||||
}
|
||||
// 成长值变动明细
|
||||
if (!ObjectUtil.isEmpty(cardFuelRecord.getGrowthValue()) && cardFuelRecord.getGrowthValue() != 0) {
|
||||
GrowthValueChange growthValueChange = new GrowthValueChange();
|
||||
growthValueChange.setUserId(cardFuelRecord.getMtUserId());
|
||||
growthValueChange.setChainStoreId(cardFuelRecord.getChainStoreId());
|
||||
|
||||
growthValueChange.setStoreId(cardFuelRecord.getStoreId());
|
||||
growthValueChange.setFromType("囤油卡充值赠送");
|
||||
growthValueChange.setGrowthValue(cardFuelRecord.getGrowthValue());
|
||||
growthValueChange.setOrderNo(cardFuelRecord.getPaymentNo());
|
||||
growthValueChange.setAfterTheChange(cardFuelRecord.getGrowthValue());
|
||||
growthValueChangeService.insertGrowthValueChange(growthValueChange);
|
||||
}
|
||||
// 员工提成
|
||||
// if (ObjectUtil.isNotEmpty(cardValueRecord.getMtStaffId()) && !ObjectUtil.isEmpty(cardValueRecord.getRoyaltyType()) && !"1".equals(cardValueRecord.getRoyaltyType())) {
|
||||
// if (ObjectUtil.isNotEmpty(cardValueRecord.getMtStaffId())) {
|
||||
// CommissionRecord commissionRecord = employeeCommissions(cardValueRecord);
|
||||
// commissionRecordService.insert2(commissionRecord);
|
||||
// staffCommissionService.countStaffCommission(cardFuelRecord.getMtStaffId(),cardFuelRecord.getStoreId(),cardFuelRecord.getBidBalance(),cardFuelRecord.getRechargeBalance(),"4",cardFuelRecord.getPaymentNo());
|
||||
// }
|
||||
//员工信息
|
||||
LJStaff ljStaff = mtStaffService.selectStaffById(cardFuelRecord.getMtStaffId());
|
||||
// 处理赠送兑换券或者其他
|
||||
//会员等级充值送券
|
||||
giveCoupon(cardFuelRecord.getMtUserId(),cardFuelRecord.getStoreId(),ljUserVos,ljStaff);
|
||||
// 修改订单的处理状态 (避免二次执行)
|
||||
CardFuelRecord cardFuelRecord1 = new CardFuelRecord();
|
||||
cardFuelRecord1.setId(id);
|
||||
cardFuelRecord1.setStatus("1");
|
||||
cardFuelRecordMapper.updateById(cardFuelRecord1);
|
||||
redisLock.unlock(lockKey);
|
||||
}
|
||||
return cardFuelRecord;
|
||||
}
|
||||
private IntegralDetail changesInPointss(CardFuelRecord cardFuelRecord,LJUserVo ljUserVos) {
|
||||
IntegralDetail integralDetail = new IntegralDetail();
|
||||
integralDetail.setUserId(cardFuelRecord.getMtUserId());
|
||||
integralDetail.setPointsChange(cardFuelRecord.getPoints().doubleValue());
|
||||
|
||||
// 计算积分
|
||||
BigDecimal bigPoints = new BigDecimal(cardFuelRecord.getPoints().toString());
|
||||
BigDecimal addPoints = bigPoints.add(new BigDecimal(ljUserVos.getPoints()));
|
||||
integralDetail.setChangeType("1");
|
||||
|
||||
integralDetail.setCurrentPoints(addPoints.intValue());
|
||||
integralDetail.setChangeReason("余额充值赠送");
|
||||
return integralDetail;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -644,7 +644,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
order.setBalanceAmount(Double.valueOf(balanceAmount));
|
||||
order.setOilCardAmount(Double.valueOf(oilCardAmount));
|
||||
order.setActiveAmount(activeAmount);
|
||||
order.setBalanceGiftAmount( this.countCardBalance(Double.valueOf(amount), userId, storeId, orderNo));
|
||||
order.setStoreId(storeId);
|
||||
order.setUserId(userId);
|
||||
order.setStaffId(staffId);
|
||||
@ -673,10 +672,15 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
if (payType.equals("card_value")) {
|
||||
// 修改用户储值卡余额
|
||||
this.insertCardBalance(consumeAmount, userId, storeId, orderNo);
|
||||
order.setBalanceGiftAmount( this.countCardBalance(Double.valueOf(amount), userId, storeId, orderNo));
|
||||
}
|
||||
if (payType.equals("fule_card")) {
|
||||
// 修改用户囤油卡余额
|
||||
userFuelService.changeBalance(userId, Integer.valueOf(jsonObject.get("oils").toString()), storeId, nowAccountInfo.getChainStoreId(), Double.valueOf(oilCardAmount), orderNo);
|
||||
order.setOrderAmount(0.00);
|
||||
order.setDiscountAmount(0.00);
|
||||
order.setBalanceAmount(0.00);
|
||||
order.setOilCardAmount(oilNum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -361,7 +361,23 @@ public class printerController extends BaseController {
|
||||
// PrintFuelDieselReport.setHandover(fuelDiesel);
|
||||
// Integer random6 = (int) ((Math.random() * 9 + 1) * 100000);
|
||||
// String url=m.print("4004872261", PrintFuelDieselReport.printFeulOrder(), "Z"+System.currentTimeMillis()+random6.toString());
|
||||
printerService.printFuelDieselReport(fuelDiesel,TokenUtil.getNowAccountInfo().getStoreId());
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
MtUser mtUser=null;
|
||||
UserBalance userBalance=null;
|
||||
LJUserGrade ljUserGrade=null;
|
||||
String orderNo=null;
|
||||
List<Map<String,String>> o = (List<Map<String,String>>)fuelDiesel.get("oilOrder");
|
||||
for (Map<String, String> stringStringMap : o) {
|
||||
orderNo=stringStringMap.get("orderNo");
|
||||
if("散客".equals(stringStringMap.get("payUser"))){
|
||||
}else {
|
||||
mtUser=mtUserMapper.selectByPhone(stringStringMap.get("payUser"));
|
||||
userBalance=userBalanceMapper.getUserBalanceByUserId(mtUser.getId().toString());
|
||||
ljUserGrade= ljUserGradeMapper.getUserGradeByUserId(userBalance.getGradeId().toString());
|
||||
}
|
||||
}
|
||||
ReceiptPrinting receiptPrinting = receiptPrintingService.queryReceiptPrintingOne(nowAccountInfo.getStoreId());
|
||||
printerService.printFuelDieselReport(fuelDiesel,TokenUtil.getNowAccountInfo().getStoreId(),receiptPrinting,mtUser,userBalance,ljUserGrade,orderNo);
|
||||
|
||||
}
|
||||
@PostMapping("printIntegralReport")
|
||||
|
@ -32,7 +32,7 @@ public interface PrinterService {
|
||||
|
||||
|
||||
void printCardValueReport(Map<String, Object> printCardValue,Integer storeId, ReceiptPrinting receiptPrinting, MtUser mtUser, UserBalance userBalance, LJUserGrade ljUserGrade,String orderNo);
|
||||
void printFuelDieselReport(Map<String, Object> printCardValue,Integer storeId);
|
||||
void printFuelDieselReport(Map<String, Object> printCardValue,Integer storeId, ReceiptPrinting receiptPrinting, MtUser mtUser, UserBalance userBalance, LJUserGrade ljUserGrade,String orderNo);
|
||||
|
||||
|
||||
void printIntegralReport(Map<String, Object> integral, Integer storeId);
|
||||
|
@ -335,9 +335,10 @@ public class PrinterServiceImpl implements PrinterService {
|
||||
|
||||
}
|
||||
}
|
||||
public void printFuelDieselReport(Map<String, Object> fuelDiesel,Integer storeId) {
|
||||
public void printFuelDieselReport(Map<String, Object> fuelDiesel,Integer storeId, ReceiptPrinting receiptPrinting, MtUser mtUser, UserBalance userBalance, LJUserGrade ljUserGrade,String orderNo) {
|
||||
PrintDeviceInfo infoByStoreId = printDeviceInfoMapper.getInfoByStoreId(storeId);
|
||||
|
||||
// PrintDeviceInfo infoByStoreId = printDeviceInfoMapper.getInfoByStoreId(storeId);
|
||||
AllOrderInfoVo allOrderInfoVo=allOrderInfoMapper.getOneByOrderNo(orderNo);
|
||||
log.info("handover:{}",fuelDiesel.toString());
|
||||
Methods m=Methods.getInstance();
|
||||
Object accessToken = RedisUtil.get("scancodemodel+" + storeId);
|
||||
@ -354,7 +355,7 @@ public class PrinterServiceImpl implements PrinterService {
|
||||
m.init(infoByStoreId.getAppKey(), infoByStoreId.getAppSecret());
|
||||
PrintFuelDieselReport.setHandover(fuelDiesel);
|
||||
Integer random6 = (int) ((Math.random() * 9 + 1) * 100000);
|
||||
String url=m.print(infoByStoreId.getMachineCode(), PrintFuelDieselReport.printFeulOrder(), "Z"+System.currentTimeMillis()+random6.toString());
|
||||
String url=m.print(infoByStoreId.getMachineCode(), PrintFuelDieselReport.printFeulOrder(receiptPrinting,mtUser,userBalance,ljUserGrade,allOrderInfoVo), "Z"+System.currentTimeMillis()+random6.toString());
|
||||
if (ObjectUtil.isNotEmpty(url)) {
|
||||
// 使用 Fastjson 将 JSON 字符串解析为 JSONObject
|
||||
JSONObject jsonObject = JSON.parseObject(url);
|
||||
@ -362,7 +363,7 @@ public class PrinterServiceImpl implements PrinterService {
|
||||
String error = jsonObject.getString("error");
|
||||
if ("18".equals(error)) {
|
||||
getToken(storeId);
|
||||
printFuelDieselReport(fuelDiesel,storeId);
|
||||
printFuelDieselReport(fuelDiesel,storeId, receiptPrinting, mtUser, userBalance, ljUserGrade, orderNo);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,31 +1,152 @@
|
||||
package com.fuint.business.printer.template;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.fuint.business.order.vo.AllOrderInfoVo;
|
||||
import com.fuint.business.setting.entity.ReceiptPrinting;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.repository.model.MtUser;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PrintFuelDieselReport {
|
||||
public static Map<String, Object> handover = new HashMap<>();
|
||||
public static String printFeulOrder() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
public static String printFeulOrder(ReceiptPrinting receiptPrinting, MtUser mtUser, UserBalance userBalance, LJUserGrade ljUserGrade,
|
||||
AllOrderInfoVo allOrderInfoVo) {
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
//
|
||||
// LocalDateTime now = LocalDateTime.now();
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
// String formattedDateTime = now.format(formatter);
|
||||
// System.out.println("当前时间:" + formattedDateTime);
|
||||
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
//
|
||||
//
|
||||
// sb.append("<center>订单统计\r\n</center>");
|
||||
//
|
||||
// sb.append("打印时间:"+formattedDateTime +"\r\n");
|
||||
// sb.append("店铺名称:"+nowAccountInfo.getStoreName() +"\r\n");
|
||||
// sb.append("--------------------------------\r\n");
|
||||
// if (ObjectUtil.isNotEmpty(handover.get("oilType"))) {
|
||||
// sb.append("充值油品:"+handover.get("oilType")+"\r\n");
|
||||
// sb.append("--------------------------------\r\n");
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(handover.get("incomeLitres"))) {
|
||||
// sb.append("充值升数:"+handover.get("incomeLitres")+"\r\n");
|
||||
// sb.append("--------------------------------\r\n");
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(handover.get("realyPayBills"))) {
|
||||
// sb.append("订单金额:¥"+handover.get("realyPayBills")+"\r\n");
|
||||
// sb.append("--------------------------------\r\n");
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(handover.get("lockupPrice"))) {
|
||||
// sb.append("锁价金额:¥"+handover.get("lockupPrice")+"\r\n");
|
||||
// sb.append("--------------------------------\r\n");
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(handover.get("payType"))) {
|
||||
// sb.append("支付方式:"+handover.get("payType")+"\r\n");
|
||||
// sb.append("--------------------------------\r\n");
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(handover.get("realyPayBills"))) {
|
||||
// sb.append("实付款:¥"+handover.get("realyPayBills")+"\r\n");
|
||||
// sb.append("--------------------------------\r\n");
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(handover.get("seekZero"))) {
|
||||
// sb.append("找零:¥"+handover.get("seekZero")+"\r\n");
|
||||
// sb.append("--------------------------------\r\n");
|
||||
// }
|
||||
//
|
||||
// sb.append("<center>谢谢惠顾,欢迎下次光临!</center>");
|
||||
//
|
||||
// return sb.toString();
|
||||
|
||||
|
||||
|
||||
StringBuilder sb=new StringBuilder();
|
||||
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
String formattedDateTime = now.format(formatter);
|
||||
System.out.println("当前时间:" + formattedDateTime);
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
if(allOrderInfoVo.getPayChannel().equals("applet") && allOrderInfoVo.getContent().equals("油品订单")){
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("zzzzz","一键加油"));
|
||||
}else {
|
||||
if(allOrderInfoVo.getContent().equals("收银台订单")){
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("zzzzz","收银台消费"));
|
||||
}
|
||||
if(allOrderInfoVo.getContent().equals("储值卡充值")){
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("zzzzz","会员充值"));
|
||||
}
|
||||
if(allOrderInfoVo.getContent().equals("囤油卡充值")){
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("zzzzz","囤油卡充值"));
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println( receiptPrinting.getPrintTemplateTop());
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("xxxxx","32131566313655"));
|
||||
if(mtUser!=null&&mtUser.getUserNo()!=null){
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("kkkkk",mtUser.getUserNo()));
|
||||
}else {
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("卡号:kkkkk\r\n",""));
|
||||
}
|
||||
if(mtUser!=null&&mtUser.getCarNo()!=null){
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("ccccc",mtUser.getCarNo()));
|
||||
}else {
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("车牌号:ccccc\r\n",""));
|
||||
}
|
||||
if(ljUserGrade!=null&&ljUserGrade.getName()!=null){
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("ddddd",ljUserGrade.getName()));
|
||||
}else {
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("等级:ddddd\r\n",""));
|
||||
}
|
||||
if(mtUser!=null&&mtUser.getMobile()!=null){
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("sssss",mtUser.getMobile()));
|
||||
}else {
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("手机号:sssss\r\n",""));
|
||||
}
|
||||
if(userBalance!=null&&userBalance.getCardBalance().toString()!=null){
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("yyyyy",userBalance.getCardBalance().toString()));
|
||||
}else {
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("余额:yyyyy\r\n",""));
|
||||
}
|
||||
if(userBalance!=null&&userBalance.getPoints().toString()!=null){
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("jjjjj",userBalance.getPoints().toString()));
|
||||
}else {
|
||||
receiptPrinting.setPrintTemplateTop(receiptPrinting.getPrintTemplateTop().replace("积分:jjjjj\r\n",""));
|
||||
}
|
||||
|
||||
sb.append("<center>订单统计\r\n</center>");
|
||||
if (allOrderInfoVo.getType().equals("1")) {
|
||||
sb.append("<table><tr><td>油品</td><td>金额</td></tr>");
|
||||
List<Map<String,String>> o = (List<Map<String,String>>)handover.get("oilOrder");
|
||||
for (Map<String, String> stringStringMap : o) {
|
||||
sb.append("<tr><td>"+stringStringMap.get("oilName")+"</td>");
|
||||
sb.append("<td>¥"+ stringStringMap.get("amount")+"</td></tr>");
|
||||
}
|
||||
sb.append("</table>");
|
||||
sb.append("--------------------------------\r\n");
|
||||
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(handover.get("goodsOrder"))) {
|
||||
sb.append("<table><tr><td>商品</td><td>数量</td><td>单价</td></tr>");
|
||||
List<Map<String,String>> o = (List<Map<String,String>>)handover.get("goodsOrder");
|
||||
for (Map<String, String> stringStringMap : o) {
|
||||
sb.append("<tr><td>"+stringStringMap.get("oilName")+"</td>");
|
||||
sb.append("<td>"+stringStringMap.get("unit")+"</td>");
|
||||
|
||||
sb.append("<td>"+ stringStringMap.get("amount")+"</td></tr>");
|
||||
}
|
||||
sb.append("</table>");
|
||||
sb.append("--------------------------------\r\n");
|
||||
|
||||
}
|
||||
|
||||
sb.append("打印时间:"+formattedDateTime +"\r\n");
|
||||
sb.append("店铺名称:"+nowAccountInfo.getStoreName() +"\r\n");
|
||||
sb.append("--------------------------------\r\n");
|
||||
if (ObjectUtil.isNotEmpty(handover.get("oilType"))) {
|
||||
sb.append("充值油品:"+handover.get("oilType")+"\r\n");
|
||||
sb.append("--------------------------------\r\n");
|
||||
@ -54,10 +175,10 @@ public class PrintFuelDieselReport {
|
||||
sb.append("找零:¥"+handover.get("seekZero")+"\r\n");
|
||||
sb.append("--------------------------------\r\n");
|
||||
}
|
||||
|
||||
sb.append("<center>谢谢惠顾,欢迎下次光临!</center>");
|
||||
|
||||
return sb.toString();
|
||||
receiptPrinting.setPrintTemplateDown(receiptPrinting.getPrintTemplateDown().
|
||||
replace("ttttt",formattedDateTime));
|
||||
System.out.println(receiptPrinting.getPrintTemplateTop()+sb.toString()+receiptPrinting.getPrintTemplateDown());
|
||||
return receiptPrinting.getPrintTemplateTop()+sb.toString()+receiptPrinting.getPrintTemplateDown();
|
||||
}
|
||||
|
||||
public static Map<String, Object> getHandover() {
|
||||
|
@ -175,7 +175,10 @@ public class PrintOilOrderReport {
|
||||
sb.append("--------------------------------\r\n");
|
||||
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(handover.get("oilCardAmount"))) {
|
||||
sb.append("加油升数:"+handover.get("oilCardAmount")+"L\r\n");
|
||||
sb.append("--------------------------------\r\n");
|
||||
}
|
||||
sb.append("支付方式:"+handover.get("payType")+"\r\n");
|
||||
if ("credit".equals(handover.get("payType"))) {
|
||||
sb.append("挂账单位:"+handover.get("unitName")+"\r\n");
|
||||
|
@ -54,6 +54,15 @@ export function getCheckTheStatusOfYourPaymentApi(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 余额插入订单
|
||||
export function getCheckTheStatusOfYourPaymentApis(query) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardValueRecord/checkTheStatusOfYourPayments?id='+query,
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 根据字典类型查询字典数据信息
|
||||
export function getDicts(dictType) {
|
||||
|
@ -556,7 +556,7 @@ import {userListByPhone} from "@/api/cashier/user";
|
||||
import {VueClipboard} from 'vue-clipboard2';
|
||||
import {getDicts} from "@/api/dict/data";
|
||||
import {
|
||||
getCheckTheStatusOfYourPaymentApi,
|
||||
getCheckTheStatusOfYourPaymentApis,
|
||||
rechargeCard
|
||||
} from "@/api/cashier/cardSet";
|
||||
import {getReturnCode, printOilOrderReport,printCardValueReport,printFuelDieselReport} from '../../../api/print'
|
||||
@ -569,6 +569,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
orderNo:'',
|
||||
oilCardAmount:'',
|
||||
disOil: 0.00,
|
||||
disGoods: 0.00,
|
||||
loadingPreferential: false,
|
||||
@ -1051,7 +1052,7 @@ export default {
|
||||
//
|
||||
let timer = setInterval(async () => {
|
||||
let flag = false
|
||||
await getCheckTheStatusOfYourPaymentApi(id).then(async response => {
|
||||
await getCheckTheStatusOfYourPaymentApis(id).then(async response => {
|
||||
if (response.data != null) {
|
||||
const payStatus = response.data.payStatus
|
||||
this_.orderNo=response.data.paymentNo
|
||||
@ -1204,6 +1205,8 @@ export default {
|
||||
consumeAmount: this.realAmount,
|
||||
// 屯油卡付款
|
||||
consumeRefuelMoney: this.realAmount,
|
||||
//多少升油
|
||||
oilCardAmount:this.oilCardAmount,
|
||||
// 实付款
|
||||
actualPay: this.realAmount,
|
||||
// 找零
|
||||
@ -1260,7 +1263,13 @@ export default {
|
||||
if (this.payForm.cardType==1){
|
||||
let payTypeText1 = payTypeMap[this.payForm.paymentType]
|
||||
console.log(this.payForm,1256)
|
||||
let mm=[]
|
||||
mm.push({
|
||||
orderNo:this.orderNo,
|
||||
payUser:this.chooseVipUser.mobile
|
||||
})
|
||||
let b = {
|
||||
oilOrder:mm,
|
||||
// 充值油品
|
||||
oilType:this.payForm.oilName,
|
||||
// 充值升数
|
||||
@ -1445,6 +1454,7 @@ export default {
|
||||
await addLJGoods(_this.payForm).then(async response => {
|
||||
_this.orderNo = response.data.orderNo;
|
||||
this.orderNo = response.data.orderNo;
|
||||
_this.oilCardAmount = response.data.oilOrder.oilCardAmount
|
||||
//支付成功 后需要打印小票
|
||||
console.log("支付成功", response)
|
||||
|
||||
@ -2089,7 +2099,6 @@ export default {
|
||||
//支付弹窗 相关
|
||||
this.payForm.realyPayBills = this.realAmount
|
||||
await addLJGoods(this.payForm).then(response => {
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user