更新9.20
This commit is contained in:
parent
5c70875129
commit
18fb854e20
@ -26,7 +26,7 @@ public class FleetInfoController extends BaseController {
|
||||
private FleetInfoService fleetInfoService;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询首页轮播图
|
||||
* 根据条件分页查询车队信息
|
||||
* @param fleetInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
|
@ -2,12 +2,14 @@ package com.fuint.business.order.controller;
|
||||
|
||||
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.order.entity.GrowthValueChange;
|
||||
import com.fuint.business.order.entity.LJOrder;
|
||||
import com.fuint.business.order.service.GrowthValueChangeService;
|
||||
import com.fuint.business.order.vo.GrowthValueChangeVo;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -35,4 +37,20 @@ public class GrowthValueChangeController extends BaseController {
|
||||
IPage<GrowthValueChangeVo> list = growthValueChangeService.selectGrowthValueChangeList(page,growthValueChange);
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成长值明细(小程序)
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param growthValueChange
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("queryByPageUni")
|
||||
public ResponseObject queryByPageUni(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@Param("integralDetail") GrowthValueChangeVo growthValueChange) {
|
||||
Page page = new Page(pageNo, pageSize);
|
||||
IPage< GrowthValueChangeVo> iPageList = this.growthValueChangeService.queryByPageUni(page, growthValueChange);
|
||||
return getSuccessResult(iPageList);
|
||||
}
|
||||
}
|
||||
|
@ -7,5 +7,6 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class CardBalanceChangeDto extends CardBalanceChange {
|
||||
private Date startTime;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.business.order.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
@ -59,5 +60,7 @@ public class GrowthValueChange extends BaseEntity implements Serializable {
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.fuint.business.order.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.order.dto.CardBalanceChangeDto;
|
||||
import com.fuint.business.order.entity.CardBalanceChange;
|
||||
import com.fuint.business.order.entity.CashierOrder;
|
||||
import com.fuint.business.order.vo.CardBalanceChangeVo;
|
||||
@ -12,4 +13,5 @@ public interface CardBalanceChangeMapper extends BaseMapper<CardBalanceChange> {
|
||||
|
||||
IPage<CardBalanceChangeVo> getCardRecordList(@Param("page")Page page, @Param("cardBalanceChange") CardBalanceChange cardBalanceChange);
|
||||
|
||||
IPage<CardBalanceChangeVo> queryAllByLimit(Page page,@Param("cardBalanceChangeDto") CardBalanceChangeDto cardBalanceChangeDto);
|
||||
}
|
||||
|
@ -37,4 +37,30 @@
|
||||
</where>
|
||||
order by cbc.id DESC
|
||||
</select>
|
||||
<select id="queryAllByLimit" resultType="com.fuint.business.order.vo.CardBalanceChangeVo">
|
||||
select
|
||||
ms.name storeName,
|
||||
cbc.*
|
||||
from
|
||||
card_balance_change cbc
|
||||
left join mt_store ms on ms.id = cbc.store_id
|
||||
<where>
|
||||
<if test="cardBalanceChangeDto.userId != null">
|
||||
and cbc.user_id = #{cardBalanceChangeDto.userId}
|
||||
</if>
|
||||
<if test="cardBalanceChangeDto.storeId != null">
|
||||
and cbc.store_id = #{cardBalanceChangeDto.storeId}
|
||||
</if>
|
||||
<if test="cardBalanceChangeDto.changeType != null">
|
||||
and cbc.change_type = #{cardBalanceChangeDto.changeType}
|
||||
</if>
|
||||
<if test="cardBalanceChangeDto.orderNo != null">
|
||||
and cbc.order_no = like concat('%', #{cardBalanceChangeDto.orderNo}, '%')
|
||||
</if>
|
||||
<if test="cardBalanceChangeDto.startTime != null and cardBalanceChangeDto.startTime != ''"><!-- 开始时间检索 -->
|
||||
and cbc.create_time between #{cardBalanceChangeDto.startTime} and #{cardBalanceChangeDto.endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by cbc.id DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<mapper namespace="com.fuint.business.order.mapper.GrowthValueChangeMapper">
|
||||
<select id="selectGrowthValueChangeList" resultType="com.fuint.business.order.vo.GrowthValueChangeVo">
|
||||
select gvc.*,ms.name storeName from growth_value_change gvc
|
||||
left join mt_store ms on store_id = ms.id
|
||||
left join mt_store ms on gvc.store_id = ms.id
|
||||
<where>
|
||||
<if test="growthValueChange.storeId != null and growthValueChange.storeId != ''">
|
||||
and gvc.store_id = #{growthValueChange.storeId}
|
||||
@ -11,6 +11,9 @@
|
||||
<if test="growthValueChange.userId != null and growthValueChange.userId != ''">
|
||||
and gvc.user_id = #{growthValueChange.userId}
|
||||
</if>
|
||||
<if test="growthValueChange.startTime != null and growthValueChange.startTime != ''">
|
||||
and gvc.create_time between #{growthValueChange.startTime} and #{growthValueChange.endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by gvc.create_time desc
|
||||
</select>
|
||||
|
@ -3,6 +3,7 @@ package com.fuint.business.order.service;
|
||||
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.order.dto.CardBalanceChangeDto;
|
||||
import com.fuint.business.order.entity.CardBalanceChange;
|
||||
import com.fuint.business.order.entity.CashierOrder;
|
||||
import com.fuint.business.order.vo.CardBalanceChangeVo;
|
||||
@ -47,4 +48,6 @@ public interface CardBalanceChangeService extends IService<CardBalanceChange> {
|
||||
* @return
|
||||
*/
|
||||
List<CardBalanceChange> selectList(String changeType);
|
||||
|
||||
IPage<CardBalanceChangeVo> queryByPageUni(Page page, CardBalanceChangeDto cardBalanceChangeDto);
|
||||
}
|
||||
|
@ -43,4 +43,6 @@ public interface GrowthValueChangeService {
|
||||
* @return
|
||||
*/
|
||||
void refundGrowthValueChange(String orderNo,Integer userId,Integer storeId);
|
||||
|
||||
IPage<GrowthValueChangeVo> queryByPageUni(Page page, GrowthValueChangeVo growthValueChange);
|
||||
}
|
||||
|
@ -1,11 +1,14 @@
|
||||
package com.fuint.business.order.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;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.order.dto.CardBalanceChangeDto;
|
||||
import com.fuint.business.order.entity.CardBalanceChange;
|
||||
import com.fuint.business.order.entity.CashierOrder;
|
||||
import com.fuint.business.order.entity.OilBalanceChange;
|
||||
@ -120,4 +123,16 @@ public class CardBalanceChangeServiceImpl extends ServiceImpl<CardBalanceChangeM
|
||||
queryWrapper.eq("change_type",changeType);
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<CardBalanceChangeVo> queryByPageUni(Page page, CardBalanceChangeDto cardBalanceChangeDto) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
cardBalanceChangeDto.setUserId(nowAccountInfo.getId());
|
||||
if (ObjectUtil.isNotEmpty(cardBalanceChangeDto.getStartTime())) {
|
||||
DateTime parse = DateUtil.parse(cardBalanceChangeDto.getStartTime(), "yyyy-MM");
|
||||
cardBalanceChangeDto.setStartTime(DateUtil.beginOfMonth(parse).toString());
|
||||
cardBalanceChangeDto.setEndTime(DateUtil.endOfMonth(parse).toString());
|
||||
}
|
||||
return this.baseMapper.queryAllByLimit(page, cardBalanceChangeDto);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.fuint.business.order.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.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -92,4 +94,16 @@ public class GrowthValueChangeServiceImpl extends ServiceImpl<GrowthValueChangeM
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<GrowthValueChangeVo> queryByPageUni(Page page, GrowthValueChangeVo growthValueChange) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
growthValueChange.setUserId(nowAccountInfo.getId());
|
||||
if (ObjectUtil.isNotEmpty(growthValueChange.getStartTime())) {
|
||||
DateTime parse = DateUtil.parse(growthValueChange.getStartTime(), "yyyy-MM");
|
||||
growthValueChange.setStartTime(DateUtil.beginOfMonth(parse).toString());
|
||||
growthValueChange.setEndTime(DateUtil.endOfMonth(parse).toString());
|
||||
}
|
||||
return this.baseMapper.selectGrowthValueChangeList(page, growthValueChange);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,22 @@
|
||||
package com.fuint.business.order.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fuint.business.order.entity.GrowthValueChange;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GrowthValueChangeVo extends GrowthValueChange {
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
private String storeName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@JsonIgnore
|
||||
private String startTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
@JsonIgnore
|
||||
private String endTime;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ 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.metadata.IPage;
|
||||
import com.fuint.business.integral.entity.IntegralDetail;
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
|
||||
import com.fuint.business.marketingActivity.cardValueOrders.mapper.CardValueOrdersMapper;
|
||||
import com.fuint.business.marketingActivity.cardValueRule.dto.CardValueOrdersDTO;
|
||||
@ -15,6 +16,7 @@ import com.fuint.business.order.dto.CardBalanceChangeDto;
|
||||
import com.fuint.business.order.entity.CardBalanceChange;
|
||||
import com.fuint.business.order.mapper.AllOrderInfoMapper;
|
||||
import com.fuint.business.order.mapper.CardBalanceChangeMapper;
|
||||
import com.fuint.business.order.service.CardBalanceChangeService;
|
||||
import com.fuint.business.order.vo.CardBalanceChangeVo;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.mapper.MtStoreMapper;
|
||||
@ -38,6 +40,7 @@ import com.fuint.utils.StringUtil;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -106,6 +109,9 @@ public class ClientBalanceController extends BaseController {
|
||||
@Autowired
|
||||
private CardValueOrdersMapper cardValueOrdersMapper;
|
||||
|
||||
@Autowired
|
||||
private CardBalanceChangeService cardBalanceChangeService;
|
||||
|
||||
@Autowired
|
||||
private MtStoreMapper mtStoreMapper;
|
||||
|
||||
@ -308,74 +314,46 @@ public class ClientBalanceController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
// @RequestMapping(value = "/detail", method = RequestMethod.GET)
|
||||
// public ResponseObject getBalanceDetail(CardValueOrdersDTO order) {
|
||||
// Page<Object> page = PageHelper.startPage(order.getPage(), order.getPageSize());
|
||||
// public ResponseObject getBalanceDetail(Integer page, Integer pageSize, CardBalanceChangeDto order) {
|
||||
// Page<Object> pageHelper = PageHelper.startPage(page, pageSize);
|
||||
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// log.info("nowAccountInfo:{}", nowAccountInfo);
|
||||
// order.setMtUserId(nowAccountInfo.getId());
|
||||
// order.setStatus("paid");
|
||||
// LambdaQueryWrapper<CardValueOrders> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// if (ObjectUtil.isNotEmpty(order.getRechargeType())) {
|
||||
// lambdaQueryWrapper.eq(CardValueOrders::getRechargeType, order.getRechargeType());
|
||||
// LambdaQueryWrapper<CardBalanceChange> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// lambdaQueryWrapper.eq(CardBalanceChange::getUserId, nowAccountInfo.getId());
|
||||
// if (ObjectUtil.isNotEmpty(order.getChangeType())) {
|
||||
// lambdaQueryWrapper.eq(CardBalanceChange::getChangeType, order.getChangeType());
|
||||
// }
|
||||
// if (ObjectUtil.isNotEmpty(order.getStartTime()) ) {
|
||||
// DateTime parse = DateUtil.parse(order.getStartTime(), DatePattern.NORM_MONTH_FORMATTER);
|
||||
// DateTime start = DateUtil.beginOfMonth(parse);
|
||||
// if (ObjectUtil.isNotEmpty(order.getStartTime())) {
|
||||
// DateTime parse = new DateTime(order.getStartTime());
|
||||
// DateTime dateTime = DateUtil.beginOfMonth(parse);
|
||||
// DateTime end = DateUtil.endOfMonth(parse);
|
||||
// lambdaQueryWrapper.between(CardValueOrders::getPayTime, start, end);
|
||||
// lambdaQueryWrapper.between(CardBalanceChange::getCreateTime, dateTime, end);
|
||||
// }
|
||||
// lambdaQueryWrapper.eq(CardValueOrders::getMtUserId,nowAccountInfo.getId());
|
||||
//// lambdaQueryWrapper.eq(CardValueOrders::getStatus, "paid");
|
||||
// List<CardValueOrders> cardValueOrders = cardValueOrdersMapper.selectList(lambdaQueryWrapper);
|
||||
// PageRequest pageRequest = PageRequest.of(order.getPage(), order.getPageSize());
|
||||
// lambdaQueryWrapper.eq(CardBalanceChange::getStoreId, order.getStoreId());
|
||||
//
|
||||
// PageRequest pageRequest = PageRequest.of(page, pageSize);
|
||||
//
|
||||
// List<CardBalanceChange> cardBalanceChanges = cardBalanceChangeMapper.selectList(lambdaQueryWrapper);
|
||||
// //查询商户名称
|
||||
// MtStore mtStore = mtStoreMapper.selectOne(new LambdaQueryWrapper<MtStore>()
|
||||
// .eq(MtStore::getId, order.getStoreId()));
|
||||
//
|
||||
// if (CollUtil.isNotEmpty(cardValueOrders) && ObjectUtil.isNotEmpty(mtStore)) {
|
||||
// cardValueOrders.stream().forEach(item -> item.setStoreName(mtStore.getName()));
|
||||
// List<CardBalanceChangeVo> cardBalanceChangeVos = BeanUtil.copyToList(cardBalanceChanges, CardBalanceChangeVo.class);
|
||||
// if (ObjectUtil.isNotEmpty(mtStore)) {
|
||||
// cardBalanceChangeVos.stream().forEach(item -> item.setStoreName(mtStore.getName()));
|
||||
// }
|
||||
// PageImpl pageImpl = new PageImpl(cardValueOrders, pageRequest, page.getTotal());
|
||||
// PaginationResponse paginationResponse = new PaginationResponse(pageImpl, CardValueOrders.class);
|
||||
// paginationResponse.setTotalPages(page.getPages());
|
||||
// paginationResponse.setTotalElements(page.getTotal());
|
||||
// paginationResponse.setContent(cardValueOrders);
|
||||
//
|
||||
// PageImpl pageImpl = new PageImpl(cardBalanceChanges, pageRequest, pageHelper.getTotal());
|
||||
// PaginationResponse paginationResponse = new PaginationResponse(pageImpl, CardBalanceChangeVo.class);
|
||||
// paginationResponse.setTotalPages(pageHelper.getPages());
|
||||
// paginationResponse.setTotalElements(pageHelper.getTotal());
|
||||
// paginationResponse.setContent(cardBalanceChangeVos);
|
||||
// return getSuccessResult(paginationResponse);
|
||||
// }
|
||||
@RequestMapping(value = "/detail", method = RequestMethod.GET)
|
||||
public ResponseObject getBalanceDetail(Integer page, Integer pageSize, CardBalanceChangeDto order) {
|
||||
Page<Object> pageHelper = PageHelper.startPage(page, pageSize);
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LambdaQueryWrapper<CardBalanceChange> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CardBalanceChange::getUserId, nowAccountInfo.getId());
|
||||
if (ObjectUtil.isNotEmpty(order.getChangeType())) {
|
||||
lambdaQueryWrapper.eq(CardBalanceChange::getChangeType, order.getChangeType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(order.getStartTime())) {
|
||||
DateTime parse = new DateTime(order.getStartTime());
|
||||
DateTime dateTime = DateUtil.beginOfMonth(parse);
|
||||
DateTime end = DateUtil.endOfMonth(parse);
|
||||
lambdaQueryWrapper.between(CardBalanceChange::getCreateTime, dateTime, end);
|
||||
}
|
||||
lambdaQueryWrapper.eq(CardBalanceChange::getStoreId, order.getStoreId());
|
||||
|
||||
PageRequest pageRequest = PageRequest.of(page, pageSize);
|
||||
|
||||
List<CardBalanceChange> cardBalanceChanges = cardBalanceChangeMapper.selectList(lambdaQueryWrapper);
|
||||
//查询商户名称
|
||||
MtStore mtStore = mtStoreMapper.selectOne(new LambdaQueryWrapper<MtStore>()
|
||||
.eq(MtStore::getId, order.getStoreId()));
|
||||
List<CardBalanceChangeVo> cardBalanceChangeVos = BeanUtil.copyToList(cardBalanceChanges, CardBalanceChangeVo.class);
|
||||
if (ObjectUtil.isNotEmpty(mtStore)) {
|
||||
cardBalanceChangeVos.stream().forEach(item -> item.setStoreName(mtStore.getName()));
|
||||
}
|
||||
PageImpl pageImpl = new PageImpl(cardBalanceChanges, pageRequest, pageHelper.getTotal());
|
||||
PaginationResponse paginationResponse = new PaginationResponse(pageImpl, CardBalanceChangeVo.class);
|
||||
paginationResponse.setTotalPages(pageHelper.getPages());
|
||||
paginationResponse.setTotalElements(pageHelper.getTotal());
|
||||
paginationResponse.setContent(cardBalanceChangeVos);
|
||||
return getSuccessResult(paginationResponse);
|
||||
@GetMapping("detail")
|
||||
public ResponseObject queryByPageUni(@RequestParam(value = "page",defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@Param("integralDetail") CardBalanceChangeDto cardBalanceChangeDto) {
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page page1 = new com.baomidou.mybatisplus.extension.plugins.pagination.Page(page, pageSize);
|
||||
IPage< CardBalanceChangeVo> iPageList = this.cardBalanceChangeService.queryByPageUni(page1, cardBalanceChangeDto);
|
||||
return getSuccessResult(iPageList);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user