用车计算同步更新发货需求当前状态
This commit is contained in:
parent
f45a68c1ba
commit
9ab497a150
@ -109,7 +109,8 @@ public class DeliveryDemand implements Serializable {
|
||||
@Excel(name = "作业备注", width = 15)
|
||||
@ApiModelProperty(value = "作业备注")
|
||||
private java.lang.String workNotes;
|
||||
/**当前状态*/
|
||||
/**当前状态 0-创建, 1-已合并需求, 2-计算车辆需求中, 3-发送车辆需求, 4-等待装车,
|
||||
* 5-车辆离厂(完成), 6-取消, 7-超期无效*/
|
||||
@Excel(name = "当前状态", width = 15, dicCode = "current_status")
|
||||
@Dict(dicCode = "current_status")
|
||||
@ApiModelProperty(value = "当前状态")
|
||||
|
@ -20,4 +20,10 @@ public interface DeliveryDemandMapper extends BaseMapper<DeliveryDemand> {
|
||||
@Param("pickUpHub") String pickUpHub,
|
||||
@Param("shipDate") Date shipDate,
|
||||
@Param("sequence") String sequence);
|
||||
/**
|
||||
* 更新发货需求
|
||||
* @param vdNo 用车需求编号
|
||||
* @param currentStatus 当前状态
|
||||
*/
|
||||
void updateByVdNo(String vdNo, String currentStatus);
|
||||
}
|
||||
|
@ -11,4 +11,9 @@
|
||||
and pick_up_hub = #{pickUpHub}
|
||||
and ship_date = #{shipDate}
|
||||
</update>
|
||||
|
||||
<update id="updateByVdNo">
|
||||
update tms_delivery_demand set current_status = #{currentStatus}
|
||||
where vd_no = #{vdNo}
|
||||
</update>
|
||||
</mapper>
|
||||
|
@ -14,9 +14,24 @@ import java.util.List;
|
||||
*/
|
||||
public interface IDeliveryDemandService extends IService<DeliveryDemand> {
|
||||
|
||||
/**
|
||||
* 手动合并
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Result<?> handleMerge(List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据料号、规格、发货数量计算托盘数
|
||||
* @param deliveryDemand
|
||||
* @return
|
||||
*/
|
||||
Result<?> getPalletsNum(DeliveryDemand deliveryDemand);
|
||||
|
||||
void updateByVdNo(String vdNo);
|
||||
/**
|
||||
* 更新发货需求
|
||||
* @param vdNo 用车需求编号
|
||||
* @param currentStatus 当前状态
|
||||
*/
|
||||
void updateByVdNo(String vdNo, String currentStatus);
|
||||
}
|
||||
|
@ -120,10 +120,10 @@ public class DeliveryDemandServiceImpl extends ServiceImpl<DeliveryDemandMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateByVdNo(String vdNo) {
|
||||
public void updateByVdNo(String vdNo, String currentStatus) {
|
||||
LambdaUpdateWrapper<DeliveryDemand> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.eq(DeliveryDemand::getVdNo, vdNo)
|
||||
.set(DeliveryDemand::getCurrentStatus, '0');
|
||||
.set(DeliveryDemand::getCurrentStatus, currentStatus);
|
||||
deliveryDemandMapper.update(new DeliveryDemand(), lambdaUpdateWrapper);
|
||||
}
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public class VehicleDemandController extends JeecgController<VehicleDemand, IVeh
|
||||
// 删除用车计算中的数据
|
||||
vehicleDemandCountService.deleteByVdNo(byId.getVdNo());
|
||||
// 更新发货需求数据
|
||||
deliveryDemandService.updateByVdNo(byId.getVdNo());
|
||||
deliveryDemandService.updateByVdNo(byId.getVdNo(), "0");
|
||||
vehicleDemandService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
@ -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.vehiclepallet.entity.VehiclePallet;
|
||||
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.VehicleDemand;
|
||||
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 IVehicleDemandCountService vehicleDemandCountService;
|
||||
private final TmsIogisticsPriceMapper iogisticsPriceMapper;
|
||||
private final DeliveryDemandMapper deliveryDemandMapper;
|
||||
|
||||
@Override
|
||||
public Result<?> carCount(VehicleDemand vehicleDemand) {
|
||||
@ -67,6 +69,8 @@ public class VehicleDemandServiceImpl extends ServiceImpl<VehicleDemandMapper, V
|
||||
List<VehicleDemandCount> vehicleDemandCounts = convertToVehicleDemandCountList(solution.getVehicleCounts(), vehicleDemand);
|
||||
// 5.新增
|
||||
vehicleDemandCountService.saveBatch(vehicleDemandCounts);
|
||||
// 6.更新发货需求当前状态
|
||||
deliveryDemandMapper.updateByVdNo(vehicleDemand.getVdNo(), "2");
|
||||
log.info("用车需求计算,用车需求编号:{},方案:{},费用:{}",vehicleDemand.getVdNo(),
|
||||
solution.getVehicleCounts(),solution.getTotalCost());
|
||||
return Result.OK("用车计算成功!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user