修改bug2
This commit is contained in:
parent
d3f85f2878
commit
a639f4c71e
@ -102,4 +102,18 @@ public class ActiveExchangeController extends BaseController {
|
||||
return getSuccessResult(this.activeExchangeService.paymentActive(paymentActiveDTO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前店铺的交易记录
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param cardExchangeRecord
|
||||
* @return
|
||||
*/
|
||||
/* @GetMapping
|
||||
public ResponseObject selectAllOrders(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@Param("cardFuelDiesel") CardExchangeRecord cardExchangeRecord) {
|
||||
return getSuccessResult(this.activeExchangeService.selectAllOrders(pageNo,pageSize, cardExchangeRecord));
|
||||
}*/
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.marketingActivity.activeExchange.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.marketingActivity.activeExchange.dto.ActiveExchangeRecordDTO;
|
||||
import com.fuint.business.marketingActivity.activeExchange.dto.PaymentActiveDTO;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.business.marketingActivity.activeExchange.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
|
||||
@ -36,6 +37,8 @@ import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableS
|
||||
import com.fuint.business.marketingActivity.cardValue.entity.CardValue;
|
||||
import com.fuint.business.marketingActivity.cardValue.service.CardValueService;
|
||||
import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO;
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.mapper.CardValueOrdersMapper;
|
||||
import com.fuint.business.order.mapper.OilOrderMapper;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilName;
|
||||
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
||||
@ -98,6 +101,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
private ILJStoreService iljStoreService;
|
||||
@Autowired
|
||||
private LJUserService userService;
|
||||
@Resource
|
||||
private CardValueOrdersMapper cardValueOrdersMapper;
|
||||
/**
|
||||
* 分页查询所有
|
||||
* @param
|
||||
|
@ -7,6 +7,7 @@ import com.fuint.business.order.entity.CashierOrder;
|
||||
import com.fuint.business.order.service.CardBalanceChangeService;
|
||||
import com.fuint.business.order.service.CashierOrderService;
|
||||
import com.fuint.business.order.vo.CardBalanceChangeVo;
|
||||
import com.fuint.business.order.vo.StroeBalanceCountVO;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -15,6 +16,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/business/CardBalanceChange")
|
||||
public class CardBalanceChangeController extends BaseController {
|
||||
@ -31,4 +36,60 @@ public class CardBalanceChangeController extends BaseController {
|
||||
IPage<CardBalanceChangeVo> list = cardBalanceChangeService.getCardRecordList(page,cardBalanceChange);
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺余额变化明细
|
||||
* @param cardBalanceChange
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getStoreOrdersList")
|
||||
public ResponseObject getStoreOrdersList(CardBalanceChange cardBalanceChange,
|
||||
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
IPage<CardBalanceChange> list = cardBalanceChangeService.getStoreOrdersList(page,cardBalanceChange);
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺余额统计
|
||||
* @param cardBalanceChange
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getBalanceStoreCount")
|
||||
public ResponseObject getStoreCount(CardBalanceChange cardBalanceChange,
|
||||
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
StroeBalanceCountVO stroeBalanceCountVO = new StroeBalanceCountVO();
|
||||
IPage<CardBalanceChange> list = cardBalanceChangeService.getStoreOrdersList(page,cardBalanceChange);
|
||||
List<CardBalanceChange> records = list.getRecords();
|
||||
//消费笔数
|
||||
List<CardBalanceChange> collectOut = records.stream().filter(s -> s.getChangeType().equals("0")).collect(Collectors.toList());
|
||||
stroeBalanceCountVO.setOutCount(collectOut.size());
|
||||
//充值笔数
|
||||
List<CardBalanceChange> collectIn = records.stream().filter(s -> s.getChangeType().equals("1")).collect(Collectors.toList());
|
||||
stroeBalanceCountVO.setOutCount(collectIn.size());
|
||||
//消费总额
|
||||
double totalConsumption = 0.0;
|
||||
for (CardBalanceChange cardBalanceChange1 : collectOut) {
|
||||
totalConsumption += cardBalanceChange1.getBalance();
|
||||
}
|
||||
stroeBalanceCountVO.setTotalConsumption(totalConsumption);
|
||||
//充值总额
|
||||
double totalRecharge = 0.0;
|
||||
for (CardBalanceChange cardBalanceChange1 : collectIn) {
|
||||
totalRecharge += cardBalanceChange1.getBalance();
|
||||
}
|
||||
stroeBalanceCountVO.setTotalRecharge(totalRecharge);
|
||||
//余额汇总
|
||||
stroeBalanceCountVO.setTotalBalance(totalRecharge -totalConsumption);
|
||||
return getSuccessResult(stroeBalanceCountVO);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.fuint.business.order.controller;
|
||||
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.api.ApiController;
|
||||
import com.baomidou.mybatisplus.extension.api.R;
|
||||
@ -9,13 +10,18 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.order.entity.CardBalanceChange;
|
||||
import com.fuint.business.order.entity.OilBalanceChange;
|
||||
import com.fuint.business.order.service.OilBalanceChangeService;
|
||||
import com.fuint.business.order.vo.StroeOilCountVO;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 余油变化表(OilBalanceChange)表控制层
|
||||
@ -44,7 +50,14 @@ public class OilBalanceChangeController extends BaseController {
|
||||
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
return getSuccessResult(this.oilBalanceChangeService.page(page, new QueryWrapper<>(oilBalanceChange)));
|
||||
LambdaQueryWrapper<OilBalanceChange> queryWrapper = new LambdaQueryWrapper<>();
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
queryWrapper.eq(OilBalanceChange::getStoreId,nowAccountInfo.getStoreId());
|
||||
if (ObjectUtils.isNotEmpty(oilBalanceChange.getOilType())){
|
||||
queryWrapper.eq(OilBalanceChange::getOilType,oilBalanceChange.getOilType());
|
||||
}
|
||||
queryWrapper.orderByDesc(OilBalanceChange::getCreateTime);
|
||||
return getSuccessResult(this.oilBalanceChangeService.page(page, queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -90,5 +103,46 @@ public class OilBalanceChangeController extends BaseController {
|
||||
public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
|
||||
return getSuccessResult(this.oilBalanceChangeService.removeByIds(idList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询所有数据
|
||||
* @param oilBalanceChange
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getOilStoreCount")
|
||||
public ResponseObject getOilStoreCount(OilBalanceChange oilBalanceChange,
|
||||
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
StroeOilCountVO stroeOilCountVO = new StroeOilCountVO();
|
||||
LambdaQueryWrapper<OilBalanceChange> queryWrapper = new LambdaQueryWrapper<>();
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
queryWrapper.eq(OilBalanceChange::getStoreId,nowAccountInfo.getStoreId());
|
||||
if (ObjectUtils.isNotEmpty(oilBalanceChange.getOilType())){
|
||||
queryWrapper.eq(OilBalanceChange::getOilType,oilBalanceChange.getOilType());
|
||||
}
|
||||
List<OilBalanceChange> list = this.oilBalanceChangeService.list(queryWrapper);
|
||||
//充值笔数
|
||||
List<OilBalanceChange> collectIn = list.stream().filter(o -> o.getChangeType().equals("1")).collect(Collectors.toList());
|
||||
stroeOilCountVO.setInCount(collectIn.size());
|
||||
//消费笔数
|
||||
List<OilBalanceChange> collectOut = list.stream().filter(o -> o.getChangeType().equals("0")).collect(Collectors.toList());
|
||||
stroeOilCountVO.setOutCount(collectOut.size());
|
||||
//消费总额
|
||||
double totalConsumption = 0.0;
|
||||
for (OilBalanceChange oilBalanceChange1 : collectOut) {
|
||||
totalConsumption += oilBalanceChange1.getOilBalance();
|
||||
}
|
||||
stroeOilCountVO.setTotalConsumption(totalConsumption);
|
||||
//充值总额
|
||||
double totalRecharge = 0.0;
|
||||
for (OilBalanceChange oilBalanceChange1 : collectIn) {
|
||||
totalRecharge += oilBalanceChange1.getOilBalance();
|
||||
}
|
||||
stroeOilCountVO.setTotalRecharge(totalConsumption);
|
||||
return getSuccessResult(stroeOilCountVO);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,4 +20,11 @@ public interface CardBalanceChangeService extends IService<CardBalanceChange> {
|
||||
|
||||
IPage<CardBalanceChangeVo> getCardRecordList(Page page, CardBalanceChange cardBalanceChange);
|
||||
|
||||
/**
|
||||
* 获取店铺余额变化明细
|
||||
* @param page
|
||||
* @param cardBalanceChange
|
||||
* @return
|
||||
*/
|
||||
IPage<CardBalanceChange> getStoreOrdersList(Page page, CardBalanceChange cardBalanceChange);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.order.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -12,6 +13,8 @@ import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CardBalanceChangeServiceImpl extends ServiceImpl<CardBalanceChangeMapper, CardBalanceChange> implements CardBalanceChangeService {
|
||||
@Override
|
||||
@ -37,4 +40,20 @@ public class CardBalanceChangeServiceImpl extends ServiceImpl<CardBalanceChangeM
|
||||
IPage<CardBalanceChangeVo> cardBalanceChangeVoIPage = baseMapper.getCardRecordList(page, cardBalanceChange);
|
||||
return cardBalanceChangeVoIPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺余额变化明细
|
||||
* @param page
|
||||
* @param cardBalanceChange
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<CardBalanceChange> getStoreOrdersList(Page page, CardBalanceChange cardBalanceChange) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LambdaQueryWrapper<CardBalanceChange> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CardBalanceChange::getStoreId,nowAccountInfo.getStoreId());
|
||||
queryWrapper.orderByDesc(CardBalanceChange::getCreateTime);
|
||||
IPage page1 = page(page, queryWrapper);
|
||||
return page1;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
package com.fuint.business.order.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class StroeBalanceCountVO implements Serializable {
|
||||
//充值笔数
|
||||
private Integer inCount;
|
||||
//消费笔数
|
||||
private Integer outCount;
|
||||
//充值总额
|
||||
private double totalRecharge;
|
||||
//消费总额
|
||||
private double totalConsumption;
|
||||
//余额汇总
|
||||
private double totalBalance;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.fuint.business.order.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class StroeOilCountVO implements Serializable {
|
||||
//充值笔数
|
||||
private Integer inCount;
|
||||
//消费笔数
|
||||
private Integer outCount;
|
||||
//充值总额
|
||||
private double totalRecharge;
|
||||
//消费总额
|
||||
private double totalConsumption;
|
||||
}
|
Loading…
Reference in New Issue
Block a user