diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java index 994bdc076..ef75acb98 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java @@ -7,6 +7,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; +import java.util.Date; + @Data @TableName("logpm_trunkline_cars_load_scan") @ApiModel(value = "TrunklineCarsLoadScan对象", description = "干线装车扫描表") @@ -107,5 +109,16 @@ public class TrunklineCarsLoadScanEntity extends TenantEntity { @ApiModelProperty(name = "是否补录 0否 1是",notes = "") private Integer isSupple ; + /** 签收时间 */ + @ApiModelProperty(name = "签收时间",notes = "") + private Date signTime; + + /** 签收异常 */ + @ApiModelProperty(name = "签收异常",notes = "") + private Integer signAbnormal; + + /** 签收单id */ + @ApiModelProperty(name = "签收单id",notes = "") + private Long signOrderId; } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineLoadSignOrderEntity.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineLoadSignOrderEntity.java index a7bebdf29..3d2cf7fb3 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineLoadSignOrderEntity.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineLoadSignOrderEntity.java @@ -7,6 +7,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; +import java.util.Date; + @Data @TableName("logpm_trunkline_load_sign_order") @ApiModel(value = "TrunklineLoadSignOrder对象", description = "配载计划直发签收单") @@ -81,4 +83,8 @@ public class TrunklineLoadSignOrderEntity extends TenantEntity { @ApiModelProperty(name = "签收单号",notes = "") private String loadSignCode; + /** 签收时间 */ + @ApiModelProperty(name = "签收时间",notes = "") + private Date signTime; + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java index c750ba493..a37898129 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java @@ -114,7 +114,7 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService { bladeRedis.expireAt(key,CommonUtil.getDayEnd()); } - return warehouseCode+CommonUtil.geFourNumber(incr,5); + return warehouseCode+"ZFQS"+CommonUtil.geFourNumber(incr,5); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java index f6a916587..d2d29b39e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java @@ -28,42 +28,33 @@ import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataGoodsAreaClient; import com.logpm.basicdata.feign.IBasicdataTrayClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; -import com.logpm.distribution.bean.Res; import com.logpm.distribution.bean.Resp; - -import com.logpm.distribution.config.RedissonConfig; import com.logpm.distribution.dto.app.StockConfigInfoVO; -import com.logpm.distribution.dto.app.StockConfigOrderPackageListVO; import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.dto.app.StockupZeroDTO; import com.logpm.distribution.entity.*; import com.logpm.distribution.mapper.DistributionReservationMapper; -import com.logpm.distribution.mapper.DistributionReservationStocklistMapper; import com.logpm.distribution.service.*; import com.logpm.distribution.vo.*; -import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity; import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; -import com.logpm.warehouse.feign.*; +import com.logpm.warehouse.feign.IWarehouseGoodsAllocationClient; +import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient; +import com.logpm.warehouse.feign.IWarehouseUpdownGoodsLogClient; +import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.redisson.api.RLock; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.RabbitConstant; -import org.springblade.common.constant.loading.LoadingStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant; -import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant; -import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant; -import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant; import org.springblade.common.constant.pda.PdaAudioLingoStatus; import org.springblade.common.constant.reservation.ReservationLoadingStatusConstant; import org.springblade.common.constant.reservation.ReservationOrderStatusConstant; import org.springblade.common.constant.reservation.ReservationPackageStatusConstant; import org.springblade.common.constant.reservation.ReservationSigningStatusConstant; -import org.springblade.common.constant.stockup.StockupStatusConstant; import org.springblade.common.constant.stockup.StockupTypeStatusConstant; import org.springblade.common.exception.CustomerException; import org.springblade.common.utils.CommonUtil; @@ -76,7 +67,6 @@ import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.cache.DictBizCache; import org.springframework.amqp.rabbit.core.RabbitTemplate; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.transaction.TransactionDefinition; import org.springframework.web.bind.annotation.*; @@ -84,7 +74,6 @@ import org.springframework.web.bind.annotation.*; import java.lang.reflect.Field; import java.text.SimpleDateFormat; import java.util.*; -import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** @@ -132,6 +121,8 @@ public class DistributionStockupAppController extends BladeController { private final IDisStockOrdercodeRecoService disStockOrdercodeRecoService; + private final BladeRedis redis; + /** * 备货信息表 任务客户 分页列表 @@ -1085,13 +1076,21 @@ public class DistributionStockupAppController extends BladeController { // TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); // try{ //设置lockey - String lockKey = stockupDTO.getPacketBarCode() + stockupDTO.getStockupId(); - RLock lock = new RedissonConfig().redisson().getLock(lockKey); - if (lock.isLocked()) { + String lockKey = "Lock:"+stockupDTO.getPacketBarCode() + stockupDTO.getStockupId(); + log.info("#################stockupScan:获取redisson对象开始"); +// RLock lock = redisson.getLock(lockKey); +// if (lock.isLocked()) { +// String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.chongfusaomiao.getValue()); +// return Resp.scanFail(PdaAudioLingoStatus.chongfusaomiao.getName(), audioValue2); +// } +// lock.lock(5, TimeUnit.SECONDS); + if(redis.exists(lockKey)){ String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.chongfusaomiao.getValue()); return Resp.scanFail(PdaAudioLingoStatus.chongfusaomiao.getName(), audioValue2); } - lock.lock(5, TimeUnit.SECONDS); + redis.setEx(lockKey,stockupDTO.getPacketBarCode() + stockupDTO.getStockupId(),5L); + + if (scanType == 1) { //包件 return stockupScanByCustom(stockupDTO); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index 696b8091c..b93980109 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -930,7 +930,8 @@ select * from logpm_distribution_parcel_list where order_package_code = #{orderPackageCode} - and order_package_status in ('20','30') + and order_package_status = '20' + limit 1 + select IFNULL(sum(unload_num),0) + from logpm_trunkline_cars_load_scan + where sign_order_id = #{signOrderId} + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java index cb0dbeab8..4d19ad9ef 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java @@ -50,4 +50,8 @@ public interface TrunklineCarsOrderMapper extends BaseMapper findCustomerOrderList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId, @Param("mallName") String mallName); + + void clearSignOrderId(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId); + + TrunklineCarsOrderEntity findEntityByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml index 3bad71f54..7fb6a18ed 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml @@ -183,18 +183,19 @@ lww.name belongToWarehouseName, 0 signNum, '0' signStatus, - GROUP_CONCAT(ldsa.consignee_person) mallPerson, - GROUP_CONCAT(ldsa.consignee_mobile) mallMobile, - GROUP_CONCAT(ldsa.consignee_address) mallAddress, + GROUP_CONCAT(distinct ldsa.consignee_person) mallPerson, + GROUP_CONCAT(distinct ldsa.consignee_mobile) mallMobile, + GROUP_CONCAT(distinct ldsa.consignee_address) mallAddress, sum(ltco.plan_num) planNum, sum(ltco.real_num) loadingNum from logpm_trunkline_cars_order ltco - left join logpm_distribution_stock_article ldsa on ldsa.order_code,ltco.order_code + left join logpm_distribution_stock_article ldsa on ldsa.order_code=ltco.order_code left join logpm_warehouse_warehouse lww on ltco.node_id = lww.id and ltco.load_id = #{loadId} and ltco.node_id = #{warehouseId} and ldsa.warehouse_id = #{warehouseId} + and ltco.is_customer = '1' group by ltco.load_id, ltco.node_id, @@ -234,8 +235,8 @@ + + update logpm_trunkline_cars_order + set sign_order_id = null + where load_id = #{loadId} + and node_id = #{warehouseId} + and sign_num = 0 + + + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml index 07b8bcd1f..0e446a4e3 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml @@ -17,20 +17,24 @@ diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java index 60667ce65..c2ef22565 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java @@ -65,4 +65,6 @@ public interface ITrunklineCarsLoadScanService extends BaseService findListByIds(List loadScanIds); + + Integer findRealSignNumBySignOrderId(Long signOrderId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java index 7418f46ec..1af0c20a8 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java @@ -48,4 +48,8 @@ public interface ITrunklineCarsOrderService extends BaseService findCustomerOrderList(Long loadId, Long warehouseId, String mallName); + void clearSignOrderId(Long loadId, Long warehouseId); + + TrunklineCarsOrderEntity findEntityByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(Long loadId, Long warehouseId, String orderCode, String waybillNo); + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsSignLogService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsSignLogService.java index be0db4481..7c3040569 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsSignLogService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsSignLogService.java @@ -1,10 +1,11 @@ package com.logpm.trunkline.service; -import com.baomidou.mybatisplus.extension.service.IService; import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity; import com.logpm.trunkline.entity.TrunklineCarsSignLogEntity; +import org.springblade.core.mp.base.BaseService; -public interface ITrunklineCarsSignLogService extends IService { +public interface ITrunklineCarsSignLogService extends BaseService { void addEntity(TrunklineCarsLoadScanEntity carsLoadScanEntity,String remark); + void saveSignLog(Long warehouseId,String warehouseName,Long loadId,String loadCode,Long waybillId,String waybillNo,String orderCode,String scanCode,Integer num,Integer type,Integer isData,Integer isAbnormal,Long trayId,String trayCode,String trayName,Long fromWarehouseId,Long loadScanId,String remark); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineLoadSignOrderService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineLoadSignOrderService.java index 46a394080..810519a01 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineLoadSignOrderService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineLoadSignOrderService.java @@ -1,15 +1,15 @@ package com.logpm.trunkline.service; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.service.IService; import com.logpm.trunkline.dto.LoadCarsDTO; import com.logpm.trunkline.entity.TrunklineLoadSignOrderEntity; import com.logpm.trunkline.vo.SignOrderDetailVO; import com.logpm.trunkline.vo.TrunklineLoadSignOrderVO; +import org.springblade.core.mp.base.BaseService; import java.util.List; -public interface ITrunklineLoadSignOrderService extends IService { +public interface ITrunklineLoadSignOrderService extends BaseService { List findAllLoadSignOrderList(Long loadId, Long warehouseId); void deleteListBySignStatusAndLoadIdAndWarehouseId(Long loadId, Long warehouseId); @@ -21,4 +21,5 @@ public interface ITrunklineLoadSignOrderService extends IService findSignOrderDetailList(IPage page, LoadCarsDTO loadCarsDTO); void updateBelongToWarehouse(Long signOrderId, Long warehouseId, String warehouseName); + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillPackageService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillPackageService.java index 8e7151302..cabd04e56 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillPackageService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineWaybillPackageService.java @@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.logpm.trunkline.entity.TrunklineWaybillPackageEntity; import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO; import com.logpm.warehouse.entity.WarehouseWaybillEntity; +import org.springblade.core.mp.base.BaseService; import java.util.List; -public interface ITrunklineWaybillPackageService extends IService { +public interface ITrunklineWaybillPackageService extends BaseService { void saveList(List list, WarehouseWaybillEntity waybillEntity); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java index d857bdecf..8c5929df0 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java @@ -157,4 +157,9 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl list = trunklineCarsOrderService.findSignOrderListBy(loadId,warehouseId); for (TrunklineLoadSignOrderEntity trunklineLoadSignOrderEntity : list) { +// TrunklineLoadSignOrderEntity trunklineLoadSignOrderEntity = new TrunklineLoadSignOrderEntity(); +// BeanUtil.copy(entity,trunklineLoadSignOrderEntity); trunklineLoadSignOrderEntity.setLoadSignCode(codeClient.getCodeByType(CodeNumConstant.TRUNKLINE_LOAD_SIGN,warehouseCode,"")); + trunklineLoadSignOrderService.save(trunklineLoadSignOrderEntity); } - trunklineLoadSignOrderService.saveBatch(list); for (TrunklineLoadSignOrderEntity trunklineLoadSignOrderEntity : list) { Long signOrderId = trunklineLoadSignOrderEntity.getId(); @@ -487,6 +489,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl list = trunklineLoadSignOrderService.findAllLoadSignOrderList(loadId,warehouseId); trunklineLoadSignOrderService.deleteListBySignStatusAndLoadIdAndWarehouseId(loadId,warehouseId); + trunklineCarsOrderService.clearSignOrderId(loadId,warehouseId); + } @Override @@ -1350,7 +1354,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl implements ITrunklineCarsSignLogService { +public class TrunklineCarsSignLogServiceImpl extends BaseServiceImpl implements ITrunklineCarsSignLogService { @Override public void addEntity(TrunklineCarsLoadScanEntity carsLoadScanEntity,String remark) { TrunklineCarsSignLogEntity trunklineCarsSignLogEntity = new TrunklineCarsSignLogEntity(); @@ -36,4 +36,28 @@ public class TrunklineCarsSignLogServiceImpl extends ServiceImpl implements ITrunklineLoadSignOrderService { +public class TrunklineLoadSignOrderServiceImpl extends BaseServiceImpl implements ITrunklineLoadSignOrderService { @Override public List findAllLoadSignOrderList(Long loadId, Long warehouseId) { diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java index c6320a469..8d5cc589c 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java @@ -8,6 +8,7 @@ import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO; import com.logpm.warehouse.entity.WarehouseWaybillEntity; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -16,7 +17,7 @@ import java.util.List; @Slf4j @Service @AllArgsConstructor -public class TrunklineWaybillPackageServiceImpl extends ServiceImpl implements ITrunklineWaybillPackageService { +public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl implements ITrunklineWaybillPackageService { @Override public void saveList(List list, WarehouseWaybillEntity waybillEntity) { List ls = new ArrayList<>();