用车需求计算添加供应商编码

This commit is contained in:
王帅 2025-04-24 15:01:01 +08:00
parent 705ef60a89
commit 8f09b65489
2 changed files with 10 additions and 1 deletions

View File

@ -101,7 +101,10 @@ public class VehicleDemandServiceImpl extends ServiceImpl<VehicleDemandMapper, V
// 更新车辆选择 // 更新车辆选择
Map<String, Integer> newChoices = new HashMap<>(choices.get(i)); Map<String, Integer> newChoices = new HashMap<>(choices.get(i));
newChoices.put(iogisticsPrice.getCarType() + "," +iogisticsPrice.getCarLong(), newChoices.getOrDefault(iogisticsPrice.getCarType() + "," +iogisticsPrice.getCarLong(), 0) + 1); newChoices.put(iogisticsPrice.getCarType() + "," + iogisticsPrice.getCarLong()
+ "," + iogisticsPrice.getSupplierCode(),
newChoices.getOrDefault(iogisticsPrice.getCarType() + "," +iogisticsPrice.getCarLong()
+ "," + iogisticsPrice.getSupplierCode(), 0) + 1);
choices.put(next, newChoices); choices.put(next, newChoices);
} }
} }
@ -134,12 +137,14 @@ public class VehicleDemandServiceImpl extends ServiceImpl<VehicleDemandMapper, V
}*/ }*/
String carType = parts[0]; // 车类型 String carType = parts[0]; // 车类型
double carLong = Double.parseDouble(parts[1]); // 车长度 double carLong = Double.parseDouble(parts[1]); // 车长度
String supplierCode = parts[2]; // 供应商编码
// 根据车辆数量生成多条记录 // 根据车辆数量生成多条记录
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
VehicleDemandCount vehicleDemandCount = new VehicleDemandCount(); VehicleDemandCount vehicleDemandCount = new VehicleDemandCount();
vehicleDemandCount.setCarType(carType) vehicleDemandCount.setCarType(carType)
.setCarLong(carLong) .setCarLong(carLong)
.setSupplierCode(supplierCode)
.setVdNo(vehicleDemand.getVdNo()) .setVdNo(vehicleDemand.getVdNo())
.setShipType(vehicleDemand.getShipType()) .setShipType(vehicleDemand.getShipType())
.setDeliveryAddress(vehicleDemand.getDeliveryAddress()) .setDeliveryAddress(vehicleDemand.getDeliveryAddress())

View File

@ -70,6 +70,10 @@ public class VehicleDemandCount implements Serializable {
@Excel(name = "车长", width = 15) @Excel(name = "车长", width = 15)
@ApiModelProperty(value = "车长") @ApiModelProperty(value = "车长")
private java.lang.Double carLong; private java.lang.Double carLong;
/**供应商编码*/
@Excel(name = "供应商编码", width = 15)
@ApiModelProperty(value = "供应商编码")
private java.lang.String supplierCode;
/**送货区域*/ /**送货区域*/
@Excel(name = "送货区域", width = 15) @Excel(name = "送货区域", width = 15)
@ApiModelProperty(value = "送货区域") @ApiModelProperty(value = "送货区域")