Browse Source

1.修复干线测试bug

master
zhenghaoyu 8 months ago
parent
commit
b10301c173
  1. 7
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  2. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  3. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  4. 30
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  5. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  6. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  7. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  8. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

7
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java

@ -171,4 +171,11 @@ public interface IDistributionParcelListClient {
@GetMapping(API_PREFIX+"/findListByWaybillId")
List<DistributionParcelListEntity> findListByWaybillId(@RequestParam Long waybillId);
@PostMapping(API_PREFIX+"/findPackagesByAdvanceIdsAndNoStock")
List<DistributionParcelListEntity> findPackagesByAdvanceIdsAndNoStock(@RequestParam List<Long> advanceIds, @RequestParam Long warehouseId);
@PostMapping(API_PREFIX+"/findAllOrderCodesByAdvanceIds")
List<String> findAllOrderCodesAndDeleteByAdvanceIds(@RequestParam List<Long> advanceIds, @RequestParam Long warehouseId);
}

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java

@ -34,6 +34,7 @@ import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@ -391,4 +392,20 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
return distributionParcelListService.list(queryWrapper);
}
@Override
public List<DistributionParcelListEntity> findPackagesByAdvanceIdsAndNoStock(List<Long> advanceIds, Long warehouseId) {
return distributionParcelListService.findPackagesByAdvanceIdsAndNoStock(advanceIds,warehouseId);
}
@Transactional(rollbackFor = Exception.class)
@Override
public List<String> findAllOrderCodesAndDeleteByAdvanceIds(List<Long> advanceIds, Long warehouseId) {
List<String> orderCodes = distributionParcelListService.findAllOrderCodesByAdvanceIds(advanceIds, warehouseId);
distributionParcelListService.removePakcageByAdvanceIds(advanceIds,warehouseId);
distributionStockArticleService.updateOrdersInfo(orderCodes,warehouseId);
return orderCodes;
}
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java

@ -270,4 +270,9 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
void clearParceListWaybillByAdvanceIds(@Param("advanceIds") List<Long> advanceIds);
List<DistributionParcelListEntity> findPackagesByAdvanceIdsAndNoStock(@Param("advanceIds") List<Long> advanceIds, @Param("warehouseId") Long warehouseId);
List<String> findAllOrderCodesByAdvanceIds(@Param("advanceIds") List<Long> advanceIds, @Param("warehouseId") Long warehouseId);
void removePakcageByAdvanceIds(@Param("advanceIds") List<Long> advanceIds, @Param("warehouseId") Long warehouseId);
}

30
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -1728,4 +1728,34 @@
</foreach>
</update>
<select id="findPackagesByAdvanceIdsAndNoStock" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
select *
from logpm_distribution_parcel_list ldpl
where warehouse_id = #{warehouseId}
and order_package_status != '20'
and advance_id in
<foreach collection="advanceIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findAllOrderCodesByAdvanceIds" resultType="String">
select order_code
from logpm_distribution_parcel_list ldpl
where warehouse_id = #{warehouseId}
and advance_id in
<foreach collection="advanceIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
group by order_code
</select>
<delete id="removePakcageByAdvanceIds" >
delete from logpm_distribution_parcel_list
where advance_id in
<foreach collection="advanceIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
</mapper>

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java

@ -229,4 +229,10 @@ public interface IDistributionParcelListService extends BaseService<Distribution
void updateUnFreezeStatusByWaybillIds(List<Long> waybillIds);
void clearParceListWaybillByAdvanceIds(List<Long> advanceIds);
List<DistributionParcelListEntity> findPackagesByAdvanceIdsAndNoStock(List<Long> advanceIds, Long warehouseId);
List<String> findAllOrderCodesByAdvanceIds(List<Long> advanceIds, Long warehouseId);
void removePakcageByAdvanceIds(List<Long> advanceIds, Long warehouseId);
}

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -1250,4 +1250,19 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
baseMapper.clearParceListWaybillByAdvanceIds(advanceIds);
}
@Override
public List<DistributionParcelListEntity> findPackagesByAdvanceIdsAndNoStock(List<Long> advanceIds, Long warehouseId) {
return baseMapper.findPackagesByAdvanceIdsAndNoStock(advanceIds,warehouseId);
}
@Override
public List<String> findAllOrderCodesByAdvanceIds(List<Long> advanceIds, Long warehouseId) {
return baseMapper.findAllOrderCodesByAdvanceIds(advanceIds,warehouseId);
}
@Override
public void removePakcageByAdvanceIds(List<Long> advanceIds, Long warehouseId) {
baseMapper.removePakcageByAdvanceIds(advanceIds,warehouseId);
}
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -197,6 +197,7 @@ public class InComingServiceImpl implements IInComingService {
// DynamicDataSourceContextHolder.push(tenantId);
Integer total = 0;
for (Long advanceId : advanceIds) {
QueryWrapper<TrunklineAdvanceDetailEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("advance_id", advanceId)
@ -213,11 +214,11 @@ public class InComingServiceImpl implements IInComingService {
//存入日志
packageTrackLogAsyncService.addPackageTrackLog(tenantId, userId, deptId, nickName, orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY.getCode(), "包件" + IncomingTypeEnum.getValue(incomingType));
total = total + detailList.size();
}
// DynamicDataSourceContextHolder.clear();
return R.success("入库成功");
return R.success("入库成功"+total+"件");
}
}

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -889,11 +889,23 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
@Override
public void deletedAdvance(AdvanceDTO advanceDTO) {
List<Long> advanceIds = advanceDTO.getAdvanceIds();
Long warehouseId = advanceDTO.getWarehouseId();
//查询包件是否已经不在库
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListClient.findPackagesByAdvanceIdsAndNoStock(advanceIds,warehouseId);
if(!parcelListEntities.isEmpty()){
log.warn("############deletedAdvance: 已有包件出库,不能删除");
throw new CustomerException(405,"已有包件出库,不能删除");
}
for (Long advanceId : advanceIds) {
advanceDetailService.deleteByAdvanceId(advanceId);
}
advanceService.deletedAdvance(advanceIds);
//删除所有在库包件,并更新订单信息
distributionParcelListClient.findAllOrderCodesAndDeleteByAdvanceIds(advanceIds,warehouseId);
}
@Override

Loading…
Cancel
Save