订单列表完善
This commit is contained in:
@ -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";
|
||||
}
|
||||
|
||||
|
||||
@ -29,6 +29,8 @@ public interface ZcRentCarRuleBatteryMapper
|
||||
public List<ZcRentCarRuleBattery> selectZcRentCarRuleBatteryList(ZcRentCarRuleBattery zcRentCarRuleBattery);
|
||||
|
||||
List<Long> selectBatteryRuleIdsByCarRuleId(Long carRuleId);
|
||||
|
||||
List<String> selectModelRuleByCarRuleId(Long carRuleId);
|
||||
/**
|
||||
* 新增租车规则租电规则关联
|
||||
*
|
||||
|
||||
@ -28,6 +28,8 @@ public interface IZcRentCarRuleBatteryService
|
||||
public List<ZcRentCarRuleBattery> selectZcRentCarRuleBatteryList(ZcRentCarRuleBattery zcRentCarRuleBattery);
|
||||
|
||||
List<Long> selectBatteryRuleIdsByCarRuleId(Long carRuleId);
|
||||
|
||||
List<String> selectModelRuleByCarRuleId(Long carRuleId);
|
||||
/**
|
||||
* 新增租车规则租电规则关联
|
||||
*
|
||||
|
||||
@ -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);
|
||||
}
|
||||
/**
|
||||
* 新增租车规则租电规则关联
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user