Browse Source

配送详情客户包件增加表头搜索接口

single_db
汤建军 1 year ago
parent
commit
a8ee3c92d9
  1. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java
  3. 58
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  4. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java
  5. 93
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -87,8 +87,8 @@ public class DistributionDeliveryListController extends BladeController {
@GetMapping("/wrapdetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查看包件详情", notes = "传入distributionDeliveryList")
public R<IPage<DistributionParcelListVO>> wrapdetail(DistributionDeliveryInfoDTO distributionDeliveryInfoDTO, Query query) {
IPage<DistributionParcelListVO> pages = distributionDeliveryInfoService.selectDistributionDeliveryInfowrapPage(Condition.getPage(query), distributionDeliveryInfoDTO);
public R<IPage<DistributionParcelListVO>> wrapdetail(@RequestParam Map<String,Object> reservationPackageDTO, Query query) {
IPage<DistributionParcelListVO> pages = distributionDeliveryInfoService.selectDistributionDeliveryInfowrapPage(reservationPackageDTO,Condition.getPage(query));
return R.data(pages);
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java

@ -84,7 +84,7 @@ public interface DistributionDeliveryInfoMapper extends BaseMapper<DistributionD
* @param distributionDeliveryInfoDTO
* @return
*/
List<DistributionParcelListEntity> selectDistributionDeliverywrapInfoPage(IPage page, @Param("param") DistributionDeliveryInfoDTO distributionDeliveryInfoDTO);
List<DistributionParcelListEntity> selectDistributionDeliverywrapInfoPage(IPage page, @Param("param") Map<String,Object> reservationPackageDTO);
/**
* 通过客户查询包条数量
* @param id

58
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -131,11 +131,69 @@
FROM
logpm_distribution_reservation_package ldrp
join logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id
LEFT JOIN logpm_distribution_loadscan AS ldl ON ldpl.id = ldl.package_id
<where>
ldrp.packet_bar_status in ('1','3')
<if test="param.reservationId != null and param.reservationId!=''">
and ldrp.reservation_id = #{param.reservationId}
</if>
<if test="param.waybillNumber != null and param.waybillNumber!=''">
and ldpl.waybill_number like concat('%',#{param.waybillNumber},'%')
</if>
<if test="param.orderCode != null and param.orderCode!=''">
and ldpl.order_code like concat('%',#{param.orderCode},'%')
</if>
<if test="param.orderPackageCode != null and param.orderPackageCode!=''">
and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%')
</if>
<if test="param.serviceNumber != null and param.serviceNumber!=''">
and ldpl.service_number like concat('%',#{param.serviceNumber},'%')
</if>
<if test="param.sendWarehouseName != null and param.sendWarehouseName!=''">
and ldpl.send_warehouse_name like concat('%',#{param.sendWarehouseName},'%')
</if>
<if test="param.acceptWarehouseName != null and param.acceptWarehouseName!=''">
and ldpl.accept_warehouse_name like concat('%',#{param.acceptWarehouseName},'%')
</if>
<if test="param.trainNumber != null and param.trainNumber!=''">
and ldpl.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.firsts != null and param.firsts!=''">
and ldpl.firsts like concat('%',#{param.firsts},'%')
</if>
<if test="param.second != null and param.second!=''">
and ldpl.second like concat('%',#{param.second},'%')
</if>
<if test="param.thirdProduct != null and param.thirdProduct!=''">
and ldpl.third_product like concat('%',#{param.thirdProduct},'%')
</if>
<if test="param.orderPackageStockupStatus != null and param.orderPackageStockupStatus!=''">
and ldpl.order_package_stockup_status = #{param.orderPackageStockupStatus}
</if>
<if test="param.orderPackageReservationStatus != null and param.orderPackageReservationStatus!=''">
and ldpl.order_package_reservation_status = #{param.orderPackageReservationStatus}
</if>
<if test="param.orderPackageLoadingStatus != null and param.orderPackageLoadingStatus!=''">
and ldpl.order_package_loading_status = #{param.orderPackageLoadingStatus}
</if>
<if test="param.orderPackageStatus != null and param.orderPackageStatus!='' ">
and ldpl.order_package_status = #{param.orderPackageStatus}
</if>
<if test="param.unSigning != null and param.unSigning!='' ">
and ldpl.order_package_status != #{param.unSigning}
</if>
<if test="param.scanStatus != null and param.scanStatus!='' ">
and ldl.scan_status = #{param.scanStatus}
</if>
<if test="param.scanUser != null and param.scanUser!='' ">
and ldl.scan_user like concat('%',#{param.scanUser},'%')
</if>
<if test="param.loadingTime != null and param.loadingTime!='' ">
and ldl.scan_time like concat('%',#{param.loadingTime},'%')
</if>
<if test="param.signingTime != null and param.signingTime!='' ">
and ldl.signing_time like concat('%',#{param.signingTime},'%')
</if>
</where>
</select>
<select id="selectWrapCount" resultType="java.lang.Integer">

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java

@ -61,7 +61,7 @@ public interface IDistributionDeliveryInfoService extends BaseService<Distributi
* @param distributionDeliveryInfoDTO
* @return
*/
IPage<DistributionParcelListVO> selectDistributionDeliveryInfowrapPage(IPage<DistributionParcelListVO> page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO);
IPage<DistributionParcelListVO> selectDistributionDeliveryInfowrapPage(Map<String,Object> reservationPackageDTO,IPage<DistributionParcelListVO> page);
/**
* 从配送查询包条自定义分页
*

93
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java

@ -44,6 +44,8 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
@ -95,38 +97,57 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
}
@Override
public IPage<DistributionParcelListVO> selectDistributionDeliveryInfowrapPage(IPage<DistributionParcelListVO> page, DistributionDeliveryInfoDTO distributionDeliveryInfoDTO) {
List<DistributionParcelListEntity> parcelListEntityList = baseMapper.selectDistributionDeliverywrapInfoPage(page, distributionDeliveryInfoDTO);
List<DistributionParcelListVO> parcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntityList);
parcelListVOS.forEach(p -> {
//查询扫描表,
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getPackageId, p.getId()).eq(DistributionLoadscanEntity::getOrderPackageCode, p.getOrderPackageCode()));
if (Func.isNotEmpty(loadscanEntity)) {
switch (loadscanEntity.getScanState().toString()) {
case "1":
p.setScanStatus(LoadingStatusConstant.quxiao.getName());
break;
case "2":
p.setScanStatus(LoadingStatusConstant.saomiao.getName());
break;
case "3":
p.setScanStatus(LoadingStatusConstant.queren.getName());
break;
case "4":
p.setScanStatus(LoadingStatusConstant.yijianzhuangche.getName());
break;
}
if (Func.isNotEmpty(loadscanEntity.getSigningTime())) {
p.setSigningTime(loadscanEntity.getSigningTime());
}
if (Func.isNotEmpty(loadscanEntity.getScanUser())) {
p.setScanUser(loadscanEntity.getScanUser());
}
if (Func.isNotEmpty(loadscanEntity.getDriverName())) {
p.setDriverName(loadscanEntity.getDriverName());
public IPage<DistributionParcelListVO> selectDistributionDeliveryInfowrapPage(Map<String, Object> reservationPackageDTO, IPage<DistributionParcelListVO> page) {
if (Func.isEmpty(reservationPackageDTO.get("reservationId"))) {
return null;
}
if (Func.isNotEmpty(reservationPackageDTO.get("orderPackageStatus"))) {
String orderPackageStatus = (String) reservationPackageDTO.get("orderPackageStatus");
if (Func.isNotBlank(orderPackageStatus)) {
if (!orderPackageStatus.equals("70")) {
reservationPackageDTO.put("unSigning", "70");
reservationPackageDTO.remove(orderPackageStatus);
}
}
});
}
List<DistributionParcelListEntity> parcelListEntityList = baseMapper.selectDistributionDeliverywrapInfoPage(page, reservationPackageDTO);
List<DistributionParcelListVO> parcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntityList);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
parcelListVOS.forEach(p -> {
//查询扫描表,
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getPackageId, p.getId()).eq(DistributionLoadscanEntity::getOrderPackageCode, p.getOrderPackageCode()));
if (Func.isNotEmpty(loadscanEntity)) {
try {
p.setLoadingTime(sdf.parse(loadscanEntity.getScanTime()));
switch (loadscanEntity.getScanState().toString()) {
case "1":
p.setScanStatus(LoadingStatusConstant.quxiao.getName());
break;
case "2":
p.setScanStatus(LoadingStatusConstant.saomiao.getName());
break;
case "3":
p.setScanStatus(LoadingStatusConstant.queren.getName());
break;
case "4":
p.setScanStatus(LoadingStatusConstant.yijianzhuangche.getName());
break;
}
if (Func.isNotEmpty(loadscanEntity.getSigningTime())) {
p.setSigningTime(loadscanEntity.getSigningTime());
}
if (Func.isNotEmpty(loadscanEntity.getScanUser())) {
p.setScanUser(loadscanEntity.getScanUser());
}
if (Func.isNotEmpty(loadscanEntity.getDriverName())) {
p.setDriverName(loadscanEntity.getDriverName());
}
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
});
return page.setRecords(parcelListVOS);
}
@ -150,17 +171,17 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscanEntity::getDeliveryId, distributionStockArticle.get("deliveryId"))
);
Map<Long, List<DistributionLoadscanEntity>> orderLoadMap;
if (!Objects.isNull(loadList)){
if (!Objects.isNull(loadList)) {
orderLoadMap = loadList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getOrderId));
} else {
orderLoadMap = null;
}
distributionDeliveryInfoVOS.forEach(s -> {
orderLoadMap = null;
}
distributionDeliveryInfoVOS.forEach(s -> {
//匹配当前配送任务签收数量
s.setSigningNumber(0);
if (Func.isNotEmpty(orderLoadMap)){
if (Func.isNotEmpty(orderLoadMap)) {
List<DistributionLoadscanEntity> orderLoading = orderLoadMap.get(s.getId());
if (Func.isNotEmpty(orderLoading)){
if (Func.isNotEmpty(orderLoading)) {
int signingNum = orderLoading.stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum();
s.setSigningNumber(signingNum);
}

Loading…
Cancel
Save