|
|
@ -26,7 +26,10 @@ import com.logpm.distribution.mapper.DistributionReservationPackageMapper; |
|
|
|
import com.logpm.distribution.mapper.DistributionReservationStockarticleMapper; |
|
|
|
import com.logpm.distribution.mapper.DistributionReservationStockarticleMapper; |
|
|
|
import com.logpm.distribution.mapper.DistributionReservationStocklistMapper; |
|
|
|
import com.logpm.distribution.mapper.DistributionReservationStocklistMapper; |
|
|
|
import com.logpm.distribution.service.*; |
|
|
|
import com.logpm.distribution.service.*; |
|
|
|
|
|
|
|
import com.logpm.distribution.vo.DistributionReservationStockarticleVO; |
|
|
|
import com.logpm.distribution.vo.DistributionReservationVO; |
|
|
|
import com.logpm.distribution.vo.DistributionReservationVO; |
|
|
|
|
|
|
|
import com.logpm.distribution.vo.DistributionStockArticleVO; |
|
|
|
|
|
|
|
import com.logpm.distribution.vo.DistributionStockListVO; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import org.springblade.common.serviceConstant.ServiceConstant; |
|
|
|
import org.springblade.common.serviceConstant.ServiceConstant; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
@ -98,10 +101,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
private final IDistributionSignforService distributionSignforService; |
|
|
|
private final IDistributionSignforService distributionSignforService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<DistributionReservationVO> selectDistrbutionReservationPage(IPage<DistributionReservationVO> page, DistributionReservationVO distrbutionReservation) { |
|
|
|
public IPage<DistributionReservationVO> selectDistrbutionReservationPage(IPage<DistributionReservationVO> page, DistributionReservationVO distrbutionReservation) { |
|
|
|
return page.setRecords(baseMapper.selectDistrbutionReservationPage(page, distrbutionReservation)); |
|
|
|
return page.setRecords(baseMapper.selectDistrbutionReservationPage(page, distrbutionReservation)); |
|
|
@ -138,9 +137,34 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public DistributionReservationVO getReservationDetail(String reservationId) { |
|
|
|
public R<?> getReservationDetail(String reservationId) { |
|
|
|
DistributionReservationVO distributionReservationVO = distributionReservationMapper.getReservationDetail(reservationId); |
|
|
|
if (Func.isBlank(reservationId)) { |
|
|
|
return distributionReservationVO; |
|
|
|
log.error("参数异常reservationId+{" + reservationId + "}"); |
|
|
|
|
|
|
|
return R.fail("服务器正忙!!"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//创建预约对象
|
|
|
|
|
|
|
|
//2、查询预约单下的包件信息列表
|
|
|
|
|
|
|
|
//3、查询预约单下的库存品信息列表
|
|
|
|
|
|
|
|
DistributionReservationEntity reservationEntity = this.getById(reservationId); |
|
|
|
|
|
|
|
DistributionReservationVO reservationVO = Func.copy(reservationEntity, DistributionReservationVO.class); |
|
|
|
|
|
|
|
String reservationStatus = reservationVO.getReservationStatus(); |
|
|
|
|
|
|
|
Integer typeService = reservationVO.getTypeService(); |
|
|
|
|
|
|
|
switch (reservationStatus) { |
|
|
|
|
|
|
|
case "2": |
|
|
|
|
|
|
|
reservationVO.setReservationStatus("已确定"); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "1": |
|
|
|
|
|
|
|
reservationVO.setReservationStatus("待确定"); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//1、查询预约单下的订单列表信息
|
|
|
|
|
|
|
|
List<DistributionStockArticleVO> stockArticleEntityList = distributionReservationMapper.getStockArticleList(reservationId); |
|
|
|
|
|
|
|
if (stockArticleEntityList.size() >= 1) { |
|
|
|
|
|
|
|
reservationVO.setStockArticleList(stockArticleEntityList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// DistributionReservationVO distributionReservationVO = distributionReservationMapper.getReservationDetail(reservationId);
|
|
|
|
|
|
|
|
return R.data(reservationVO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -154,9 +178,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); |
|
|
|
DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); |
|
|
|
Func.copy(distributionReservationDTO, reservationEntity); |
|
|
|
Func.copy(distributionReservationDTO, reservationEntity); |
|
|
|
//新建预约单为待确认状态
|
|
|
|
//新建预约单为待确认状态
|
|
|
|
reservationEntity.setReservationStatus("1"); |
|
|
|
reservationEntity.setReservationStatus(ServiceConstant.RESERVATION_STATE_WAIT_CONFIRM); |
|
|
|
//新建预约单订单处于未备货状态
|
|
|
|
//新建预约单订单处于未备货状态
|
|
|
|
reservationEntity.setStockupStatus("1"); |
|
|
|
reservationEntity.setStockupStatus(ServiceConstant.STOCkUP_STATE_NOT_EXECUTION); |
|
|
|
this.save(reservationEntity); |
|
|
|
this.save(reservationEntity); |
|
|
|
//获取新增预约信息的编号
|
|
|
|
//获取新增预约信息的编号
|
|
|
|
Long reservationId = reservationEntity.getId(); |
|
|
|
Long reservationId = reservationEntity.getId(); |
|
|
@ -177,7 +201,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
//预约订单数量
|
|
|
|
//预约订单数量
|
|
|
|
AtomicInteger packageNum = new AtomicInteger(); |
|
|
|
AtomicInteger packageNum = new AtomicInteger(); |
|
|
|
List<DistributionParcelListEntity> packageList = s.getPackageList(); |
|
|
|
List<DistributionParcelListEntity> packageList = s.getPackageList(); |
|
|
|
if (s.getIsHaveData().equals(ServiceConstant.ORDER_HAVE_DATA)){ |
|
|
|
|
|
|
|
if (packageList.size() == 0) { |
|
|
|
if (packageList.size() == 0) { |
|
|
|
if (s.getIsHaveData() == 2) { |
|
|
|
if (s.getIsHaveData() == 2) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
@ -212,10 +235,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
s.setAvailableQuantity(s.getHandQuantity() - s.getReservationNum()); |
|
|
|
s.setAvailableQuantity(s.getHandQuantity() - s.getReservationNum()); |
|
|
|
} |
|
|
|
} |
|
|
|
distributionReservationStockarticleEntity.setReservationNum(packageNum.get()); |
|
|
|
distributionReservationStockarticleEntity.setReservationNum(packageNum.get()); |
|
|
|
}else { |
|
|
|
|
|
|
|
distributionReservationStockarticleEntity.setIsHaveData(ServiceConstant.ORDER_NOT_HAVE_DATA); |
|
|
|
|
|
|
|
distributionReservationStockarticleEntity.setReservationNum(s.getTotalNumber()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//订单无数据源,不需要进行包件信息维护
|
|
|
|
//订单无数据源,不需要进行包件信息维护
|
|
|
|
//修改订单状态为已预约
|
|
|
|
//修改订单状态为已预约
|
|
|
|
s.setState(ServiceConstant.ORDER_STATE_ALREADY_RESERVATION); |
|
|
|
s.setState(ServiceConstant.ORDER_STATE_ALREADY_RESERVATION); |
|
|
@ -570,7 +589,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
//设置是否为主司机
|
|
|
|
//设置是否为主司机
|
|
|
|
if (Func.equals(allocationDTO.getMasterDriverName(), a.getDriver())) { |
|
|
|
if (Func.equals(allocationDTO.getMasterDriverName(), a.getDriver())) { |
|
|
|
//设置主司机
|
|
|
|
//设置主司机
|
|
|
|
distributionDeliverySelfEntity.setIsMaster(1); |
|
|
|
distributionDeliverySelfEntity.setIsMaster(ServiceConstant.IS_MASTER_YES); |
|
|
|
} |
|
|
|
} |
|
|
|
//完成对自主配送司机信息保存
|
|
|
|
//完成对自主配送司机信息保存
|
|
|
|
distributionDeliverySelfEntity.setDeliveryId(deliveryListId); |
|
|
|
distributionDeliverySelfEntity.setDeliveryId(deliveryListId); |
|
|
@ -604,6 +623,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
distributionDeliveryListService.updateById(distributionDeliveryListEntity); |
|
|
|
distributionDeliveryListService.updateById(distributionDeliveryListEntity); |
|
|
|
return R.status(true); |
|
|
|
return R.status(true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R<DistributionReservationVO> getReservationInfo(String reservationId) { |
|
|
|
public R<DistributionReservationVO> getReservationInfo(String reservationId) { |
|
|
|
//查询出预约信息
|
|
|
|
//查询出预约信息
|
|
|
@ -624,8 +644,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
stockArticleEntity.setReservationNum(a1.getReservationNum()); |
|
|
|
stockArticleEntity.setReservationNum(a1.getReservationNum()); |
|
|
|
stockArticleEntityList.add(stockArticleEntity); |
|
|
|
stockArticleEntityList.add(stockArticleEntity); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
List<DistributionStockArticleVO> stockArticleVOList = Func.copy(stockArticleEntityList, DistributionStockArticleVO.class); |
|
|
|
//查询出 库存信息
|
|
|
|
//查询出 库存信息
|
|
|
|
reservationVO.setStockArticleList(stockArticleEntityList); |
|
|
|
reservationVO.setStockArticleList(stockArticleVOList); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!Func.isEmpty(reservationStocklistEntityList)) { |
|
|
|
if (!Func.isEmpty(reservationStocklistEntityList)) { |
|
|
|
List<DistributionStockListEntity> stockArticleEntityList = new ArrayList<>(); |
|
|
|
List<DistributionStockListEntity> stockArticleEntityList = new ArrayList<>(); |
|
|
@ -634,8 +655,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
stockListEntity.setReservationNum(a2.getReservationNum()); |
|
|
|
stockListEntity.setReservationNum(a2.getReservationNum()); |
|
|
|
stockArticleEntityList.add(stockListEntity); |
|
|
|
stockArticleEntityList.add(stockListEntity); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
List<DistributionStockListVO> stockListVOList = Func.copy(stockArticleEntityList, DistributionStockListVO.class); |
|
|
|
//查询出 库存信息
|
|
|
|
//查询出 库存信息
|
|
|
|
reservationVO.setInventoryList(stockArticleEntityList); |
|
|
|
reservationVO.setInventoryList(stockListVOList); |
|
|
|
} |
|
|
|
} |
|
|
|
return R.data(reservationVO); |
|
|
|
return R.data(reservationVO); |
|
|
|
} |
|
|
|
} |
|
|
@ -999,4 +1021,23 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu |
|
|
|
result = this.updateById(reservationEntity); |
|
|
|
result = this.updateById(reservationEntity); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public R<?> getReservationPackage(String reservationId, String id) { |
|
|
|
|
|
|
|
DistributionReservationPackageDTO reservationPackageDTO = new DistributionReservationPackageDTO(); |
|
|
|
|
|
|
|
reservationPackageDTO.setReservationId(Long.parseLong(reservationId)); |
|
|
|
|
|
|
|
reservationPackageDTO.setStockArticleId(Long.parseLong(id)); |
|
|
|
|
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationPackageMapper.getReservationPackage(reservationPackageDTO); |
|
|
|
|
|
|
|
return R.data(parcelListEntityList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public R<?> getReservationPackageList(String reservationId) { |
|
|
|
|
|
|
|
if (Func.isBlank(reservationId)) { |
|
|
|
|
|
|
|
log.error("参数异常reservationId+{" + reservationId + "}"); |
|
|
|
|
|
|
|
return R.fail("服务器正忙!!"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntityList = distributionReservationPackageMapper.getReservationPackageList(reservationId); |
|
|
|
|
|
|
|
return R.data(distributionParcelListEntityList); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|