用车计算同步更新发货需求当前状态

This commit is contained in:
王帅 2025-04-25 11:33:02 +08:00
parent f45a68c1ba
commit 9ab497a150
7 changed files with 36 additions and 5 deletions

View File

@ -109,7 +109,8 @@ public class DeliveryDemand implements Serializable {
@Excel(name = "作业备注", width = 15) @Excel(name = "作业备注", width = 15)
@ApiModelProperty(value = "作业备注") @ApiModelProperty(value = "作业备注")
private java.lang.String workNotes; private java.lang.String workNotes;
/**当前状态*/ /**当前状态 0-创建, 1-已合并需求, 2-计算车辆需求中, 3-发送车辆需求, 4-等待装车,
* 5-车辆离厂完成, 6-取消, 7-超期无效*/
@Excel(name = "当前状态", width = 15, dicCode = "current_status") @Excel(name = "当前状态", width = 15, dicCode = "current_status")
@Dict(dicCode = "current_status") @Dict(dicCode = "current_status")
@ApiModelProperty(value = "当前状态") @ApiModelProperty(value = "当前状态")

View File

@ -20,4 +20,10 @@ public interface DeliveryDemandMapper extends BaseMapper<DeliveryDemand> {
@Param("pickUpHub") String pickUpHub, @Param("pickUpHub") String pickUpHub,
@Param("shipDate") Date shipDate, @Param("shipDate") Date shipDate,
@Param("sequence") String sequence); @Param("sequence") String sequence);
/**
* 更新发货需求
* @param vdNo 用车需求编号
* @param currentStatus 当前状态
*/
void updateByVdNo(String vdNo, String currentStatus);
} }

View File

@ -11,4 +11,9 @@
and pick_up_hub = #{pickUpHub} and pick_up_hub = #{pickUpHub}
and ship_date = #{shipDate} and ship_date = #{shipDate}
</update> </update>
<update id="updateByVdNo">
update tms_delivery_demand set current_status = #{currentStatus}
where vd_no = #{vdNo}
</update>
</mapper> </mapper>

View File

@ -14,9 +14,24 @@ import java.util.List;
*/ */
public interface IDeliveryDemandService extends IService<DeliveryDemand> { public interface IDeliveryDemandService extends IService<DeliveryDemand> {
/**
* 手动合并
* @param ids
* @return
*/
Result<?> handleMerge(List<String> ids); Result<?> handleMerge(List<String> ids);
/**
* 根据料号规格发货数量计算托盘数
* @param deliveryDemand
* @return
*/
Result<?> getPalletsNum(DeliveryDemand deliveryDemand); Result<?> getPalletsNum(DeliveryDemand deliveryDemand);
void updateByVdNo(String vdNo); /**
* 更新发货需求
* @param vdNo 用车需求编号
* @param currentStatus 当前状态
*/
void updateByVdNo(String vdNo, String currentStatus);
} }

View File

@ -120,10 +120,10 @@ public class DeliveryDemandServiceImpl extends ServiceImpl<DeliveryDemandMapper,
} }
@Override @Override
public void updateByVdNo(String vdNo) { public void updateByVdNo(String vdNo, String currentStatus) {
LambdaUpdateWrapper<DeliveryDemand> lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<DeliveryDemand> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.eq(DeliveryDemand::getVdNo, vdNo) lambdaUpdateWrapper.eq(DeliveryDemand::getVdNo, vdNo)
.set(DeliveryDemand::getCurrentStatus, '0'); .set(DeliveryDemand::getCurrentStatus, currentStatus);
deliveryDemandMapper.update(new DeliveryDemand(), lambdaUpdateWrapper); deliveryDemandMapper.update(new DeliveryDemand(), lambdaUpdateWrapper);
} }
} }

View File

@ -125,7 +125,7 @@ public class VehicleDemandController extends JeecgController<VehicleDemand, IVeh
// 删除用车计算中的数据 // 删除用车计算中的数据
vehicleDemandCountService.deleteByVdNo(byId.getVdNo()); vehicleDemandCountService.deleteByVdNo(byId.getVdNo());
// 更新发货需求数据 // 更新发货需求数据
deliveryDemandService.updateByVdNo(byId.getVdNo()); deliveryDemandService.updateByVdNo(byId.getVdNo(), "0");
vehicleDemandService.removeById(id); vehicleDemandService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }

View File

@ -9,6 +9,7 @@ import org.jeecg.modules.tms.basicdata.iogisticsprice.entity.TmsIogisticsPrice;
import org.jeecg.modules.tms.basicdata.iogisticsprice.mapper.TmsIogisticsPriceMapper; import org.jeecg.modules.tms.basicdata.iogisticsprice.mapper.TmsIogisticsPriceMapper;
import org.jeecg.modules.tms.basicdata.vehiclepallet.entity.VehiclePallet; import org.jeecg.modules.tms.basicdata.vehiclepallet.entity.VehiclePallet;
import org.jeecg.modules.tms.basicdata.vehiclepallet.mapper.VehiclePalletMapper; import org.jeecg.modules.tms.basicdata.vehiclepallet.mapper.VehiclePalletMapper;
import org.jeecg.modules.tms.outbound.deliverydemand.mapper.DeliveryDemandMapper;
import org.jeecg.modules.tms.outbound.vehicledemand.entity.Solution; import org.jeecg.modules.tms.outbound.vehicledemand.entity.Solution;
import org.jeecg.modules.tms.outbound.vehicledemand.entity.VehicleDemand; import org.jeecg.modules.tms.outbound.vehicledemand.entity.VehicleDemand;
import org.jeecg.modules.tms.outbound.vehicledemand.mapper.VehicleDemandMapper; import org.jeecg.modules.tms.outbound.vehicledemand.mapper.VehicleDemandMapper;
@ -36,6 +37,7 @@ public class VehicleDemandServiceImpl extends ServiceImpl<VehicleDemandMapper, V
private final VehiclePalletMapper vehiclePalletMapper; private final VehiclePalletMapper vehiclePalletMapper;
private final IVehicleDemandCountService vehicleDemandCountService; private final IVehicleDemandCountService vehicleDemandCountService;
private final TmsIogisticsPriceMapper iogisticsPriceMapper; private final TmsIogisticsPriceMapper iogisticsPriceMapper;
private final DeliveryDemandMapper deliveryDemandMapper;
@Override @Override
public Result<?> carCount(VehicleDemand vehicleDemand) { public Result<?> carCount(VehicleDemand vehicleDemand) {
@ -67,6 +69,8 @@ public class VehicleDemandServiceImpl extends ServiceImpl<VehicleDemandMapper, V
List<VehicleDemandCount> vehicleDemandCounts = convertToVehicleDemandCountList(solution.getVehicleCounts(), vehicleDemand); List<VehicleDemandCount> vehicleDemandCounts = convertToVehicleDemandCountList(solution.getVehicleCounts(), vehicleDemand);
// 5.新增 // 5.新增
vehicleDemandCountService.saveBatch(vehicleDemandCounts); vehicleDemandCountService.saveBatch(vehicleDemandCounts);
// 6.更新发货需求当前状态
deliveryDemandMapper.updateByVdNo(vehicleDemand.getVdNo(), "2");
log.info("用车需求计算,用车需求编号:{},方案:{},费用:{}",vehicleDemand.getVdNo(), log.info("用车需求计算,用车需求编号:{},方案:{},费用:{}",vehicleDemand.getVdNo(),
solution.getVehicleCounts(),solution.getTotalCost()); solution.getVehicleCounts(),solution.getTotalCost());
return Result.OK("用车计算成功!"); return Result.OK("用车计算成功!");