修改bug

This commit is contained in:
齐天大圣 2024-01-05 18:19:48 +08:00
parent e740b59800
commit d92c33373a
7 changed files with 51 additions and 28 deletions

View File

@ -16,6 +16,14 @@ export function oilName(oilType) {
})
}
// 查询油号
export function getById(id) {
return request({
url: 'business/marketingActivity/cardFuelDiesel/'+id,
method: 'get',
})
}
// 新增列表
export function addList(data) {
return request({

View File

@ -156,7 +156,7 @@
</el-card>
<el-dialog
title="添加囤油卡"
title="囤油卡操作"
:visible.sync="centerDialogVisible"
width="36%"
center>
@ -256,7 +256,7 @@
</template>
<script>
import { getList,oilName,addList,eitList} from "@/api/EventMarketing/oilBlock";
import { getList,oilName,addList,eitList,getById} from "@/api/EventMarketing/oilBlock";
export default {
dicts: ['oil_type'],
name: 'index',
@ -429,9 +429,12 @@
this.centerDialogVisible = false
},
handleUpdate(data){
console.log(data)
this.ruleForm = data
this.centerDialogVisible = true
getById(data.id).then(res=>{
if (res.code == 200){
this.ruleForm = res.data
this.centerDialogVisible = true
}
})
}
}

View File

@ -117,8 +117,8 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
@Override
public int insertMerch(MerchantConfig merchantConfig) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
if (ObjectUtil.isEmpty(merchantConfig.getStoreId())) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
merchantConfig.setStoreId(nowAccountInfo.getStoreId());
}
int row = 0;

View File

@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -63,7 +64,9 @@ public class CardFuelDieselServiceImpl extends ServiceImpl<CardFuelDieselMapper,
List<CardFuelDiesel> records = page1.getRecords();
//返回囤油卡状态
for (CardFuelDiesel record : records) {
record.setOilType(oilNameService.selectOilNameById(Integer.parseInt(record.getOilType())).getOilName());
if (ObjectUtils.isNotEmpty(record.getOilType())){
record.setOilType(oilNameService.selectOilNameById(Integer.parseInt(record.getOilType())).getOilName());
}
record.setStatus(record.getStatus().equals("1") ? "true" : "false");
if(ObjectUtils.isNotEmpty(record.getActiveTime()) && "1".equals(record.getActiveTime())){
record.setActivityProgress("1");
@ -105,8 +108,17 @@ public class CardFuelDieselServiceImpl extends ServiceImpl<CardFuelDieselMapper,
queryWrapper.orderByDesc(CardFuelDiesel::getCreateTime);
IPage page1 = page(page, queryWrapper);
List<CardFuelDiesel> records = page1.getRecords();
//返回囤油卡状态
ArrayList<CardFuelDiesel> cardFuelDiesels = new ArrayList<>();
for (CardFuelDiesel record : records) {
Date startTime = record.getStartTime();
Date endTime = record.getEndTime();
Date date = new Date();
if(startTime.before(date) && endTime.after(date)){
cardFuelDiesels.add(record);
}
}
//返回囤油卡状态
/*for (CardFuelDiesel record : records) {
record.setOilType(oilNameService.selectOilNameById(Integer.parseInt(record.getOilType())).getOilName());
record.setStatus(record.getStatus().equals("1") ? "true" : "false");
if(ObjectUtils.isNotEmpty(record.getActiveTime()) && "1".equals(record.getActiveTime())){
@ -121,7 +133,8 @@ public class CardFuelDieselServiceImpl extends ServiceImpl<CardFuelDieselMapper,
record.setActivityProgress(record.getEndTime().getTime() > new Date().getTime() ? "1" : "2");
}
}
}
}*/
page1.setRecords(cardFuelDiesels);
return page1;
}
}

View File

@ -416,15 +416,9 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
cardFuleOrders.setRealName(ljStaff.getRealName());
cardFuleOrders.setStaffMobile(ljStaff.getMobile());
//订单金额
cardFuleOrders.setAmount(0.02);
/*
//订单金额
cardFuleOrders.setAmount(cardFuelDiesel.getRechargeBalance());
//支付金额
cardFuleOrders.setPayAmount(cardFuelDiesel.getRechargeBalance());
}*/
cardFuleOrders.setAmount(cardFuelDiesel.getRechargeBalance());
//支付金额
cardFuleOrders.setPayAmount(0.01);
cardFuleOrders.setPayAmount(cardFuelDiesel.getRechargeBalance());
cardFuleOrders.setStatus("unpaid");
//生成订单
boolean save = cardFuleOrdersService.save(cardFuleOrders);
@ -501,7 +495,8 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
for (JSONObject jsonObject : jsonObjectList) {
if (cardFuleOrders.getOilType().equals(jsonObject.getString("oilType"))) {
double incomeLitres = jsonObject.getDouble("incomeLitres");
incomeLitres = (cardFuleOrders.getIncomeLitres() + incomeLitres);
BigDecimal add = BigDecimal.valueOf(cardFuleOrders.getIncomeLitres()).add(BigDecimal.valueOf(incomeLitres));
incomeLitres = add.doubleValue();
jsonObject.put("incomeLitres", incomeLitres);
String userBnlancce = jsonObjectList.toString();
userBalance.setRefuelMoney(userBnlancce);

View File

@ -141,7 +141,10 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getCardFavorableId())){
CardFavorable cardFavorable = cardFavorableService.getById(cardValueRecordDTO.getCardFavorableId());
if (cardValue.getRechargeBalance() >= cardFavorable.getSatisfiedAmount()) {
cardFavorableValue += cardFavorable.getDiscountAmount();
BigDecimal bigDecimal = BigDecimal.valueOf(cardFavorable.getDiscountAmount());
BigDecimal cardFavora = BigDecimal.valueOf(cardFavorableValue);
cardFavorableValue = bigDecimal.add(cardFavora).doubleValue();
//cardFavorableValue += cardFavorable.getDiscountAmount();
}
}
//订单号
@ -166,7 +169,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
if (ObjectUtils.isNotEmpty(cardValue.getRoyaltyType())){
cardValueOrders.setRoyaltyType(cardValue.getRoyaltyType());
if (cardValue.getRoyaltyType().equals("3")){
cardValueOrders.setAmountCommission(cardValue.getRechargeBalance() * cardValue.getPercentageCommissions());
BigDecimal multiply = BigDecimal.valueOf(cardValue.getRechargeBalance()).multiply(BigDecimal.valueOf(cardValue.getPercentageCommissions()));
cardValueOrders.setAmountCommission(multiply.doubleValue());
}
}
if (ObjectUtils.isNotEmpty(cardValue.getAmountCommission())){
@ -175,12 +179,12 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
//订单金额
if (ObjectUtils.isNotEmpty(cardValue.getGiftBalance())){
//订单金额
cardValueOrders.setAmount(cardValue.getRechargeBalance());
BigDecimal add = BigDecimal.valueOf(cardValue.getRechargeBalance()).add(BigDecimal.valueOf(cardValue.getGiftBalance()));
cardValueOrders.setAmount(add.doubleValue());
//支付金额
cardValueOrders.setPayAmount(cardValue.getRechargeBalance() - cardValue.getGiftBalance() - cardFavorableValue);
cardValueOrders.setPayAmount(cardValue.getRechargeBalance());
}
//支付金额
//cardValueOrders.setPayAmount(0.01);
//优惠券id
if (ObjectUtils.isNotEmpty(cardValueRecordDTO.getCardFavorableId())){
cardValueOrders.setCardFavorableId(cardValueRecordDTO.getCardFavorableId());
@ -191,7 +195,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
}
//优惠金额
if (ObjectUtils.isNotEmpty(cardValue.getGiftBalance())){
cardValueOrders.setDiscount(cardValue.getGiftBalance() + cardFavorableValue);
BigDecimal add = BigDecimal.valueOf(cardValue.getGiftBalance()).add(BigDecimal.valueOf(cardFavorableValue));
cardValueOrders.setDiscount(add.doubleValue());
}
cardValueOrders.setStatus("unpaid");
//生成订单
@ -615,7 +620,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
}
//储值卡余额
if (ObjectUtils.isNotEmpty(userBalance.getCardBalance()) && ObjectUtils.isNotEmpty(cardValueOrders.getAmount())){
afterBalance = userBalance.getCardBalance() + cardValueOrders.getAmount();
BigDecimal add = BigDecimal.valueOf(userBalance.getCardBalance()).add(BigDecimal.valueOf(cardValueOrders.getAmount()));
afterBalance = add.doubleValue();
userBalance.setCardBalance(afterBalance);
}
userBalanceService.updateUserBalance(userBalance);

View File

@ -194,8 +194,6 @@
this.query.chainStoreId = uni.getStorageSync('chainStoreId')
this.getUserBalance();
this.getGiftRecords();
},
methods: {
//
@ -489,4 +487,4 @@
.centenr-size {
font-size: 14px;
}
</style>
</style>