| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TRechargeRecordAgentResp; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TRechargeRecordUserResp; |
| | | import com.stylefeng.guns.modular.system.model.TRechargeRecord; |
| | | import com.stylefeng.guns.modular.system.dao.TRechargeRecordMapper; |
| | | import com.stylefeng.guns.modular.system.service.ITRechargeRecordService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-02-20 |
| | | * @since 2023-03-10 |
| | | */ |
| | | @Service |
| | | public class TRechargeRecordServiceImpl extends ServiceImpl<TRechargeRecordMapper, TRechargeRecord> implements ITRechargeRecordService { |
| | | |
| | | @Autowired |
| | | private TRechargeRecordMapper tRechargeRecordMapper; |
| | | |
| | | @Override |
| | | public List<TRechargeRecordUserResp> userRecharge(String userName, String userPhone, String code, String createTime) { |
| | | String startTime = null; |
| | | String endTime = null; |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | } |
| | | return tRechargeRecordMapper.userRecharge(startTime,endTime,userName,userPhone,code); |
| | | } |
| | | |
| | | @Override |
| | | public List<TRechargeRecordAgentResp> agentRechargeList(String driverName, String driverPhone, String createTime) { |
| | | String startTime = null; |
| | | String endTime = null; |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | } |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | | List<TRechargeRecordAgentResp> tRechargeRecordAgentRespList = tRechargeRecordMapper.agentRechargeList(startTime, endTime, driverName, driverPhone, roleType, objectId); |
| | | for (TRechargeRecordAgentResp tRechargeRecordAgentResp : tRechargeRecordAgentRespList) { |
| | | tRechargeRecordAgentResp.setArea(tRechargeRecordAgentResp.getProvinceName()+tRechargeRecordAgentResp.getCityName()); |
| | | } |
| | | return tRechargeRecordAgentRespList; |
| | | } |
| | | } |