更新9.21
This commit is contained in:
parent
fc390ba458
commit
7ab5ae5121
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,11 @@ public class FleetConsumeRecord extends BaseEntity implements Serializable {
|
||||
* 所属店铺id
|
||||
*/
|
||||
private Integer storeId;
|
||||
|
||||
/**
|
||||
* 车队id
|
||||
*/
|
||||
private Integer fleetId;
|
||||
/**
|
||||
* 车队成员id
|
||||
*/
|
||||
|
@ -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<FleetConsumeRecord> {
|
||||
IPage<FleetConsumeRecord> queryPage(Page page, @Param("entity") FleetConsumeRecord fleetInfo);
|
||||
|
||||
IPage<FleetConsumeRecordVo> selectGrowthValueChangeList(Page page, @Param("fleetConsumeRecord") FleetConsumeRecordVo fleetConsumeRecord);
|
||||
}
|
||||
|
@ -23,5 +23,20 @@
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
<select id="selectGrowthValueChangeList" resultType="com.fuint.business.fleet.vo.FleetConsumeRecordVo">
|
||||
SELECT * FROM fleet_consume_record
|
||||
<where>
|
||||
<if test="fleetConsumeRecord.storeId != null and fleetConsumeRecord.storeId != ''">
|
||||
and gvc.store_id = #{fleetConsumeRecord.storeId}
|
||||
</if>
|
||||
<if test="fleetConsumeRecord.fleetId != null and fleetConsumeRecord.fleetId != ''">
|
||||
and gvc.fleet_id = #{fleetConsumeRecord.fleetId}
|
||||
</if>
|
||||
<if test="fleetConsumeRecord.startTime != null and fleetConsumeRecord.startTime != ''">
|
||||
and gvc.create_time between #{fleetConsumeRecord.startTime} and #{fleetConsumeRecord.endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
@ -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<FleetConsumeRecordVo> queryByPageUni(Page page, FleetConsumeRecordVo fleetConsumeRecord);
|
||||
}
|
||||
|
@ -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<FleetConsumeRecor
|
||||
public int deleteById(Integer id) {
|
||||
return baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page
|
||||
* @param fleetConsumeRecord
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<FleetConsumeRecordVo> 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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user