Browse Source

1.干线-三方中转bug修复

master
zhenghaoyu 9 months ago
parent
commit
3399f0be3a
  1. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  2. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  3. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java
  4. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  5. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  6. 33
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  7. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  8. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  9. 53
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java
  10. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  11. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml
  12. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  13. 34
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  14. 14
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

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

@ -149,4 +149,7 @@ public interface IDistributionParcelListClient {
@GetMapping(API_PREFIX+"/findAllStockListByOrderPackageCode")
List<DistributionParcelListEntity> findAllStockListByOrderPackageCode(String orderPackageCode);
@PostMapping(API_PREFIX+"/updatePackageStatus")
void updatePackageStatus(@RequestParam List<String> orderPackageCodes, @RequestParam Long warehouseId, @RequestParam String packageStatus);
}

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java

@ -120,4 +120,7 @@ public class LoadCarsDTO implements Serializable {
private List<TrunklineLoadSignPhotoEntity> signPhotoList;
private Integer isTransfer = 0;
}

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java

@ -22,6 +22,8 @@ public class CarsLoadWaybillInfoVO implements Serializable {
private Integer waybillNum;
private String openPrice;
private String goodsName;
private String waybillType;
private Long waybillId;
private String remark;
private BigDecimal totalFreight;
private BigDecimal deliveryFee;

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

@ -320,4 +320,15 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
return distributionParcelListService.list(queryWrapper);
}
@Override
public void updatePackageStatus(List<String> orderPackageCodes, Long warehouseId, String packageStatus) {
distributionParcelListService.updatePackageStatus(orderPackageCodes,warehouseId,packageStatus);
List<DistributionParcelListEntity> list = distributionParcelListService.findListByOrderPackageCode(orderPackageCodes,warehouseId);
//循环list调用更新updateOrderInfo方法
list.forEach(item->{
distributionStockArticleService.updateOrderInfo(item.getOrderCode(),warehouseId);
});
}
}

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

@ -259,4 +259,8 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
* @return 返回一个List<DistributionParcelListEntity>类型的集合包含匹配的包裹列表实体
*/
List<DistributionParcelListEntity> findListByIds(@Param("parcelListIds") Set<Long> parcelListIds, @Param("warehouseId") Long warehouseId);
void updatePackageStatus(@Param("orderPackageCodes") List<String> orderPackageCodes, @Param("warehouseId") Long warehouseId, @Param("packageStatus") String packageStatus);
List<DistributionParcelListEntity> findListByOrderPackageCode(@Param("orderPackageCodes") List<String> orderPackageCodes, @Param("warehouseId") Long warehouseId);
}

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

@ -1457,4 +1457,37 @@
</foreach>
and warehouse_id = #{warehouseId}
</select>
<update id="updatePackageStatus">
update logpm_distribution_parcel_list ldpl
set ldpl.order_package_status = #{packageStatus}
where exists(
select 1 from (
<foreach collection="orderPackageCodes" index="ind" item="item">
<if test="ind == 0">
select #{item} pid
</if>
<if test="ind != 0">
union all
select #{item} pid
</if>
</foreach>
) packageCodes where packageCodes.pid = ldpl.order_package_code)
and ldpl.warehouse_id = #{warehouseId}
</update>
<select id="findListByOrderPackageCode" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
select *
from logpm_distribution_parcel_list
where 1=1
<if test="orderPackageCodes != null and orderPackageCodes.size() > 0">
and order_package_code in
<foreach collection="orderPackageCodes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
and warehouse_id = #{warehouseId}
</select>
</mapper>

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

@ -219,4 +219,8 @@ public interface IDistributionParcelListService extends BaseService<Distribution
* @return 返回一个List<DistributionParcelListEntity>类型的集合包含匹配的包裹列表实体
*/
List<DistributionParcelListEntity> findListByIds(Set<Long> parcelListIds, Long warehouseId);
void updatePackageStatus(List<String> orderPackageCodes, Long warehouseId, String packageStatus);
List<DistributionParcelListEntity> findListByOrderPackageCode(List<String> orderPackageCodes, Long warehouseId);
}

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

@ -1215,4 +1215,14 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return null;
}
@Override
public void updatePackageStatus(List<String> orderPackageCodes, Long warehouseId, String packageStatus) {
baseMapper.updatePackageStatus(orderPackageCodes,warehouseId,packageStatus);
}
@Override
public List<DistributionParcelListEntity> findListByOrderPackageCode(List<String> orderPackageCodes, Long warehouseId) {
return baseMapper.findListByOrderPackageCode(orderPackageCodes,warehouseId);
}
}

53
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java

@ -468,6 +468,59 @@ public class TripartiteTransferController {
}
}
@ResponseBody
@PostMapping("/tripartiteTransferFindSignPhoto")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "三方中转签收图片列表", notes = "传入loadCarsDTO")
public R tripartiteTransferFindSignPhoto(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############tripartiteTransferFindSignPhoto: ";
log.info(method+"请求参数{}",loadCarsDTO);
try{
// //当前登录人选择的仓库
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// if(!Objects.isNull(myCurrentWarehouse)){
// loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
// }
//
// IPage<TripartiteTransferVO> pages = carsLoadService.tripartiteTransferPageList(loadCarsDTO);
return carsLoadService.tripartiteTransferFindSignPhoto(loadCarsDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/tripartiteTransferUploadSignPhoto")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "三方中转签收图片上传", notes = "传入loadCarsDTO")
public R tripartiteTransferUploadSignPhoto(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############tripartiteTransferUploadSignPhoto: ";
log.info(method+"请求参数{}",loadCarsDTO);
try{
// //当前登录人选择的仓库
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// if(!Objects.isNull(myCurrentWarehouse)){
// loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
// }
//
// IPage<TripartiteTransferVO> pages = carsLoadService.tripartiteTransferPageList(loadCarsDTO);
return carsLoadService.tripartiteTransferUploadSignPhoto(loadCarsDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -154,6 +154,7 @@
left join logpm_distribution_parcel_list ldpl on ldsa.order_code = ldpl.order_code
where ldpl.is_deleted = 0
and ldpl.order_package_status = '20'
and
and ldpl.is_deleted = 0
and ldpl.is_transfer = 1
and ldpl.waybill_number is not null
@ -173,6 +174,13 @@
and ldsa.warehouse_id = #{param.warehouseId}
and ldpl.warehouse_id = #{param.warehouseId}
</if>
<if test="param.isTransfer != null and param.isTransfer == 1" >
and ldpl.accept_warehouse_id = #{param.warehouseId}
and ldsa.type_service = '4'
</if>
<if test="param.isTransfer != null and param.isTransfer == 0" >
and ldsa.type_service != '4'
</if>
group by ldpl.order_code,
ldpl.waybill_number,
ldsa.is_zero,

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml

@ -104,6 +104,8 @@
<select id="findWaybillOrderByloadId" resultType="com.logpm.trunkline.vo.CarsLoadWaybillInfoVO">
select t.waybill_no waybillNo,
wb.id waybillId,
wb.waybill_type waybillType,
wb.create_time createTime,
wb.destination destination,
wb.destination_warehouse_name destinationWarehouseName,

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

@ -207,4 +207,9 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R findWaybillTransferInfo(Long waybillId);
List<LoadingDetailExportVO> loadingDetailExport(LoadCarsDTO loadCarsDTO);
R tripartiteTransferFindSignPhoto(LoadCarsDTO loadCarsDTO);
R tripartiteTransferUploadSignPhoto(LoadCarsDTO loadCarsDTO);
}

34
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -105,6 +105,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
private final IBasicdataDriverArteryClient driverArteryClient;
private final ITrunklineLoadSignPhotoService loadSignPhotoService;
private final ITrunklineWaybillPackageService waybillPackageService;
@Override
public IPage<TrunklineCarsLoadVO> loadCarsPageList(LoadCarsDTO loadCarsDTO) {
@ -4066,9 +4067,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
trunklineCarsLoadScanService.updateScanStatus(loadScanIds, "3");
try {
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodesByIds(loadScanIds);
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodesByIds(loadScanIds);
//包件签收状态修改
distributionParcelListClient.updatePackageStatus(orderPackageCodes,warehouseId,"70");
waybillPackageService.updatePackageStatus(orderPackageCodes,WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode());
try {
String content = "包件在" + warehouseEntity.getName() + "被三方中转签收";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode(), content);
} catch (Exception e) {
@ -4437,6 +4443,30 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return trunklineCarsLoadScanService.loadingDetailExport(loadCarsDTO);
}
@Override
public R tripartiteTransferFindSignPhoto(LoadCarsDTO loadCarsDTO) {
List<TrunklineLoadSignPhotoEntity> signPhotoEntityList = loadSignPhotoService.findBySignPhotoList(loadCarsDTO.getLoadId());
return R.data(signPhotoEntityList);
}
@Override
public R tripartiteTransferUploadSignPhoto(LoadCarsDTO loadCarsDTO) {
Long signOrderId = loadCarsDTO.getSignOrderId();
List<TrunklineLoadSignPhotoEntity> signPhotoList = loadCarsDTO.getSignPhotoList();
List<TrunklineLoadSignPhotoEntity> oldSignPhotoList = loadSignPhotoService.findBySignPhotoList(signOrderId);
//修改oldSignPhotoList中所有对象的type为2
oldSignPhotoList.forEach(e -> {
e.setPhotoType(2);
});
loadSignPhotoService.removeBatchByIds(oldSignPhotoList);
loadSignPhotoService.saveBatch(signPhotoList);
return R.success("上传成功");
}
@Override
public R loadingTrayInfo(LoadCarsDTO loadCarsDTO) {
log.info("##############loadingTrayInfo: 查询托盘的货物信息");

14
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -1,6 +1,7 @@
package com.logpm.warehouse.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -43,7 +44,6 @@ import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.OldSystemDataPushConfig;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.order.*;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.TemplateUtil;
import org.springblade.core.log.exception.ServiceException;
@ -54,7 +54,6 @@ import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -763,7 +762,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
if (ObjectUtils.isNotEmpty(detailList)) {
// 得到需要打印的页面数量
int num = detailList.size() % 4;
int num = detailList.size() / 4;
for (int i = 0; i <= num; i++) {
// 需要从detailList每次循环获取到4个数据
@ -794,9 +793,9 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
Map<String, Object> map = new HashMap<>();
map.put("查询单号", warehouseWaybillEntity.getWaybillNo());
map.put("起运地", warehouseWaybillEntity.getWaybillNo());
map.put("到达站", warehouseWaybillEntity.getWaybillNo());
map.put("客户车次号", warehouseWaybillEntity.getWaybillNo());
map.put("起运地", warehouseWaybillEntity.getDepartureWarehouseName());
map.put("到达站", warehouseWaybillEntity.getDestinationWarehouseName());
map.put("客户车次号", "客户车次号: "+warehouseWaybillEntity.getCustomerTrain());
map.put("托运单位名称", warehouseWaybillEntity.getShipper());
@ -853,6 +852,9 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
private String formatToTwoDecimalPlaces(BigDecimal value) {
if(ObjectUtil.isNull(value)){
return "";
}
return value.setScale(2, RoundingMode.HALF_UP).toString();
}

Loading…
Cancel
Save