订单列表完善

This commit is contained in:
19173159168
2025-08-08 22:37:52 +08:00
parent 0677ca3ede
commit 9018d8eef1
11 changed files with 316 additions and 114 deletions

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.operation.domain.Company;
@ -142,6 +143,18 @@ public class ZcRentCarRuleController extends BaseController
ZcRentCarRule zcRentCarRule = zcRentCarRuleService.selectZcRentCarRuleById(id);
mmap.put("zcRentCarRule", zcRentCarRule);
Company company = companyList.stream()
.filter(c -> c.getId() != null && c.getId().equals(zcRentCarRule.getOperatingCompanyId()))
.findFirst()
.orElse(null);
mmap.put("company", company);
// 查询已绑定的电池规则
List<String> batteryRules = zcRentCarRuleBatteryService.selectModelRuleByCarRuleId(id);
String modelRuleNames = batteryRules.stream()
.map(String::valueOf)
.collect(Collectors.joining(","));
mmap.put("modelRuleNames", modelRuleNames);
return prefix + "/edit";
}

View File

@ -29,6 +29,8 @@ public interface ZcRentCarRuleBatteryMapper
public List<ZcRentCarRuleBattery> selectZcRentCarRuleBatteryList(ZcRentCarRuleBattery zcRentCarRuleBattery);
List<Long> selectBatteryRuleIdsByCarRuleId(Long carRuleId);
List<String> selectModelRuleByCarRuleId(Long carRuleId);
/**
* 新增租车规则租电规则关联
*

View File

@ -28,6 +28,8 @@ public interface IZcRentCarRuleBatteryService
public List<ZcRentCarRuleBattery> selectZcRentCarRuleBatteryList(ZcRentCarRuleBattery zcRentCarRuleBattery);
List<Long> selectBatteryRuleIdsByCarRuleId(Long carRuleId);
List<String> selectModelRuleByCarRuleId(Long carRuleId);
/**
* 新增租车规则租电规则关联
*

View File

@ -50,7 +50,10 @@ public class ZcRentCarRuleBatteryServiceImpl implements IZcRentCarRuleBatterySer
public List<Long> selectBatteryRuleIdsByCarRuleId(Long carRuleId) {
return zcRentCarRuleBatteryMapper.selectBatteryRuleIdsByCarRuleId(carRuleId);
}
@Override
public List<String> selectModelRuleByCarRuleId(Long carRuleId) {
return zcRentCarRuleBatteryMapper.selectModelRuleByCarRuleId(carRuleId);
}
/**
* 新增租车规则租电规则关联
*