微调
This commit is contained in:
		
							parent
							
								
									f24fd9a789
								
							
						
					
					
						commit
						fdfdddc3b6
					
				|  | @ -4,6 +4,8 @@ import com.ruoyi.common.annotation.Excel; | ||||||
| import com.ruoyi.common.core.domain.BaseEntity; | import com.ruoyi.common.core.domain.BaseEntity; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
| 
 | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
| /** | /** | ||||||
|  * 订单对象 et_order |  * 订单对象 et_order | ||||||
|  * |  * | ||||||
|  | @ -43,4 +45,8 @@ public class EtOrderQuery extends BaseEntity | ||||||
|     @Excel(name = "退款类型") |     @Excel(name = "退款类型") | ||||||
|     private String refundType; |     private String refundType; | ||||||
| 
 | 
 | ||||||
|  |     /** 是否退款 */ | ||||||
|  |     @Excel(name = "是否退款") | ||||||
|  |     private List<String> isRefund; | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -30,6 +30,9 @@ public class DeviceNumVo { | ||||||
|     /** 已离线 */ |     /** 已离线 */ | ||||||
|     private Integer offlineNum; |     private Integer offlineNum; | ||||||
| 
 | 
 | ||||||
|  |     /** 全部离线设备 */ | ||||||
|  |     private Integer allOfflineNum; | ||||||
|  | 
 | ||||||
|     /** 正常待租 */ |     /** 正常待租 */ | ||||||
|     private Integer normalNum; |     private Integer normalNum; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -803,13 +803,17 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i | ||||||
| 
 | 
 | ||||||
|         QueryWrapper<AsDevice> wrapperForOffline = new QueryWrapper<>(); |         QueryWrapper<AsDevice> wrapperForOffline = new QueryWrapper<>(); | ||||||
|         wrapperForOffline.eq("online_status","0");//在线状态:0-不在线;1-在线 |         wrapperForOffline.eq("online_status","0");//在线状态:0-不在线;1-在线 | ||||||
|         wrapperForOffline.ne("status","0");// |  | ||||||
|         if(StrUtil.isNotBlank(powerStart) && StrUtil.isNotBlank(powerEnd)){ |         if(StrUtil.isNotBlank(powerStart) && StrUtil.isNotBlank(powerEnd)){ | ||||||
|             wrapperForOffline.between("remaining_power",Integer.parseInt(powerStart),Integer.parseInt(powerEnd)); |             wrapperForOffline.between("remaining_power",Integer.parseInt(powerStart),Integer.parseInt(powerEnd)); | ||||||
|         } |         } | ||||||
|         if(StrUtil.isNotBlank(areaId)){ |         if(StrUtil.isNotBlank(areaId)){ | ||||||
|             wrapperForOffline.eq("area_id",areaId); |             wrapperForOffline.eq("area_id",areaId); | ||||||
|         } |         } | ||||||
|  |         Integer allOfflineNum = asDeviceMapper.selectCount(wrapperForOffline); | ||||||
|  |         deviceNumVo.setOfflineNum(allOfflineNum);//全部离线数 | ||||||
|  | 
 | ||||||
|  |         wrapperForOffline.ne("status","0"); | ||||||
|  | 
 | ||||||
|         Integer offlineNum = asDeviceMapper.selectCount(wrapperForOffline); |         Integer offlineNum = asDeviceMapper.selectCount(wrapperForOffline); | ||||||
|         deviceNumVo.setOfflineNum(offlineNum);//已离线 |         deviceNumVo.setOfflineNum(offlineNum);//已离线 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -416,6 +416,22 @@ public class EtOrderServiceImpl implements IEtOrderService | ||||||
|                 rechargeVoList.add(rechargeVo); |                 rechargeVoList.add(rechargeVo); | ||||||
|             }); |             }); | ||||||
|         } |         } | ||||||
|  |         //补充代码 根据isRefund判断,如果isRefund只存在"0",则只查询未退款(rechargeVo.isRefunded字段,布尔类型的)的记录,如果isRefund存在"1",则查询已退款的记录,如果isRefund为空或两个都有,则查询全部 | ||||||
|  |         List<String> isRefund = etOrder.getIsRefund(); | ||||||
|  |         if (isRefund != null && isRefund.size() > 0) { | ||||||
|  |             // 如果只包含 "0",则过滤未退款记录 | ||||||
|  |             if (isRefund.contains("0") && !isRefund.contains("1")) { | ||||||
|  |                 rechargeVoList.removeIf(rechargeVo -> { | ||||||
|  |                     Boolean isRefunded = rechargeVo.getIsRefunded(); | ||||||
|  |                     return isRefunded == null || Boolean.TRUE.equals(isRefunded); | ||||||
|  |                 }); | ||||||
|  |             } | ||||||
|  |             // 如果只包含 "1",则过滤已退款记录 | ||||||
|  |             if (isRefund.contains("1") && !isRefund.contains("0")) { | ||||||
|  |                 rechargeVoList.removeIf(rechargeVo -> Boolean.FALSE.equals(rechargeVo.getIsRefunded())); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         //将rechargeVoList根据payTime倒序 |         //将rechargeVoList根据payTime倒序 | ||||||
|         rechargeVoList.sort(Comparator.comparing(RechargeVo::getPayTime).reversed()); |         rechargeVoList.sort(Comparator.comparing(RechargeVo::getPayTime).reversed()); | ||||||
|         return rechargeVoList; |         return rechargeVoList; | ||||||
|  |  | ||||||
|  | @ -60,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||||
|         where 1 = 1 |         where 1 = 1 | ||||||
|         <if test="refundResult != null "> and r.refund_result = #{refundResult}</if> |         <if test="refundResult != null "> and r.refund_result = #{refundResult}</if> | ||||||
|         <if test="refundType != null "> and r.type = #{refundType}</if> |         <if test="refundType != null "> and r.type = #{refundType}</if> | ||||||
|  |         <if test="deptId != null and deptId != ''"> and d.dept_id = #{deptId}</if> | ||||||
|         <if test="userName != null and userName != ''"> and u.user_name like concat('%', #{userName}, '%')</if> |         <if test="userName != null and userName != ''"> and u.user_name like concat('%', #{userName}, '%')</if> | ||||||
|         <!-- 数据范围过滤 --> |         <!-- 数据范围过滤 --> | ||||||
|         ${params.dataScope} |         ${params.dataScope} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user