Browse Source

Merge branch 'dev' into pre-production

newStockUp
zhenghaoyu 1 year ago
parent
commit
9de2336e0f
  1. 47
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineBillladingLogEntity.java
  2. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  3. 43
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionSignforExcel.java
  4. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  5. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  7. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  8. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  9. 21
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  10. 40
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  11. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java
  12. 3
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java
  13. 25
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  14. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml
  15. 11
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java
  16. 15
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseRetentionRecordDTO.java
  17. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java
  18. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionScanService.java
  19. 85
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java
  20. 34
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionScanServiceImpl.java

47
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineBillladingLogEntity.java

@ -0,0 +1,47 @@
package com.logpm.trunkline.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_trunkline_billlading_log")
@ApiModel(value = "TrunklineBillladingLog对象", description = "干线提货单日志表")
@EqualsAndHashCode(callSuper = true)
public class TrunklineBillladingLogEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
/** 仓库id */
@ApiModelProperty(name = "仓库id",notes = "")
private Long warehouseId ;
/** 仓库名称 */
@ApiModelProperty(name = "仓库名称",notes = "")
private String warehouseName ;
/** 创建人名称 */
@ApiModelProperty(name = "创建人名称",notes = "")
private String createUserName ;
/** 描述内容 */
@ApiModelProperty(name = "描述内容",notes = "")
private String content ;
/** 提货单id */
@ApiModelProperty(name = "提货单id",notes = "")
private Long billladingId ;
}

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

@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.distribution.dto.DistributionAddvalueDTO;
import com.logpm.distribution.dto.DistributionReservationStocklistDTO;
import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.entity.DistributionSignPrintEntity;
import com.logpm.distribution.entity.DistributionSignforEntity;
@ -42,7 +41,6 @@ import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
@ -289,12 +287,8 @@ public class DistributionSignforController extends BladeController {
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入distributionSignfor")
public void exportDistributionSignfor(@ApiIgnore @RequestParam Map<String, Object> distributionSignfor, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<DistributionSignforEntity> queryWrapper = Condition.getQueryWrapper(distributionSignfor, DistributionSignforEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(DistributionSignfor::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(DistributionSignforEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<DistributionSignforExcel> list = distributionSignforService.exportDistributionSignfor(queryWrapper);
List<DistributionSignforExcel> list = distributionSignforService.exportDistributionSignfor(distributionSignfor);
ExcelUtil.export(response, "签收管理数据" + DateUtil.time(), "签收管理数据表", list, DistributionSignforExcel.class);
}

43
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionSignforExcel.java

@ -41,48 +41,7 @@ public class DistributionSignforExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("租户号")
private String tenantId;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Integer isDeleted;
/**
* 预留1
*/
@ColumnWidth(20)
@ExcelProperty("预留1")
private String reserve1;
/**
* 预留2
*/
@ColumnWidth(20)
@ExcelProperty("预留2")
private String reserve2;
/**
* 预留3
*/
@ColumnWidth(20)
@ExcelProperty("预留3")
private String reserve3;
/**
* 预留4
*/
@ColumnWidth(20)
@ExcelProperty("预留4")
private String reserve4;
/**
* 预留5
*/
@ColumnWidth(20)
@ExcelProperty("预留5")
private String reserve5;
/**
* 订单自编号;订单关联id
*/

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

@ -1634,7 +1634,7 @@
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldrp.stock_article_id = ldrs.stock_article_id and ldrp.reservation_id = ldr.id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldrp.parce_list_id and ldpl.stock_article_id = ldsa.id
WHERE
lddl.id=#{deliveryId} AND ldrp.packet_bar_status in ('1','3') AND ldrs.is_zero = 0 AND ldpl.order_package_code = #{barCode}
lddl.id=#{deliveryId} AND ldrp.packet_bar_status in ('1','3') AND ldrs.is_zero = 0 AND ldpl.order_package_code = #{orderPackageCode}
</select>
<select id="selectRetentionZeroPackage" resultType="com.logpm.distribution.vo.DistributionRetentionScanVo">
@ -1647,7 +1647,8 @@
ldsa.order_code AS orderCode,
ldrs.reservation_num AS maxRetention,
ldrzp.parcel_list_id AS orderPackageId,
ldpl.firsts AS materialName
ldpl.firsts AS materialName,
2 AS conditions
FROM
logpm_distribution_delivery_list AS lddl
LEFT JOIN logpm_distribution_signfor AS lds ON lds.delivery_id = lddl.id

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

@ -57,7 +57,7 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @param queryWrapper
* @return
*/
List<DistributionSignforExcel> exportDistributionSignfor(@Param("ew") Wrapper<DistributionSignforEntity> queryWrapper);
List<DistributionSignforVO> exportDistributionSignfor(@Param("ew") Wrapper<DistributionSignforEntity> queryWrapper);
/**
* 订单总数
*

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

@ -376,7 +376,7 @@
</select>
<select id="exportDistributionSignfor" resultType="com.logpm.distribution.excel.DistributionSignforExcel">
<select id="exportDistributionSignfor" resultType="com.logpm.distribution.vo.DistributionSignforVO">
SELECT * FROM logpm_distribution_signfor ${ew.customSqlSegment}
</select>
<select id="selectOrdersNub" resultType="java.lang.Integer">

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

@ -115,7 +115,9 @@
</select>
<select id="getBillOrderDetail" resultType="com.logpm.distribution.vo.DistributionBillOrderVO">
select DISTINCT ldsa.order_code orderCode,ldsa.description_goods descriptionGoods,ldsa.stockup_status stockupStatus,ldsa.hand_quantity handQuantity,
select DISTINCT ldsa.order_code orderCode,ldsa.description_goods descriptionGoods,ldsa.stockup_status stockupStatus,
(select COUNT(id) from logpm_distrilbution_bill_package
where stock_article_id = ldsa.id and packet_bar_status in (1,3)) handQuantity,
(select GROUP_CONCAT(IFNULL(ldpl.material_name , '') SEPARATOR ', ')
from logpm_distribution_parcel_list ldpl
where ldpl.material_name is not null and ldpl.stock_article_id = ldbs.stock_article_id) materialName,

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

@ -16,7 +16,6 @@
*/
package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.distribution.bean.Resp;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistributionAddvalueDTO;
@ -57,10 +56,9 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
/**
* 导出数据
*
* @param queryWrapper
* @return
* @param distributionSignfor@return
*/
List<DistributionSignforExcel> exportDistributionSignfor(Wrapper<DistributionSignforEntity> queryWrapper);
List<DistributionSignforExcel> exportDistributionSignfor(Map<String, Object> distributionSignfor);
/**
* 签收订单统计
*

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

@ -5167,7 +5167,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionParcelListEntity> parcelListEntities = baseMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
// List<DisStockListDetailEntity> detailEntities = baseMapper.selectInventoryListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isNotEmpty(parcelListEntities)){
List<DistributionParcelListEntity> packageInfo = parcelListEntities.stream().filter(p -> Func.isNotEmpty(p.getOrderPackageCode()) && p.getOrderPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList());
List<DistributionParcelListEntity> packageInfo = parcelListEntities.stream().filter(p -> Func.equals(p.getOrderPackageCode(),distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList());
if (packageInfo.size()>1){
log.error("################包条码重复:{}",distrilbutionloadingscanDTO.getBarcode());
return Resp.scanFail("操作失败","操作失败");
@ -5177,19 +5177,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//此时才是满足条件的包件,能够进行滞留
//通过配送任务和包件确定预约信息
DistributionParcelListEntity parcelListEntity = packageInfo.get(0);
DistributionRetentionScanVo retentionPackage = baseMapper.selectRetentionPackage(parcelListEntity.getOrderPackageCode(), distrilbutionloadingscanDTO.getDeliveryId());
// distributionRetentionScanVo.setConditions(1);
// distributionRetentionScanVo.setOrderCode(parcelListEntity.getOrderPackageCode());
// distributionRetentionScanVo.setOrderId(parcelListEntity.getStockArticleId());
// distributionRetentionScanVo.setOrderPackageId(parcelListEntity.getId());
// distributionRetentionScanVo.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
// distributionRetentionScanVo.setReservationCode(reservationEntity.getReservationCode());
// distributionRetentionScanVo.setReservationId(reservationEntity.getId());
// distributionRetentionScanVo.setRetentionQuantity(parcelListEntity.getQuantity());
// retentionScanVos.add(distributionRetentionScanVo);
DistributionRetentionScanVo retentionScanVo = baseMapper.selectRetentionPackage(parcelListEntity.getOrderPackageCode(), distrilbutionloadingscanDTO.getDeliveryId());
retentionScanVos.add(retentionScanVo);
}
//
} else {
List<DisStockListDetailEntity> detailEntities = baseMapper.selectInventoryListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isNotEmpty(detailEntities)){
@ -5198,11 +5188,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error("################库存品条码重复:{}",distrilbutionloadingscanDTO.getBarcode());
return Resp.scanFail("操作失败","操作失败");
}
if (stockListDetailEntities.size() == 1){
// DistributionRetentionScanVo distributionRetentionScanVo = new DistributionRetentionScanVo();
//此时才是满足条件的包件,能够进行滞留
//通过配送任务和包件确定预约信息
DisStockListDetailEntity disStockListDetailEntity = stockListDetailEntities.get(0);
DistributionRetentionScanVo inventoryPackage = baseMapper.selectRetentionInventoryPackage(disStockListDetailEntity.getStockPackageCode(), distrilbutionloadingscanDTO.getDeliveryId());
retentionScanVos.add(inventoryPackage);
@ -5211,7 +5197,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error("################查询包件和库存品为空:{}",distrilbutionloadingscanDTO.getDeliveryId());
return Resp.scanFail("操作失败","不属于该配送任务!!!");
}
}
List<DistributionRetentionScanVo> distributionRetentionScanVos = baseMapper.selectRetentionZeroPackage(distrilbutionloadingscanDTO.getDeliveryId(),distrilbutionloadingscanDTO.getBarcode());
if (Func.isNotEmpty(distributionRetentionScanVos)){

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

@ -16,7 +16,6 @@
*/
package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@ -50,16 +49,18 @@ import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.loading.LoadScanSigningStatusConstant;
import org.springblade.common.constant.loading.LoadingIsInsertConstant;
import org.springblade.common.constant.loading.LoadingStatusConstant;
import org.springblade.common.constant.order.OrderReservationStatusConstant;
import org.springblade.common.constant.orderpackage.*;
import org.springblade.common.constant.reservation.*;
import org.springblade.common.constant.signing.SignforDriverSigningStatusConstant;
import org.springblade.common.serviceConstant.ServiceConstant;
import org.springblade.common.utils.GaoDeApiUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.feign.IDictBizClient;
import org.springframework.beans.BeanUtils;
@ -69,7 +70,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -152,12 +152,34 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public List<DistributionSignforExcel> exportDistributionSignfor(Wrapper<DistributionSignforEntity> queryWrapper) {
List<DistributionSignforExcel> distributionSignforList = baseMapper.exportDistributionSignfor(queryWrapper);
//distributionSignforList.forEach(distributionSignfor -> {
// distributionSignfor.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionSignfor.getType()));
//});
return distributionSignforList;
public List<DistributionSignforExcel> exportDistributionSignfor(Map<String, Object> distributionSignfor) {
Object o = distributionSignfor.get("ids");
if(ObjectUtils.isNotNull(o)){
distributionSignfor.remove("ids");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull()){
throw new ServiceException("请选择仓库!");
}
QueryWrapper<DistributionSignforEntity> queryWrapper = Condition.getQueryWrapper(distributionSignfor, DistributionSignforEntity.class);
queryWrapper.lambda().eq(DistributionSignforEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
if(ObjectUtils.isNotNull(o)){
queryWrapper.in("id",String.valueOf(o).split(","));
}
queryWrapper.eq("warehouse_id",myCurrentWarehouse.getId());
List<DistributionSignforVO> distributionSignforList = baseMapper.exportDistributionSignfor(queryWrapper);
List<DistributionSignforExcel> list = new ArrayList<>();
distributionSignforList.forEach(d -> {
// distributionSignfor.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionSignfor.getType()));
DistributionSignforExcel signforExcel = new DistributionSignforExcel();
BeanUtils.copyProperties(d,signforExcel);
// signforExcel.setConsignee();
list.add(signforExcel);
});
return list;
}
@Override

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java

@ -61,6 +61,9 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
private IDistributionParcelListService distributionParcelListService;
private IDistributionReservationService distributionReservationService;
private IDistributionReservationPackageService distributionReservationPackageService;
private IDistrilbutionBillPackageService distrilbutionBillPackageService;
private DistributionStockupMapper distributionStockupMapper;
@ -217,9 +220,19 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
continue;
}
if(ObjectUtils.isNotNull(distributionStocks.getStockupType()) && distributionStocks.getStockupType().equals("ZT")){
stockEntity.setBillLadingId(stockVOList.get(0).getReservationId());
List<DistrilbutionBillPackageEntity> list1 = distrilbutionBillPackageService.list(Wrappers.<DistrilbutionBillPackageEntity>query().lambda()
.eq(DistrilbutionBillPackageEntity::getParceListId, i)
.apply("packet_bar_status in (1,3)")
.orderByDesc(DistrilbutionBillPackageEntity::getCreateTime)
);
stockEntity.setBillLadingId(list1.get(0).getBillLadingId());
}else{
stockEntity.setReservationId(stockVOList.get(0).getReservationId());
List<DistributionReservationPackageEntity> list1 = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.eq(DistributionReservationPackageEntity::getParceListId, i)
.apply("packet_bar_status in (1,3)")
.orderByDesc(DistributionReservationPackageEntity::getCreateTime)
);
stockEntity.setReservationId(list1.get(0).getReservationId());
}
stockEntity.setDeliveryListId(stockVOList.get(0).getDeliveryListId());
stockEntity.setDeliveryListCode(stockVOList.get(0).getDeliveryListCode());

3
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java

@ -97,6 +97,7 @@ public class OrderStatusHandler {
break;
case FactoryConstant.OUPAI:
//测试网开启 正式网关闭
r = ouPaiFactoryService.handleStatusData(orderStatusDTO);
if (r.getCode() == 400 || r.getCode() == 200) {
log.info("TAG {} ##################orderStatusHandler: 该条数据不用处理 orderNo={}", FactoryConstant.OUPAI, orderSelfNum);
@ -104,7 +105,7 @@ public class OrderStatusHandler {
} else {
throw new CustomerException(r.getCode(), r.getMsg());
}
break;
default:
log.info("##################orderStatusHandler: 未知品牌 type={}", type);

25
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -6,9 +6,11 @@ import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient;
import com.logpm.basicdata.feign.IBasicdataTrayClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
@ -65,6 +67,8 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
private final ITrayScanClient trayScanClient;
private final IWarehouseTrayTypeClient warehouseTrayTypeClient;
private final IInventoryDetailClient inventoryDetailClient;
private final IBasicdataTrayClient basicdataTrayClient;
private final ITrayClient trayClient;
@Transactional(rollbackFor = Exception.class)
@Override
@ -1349,6 +1353,27 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
continue;
}
//判断托盘是否已经存在
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode("T" + trayId);
if(Objects.isNull(basicdataTrayEntity)){
log.info("############syncTrayTypeData: 托盘信息不存在");
//如果托盘不存在就去同步该托盘
TrayEntity trayEntity = trayClient.getTrayById(trayId);
basicdataTrayEntity = new BasicdataTrayEntity();
basicdataTrayEntity.setTenantId("627683");
basicdataTrayEntity.setCreateUser(1714696768639311873L);
basicdataTrayEntity.setUpdateUser(1714696768639311873L);
basicdataTrayEntity.setCreateDept(1649331096241836033L);
basicdataTrayEntity.setPalletName(trayEntity.getTrayNo());
basicdataTrayEntity.setPalletCode("T"+trayEntity.getId());
basicdataTrayEntity.setWarehouseId(newWarehouseId);
basicdataTrayEntity.setTrayStatus(trayEntity.getStatus()+"");
basicdataTrayEntity.setType(1);
basicdataTrayEntity.setOldId(trayId);
// basicdataTrayEntity.setNowWarehouseId(nowNewWarehouseId);
basicdataTrayClient.addTray(basicdataTrayEntity);
}
//方式:1=仓,2=商场,3=客户,4=其他,5=服务号,6=合同号
//方式:60=仓,30=商场,50=客户,100=其他,10=服务号,20=合同号
String newTrayType = "100";

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

@ -28,7 +28,7 @@
sum(ltbw.real_volume) totalVolume
from logpm_trunkline_billlading ltb
left join logpm_basic_deline lbd on lbd.id = ltb.line_id
left join logpm_trunkline_billlading_waybill ltbw on ltbw.billlading_id = ltb.id
left join logpm_trunkline_billlading_waybill ltbw on ltbw.billlading_id = ltb.id and ltbw.
where ltb.is_deleted = 0
<if test="param.billladingCode != null and param.billladingCode != '' ">
and ltb.billlading_code = #{param.billladingCode}

11
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java

@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.warehouse.dto.RetentionDTO;
import com.logpm.warehouse.dto.WarehouseRetentionRecordDTO;
import com.logpm.warehouse.dto.WarehouseRetentionScanDTO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.service.IWarehouseRetentionRecordService;
import com.logpm.warehouse.service.IWarehouseRetentionScanService;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -17,6 +20,7 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
@Log4j2
@ -28,6 +32,8 @@ public class WarehouseRetentionApiController {
private final IWarehouseRetentionRecordService warehouseRetentionRecordService;
private final IWarehouseRetentionScanService warehouseRetentionScanService;
@ResponseBody
@PostMapping("/retentionPackageList")
@ -72,8 +78,9 @@ public class WarehouseRetentionApiController {
@PostMapping("/saveRetentionList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "保存滞留扫描列表", notes = "传入trayTypeDTO")
public R saveRetentionList(@RequestBody RetentionDTO retentionDTO) {
R r = warehouseRetentionRecordService.saveRetentionList(retentionDTO);
public R saveRetentionList(@RequestBody WarehouseRetentionRecordDTO warehouseRetentionScanDTOS) {
// R r = warehouseRetentionRecordService.saveRetentionList(warehouseRetentionScanDTOS);
R r = warehouseRetentionScanService.saveRetentionList(warehouseRetentionScanDTOS);
return r;
}

15
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseRetentionRecordDTO.java

@ -20,6 +20,8 @@ import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 滞留记录 数据传输对象实体类
*
@ -31,4 +33,17 @@ import lombok.EqualsAndHashCode;
public class WarehouseRetentionRecordDTO extends WarehouseRetentionRecordEntity {
private static final long serialVersionUID = 1L;
private Long deliveryId;
private String remarks;
private String trainNumber;
private Long loadingId;
private List<WarehouseRetentionScanDTO> warehouseRetentionScanDTOS;
}

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

@ -19,6 +19,7 @@ package com.logpm.warehouse.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.warehouse.dto.RetentionDTO;
import com.logpm.warehouse.dto.WarehouseRetentionScanDTO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
@ -70,10 +71,4 @@ public interface IWarehouseRetentionRecordService extends BaseService<WarehouseR
*/
WarehouseRetentionRecordVO initRetentionList(Long deliveryId);
/**
* 保存扫描记录
* @param retentionDTO
* @return
*/
R saveRetentionList(RetentionDTO retentionDTO);
}

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

@ -17,6 +17,8 @@
package com.logpm.warehouse.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.warehouse.dto.WarehouseRetentionRecordDTO;
import com.logpm.warehouse.dto.WarehouseRetentionScanDTO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
import com.logpm.warehouse.excel.WarehouseRetentionScanExcel;
@ -24,6 +26,7 @@ import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import org.springblade.core.tool.api.R;
import java.util.List;
@ -52,4 +55,6 @@ public interface IWarehouseRetentionScanService extends IService<WarehouseRetent
*/
List<WarehouseRetentionScanExcel> exportWarehouseRetentionRecord(Wrapper<WarehouseRetentionScanEntity> queryWrapper);
R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionRecordEntity);
}

85
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

@ -33,10 +33,7 @@ import com.logpm.distribution.vo.DistributionDeliveryListVO;
import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import com.logpm.oldproject.feign.IWarehouseClient;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.RetentionDTO;
import com.logpm.warehouse.dto.RetentionDistributionListDetailDTO;
import com.logpm.warehouse.dto.RetentionParcelListDTO;
import com.logpm.warehouse.dto.RetentionZeroParcelDTO;
import com.logpm.warehouse.dto.*;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel;
@ -162,84 +159,4 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
return warehouseRetentionRecordVO;
}
@Override
public R saveRetentionList(RetentionDTO retentionDTO) {
DistributionDeliveryListVO deliveryDriverInfo = deliveryListClient.getDeliveryDriverInfo(retentionDTO.getDeliveryId());
if (Func.isEmpty(deliveryDriverInfo)){
//查询配送任务
log.error("##############查询配送任务失败,deliveryId:{}",retentionDTO.getDeliveryId());
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException(403, "仓库信息不能为空");
}
if (Func.isEmpty(deliveryDriverInfo.getDeliverySelfVO())){
log.error("##############查询配送任务司机失败");
}
List<DistributionDeliverySelfVO> deliverySelfVO = deliveryDriverInfo.getDeliverySelfVO();
DistributionDeliverySelfVO distributionDeliverySelfVO = null;
if (deliveryDriverInfo.getKind().equals("1")){
distributionDeliverySelfVO = deliverySelfVO.stream().filter(d -> d.getIsMaster() == 2).collect(Collectors.toList()).get(0);
}else if (deliveryDriverInfo.getKind().equals("2")){
distributionDeliverySelfVO = deliverySelfVO.get(0);
}
WarehouseRetentionRecordEntity warehouseRetentionRecordEntity = new WarehouseRetentionRecordEntity();
warehouseRetentionRecordEntity.setRetentionType(RetentionTypeConstant.peisongzhiliu.getValue());
warehouseRetentionRecordEntity.setRetentionWarehouseId(myCurrentWarehouse.getId());
warehouseRetentionRecordEntity.setRetentionWarehouseName(myCurrentWarehouse.getName());
warehouseRetentionRecordEntity.setRemark(retentionDTO.getRemarks());
warehouseRetentionRecordEntity.setTaskId(retentionDTO.getDeliveryId());
warehouseRetentionRecordEntity.setRetentionCarId(distributionDeliverySelfVO.getId());
warehouseRetentionRecordEntity.setRetentionCarNo(deliveryDriverInfo.getTrainNumber());
warehouseRetentionRecordEntity.setAssembleCarPersonId(distributionDeliverySelfVO.getDeliveryId());
warehouseRetentionRecordEntity.setAssembleCarPersonName(distributionDeliverySelfVO.getDriverName());
//统计数量
AtomicInteger retentionQuantity = new AtomicInteger();
List<RetentionParcelListDTO> parcelListEntityList = retentionDTO.getParcelListEntityList();
if (Func.isNotEmpty(parcelListEntityList)){
parcelListEntityList.forEach(p->{
WarehouseRetentionScanEntity warehouseRetentionScanEntity = new WarehouseRetentionScanEntity();
warehouseRetentionScanEntity.setConditions(1);
warehouseRetentionScanEntity.setDeliveryId(deliveryDriverInfo.getId());
warehouseRetentionScanEntity.setOrderCode(p.getOrderCode());
warehouseRetentionScanEntity.setOrderPackageCode(p.getOrderPackageCode());
warehouseRetentionScanEntity.setOrderId(p.getStockArticleId());
warehouseRetentionScanEntity.setOrderPackageId(p.getId());
warehouseRetentionScanService.save(warehouseRetentionScanEntity);
retentionQuantity.getAndAdd(p.getQuantity());
//缺少一个进行解绑的远程
});
}
List<RetentionZeroParcelDTO> parcelNumberEntityList = retentionDTO.getParcelNumberEntityList();
if (Func.isNotEmpty(parcelNumberEntityList)){
parcelNumberEntityList.forEach(pn->{
WarehouseRetentionScanEntity warehouseRetentionScanEntity = new WarehouseRetentionScanEntity();
warehouseRetentionScanEntity.setConditions(2);
warehouseRetentionScanEntity.setDeliveryId(deliveryDriverInfo.getId());
warehouseRetentionScanEntity.setOrderId(pn.getStockArticleId());
warehouseRetentionScanEntity.setOrderPackageId(pn.getParcelListId());
warehouseRetentionScanService.save(warehouseRetentionScanEntity);
retentionQuantity.getAndAdd(pn.getQuantity());
});
}
List<RetentionDistributionListDetailDTO> detailEntityList = retentionDTO.getDetailEntityList();
if (Func.isNotEmpty(detailEntityList)){
detailEntityList.forEach(d->{
WarehouseRetentionScanEntity warehouseRetentionScanEntity = new WarehouseRetentionScanEntity();
warehouseRetentionScanEntity.setConditions(3);
warehouseRetentionScanEntity.setDeliveryId(deliveryDriverInfo.getId());
warehouseRetentionScanEntity.setInventoryId(d.getStockListId());
warehouseRetentionScanEntity.setMaterialName(d.getMaterialName());
warehouseRetentionScanEntity.setMaterialNumber(d.getMaterialNumber());
warehouseRetentionScanEntity.setOrderPackageCode(d.getStockPackageCode());
warehouseRetentionScanEntity.setOrderPackageId(d.getId());
warehouseRetentionScanService.save(warehouseRetentionScanEntity);
retentionQuantity.getAndAdd(d.getNum());
});
}
this.save(warehouseRetentionRecordEntity);
return Resp.scanSuccess("操作成功","操作成功");
}
}

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

@ -16,6 +16,11 @@
*/
package com.logpm.warehouse.service.impl;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.WarehouseRetentionRecordDTO;
import com.logpm.warehouse.dto.WarehouseRetentionScanDTO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
import com.logpm.warehouse.excel.WarehouseRetentionScanExcel;
@ -25,6 +30,8 @@ import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -39,6 +46,9 @@ import java.util.List;
@Service
public class WarehouseRetentionScanServiceImpl extends BaseServiceImpl<WarehouseRetentionScanMapper, WarehouseRetentionScanEntity> implements IWarehouseRetentionScanService {
private IBasicdataWarehouseClient warehouseClient;
@Override
public IPage<WarehouseRetentionScanVO> selectWarehouseRetentionRecordPage(IPage<WarehouseRetentionScanVO> page, WarehouseRetentionScanVO warehouseRetentionScanVO) {
return page.setRecords(baseMapper.selectWarehouseRetentionRecordPage(page, warehouseRetentionScanVO));
@ -54,4 +64,28 @@ public class WarehouseRetentionScanServiceImpl extends BaseServiceImpl<Warehouse
return warehouseRetentionRecordList;
}
@Override
public R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionRecordDTO) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
return null;
}
List<WarehouseRetentionScanDTO> warehouseRetentionScanDTOS = warehouseRetentionRecordDTO.getWarehouseRetentionScanDTOS();
if (Func.isEmpty(warehouseRetentionScanDTOS)){
log.error("############用户提交空滞留列表");
return Resp.scanFail("操作失败","无滞留包件信息");
}
//TODO 保存车次数据还需要处理
WarehouseRetentionRecordEntity warehouseRetentionRecordEntity = new WarehouseRetentionRecordEntity();
warehouseRetentionRecordEntity.setTaskId(warehouseRetentionRecordDTO.getDeliveryId());
warehouseRetentionRecordEntity.setRemark(warehouseRetentionRecordDTO.getRemark());
warehouseRetentionRecordEntity.setRetentionCarNo(warehouseRetentionRecordDTO.getTrainNumber());
warehouseRetentionRecordEntity.setRetentionCarId(warehouseRetentionRecordDTO.getLoadingId());
warehouseRetentionRecordEntity.setRetentionWarehouseId(myCurrentWarehouse.getId());
warehouseRetentionRecordEntity.setRetentionWarehouseName(myCurrentWarehouse.getName());
warehouseRetentionScanDTOS.forEach(r->{
this.save(Func.copy(r,WarehouseRetentionScanEntity.class));
});
return Resp.scanSuccess("操作成功","操作成功");
}
}

Loading…
Cancel
Save