Browse Source

回库任务、异常驳回

dist.1.3.0
汤建军 4 months ago
parent
commit
0fc8dfbd7e
  1. 5
      blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java
  2. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionLoadscanAbnormalVO.java
  3. 59
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionRetentionScanVO.java
  4. 30
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java
  5. 6
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseRetentionScanClient.java
  6. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java
  7. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  8. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  9. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  10. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  11. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  12. 48
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  13. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  14. 123
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  15. 11
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionScanController.java
  16. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseRetentionScanClient.java
  17. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.java
  18. 40
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.xml
  19. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionScanService.java
  20. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java

5
blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java

@ -72,6 +72,7 @@ public enum WorkNodeEnums implements Serializable {
DISTRIBUTION_LOADING(302010, "配送装车"),
DISTRIBUTION_ABNORMAL_LOADING(302020, "异常装车"),
DISTRIBUTION_ABNORMAL_REJECT(302025, "异常驳回"),
DISTRIBUTION_CANCEL_LOADING(302030, "取消装车"),
DISTRIBUTION_CAR_START(302040, "配送发车"),
DISTRIBUTION_CAR_ARRIVED(302050, "配送到达"),
@ -80,7 +81,9 @@ public enum WorkNodeEnums implements Serializable {
DISTRIBUTION_ABNORMAL_SIGN_FOR(302080, "异常签收"),
DISTRIBUTION_FAIL(302090, "配送失败"),
CLERK_REVIEW(303010, "文员复核");
CLERK_REVIEW(303010, "文员复核"),
DELIVERY_COMPLETE(303020, "车次完成");
private Integer code;
private String value;

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionLoadscanAbnormalVO.java

@ -190,5 +190,10 @@ public class DistributionLoadscanAbnormalVO extends DistributionLoadscanAbnormal
*/
@ApiModelProperty(value = "装车状态")
private String orderPackageLoadingStatusName;
/**
* 异常类型
*/
@ApiModelProperty(value = "异常类型")
private String abnormalTypeName;
}

59
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionRetentionScanVO.java

@ -0,0 +1,59 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.vo.app;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* 滞留扫描记录 视图实体类
*
* @author BladeX
* @since 2023-11-03
*/
@Data
public class DistributionRetentionScanVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String taskCode;
private String orderPackageCode;
private String orderCode;
private String vehicleNumber;
private String trainNumber;
private String reservationCode;
private String deliveryType;
private String retentionType;
private String goodsName;
private String retentionQuantity;
}

30
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java

@ -261,4 +261,34 @@ public class WarehouseRetentionScanEntity extends TenantEntity {
@ApiModelProperty(value = "运单Id")
private String warehouseName;
/**
* 车牌号
*/
@ApiModelProperty(value = "车牌号")
private String vehicleNumber;
/**
* 配送类型
*/
@ApiModelProperty(value = "配送类型 1-市配 2-商配")
private Integer deliveryType;
/**
* 回库任务类型
*/
@ApiModelProperty(value = "配送类型 1-新增 2-异常 3-取消签收")
private Integer retentionType;
/**
* 是否回库
*/
@ApiModelProperty(value = "是否确认回库 0否 1是")
private boolean confirmStatus;
/**
* 回库任务编号
*/
@ApiModelProperty(value = "回库任务编号")
private String taskCode;
}

6
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseRetentionScanClient.java

@ -16,6 +16,7 @@
*/
package com.logpm.warehouse.feign;
import com.logpm.distribution.vo.app.DistributionRetentionScanVO;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.mp.support.BladePage;
@ -64,4 +65,9 @@ public interface IWarehouseRetentionScanClient {
@PostMapping(TOP+"/saveBatchRetentionScan")
R saveBatchRetentionScan(@RequestBody List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities);
@PostMapping(TOP+"/submitBatchRetentionScan")
R submitBatchRetentionScan(@RequestBody List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities);
@GetMapping(TOP+"/retentionScanEntityListByWarehouseId")
List<DistributionRetentionScanVO> getRetentionScanEntityListByWarehouseId(@RequestParam("warehouseId") Long warehouseId);
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java

@ -381,6 +381,17 @@ public class DistributionDeliveryAppController {
}
/**
* 扫描查询配送任务下的包件信息
*/
@GetMapping("/newRetentionScan")
@ApiOperationSupport(order = 11)
public R newRetentionScan() {
R r = distributionDeliveryListService.newRetentionScan();
return r;
}
/**
* 扫描查询配送任务下的包件信息
*/

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java

@ -157,6 +157,18 @@ public class DistributionSignforController extends BladeController {
}
/**
* 异常装车驳回
*/
@GetMapping("/newLoadingAbnormalPackageListTurnDown")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distributionSignfor")
public R newLoadingAbnormalPackageListTurnDown(@RequestParam("ids") String ids) {
R r = distributionSignforService.newLoadingAbnormalPackageListTurnDown(ids);
return r;
}
/**
* 签收管理 签收订单统计

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

@ -2250,8 +2250,8 @@
LEFT JOIN logpm_distribution_loadscan AS ldl ON ldla.loading_id = ldl.id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldla.package_id = ldpl.id
WHERE
ldla.reservation_id = 1834121310973964290
AND ldla.delivery_list_id = 1834121296369397761
ldla.reservation_id = #{reservationId}
AND ldla.delivery_list_id = #{deliveryId}
AND ldla.is_deleted = 0
</select>

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -527,6 +527,13 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/
R newAbnormalLoading(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
/**
* 回库任务扫描
* @param distrilbutionloadingscanDTO
* @return
*/
R newRetentionScan();
// /**

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

@ -92,6 +92,8 @@ public interface IDistributionReservationService extends BaseService<Distributio
*/
String reservationMa();
String retentionMa();
/**
* 配送编码
* @return

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java

@ -407,4 +407,11 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
* @return
*/
R newLoadingAbnormalPackageListDetail(Long signId);
/**
* 异常驳回
* @param ids
* @return
*/
R newLoadingAbnormalPackageListTurnDown(String ids);
}

48
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -59,6 +59,7 @@ import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.*;
import com.logpm.warehouse.vo.TrayTypeDataVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.util.Strings;
@ -87,6 +88,7 @@ import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.*;
import org.springblade.common.model.workNode.FinishDistributionTrainVO;
import org.springblade.common.serviceConstant.ServiceConstant;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.QRCodeUtil;
@ -283,6 +285,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Autowired
private IBasicMaterialClient basicMaterialClient;
@Autowired
private IWarehouseRetentionScanClient retentionScanClient;
@Override
public IPage<DistributionDeliveryListEntity> selectDistributionDeliveryListPage(IPage<DistributionDeliveryListEntity> page, DistributionDeliveryListDTO distributionDeliveryList) {
//转换创建时间
@ -9268,17 +9274,18 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanSuccess("操作成功", "异常" + abnormalTotal + "件");
}
private List<JSONObject> handleCancelPackagelog(List<DistributionParcelListEntity> parcelListEntities, BasicdataWarehouseEntity warehouse, String trainNumber, String reservationCode) {
List<JSONObject> packageLogList = new ArrayList<>();
String content = "包件在" + warehouse.getName() + "由" + AuthUtil.getNickName() + "取消装车,配送车次号:" + trainNumber + "预约任务号:" + reservationCode;
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) {
JSONObject trunklinePackageTrackLog = handleLogJSONObject(warehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_CANCEL_LOADING.getCode());
packageLogList.add(trunklinePackageTrackLog);
@Override
public R newRetentionScan() {
//查询包件
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
return Resp.scanFail("未授权!!!", "未授权!!!");
}
//查询所有的回库任务
List<DistributionRetentionScanVO> retentionScanVOS = retentionScanClient.getRetentionScanEntityListByWarehouseId(myCurrentWarehouse.getId());
return packageLogList;
return R.data(retentionScanVOS);
}
private void updateZeroLoadingEntity(DistributionLoadscanEntity loadscanEntity, DistributionParcelNumberDTO parcelListDTO, BasicdataWarehouseEntity myCurrentWarehouse, Map<Long, DistributionParcelNumberEntity> zeroPackageMap) {
@ -9797,7 +9804,30 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
private boolean isAllSignforCompleted(Long deliveryId) {
List<DistributionSignforEntity> signforEntities = baseMapper.selectSignforByDeliveryId(deliveryId);
return signforEntities.stream().allMatch(s -> SignforStatusConstant.yiqianshou.getValue().equals(s.getSigningStatus()));
boolean match = signforEntities.stream().allMatch(s -> SignforStatusConstant.yiqianshou.getValue().equals(s.getSigningStatus()));
if (match) {
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(deliveryId);
if (!Objects.isNull(deliveryListEntity)){
NodeFanoutMsg<FinishDistributionTrainVO> nodeFanoutMsg = buildNodeFanoutMsgByFinishDistributionTrainVO(deliveryListEntity,AuthUtil.getUser());
distributionNodeWorkService.finishDistributionTrain(nodeFanoutMsg,AuthUtil.getUser());
}
}
return match;
}
private NodeFanoutMsg<FinishDistributionTrainVO> buildNodeFanoutMsgByFinishDistributionTrainVO(DistributionDeliveryListEntity deliveryListEntity, BladeUser user) {
NodeFanoutMsg<org.springblade.common.model.workNode.FinishDistributionTrainVO> nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setNode(WorkNodeEnums.DELIVERY_COMPLETE);
nodeFanoutMsg.setWarehouse(deliveryListEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(deliveryListEntity.getWarehouseId());
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(new Date());
nodeFanoutMsg.setTenantId(AuthUtil.getTenantId());
FinishDistributionTrainVO finishDistributionTrainVO = new FinishDistributionTrainVO();
finishDistributionTrainVO.setTrainNumber(deliveryListEntity.getTrainNumber());
nodeFanoutMsg.setMain(finishDistributionTrainVO);
return nodeFanoutMsg;
}

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

@ -949,6 +949,30 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return sb.toString();
}
@Override
public String retentionMa() {
StringBuilder sb = new StringBuilder();
sb.append("HK");
BladeUser user = AuthUtil.getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String format1 = format.format(new Date());
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getMyCurrentWarehouse();
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) {
sb.append(warehouseByDepartment.getWarehouseCode());
sb.append(format1);
String s = "YY" + warehouseByDepartment.getWarehouseCode();
String s1 = jiShuan(s);
sb.append(s1);
} else {
sb.append("00000");
sb.append(format1);
String s = "YY" + "00000";
String s1 = jiShuan(s);
sb.append(s1);
}
return sb.toString();
}
@Override
public String deliveryListMa() {

123
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -55,7 +55,8 @@ import com.logpm.oldproject.feign.IWarehouseClient;
import com.logpm.trunkline.dto.WaybillLogDTO;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.trunkline.feign.ITrunklineWaybillTrackClient;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
import com.logpm.warehouse.feign.IWarehouseRetentionScanClient;
import com.logpm.warehouse.feign.IWarehouseUpdownStockUpAreaClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import lombok.extern.slf4j.Slf4j;
@ -261,6 +262,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private IBasicdataDriverArteryClient basicdataDriverArteryClient;
@Autowired
private IWarehouseRetentionScanClient warehouseRetentionScanClient;
@Override
public IPage<DistributionSignforVO> selectDistributionSignforPage(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor) {
@ -8329,6 +8333,122 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R.data(loadscanAbnormalVOS);
}
@Override
@Transactional
public R newLoadingAbnormalPackageListTurnDown(String ids) {
//异常驳回进行异常信息的删除,对于装车记录的清理,对于已装车和签收的数量扣减
String method = "####################异常驳回loadingAbnormalPackageListTurnDown";
if (Func.isEmpty(ids)) {
log.error(method + "ids参数缺失:{}", ids);
return R.fail("参数缺失,请联系管理员");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
log.error(method + "未授权");
return R.fail(403,"未授权!!!");
}
List<Long> list = Func.toLongList(ids);
List<DistributionLoadscanAbnormalEntity> abnormalEntities = distributionLoadscanAbnormalService.listByIds(list);
if (abnormalEntities.isEmpty()){
log.error(method + "查询异常列表数据错误,ids:{}", ids);
return R.fail("查询异常列表数据错误,请联系管理员");
}
boolean isLoadingFlag = abnormalEntities.stream().anyMatch(a -> Objects.isNull(a.getLoadingId()));
if (isLoadingFlag) {
//存在驳回但是未进行装车数据
String unLoadingPackageCode = abnormalEntities.stream().filter(a -> Objects.isNull(a.getLoadingId())).map(DistributionLoadscanAbnormalEntity::getPackageCode).collect(Collectors.joining(","));
log.error(method + "驳回出现,未进行装车的包件,unLoadingPackageCode:{}", unLoadingPackageCode);
return R.fail(unLoadingPackageCode+"未进行装车");
}
List<Long> packageIds = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getPackageId).collect(Collectors.toList());
List<Long> reservationId = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getReservationId).distinct().collect(Collectors.toList());
List<Long> deliveryId = abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getDeliveryListId).distinct().collect(Collectors.toList());
if (reservationId.size() != 1) {
log.error(method + "当前异常驳回存在多个客户信息,reservationId:{}", reservationId);
return R.fail("查询包件装车信息错误");
}
if (deliveryId.size() != 1) {
log.error(method + "当前异常驳回存在多个配送信息,deliveryId:{}", deliveryId);
return R.fail("查询包件装车信息错误");
}
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId.get(0));
if (Objects.isNull(reservationEntity)){
log.error(method + "当前异常驳回查询预约计划错误,reservationId:{}", reservationId.get(0));
return R.fail("查询预约计划错误");
}
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(deliveryId.get(0));
if (Objects.isNull(deliveryListEntity)){
log.error(method + "当前异常驳回查询配送计划错误,deliveryId:{}", deliveryId.get(0));
return R.fail("查询配送计划错误");
}
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.in(DistributionLoadscanEntity::getPackageId, packageIds)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (loadscanEntityList.isEmpty()) {
log.error(method + "查询包件装车信息错误,packageIds:{}", packageIds);
return R.fail("查询包件装车信息错误");
}
//进行异常驳回
distributionLoadscanAbnormalService.update(Wrappers.<DistributionLoadscanAbnormalEntity>update().lambda()
.in(DistributionLoadscanAbnormalEntity::getId,ids)
.set(DistributionLoadscanAbnormalEntity::getAuditingStatus,LoadingAbnormalAuditingStatusConstant.yichang.getValue())
.set(DistributionLoadscanAbnormalEntity::getAuditingUser,AuthUtil.getNickName())
.set(DistributionLoadscanAbnormalEntity::getAuditingTime,new Date())
);
List<WarehouseRetentionScanEntity> entityList = createdRetentionScanEntity(loadscanEntityList,myCurrentWarehouse,AuthUtil.getUser(),reservationEntity,deliveryListEntity);
if (!entityList.isEmpty()){
//进行批量回库任务提交
warehouseRetentionScanClient.saveBatchRetentionScan(entityList);
}
return R.success("操作成功");
}
private List<WarehouseRetentionScanEntity> createdRetentionScanEntity(List<DistributionLoadscanEntity> loadscanEntityList, BasicdataWarehouseEntity myCurrentWarehouse, BladeUser user, DistributionReservationEntity reservationEntity, DistributionDeliveryListEntity deliveryListEntity) {
List<WarehouseRetentionScanEntity> entityList = new ArrayList<>();
List<JSONObject> logList = new ArrayList<>();
for (DistributionLoadscanEntity distributionLoadscanEntity : loadscanEntityList) {
//进行回库任务生成
WarehouseRetentionScanEntity warehouseRetentionScanEntity = new WarehouseRetentionScanEntity();
warehouseRetentionScanEntity.setWarehouseName(myCurrentWarehouse.getName());
warehouseRetentionScanEntity.setTaskCode(distributionReservationService.retentionMa());
warehouseRetentionScanEntity.setWarehouseId(myCurrentWarehouse.getId());
warehouseRetentionScanEntity.setLoadingId(myCurrentWarehouse.getId());
warehouseRetentionScanEntity.setDeliveryId(distributionLoadscanEntity.getDeliveryId());
warehouseRetentionScanEntity.setReservationId(distributionLoadscanEntity.getReservationId());
warehouseRetentionScanEntity.setConditions(1);
warehouseRetentionScanEntity.setReservationCode(reservationEntity.getReservationCode());
warehouseRetentionScanEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
//查询此包件
DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
if (!Objects.isNull(parcelListEntity)){
//订单运单信息填充
warehouseRetentionScanEntity.setOrderCode(parcelListEntity.getOrderCode());
warehouseRetentionScanEntity.setWaybillNumber(parcelListEntity.getWaybillNumber());
warehouseRetentionScanEntity.setWaybillId(parcelListEntity.getWaybillId());
warehouseRetentionScanEntity.setOrderId(parcelListEntity.getStockArticleId());
warehouseRetentionScanEntity.setRetentionQuantity(parcelListEntity.getQuantity());
//记录当前包件生成待回库任务
String content = "包件在" + myCurrentWarehouse.getName() + "由" + user.getNickName() + "异常装车驳回生成待回库任务,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject jsonObject = handleLogJSONObject(myCurrentWarehouse, user, distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_REJECT.getCode(), deliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
logList.add(jsonObject);
}
warehouseRetentionScanEntity.setOrderPackageCode(distributionLoadscanEntity.getOrderPackageCode());
warehouseRetentionScanEntity.setOrderPackageId(distributionLoadscanEntity.getPackageId());
warehouseRetentionScanEntity.setVehicleNumber(distributionLoadscanEntity.getVehicleName());
warehouseRetentionScanEntity.setRetentionType(2);
warehouseRetentionScanEntity.setDeliveryType(Integer.parseInt(deliveryListEntity.getType()));
warehouseRetentionScanEntity.setConfirmStatus(false);
entityList.add(warehouseRetentionScanEntity);
}
if (!logList.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(logList);
}
return entityList;
}
/**
* 修改装车为签收数据
* @param loadscanEntity
@ -8603,5 +8723,4 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return trunklinePackageTrackLog;
}
}

11
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionScanController.java

@ -95,6 +95,17 @@ public class WarehouseRetentionScanController extends BladeController {
return R.data(pages);
}
/**
* 滞留扫描记录 自定义分页
*/
@GetMapping("/newPage")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入warehouseRetentionScan")
public R<IPage<WarehouseRetentionScanVO>> newPage(WarehouseRetentionScanDTO warehouseRetentionScan, Query query) {
IPage<WarehouseRetentionScanVO> pages = warehouseRetentionScanService.selectWarehouseRetentionRecordPage(Condition.getPage(query), warehouseRetentionScan);
return R.data(pages);
}
/**
* 滞留扫描记录 新增
*/

12
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseRetentionScanClient.java

@ -17,6 +17,7 @@
package com.logpm.warehouse.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.vo.app.DistributionRetentionScanVO;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
import com.logpm.warehouse.service.IWarehouseRetentionScanService;
import lombok.AllArgsConstructor;
@ -64,8 +65,17 @@ public class WarehouseRetentionScanClient implements IWarehouseRetentionScanClie
@Override
public R saveBatchRetentionScan(List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities) {
return warehouseRetentionRecordService.saveBatchRetentionList(warehouseRetentionScanEntities);
}
@Override
public R submitBatchRetentionScan(List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities) {
return R.status(warehouseRetentionScanService.saveBatch(warehouseRetentionScanEntities));
}
@Override
public List<DistributionRetentionScanVO> getRetentionScanEntityListByWarehouseId(Long warehouseId) {
return warehouseRetentionScanService.getRetentionScanEntityListByWarehouseId(warehouseId);
}
}

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.java

@ -16,6 +16,7 @@
*/
package com.logpm.warehouse.mapper;
import com.logpm.distribution.vo.app.DistributionRetentionScanVO;
import com.logpm.warehouse.dto.WarehouseRetentionScanDTO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
@ -62,4 +63,10 @@ public interface WarehouseRetentionScanMapper extends BaseMapper<WarehouseRetent
*/
List<WarehouseRetentionScanExcel> getExportWarehouseRetentionScanList(@Param("param") WarehouseRetentionScanDTO warehouseRetentionScan);
/**
* 查询指定仓库所有回库任务
* @param warehouseId
* @return
*/
List<DistributionRetentionScanVO> getRetentionScanEntityListByWarehouseId(@Param("warehouseId")Long warehouseId);
}

40
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionScanMapper.xml

@ -36,7 +36,7 @@
<result column="remarks" property="remarks"/>
<result column="retention_scan_time" property="retentionScanTime"/>
<result column="retention_way" property="retentionWay"/>
<result column="delivery_list_id" property="deliveryListId"/>
<result column="delivery_id" property="deliveryId"/>
</resultMap>
@ -154,5 +154,43 @@
</where>
ORDER BY create_time DESC
</select>
<select id="getRetentionScanEntityListByWarehouseId"
resultType="com.logpm.distribution.vo.app.DistributionRetentionScanVO">
SELECT
id,
CASE conditions
WHEN 1 THEN '定制品'
WHEN 2 THEN '零担'
WHEN 3 THEN '库存品'
ELSE
'未知'
END goodsName,
task_code AS taskCode,
order_package_code AS orderPackageCode,
order_code AS orderCode,
train_number As trainNumber,
CASE delivery_type
WHEN 1 THEN '市配'
WHEN 2 THEN '商配'
ELSE
'未知'
END deliveryType,
reservation_code AS reservationCode,
CASE retention_type
WHEN 1 THEN '自主新增'
WHEN 2 THEN '异常驳回'
WHEN 3 THEN '签收失败'
ELSE
'未知'
END retentionType,
retention_quantity AS retentionQuantity
FROM
logpm_warehouse_retention_scan
WHERE
warehouse_id = #{warehouseId}
AND confirm_status = 0
AND is_deleted = 0
ORDER BY create_time DESC
</select>
</mapper>

8
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionScanService.java

@ -17,6 +17,7 @@
package com.logpm.warehouse.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.distribution.vo.app.DistributionRetentionScanVO;
import com.logpm.warehouse.dto.WarehouseRetentionRecordDTO;
import com.logpm.warehouse.dto.WarehouseRetentionScanDTO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
@ -62,6 +63,13 @@ public interface IWarehouseRetentionScanService extends IService<WarehouseRetent
*/
List<WarehouseRetentionScanExcel> getExportWarehouseRetentionScanList(WarehouseRetentionScanDTO warehouseRetentionScan);
/**
* 查询所有回库任务
* @param warehouseId
* @return
*/
List<DistributionRetentionScanVO> getRetentionScanEntityListByWarehouseId(Long warehouseId);
// R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionRecordEntity);
}

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java

@ -18,6 +18,7 @@ package com.logpm.warehouse.service.impl;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.vo.app.DistributionRetentionScanVO;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.WarehouseRetentionRecordDTO;
import com.logpm.warehouse.dto.WarehouseRetentionScanDTO;
@ -110,6 +111,11 @@ public class WarehouseRetentionScanServiceImpl extends BaseServiceImpl<Warehouse
return baseMapper.getExportWarehouseRetentionScanList(warehouseRetentionScan);
}
@Override
public List<DistributionRetentionScanVO> getRetentionScanEntityListByWarehouseId(Long warehouseId) {
return baseMapper.getRetentionScanEntityListByWarehouseId(warehouseId);
}
// @Override
// public R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionRecordDTO) {
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();

Loading…
Cancel
Save