更新9.28

This commit is contained in:
许允枞 2024-09-28 11:30:25 +08:00
parent b8bdbaab89
commit 8d702bc6e4
7 changed files with 76 additions and 5 deletions

View File

@ -215,5 +215,10 @@ public class FleetMemberController extends BaseController {
public ResponseObject editLimit(@RequestBody FleetMember fleetMember){ public ResponseObject editLimit(@RequestBody FleetMember fleetMember){
return getSuccessResult(fleetMemberService.editLimit(fleetMember)); return getSuccessResult(fleetMemberService.editLimit(fleetMember));
} }
@PutMapping("signOUTMember")
public ResponseObject signOUTMember(Integer memberId){
return getSuccessResult(fleetMemberService.signOUTMember(memberId));
}
} }

View File

@ -89,6 +89,18 @@ public class FleetConsumeRecord extends BaseEntity implements Serializable {
* 更新时间 * 更新时间
*/ */
private Date updateTime; private Date updateTime;
/**
* 余额变化类型 0-减少 1增加
*/
private String changeType;
/**
* 消费来源
*/
private String fromType;
/**
* 余额变化之后的值
*/
private Double afterTheChange;
} }

View File

@ -24,17 +24,22 @@
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="selectGrowthValueChangeList" resultType="com.fuint.business.fleet.vo.FleetConsumeRecordVo"> <select id="selectGrowthValueChangeList" resultType="com.fuint.business.fleet.vo.FleetConsumeRecordVo">
SELECT * FROM fleet_consume_record SELECT * , mt.name storeName FROM fleet_consume_record fc
left join mt_store mt on mt.id = fc.store_id
<where> <where>
<if test="fleetConsumeRecord.storeId != null and fleetConsumeRecord.storeId != ''"> <if test="fleetConsumeRecord.storeId != null and fleetConsumeRecord.storeId != ''">
and gvc.store_id = #{fleetConsumeRecord.storeId} and fc.store_id = #{fleetConsumeRecord.storeId}
</if>
<if test="fleetConsumeRecord.fleetMemberId != null and fleetConsumeRecord.fleetMemberId != ''">
and fc.fleet_member_id = #{fleetConsumeRecord.fleetMemberId}
</if> </if>
<if test="fleetConsumeRecord.fleetId != null and fleetConsumeRecord.fleetId != ''"> <if test="fleetConsumeRecord.fleetId != null and fleetConsumeRecord.fleetId != ''">
and gvc.fleet_id = #{fleetConsumeRecord.fleetId} and fc.fleet_id = #{fleetConsumeRecord.fleetId}
</if> </if>
<if test="fleetConsumeRecord.startTime != null and fleetConsumeRecord.startTime != ''"> <if test="fleetConsumeRecord.startTime != null and fleetConsumeRecord.startTime != ''">
and gvc.create_time between #{fleetConsumeRecord.startTime} and #{fleetConsumeRecord.endTime} and fc.create_time between #{fleetConsumeRecord.startTime} and #{fleetConsumeRecord.endTime}
</if> </if>
</where> </where>
order by create_time desc order by create_time desc
</select> </select>

View File

@ -94,4 +94,11 @@ public interface FleetMemberService {
* @return * @return
*/ */
int editLimitPC(FleetMember fleetMember); int editLimitPC(FleetMember fleetMember);
/**
* 注销车队成员
* @param memberId
* @return
*/
int signOUTMember(Integer memberId);
} }

View File

@ -3,15 +3,21 @@ package com.fuint.business.fleet.service.impl;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.fleet.entity.FleetConsumeRecord; import com.fuint.business.fleet.entity.FleetConsumeRecord;
import com.fuint.business.fleet.entity.FleetInfo;
import com.fuint.business.fleet.entity.FleetMember;
import com.fuint.business.fleet.mapper.FleetConsumeRecordMapper; import com.fuint.business.fleet.mapper.FleetConsumeRecordMapper;
import com.fuint.business.fleet.mapper.FleetInfoMapper;
import com.fuint.business.fleet.mapper.FleetMemberMapper;
import com.fuint.business.fleet.service.FleetConsumeRecordService; import com.fuint.business.fleet.service.FleetConsumeRecordService;
import com.fuint.business.fleet.vo.FleetConsumeRecordVo; import com.fuint.business.fleet.vo.FleetConsumeRecordVo;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
@ -23,6 +29,10 @@ import org.springframework.stereotype.Service;
@Service("fleetConsumeRecordService") @Service("fleetConsumeRecordService")
public class FleetConsumeRecordServiceImpl extends ServiceImpl<FleetConsumeRecordMapper,FleetConsumeRecord> implements FleetConsumeRecordService { public class FleetConsumeRecordServiceImpl extends ServiceImpl<FleetConsumeRecordMapper,FleetConsumeRecord> implements FleetConsumeRecordService {
@Autowired
private FleetInfoMapper fleetInfoMapper;
@Autowired
private FleetMemberMapper fleetMemberMapper;
@Override @Override
public IPage<FleetConsumeRecord> queryPage(Page page, FleetConsumeRecord fleetInfo) { public IPage<FleetConsumeRecord> queryPage(Page page, FleetConsumeRecord fleetInfo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
@ -84,7 +94,23 @@ public class FleetConsumeRecordServiceImpl extends ServiceImpl<FleetConsumeRecor
@Override @Override
public IPage<FleetConsumeRecordVo> queryByPageUni(Page page, FleetConsumeRecordVo fleetConsumeRecord) { public IPage<FleetConsumeRecordVo> queryByPageUni(Page page, FleetConsumeRecordVo fleetConsumeRecord) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
fleetConsumeRecord.setFleetMemberId(nowAccountInfo.getId()); //判断当前登陆人是否是车队负责人
FleetInfo fleetInfo = fleetInfoMapper.selectOne(new LambdaQueryWrapper<FleetInfo>()
.eq(FleetInfo::getId, fleetConsumeRecord.getFleetId())
.eq(FleetInfo::getUserId, nowAccountInfo.getId()));
//如果为空则是车队成员则查询当前用户的消费记录
if (ObjectUtil.isEmpty(fleetInfo)) {
FleetMember fleetMember = fleetMemberMapper.selectOne(new LambdaQueryWrapper<FleetMember>()
.eq(FleetMember::getUserId, nowAccountInfo.getId())
.eq(FleetMember::getFleetId, fleetConsumeRecord.getFleetId()));
if (ObjectUtil.isEmpty(fleetMember)) {
throw new RuntimeException("未绑定该车队,无法查看当前车队成员信息");
}
fleetConsumeRecord.setFleetMemberId(fleetMember.getId());
}else {
// 查询当前车队的名称
fleetConsumeRecord.setFleetName(fleetInfo.getFleetName());
}
if (ObjectUtil.isNotEmpty(fleetConsumeRecord.getStartTime())) { if (ObjectUtil.isNotEmpty(fleetConsumeRecord.getStartTime())) {
DateTime parse = DateUtil.parse(fleetConsumeRecord.getStartTime(), "yyyy-MM"); DateTime parse = DateUtil.parse(fleetConsumeRecord.getStartTime(), "yyyy-MM");
fleetConsumeRecord.setStartTime(DateUtil.beginOfMonth(parse).toString()); fleetConsumeRecord.setStartTime(DateUtil.beginOfMonth(parse).toString());

View File

@ -319,6 +319,20 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
return baseMapper.updateById(fleetMember); return baseMapper.updateById(fleetMember);
} }
/**
* 注销车队成员
*
* @param memberId
* @return
*/
@Override
public int signOUTMember(Integer memberId) {
FleetMember fleetMember = new FleetMember();
fleetMember.setId(memberId);
fleetMember.setIfLogOff("1");
return baseMapper.updateById(fleetMember);
}
/** /**
* 创建用户的基础信息 * 创建用户的基础信息
*/ */

View File

@ -10,4 +10,6 @@ public class FleetConsumeRecordVo extends FleetConsumeRecord {
private String startTime; private String startTime;
@JsonIgnore @JsonIgnore
private String endTime; private String endTime;
private String fleetName;
private String storeName;
} }