Browse Source

预约查看

test
kilo 2 years ago
parent
commit
ff24a7adb7
  1. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java
  2. 33
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  3. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  4. 76
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  5. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationPackageMapper.java
  6. 28
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationPackageMapper.xml
  7. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  8. 75
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

6
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java

@ -42,14 +42,12 @@ public class DistributionReservationVO extends DistributionReservationEntity {
* 库存品信息列表 * 库存品信息列表
*/ */
@ApiModelProperty(value = "库存品信息列表") @ApiModelProperty(value = "库存品信息列表")
private List<DistributionStockListEntity> inventoryList; private List<DistributionStockListVO> inventoryList;
/** /**
* 订单信息列表 * 订单信息列表
*/ */
@ApiModelProperty(value = "订单信息列表") @ApiModelProperty(value = "订单信息列表")
private List<DistributionStockArticleEntity> stockArticleList; private List<DistributionStockArticleVO> stockArticleList;
} }

33
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java

@ -233,4 +233,37 @@ public class DistributionReservationController extends BladeController {
boolean result = reservationService.cancelReservation(reservationDTO); boolean result = reservationService.cancelReservation(reservationDTO);
return R.status(result); return R.status(result);
} }
/**
* 预约列表 详情
*/
@GetMapping("/getReservationDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distrbutionReservation")
public R<?> getReservationDetail(@RequestParam String id) {
R<?> reservationVO = reservationService.getReservationDetail(id);
return R.data(reservationVO);
}
/**
* 预约列表 详情
*/
@GetMapping("/getReservationPackage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distrbutionReservation")
public R<?> getReservationPackage(@RequestParam String reservationId,@RequestParam String id) {
R<?> reservationPackage = reservationService.getReservationPackage(reservationId,id);
return reservationPackage;
}
/**
* 预约列表 详情
*/
@GetMapping("/getReservationPackageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distrbutionReservation")
public R<?> getReservationPackageList(@RequestParam String reservationId) {
R<?> reservationPackage = reservationService.getReservationPackageList(reservationId);
return reservationPackage;
}
} }

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java

@ -20,8 +20,10 @@ import com.logpm.distribution.entity.DistributionReservationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.excel.DistributionReservationExcel; import com.logpm.distribution.excel.DistributionReservationExcel;
import com.logpm.distribution.vo.DistributionReservationVO; import com.logpm.distribution.vo.DistributionReservationVO;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -54,4 +56,6 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
Integer addReservations(@Param("list")List<Long> toLongList); Integer addReservations(@Param("list")List<Long> toLongList);
DistributionReservationVO getReservationDetail(String reservationId); DistributionReservationVO getReservationDetail(String reservationId);
List<DistributionStockArticleVO> getStockArticleList(@Param("id") String reservationId);
} }

76
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -80,5 +80,81 @@
AND AND
reservation.reservation.id=#{reservationId} reservation.reservation.id=#{reservationId}
</select> </select>
<select id="getStockArticleList" resultType="com.logpm.distribution.vo.DistributionStockArticleVO">
SELECT
ldsa.tenant_id,
ldsa.id,
ldsa.create_user,
ldsa.create_time,
ldsa.update_user,
ldsa.update_time,
ldsa.status,
ldsa.is_deleted,
ldsa.create_dept,
ldsa.service_number,
ldsa.order_self_numbering,
ldsa.mall_id,
ldsa.mall_code,
ldsa.mall_name,
ldsa.store_name,
ldsa.store_code,
ldsa.store_id,
ldsa.description_goods,
ldsa.warehouse_id,
ldsa.warehouse,
ldsa.warehouse_entry_time,
ldsa.store_time,
ldsa.total_number,
ldsa.hand_quantity,
ldsa.complete_set,
ldsa.brand,
ldsa.type_service,
ldsa.customer_name,
ldsa.customer_telephone,
ldsa.customer_address,
ldsa.genre,
ldsa.state,
ldsa.notification,
ldsa.fee,
ldsa.rate,
ldsa.advance_id,
ldsa.waybill_number,
ldsa.consignee_unit,
ldsa.collect_fee,
ldsa.storage_fee,
ldsa.consignee_person,
ldsa.consignee_address,
ldsa.consignee_mobile,
ldsa.warehouse_entry_time_end,
ldsa.sorting_quantity,
ldsa.delivery_quantity,
ldsa.transfer_quantity,
ldsa.signin_quantity,
ldsa.grounding_status,
ldsa.allocation,
ldsa.resource,
ldsa.trays,
ldsa.is_opai,
ldsa.inventory_date,
ldsa.inventory_person,
ldsa.inventory_person_id,
ldsa.freeze_status,
ldsa.available_quantity,
ldsa.is_have_data,
ldsa.stock_article_code,
ldsa.dealer_name,
ldsa.dealer_code,
ldrs.reservation_num AS reservationNum
FROM
logpm_distribution_reservation ldr
INNER JOIN logpm_distribution_reservation_stockarticle ldrs ON ldr.id = ldrs.reservation_id
INNER JOIN logpm_distribution_stock_article ldsa ON ldrs.stock_article_id = ldsa.id
<where>
<if test="id != '' and id != null">
ldr.id = #{id}
</if>
</where>
</select>
</mapper> </mapper>

16
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationPackageMapper.java

@ -16,6 +16,8 @@
*/ */
package com.logpm.distribution.mapper; package com.logpm.distribution.mapper;
import com.logpm.distribution.dto.DistributionReservationPackageDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationPackageEntity; import com.logpm.distribution.entity.DistributionReservationPackageEntity;
import com.logpm.distribution.vo.DistributionReservationPackageVO; import com.logpm.distribution.vo.DistributionReservationPackageVO;
import com.logpm.distribution.excel.DistributionReservationPackageExcel; import com.logpm.distribution.excel.DistributionReservationPackageExcel;
@ -57,4 +59,18 @@ public interface DistributionReservationPackageMapper extends BaseMapper<Distrib
* @return * @return
*/ */
int deleteReservationPackage(@Param("id")Long id); int deleteReservationPackage(@Param("id")Long id);
/**
* 查询订单下的包件信息
* @param reservationPackageDTO
* @return
*/
List<DistributionParcelListEntity> getReservationPackage(@Param("po")DistributionReservationPackageDTO reservationPackageDTO);
/**
* 查询预约单的所有包件信息
* @param reservationId
* @return
*/
List<DistributionParcelListEntity> getReservationPackageList(@Param("id")String reservationId);
} }

28
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationPackageMapper.xml

@ -36,5 +36,33 @@
<select id="exportDistributionReservationPackage" resultType="com.logpm.distribution.excel.DistributionReservationPackageExcel"> <select id="exportDistributionReservationPackage" resultType="com.logpm.distribution.excel.DistributionReservationPackageExcel">
SELECT * FROM logpm_distribution_reservation_package ${ew.customSqlSegment} SELECT * FROM logpm_distribution_reservation_package ${ew.customSqlSegment}
</select> </select>
<select id="getReservationPackage" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT
ldpl.*
FROM
logpm_distribution_reservation_package ldrp
INNER JOIN logpm_distribution_parcel_list ldpl ON ldrp.parce_list_id = ldpl.id
<where>
<if test="po.reservationId !='' and po.reservationId != null">
and ldrp.reservation_id = #{po.reservationId}
</if>
<if test="po.id !='' and po.id != null">
and ldrp.stock_article_id = #{po.id}
</if>
</where>
</select>
<select id="getReservationPackageList" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT
ldpl.*
FROM
`logpm_distribution_reservation_package` ldrp
INNER JOIN logpm_distribution_parcel_list ldpl ON ldrp.parce_list_id = ldpl.id
<where>
<if test="id != '' and id !=null">
and ldrp.reservation_id = #{id}
</if>
</where>
</select>
</mapper> </mapper>

20
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -66,7 +66,7 @@ public interface IDistributionReservationService extends BaseService<Distributio
* @param reservationId 预约信息ID * @param reservationId 预约信息ID
* @return * @return
*/ */
DistributionReservationVO getReservationDetail(String reservationId); R<?> getReservationDetail(String reservationId);
/** /**
* 新增预约列表数据 * 新增预约列表数据
@ -120,10 +120,24 @@ public interface IDistributionReservationService extends BaseService<Distributio
R<?> deliveryBusinessTask(DistributionDeliveryAllocationDTO allocationDTO); R<?> deliveryBusinessTask(DistributionDeliveryAllocationDTO allocationDTO);
/** /**
* *取消预约
* @param allocationDTO * @param reservationDTO
* @return * @return
*/ */
boolean cancelReservation(DistributionReservationDTO reservationDTO); boolean cancelReservation(DistributionReservationDTO reservationDTO);
/**
* 查询预约下的包件信息
* @param reservationId
* @param id
* @return
*/
R<?> getReservationPackage(String reservationId, String id);
/**
* 查询预约单下的所有包件信息
* @param reservationId
* @return
*/
R<?> getReservationPackageList(String reservationId);
} }

75
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -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);
}
} }

Loading…
Cancel
Save