diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetConsumeRecordController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetConsumeRecordController.java index bb4f97ba5..0bef8a64f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetConsumeRecordController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/controller/FleetConsumeRecordController.java @@ -1,10 +1,14 @@ package com.fuint.business.fleet.controller; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.fleet.entity.FleetConsumeRecord; import com.fuint.business.fleet.service.FleetConsumeRecordService; +import com.fuint.business.fleet.vo.FleetConsumeRecordVo; +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.web.bind.annotation.*; import javax.annotation.Resource; @@ -83,5 +87,21 @@ public class FleetConsumeRecordController extends BaseController { return getSuccessResult(fleetConsumeRecordService.deleteById(id)); } + /** + * 根据条件分页查询车队消费记录(小程序端) + * @param fleetConsumeRecord + * @param pageNo + * @param pageSize + * @return + */ + @GetMapping("queryByPageUni") + public ResponseObject queryByPageUni(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("fleetConsumeRecord") FleetConsumeRecordVo fleetConsumeRecord) { + Page page = new Page(pageNo, pageSize); + IPage< FleetConsumeRecordVo> iPageList = this.fleetConsumeRecordService.queryByPageUni(page, fleetConsumeRecord); + return getSuccessResult(iPageList); + } + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/entity/FleetConsumeRecord.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/entity/FleetConsumeRecord.java index 0594187e0..177081f39 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/entity/FleetConsumeRecord.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/entity/FleetConsumeRecord.java @@ -36,6 +36,11 @@ public class FleetConsumeRecord extends BaseEntity implements Serializable { * 所属店铺id */ private Integer storeId; + + /** + * 车队id + */ + private Integer fleetId; /** * 车队成员id */ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/FleetConsumeRecordMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/FleetConsumeRecordMapper.java index f22069c0e..b83c584b6 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/FleetConsumeRecordMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/FleetConsumeRecordMapper.java @@ -4,8 +4,11 @@ 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.fleet.entity.FleetConsumeRecord; +import com.fuint.business.fleet.vo.FleetConsumeRecordVo; import org.apache.ibatis.annotations.Param; public interface FleetConsumeRecordMapper extends BaseMapper { IPage queryPage(Page page, @Param("entity") FleetConsumeRecord fleetInfo); + + IPage selectGrowthValueChangeList(Page page, @Param("fleetConsumeRecord") FleetConsumeRecordVo fleetConsumeRecord); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/xml/FleetConsumeRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/xml/FleetConsumeRecordMapper.xml index 0f572fbb5..526a0e7ed 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/xml/FleetConsumeRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/mapper/xml/FleetConsumeRecordMapper.xml @@ -23,5 +23,20 @@ ORDER BY create_time DESC + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetConsumeRecordService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetConsumeRecordService.java index 502c0f7ed..7d724607f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetConsumeRecordService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/FleetConsumeRecordService.java @@ -3,6 +3,7 @@ package com.fuint.business.fleet.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.fleet.entity.FleetConsumeRecord; +import com.fuint.business.fleet.vo.FleetConsumeRecordVo; /** * (FleetConsumeRecord)表服务接口 @@ -51,4 +52,11 @@ public interface FleetConsumeRecordService { */ int deleteById(Integer id); + /** + * 分页查询 + * @param page + * @param fleetConsumeRecord + * @return + */ + IPage queryByPageUni(Page page, FleetConsumeRecordVo fleetConsumeRecord); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetConsumeRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetConsumeRecordServiceImpl.java index b287c4ff3..9a89f9031 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetConsumeRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/service/impl/FleetConsumeRecordServiceImpl.java @@ -1,11 +1,15 @@ package com.fuint.business.fleet.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.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.fleet.entity.FleetConsumeRecord; import com.fuint.business.fleet.mapper.FleetConsumeRecordMapper; import com.fuint.business.fleet.service.FleetConsumeRecordService; +import com.fuint.business.fleet.vo.FleetConsumeRecordVo; import com.fuint.common.dto.AccountInfo; import com.fuint.common.util.TokenUtil; import org.springframework.stereotype.Service; @@ -69,4 +73,23 @@ public class FleetConsumeRecordServiceImpl extends ServiceImpl queryByPageUni(Page page, FleetConsumeRecordVo fleetConsumeRecord) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + fleetConsumeRecord.setFleetMemberId(nowAccountInfo.getId()); + if (ObjectUtil.isNotEmpty(fleetConsumeRecord.getStartTime())) { + DateTime parse = DateUtil.parse(fleetConsumeRecord.getStartTime(), "yyyy-MM"); + fleetConsumeRecord.setStartTime(DateUtil.beginOfMonth(parse).toString()); + fleetConsumeRecord.setEndTime(DateUtil.endOfMonth(parse).toString()); + } + return this.baseMapper.selectGrowthValueChangeList(page, fleetConsumeRecord); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/vo/FleetConsumeRecordVo.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/vo/FleetConsumeRecordVo.java new file mode 100644 index 000000000..4ec662f6e --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/fleet/vo/FleetConsumeRecordVo.java @@ -0,0 +1,13 @@ +package com.fuint.business.fleet.vo; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fuint.business.fleet.entity.FleetConsumeRecord; +import lombok.Data; + +@Data +public class FleetConsumeRecordVo extends FleetConsumeRecord { + @JsonIgnore + private String startTime; + @JsonIgnore + private String endTime; +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/GrowthValueChangeController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/GrowthValueChangeController.java index 265767be7..0583539ac 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/GrowthValueChangeController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/GrowthValueChangeController.java @@ -48,7 +48,7 @@ public class GrowthValueChangeController extends BaseController { @GetMapping("queryByPageUni") public ResponseObject queryByPageUni(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, - @Param("integralDetail") GrowthValueChangeVo growthValueChange) { + @Param("growthValueChange") GrowthValueChangeVo growthValueChange) { Page page = new Page(pageNo, pageSize); IPage< GrowthValueChangeVo> iPageList = this.growthValueChangeService.queryByPageUni(page, growthValueChange); return getSuccessResult(iPageList);