Merge branch 'main' of http://122.51.230.86:3000/dianliang/oil-station
This commit is contained in:
commit
9f9c1c2c05
@ -190,7 +190,6 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
String str = reqMap.get("sign");
|
||||
if (Utils.verifySign(reqMap, str)) {
|
||||
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(orderNo);
|
||||
List<OilOrder> list = oilOrderService.selectOilOrder(orderNo);
|
||||
LJOrder goodsOrder = goodsOrderService.selectGoodsOrder(orderNo);
|
||||
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
|
||||
String transactionType = null;
|
||||
@ -281,32 +280,6 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
receiveParameter.setType("7");
|
||||
receiveParameter.setContent("挂账订单");
|
||||
}
|
||||
if (!ArrayUtil.isEmpty(list)) {
|
||||
if (list.size() > 1) {
|
||||
Double oilLiters = 0.0;
|
||||
for (OilOrder order : list) {
|
||||
oilLiters += order.getOilNum();
|
||||
}
|
||||
for (OilOrder order : list) {
|
||||
if (order.getOrderType().equals("主订单")) {
|
||||
if (ObjectUtil.isNotEmpty(order.getStaffId()))
|
||||
staffCommissionService.countStaffCommission(order.getStaffId(), order.getStoreId(), order.getOrderAmount(), order.getPayAmount(), "1", orderNo);
|
||||
}
|
||||
// 添加多个油品订单
|
||||
order.setOrderStatus("paid");
|
||||
order.setPayTime(date);
|
||||
oilOrderService.updateOilOrder(order);
|
||||
|
||||
oilOrderService.updateCardAndActiveById(order.getStoreId(), order.getUserId(), order.getActiveId(), order.getCouponId(), order.getActiveType(), order.getOrderAmount(), order.getPayAmount(), Integer.valueOf(order.getOils()));
|
||||
|
||||
// 修改油罐容量
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(map1.get("oilOrder"), JSONObject.class);
|
||||
for (JSONObject jsonObject : jsonObjects) {
|
||||
oilOrderService.addOilTrack(jsonObject, oilOrder.getStoreId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("CVR".equals(type)) {
|
||||
//储值卡订单
|
||||
payStates = "paid";
|
||||
@ -351,14 +324,6 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
receiveParameter.setType("7");
|
||||
receiveParameter.setContent("挂账订单");
|
||||
}
|
||||
if (!ArrayUtil.isEmpty(list)) {
|
||||
if (list.size() > 1) {
|
||||
for (OilOrder order : list) {
|
||||
order.setOrderStatus("payFail");
|
||||
oilOrderService.updateOilOrder(order);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("CVR".equals(type)) {
|
||||
payStates = "payFail";
|
||||
cardValueOrdersService.updateOrderStatus(orderNo,payStatus);
|
||||
@ -413,7 +378,7 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
//储值卡
|
||||
Integer id = Integer.parseInt(map1.get("orderId"));
|
||||
cardValueRecordService.editPayStatus(id, payStates);
|
||||
cardValueOrdersService.updateBalance(orderNo,payStatus);
|
||||
//cardValueOrdersService.updateBalance(orderNo,payStatus);
|
||||
CardValueRecord byId = cardValueRecordService.getById(id);
|
||||
receiveParameter.setType("3");
|
||||
if (byId.getMtUserId() != null) {
|
||||
@ -449,13 +414,12 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
this.insertAllOrderInfo(receiveParameter, payStatus,discountAmount,payChannel,merchantConfig);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(merchantConfig)) {
|
||||
|
||||
//添加配置记录信息
|
||||
MerchantConfigRecord merchantConfigRecord = new MerchantConfigRecord();
|
||||
merchantConfigRecord.setMerchantId(merchantConfig.getId());
|
||||
if (payStatus.equals("paid")) {
|
||||
merchantConfigRecord.setIsSuccess("yes");
|
||||
} else {
|
||||
}else {
|
||||
merchantConfigRecord.setIsSuccess("no");
|
||||
}
|
||||
merchantConfigRecord.setAmount(allAmount / 100.0);
|
||||
|
@ -64,6 +64,10 @@ public class CommissionRecord extends BaseEntity {
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String roleId;
|
||||
/**
|
||||
* 提成卡来源:油品非油品
|
||||
*/
|
||||
private String commissionSource;
|
||||
|
||||
}
|
||||
|
||||
|
@ -96,4 +96,10 @@ public interface CommissionRecordService {
|
||||
* @param storeId 店铺id
|
||||
*/
|
||||
void addRefundRecord(String orderNo,String type,Integer staffId,Integer storeId);
|
||||
|
||||
/**
|
||||
* 添加提成记录信息
|
||||
* @param orderId 订单id
|
||||
*/
|
||||
void addRecord(Integer orderId);
|
||||
}
|
||||
|
@ -1,16 +1,26 @@
|
||||
package com.fuint.business.commission.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.commission.entity.CommissionRecord;
|
||||
import com.fuint.business.commission.entity.StaffCommission;
|
||||
import com.fuint.business.commission.mapper.CommissionRecordMapper;
|
||||
import com.fuint.business.commission.mapper.StaffCommissionMapper;
|
||||
import com.fuint.business.commission.service.CommissionRecordService;
|
||||
import com.fuint.business.commission.vo.CommissionRecordVo;
|
||||
import com.fuint.business.commission.vo.StaffPercentageVo;
|
||||
import com.fuint.business.member.entity.LJStaff;
|
||||
import com.fuint.business.member.service.ILJStaffService;
|
||||
import com.fuint.business.order.entity.AllOrderInfo;
|
||||
import com.fuint.business.order.entity.OilOrder;
|
||||
import com.fuint.business.order.mapper.AllOrderInfoMapper;
|
||||
import com.fuint.business.order.mapper.OilOrderMapper;
|
||||
import com.fuint.repository.mapper.NewMtStaffMapper;
|
||||
import com.fuint.repository.model.NewMtStaff;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
@ -18,12 +28,8 @@ import io.lettuce.core.dynamic.annotation.Param;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 提成记录表(CommissionRecord)表服务实现类
|
||||
@ -37,6 +43,14 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
|
||||
private CommissionRecordMapper commissionRecordMapper;
|
||||
@Autowired
|
||||
private ILJStaffService staffService;
|
||||
@Autowired
|
||||
private AllOrderInfoMapper allOrderInfoMapper;
|
||||
@Autowired
|
||||
private NewMtStaffMapper newMtStaffMapper;
|
||||
@Autowired
|
||||
private StaffCommissionMapper staffCommissionMapper;
|
||||
@Autowired
|
||||
private OilOrderMapper oilOrderMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
@ -53,7 +67,7 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
|
||||
* 分页查询
|
||||
*
|
||||
* @param commissionRecord 筛选条件
|
||||
* @param page 分页对象
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
@ -64,15 +78,15 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String,Object> selectStaffCommissionList(Page page, CommissionRecord commissionRecord) {
|
||||
Map<String,Object> resMap = new HashMap<>();
|
||||
public Map<String, Object> selectStaffCommissionList(Page page, CommissionRecord commissionRecord) {
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LJStaff staff = new LJStaff();
|
||||
staff.setStoreId(nowAccountInfo.getStoreId());
|
||||
staff.setId(commissionRecord.getStaffId());
|
||||
staff.setRoleId(commissionRecord.getRoleId());
|
||||
IPage<LJStaff> ljStaffIPage = staffService.selectStaffList(page, staff);
|
||||
if (ObjectUtil.isNotEmpty(ljStaffIPage)){
|
||||
if (ObjectUtil.isNotEmpty(ljStaffIPage)) {
|
||||
List<StaffPercentageVo> list = new ArrayList<>();
|
||||
for (LJStaff record : ljStaffIPage.getRecords()) {
|
||||
StaffPercentageVo staffPercentageVo = new StaffPercentageVo();
|
||||
@ -95,8 +109,8 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
|
||||
staffPercentageVo.setOilStorageRecharge(commissionRecordMapper.selectAllCommissIon(commissionRecord));
|
||||
list.add(staffPercentageVo);
|
||||
}
|
||||
resMap.put("records",list);
|
||||
resMap.put("total",ljStaffIPage.getTotal());
|
||||
resMap.put("records", list);
|
||||
resMap.put("total", ljStaffIPage.getTotal());
|
||||
}
|
||||
|
||||
return resMap;
|
||||
@ -151,12 +165,12 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
|
||||
@Override
|
||||
public int insertRecord(CommissionRecord commissionRecord) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("staff_id",commissionRecord.getStaffId());
|
||||
queryWrapper.eq("store_id",commissionRecord.getStoreId());
|
||||
queryWrapper.eq("type",commissionRecord.getType());
|
||||
queryWrapper.eq("order_no",commissionRecord.getOrderNo());
|
||||
queryWrapper.eq("staff_id", commissionRecord.getStaffId());
|
||||
queryWrapper.eq("store_id", commissionRecord.getStoreId());
|
||||
queryWrapper.eq("type", commissionRecord.getType());
|
||||
queryWrapper.eq("order_no", commissionRecord.getOrderNo());
|
||||
CommissionRecord commissionRecord1 = commissionRecordMapper.selectOne(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(commissionRecord1)){
|
||||
if (ObjectUtil.isNotEmpty(commissionRecord1)) {
|
||||
return 0;
|
||||
}
|
||||
return commissionRecordMapper.insert(commissionRecord);
|
||||
@ -179,14 +193,14 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
|
||||
@Override
|
||||
public void addRefundRecord(String orderNo, String type, Integer staffId, Integer storeId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("staff_id",staffId);
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("type",type);
|
||||
queryWrapper.eq("order_no",orderNo);
|
||||
queryWrapper.eq("staff_id", staffId);
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
queryWrapper.eq("type", type);
|
||||
queryWrapper.eq("order_no", orderNo);
|
||||
CommissionRecord commissionRecord = commissionRecordMapper.selectOne(queryWrapper);
|
||||
if (ObjectUtil.isNotEmpty(commissionRecord) && ObjectUtil.isNotEmpty(commissionRecord.getAmount())){
|
||||
if (ObjectUtil.isNotEmpty(commissionRecord) && ObjectUtil.isNotEmpty(commissionRecord.getAmount())) {
|
||||
CommissionRecord record = new CommissionRecord();
|
||||
if (type.equals("1")){
|
||||
if (type.equals("1")) {
|
||||
record.setType("4");
|
||||
record.setStaffId(staffId);
|
||||
record.setStoreId(storeId);
|
||||
@ -195,7 +209,7 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
|
||||
record.setAmount(-commissionRecord.getAmount());
|
||||
commissionRecordMapper.insert(record);
|
||||
}
|
||||
if (type.equals("2")){
|
||||
if (type.equals("2")) {
|
||||
record.setType("5");
|
||||
record.setStaffId(staffId);
|
||||
record.setStoreId(storeId);
|
||||
@ -206,4 +220,189 @@ public class CommissionRecordServiceImpl implements CommissionRecordService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加提成记录信息
|
||||
* @param orderId 订单id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void addRecord(Integer orderId) {
|
||||
//查询订单信息
|
||||
AllOrderInfo allOrderInfo = allOrderInfoMapper.selectById(orderId);
|
||||
Integer storeId = allOrderInfo.getStoreId();
|
||||
Integer staffId = allOrderInfo.getStaffId();
|
||||
//根据员工id查询用户角色
|
||||
NewMtStaff newMtStaff = newMtStaffMapper.selectById(staffId);
|
||||
if (ObjectUtil.isNull(newMtStaff)) {
|
||||
throw new RuntimeException("员工不存在");
|
||||
}
|
||||
String roleId = newMtStaff.getRoleId();
|
||||
//查询对应的提成策略
|
||||
List<StaffCommission> staffCommissions = staffCommissionMapper.selectList(new LambdaQueryWrapper<StaffCommission>()
|
||||
.eq(StaffCommission::getStoreId, storeId)
|
||||
.eq(StaffCommission::getStatus, "qy"));
|
||||
//判断是否是油品与商品混合订单
|
||||
if (allOrderInfo.getType().equals("6")){
|
||||
//查询油品订单信息
|
||||
OilOrder oilOrder = oilOrderMapper.selectOne(new LambdaQueryWrapper<OilOrder>()
|
||||
.eq(OilOrder::getOrderNo, allOrderInfo.getOrderNo()));
|
||||
//查询策略
|
||||
//油品策略
|
||||
StaffCommission staffCommissionOil = new StaffCommission();
|
||||
//商品策略
|
||||
StaffCommission staffCommissionProduct = new StaffCommission();
|
||||
for (StaffCommission staffCommission1 : staffCommissions) {
|
||||
String[] split = staffCommission1.getStaffRoleGroup().split(",");
|
||||
if (Arrays.asList(split).contains(roleId)){
|
||||
if (staffCommission1.getClassify().equals("0")) {
|
||||
staffCommissionOil = staffCommission1;
|
||||
}else if (staffCommission1.getClassify().equals("1")) {
|
||||
staffCommissionProduct = staffCommission1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(staffCommissionOil)) {
|
||||
//添加油品提成记录表
|
||||
CommissionRecord record = new CommissionRecord();
|
||||
record.setStoreId(storeId);
|
||||
record.setStaffId(staffId);
|
||||
record.setOrderNo(allOrderInfo.getOrderNo());
|
||||
record.setDescription("订单支付金额:" + oilOrder.getPayAmount());
|
||||
record.setCreateTime(DateUtil.date());
|
||||
record.setCommissionSource(staffCommissionOil.getCommissionSource());
|
||||
record.setCreateBy(TokenUtil.getNowAccountInfo().getId().toString());
|
||||
|
||||
//计算油品提成金额
|
||||
//判断提成类型
|
||||
Double royaltyRate = Double.valueOf(staffCommissionOil.getRoyaltyRate().substring(0, staffCommissionOil.getRoyaltyRate().length() - 1));
|
||||
String unit = staffCommissionOil.getRoyaltyRate().substring(staffCommissionOil.getRoyaltyRate().length() - 1);
|
||||
//按照订单金额计算提成
|
||||
if (staffCommissionOil.getType().equals("orderAmount")) {
|
||||
compute(oilOrder.getOrderAmount(), staffCommissionOil, unit, record, royaltyRate);
|
||||
}
|
||||
//按照实付金额计算提成
|
||||
else if (staffCommissionOil.getType().equals("payAmount")){
|
||||
compute(oilOrder.getPayAmount(), staffCommissionOil, unit, record, royaltyRate);
|
||||
}
|
||||
oilOrder.setCommissionAmount(record.getAmount());
|
||||
commissionRecordMapper.insert(record);
|
||||
oilOrderMapper.updateById(oilOrder);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(staffCommissionProduct)) {
|
||||
//添加商品提成记录表
|
||||
CommissionRecord commissionRecordProduct = new CommissionRecord();
|
||||
commissionRecordProduct.setStoreId(storeId);
|
||||
commissionRecordProduct.setStaffId(staffId);
|
||||
commissionRecordProduct.setOrderNo(allOrderInfo.getOrderNo());
|
||||
commissionRecordProduct.setCreateTime(DateUtil.date());
|
||||
commissionRecordProduct.setCreateBy(TokenUtil.getNowAccountInfo().getId().toString());
|
||||
commissionRecordProduct.setCommissionSource(staffCommissionProduct.getCommissionSource());
|
||||
|
||||
//计算商品提成金额
|
||||
//判断提成类型
|
||||
Double royaltyRateProduct = Double.valueOf(staffCommissionProduct.getRoyaltyRate().substring(0, staffCommissionProduct.getRoyaltyRate().length() - 1));
|
||||
String unitProduct = staffCommissionProduct.getRoyaltyRate().substring(staffCommissionProduct.getRoyaltyRate().length() - 1);
|
||||
//按照订单金额计算提成
|
||||
double amountProduct = allOrderInfo.getGoodsMoney() - oilOrder.getOrderAmount();
|
||||
double payAmountProduct = allOrderInfo.getPayMoney() - oilOrder.getPayAmount();
|
||||
commissionRecordProduct.setDescription("订单支付金额:" + payAmountProduct);
|
||||
if (staffCommissionProduct.getType().equals("orderAmount")) {
|
||||
compute(amountProduct, staffCommissionProduct, unitProduct, commissionRecordProduct, royaltyRateProduct);
|
||||
}
|
||||
//按照实付金额计算提成
|
||||
else if (staffCommissionProduct.getType().equals("payAmount")) {
|
||||
compute(payAmountProduct, staffCommissionProduct, unitProduct, commissionRecordProduct, royaltyRateProduct);
|
||||
}
|
||||
commissionRecordMapper.insert(commissionRecordProduct);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
StaffCommission staffCommission = new StaffCommission();
|
||||
String type = "";
|
||||
switch (allOrderInfo.getType()) {
|
||||
case "1":
|
||||
type = "0";
|
||||
break;
|
||||
case "2":
|
||||
type = "1";
|
||||
break;
|
||||
case "3":
|
||||
type = "3";
|
||||
break;
|
||||
case "5":
|
||||
type = "3";
|
||||
break;
|
||||
}
|
||||
for (StaffCommission staffCommission1 : staffCommissions) {
|
||||
String[] split = staffCommission1.getStaffRoleGroup().split(",");
|
||||
if (Arrays.asList(split).contains(roleId)){
|
||||
if (staffCommission1.getClassify().equals(type)) {
|
||||
staffCommission = staffCommission1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(staffCommission)) {
|
||||
//添加提成记录表
|
||||
CommissionRecord record = new CommissionRecord();
|
||||
record.setStoreId(storeId);
|
||||
record.setStaffId(staffId);
|
||||
record.setOrderNo(allOrderInfo.getOrderNo());
|
||||
record.setDescription("订单支付金额:" + allOrderInfo.getPayMoney());
|
||||
record.setCreateTime(DateUtil.date());
|
||||
record.setCreateBy(TokenUtil.getNowAccountInfo().getId().toString());
|
||||
record.setCommissionSource(staffCommission.getCommissionSource());
|
||||
//判断类型
|
||||
switch(allOrderInfo.getType()){
|
||||
case "1":
|
||||
record.setType("1");
|
||||
break;
|
||||
case "2":
|
||||
record.setType("2");
|
||||
break;
|
||||
case "3":
|
||||
record.setType("3");
|
||||
break;
|
||||
case "5":
|
||||
record.setType("6");
|
||||
break;
|
||||
}
|
||||
//计算员工提成金额
|
||||
//判断提成类型
|
||||
Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
//按照订单金额计算提成
|
||||
if (staffCommission.getType().equals("orderAmount")) {
|
||||
compute(allOrderInfo.getGoodsMoney(), staffCommission, unit, record, royaltyRate);
|
||||
}
|
||||
//按照实付金额计算提成
|
||||
else if (staffCommission.getType().equals("payAmount")){
|
||||
compute(allOrderInfo.getPayMoney(), staffCommission, unit, record, royaltyRate);
|
||||
}
|
||||
commissionRecordMapper.insert(record);
|
||||
//如果是油品订单,则更新油品订单的提成金额
|
||||
if (allOrderInfo.getType().equals("1")) {
|
||||
OilOrder oilOrder = oilOrderMapper.selectOne(new LambdaQueryWrapper<OilOrder>()
|
||||
.eq(OilOrder::getOrderNo, allOrderInfo.getOrderNo()));
|
||||
if (ObjectUtil.isNotEmpty(oilOrder)) {
|
||||
oilOrder.setCommissionAmount(record.getAmount());
|
||||
}
|
||||
oilOrderMapper.updateById(oilOrder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void compute(Double allOrderInfo, StaffCommission staffCommission, String unit, CommissionRecord record, Double royaltyRate) {
|
||||
if (allOrderInfo >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
record.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
record.setAmount(allOrderInfo * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.business.commission.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -14,6 +15,8 @@ import com.fuint.business.commission.vo.StaffCommissionVo;
|
||||
import com.fuint.business.member.entity.LJStaff;
|
||||
import com.fuint.business.member.service.ILJDutyService;
|
||||
import com.fuint.business.member.service.ILJStaffService;
|
||||
import com.fuint.business.order.entity.AllOrderInfo;
|
||||
import com.fuint.business.order.mapper.AllOrderInfoMapper;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.system.role.entity.TDuty;
|
||||
@ -33,6 +36,8 @@ import java.util.*;
|
||||
public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMapper, StaffCommission> implements StaffCommissionService {
|
||||
@Autowired
|
||||
private ILJDutyService dutyService;
|
||||
@Autowired
|
||||
private AllOrderInfoMapper allOrderInfoMapper;
|
||||
|
||||
@Override
|
||||
public IPage<StaffCommissionVo> selectCommissionList(Page page, StaffCommission commission) {
|
||||
@ -41,13 +46,13 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
||||
commission.setStoreId(storeId);
|
||||
IPage<StaffCommissionVo> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
|
||||
for (StaffCommissionVo record : staffCommissionIPage.getRecords()) {
|
||||
List<TDuty> tDuties = dutyService.selectDutyPage(new Page<>(1,10000),new TDuty()).getRecords();
|
||||
List<TDuty> tDuties = dutyService.selectDutyPage(new Page<>(1, 10000), new TDuty()).getRecords();
|
||||
String[] staffRoleGroup = record.getStaffRoleGroup().split(",");
|
||||
String str = "";
|
||||
for (String staffRole : staffRoleGroup) {
|
||||
for (TDuty tDuty : tDuties) {
|
||||
if (staffRole.equals(tDuty.getDutyId().toString())){
|
||||
str += tDuty.getDutyName()+",";
|
||||
if (staffRole.equals(tDuty.getDutyId().toString())) {
|
||||
str += tDuty.getDutyName() + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -67,10 +72,10 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
queryWrapper.eq("staff_role_group",commission.getStaffRoleGroup());
|
||||
queryWrapper.eq("commission_source",commission.getCommissionSource());
|
||||
queryWrapper.eq("status","qy");
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
queryWrapper.eq("staff_role_group", commission.getStaffRoleGroup());
|
||||
queryWrapper.eq("commission_source", commission.getCommissionSource());
|
||||
queryWrapper.eq("status", "qy");
|
||||
StaffCommission commission1 = baseMapper.selectOne(queryWrapper);
|
||||
return commission1;
|
||||
}
|
||||
@ -85,7 +90,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
||||
StaffCommission staffCommission = this.selectCommissionByRole(commission);
|
||||
int row = 0;
|
||||
// 判断当前店铺是否存在同角色的同一提成方案
|
||||
if (ObjectUtil.isNotEmpty(staffCommission)){
|
||||
if (ObjectUtil.isNotEmpty(staffCommission)) {
|
||||
row = 0;
|
||||
return row;
|
||||
}
|
||||
@ -101,7 +106,7 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
||||
StaffCommission staffCommission = this.selectCommissionByRole(commission);
|
||||
int row = 0;
|
||||
// 判断当前店铺是否存在同角色的同一提成方案
|
||||
if (ObjectUtil.isNotEmpty(staffCommission) && staffCommission.getId()!=commission.getId()){
|
||||
if (ObjectUtil.isNotEmpty(staffCommission) && staffCommission.getId() != commission.getId()) {
|
||||
row = 0;
|
||||
return row;
|
||||
}
|
||||
@ -115,177 +120,180 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
||||
private ILJStaffService staffService;
|
||||
|
||||
@Override
|
||||
public void countStaffCommission(Integer staffId,Integer storeId,Double amount,Double payAmount,String type,String orderNo) {
|
||||
if (ObjectUtil.isNotEmpty(staffId)) {
|
||||
LJStaff staff = staffService.selectStaffById(staffId);
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
queryWrapper.eq("status", "qy");
|
||||
// 查询当前店铺启用的提成方案信息
|
||||
List<StaffCommission> list = baseMapper.selectList(queryWrapper);
|
||||
if (list.size() > 0 && ObjectUtil.isNotEmpty(staff)) {
|
||||
for (StaffCommission staffCommission : list) {
|
||||
CommissionRecord commissionRecord = new CommissionRecord();
|
||||
String[] staffRoleGroups = staffCommission.getStaffRoleGroup().split(",");
|
||||
if (type.equals("1") && staffCommission.getCommissionSource().equals("车主加油")) {
|
||||
for (String staffRoleGroup : staffRoleGroups) {
|
||||
if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
commissionRecord.setStaffId(staffId);
|
||||
commissionRecord.setStoreId(storeId);
|
||||
commissionRecord.setType(type);
|
||||
commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
commissionRecord.setOrderNo(orderNo);
|
||||
Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
// 按照订单金额计算提成
|
||||
if (staffCommission.getType().equals("orderAmount")) {
|
||||
if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
// 按照实付金额计算提成
|
||||
if (staffCommission.getType().equals("payAmount")) {
|
||||
if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
// 按照加油数量计算提成
|
||||
// if (staffCommission.getType().equals("refuleNum")){
|
||||
// if (oilLiters>=Double.valueOf(staffCommission.getMeetCondition())){
|
||||
// if (unit.equals("元")){
|
||||
// commissionRecord.setAmount(royaltyRate);
|
||||
public void countStaffCommission(Integer staffId, Integer storeId, Double amount, Double payAmount, String type, String orderNo) {
|
||||
AllOrderInfo allOrderInfo = allOrderInfoMapper.selectOne(new LambdaQueryWrapper<AllOrderInfo>()
|
||||
.eq(AllOrderInfo::getOrderNo, orderNo));
|
||||
commissionRecordService.addRecord(allOrderInfo.getId());
|
||||
// if (ObjectUtil.isNotEmpty(staffId)) {
|
||||
// LJStaff staff = staffService.selectStaffById(staffId);
|
||||
// QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
// queryWrapper.eq("store_id", storeId);
|
||||
// queryWrapper.eq("status", "qy");
|
||||
//// 查询当前店铺启用的提成方案信息
|
||||
// List<StaffCommission> list = baseMapper.selectList(queryWrapper);
|
||||
// if (list.size() > 0 && ObjectUtil.isNotEmpty(staff)) {
|
||||
// for (StaffCommission staffCommission : list) {
|
||||
// CommissionRecord commissionRecord = new CommissionRecord();
|
||||
// String[] staffRoleGroups = staffCommission.getStaffRoleGroup().split(",");
|
||||
// if (type.equals("1") && staffCommission.getCommissionSource().equals("车主加油")) {
|
||||
// for (String staffRoleGroup : staffRoleGroups) {
|
||||
// if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
// commissionRecord.setStaffId(staffId);
|
||||
// commissionRecord.setStoreId(storeId);
|
||||
// commissionRecord.setType(type);
|
||||
// commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
// commissionRecord.setOrderNo(orderNo);
|
||||
// Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
// String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
//// 按照订单金额计算提成
|
||||
// if (staffCommission.getType().equals("orderAmount")) {
|
||||
// if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
// if (unit.equals("元")) {
|
||||
// commissionRecord.setAmount(royaltyRate);
|
||||
// }
|
||||
// if (unit.equals("%")) {
|
||||
// commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
// }
|
||||
// commissionRecordService.insertRecord(commissionRecord);
|
||||
// }
|
||||
// if (unit.equals("%")){
|
||||
// commissionRecord.setAmount(oilLiters*(royaltyRate/100));
|
||||
// }
|
||||
// commissionRecordService.insertRecord(commissionRecord);
|
||||
// }
|
||||
//// 按照实付金额计算提成
|
||||
// if (staffCommission.getType().equals("payAmount")) {
|
||||
// if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
// if (unit.equals("元")) {
|
||||
// commissionRecord.setAmount(royaltyRate);
|
||||
// }
|
||||
// if (unit.equals("%")) {
|
||||
// commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
// }
|
||||
// commissionRecordService.insertRecord(commissionRecord);
|
||||
// }
|
||||
// }
|
||||
//// 按照加油数量计算提成
|
||||
//// if (staffCommission.getType().equals("refuleNum")){
|
||||
//// if (oilLiters>=Double.valueOf(staffCommission.getMeetCondition())){
|
||||
//// if (unit.equals("元")){
|
||||
//// commissionRecord.setAmount(royaltyRate);
|
||||
//// }
|
||||
//// if (unit.equals("%")){
|
||||
//// commissionRecord.setAmount(oilLiters*(royaltyRate/100));
|
||||
//// }
|
||||
//// commissionRecordService.insertRecord(commissionRecord);
|
||||
//// }
|
||||
//// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type.equals("2") && staffCommission.getCommissionSource().equals("非油品")) {
|
||||
for (String staffRoleGroup : staffRoleGroups) {
|
||||
if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
commissionRecord.setStaffId(staffId);
|
||||
commissionRecord.setStoreId(storeId);
|
||||
commissionRecord.setType(type);
|
||||
commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
commissionRecord.setOrderNo(orderNo);
|
||||
Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
// 按照订单金额计算提成
|
||||
if (staffCommission.getType().equals("orderAmount")) {
|
||||
if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 按照实付金额计算提成
|
||||
if (staffCommission.getType().equals("payAmount")) {
|
||||
if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type.equals("3") && staffCommission.getCommissionSource().equals("电子储值卡充值")) {
|
||||
for (String staffRoleGroup : staffRoleGroups) {
|
||||
if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
commissionRecord.setStaffId(staffId);
|
||||
commissionRecord.setStoreId(storeId);
|
||||
commissionRecord.setType(type);
|
||||
commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
commissionRecord.setOrderNo(orderNo);
|
||||
Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
// 按照订单金额计算提成
|
||||
if (staffCommission.getType().equals("orderAmount")) {
|
||||
if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 按照实付金额计算提成
|
||||
if (staffCommission.getType().equals("payAmount")) {
|
||||
if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type.equals("4") && staffCommission.getCommissionSource().equals("电子囤油卡充值")) {
|
||||
for (String staffRoleGroup : staffRoleGroups) {
|
||||
if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
commissionRecord.setStaffId(staffId);
|
||||
commissionRecord.setStoreId(storeId);
|
||||
commissionRecord.setType(type);
|
||||
commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
commissionRecord.setOrderNo(orderNo);
|
||||
Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
// 按照订单金额计算提成
|
||||
if (staffCommission.getType().equals("orderAmount")) {
|
||||
if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 按照实付金额计算提成
|
||||
if (staffCommission.getType().equals("payAmount")) {
|
||||
if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
// if (type.equals("2") && staffCommission.getCommissionSource().equals("非油品")) {
|
||||
// for (String staffRoleGroup : staffRoleGroups) {
|
||||
// if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
// commissionRecord.setStaffId(staffId);
|
||||
// commissionRecord.setStoreId(storeId);
|
||||
// commissionRecord.setType(type);
|
||||
// commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
// commissionRecord.setOrderNo(orderNo);
|
||||
// Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
// String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
//// 按照订单金额计算提成
|
||||
// if (staffCommission.getType().equals("orderAmount")) {
|
||||
// if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
// if (unit.equals("元")) {
|
||||
// commissionRecord.setAmount(royaltyRate);
|
||||
// }
|
||||
// if (unit.equals("%")) {
|
||||
// commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//// 按照实付金额计算提成
|
||||
// if (staffCommission.getType().equals("payAmount")) {
|
||||
// if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
// if (unit.equals("元")) {
|
||||
// commissionRecord.setAmount(royaltyRate);
|
||||
// }
|
||||
// if (unit.equals("%")) {
|
||||
// commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// commissionRecordService.insertRecord(commissionRecord);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (type.equals("3") && staffCommission.getCommissionSource().equals("电子储值卡充值")) {
|
||||
// for (String staffRoleGroup : staffRoleGroups) {
|
||||
// if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
// commissionRecord.setStaffId(staffId);
|
||||
// commissionRecord.setStoreId(storeId);
|
||||
// commissionRecord.setType(type);
|
||||
// commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
// commissionRecord.setOrderNo(orderNo);
|
||||
// Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
// String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
//// 按照订单金额计算提成
|
||||
// if (staffCommission.getType().equals("orderAmount")) {
|
||||
// if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
// if (unit.equals("元")) {
|
||||
// commissionRecord.setAmount(royaltyRate);
|
||||
// }
|
||||
// if (unit.equals("%")) {
|
||||
// commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//// 按照实付金额计算提成
|
||||
// if (staffCommission.getType().equals("payAmount")) {
|
||||
// if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
// if (unit.equals("元")) {
|
||||
// commissionRecord.setAmount(royaltyRate);
|
||||
// }
|
||||
// if (unit.equals("%")) {
|
||||
// commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// commissionRecordService.insertRecord(commissionRecord);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (type.equals("4") && staffCommission.getCommissionSource().equals("电子囤油卡充值")) {
|
||||
// for (String staffRoleGroup : staffRoleGroups) {
|
||||
// if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
// commissionRecord.setStaffId(staffId);
|
||||
// commissionRecord.setStoreId(storeId);
|
||||
// commissionRecord.setType(type);
|
||||
// commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
// commissionRecord.setOrderNo(orderNo);
|
||||
// Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
// String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
//// 按照订单金额计算提成
|
||||
// if (staffCommission.getType().equals("orderAmount")) {
|
||||
// if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
// if (unit.equals("元")) {
|
||||
// commissionRecord.setAmount(royaltyRate);
|
||||
// }
|
||||
// if (unit.equals("%")) {
|
||||
// commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//// 按照实付金额计算提成
|
||||
// if (staffCommission.getType().equals("payAmount")) {
|
||||
// if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
// if (unit.equals("元")) {
|
||||
// commissionRecord.setAmount(royaltyRate);
|
||||
// }
|
||||
// if (unit.equals("%")) {
|
||||
// commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// commissionRecordService.insertRecord(commissionRecord);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
<select id="getByStoreId" resultMap="IntegralSettingsMap">
|
||||
select
|
||||
id, refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_time, update_time, create_by, update_by, chain_store_id
|
||||
id, refuel_points_rules, refuel_points_function, refuel_scene_type, refuel_amount_type, refuel_value_participation, refuel_scene_rules, refuel_consumption_amount, refuel_points, refuel_fuel_amount, refuel_fuel_volume, recharge_give, invite_give, invite_give_rules, sign_in_function, sign_in_rules, points_obtained, points_rules, store_id, create_time, update_time, create_by, update_by, chain_store_id, sign_applicable_rules, sign_cycle
|
||||
from integral_settings
|
||||
where store_id = #{storeId}
|
||||
</select>
|
||||
|
@ -2,6 +2,7 @@ package com.fuint.business.integral.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralDetail;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralSettings;
|
||||
import com.fuint.business.integral.vo.IntegralSettingsVo;
|
||||
@ -71,7 +72,7 @@ public interface IntegralSettingsService {
|
||||
|
||||
Integer todayIsSignIn(Integer storeId);
|
||||
|
||||
IntegralSettings signInFunction(IntegralSettings integralSettings);
|
||||
IntegralDetail signInFunction(IntegralSettings integralSettings);
|
||||
|
||||
/**
|
||||
* 加油赠送积分
|
||||
|
@ -248,7 +248,7 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public IntegralSettings signInFunction(IntegralSettings integralSettings) {
|
||||
public IntegralDetail signInFunction(IntegralSettings integralSettings) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
Integer integer = todayIsSignIn(integralSettings.getStoreId());
|
||||
@ -286,7 +286,7 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
List<IntegralDetail> signInGifts = integralDetailMapper.signInGiftsYesterday("签到赠送", ljUserVos.getId(), ljUserVos.getChainStoreId());
|
||||
|
||||
if (ObjectUtil.isEmpty(signInGifts)) {
|
||||
extracted(ljUserVos, jsonArray, 0);
|
||||
return extracted(integralSetting, ljUserVos, jsonArray, 0);
|
||||
} else {
|
||||
String changeReason = signInGifts.get(0).getChangeReason();
|
||||
|
||||
@ -310,7 +310,7 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
// if (dayInt > 8 && 8< jsonArray.size()) {
|
||||
// extracted(ljUserVos, jsonArray, dayInt);
|
||||
// } else if (dayInt >= 1 && dayInt <= jsonArray.size()) {
|
||||
extracted(ljUserVos, jsonArray, dayInt);
|
||||
return extracted(integralSetting, ljUserVos, jsonArray, dayInt);
|
||||
// }
|
||||
}
|
||||
}
|
||||
@ -366,13 +366,13 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
integralSettingsList.add(integralSettings1);
|
||||
}
|
||||
integralSettingsVo.setIntegralSettings(integralSettingsList);
|
||||
}else if (integralSettings.getSignApplicableRules() == 1) {
|
||||
} else if (integralSettings.getSignApplicableRules() == 1) {
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
String day = jsonArray.getJSONObject(i).get("day").toString();
|
||||
Integer points = Integer.parseInt(jsonArray.getJSONObject(i).get("integral").toString());
|
||||
IntegralSettingsBo integralSettings1 = new IntegralSettingsBo();
|
||||
// integralSettings1.setIntegralName(day);
|
||||
integralSettings1.setIntegralName("第" +( i + 1 )+ "天");
|
||||
integralSettings1.setIntegralName("第" + (i + 1) + "天");
|
||||
integralSettings1.setIntegral(points);
|
||||
integralSettingsList.add(integralSettings1);
|
||||
}
|
||||
@ -391,24 +391,27 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
|
||||
// if (CollUtil.isNotEmpty(day)) {
|
||||
// IntegralDetail integralDetail = day.get(0);
|
||||
if (ObjectUtil.isNotEmpty(integralDetail)) {
|
||||
// 正则表达式,匹配数字
|
||||
Pattern pattern = Pattern.compile("\\d+");
|
||||
Matcher matcher = pattern.matcher(integralDetail.getChangeReason());
|
||||
StringBuilder numbers = new StringBuilder();
|
||||
numbers.append(0);
|
||||
while (matcher.find()) {
|
||||
numbers.append(matcher.group());
|
||||
}
|
||||
if (StrUtil.isEmpty(numbers)) {
|
||||
integralSettingsVo.setSignInDays("0");
|
||||
}
|
||||
String str = numbers.toString();
|
||||
if (Integer.parseInt(str) >= 10) {
|
||||
numbers.deleteCharAt(0);
|
||||
}
|
||||
integralSettingsVo.setSignInDays(numbers.toString());
|
||||
} else {
|
||||
if (ObjectUtil.isNotEmpty(integralDetail)) {
|
||||
// 正则表达式,匹配数字
|
||||
Pattern pattern = Pattern.compile("\\d+");
|
||||
Matcher matcher = pattern.matcher(integralDetail.getChangeReason());
|
||||
StringBuilder numbers = new StringBuilder();
|
||||
StringBuilder classColor = new StringBuilder();
|
||||
numbers.append(0);
|
||||
while (matcher.find()) {
|
||||
numbers.append(matcher.group());
|
||||
classColor.append(matcher.group());
|
||||
}
|
||||
if (StrUtil.isEmpty(numbers)) {
|
||||
integralSettingsVo.setSignInDays("0");
|
||||
}
|
||||
String str = numbers.toString();
|
||||
if (Integer.parseInt(str) >= 10) {
|
||||
numbers.deleteCharAt(0);
|
||||
}
|
||||
integralSettingsVo.setSignInDays(numbers.toString());
|
||||
integralSettingsVo.setClassColor(Integer.parseInt(classColor.toString()));
|
||||
} else {
|
||||
integralSettingsVo.setSignInDays("0");
|
||||
}
|
||||
// }
|
||||
@ -471,17 +474,48 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
}
|
||||
}
|
||||
|
||||
private void extracted(LJUserVo ljUserVos, JSONArray jsonArray, int dayInt) {
|
||||
private IntegralDetail extracted(IntegralSettings integralSetting, LJUserVo ljUserVos, JSONArray jsonArray, int dayInt) {
|
||||
IntegralDetail integralDetail = new IntegralDetail();
|
||||
integralDetail.setStoreId(ljUserVos.getStoreId());
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
if (dayInt >= 8) {
|
||||
jsonObject = jsonArray.getJSONObject(7);
|
||||
//判断有没有规则
|
||||
if (integralSetting.getSignApplicableRules() == 0) {
|
||||
jsonObject = jsonArray.getJSONObject(0);
|
||||
} else if (integralSetting.getSignApplicableRules() == 1) {
|
||||
switch (integralSetting.getSignCycle()) {
|
||||
case 0:
|
||||
// System.out.println("dayInt: " + dayInt);
|
||||
// System.out.println("jsonArray size: " + jsonArray.size());
|
||||
|
||||
} else {
|
||||
jsonObject = jsonArray.getJSONObject(dayInt);
|
||||
if (dayInt >= 7) {
|
||||
jsonObject = jsonArray.getJSONObject(6);
|
||||
} else {
|
||||
jsonObject = jsonArray.getJSONObject(dayInt);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (dayInt >= 14) {
|
||||
jsonObject = jsonArray.getJSONObject(13);
|
||||
}else {
|
||||
jsonObject = jsonArray.getJSONObject(dayInt);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (dayInt >= 30) {
|
||||
jsonObject = jsonArray.getJSONObject(29);
|
||||
}else {
|
||||
jsonObject = jsonArray.getJSONObject(dayInt);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if (dayInt >= 8) {
|
||||
// jsonObject = jsonArray.getJSONObject(7);
|
||||
//
|
||||
// } else {
|
||||
// jsonObject = jsonArray.getJSONObject(dayInt);
|
||||
// }
|
||||
|
||||
Map<String, Object> map = new HashMap<>(jsonObject);
|
||||
|
||||
@ -508,5 +542,6 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
userBalance.setId(ljUserVos.getBalanceId());
|
||||
userBalance.setPoints(addPoints.intValue());
|
||||
userBalanceService.updateUserBalance(userBalance);
|
||||
return integralDetail;
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import java.util.List;
|
||||
public class IntegralSettingsVo{
|
||||
private String signInDays;
|
||||
private List<IntegralSettingsBo> integralSettings;
|
||||
private Integer classColor;
|
||||
|
||||
|
||||
}
|
||||
|
@ -175,5 +175,16 @@ public class ActiveAppletController extends BaseController {
|
||||
public ResponseObject editStatus(@PathVariable Integer id) {
|
||||
return getSuccessResult(activeAppletService.updateActiveStatus(id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 根据storeId查询邀请有礼活动(小程序)
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getRecommendedByStoreId")
|
||||
public ResponseObject getRecommendedByStoreId(Integer storeId){
|
||||
return getSuccessResult(activeAppletService.selectByStoreId(storeId));
|
||||
}
|
||||
}
|
||||
|
@ -61,5 +61,13 @@ public interface ActiveAppletService extends IService<ActiveApplet> {
|
||||
* @return
|
||||
*/
|
||||
ActiveApplet selectByActiveId(Integer activeId,String type);
|
||||
|
||||
/**
|
||||
*
|
||||
* 根据storeId查询邀请有礼信息
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
ActiveApplet selectByStoreId(Integer storeId);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
package com.fuint.business.marketingActivity.activeApplet.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -25,6 +28,7 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -199,6 +203,43 @@ public class ActiveAppletServiceImpl extends ServiceImpl<ActiveAppletMapper, Act
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据storeId查询邀请有礼信息
|
||||
*
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ActiveApplet selectByStoreId(Integer storeId) {
|
||||
ActiveApplet activeApplet = baseMapper.selectOne(new LambdaQueryWrapper<ActiveApplet>()
|
||||
.eq(ActiveApplet::getStoreId, storeId)
|
||||
.eq(ActiveApplet::getType, "7")
|
||||
.eq(ActiveApplet::getIsonline, "0")
|
||||
.eq(ActiveApplet::getActiveStatus, "1"));
|
||||
if (activeApplet != null) {
|
||||
if (!"1".equals(activeApplet.getTime())) {
|
||||
return activeApplet;
|
||||
}else {
|
||||
DateTime now = DateUtil.date();
|
||||
Date activeStartTime = activeApplet.getActiveStartTime();
|
||||
Date activeEndTime = activeApplet.getActiveEndTime();
|
||||
//判断当前时间是否在活动时间范围内
|
||||
boolean timeBetween = isTimeBetween(activeStartTime, activeEndTime, now);
|
||||
if (timeBetween) {
|
||||
return activeApplet;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean isTimeBetween(Date activeStartTime, Date activeEndTime, DateTime now) {
|
||||
if (now.isAfterOrEquals(activeStartTime) && now.isBeforeOrEquals(activeEndTime)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型转换
|
||||
*
|
||||
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.api.ApiController;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponService;
|
||||
import com.fuint.business.marketingActivity.cardGiftActive.entity.CardGiftActive;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilName;
|
||||
@ -214,6 +215,13 @@ public class CardCouponController extends BaseController {
|
||||
return getSuccessResult(this.cardCouponService.selectAllByPageAndStoreId(page, cardCoupon));
|
||||
|
||||
}
|
||||
@PostMapping("/sendCoupon")
|
||||
public ResponseObject sendCoupon(@RequestBody CardCouponUser cardCouponUser) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
cardCouponUser.setStoreId(nowAccountInfo.getStoreId());
|
||||
cardCouponUser.setChainStoreId(nowAccountInfo.getChainStoreId());
|
||||
return getSuccessResult(cardCouponService.sendCoupon(cardCouponUser));
|
||||
}
|
||||
|
||||
// @GetMapping("getCouponOne")
|
||||
// public ResponseObject getCouponOne(Integer id) {
|
||||
|
@ -30,7 +30,7 @@ public class CardCouponUser extends Model<CardCouponUser> {
|
||||
private Integer mtUserId;
|
||||
//会员手机号码
|
||||
private String mobile;
|
||||
//来源类型 1储值卡2囤油卡....
|
||||
//来源类型 1储值卡2囤油卡 3消费有礼赠送4收银台赠送
|
||||
private String fromType;
|
||||
//活动id
|
||||
private Integer activeId;
|
||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo;
|
||||
|
||||
import java.util.List;
|
||||
@ -27,7 +28,7 @@ public interface CardCouponService extends IService<CardCoupon> {
|
||||
int isOnLine(Integer id);
|
||||
|
||||
IPage selectAllByPageAndStoreId(Page page, CardCoupon cardCoupon);
|
||||
|
||||
int sendCoupon(CardCouponUser cardCouponUser);
|
||||
|
||||
CardCoupon selectOneBuId(Integer id);
|
||||
/**
|
||||
|
@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCoupon;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponMapper;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper;
|
||||
import com.fuint.business.marketingActivity.cardCoupon.service.CardCouponService;
|
||||
@ -20,15 +21,14 @@ import com.fuint.business.petrolStationManagement.entity.OilName;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilNameMapper;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.mapper.MtStoreMapper;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -40,14 +40,12 @@ import java.util.stream.Collectors;
|
||||
@Service("cardCouponService")
|
||||
public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCoupon> implements CardCouponService {
|
||||
|
||||
@Autowired
|
||||
private MtStoreMapper mtStoreMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private CardCouponUserMapper cardCouponUserMapper;
|
||||
|
||||
@Autowired
|
||||
private OilNameMapper oilNameMapper;
|
||||
private LJUserService userService;
|
||||
@Override
|
||||
public IPage<CardCoupon> pageVo(Page page, CardCoupon cardCoupon) {
|
||||
return baseMapper.pageVo( page, cardCoupon);
|
||||
@ -128,6 +126,22 @@ public class CardCouponServiceImpl extends ServiceImpl<CardCouponMapper, CardCou
|
||||
return cardCouponUniVoIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int sendCoupon(CardCouponUser cardCouponUser) {
|
||||
LJUserVo ljUserVo = userService.selectUserById(cardCouponUser.getMtUserId(), cardCouponUser.getStoreId());
|
||||
cardCouponUser.setMobile(ljUserVo.getMobile());
|
||||
//通过优惠卷策略计算 开始时间 结束时间
|
||||
CardCoupon cardCoupon = this.getById(cardCouponUser.getCardCouponId());
|
||||
if (cardCoupon.getTimeType().equals("1")){
|
||||
cardCouponUser.setStartTime(new Date());
|
||||
cardCouponUser.setEndTime(DateUtil.offsetDay(new Date(),cardCoupon.getValidityDay()));
|
||||
}else {
|
||||
cardCouponUser.setStartTime(cardCoupon.getEffectiveDateStart());
|
||||
cardCouponUser.setEndTime(cardCoupon.getEffectiveDateEnd());
|
||||
}
|
||||
return cardCouponUserMapper.insert(cardCouponUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CardCoupon selectOneBuId(Integer id) {
|
||||
return baseMapper.selectById(id);
|
||||
|
@ -47,14 +47,17 @@ import com.fuint.business.order.service.OilBalanceChangeService;
|
||||
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.userManager.entity.MtUserFuel;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.mapper.LJUserMapper;
|
||||
import com.fuint.business.userManager.mapper.UserBalanceMapper;
|
||||
import com.fuint.business.userManager.service.IMtUserFuelService;
|
||||
import com.fuint.business.userManager.service.UserBalanceService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.common.util.RedisLock;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -118,6 +121,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
private StaffCommissionService staffCommissionService;
|
||||
@Resource
|
||||
private CardValueOrdersService cardValueOrdersService;
|
||||
@Resource
|
||||
private IMtUserFuelService userFuelService;
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
@ -188,6 +193,35 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
*/
|
||||
@Override
|
||||
public boolean editPayStatus(Integer id, String payStatus) {
|
||||
//增加用户的余额
|
||||
if (payStatus.equals("paid")){
|
||||
//支付成功的处理 判断当前支付订单是否不是成功
|
||||
CardFuelRecord record = cardFuelRecordMapper.selectById(id);
|
||||
if (StringUtils.isNotEmpty(record.getPayStatus())&&!record.getPayStatus().equals("paid")){
|
||||
return true;
|
||||
}
|
||||
//处理当前用户的余额
|
||||
UserBalance userBalance = userBalanceService.selectUserBalanceByStorId(record.getMtUserId(), record.getStoreId());
|
||||
userBalance.setPoints(userBalance.getPoints()+record.getPoints());
|
||||
//囤油卡数据
|
||||
LambdaQueryWrapper<MtUserFuel> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(MtUserFuel::getMtUserId,record.getMtUserId())
|
||||
.eq(MtUserFuel::getStoreId,record.getStoreId()).eq(MtUserFuel::getOilName,record.getOilNumberId());
|
||||
MtUserFuel mtUserFuel = userFuelService.getOne(queryWrapper);
|
||||
if (ObjectUtils.isNotEmpty(mtUserFuel)){
|
||||
mtUserFuel.setFuelAmount(mtUserFuel.getFuelAmount()+record.getIncomeLitres());
|
||||
}else {
|
||||
mtUserFuel =new MtUserFuel();
|
||||
mtUserFuel.setFuelAmount(record.getIncomeLitres());
|
||||
mtUserFuel.setOilName(String.valueOf(record.getOilNumberId()));
|
||||
mtUserFuel.setMtUserId(record.getMtUserId());
|
||||
mtUserFuel.setStoreId(record.getStoreId());
|
||||
mtUserFuel.setChainStoreId(record.getChainStoreId());
|
||||
|
||||
}
|
||||
userFuelService.saveOrUpdate(mtUserFuel);
|
||||
|
||||
}
|
||||
CardFuelRecord cardFuelRecord = new CardFuelRecord();
|
||||
cardFuelRecord.setId(id);
|
||||
cardFuelRecord.setPayStatus(payStatus);
|
||||
@ -251,15 +285,10 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
Date from = Date.from(instant1);
|
||||
cardFuelRecordDTO.setExpireTime(from);
|
||||
}
|
||||
|
||||
|
||||
|
||||
cardFuelRecordDTO.setExpireTime(cardFuelRecordDTO.getExpireTime());
|
||||
|
||||
if (ObjectUtil.isEmpty(cardFuelRecordDTO.getMtStaffId())) {
|
||||
cardFuelRecordDTO.setMtStaffId(nowAccountInfo.getStaffId());
|
||||
}
|
||||
|
||||
LJStaff ljStaff = iljStaffService.selectStaffById(cardFuelRecordDTO.getMtStaffId());
|
||||
if (ObjectUtil.isNotEmpty(ljStaff)) {
|
||||
cardFuelRecordDTO.setStaffMobile(ljStaff.getMobile());
|
||||
@ -623,7 +652,6 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
if (map.get("code").equals("success")){
|
||||
return JSONObject.parseObject(JSONObject.toJSONString(map.get("data")),ReturnParameter.class);
|
||||
}else {
|
||||
// throw new Exception(map.get("msg").toString());
|
||||
return new ReturnParameter();
|
||||
}
|
||||
}
|
||||
|
@ -60,9 +60,11 @@ import com.fuint.business.order.service.CardBalanceChangeService;
|
||||
import com.fuint.business.order.service.GrowthValueChangeService;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.business.userManager.entity.MtUserGradeChild;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.mapper.LJUserMapper;
|
||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||
import com.fuint.business.userManager.service.MtUserGradeChildService;
|
||||
import com.fuint.business.userManager.service.UserBalanceService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
@ -76,6 +78,7 @@ import com.fuint.repository.model.MtStaff;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.redisson.api.RLock;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -147,6 +150,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
@Resource
|
||||
@Lazy
|
||||
private CardFuelRecordService fuelRecordService;
|
||||
@Autowired
|
||||
private LJUserGradeService userGradeService;
|
||||
|
||||
/**
|
||||
* 储值卡充值(新增)
|
||||
@ -517,8 +522,11 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
}
|
||||
//赠送成长值
|
||||
cardValueRecordDTO.setGrowthValue(Optional.ofNullable(selectCard.getGrowthValue()).orElse(0));
|
||||
if (ObjectUtils.isEmpty(cardValueRecordDTO.getMtStaffId()) || cardValueRecordDTO.getMtStaffId() == 0) {
|
||||
if (ObjectUtils.isEmpty(selectCard.getChooseStaff()) || selectCard.getChooseStaff() == 0) {
|
||||
cardValueRecordDTO.setMtStaffId(nowAccountInfo.getStaffId());
|
||||
cardValueRecordDTO.setRealName(nowAccountInfo.getRealName());
|
||||
LJUserVo ljUserVo1 = ljUserMapper.selectUserById(nowAccountInfo.getId());
|
||||
cardValueRecordDTO.setStaffMobile(ljUserVo1.getMobile());
|
||||
}else {
|
||||
LJStaff staff = mtStaffService.getById(selectCard.getChooseStaff());
|
||||
cardValueRecordDTO.setRealName(staff.getRealName());
|
||||
@ -541,7 +549,6 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
//囤油卡
|
||||
CardFuelRecordDTO cardFuelRecordDTO =new CardFuelRecordDTO();
|
||||
cardFuelRecordDTO.setCardFuelId(selectCard.getSelectCardId());
|
||||
cardFuelRecordDTO.setMtStaffId(ljUserVo.getId());
|
||||
cardFuelRecordDTO.setPayStatus(payStatus);
|
||||
cardFuelRecordDTO.setMtUserId(ljUserVo.getId());
|
||||
cardFuelRecordDTO.setName(ljUserVo.getName());
|
||||
@ -563,10 +570,13 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
|
||||
//赠送积分
|
||||
cardFuelRecordDTO.setPoints(Optional.ofNullable(selectCard.getPoints()).orElse(0));
|
||||
//赠送成长值
|
||||
cardFuelRecordDTO.setGrowthValue(Optional.ofNullable(selectCard.getGrowthValue()).orElse(0));
|
||||
if (ObjectUtils.isEmpty(cardFuelRecordDTO.getMtStaffId()) || cardFuelRecordDTO.getMtStaffId() == 0) {
|
||||
cardFuelRecordDTO.setPaymentType(selectCard.getPaymentType());
|
||||
cardFuelRecordDTO.setPayChannel(selectCard.getPayChannel());
|
||||
if (ObjectUtils.isEmpty(selectCard.getChooseStaff()) || selectCard.getChooseStaff() == 0) {
|
||||
cardFuelRecordDTO.setMtStaffId(nowAccountInfo.getStaffId());
|
||||
cardFuelRecordDTO.setRealName(nowAccountInfo.getRealName());
|
||||
LJUserVo ljUserVo1 = ljUserMapper.selectUserById(nowAccountInfo.getId());
|
||||
cardFuelRecordDTO.setStaffMobile(ljUserVo1.getMobile());
|
||||
}else {
|
||||
LJStaff staff = mtStaffService.getById(selectCard.getChooseStaff());
|
||||
cardFuelRecordDTO.setRealName(staff.getRealName());
|
||||
@ -574,6 +584,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
cardFuelRecordDTO.setStaffMobile(staff.getMobile());
|
||||
}
|
||||
fuelRecordService.insert(cardFuelRecordDTO);
|
||||
orderId = cardFuelRecordDTO.getId();
|
||||
res = JSONObject.parseObject(JSONObject.toJSONString(cardFuelRecordDTO));
|
||||
}
|
||||
|
||||
@ -769,31 +780,21 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
}
|
||||
}catch (Exception e) {
|
||||
redisLock.unlock(lockKey);
|
||||
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//会员等级充值送券
|
||||
giveCoupon(cardValueRecord.getMtUserId(),cardValueRecord.getStoreId(),ljUserVos,ljStaff);
|
||||
|
||||
// 修改订单的处理状态 (避免二次执行)
|
||||
CardValueRecord updateCardValueRecord = new CardValueRecord();
|
||||
updateCardValueRecord.setId(id);
|
||||
updateCardValueRecord.setStatus("1");
|
||||
cardValueRecord.setStatus("1");
|
||||
baseMapper.updateById(updateCardValueRecord);
|
||||
|
||||
|
||||
redisLock.unlock(lockKey);
|
||||
}
|
||||
// else {
|
||||
// return cardValueRecord;
|
||||
// }
|
||||
return cardValueRecord;
|
||||
}
|
||||
//添加余额明细表
|
||||
@ -884,11 +885,30 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
// 成长值变动
|
||||
|
||||
//支付
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean editPayStatus(Integer id, String payStatus) {
|
||||
//增加用户的余额
|
||||
if (payStatus.equals("paid")){
|
||||
//支付成功的处理 判断当前支付订单是否不是成功
|
||||
CardValueRecord record = baseMapper.selectById(id);
|
||||
if (StringUtils.isNotEmpty(record.getPayStatus())&&!record.getPayStatus().equals("paid")){
|
||||
return true;
|
||||
}
|
||||
//处理当前用户的余额
|
||||
UserBalance userBalance = userBalanceService.selectUserBalanceByStorId(record.getMtUserId(), record.getStoreId());
|
||||
userBalance.setCardBalance(userBalance.getCardBalance()+record.getRechargeBalance());
|
||||
userBalance.setGiveAmount(userBalance.getGiveAmount()+record.getGiftBalance());
|
||||
userBalance.setPoints(userBalance.getPoints()+record.getPoints());
|
||||
userBalance.setGrowthValue(userBalance.getGrowthValue()+record.getGrowthValue());
|
||||
userBalance.setRechargeNum(userBalance.getRechargeNum()+1);
|
||||
//处理会员的等级
|
||||
List<LJUserGrade> records = userGradeService.selectUserGradeAll(userBalance.getStoreId());
|
||||
}
|
||||
CardValueRecord cardValueRecord = new CardValueRecord();
|
||||
cardValueRecord.setId(id);
|
||||
cardValueRecord.setPayStatus(payStatus);
|
||||
int i = baseMapper.updateById(cardValueRecord);
|
||||
|
||||
// staffCommissionService.countStaffCommission(cardValueOrders.getStaffId(),cardValueOrders.getStoreId(),cardValueOrders.getAmount(),cardValueOrders.getPayAmount(),"3",cardValueOrders.getOrderNo());
|
||||
return i>0;
|
||||
}
|
||||
|
@ -12,5 +12,5 @@ public class AllOrderInfoDto extends AllOrderInfo {
|
||||
private List<Long> storeIds;
|
||||
private String flag;
|
||||
private String isType;
|
||||
private Long staffId;
|
||||
// private Long staffId;
|
||||
}
|
||||
|
@ -64,6 +64,10 @@ public class AllOrderInfo extends BaseEntity implements Serializable {
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||
private Date payTime;
|
||||
/**
|
||||
* 店员id
|
||||
*/
|
||||
private Integer staffId;
|
||||
/**
|
||||
* 付款方式(数据字典)
|
||||
*/
|
||||
|
@ -90,13 +90,19 @@ public class OilOrder extends BaseEntity implements Serializable {
|
||||
*/
|
||||
private Double discountAmount;
|
||||
/**
|
||||
* 优惠金额
|
||||
* 储值卡消费金额
|
||||
*/
|
||||
private Double balanceAmount;
|
||||
/**
|
||||
* 等级金额
|
||||
*/
|
||||
private Double levelAmount;
|
||||
/**
|
||||
* 营销活动优惠金额
|
||||
*/
|
||||
private Double activeAmount;
|
||||
/**
|
||||
* 优惠金额
|
||||
* 囤油卡消费升数
|
||||
*/
|
||||
private Double oilCardAmount;
|
||||
/**
|
||||
@ -144,11 +150,13 @@ public class OilOrder extends BaseEntity implements Serializable {
|
||||
* 退款备注
|
||||
*/
|
||||
private String refundRemark;
|
||||
/**
|
||||
* 码牌二维码的sn号
|
||||
*/
|
||||
private String oilTagSn;
|
||||
/**
|
||||
* 油罐id
|
||||
*/
|
||||
// @TableField(exist = false)
|
||||
private Integer tankId;
|
||||
/**
|
||||
* 商户号
|
||||
|
@ -16,6 +16,7 @@ import com.fuint.api.fuyou.entity.ReceiveParameterPos;
|
||||
import com.fuint.api.fuyou.service.FyPayService;
|
||||
import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||
import com.fuint.api.fuyou.service.OilConfigService;
|
||||
import com.fuint.business.commission.service.CommissionRecordService;
|
||||
import com.fuint.business.commission.service.StaffCommissionService;
|
||||
import com.fuint.business.convenienceSore.entity.LJGoods;
|
||||
import com.fuint.business.convenienceSore.entity.SaleDetail;
|
||||
@ -128,6 +129,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
@Autowired
|
||||
private StaffCommissionService staffCommissionService;
|
||||
@Autowired
|
||||
private CommissionRecordService commissionRecordService;
|
||||
@Autowired
|
||||
private GrowthValueChangeService growthValueChangeService;
|
||||
@Autowired
|
||||
private ChainStoreConfigService chainStoreConfigService;
|
||||
@ -157,6 +160,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
@Resource
|
||||
private MtStoreMapper mtStoreMapper;
|
||||
|
||||
@Override
|
||||
public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
@ -165,12 +169,14 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
IPage<OilOrder> oilOrderIPage = baseMapper.selectOilOrderList(page, order);
|
||||
return oilOrderIPage;
|
||||
}
|
||||
|
||||
@Resource
|
||||
OilGunMapper oilGunMapper;
|
||||
@Resource
|
||||
OilNameMapper oilNameMapper;
|
||||
@Resource
|
||||
OilTankMapper oilTankMapper;
|
||||
|
||||
@Override
|
||||
public IPage<OilOrder> selectOilOrderListByZtDz(Page page, OilOrder order) {
|
||||
if (ObjectUtil.isEmpty(order.getDeptId())) {
|
||||
@ -189,7 +195,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
record.setStoreName(mtStore.getName());
|
||||
}
|
||||
OilGun oilGun = oilGunMapper.queryById(Integer.valueOf(record.getOilGunNum()));
|
||||
if (ObjectUtil.isNotEmpty(oilGun)){
|
||||
if (ObjectUtil.isNotEmpty(oilGun)) {
|
||||
record.setGunName(oilGun.getGunName());
|
||||
}
|
||||
OilName oilName = oilNameMapper.selectOilNameById(Integer.valueOf(record.getOils()));
|
||||
@ -203,7 +209,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
}
|
||||
return oilOrderIPage;
|
||||
}
|
||||
// 查询油品分析 列表
|
||||
|
||||
// 查询油品分析 列表
|
||||
@Override
|
||||
public IPage<OilOrderVo> selectOilOrderFenXiListByZtDz(Page page, OilOrderVo order) {
|
||||
if (ObjectUtil.isEmpty(order.getDeptId())) {
|
||||
@ -239,8 +246,9 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
}
|
||||
return oilOrderIPage;
|
||||
}
|
||||
// 查询油品分析 累计
|
||||
public Map<String,String> selectOilOrderFenXiDataByZtDz(OilOrderVo order){
|
||||
|
||||
// 查询油品分析 累计
|
||||
public Map<String, String> selectOilOrderFenXiDataByZtDz(OilOrderVo order) {
|
||||
if (ObjectUtil.isEmpty(order.getDeptId())) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
order.setDeptId(nowAccountInfo.getDeptId());
|
||||
@ -399,49 +407,36 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
Double seekZero = Double.valueOf(map.get("seekZero"));
|
||||
// 油枪id
|
||||
String oilGunId = map.get("oilGunId");
|
||||
log.info("11111111111111111111111285:", map.get("levelAmount"));
|
||||
Double levelAmount = Double.valueOf(map.get("levelAmount"));
|
||||
Double activeAmount = Double.valueOf(map.get("activeAmount"));
|
||||
Double oilCardAmount1 = Double.valueOf(map.get("oilCardAmount1"));
|
||||
// 优惠券id
|
||||
Integer cardFavorableId = null;
|
||||
if (StringUtils.isNotEmpty(map.get("cardFavorableId"))) {
|
||||
cardFavorableId = Integer.valueOf(map.get("cardFavorableId"));
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(cardFavorableId) && StringUtils.isNotEmpty(map.get("userId"))) {
|
||||
Integer userId = Integer.valueOf(map.get("userId"));
|
||||
LambdaQueryWrapper<CardFavorableRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CardFavorableRecord::getMtUserId, userId);
|
||||
queryWrapper.eq(CardFavorableRecord::getCardFavorableId, cardFavorableId);
|
||||
queryWrapper.eq(CardFavorableRecord::getStoreId, storeId);
|
||||
queryWrapper.eq(CardFavorableRecord::getStatus, 0);
|
||||
List<CardFavorableRecord> list = cardFavorableRecordService.list(queryWrapper);
|
||||
list.get(0).setStatus("1");
|
||||
cardFavorableRecordService.updateById(list.get(0));
|
||||
// 优惠券 用户 id
|
||||
Integer couponUserId = null;
|
||||
if (StringUtils.isNotEmpty(map.get("couponUserId"))) {
|
||||
couponUserId = Integer.valueOf(map.get("couponUserId"));
|
||||
}
|
||||
|
||||
Integer recordId = null;
|
||||
if (StringUtils.isNotEmpty(map.get("recordId"))) {
|
||||
recordId = Integer.valueOf(map.get("recordId"));
|
||||
}
|
||||
// 付款用户
|
||||
//付款用户
|
||||
String payUser = null;
|
||||
if (ObjectUtil.isNotEmpty(map.get("payUser")) && !map.get("payUser").equals("[]")) {
|
||||
payUser = map.get("payUser");
|
||||
} else {
|
||||
payUser = "散客";
|
||||
}
|
||||
// 油品优惠金额
|
||||
//油品优惠金额
|
||||
Double oilDiscount = Double.valueOf(map.get("oilDiscount"));
|
||||
// 商品优惠金额
|
||||
Double goodsDiscount = Double.valueOf(map.get("goodsDiscount"));
|
||||
// 员工id
|
||||
//员工id
|
||||
Integer staffId = null;
|
||||
if (ObjectUtil.isNotEmpty(map.get("staffId"))) {
|
||||
staffId = Integer.valueOf(map.get("staffId"));
|
||||
}
|
||||
// 会员消费金额(储值卡需要减少的金额)
|
||||
// 会员消费金额(储值卡需要减少的金额)
|
||||
Double consumeAmount = Double.valueOf(map.get("consumeAmount"));
|
||||
Integer userId = null;
|
||||
Boolean isMember = false;
|
||||
@ -485,16 +480,16 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
LJOrder ljOrder1 = null;
|
||||
|
||||
String transactionType = null;
|
||||
if (oilAmount>0 && goodsAmount>0){
|
||||
if (oilAmount > 0 && goodsAmount > 0) {
|
||||
transactionType = "5";
|
||||
}else if (oilAmount>0) {
|
||||
} else if (oilAmount > 0) {
|
||||
transactionType = "4";
|
||||
}else if (goodsAmount>0) {
|
||||
} else if (goodsAmount > 0) {
|
||||
transactionType = "2";
|
||||
}
|
||||
|
||||
// 根据店铺id查询商户配置信息
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId,transactionType,oilGunId);
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId, transactionType, oilGunId);
|
||||
|
||||
if (ObjectUtil.isEmpty(merchantConfig) && !payType.equals("CASH") && !payType.equals("credit") &&
|
||||
!map.get("allAmount").equals("0")) {
|
||||
@ -538,7 +533,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
|
||||
orderService.insertGoodOrder(ljOrder);
|
||||
|
||||
// 查询商品订单号
|
||||
//查询商品订单号
|
||||
LJOrder ljOrder2 = orderService.selectGoodsOrder(orderNo);
|
||||
if (payType.equals("CASH") || payType.equals("credit")) {
|
||||
// 添加商品订单记录表
|
||||
@ -622,16 +617,13 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
order.setPayTime(new Date());
|
||||
order.setOrderStatus("paid");
|
||||
}
|
||||
// if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))){
|
||||
// baseMapper.updateById(order);
|
||||
// }else {
|
||||
|
||||
baseMapper.insert(order);
|
||||
// }
|
||||
oilOrder1 = this.selectOilOrderByOrderNo(orderNo);
|
||||
}
|
||||
}
|
||||
|
||||
// 添加收银台订单信息
|
||||
// 添加收银台订单信息
|
||||
CashierOrder cashierOrder = new CashierOrder();
|
||||
cashierOrder.setStaffId(staffId);
|
||||
cashierOrder.setStoreId(storeId);
|
||||
@ -1184,89 +1176,89 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
|
||||
String status = "unpaid";
|
||||
|
||||
if ( lockupAmount>0.0) {
|
||||
OilOrder order = new OilOrder();
|
||||
OilOrder oilOrder = null;
|
||||
if (lockupAmount > 0.0) {
|
||||
OilOrder order = new OilOrder();
|
||||
OilOrder oilOrder = null;
|
||||
|
||||
// 添加收银台订单信息
|
||||
CashierOrder cashierOrder = new CashierOrder();
|
||||
boolean flag = false;
|
||||
if (cardBalance >= lockupAmount){
|
||||
flag = true;
|
||||
status = "paid";
|
||||
}else {
|
||||
flag = false;
|
||||
status = "payFail";
|
||||
// 添加收银台订单信息
|
||||
CashierOrder cashierOrder = new CashierOrder();
|
||||
boolean flag = false;
|
||||
if (cardBalance >= lockupAmount) {
|
||||
flag = true;
|
||||
status = "paid";
|
||||
} else {
|
||||
flag = false;
|
||||
status = "payFail";
|
||||
}
|
||||
Double oilLiters = 0.0;
|
||||
for (int i = 0; i < oilOrders.size(); i++) {
|
||||
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
|
||||
Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
|
||||
Double oilNum = amount / oilPrice;
|
||||
oilLiters += oilNum;
|
||||
if (i == 0) {
|
||||
order.setOrderType("主订单");
|
||||
order.setOrderAmount(amount);
|
||||
order.setPayAmount(amount);
|
||||
order.setOrderNo(orderNo);
|
||||
} else {
|
||||
order.setOrderType("子订单");
|
||||
order.setOrderAmount(amount);
|
||||
order.setPayAmount(0.0);
|
||||
order.setOrderNo(orderNo + "1");
|
||||
}
|
||||
Double oilLiters = 0.0;
|
||||
for (int i = 0; i < oilOrders.size(); i++) {
|
||||
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
|
||||
Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
|
||||
Double oilNum = amount / oilPrice;
|
||||
oilLiters += oilNum;
|
||||
if (i == 0) {
|
||||
order.setOrderType("主订单");
|
||||
order.setOrderAmount(amount);
|
||||
order.setPayAmount(amount);
|
||||
order.setOrderNo(orderNo);
|
||||
} else {
|
||||
order.setOrderType("子订单");
|
||||
order.setOrderAmount(amount);
|
||||
order.setPayAmount(0.0);
|
||||
order.setOrderNo(orderNo + "1");
|
||||
}
|
||||
order.setStoreId(accountInfo.getStoreId());
|
||||
order.setUserId(userId);
|
||||
order.setCommissionAmount(Double.valueOf(map.get("commissionAmount")));
|
||||
if (ObjectUtil.isNotEmpty(map.get("staffId")))
|
||||
order.setStaffId(Integer.valueOf(map.get("staffId")));
|
||||
order.setTerminal(map.get("terminal"));
|
||||
order.setOils((String) oilOrders.get(i).get("oilName"));
|
||||
order.setOilGunNum(oilOrders.get(i).get("gunName").toString());
|
||||
order.setOilNum(oilNum);
|
||||
order.setStoreId(accountInfo.getStoreId());
|
||||
order.setUserId(userId);
|
||||
order.setCommissionAmount(Double.valueOf(map.get("commissionAmount")));
|
||||
if (ObjectUtil.isNotEmpty(map.get("staffId")))
|
||||
order.setStaffId(Integer.valueOf(map.get("staffId")));
|
||||
order.setTerminal(map.get("terminal"));
|
||||
order.setOils((String) oilOrders.get(i).get("oilName"));
|
||||
order.setOilGunNum(oilOrders.get(i).get("gunName").toString());
|
||||
order.setOilNum(oilNum);
|
||||
// order.setDiscountAmount(Double.valueOf(map.get("oilDiscount")));
|
||||
order.setPayUser(userVo1.getMobile());
|
||||
order.setPayType(map.get("payType"));
|
||||
order.setInvoicing("未开票");
|
||||
order.setOrderStatus(status);
|
||||
if (flag) order.setPayTime(new Date());
|
||||
order.setPayUser(userVo1.getMobile());
|
||||
order.setPayType(map.get("payType"));
|
||||
order.setInvoicing("未开票");
|
||||
order.setOrderStatus(status);
|
||||
if (flag) order.setPayTime(new Date());
|
||||
|
||||
this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId());
|
||||
if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))) {
|
||||
baseMapper.updateById(order);
|
||||
} else {
|
||||
baseMapper.insert(order);
|
||||
}
|
||||
|
||||
oilOrder = this.selectOilOrderByOrderNo(orderNo);
|
||||
this.updateGrowthValue1(oilAmount, 0.0, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId, orderNo);
|
||||
this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId());
|
||||
if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))) {
|
||||
baseMapper.updateById(order);
|
||||
} else {
|
||||
baseMapper.insert(order);
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
oilOrder = this.selectOilOrderByOrderNo(orderNo);
|
||||
this.updateGrowthValue1(oilAmount, 0.0, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId, orderNo);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(map.get("staffId")))
|
||||
cashierOrder.setStaffId(Integer.valueOf(map.get("staffId")));
|
||||
cashierOrder.setStoreId(accountInfo.getStoreId());
|
||||
cashierOrder.setPayUser(userVo1.getMobile());
|
||||
cashierOrder.setAmount(oilAmount);
|
||||
cashierOrder.setOilPayAmount(oilAmount);
|
||||
cashierOrder.setPayAmount(oilAmount);
|
||||
cashierOrder.setStatus(status);
|
||||
cashierOrder.setPayTime(new Date());
|
||||
cashierOrder.setOrderNo(orderNo);
|
||||
cashierOrder.setOilOrderAmount(oilAmount);
|
||||
cashierOrder.setTerminal(map.get("terminal"));
|
||||
cashierOrder.setOilOrderId(oilOrder.getId());
|
||||
cashierOrder.setSeekZero(0.0);
|
||||
cashierOrder.setPayType(map.get("payType"));
|
||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", status);
|
||||
if (ObjectUtil.isNotEmpty(map.get("staffId")))
|
||||
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")), storeId, oilAmount, oilAmount, "1", orderNo);
|
||||
res.put("success", "success");
|
||||
}else {
|
||||
res.put("error", "储值卡余额不足!");
|
||||
}
|
||||
if (flag) {
|
||||
|
||||
if (ObjectUtil.isNotEmpty(map.get("staffId")))
|
||||
cashierOrder.setStaffId(Integer.valueOf(map.get("staffId")));
|
||||
cashierOrder.setStoreId(accountInfo.getStoreId());
|
||||
cashierOrder.setPayUser(userVo1.getMobile());
|
||||
cashierOrder.setAmount(oilAmount);
|
||||
cashierOrder.setOilPayAmount(oilAmount);
|
||||
cashierOrder.setPayAmount(oilAmount);
|
||||
cashierOrder.setStatus(status);
|
||||
cashierOrder.setPayTime(new Date());
|
||||
cashierOrder.setOrderNo(orderNo);
|
||||
cashierOrder.setOilOrderAmount(oilAmount);
|
||||
cashierOrder.setTerminal(map.get("terminal"));
|
||||
cashierOrder.setOilOrderId(oilOrder.getId());
|
||||
cashierOrder.setSeekZero(0.0);
|
||||
cashierOrder.setPayType(map.get("payType"));
|
||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", status);
|
||||
if (ObjectUtil.isNotEmpty(map.get("staffId")))
|
||||
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")), storeId, oilAmount, oilAmount, "1", orderNo);
|
||||
res.put("success", "success");
|
||||
} else {
|
||||
res.put("error", "储值卡余额不足!");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
@ -1362,7 +1354,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId());
|
||||
// 根据用户id查询用户信息
|
||||
LJUserVo userVo1 = userService.selectUserById(userId, storeId);
|
||||
if (ObjectUtil.isEmpty(userVo1)){
|
||||
if (ObjectUtil.isEmpty(userVo1)) {
|
||||
res.put("error", "当前会员不存在!");
|
||||
return res;
|
||||
}
|
||||
@ -1578,13 +1570,12 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
public OilOrder addOilOrder(OilOrder oilOrder) {
|
||||
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo1();
|
||||
// 根据日期生成订单信息
|
||||
//根据日期生成订单信息
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String timestamp = dateFormat.format(new Date());
|
||||
String randomString = UUID.randomUUID().toString().replace("-", "").substring(0, 6);
|
||||
String orderNo = "2345" + timestamp + randomString;
|
||||
|
||||
// 添加油品订单信息
|
||||
//添加油品订单信息
|
||||
oilOrder.setOrderNo(orderNo);
|
||||
oilOrder.setOrderStatus("unpaid");
|
||||
oilOrder.setOrderType("主订单");
|
||||
@ -1608,7 +1599,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
|
||||
LJUserVo userVo = userService.selectUserById(oilOrder.getUserId(), oilOrder.getStoreId());
|
||||
oilOrder.setPayUser(userVo.getMobile());
|
||||
// baseMapper.insert(oilOrder);
|
||||
if (ObjectUtil.isNotEmpty(this.selectOilOrderByOrderNo(orderNo))) {
|
||||
baseMapper.updateById(oilOrder);
|
||||
} else {
|
||||
@ -1621,15 +1611,15 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
public Map<String, Object> appletPay(Map<String, String> map) throws Exception {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
String orderNo = map.get("orderNo");
|
||||
// 支付金额
|
||||
// 支付金额
|
||||
Double payAmount = Double.valueOf(map.get("payAmount"));
|
||||
// 优惠金额
|
||||
//优惠金额
|
||||
String discountAmount = map.get("discountAmount");
|
||||
// 囤油卡消费后的信息
|
||||
//囤油卡消费后的信息
|
||||
String oilCardAmount = map.get("oilCardAmount");
|
||||
// 囤油卡消费升数
|
||||
//囤油卡消费升数
|
||||
Double oilCardLiters = Double.valueOf(map.get("oilCardLiters"));
|
||||
// 是否使用囤油卡
|
||||
//是否使用囤油卡
|
||||
String isOilStorageCard = map.get("isOilStorageCard");
|
||||
// 储值卡消费金额
|
||||
String balanceAmount = map.get("balanceAmount");
|
||||
@ -1859,7 +1849,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
@Override
|
||||
public int updateOrderStatus(String orderNo, String status) throws Exception {
|
||||
int row = 0;
|
||||
String staffId ="";
|
||||
String staffId = "";
|
||||
OilOrder oilOrder = this.selectOilOrderByOrderNo(orderNo);
|
||||
Integer userId = oilOrder.getUserId();
|
||||
LJUser user = null;
|
||||
@ -1880,7 +1870,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
Integer tagCodeId = oilTag.getTagCodeId();
|
||||
TagCode tagCode = tagCodeService.getById(tagCodeId);
|
||||
String[] staffIds = tagCode.getCollection().split("staffId");
|
||||
if (staffIds.length > 1){
|
||||
if (staffIds.length > 1) {
|
||||
staffId = staffIds[1];
|
||||
oilOrder.setStaffId(Integer.parseInt(staffId));
|
||||
}
|
||||
@ -1930,12 +1920,16 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
userId = cardValudChildrens.getUserId();
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(userId)) this.updateGrowthValue(oilOrder.getOrderAmount(), oilOrder.getPayAmount(), userId, Integer.valueOf(oilOrder.getOils()), null, oilOrder.getStoreId(), orderNo);
|
||||
if (ObjectUtil.isNotEmpty(userId))
|
||||
this.updateGrowthValue(oilOrder.getOrderAmount(), oilOrder.getPayAmount(), userId, Integer.valueOf(oilOrder.getOils()), null, oilOrder.getStoreId(), orderNo);
|
||||
this.addOilTracks(oilOrder, oilOrder.getStoreId());
|
||||
this.updateCardAndActiveById(oilOrder.getStoreId(), oilOrder.getUserId(), oilOrder.getActiveId(), oilOrder.getCouponId(), oilOrder.getActiveType(), oilOrder.getOrderAmount(), oilOrder.getPayAmount(), Integer.valueOf(oilOrder.getOils()));
|
||||
if (ObjectUtil.isNotEmpty(userId)) this.insertCardBalance(oilOrder.getOrderAmount() - oilOrder.getDiscountAmount() - oilOrder.getPayAmount(), userId, oilOrder.getStoreId(), orderNo);
|
||||
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId()))
|
||||
if (ObjectUtil.isNotEmpty(userId))
|
||||
this.insertCardBalance(oilOrder.getOrderAmount() - oilOrder.getDiscountAmount() - oilOrder.getPayAmount(), userId, oilOrder.getStoreId(), orderNo);
|
||||
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId())) {
|
||||
staffCommissionService.countStaffCommission(oilOrder.getStaffId(), oilOrder.getStoreId(), oilOrder.getOrderAmount(), oilOrder.getPayAmount(), "1", orderNo);
|
||||
// commissionRecordService.addRecord(oilOrder.getStoreId(),"1",oilOrder.getStaffId(),oilOrder.getOrderAmount(), oilOrder.getPayAmount(),"0","油品出售",orderNo);
|
||||
}
|
||||
}
|
||||
row = baseMapper.updateById(oilOrder);
|
||||
}
|
||||
@ -2032,7 +2026,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
private void updateGrowthValue(Double oilAmount, Double oilActualPay, Integer userid, Integer oilId, String refuelMoney, Integer storeId, String orderNo) {
|
||||
if (ObjectUtil.isNotEmpty(oilId)) {
|
||||
OilName oilName = oilNameService.selectOilNameById(oilId);
|
||||
// 获取成长值增长数值
|
||||
//获取成长值增长数值
|
||||
Integer gasGrowthValue = null;
|
||||
Integer dieselGrowthValue = null;
|
||||
Integer naturalGrowthValue = null;
|
||||
@ -2041,33 +2035,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userid, store.getChainStoreId());
|
||||
int growth = balance.getGrowthValue();
|
||||
// if (refuelMoney==null){
|
||||
// String refuelMoney1 = balance.getRefuelMoney();
|
||||
// if (ObjectUtil.isNotEmpty(refuelMoney1) && ObjectUtil.isNotEmpty(refuelMoney)){
|
||||
// JSONArray objects = JSONArray.parseArray(refuelMoney);
|
||||
// JSONArray objects1 = JSONArray.parseArray(refuelMoney1);
|
||||
// List<RefuelMoney> list = new ArrayList<>();
|
||||
// for (int i = 0;i<objects.size();i++){
|
||||
// if (((JSONObject)objects.get(i)).get("oilType").toString().equals(oilId)){
|
||||
// RefuelMoney refuelMoney2 = new RefuelMoney();
|
||||
// refuelMoney2.setType(((JSONObject) objects.get(i)).get("type").toString());
|
||||
// refuelMoney2.setOilType(((JSONObject) objects.get(i)).get("oilType").toString());
|
||||
// refuelMoney2.setRefuelMoney(((JSONObject) objects.get(i)).get("refuelMoney").toString());
|
||||
// list.add(refuelMoney2);
|
||||
// Double oilBalance = 0.0;
|
||||
// Double afterOilBalance = 0.0;
|
||||
// if (!refuelMoney1.equals(refuelMoney)){
|
||||
// oilBalance = Double.valueOf(((JSONObject) objects1.get(i)).get("refuelMoney").toString()) - Double.valueOf(((JSONObject) objects.get(i)).get("refuelMoney").toString());
|
||||
// afterOilBalance = Double.valueOf(((JSONObject) objects.get(i)).get("refuelMoney").toString());
|
||||
// this.insertOilBalance(userid,storeId,oilName.getId().toString(),oilName.getOilType(),oilBalance,afterOilBalance,orderNo);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// balance.setRefuelMoney(JSONObject.toJSONString(list));
|
||||
// }
|
||||
// }else {
|
||||
// balance.setRefuelMoney(refuelMoney);
|
||||
// }
|
||||
if (ObjectUtil.isNotEmpty(refuelMoney) && !refuelMoney.equals("null")) {
|
||||
String refuelMoney1 = balance.getRefuelMoney();
|
||||
JSONArray objects = JSONArray.parseArray(refuelMoney);
|
||||
@ -2084,7 +2051,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
|
||||
balance.setRefuelMoney(refuelMoney);
|
||||
}
|
||||
// 查询会员等级列表信息
|
||||
//查询会员等级列表信息
|
||||
Page page = new Page(1, 20);
|
||||
LJUserGrade ljUserGrade1 = new LJUserGrade();
|
||||
List<LJUserGrade> records = userGradeService.selectUserGradeAll(storeId);
|
||||
@ -2094,7 +2061,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
Integer addVal = (int) (gasGrowthValue * oilAmount);
|
||||
addGrowthVal = addVal;
|
||||
growthAfter = growth + addVal;
|
||||
// 如果会员成长值达到会员等级成长值,则修改会员的会员等级信息
|
||||
//如果会员成长值达到会员等级成长值,则修改会员的会员等级信息
|
||||
for (int i = 1; i < records.size(); i++) {
|
||||
if (growthAfter < records.get(i).getGrowthValue()) {
|
||||
balance.setGradeId(records.get(i - 1).getId());
|
||||
@ -2107,7 +2074,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
Integer addVal = (int) (dieselGrowthValue * oilAmount);
|
||||
addGrowthVal = addVal;
|
||||
growthAfter = growth + addVal;
|
||||
// 如果会员成长值达到会员等级成长值,则修改会员的会员等级信息
|
||||
//如果会员成长值达到会员等级成长值,则修改会员的会员等级信息
|
||||
for (int i = 0; i < records.size(); i++) {
|
||||
if (growthAfter < records.get(i).getGrowthValue()) {
|
||||
balance.setGradeId(records.get(i - 1).getId());
|
||||
@ -2120,7 +2087,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
Integer addVal = (int) (naturalGrowthValue * oilAmount);
|
||||
addGrowthVal = addVal;
|
||||
growthAfter = growth + addVal;
|
||||
// 如果会员成长值达到会员等级成长值,则修改会员的会员等级信息
|
||||
//如果会员成长值达到会员等级成长值,则修改会员的会员等级信息
|
||||
for (int i = 0; i < records.size(); i++) {
|
||||
if (growthAfter < records.get(i).getGrowthValue()) {
|
||||
balance.setGradeId(records.get(i - 1).getId());
|
||||
@ -2130,9 +2097,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
balance.setGrowthValue(growthAfter);
|
||||
} else {
|
||||
}
|
||||
// 修改用户成长值
|
||||
Integer consumeNum = balance.getConsumeNum();
|
||||
// balance.setConsumeNum(consumeNum+1);
|
||||
// 修改用户成长值
|
||||
userBalanceService.updateUserBalance(balance);
|
||||
|
||||
this.insertGrowthValueChange(userid, storeId, addGrowthVal, growthAfter, orderNo);
|
||||
@ -2566,12 +2531,12 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
oilOrderVo.setTerminal("POS");
|
||||
oilOrderVo.setOrderStatus("unpaid");
|
||||
oilOrderVo.setOrderType("主订单");
|
||||
if (ObjectUtil.isNotEmpty(oilOrderVo.getOrderNo())){
|
||||
if (ObjectUtil.isNotEmpty(oilOrderVo.getOrderNo())) {
|
||||
OilOrder oilOrder = this.selectOilOrderByOrderNo(oilOrderVo.getOrderNo());
|
||||
oilOrderVo.setId(oilOrder.getId());
|
||||
oilOrderVo.setOrderNo(orderNo);
|
||||
baseMapper.updateById(oilOrderVo);
|
||||
}else {
|
||||
} else {
|
||||
oilOrderVo.setOrderNo(orderNo);
|
||||
baseMapper.insert(oilOrderVo);
|
||||
}
|
||||
@ -2588,61 +2553,61 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
receiveParameterPos.setOilCardAmount(oilOrderVo.getOilCardAmount1());
|
||||
receiveParameterPos.setOilGunId(oilOrderVo.getOilGunNum());
|
||||
Map<String, String> mainScan = fyPayService.mainScan(receiveParameterPos);
|
||||
res.put("oilOrder",this.selectOilOrderByOrderNo(orderNo));
|
||||
res.put("scanCode",mainScan);
|
||||
res.put("oilOrder", this.selectOilOrderByOrderNo(orderNo));
|
||||
res.put("scanCode", mainScan);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OilOrderVo> selectProportion(Map<String, String> map,List<Integer> storeIds) {
|
||||
public List<OilOrderVo> selectProportion(Map<String, String> map, List<Integer> storeIds) {
|
||||
String startTime = map.get("startTime");
|
||||
String endTime = map.get("endTime");
|
||||
OilOrderVo oilOrderVo = new OilOrderVo();
|
||||
Map<String , Object> map1 = new HashMap<>();
|
||||
map1.put("beginTime",startTime);
|
||||
map1.put("endTime",endTime);
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("beginTime", startTime);
|
||||
map1.put("endTime", endTime);
|
||||
oilOrderVo.setParams(map1);
|
||||
return baseMapper.selectOilsCount(oilOrderVo,storeIds);
|
||||
return baseMapper.selectOilsCount(oilOrderVo, storeIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OilOrder> selectListByGroup(UserGroup userGroup,Integer userId) {
|
||||
public List<OilOrder> selectListByGroup(UserGroup userGroup, Integer userId) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id",userGroup.getStoreId());
|
||||
queryWrapper.eq("order_status","paid");
|
||||
queryWrapper.eq("user_id",userId);
|
||||
if (ObjectUtil.isNotEmpty(userGroup.getConsumeCycle())){
|
||||
queryWrapper.eq("store_id", userGroup.getStoreId());
|
||||
queryWrapper.eq("order_status", "paid");
|
||||
queryWrapper.eq("user_id", userId);
|
||||
if (ObjectUtil.isNotEmpty(userGroup.getConsumeCycle())) {
|
||||
// 查询7天的数据
|
||||
if (userGroup.getConsumeCycle().equals("1")){
|
||||
if (userGroup.getConsumeCycle().equals("1")) {
|
||||
LocalDate now = LocalDate.now();
|
||||
LocalDate sevenDaysAgo = now.minus(7, ChronoUnit.DAYS);
|
||||
queryWrapper.ge("create_time", sevenDaysAgo);
|
||||
queryWrapper.le("create_time", now);
|
||||
}else if (userGroup.getConsumeCycle().equals("2")){
|
||||
} else if (userGroup.getConsumeCycle().equals("2")) {
|
||||
// 查询15天的数据
|
||||
LocalDate now = LocalDate.now();
|
||||
LocalDate sevenDaysAgo = now.minus(15, ChronoUnit.DAYS);
|
||||
queryWrapper.ge("create_time", sevenDaysAgo);
|
||||
queryWrapper.le("create_time", now);
|
||||
}else if (userGroup.getConsumeCycle().equals("3")){
|
||||
} else if (userGroup.getConsumeCycle().equals("3")) {
|
||||
// 查询15天的数据
|
||||
LocalDate now = LocalDate.now();
|
||||
LocalDate sevenDaysAgo = now.minus(30, ChronoUnit.DAYS);
|
||||
queryWrapper.ge("create_time", sevenDaysAgo);
|
||||
queryWrapper.le("create_time", now);
|
||||
}else if (userGroup.getConsumeCycle().equals("4")){
|
||||
} else if (userGroup.getConsumeCycle().equals("4")) {
|
||||
// 查询15天的数据
|
||||
LocalDate now = LocalDate.now();
|
||||
LocalDate sevenDaysAgo = now.minus(60, ChronoUnit.DAYS);
|
||||
queryWrapper.ge("create_time", sevenDaysAgo);
|
||||
queryWrapper.le("create_time", now);
|
||||
}else if (userGroup.getConsumeCycle().equals("5")){
|
||||
} else if (userGroup.getConsumeCycle().equals("5")) {
|
||||
// 查询15天的数据
|
||||
LocalDate now = LocalDate.now();
|
||||
LocalDate sevenDaysAgo = now.minus(90, ChronoUnit.DAYS);
|
||||
queryWrapper.ge("create_time", sevenDaysAgo);
|
||||
queryWrapper.le("create_time", now);
|
||||
}else if (userGroup.getConsumeCycle().equals("6")){
|
||||
} else if (userGroup.getConsumeCycle().equals("6")) {
|
||||
// 查询15天的数据
|
||||
LocalDate now = LocalDate.now();
|
||||
LocalDate sevenDaysAgo = now.minus(180, ChronoUnit.DAYS);
|
||||
@ -2650,11 +2615,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
queryWrapper.le("create_time", now);
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(userGroup.getConsumeAmountFront()) && ObjectUtil.isNotEmpty(userGroup.getConsumeAmountAfter())){
|
||||
if (ObjectUtil.isNotEmpty(userGroup.getConsumeAmountFront()) && ObjectUtil.isNotEmpty(userGroup.getConsumeAmountAfter())) {
|
||||
queryWrapper.ge("pay_amount", userGroup.getConsumeAmountFront());
|
||||
queryWrapper.le("pay_amount", userGroup.getConsumeAmountAfter());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(userGroup.getAverageConsumeFront()) && ObjectUtil.isNotEmpty(userGroup.getAverageConsumeAfter())){
|
||||
if (ObjectUtil.isNotEmpty(userGroup.getAverageConsumeFront()) && ObjectUtil.isNotEmpty(userGroup.getAverageConsumeAfter())) {
|
||||
queryWrapper.ge("pay_amount", userGroup.getAverageConsumeFront());
|
||||
queryWrapper.le("pay_amount", userGroup.getAverageConsumeAfter());
|
||||
}
|
||||
|
@ -92,4 +92,16 @@ public interface UserBalanceService extends IService<UserBalance> {
|
||||
* @return
|
||||
*/
|
||||
int logOffBalance(Integer id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @param chainStoreId 连锁店id
|
||||
* @param storeId 店铺id
|
||||
* @param consumptioType 消费类型 1-汽油消费 2-柴油消费 3-天然气消费 4-会员充值
|
||||
* @param money 消费金额
|
||||
* @param fromType 消费来源
|
||||
* @param orderNo 订单号
|
||||
*/
|
||||
void growthValue(Integer userId, Integer chainStoreId,Integer storeId, String consumptioType, Double money,String fromType, String orderNo);
|
||||
}
|
||||
|
@ -374,7 +374,15 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
@Override
|
||||
public List<LJUserVo> userListByPhone(String mobile) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
return baseMapper.userListByPhone(mobile, nowAccountInfo.getStoreId());
|
||||
List<LJUserVo> ljUserVos = baseMapper.userListByPhone(mobile, nowAccountInfo.getStoreId());
|
||||
ljUserVos.forEach(it->{
|
||||
//在查询囤油卡信息
|
||||
LambdaQueryWrapper<MtUserFuel> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(MtUserFuel::getStoreId,nowAccountInfo.getStoreId()).eq(MtUserFuel::getMtUserId,it.getId());
|
||||
List<MtUserFuel> list = userFuelService.list(queryWrapper);
|
||||
it.setUserFuels(list);
|
||||
});
|
||||
return ljUserVos;
|
||||
}
|
||||
|
||||
@Resource
|
||||
|
@ -2,6 +2,7 @@ package com.fuint.business.userManager.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@ -19,13 +20,18 @@ import com.fuint.business.marketingActivity.cardGift.mapper.CardGiftMapper;
|
||||
import com.fuint.business.marketingActivity.cardGiftActive.mapper.CardGiftActiveMapper;
|
||||
import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord;
|
||||
import com.fuint.business.marketingActivity.cardValue.mapper.CardValueRecordMapper;
|
||||
import com.fuint.business.order.entity.AllOrderInfo;
|
||||
import com.fuint.business.order.entity.GrowthValueChange;
|
||||
import com.fuint.business.order.mapper.AllOrderInfoMapper;
|
||||
import com.fuint.business.order.mapper.GrowthValueChangeMapper;
|
||||
import com.fuint.business.store.mapper.MtStoreMapper;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.userManager.entity.ChainStoreConfig;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.business.userManager.entity.MtUserFuel;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.mapper.ChainStoreConfigMapper;
|
||||
import com.fuint.business.userManager.mapper.LJUserGradeMapper;
|
||||
import com.fuint.business.userManager.mapper.MtUserFuelMapper;
|
||||
import com.fuint.business.userManager.mapper.UserBalanceMapper;
|
||||
@ -37,6 +43,8 @@ import com.fuint.business.userManager.vo.UserBlanceUniVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.RedisLock;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.repository.mapper.MtUserGradeMapper;
|
||||
import com.fuint.repository.model.MtUserGrade;
|
||||
import com.fuint.system.dept.mapper.SysDeptMapper;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
@ -90,6 +98,12 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
|
||||
|
||||
@Autowired
|
||||
MtUserFuelMapper mtUserFuelMapper;
|
||||
@Autowired
|
||||
private ChainStoreConfigMapper chainStoreConfigMapper;
|
||||
@Autowired
|
||||
private GrowthValueChangeMapper growthValueChangeMapper;
|
||||
@Autowired
|
||||
private MtUserGradeMapper mtUserGradeMapper;
|
||||
|
||||
|
||||
|
||||
@ -267,6 +281,93 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
|
||||
return baseMapper.updateById(userBalance);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @param chainStoreId 连锁店id
|
||||
* @param storeId 店铺id
|
||||
* @param consumptioType 消费类型 1-汽油消费 2-柴油消费 3-天然气消费 4-会员充值
|
||||
* @param money 消费金额
|
||||
* @param fromType 消费来源
|
||||
* @param orderNo 订单号
|
||||
*/
|
||||
@Override
|
||||
public void growthValue(Integer userId, Integer chainStoreId,Integer storeId,String consumptioType, Double money, String fromType, String orderNo) {
|
||||
//查询成长值规则
|
||||
ChainStoreConfig chainStoreConfig = chainStoreConfigMapper.selectOne(new LambdaQueryWrapper<ChainStoreConfig>()
|
||||
.eq(ChainStoreConfig::getChainStoreId, chainStoreId));
|
||||
//消费满购金额
|
||||
int consumeAmount = 0;
|
||||
//成长值增加
|
||||
int growthValue = 0;
|
||||
switch (consumptioType) {
|
||||
//汽油
|
||||
case "1":
|
||||
consumeAmount = Integer.parseInt(chainStoreConfig.getGasConsumeAmount());
|
||||
growthValue = Integer.parseInt(chainStoreConfig.getGasGrowthValue());
|
||||
break;
|
||||
//柴油
|
||||
case "2":
|
||||
consumeAmount = Integer.parseInt(chainStoreConfig.getDieselConsumeAmount());
|
||||
growthValue = Integer.parseInt(chainStoreConfig.getDieselGrowthValue());
|
||||
break;
|
||||
//天然气
|
||||
case "3":
|
||||
consumeAmount = Integer.parseInt(chainStoreConfig.getNaturalConsumeAmount());
|
||||
growthValue = Integer.parseInt(chainStoreConfig.getNaturalGrowthValue());
|
||||
break;
|
||||
//会员充值
|
||||
case "4":
|
||||
consumeAmount = Integer.parseInt(chainStoreConfig.getRechargeConsumeAmount());
|
||||
growthValue = Integer.parseInt(chainStoreConfig.getRechargeGrowthValue());
|
||||
break;
|
||||
}
|
||||
if (consumeAmount != 0 && money >= consumeAmount) {
|
||||
//金额除以消费金额,取整
|
||||
int growth = (int) (money / consumeAmount);
|
||||
//计算成长值
|
||||
growthValue = growth * growthValue;
|
||||
//更新用户余额表成长值
|
||||
UserBalance userBalance = baseMapper.selectOne(new LambdaQueryWrapper<UserBalance>()
|
||||
.eq(UserBalance::getMtUserId, userId));
|
||||
userBalance.setGrowthValue(userBalance.getGrowthValue() + growthValue);
|
||||
|
||||
//更新成长值记录变化表
|
||||
GrowthValueChange growthValueChange = new GrowthValueChange();
|
||||
growthValueChange.setUserId(userId);
|
||||
growthValueChange.setChangeType("1");
|
||||
growthValueChange.setFromType(fromType);
|
||||
growthValueChange.setGrowthValue(growthValue);
|
||||
growthValueChange.setOrderNo(orderNo);
|
||||
growthValueChange.setAfterTheChange(userBalance.getGrowthValue());
|
||||
growthValueChange.setChainStoreId(chainStoreId);
|
||||
growthValueChange.setStoreId(storeId);
|
||||
growthValueChange.setCreateTime(DateUtil.date());
|
||||
growthValueChange.setCreateBy(TokenUtil.getNowAccountInfo().getId().toString());
|
||||
growthValueChangeMapper.insert(growthValueChange);
|
||||
|
||||
|
||||
List<MtUserGrade> mtUserGrades = mtUserGradeMapper.selectList(new LambdaQueryWrapper<MtUserGrade>()
|
||||
.eq(MtUserGrade::getStoreId, storeId));
|
||||
|
||||
//判断当前用户等级
|
||||
for (int i = 0; i < mtUserGrades.size(); i++) {
|
||||
if (i < mtUserGrades.size() - 2) {
|
||||
if (userBalance.getGrowthValue() >= mtUserGrades.get(i).getGrowthValue() && userBalance.getGrowthValue() < mtUserGrades.get(i + 1).getGrowthValue()){
|
||||
userBalance.setGradeId(mtUserGrades.get(i).getId());
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
userBalance.setGradeId(mtUserGrades.get(mtUserGrades.size() - 1).getId());
|
||||
}
|
||||
}
|
||||
userBalance.setUpdateTime(DateUtil.date());
|
||||
userBalance.setUpdateBy(TokenUtil.getNowAccountInfo().getId().toString());
|
||||
//更新用户等级
|
||||
baseMapper.updateById(userBalance);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
RedisLock redisLock;
|
||||
|
||||
|
@ -28,6 +28,9 @@ public class MtUserGrade implements Serializable {
|
||||
@ApiModelProperty("自增ID")
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
private Integer storeId;
|
||||
private Integer chainStoreId;
|
||||
private Integer growthValue;
|
||||
|
||||
// @ApiModelProperty("商户ID")
|
||||
// private Integer merchantId;
|
||||
|
@ -65,3 +65,10 @@ export function getCouponList(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function sendCouponFun(data) {
|
||||
return request({
|
||||
url: '/cardCoupon/sendCoupon',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!--积分-->
|
||||
<!--积分 商城-->
|
||||
<template>
|
||||
<div class="app-center">
|
||||
<div class="center-left">
|
||||
@ -49,22 +49,15 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- <div class="center-left-hj">-->
|
||||
<!-- <div class="hj-box" style="justify-content: left">油品:¥200.00</div>-->
|
||||
<!-- <div class="hj-box" style="border-left: 1px solid #d1d1d4; border-right: 1px solid #d1d1d4;">商品:¥0.52</div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="center-left-hj">
|
||||
<div>使用积分</div>
|
||||
<div>-{{allPoints}}</div>
|
||||
</div>
|
||||
<!-- <div class="center-left-hj" v-show="isMember">-->
|
||||
<!-- <div>-->
|
||||
<!-- 电子储值卡-->
|
||||
<!-- <span>(账户余额:{{ balance }}元)</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div>-¥{{ allAmout }}</div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="center-left-hj">
|
||||
<div>积分余额(账户余额:318积分)</div>
|
||||
<div>-{{allPoints}}</div>
|
||||
</div>
|
||||
<div class="center-left-hj" v-show="isMember">
|
||||
<div>
|
||||
积分余额
|
||||
@ -78,10 +71,6 @@
|
||||
<div>扫码支付</div>
|
||||
<div class="bule">{{allPoints}}</div>
|
||||
</div>
|
||||
<!-- <div class="th-box">-->
|
||||
<!-- <div>找零</div>-->
|
||||
<!-- <div class="bule">394.7</div>-->
|
||||
<!-- </div>-->
|
||||
<div class="th-box">
|
||||
<div @click="dialogVisible = true">加油员</div>
|
||||
<div style="cursor: pointer;color: crimson" @click="dialogVisible = true" >{{ staff.realName }}</div>
|
||||
@ -114,15 +103,13 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="center-right"
|
||||
>
|
||||
<!-- 右侧-->
|
||||
<div class="center-right">
|
||||
<div class="center-right-top">
|
||||
<el-tabs v-model="queryParams.categoryId" @tab-click="handleClick">
|
||||
<el-tab-pane label="全部" name='first'></el-tab-pane>
|
||||
<el-tab-pane v-for="(item,index) in giftCategoryList" :label="item.categoryName" :name='item.id.toString()'></el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
</div>
|
||||
<div style="width: 200px;margin-left: 2%; ">
|
||||
<el-input v-model="queryParams.giftName" @input="getGift()" placeholder="请输入内容"></el-input>
|
||||
@ -165,11 +152,10 @@
|
||||
<div class="ddjil" @click="orderHistoryMethod">订单记录</div>
|
||||
<div class="gwuc" @click="shoppingCartMethod()">
|
||||
<el-badge :hidden="markPurchasesAll<1" :value="markPurchasesAll" class="item">
|
||||
<i class="el-icon-shopping-cart-2"></i> <span style="margin-left: 5px">购物车</span>
|
||||
<i class="el-icon-shopping-cart-2"></i> <span style="margin-left: 5px">购物车1</span>
|
||||
</el-badge>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -1570,20 +1556,9 @@ import {getReturnCode, printIntegralReport, sendPrintIndex} from "@/api/print";
|
||||
cursor: pointer;
|
||||
/*color: white;*/
|
||||
}
|
||||
|
||||
.wrap-box2{
|
||||
background: #30a1ff !important;
|
||||
color: white;
|
||||
//width: 100%;
|
||||
//height: 100%;
|
||||
//border-radius: 8px;
|
||||
//height: 80px;
|
||||
//display: flex;
|
||||
//align-items: center;
|
||||
//justify-content: center;
|
||||
//border: 1px solid #20b400;
|
||||
//cursor: pointer;
|
||||
//color: #20b400;
|
||||
}
|
||||
|
||||
.center-left-bottom{
|
||||
@ -1733,7 +1708,10 @@ import {getReturnCode, printIntegralReport, sendPrintIndex} from "@/api/print";
|
||||
align-items: center;
|
||||
}
|
||||
.wrap-right-bottom{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
justify-content: space-between;
|
||||
width: 58%;
|
||||
background: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -1741,7 +1719,8 @@ import {getReturnCode, printIntegralReport, sendPrintIndex} from "@/api/print";
|
||||
margin-top: 10px;
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
justify-content: space-between;
|
||||
|
||||
|
||||
}
|
||||
.chongzhi{
|
||||
display: flex;
|
||||
|
@ -6,37 +6,41 @@
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="w_box" style="margin-bottom: 20px">
|
||||
<div class="w_boxs" v-if="tabindex == 1" >
|
||||
<writeList></writeList>
|
||||
</div>
|
||||
<div class="w_box" v-if="tabindex == 0" >
|
||||
<div class="title_" >通过手机号查询会员可以核销的卡券或扫码核销(扫码时,请保证输入框有光标闪烁)</div>
|
||||
<div class="input_box" >
|
||||
<div style="width: 40%;margin-right: 15px">
|
||||
<el-input v-model="queryParams.mobile" placeholder="请输入会员手机号码"></el-input>
|
||||
<el-input v-model="queryParams.mobile" placeholder="请输入会员手机号码或卡券核销码"></el-input>
|
||||
</div>
|
||||
<div >
|
||||
<el-button type="primary" icon="el-icon-search" @click="getList">搜索</el-button>
|
||||
<el-button type="primary" @click="getList">搜索 / 核销</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="wrap-box">
|
||||
|
||||
<div class="coupon-box" @click="getcardExchangeRecord(item.id)" v-for="(item,index) in couponList" :key="index">
|
||||
<div class="box-hei">{{item.exchangeName}} </div>
|
||||
<div class="box-hui"><span>券码:</span> <span>{{item.ticketCode}}</span> </div>
|
||||
<div class="box-hui"><span>有效期:</span> <span>{{item.outTime}}</span> </div>
|
||||
<div class="box-hui"><span>获得方式:</span> <span>{{item.exchangeFrom}}</span> </div>
|
||||
<!-- <div class="anniu" >-->
|
||||
<!-- <span>立即核销</span>-->
|
||||
<!-- </div>-->
|
||||
<div style="margin-left: 30%;width: 57%">
|
||||
<div class="box-hei">{{item.exchangeName}} </div>
|
||||
<div class="box-hui"><span>领取人:</span> <span>{{item.mobile || '匿名'}}</span> </div>
|
||||
<div class="box-hui"><span>核销码:</span> <span>{{item.ticketCode}}</span> </div>
|
||||
<div class="box-hui"><span>有效期:</span> <span>{{item.exchangeFrom}}</span> </div>
|
||||
</div>
|
||||
<div class="hx_">
|
||||
立即核销
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-empty :image-size="300" v-if="total == 0"></el-empty>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listRecord,cardExchangeRecord } from "@/api/online";
|
||||
import writeList from "@/views/cashier/NewComponents/writeList.vue";
|
||||
export default {
|
||||
name: 'index',
|
||||
data(){
|
||||
@ -50,6 +54,7 @@ export default {
|
||||
name: "核销记录",
|
||||
},
|
||||
],
|
||||
num:13964068390,
|
||||
queryParams : {
|
||||
pageNum: 1,
|
||||
pageSize: 999,
|
||||
@ -75,6 +80,9 @@ export default {
|
||||
total:0,
|
||||
}
|
||||
},
|
||||
components:{
|
||||
writeList
|
||||
},
|
||||
methods:{
|
||||
getindex(index) {
|
||||
this.tabindex = index
|
||||
@ -149,11 +157,12 @@ export default {
|
||||
width: 335px;
|
||||
height: 100px;
|
||||
background: #ffffff;
|
||||
border: 1px solid #eef1f6;
|
||||
border-radius: 2px;
|
||||
margin: 10px;
|
||||
background: url("./imgs/qname.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.box-top{
|
||||
width: 100%;
|
||||
@ -176,16 +185,16 @@ export default {
|
||||
color: #999999;
|
||||
display: flex;
|
||||
font-size: 12px;
|
||||
margin-left: 30%;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
.box-hei{
|
||||
box-sizing: border-box;
|
||||
padding: 0px 15px;
|
||||
color: #333;
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
margin-left: 30%;
|
||||
margin-top: 15px;
|
||||
font-size: 14px;font-weight: 600;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.anniu{
|
||||
box-sizing: border-box;
|
||||
@ -208,8 +217,14 @@ export default {
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
min-height: 80vh;
|
||||
margin: 15px auto;
|
||||
min-height: 92vh;
|
||||
margin: 10px auto;
|
||||
}
|
||||
.w_boxs{
|
||||
width: 98%;
|
||||
box-sizing: border-box;
|
||||
|
||||
margin: 10px auto;
|
||||
}
|
||||
.tab-box {
|
||||
width: 100%;
|
||||
@ -217,7 +232,7 @@ export default {
|
||||
background: #fff;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 25px;
|
||||
margin-bottom: 15px;
|
||||
|
||||
}
|
||||
|
||||
@ -257,4 +272,10 @@ export default {
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
.hx_{
|
||||
background: #ff9655;
|
||||
color: #fff;
|
||||
width: 14px;
|
||||
margin-left: 12px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<!--挂账管理1new-->
|
||||
<template>
|
||||
<div class="app-center">
|
||||
<div class="app-centser">
|
||||
<!-- 查询-->
|
||||
<div class="top_new">
|
||||
<el-form :model="queryParams2" ref="queryForm" size="small" :inline="true" label-width="80px">
|
||||
@ -57,12 +57,13 @@
|
||||
placeholder="挂账结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item style="float: right">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery1">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery1">重置</el-button>
|
||||
<el-button type="primary" size="mini" @click="addUnit">新增挂账单位</el-button>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="display: flex">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery1">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery1">重置</el-button>
|
||||
<el-button type="primary" @click="addUnit">新增挂账单位</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 统计-->
|
||||
<div class="top_news">
|
||||
@ -203,17 +204,15 @@
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<div class="pagination-box">
|
||||
<el-pagination
|
||||
background
|
||||
layout="prev, pager, next"
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@current-change="getList">
|
||||
</el-pagination>
|
||||
<pagination
|
||||
:total="total3"
|
||||
:page.sync="queryParams2.page"
|
||||
:limit.sync="queryParams2.pageSize"
|
||||
@pagination="getCreditUnits()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -603,16 +602,6 @@
|
||||
|
||||
<!-- 批量挂账归还-->
|
||||
<el-dialog title="批量挂账归还" :visible.sync="open3" append-to-body>
|
||||
<!-- <el-form ref="form3" :model="form3">-->
|
||||
<!-- <el-form-item>-->
|
||||
<!-- <el-input placeholder="请输入挂账单位、挂账人、挂账人手机号检索"-->
|
||||
<!-- v-model="unitName"-->
|
||||
<!-- @keyup.enter.native="getRepayList"-->
|
||||
<!-- clearable class="input-with-select">-->
|
||||
<!-- <el-button slot="append" icon="el-icon-search" @click="getRepayList">查询</el-button>-->
|
||||
<!-- </el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
@ -1074,10 +1063,7 @@ import {getLodop} from "@/api/LodopFuncs";
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
getCreditUnits(val){
|
||||
if (val!=undefined){
|
||||
this.queryParams2.page = val
|
||||
}
|
||||
getCreditUnits(){
|
||||
let dateRange = []
|
||||
if (this.beginTime && this.endTime) {
|
||||
dateRange.push(this.beginTime.toLocaleDateString())
|
||||
@ -1585,99 +1571,47 @@ import {getLodop} from "@/api/LodopFuncs";
|
||||
.size-hui{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
//width: 200px;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 13px;
|
||||
color: #888888;
|
||||
//line-height: 0px;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
.nei {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
.size-bole{
|
||||
//font-weight: bold;
|
||||
|
||||
//width: 53px;
|
||||
height: 31px;
|
||||
font-family: YouSheBiaoTiHei;
|
||||
font-weight: 400;
|
||||
font-size: 24px;
|
||||
color: #555555;
|
||||
//line-height: 0px;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
.icon-img{
|
||||
//margin-left: 110px;
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
margin-right: 5px;
|
||||
img{
|
||||
float: right;
|
||||
//width: 100%;
|
||||
width: 20px;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.wgang{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20px;
|
||||
|
||||
}
|
||||
.table-box{
|
||||
width: 100%;
|
||||
height: 70vh;
|
||||
overflow: auto;
|
||||
}
|
||||
.pagination-box{
|
||||
width: 100%;
|
||||
margin: 10px auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.top-app-sou{
|
||||
width: 20%;
|
||||
}
|
||||
.box1{
|
||||
padding: 5px;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 20px;
|
||||
padding-left: 20px;
|
||||
|
||||
width: 211px;
|
||||
height: 60px;
|
||||
background: rgba(255,150,85,0.05);
|
||||
border-radius: 6px 6px 6px 6px;
|
||||
border: 1px solid #FF9655;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.top_new{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
background: #fff;
|
||||
width: 98%;
|
||||
margin: 10px auto;
|
||||
width: 100%;
|
||||
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.top_news{
|
||||
|
||||
background: #fff;
|
||||
width: 98%;
|
||||
margin: 10px auto;
|
||||
width: 100%;
|
||||
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 5px;
|
||||
|
||||
}
|
||||
.box2 {
|
||||
padding: 5px;
|
||||
@ -1689,4 +1623,8 @@ import {getLodop} from "@/api/LodopFuncs";
|
||||
border-radius: 6px 6px 6px 6px;
|
||||
border: 1px solid #FF9655;
|
||||
}
|
||||
.app-centser{
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
|
@ -4052,8 +4052,6 @@
|
||||
this.map.authCode = this.authCode;
|
||||
this.map.allAmount = +this.oilActualPay + +this.goodsActualPay
|
||||
this.map.consumeAmount = this.consumeAmount;
|
||||
// if (this.consumeRefuelMoney>0) this.updateRefuelMoney();
|
||||
// this.map.refuelMoney = JSON.stringify(this.refuelMoney)
|
||||
this.map.couponId = this.useCouponIds
|
||||
if (this.staff) {
|
||||
this.map.staffId = this.staff.id
|
||||
|
@ -129,9 +129,9 @@
|
||||
<div class="box-bottom">
|
||||
<div>
|
||||
<div class="price_">¥{{realAmount}}</div>
|
||||
<div class="price_prefer">优惠合计:¥{{disTotal}}元</div>
|
||||
<div class="price_prefer">优惠合计:¥{{disTotal}}</div>
|
||||
</div>
|
||||
<div class="anniu">立即结算</div>
|
||||
<div class="anniu" @click="settlement()">立即结算</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -249,23 +249,23 @@
|
||||
|
||||
</div>
|
||||
<div class="wrap-tc">
|
||||
<div class="tc_wa" :class="{'tc-active' : freeIndex == index }" @click="setFreeIndex(index)"
|
||||
v-for="(item,index) in freeTicketList">{{ item.name }}
|
||||
<div class="tc_wa" :class="{'tc-active' : item.id == sendCoupon.id }" @click="setFreeIndex(item)" v-for="(item,index) in sendCouponList">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right_tc">
|
||||
<div style="font-weight: 600;font-size: 16px;color: #333333;text-align: center;margin-bottom: 15px">
|
||||
优惠价格固定1元
|
||||
{{sendCoupon.name}}
|
||||
</div>
|
||||
<div style="font-weight: 600;font-size: 16px;color: #333333;margin-bottom: 10px">油品立减券</div>
|
||||
<div style="margin-bottom: 10px">可用时间:周一至周日 全天</div>
|
||||
<div style="font-weight: 600;font-size: 16px;color: #333333;margin-bottom: 10px">{{sendCoupon.type}}</div>
|
||||
|
||||
<div style="display: flex">
|
||||
<div style="width: 70px">可用日期:</div>
|
||||
<div style="width: 150px">2024-09-01 12:00:00至2024-09-01 12:00:00</div>
|
||||
<div style="width: 70px">日期规则:</div>
|
||||
<div style="width: 150px"> {{sendCoupon.dateText}}</div>
|
||||
</div>
|
||||
<div style="font-weight: 600;font-size: 16px;color: #333333;margin-bottom: 5px">使用规则</div>
|
||||
<div>优惠说明:价值10元代金券一张消费满100可用</div>
|
||||
<div>{{sendCoupon.ruleText}}</div>
|
||||
<div style="margin-top: 20px;text-align: end">
|
||||
|
||||
</div>
|
||||
@ -274,7 +274,7 @@
|
||||
|
||||
</div>
|
||||
<div style="display: flex;justify-content: center">
|
||||
<el-button type="primary" >确定赠送</el-button>
|
||||
<el-button type="primary" @click="sendCouponClick()" >确定赠送</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
@ -538,7 +538,14 @@ import pickUp from './newHomeComponents/pickUpTheOrder.vue'
|
||||
import accountPending from './newHomeComponents/accountPending.vue'
|
||||
import memberRecharge from './newHomeComponents/memberRecharge.vue'
|
||||
import refuelingAmount from './newHomeComponents/refuelingAmount.vue'
|
||||
import { cashRegisterList, cashRegisterGoodsList,getActivityList,getCouponList,getCanUseCoupon } from '@/api/newHome/newHome.js'
|
||||
import {
|
||||
cashRegisterList,
|
||||
cashRegisterGoodsList,
|
||||
getActivityList,
|
||||
getCouponList,
|
||||
getCanUseCoupon,
|
||||
sendCouponFun
|
||||
} from '@/api/newHome/newHome.js'
|
||||
import {QRCodeByStoreId} from "@/api/staff/qrcode";
|
||||
import {userListByPhone} from "@/api/cashier/user";
|
||||
|
||||
@ -551,6 +558,7 @@ import {
|
||||
import {getReturnCode} from "@/api/print";
|
||||
|
||||
export default {
|
||||
dicts: ['CardCoupon_type'],
|
||||
data() {
|
||||
return {
|
||||
payForm:{
|
||||
@ -559,6 +567,7 @@ export default {
|
||||
authCode:null,
|
||||
seekZero:0.00
|
||||
},
|
||||
sendCoupon:{},
|
||||
//可参加的活动
|
||||
activityList:[],
|
||||
//可用优惠券
|
||||
@ -613,32 +622,6 @@ export default {
|
||||
showCoupon: true,
|
||||
freeTicket:false,
|
||||
freeIndex:0,
|
||||
freeTicketList:[
|
||||
{
|
||||
name: '油品券',
|
||||
num: '0'
|
||||
},
|
||||
{
|
||||
name: '储值卡券',
|
||||
num: '0'
|
||||
},
|
||||
{
|
||||
name: '会员卡券',
|
||||
num: '0'
|
||||
},
|
||||
{
|
||||
name: '油品券',
|
||||
num: '0'
|
||||
},
|
||||
{
|
||||
name: '储值卡券',
|
||||
num: '0'
|
||||
},
|
||||
{
|
||||
name: '会员卡券',
|
||||
num: '0'
|
||||
},
|
||||
],
|
||||
nums:0,
|
||||
payList: [
|
||||
],
|
||||
@ -676,6 +659,7 @@ export default {
|
||||
//会员搜索列表
|
||||
vipUserList:[],
|
||||
chooseVipUser:{},
|
||||
couponTypeList:[],
|
||||
cardValueForm:{
|
||||
cardValueId: '', // 储值卡id
|
||||
mtStaffId: '', //
|
||||
@ -785,6 +769,7 @@ export default {
|
||||
this.getGoodsList()
|
||||
this.getQRCodeInfoByStoreId(0);
|
||||
this.getPayList()
|
||||
this.getCouponType()
|
||||
},
|
||||
|
||||
computed: {
|
||||
@ -820,6 +805,18 @@ export default {
|
||||
|
||||
},
|
||||
methods: {
|
||||
sendCouponClick(){
|
||||
//this.sendCoupon this.chooseVipUser.id
|
||||
this.sendCoupon.mtUserId = this.chooseVipUser.id
|
||||
this.sendCoupon.fromType = "4"
|
||||
this.sendCoupon.cardCouponId = this.sendCoupon.id
|
||||
sendCouponFun(this.sendCoupon).then(
|
||||
res=>{
|
||||
this.$message.success("赠送成功")
|
||||
this.freeTicket = false
|
||||
}
|
||||
)
|
||||
},
|
||||
handleCilone(value){
|
||||
console.log(value)
|
||||
},
|
||||
@ -901,23 +898,14 @@ export default {
|
||||
},
|
||||
async collection1() {
|
||||
let makeChange = 0
|
||||
|
||||
if (!this.payForm.authCode && this.payForm.paymentType !== "CASH") {
|
||||
this.$message.error('请先扫码');
|
||||
return
|
||||
}else {
|
||||
if (this.payForm.authCode<this.payForm.amount || this.seekZero<0){
|
||||
this.$modal.msgError("请输入正确的金额");
|
||||
return;
|
||||
}
|
||||
if (!this.payForm.authCode){
|
||||
this.$modal.msgError("请输入正确的金额");
|
||||
return;
|
||||
}
|
||||
makeChange = this.seekZero
|
||||
}
|
||||
// 会员id 会员名字会员手机号码
|
||||
this.payForm.mtUserId = this.chooseVipUser.id
|
||||
if (this.chooseVipUser.id){
|
||||
this.payForm.mtUserId = this.chooseVipUser.id
|
||||
}
|
||||
// 现金找零金额
|
||||
this.payForm.seekZero = makeChange
|
||||
this.payForm.payChannel = 'cashier'
|
||||
@ -1022,6 +1010,14 @@ export default {
|
||||
this.isPay = true
|
||||
//this.getCode(this.realyPayBills, this.flag)
|
||||
},
|
||||
// 立即结算
|
||||
async settlement(){
|
||||
this.payForm.realyPayBills = this.realAmount
|
||||
this.payForm.paymentType = this.payWay
|
||||
this.flag = 3
|
||||
this.openConfirm = true;
|
||||
this.isPay = true
|
||||
},
|
||||
// 网络下发之后获取条码
|
||||
getCode(amount,flag) {
|
||||
console.log("payType",this.payForm.payType) // 现金不参与
|
||||
@ -1323,12 +1319,90 @@ export default {
|
||||
addVip() {
|
||||
this.newMember = true
|
||||
},
|
||||
setFreeIndex(index){
|
||||
this.freeIndex = index
|
||||
setFreeIndex(data){
|
||||
//根据字段处理显示
|
||||
let dateText="";
|
||||
if (data.availableOrUn==0){
|
||||
dateText+="适用时间 "
|
||||
}else {
|
||||
dateText+="不适用时间 "
|
||||
}
|
||||
if (data.availableType==1){
|
||||
//每周
|
||||
dateText+="每周 "
|
||||
}else {
|
||||
dateText+="每月 "
|
||||
}
|
||||
if (data.availableOrUn==0){
|
||||
dateText+=data.availableDay +" 可用"
|
||||
}else {
|
||||
dateText+=data.availableDay +" 不可用"
|
||||
}
|
||||
|
||||
data.dateText = dateText
|
||||
let amountRule = "";
|
||||
if (data.type==1){
|
||||
amountRule += "消费条件: "
|
||||
if (data.useType=="1"){
|
||||
amountRule +="订单金额"
|
||||
}else {
|
||||
amountRule +="实收金额"
|
||||
}
|
||||
amountRule +="满足金额 "+data.reachAmount
|
||||
amountRule +="优惠 "+data.reduceAmount
|
||||
}else if (data.type==2){
|
||||
amountRule += "兑换内容: "+data.exchangeContent
|
||||
|
||||
}else if (data.type==3) {
|
||||
amountRule = "";
|
||||
amountRule += "优惠条件: "
|
||||
if (data.useType == "1") {
|
||||
amountRule += "订单金额"
|
||||
} else {
|
||||
amountRule += "实收金额"
|
||||
}
|
||||
amountRule += "金额起 " + data.zkStartAmount
|
||||
amountRule += "金额止 " + data.zkEndAmount
|
||||
amountRule += data.zkData * 10 + "折"
|
||||
}else if (data.type==4) {
|
||||
amountRule = "";
|
||||
amountRule += "消费条件: "
|
||||
if (data.useType == "1") {
|
||||
amountRule += "订单金额"
|
||||
} else {
|
||||
amountRule += "实收金额"
|
||||
}
|
||||
amountRule += "金额满 " + data.reachAmount+" 每"+data.ljOilNum +"L,减"+data.ljOilAmount+"元"
|
||||
}else if (data.type==5) {
|
||||
amountRule += "消费条件: "
|
||||
if (data.useType=="1"){
|
||||
amountRule +="订单金额"
|
||||
}else {
|
||||
amountRule +="实收金额"
|
||||
}
|
||||
amountRule +="满足金额 "+data.reachAmount
|
||||
amountRule +="优惠 "+data.reduceAmount
|
||||
}
|
||||
data.ruleText = amountRule
|
||||
console.log(amountRule,dateText,this.couponTypeList)
|
||||
let tempType=""
|
||||
for (const item of this.couponTypeList) {
|
||||
if (item.dictValue==data.type){
|
||||
tempType = item.dictLabel
|
||||
}
|
||||
}
|
||||
data.type = tempType
|
||||
this.sendCoupon = data
|
||||
},
|
||||
// 获取支付方式
|
||||
getCouponType(){
|
||||
getDicts("CardCoupon_type").then( response => {
|
||||
this.couponTypeList = response.data;
|
||||
})
|
||||
},
|
||||
addFreeTicket(){
|
||||
getCanUseCoupon().then(res=>{
|
||||
this.s
|
||||
this.sendCouponList = res.data
|
||||
})
|
||||
this.freeTicket = true
|
||||
},
|
||||
|
139
fuintCashierWeb/src/views/cashier/NewComponents/writeList.vue
Normal file
139
fuintCashierWeb/src/views/cashier/NewComponents/writeList.vue
Normal file
@ -0,0 +1,139 @@
|
||||
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="top_new">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" style="width: 100%" :inline="true" >
|
||||
|
||||
<el-form-item label="" prop="payUser">
|
||||
<el-input
|
||||
v-model="queryParams.payUser"
|
||||
placeholder="请选择优惠券名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="payUser">
|
||||
<el-input
|
||||
v-model="queryParams.payUser"
|
||||
placeholder="请输入用户手机号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-date-picker
|
||||
v-model="beginTime"
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
placeholder="交易开始日期">
|
||||
</el-date-picker>
|
||||
至
|
||||
<el-date-picker
|
||||
v-model="endTime"
|
||||
style="width: 160px"
|
||||
type="date"
|
||||
placeholder="交易结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item >
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="height: 32px;width: 20%;display: flex;justify-content: flex-end">
|
||||
<el-button type="primary" icon="el-icon-search" @click="">查询</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="">重置</el-button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-box">
|
||||
<el-table
|
||||
:data="list"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column type="index" width="50" align="center" label="序号"/>
|
||||
<el-table-column label="优惠券名称" align="center" prop="orderNo" width="220"/>
|
||||
<el-table-column label="优惠券类型" align="center" prop="terminal"/>
|
||||
<el-table-column label="用户手机号" align="center" prop="terminal"/>
|
||||
<el-table-column label="有效日期" align="center" prop="terminal"/>
|
||||
<el-table-column label="可用时间" align="center" prop="terminal"/>
|
||||
<el-table-column label="兑换内容" align="center" prop="terminal"/>
|
||||
<el-table-column label="使用条件" align="center" prop="terminal"/>
|
||||
<el-table-column label="核销人" align="center" prop="terminal"/>
|
||||
<el-table-column label="核销时间" align="center" prop="terminal"/>
|
||||
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button style="color: #fe8c4a" @click="patchwork(scope.row)"
|
||||
type="text" >补打
|
||||
</el-button>
|
||||
<el-button style="color: #fe8c4a"
|
||||
v-if="scope.row.status === 'paid'"
|
||||
@click="refHandleRefund(scope.row.id)"
|
||||
type="text">退款
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<div class="pagination-box">
|
||||
<el-pagination
|
||||
background
|
||||
layout="prev, pager, next"
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@current-change="getList">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "order_Goods",
|
||||
data() {
|
||||
return {
|
||||
List:[],
|
||||
beginTime:'',
|
||||
endTime:'',
|
||||
queryParams: {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
total:0
|
||||
}
|
||||
|
||||
},
|
||||
methods:{
|
||||
getList(){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.top_new{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
height: 64px;
|
||||
margin-bottom: 5px;
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.table-box {
|
||||
width: 100%;
|
||||
height: 66vh;
|
||||
overflow: auto;
|
||||
background: #FFF;
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
min-height: 85vh;
|
||||
}
|
||||
</style>
|
@ -748,12 +748,13 @@ export default {
|
||||
}
|
||||
}
|
||||
.app-left-box{
|
||||
width: 100%;
|
||||
width: 80%;
|
||||
margin-left: 15%;
|
||||
height: 60px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
//justify-content: center;
|
||||
color: #909399;
|
||||
}
|
||||
.container-top{
|
||||
|
@ -938,6 +938,5 @@ export default {
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
height: 64px;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
@ -1,8 +1,12 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
|
||||
<div class="breadcrumb" >
|
||||
<span style="cursor: pointer" @click="goBack">当前位置:会员--会员详情</span>
|
||||
|
||||
</div>
|
||||
<div class="app-cont">
|
||||
<div class="wit_box">
|
||||
|
||||
<div class="user-box">
|
||||
<div class="d-s">
|
||||
<img v-if="form.avatar" :src="baseUrl+form.avatar" style="width: 40px;height: 40px;border-radius: 50%">
|
||||
@ -621,6 +625,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -876,6 +881,7 @@ export default {
|
||||
this.getAllAmount()
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 计算找零金额
|
||||
changeSeekZero(){
|
||||
if (this.flag === 1) {
|
||||
@ -1829,7 +1835,7 @@ export default {
|
||||
},
|
||||
// 返回
|
||||
goBack() {
|
||||
this.$router.back(-1);
|
||||
this.$router.go(-1);
|
||||
},
|
||||
// 积分表、电子储值卡详情表、积分详情表、电子储值卡表、电子储值卡模板表、用户电子储值卡关联表、
|
||||
|
||||
@ -2099,8 +2105,8 @@ export default {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
height: 85vh;
|
||||
padding: 10px 15px ;
|
||||
height: 82vh;
|
||||
}
|
||||
.user-box{
|
||||
width: 100%;
|
||||
@ -2112,6 +2118,15 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.gang{
|
||||
width: 2px;
|
||||
height: 14px;
|
||||
background: #FF9655;
|
||||
}
|
||||
.g-class{
|
||||
font-size: 14px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.sm-box{
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
@ -2125,15 +2140,7 @@ export default {
|
||||
.rsw{
|
||||
width: 25%;
|
||||
}
|
||||
.gang{
|
||||
width: 2px;
|
||||
height: 14px;
|
||||
background: #FF9655;
|
||||
}
|
||||
.g-class{
|
||||
font-size: 14px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.info-box{
|
||||
display: flex;
|
||||
width: 100%;
|
||||
@ -2141,4 +2148,19 @@ export default {
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.breadcrumb{
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
color: #666666;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.app-cont{
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,13 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="comment-box">
|
||||
<el-radio-group v-model="cardList" size="mini" style="margin-bottom: 30px;" @change="changeStatus()">
|
||||
<el-radio-button label="notUse">未使用</el-radio-button>
|
||||
<el-radio-button label="used">已使用</el-radio-button>
|
||||
<el-radio-button label="expired">已过期</el-radio-button>
|
||||
<el-radio-button label="whole">全部</el-radio-button>
|
||||
</el-radio-group>
|
||||
<div>
|
||||
<div class="table-box">
|
||||
<el-table ref="tables" border v-loading="loading" :data="list">
|
||||
<el-table-column label="序号" type="index"/>
|
||||
<el-table-column align="center" prop="storeName" label="所属油站">
|
||||
<template slot-scope="scope">
|
||||
<span>{{store.name}}</span>
|
||||
@ -161,5 +162,13 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.comment-box{
|
||||
box-sizing: border-box;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.table-box{
|
||||
width: 100%;
|
||||
height: 60vh;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,6 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="comment-box">
|
||||
<div class="d-s" style="margin-bottom: 10px">
|
||||
<div class="gang"></div>
|
||||
<div class="g-class">商品消费记录</div>
|
||||
</div>
|
||||
<div class="table-box">
|
||||
<el-table ref="tables" border v-loading="loading" :data="list">
|
||||
<el-table-column label="序号" type="index"/>
|
||||
<el-table-column label="所属油站" prop="storeName" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{store.name}}</span>
|
||||
@ -30,7 +36,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
@ -90,5 +96,26 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.d-s{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.gang{
|
||||
width: 2px;
|
||||
height: 14px;
|
||||
background: #FF9655;
|
||||
}
|
||||
.g-class{
|
||||
font-size: 14px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.comment-box{
|
||||
box-sizing: border-box;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.table-box{
|
||||
width: 100%;
|
||||
height: 60vh;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,6 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="comment-box">
|
||||
<div class="d-s" style="margin-bottom: 10px">
|
||||
<div class="gang"></div>
|
||||
<div class="g-class">成长值记录</div>
|
||||
</div>
|
||||
<div class="table-box">
|
||||
<el-table ref="tables" border v-loading="loading" :data="list">
|
||||
<el-table-column label="序号" type="index"/>
|
||||
<el-table-column label="所属油站" prop="storeName" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.storeName ? scope.row.storeName : storeName}}</span>
|
||||
@ -19,7 +25,7 @@
|
||||
<el-table-column label="变动后成长值" align="center" prop="afterTheChange" />
|
||||
<el-table-column label="描述" align="center" prop="fromType" />
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
@ -75,5 +81,26 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.d-s{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.gang{
|
||||
width: 2px;
|
||||
height: 14px;
|
||||
background: #FF9655;
|
||||
}
|
||||
.g-class{
|
||||
font-size: 14px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.comment-box{
|
||||
box-sizing: border-box;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.table-box{
|
||||
width: 100%;
|
||||
height: 60vh;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,6 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="comment-box">
|
||||
<div class="d-s" style="margin-bottom: 10px">
|
||||
<div class="gang"></div>
|
||||
<div class="g-class">油品消费记录</div>
|
||||
</div>
|
||||
<div class="table-box">
|
||||
<el-table ref="tables" border v-loading="loading" :data="list">
|
||||
<el-table-column label="序号" type="index"/>
|
||||
<el-table-column label="所属油站" prop="storeName" align="center"/>
|
||||
<el-table-column label="订单时间" align="center" prop="createTime"/>
|
||||
<el-table-column label="交易终端" align="center" prop="payType">
|
||||
@ -44,7 +50,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
@ -140,5 +146,26 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.d-s{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.gang{
|
||||
width: 2px;
|
||||
height: 14px;
|
||||
background: #FF9655;
|
||||
}
|
||||
.g-class{
|
||||
font-size: 14px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.comment-box{
|
||||
box-sizing: border-box;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.table-box{
|
||||
width: 100%;
|
||||
height: 60vh;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,6 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table ref="tables2" key="2" v-loading="loading" :data="fuelList">
|
||||
<div class="comment-box">
|
||||
<div class="d-s" style="margin-bottom: 10px">
|
||||
<div class="gang"></div>
|
||||
<div class="g-class">囤油卡记录</div>
|
||||
</div>
|
||||
<div class="table-box">
|
||||
<el-table ref="tables2" border key="2" v-loading="loading" :data="fuelList">
|
||||
<el-table-column label="序号" type="index"/>
|
||||
<el-table-column align="center" label="所属油站" prop="storeName">
|
||||
<template slot-scope="scope">
|
||||
<span>{{store.name}}</span>
|
||||
@ -32,7 +38,7 @@
|
||||
<el-table-column label="描述" align="center" prop="fromType"/>
|
||||
<el-table-column label="变动时间" align="center" prop="createTime"/>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<pagination
|
||||
:total="fuelTotal"
|
||||
:page.sync="queryFuelParams.page"
|
||||
@ -125,5 +131,26 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.d-s{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.gang{
|
||||
width: 2px;
|
||||
height: 14px;
|
||||
background: #FF9655;
|
||||
}
|
||||
.g-class{
|
||||
font-size: 14px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.comment-box{
|
||||
box-sizing: border-box;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.table-box{
|
||||
width: 100%;
|
||||
height: 60vh;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,6 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="comment-box">
|
||||
<div class="d-s" style="margin-bottom: 10px">
|
||||
<div class="gang"></div>
|
||||
<div class="g-class">会员资产</div>
|
||||
</div>
|
||||
<div class="table-box">
|
||||
|
||||
|
||||
<el-table ref="tables" border v-loading="loading" :data="list">
|
||||
<el-table-column label="序号" type="index"/>
|
||||
<el-table-column label="所属油站" prop="storeName" align="center"/>
|
||||
<el-table-column label="变动时间" prop="createTime" align="center"/>
|
||||
<el-table-column label="类型" align="center" prop="changeType">
|
||||
@ -15,7 +23,7 @@
|
||||
<el-table-column label="变动后积分" align="center" prop="currentPoints" />
|
||||
<el-table-column label="描述" align="center" prop="changeReason"/>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
@ -64,5 +72,26 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.d-s{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.gang{
|
||||
width: 2px;
|
||||
height: 14px;
|
||||
background: #FF9655;
|
||||
}
|
||||
.g-class{
|
||||
font-size: 14px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.comment-box{
|
||||
box-sizing: border-box;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.table-box{
|
||||
width: 100%;
|
||||
height: 60vh;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,7 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="comment-box">
|
||||
<div class="d-s" style="margin-bottom: 10px">
|
||||
<div class="gang"></div>
|
||||
<div class="g-class">储值卡记录</div>
|
||||
</div>
|
||||
<div class="table-box">
|
||||
<el-table key="1" ref="tables" v-loading="loading" :data="cardList">
|
||||
<el-table-column label="序号" type="index"/>
|
||||
<el-table-column align="center" prop="storeName" label="所属油站"/>
|
||||
<!-- <el-table-column prop="date" label="变动账户"/> -->
|
||||
<el-table-column align="center" prop="changeType" label="类型">
|
||||
@ -20,7 +25,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="afterTheChange" label="变动后余额">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.afterTheChange?scope.row.afterTheChange : '/'}}</span>
|
||||
<span>{{ scope.row.afterTheChange?(scope.row.afterTheChange).toFixed(2) : '/'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -29,7 +34,7 @@
|
||||
<el-table-column align="center" prop="fromType" label="描述"/>
|
||||
<el-table-column align="center" prop="createTime" label="变动时间"/>
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<pagination
|
||||
:total="cardTotal"
|
||||
:page.sync="queryCardParams.page"
|
||||
@ -123,5 +128,26 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.d-s{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.gang{
|
||||
width: 2px;
|
||||
height: 14px;
|
||||
background: #FF9655;
|
||||
}
|
||||
.g-class{
|
||||
font-size: 14px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.comment-box{
|
||||
box-sizing: border-box;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.table-box{
|
||||
width: 100%;
|
||||
height: 60vh;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -51,32 +51,40 @@
|
||||
<view class="title_">
|
||||
支付方式
|
||||
</view>
|
||||
<view class="d-bs">
|
||||
<view class="d-bs" @click="oilOrder.payType=cardPayType">
|
||||
<image src="../../static/icon/hyk.png" style="width: 35px; height: 35px; "></image>
|
||||
<view class="br-box">
|
||||
<view style="font-size: 14px;">
|
||||
<view class="">会员卡类型</view>
|
||||
<view class="d-bs" style="align-items: center;border-bottom: none;"
|
||||
@click="cardType = true">
|
||||
<view style="font-size: 12px;">储值卡(余额:{{user.cardBalance}})</view>
|
||||
<view style="font-size: 12px;" v-if="chooseCard && chooseCard.fuelAmount>=0">
|
||||
囤油卡(余额:{{chooseCard.fuelAmount}})</view>
|
||||
<view style="font-size: 12px;" v-if="chooseCard && chooseCard.totalBalance>=0">
|
||||
车队卡(余额:{{chooseCard.totalBalance}})</view>
|
||||
<view style="font-size: 12px;" v-if="!chooseCard">储值卡(余额:{{user.cardBalance}})
|
||||
</view>
|
||||
<view style="line-height: 20px;">
|
||||
<u-icon name="arrow-right" size="12px"></u-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="anxuan">
|
||||
<view class="dian"></view>
|
||||
<view class="anxuan"
|
||||
:class="{'anxuan1': oilOrder.payType!='ALIPAY' && oilOrder.payType!='WECHAT'}">
|
||||
<view class="dian"
|
||||
:class="{'dian1': oilOrder.payType!='ALIPAY' && oilOrder.payType!='WECHAT'}"></view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-bs">
|
||||
<view class="d-bs" @click="oilOrder.payType=appltType">
|
||||
<image src="../../static/icon/wz.png" style="width: 35px; height: 35px; "></image>
|
||||
<view class="br-box">
|
||||
<view class="">微信</view>
|
||||
<view class="anxuan">
|
||||
<view class="dian"></view>
|
||||
<view class="anxuan"
|
||||
:class="{'anxuan1': oilOrder.payType=='ALIPAY' || oilOrder.payType=='WECHAT'}">
|
||||
<view class="dian"
|
||||
:class="{'dian1': oilOrder.payType=='ALIPAY' || oilOrder.payType=='WECHAT'}"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -88,7 +96,7 @@
|
||||
<view class="d-bs" style="box-sizing: border-box; padding: 20px;" @click="selectCoupon = true">
|
||||
<view class="">优惠券</view>
|
||||
<view class="d-s">
|
||||
<view class="">-20.00</view>
|
||||
<view class="">-{{oilOrder.discountAmount}}</view>
|
||||
<u-icon name="arrow-right"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
@ -109,7 +117,7 @@
|
||||
<!-- 支付信息 -->
|
||||
<view class="bs-box">
|
||||
<view class="">
|
||||
<view class="onetitle">¥{{oilOrder.payAmount}}</view>
|
||||
<view class="onetitle">¥{{oilOrder.orderAmount - oilOrder.discountAmount}}</view>
|
||||
<view class="orsize">共优惠¥{{oilOrder.discountAmount || 0}}</view>
|
||||
</view>
|
||||
<view class="d-s">
|
||||
@ -143,24 +151,26 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponBox" v-if="tabIndex == 0">
|
||||
<view class="cou_top">
|
||||
<view class="d-s">
|
||||
<view class="qaz"></view>
|
||||
<view class="c_title">油品消费满减券</view>
|
||||
<view v-for="(item,index) in couponList" @click="chooseCoupon(item)">
|
||||
<view class="cou_top">
|
||||
<view class="d-s">
|
||||
<view class="qaz"></view>
|
||||
<view class="c_title">{{item.name}}</view>
|
||||
</view>
|
||||
<view class="c-r-num">¥{{item.disAmount}}</view>
|
||||
</view>
|
||||
<view class="c-r-num">¥10</view>
|
||||
</view>
|
||||
<view class="cou_top">
|
||||
<view class="sm_size">有效期:2024-08-05 14:15:12~2024-08-15 14:15:11</view>
|
||||
<view class="sm_r-zie">满200可用</view>
|
||||
</view>
|
||||
<view class="dashed_box"></view>
|
||||
<view class="cou_top">
|
||||
<view class="sb_size" :class="{ 'sb_xl' : RandR == true }">
|
||||
以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡
|
||||
<view class="cou_top">
|
||||
<view class="sm_size">有效期:2024-08-05 14:15:12~2024-08-15 14:15:11</view>
|
||||
<view class="sm_r-zie">满200可用</view>
|
||||
</view>
|
||||
<view class="dashed_box"></view>
|
||||
<view class="cou_top">
|
||||
<view class="sb_size" :class="{ 'sb_xl' : RandR == true }">
|
||||
以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡、会以下支付方式可用:微信、支付宝、云闪付、pos刷卡
|
||||
</view>
|
||||
<view class="sm_r-zie" style="height: 14px; " @click="RandR =! RandR">适用详情 <u-icon
|
||||
name="arrow-right" color="#E02020" size="10"></u-icon> </view>
|
||||
</view>
|
||||
<view class="sm_r-zie" style="height: 14px; " @click="RandR =! RandR">适用详情 <u-icon
|
||||
name="arrow-right" color="#E02020" size="10"></u-icon> </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponBox_h" v-if="tabIndex == 1">
|
||||
@ -197,7 +207,7 @@
|
||||
<u-popup :show="cardType" closeable="true" mode="bottom" :round="10" @close="cardTypeclose">
|
||||
<view class="popup-box">
|
||||
<view class="p_title">选择会员卡类型</view>
|
||||
<view class="c_pox">
|
||||
<view class="c_pox" @click="chooseUserCard('card_value')">
|
||||
<view class="c_bs" style="margin-bottom: 15px;">
|
||||
<view class="">储值卡</view>
|
||||
<view class="anniubai">充值</view>
|
||||
@ -208,7 +218,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="c_pox" style="background: url('../../static/imgs/tyktc.png'); "
|
||||
v-for="(item,index) in oilCardList" :key="index">
|
||||
v-for="(item,index) in oilCardList" :key="index" @click="chooseUserCard('fule_card',item)">
|
||||
<view class="c_bs" style="margin-bottom: 15px; ">
|
||||
<view class="">囤油卡</view>
|
||||
<view class="anniubai" style="color: #70D0C7;">充值</view>
|
||||
@ -218,8 +228,9 @@
|
||||
<!-- <view class="">NO.xxxxxxxxxxxxxxxxx</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="c_pox">
|
||||
<view class="c_bs" style="margin-bottom: 15px;" v-for="(item,index) in fleetList" :key="index">
|
||||
<view class="c_pox" v-for="(item,index) in fleetList" :key="index"
|
||||
@click="chooseUserCard(item.cardType=='储值卡' ? 'car_card_value' : 'car_fule_card',item)">
|
||||
<view class="c_bs" style="margin-bottom: 15px;">
|
||||
<view class="">{{item.fleetName}}</view>
|
||||
<view class="anniubai">充值</view>
|
||||
</view>
|
||||
@ -272,11 +283,20 @@
|
||||
<image src="../../static/imgs/zficon.png" style="width: 36px; height: 36px; "></image>
|
||||
<view class="p_ds" style="width: 85%;">
|
||||
<view class="">
|
||||
<view class="">消费应支付{{oilOrder.payAmount}}元</view>
|
||||
<view class="sm-size">会员-储值卡(余额:{{user.cardBalance}})</view>
|
||||
<view class="">消费应支付{{oilOrder.orderAmount - oilOrder.discountAmount
|
||||
}}元</view>
|
||||
<view class="sm-size" v-if="oilOrder.payType=='card_value'">
|
||||
会员-储值卡(余额:{{user.cardBalance}})</view>
|
||||
<view class="sm-size" v-if="oilOrder.payType=='fule_card'">
|
||||
会员-囤油卡(余额:{{chooseCard.fuelAmount}})</view>
|
||||
<view class="sm-size"
|
||||
v-if="oilOrder.payType=='car_card_value' || oilOrder.payType=='car_fule_card'">
|
||||
会员-车队卡(余额:{{chooseCard.totalBalance}})</view>
|
||||
<view class="sm-size" v-if="oilOrder.payType=='WECHAT'">微信</view>
|
||||
<view class="sm-size" v-if="oilOrder.payType=='ALIPAY'">支付宝</view>
|
||||
</view>
|
||||
<view class="anxuan">
|
||||
<view class="dian"></view>
|
||||
<view class="anxuan anxuan1">
|
||||
<view class="dian dian1"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -428,7 +448,9 @@
|
||||
orderInfo: {},
|
||||
user: {},
|
||||
oilCardList: [],
|
||||
fleetList: []
|
||||
fleetList: [],
|
||||
chooseCard: null,
|
||||
cardPayType: 'card_value'
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@ -496,6 +518,18 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 选择会员卡
|
||||
chooseUserCard(payType, data) {
|
||||
this.oilOrder.payType = payType
|
||||
this.cardPayType = payType
|
||||
if (data) {
|
||||
this.chooseCard = data
|
||||
} else {
|
||||
this.chooseCard = null
|
||||
}
|
||||
this.cardType = false
|
||||
console.log(this.chooseCard, 515);
|
||||
},
|
||||
// 获取储值卡信息
|
||||
getOilCard() {
|
||||
request({
|
||||
@ -508,6 +542,19 @@
|
||||
this.fleetList = res.data.fleetInfoUniVos
|
||||
})
|
||||
},
|
||||
// 获取消费有礼信息
|
||||
getConsume(){
|
||||
request({
|
||||
url: "pay/paycenter/cashRegisterSpendWisely",
|
||||
method: 'post',
|
||||
data:{
|
||||
storeId:this.storeId,
|
||||
userId:uni.getStorageSync("userId"),
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res, 555);
|
||||
})
|
||||
},
|
||||
// 支付接口
|
||||
payment() {
|
||||
this.ifLogin = this.AppToken ? true : false
|
||||
@ -659,6 +706,7 @@
|
||||
if (this.oilOrder.orderAmount) {
|
||||
this.oilOrder.payAmount = this.oilOrder.orderAmount - this.oilOrder.discountAmount
|
||||
this.oilOrder.oilNum = (this.oilOrder.orderAmount / this.oilPrice).toFixed(2)
|
||||
this.getCouponList()
|
||||
}
|
||||
},
|
||||
getCouponList() {
|
||||
@ -668,13 +716,20 @@
|
||||
data: {
|
||||
userId: uni.getStorageSync('userId'),
|
||||
oilId: this.oilOrder.oils,
|
||||
oilAmount: this.oilOrder.amount,
|
||||
oilAmount: this.oilOrder.orderAmount,
|
||||
oilLiter: this.oilOrder.oilNum,
|
||||
payWay: this.oilOrder.payType,
|
||||
oilId:this.oilOrder.oils
|
||||
},
|
||||
}).then((res) => {
|
||||
|
||||
}).catch(err => {})
|
||||
console.log(res, 701);
|
||||
this.couponList = res.data
|
||||
})
|
||||
},
|
||||
// 选择优惠券
|
||||
chooseCoupon(data){
|
||||
this.oilOrder.discountAmount = data.disAmount
|
||||
this.oilOrder.couponId = data.id
|
||||
},
|
||||
Couponclose() {
|
||||
this.selectCoupon = false
|
||||
@ -730,19 +785,36 @@
|
||||
})
|
||||
return;
|
||||
}
|
||||
let _this = this
|
||||
request({
|
||||
url: "business/petrolStationManagement/oilTank/" + uni.getStorageSync('tankId'),
|
||||
method: 'get',
|
||||
}).then((res) => {
|
||||
if (res.data.storedQuantity - this.oilOrder.oilNum < 0) {
|
||||
if (res.data.storedQuantity - _this.oilOrder.oilNum < 0) {
|
||||
uni.showToast({
|
||||
title: "所加油的升数大于油罐内的升数,请重新选择加油升数",
|
||||
icon: "none"
|
||||
})
|
||||
return;
|
||||
} else {
|
||||
this.ConfirmPayment = true
|
||||
this.addOrder()
|
||||
_this.ConfirmPayment = true
|
||||
if (_this.oilOrder.payType == 'card_value') {
|
||||
_this.oilOrder.balanceAmount = _this.oilOrder.payAmount
|
||||
_this.oilOrder.payAmount = 0
|
||||
}
|
||||
if (_this.oilOrder.payType == 'fule_card') {
|
||||
_this.oilOrder.oilCardAmount = _this.oilOrder.oilNum
|
||||
_this.oilOrder.payAmount = 0
|
||||
}
|
||||
if (_this.oilOrder.payType == 'car_card_value') {
|
||||
_this.oilOrder.balanceAmount = _this.oilOrder.payAmount
|
||||
_this.oilOrder.payAmount = 0
|
||||
}
|
||||
if (_this.oilOrder.payType == 'car_fule_card') {
|
||||
_this.oilOrder.oilCardAmount = _this.oilOrder.oilNum
|
||||
_this.oilOrder.payAmount = 0
|
||||
}
|
||||
_this.addOrder()
|
||||
}
|
||||
})
|
||||
|
||||
@ -1483,14 +1555,22 @@
|
||||
|
||||
}
|
||||
|
||||
.anxuan1 {
|
||||
|
||||
border: 1px solid #FF9655 !important;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.dian {
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 50%;
|
||||
background: #999999;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.dian1 {
|
||||
background: #FF9655 !important;
|
||||
}
|
||||
|
||||
.sm-size {
|
||||
|
@ -38,7 +38,7 @@
|
||||
<view class="card_2">
|
||||
<view class="top_card">
|
||||
<view class="">礼品卡</view>
|
||||
<view class="">
|
||||
<view class="" @click="goGiftDetails()">
|
||||
兑换记录
|
||||
</view>
|
||||
</view>
|
||||
@ -117,19 +117,16 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
goFleetDetails() {
|
||||
|
||||
goGiftDetails() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesHome/RechargeRecords/RechargeRecords'
|
||||
})
|
||||
},
|
||||
goCode() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesHome/QRcode/QRcode'
|
||||
})
|
||||
},
|
||||
gocard(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesHome/oilRecharge/oilRecharge?id=' + id
|
||||
})
|
||||
},
|
||||
goDetails(val, fleetId) {
|
||||
if (fleetId) {
|
||||
uni.navigateTo({
|
||||
@ -159,7 +156,7 @@
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.cardBalance = res.data
|
||||
console.log(res,163);
|
||||
console.log(res, 163);
|
||||
this.cardsList = res.data.userFuel
|
||||
}
|
||||
})
|
||||
|
@ -5,7 +5,8 @@
|
||||
<view class="f-box" v-for="(item,index) in list" :key="index" @click="goDetails(item.id)">
|
||||
<view class="f-top">{{item.storeName}}可用</view>
|
||||
<view class="f-bs">
|
||||
<image :src="item.backgroundImage" v-if="item.backgroundImage" style="width: 60px; height: 60px; "></image>
|
||||
<image :src="item.backgroundImage" v-if="item.backgroundImage" style="width: 60px; height: 60px; ">
|
||||
</image>
|
||||
<image src="../../static/logo.png" v-else style="width: 60px; height: 60px; "></image>
|
||||
<view class="r-box">
|
||||
<view class="">
|
||||
@ -23,6 +24,11 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="list.length==0" style="margin-top: 20vh;">
|
||||
<u-empty mode="car" icon="http://47.94.122.58:83/queshengye.png" text="您当前没有优惠券~">
|
||||
</u-empty>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -63,7 +69,7 @@
|
||||
method: 'get',
|
||||
params: this.queryParams
|
||||
}).then(res => {
|
||||
console.log(res,66);
|
||||
console.log(res, 66);
|
||||
if (res.code == 200) {
|
||||
this.list = res.data.records
|
||||
this.total = res.data.total
|
||||
@ -77,7 +83,7 @@
|
||||
},
|
||||
goDetails(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesHome/certificate/details?certificateId='+id
|
||||
url: '/pagesHome/certificate/details?certificateId=' + id
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@
|
||||
<view class="input-box">
|
||||
<view class="i-title">充值金额</view>
|
||||
<view class="n_input">
|
||||
<input type="text" v-model="rechargeOrder.balance" :disabled="isEdit">
|
||||
<input type="text" v-model="rechargeCardOrder.rechargeBalance" :disabled="isEdit">
|
||||
<view class="r-title">
|
||||
{{staff.realName || "--"}}
|
||||
</view>
|
||||
@ -90,8 +90,11 @@
|
||||
|
||||
<view style="width: 100%; height: 88px; "></view>
|
||||
<view class="bottom_">
|
||||
<view class="anniu_" @click="goRecharge()">
|
||||
<view class="anniu_" v-if="type=='balance'" @click="goRecharge()">
|
||||
立即充值{{rechargeOrder.balance}}元
|
||||
</view>
|
||||
<view class="anniu_" v-if="type=='oilCard'" @click="addFuleCarRecords()">
|
||||
立即充值{{rechargeCardOrder.rechargeBalance}}元
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="show" :closeable="true" :round="10" mode="bottom" @close="close">
|
||||
@ -116,7 +119,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
type: 'balance',
|
||||
type: 'oilCard',
|
||||
show: false,
|
||||
windex: 0,
|
||||
storeId: uni.getStorageSync("storeId"),
|
||||
@ -146,6 +149,15 @@
|
||||
balance: 0,
|
||||
types: 0
|
||||
},
|
||||
rechargeCardOrder: {
|
||||
payType: uni.getStorageSync("appltType"),
|
||||
mtStaffId: '',
|
||||
id: '',
|
||||
storeId: uni.getStorageSync("storeId"),
|
||||
chainStoreId: uni.getStorageSync("chainStoreId"),
|
||||
cardFavorableId: '',
|
||||
cardRecordId: '',
|
||||
},
|
||||
isEdit: true,
|
||||
describe: [],
|
||||
// 小程序类型 微信 WECHAT 支付宝 ALIPAY
|
||||
@ -159,15 +171,100 @@
|
||||
this.getDescribe()
|
||||
},
|
||||
methods: {
|
||||
// 调用充值接口
|
||||
//囤油卡充值
|
||||
addFuleCarRecords() {
|
||||
this.rechargeCardOrder.mtStaffId = this.staff.id
|
||||
let _this = this
|
||||
request({
|
||||
url: 'business/marketingActivity/cardFuelRecord/addFuleCarRecords',
|
||||
method: 'post',
|
||||
data: _this.rechargeCardOrder,
|
||||
}).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (_this.appltType == "WECHAT") {
|
||||
if (!res.data.reservedPayInfo) {
|
||||
uni.showToast({
|
||||
title: '支付失败,请联系商家',
|
||||
icon: "none"
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
let payProvider = "wxpay"
|
||||
_this.orderInfo = JSON.parse(res.data.reservedPayInfo);
|
||||
uni.requestPayment({
|
||||
// 微信支付provider: 'wxpay' 支付宝支付 'alipay'
|
||||
provider: payProvider,
|
||||
timeStamp: _this.orderInfo.timeStamp,
|
||||
nonceStr: _this.orderInfo.nonceStr,
|
||||
package: _this.orderInfo.package,
|
||||
signType: 'MD5',
|
||||
paySign: _this.orderInfo.paySign,
|
||||
success: function(res) {
|
||||
console.log('success:', res);
|
||||
uni.reLaunch({
|
||||
url: '/pagesRefuel/orderSuccess/index'
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
request({
|
||||
url: "/business/marketingActivity/cardFuleOrders/updateOrderStatus",
|
||||
method: 'post',
|
||||
data: {
|
||||
"orderNo": res.data.orderNo,
|
||||
"status": "payFail"
|
||||
},
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: "支付失败!",
|
||||
icon: "error"
|
||||
})
|
||||
})
|
||||
console.log('fail:', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (_this.appltType == "ALIPAY") {
|
||||
if (!res.data.reservedTransactionId) {
|
||||
uni.showToast({
|
||||
title: '支付失败,请联系商家',
|
||||
icon: "none"
|
||||
})
|
||||
return;
|
||||
}
|
||||
my.tradePay({
|
||||
tradeNO: res.data.reservedTransactionId
|
||||
}, function(resp) {
|
||||
if (resp.resultCode == '9000') {
|
||||
console.log("支付成功")
|
||||
uni.reLaunch({
|
||||
url: '/pagesRefuel/orderSuccess/index'
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: "/business/marketingActivity/cardFuleOrders/updateOrderStatus",
|
||||
method: 'post',
|
||||
data: {
|
||||
"orderNo": res.data.orderNo,
|
||||
"status": "payFail"
|
||||
},
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: "支付失败!",
|
||||
icon: "error"
|
||||
})
|
||||
})
|
||||
console.log('支付失败,' + resp.resultCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 调用储值卡充值接口
|
||||
goRecharge() {
|
||||
if (this.type == 'oilCard') {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: "暂未开发!"
|
||||
})
|
||||
return;
|
||||
}
|
||||
this.rechargeOrder.mtStaffId = this.staff.id
|
||||
let _this = this
|
||||
request({
|
||||
url: 'business/marketingActivity/cardValueRecord',
|
||||
@ -212,7 +309,6 @@
|
||||
title: "支付失败!",
|
||||
icon: "error"
|
||||
})
|
||||
// console.log('fail:', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -300,7 +396,11 @@
|
||||
},
|
||||
}).then((res) => {
|
||||
this.oilRechargeList = res.data.records
|
||||
console.log(res, 271);
|
||||
if (res.data.records.length>0){
|
||||
this.rechargeCardOrder.rechargeBalance = res.data.records[0].rechargeBalance
|
||||
this.rechargeCardOrder.id = res.data.records[0].id
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
getUserBalance() {
|
||||
@ -338,7 +438,8 @@
|
||||
}
|
||||
}
|
||||
if (this.type == 'oilCard') {
|
||||
|
||||
this.rechargeCardOrder.rechargeBalance = data.rechargeBalance
|
||||
this.rechargeCardOrder.id =data.id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,16 +56,16 @@
|
||||
<view class="si_t">
|
||||
<view style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; ">
|
||||
<view class="title_">适用门店</view>
|
||||
<view class="d-s" style=" color: #FF2828; margin: 0px; ">
|
||||
<view class="d-s" style=" color: #FF2828; margin: 0px; " @click="goGoGo()">
|
||||
<image src="../../static/icon/reddh.png" style="width: 14px; height: 14px; "></image> 导航
|
||||
</view>
|
||||
</view>
|
||||
<view class="">中建锦绣广场二期站</view>
|
||||
<view class="">山东省济南市槐荫区 | 3.0km</view>
|
||||
<view class="">{{store.name}}</view>
|
||||
<view class="">{{store.address}} | {{distance}}km</view>
|
||||
</view>
|
||||
<!-- 顶部区域 -->
|
||||
|
||||
<u-overlay :show="show" @click="show = false">
|
||||
<u-overlay :show="show" @click="show = !show">
|
||||
<view class="warp">
|
||||
<view class="warp-cent" @tap.stop>
|
||||
<view class="title_or">扫码领会员</view>
|
||||
@ -134,7 +134,7 @@
|
||||
title: '',
|
||||
userId: '',
|
||||
storeId: '',
|
||||
show: true,
|
||||
show: false,
|
||||
options: {
|
||||
code: 'https://oilapi.youkerr.com/oily?storeId=' + uni.getStorageSync('storeId') + '&userId=' + uni
|
||||
.getStorageSync('userId') + '&type=yaoqingyouli',
|
||||
@ -142,7 +142,21 @@
|
||||
// .getStorageSync('userId'), // 生成二维码的值
|
||||
size: 400, // 460代表生成的二维码的宽高均为460rpx
|
||||
},
|
||||
|
||||
// 当前经度信息
|
||||
longitude: "",
|
||||
// 当前纬度信息
|
||||
latitude: "",
|
||||
// 店铺经度信息
|
||||
lon: "",
|
||||
// 店铺纬度信息
|
||||
lat: "",
|
||||
// 店铺信息
|
||||
store: {
|
||||
name: "测试油站",
|
||||
description: "济南分店",
|
||||
address: "济南槐荫区"
|
||||
},
|
||||
distance: 0,
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@ -208,8 +222,73 @@
|
||||
onShow() {
|
||||
this.getAllAmount();
|
||||
this.getActiveRecommendRecords();
|
||||
this.getAddress(uni.getStorageSync("storeId"))
|
||||
},
|
||||
methods: {
|
||||
goGoGo() {
|
||||
let lat = Number(this.lat)
|
||||
let lon = Number(this.lon)
|
||||
uni.openLocation({
|
||||
latitude: lat,
|
||||
longitude: lon,
|
||||
name: this.store.name,
|
||||
address: this.store.address,
|
||||
|
||||
success: function() {
|
||||
console.log('success');
|
||||
},
|
||||
complete: function(res) {
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取当前位置
|
||||
getAddress(storeId) {
|
||||
let _this = this;
|
||||
uni.getLocation({
|
||||
// 谷歌使用wgs84 其他使用gcj02
|
||||
type: 'gcj02', // 使用国测局坐标系
|
||||
success: function(res) {
|
||||
if (_this.longitude == "" && _this.latitude == "") {
|
||||
|
||||
_this.longitude = res.longitude;
|
||||
_this.latitude = res.latitude
|
||||
}
|
||||
console.log('经度: ' + _this.longitude);
|
||||
console.log('纬度: ' + _this.latitude);
|
||||
request({
|
||||
url: 'business/storeInformation/store/recentlyStore',
|
||||
method: 'post',
|
||||
data: {
|
||||
"lon": _this.longitude,
|
||||
"lat": _this.latitude,
|
||||
"storeId": storeId,
|
||||
"isLogin": _this.AppToken ? "0" : "1", // 0为登录
|
||||
|
||||
},
|
||||
}).then((response) => {
|
||||
if (response.data.store) {
|
||||
_this.distance = (Math.ceil(response.data.distance))
|
||||
.toFixed(1)
|
||||
_this.store = response.data.store
|
||||
|
||||
_this.lon = _this.store.longitude
|
||||
_this.lat = _this.store.latitude
|
||||
console.log(_this.store, 129);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "当前店铺已关闭!!!",
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
|
||||
}).catch(err => {})
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log('获取位置信息失败: ' + err.errMsg);
|
||||
}
|
||||
});
|
||||
},
|
||||
goList() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesMy/invite/list'
|
||||
|
@ -46,7 +46,7 @@
|
||||
</view>
|
||||
<view class="box-hang" @click="show=!show">
|
||||
<view class="">生日</view>
|
||||
<view class="dis"> <text>{{user.birthday}}</text> <uni-icons type="right" size="16"></uni-icons> </view>
|
||||
<view class="dis"> <text>{{user.birthday || '--'}}</text> <uni-icons type="right" size="16"></uni-icons> </view>
|
||||
</view>
|
||||
<!-- <view class="box-hang">
|
||||
<view class="">手机号</view>
|
||||
|
@ -10,7 +10,7 @@
|
||||
</view>
|
||||
<view class="wrap-box">
|
||||
<view class="w_box" v-for="(item,index) in list" :key="index" @click="setIndex(index,item)"
|
||||
:class="{'acv_w' : wIndex == index }">
|
||||
:class="{'acv_w' : (index + 1) <= wIndex }">
|
||||
<view class="">{{item.integralName}}</view>
|
||||
<image src="@/static/imgs/jinbi.png" style="width: 25px; height: 25px; "></image>
|
||||
<view class="">{{item.integral}}积分</view>
|
||||
@ -97,20 +97,24 @@
|
||||
},
|
||||
methods: {
|
||||
goSignIn() {
|
||||
request({
|
||||
url: 'business/integral/integralSettings/signInFunction',
|
||||
method: 'post',
|
||||
data: {
|
||||
storeId: uni.getStorageSync("storeId"),
|
||||
chainStoreId: uni.getStorageSync("chainStoreId")
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
console.log(res, 108);
|
||||
this.show = true
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
if (this.isSignIn == true) {
|
||||
request({
|
||||
url: 'business/integral/integralSettings/signInFunction',
|
||||
method: 'post',
|
||||
data: {
|
||||
storeId: uni.getStorageSync("storeId"),
|
||||
chainStoreId: uni.getStorageSync("chainStoreId")
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
console.log(res, 108);
|
||||
this.integral = res.data.pointsChange
|
||||
this.show = true
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
// 判断是否签到
|
||||
getIsSignIn() {
|
||||
@ -147,7 +151,7 @@
|
||||
this.equityShow = false
|
||||
},
|
||||
setIndex(index, data) {
|
||||
this.wIndex = index
|
||||
// this.wIndex = index
|
||||
this.integral = data.integral
|
||||
},
|
||||
getList() {
|
||||
@ -161,6 +165,7 @@
|
||||
if (res.code == 200) {
|
||||
this.list = res.data.integralSettings
|
||||
this.signInDays = res.data.signInDays
|
||||
this.wIndex = res.data.classColor
|
||||
}
|
||||
})
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user