Browse Source

1.修改确定库存品需要增加字段批次号

training
zhenghaoyu 2 years ago
parent
commit
2cd18df858
  1. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java
  2. 7
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockListClient.java
  3. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseTrayGoodsEntity.java
  4. 3
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseTrayGoodsLogEntity.java
  5. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseUpdownGoodsEntity.java
  6. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseUpdownGoodsLogEntity.java
  7. 1
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TrayTypeDataListVO.java
  8. 1
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/UpdownStockVO.java
  9. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockListClient.java
  10. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java
  11. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  12. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  13. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  14. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java
  15. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayTypeDTO.java
  16. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/UpShelfStockDTO.java
  17. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml
  18. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml
  19. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsLogService.java
  20. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsService.java
  21. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java
  22. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsLogServiceImpl.java
  23. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java
  24. 105
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  25. 124
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java

@ -84,5 +84,5 @@ public interface IDistributionStockArticleClient {
@GetMapping(API_PREFIX + "/fingListByServiceNumber")
List<Map> fingListByServiceNumber(@RequestParam String serviceNumber);
@GetMapping(API_PREFIX + "/findListByWaybillNumber")
List<DistributionStockArticleEntity> findListByWaybillNumber(String waybillNumber);
List<DistributionStockArticleEntity> findListByWaybillNumber(@RequestParam String waybillNumber);
}

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

@ -86,17 +86,20 @@ public interface IDistributionStockListClient {
List<StockMallVO> getAllStockMall();
@GetMapping(API_PREFIX+"/getEntityByMarketIdAndMaterialId")
DistributionStockListEntity getEntityByMarketIdAndMaterialId(@RequestParam("marketId") Long marketId,@RequestParam("materialId") Long materialId);
DistributionStockListEntity getEntityByMarketIdAndMaterialId(@RequestParam("marketId") Long marketId,@RequestParam("materialId") Long materialId, @RequestParam("incomingBatch") String incomingBatch);
@GetMapping(API_PREFIX+"/findAllMarket")
List<Map> findAllMarket(@RequestParam("warehouseCode") String warehouseCode);
@GetMapping(API_PREFIX+"/getEntityByMarketIdAndMaterialCode")
DistributionStockListEntity getEntityByMarketIdAndMaterialCode(@RequestParam("marketId") Long marketId, @RequestParam("materialCode") String materialCode);
List<DistributionStockListEntity> getListByMarketIdAndMaterialCode(@RequestParam("marketId") Long marketId, @RequestParam("materialCode") String materialCode);
@GetMapping(API_PREFIX+"/getEntityByMarketIdAndMaterialName")
List<DistributionStockListEntity> getEntityByMarketIdAndMaterialName(@RequestParam("marketId") Long marketId, @RequestParam("materialName") String materialName);
@GetMapping(API_PREFIX+"/getEntityByMarketIdAndMaterialCodeAndIncomingBatch")
DistributionStockListEntity getEntityByMarketIdAndMaterialCodeAndIncomingBatch(@RequestParam("marketId") Long marketId, @RequestParam("materialCode") String materialCode, @RequestParam("incomingBatch") String incomingBatch);
// /**
// * 修改某个客户信息及物品信息
// *

4
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseTrayGoodsEntity.java

@ -67,5 +67,7 @@ public class WarehouseTrayGoodsEntity extends TenantEntity {
/** 商场名称 */
@ApiModelProperty(name = "商场名称",notes = "")
private String marketName ;
/** 批次号 */
@ApiModelProperty(name = "批次号",notes = "")
private String incomingBatch ;
}

3
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseTrayGoodsLogEntity.java

@ -61,4 +61,7 @@ public class WarehouseTrayGoodsLogEntity extends TenantEntity {
/** 商场名称 */
@ApiModelProperty(name = "商场名称",notes = "")
private String marketName ;
/** 批次号 */
@ApiModelProperty(name = "批次号",notes = "")
private String incomingBatch ;
}

4
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseUpdownGoodsEntity.java

@ -76,5 +76,7 @@ public class WarehouseUpdownGoodsEntity extends TenantEntity {
/** 商场名称 */
@ApiModelProperty(name = "商场名称",notes = "")
private String marketName ;
/** 批次号 */
@ApiModelProperty(name = "批次号",notes = "")
private String incomingBatch ;
}

4
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseUpdownGoodsLogEntity.java

@ -82,6 +82,8 @@ public class WarehouseUpdownGoodsLogEntity extends TenantEntity {
/** 商场名称 */
@ApiModelProperty(name = "商场名称",notes = "")
private String marketName ;
/** 批次号 */
@ApiModelProperty(name = "批次号",notes = "")
private String incomingBatch ;
}

1
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TrayTypeDataListVO.java

@ -13,6 +13,7 @@ public class TrayTypeDataListVO implements Serializable {
private String dataName;//名称
private String sku;//sku
private String cargoUnit;//cargoUnit
private String incomingBatch;//批次号
private Integer scanNum;//已扫件数
private Integer isFleeing;//是否串货 1是0否

1
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/UpdownStockVO.java

@ -15,6 +15,7 @@ public class UpdownStockVO implements Serializable {
private String materialName;//物料名称
private Integer totalNumber;//合同数量
private Integer residueNumber;//剩余数量
private String incomingBatch;//批次号
private List<UpdownStockAllocationVO> list = new ArrayList<>();
}

16
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockListClient.java

@ -110,10 +110,11 @@ public class DistributionStockListClient implements IDistributionStockListClient
}
@Override
public DistributionStockListEntity getEntityByMarketIdAndMaterialId(Long marketId, Long materialId) {
public DistributionStockListEntity getEntityByMarketIdAndMaterialId(Long marketId, Long materialId,String incomingBatch) {
QueryWrapper<DistributionStockListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("market_id",marketId)
.eq("material_id",materialId)
.eq("incoming_batch",incomingBatch)
.eq("is_deleted",0);
return distributionStockListService.getOne(queryWrapper);
}
@ -124,8 +125,8 @@ public class DistributionStockListClient implements IDistributionStockListClient
}
@Override
public DistributionStockListEntity getEntityByMarketIdAndMaterialCode(Long marketId, String materialCode) {
return distributionStockListService.getEntityByMarketIdAndMaterialCode(marketId,materialCode);
public List<DistributionStockListEntity> getListByMarketIdAndMaterialCode(Long marketId, String materialCode) {
return distributionStockListService.getListByMarketIdAndMaterialCode(marketId,materialCode);
}
@Override
@ -133,5 +134,14 @@ public class DistributionStockListClient implements IDistributionStockListClient
return distributionStockListService.getEntityByMarketIdAndMaterialName(marketId,materialName);
}
@Override
public DistributionStockListEntity getEntityByMarketIdAndMaterialCodeAndIncomingBatch(Long marketId, String materialCode, String incomingBatch) {
QueryWrapper<DistributionStockListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("market_id",marketId)
.eq("cargo_number",materialCode)
.eq("incoming_batch",incomingBatch);
return distributionStockListService.getOne(queryWrapper);
}
}

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

@ -75,7 +75,7 @@ public interface DistributionStockListMapper extends BaseMapper<DistributionStoc
List<Map> findAllMarket(@Param("warehouseCode") String warehouseCode);
DistributionStockListEntity getEntityByMarketIdAndMaterialCode(@Param("marketId") Long marketId, @Param("materialCode") String materialCode);
List<DistributionStockListEntity> getListByMarketIdAndMaterialCode(@Param("marketId") Long marketId, @Param("materialCode") String materialCode);
List<DistributionStockListEntity> getEntityByMarketIdAndMaterialName(@Param("marketId") Long marketId, @Param("materialName") String materialName);

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

@ -274,7 +274,7 @@
ldsl.market_name
</select>
<select id="getEntityByMarketIdAndMaterialCode" resultType="com.logpm.distribution.entity.DistributionStockListEntity">
<select id="getListByMarketIdAndMaterialCode" resultType="com.logpm.distribution.entity.DistributionStockListEntity">
select ldsl.*
from logpm_distribution_stock_list ldsl
where ldsl.is_deleted = 0

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

@ -102,7 +102,7 @@ public interface IDistributionStockListService extends BaseService<DistributionS
List<Map> findAllMarket(String warehouseCode);
DistributionStockListEntity getEntityByMarketIdAndMaterialCode(Long marketId, String materialCode);
List<DistributionStockListEntity> getListByMarketIdAndMaterialCode(Long marketId, String materialCode);
List<DistributionStockListEntity> getEntityByMarketIdAndMaterialName(Long marketId, String materialName);

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

@ -317,8 +317,8 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
}
@Override
public DistributionStockListEntity getEntityByMarketIdAndMaterialCode(Long marketId, String materialCode) {
return baseMapper.getEntityByMarketIdAndMaterialCode(marketId,materialCode);
public List<DistributionStockListEntity> getListByMarketIdAndMaterialCode(Long marketId, String materialCode) {
return baseMapper.getListByMarketIdAndMaterialCode(marketId,materialCode);
}
@Override

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

@ -723,6 +723,7 @@ public class WarehouseTrayTypeApiController {
Integer num = trayTypeDTO.getNum();//数量
String trayType = trayTypeDTO.getTrayType();//打托方式
String trayCode = trayTypeDTO.getTrayCode();//托盘码
String incomingBatch = trayTypeDTO.getIncomingBatch();//批次号
try{
if(!StringUtil.hasLength(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
@ -736,12 +737,16 @@ public class WarehouseTrayTypeApiController {
log.warn(method+"物料编码不能为空 materialCode={}",materialCode);
return R.fail(403,"物料编码不能为空");
}
if(!StringUtil.hasLength(incomingBatch)){
log.warn(method+"批次号不能为空 incomingBatch={}",incomingBatch);
return R.fail(403,"批次号不能为空");
}
if(Objects.isNull(marketId)){
log.warn(method+"商场id不能为空 marketId={}",marketId);
return R.fail(403,"商场id不能为空");
}
return warehouseTrayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,materialCode,marketId,num);
return warehouseTrayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,materialCode,marketId,num,incomingBatch);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayTypeDTO.java

@ -45,6 +45,7 @@ public class TrayTypeDTO implements Serializable {
private String materialCode;//物料编码
private Long marketId;//商场id
private String incomingBatch;//批次号
private List<ZeroOrderVO> zeroList = new ArrayList<>();

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/UpShelfStockDTO.java

@ -17,5 +17,6 @@ public class UpShelfStockDTO implements Serializable {
private Integer enterNum;//录入数量
@ApiModelProperty(name = "库位id",notes = "库位id")
private Long allocationId;//库位id
private String incomingBatch;//批次号
}

8
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml

@ -20,6 +20,7 @@
<select id="getUpListByTrayTypeId" resultType="com.logpm.warehouse.vo.UpShelfDataVO">
select ldsa.order_code orderCode,
lwtg.tray_code trayCode,
1 goodsType,
sum(lwtg.num) shelfNum
from logpm_warehouse_tray_goods lwtg
left join logpm_distribution_parcel_list ldpl on ldpl.id = lwtg.association_id and ldpl.is_deleted = 0
@ -56,6 +57,7 @@
<select id="getZeroUpListByTrayTypeId" resultType="com.logpm.warehouse.vo.UpShelfDataVO">
select ldsa.order_code orderCode,
lwtg.tray_code trayCode,
2 goodsType,
lwtg.num num
from logpm_warehouse_tray_goods lwtg
left join logpm_distribution_stock_article ldsa on ldsa.id = lwtg.association_id and ldsa.is_zero = 1 and ldsa.is_deleted = 0
@ -76,11 +78,12 @@
lbm.sku sku,
ldsl.cargo_unit cargoUnit,
lwtg.num scanNum,
lwtg.incoming_batch incomingBatch,
ldsl.quantity_stock orderTotalNum
from logpm_warehouse_tray_goods lwtg
left join logpm_warehouse_tray_type lwtt on lwtt.id = lwtg.tray_type_id and lwtt.is_deleted = 0
left join logpm_basicdata_material lbm on lwtg.association_id = lbm.id and lbm.is_deleted = 0
left join logpm_distribution_stock_list ldsl on ldsl.material_id = lbm.id and lwtt.market_id = ldsl.market_id and ldsl.is_deleted = 0
left join logpm_distribution_stock_list ldsl on ldsl.material_id = lbm.id and lwtt.market_id = ldsl.market_id and ldsl.incoming_batch = lwtg.incoming_batch and ldsl.is_deleted = 0
where lwtg.is_deleted = 0
and lwtg.tray_type_id = #{trayTypeId}
</select>
@ -104,10 +107,11 @@
lwtg.tray_code trayCode,
ldsl.quantity_stock totalNum,
lwtg.num shelfNum,
3 goodsType,
ldsl.market_id marketId,
ldsl.market_name marketName
from logpm_warehouse_tray_goods lwtg
left join logpm_distribution_stock_list ldsl on ldsl.material_id = lwtg.association_id and lwtg.market_id = ldsl.market_id and ldsl.is_deleted = 0
left join logpm_distribution_stock_list ldsl on ldsl.material_id = lwtg.association_id and lwtg.market_id = ldsl.market_id and lwtg.incoming_batch = ldsl.incoming_batch and ldsl.is_deleted = 0
where lwtg.is_deleted = 0
and lwtg.tray_type_id = #{trayTypeId}
</select>

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml

@ -118,7 +118,7 @@
lwug.num shelfNum
from logpm_warehouse_updown_goods lwug
left join logpm_basicdata_material lbm on lbm.id = lwug.association_id and lbm.is_deleted = 0
left join logpm_distribution_stock_list ldsl on ldsl.material_id = lwug.association_id and ldsl.market_id = lwug.market_id and ldsl.is_deleted = 0
left join logpm_distribution_stock_list ldsl on ldsl.material_id = lwug.association_id and ldsl.market_id = lwug.market_id and lwug.incoming_batch = ldsl.incoming_batch and ldsl.is_deleted = 0
where lwug.is_deleted = 0
and lwug.association_type = 4
and lwug.updown_type_id = #{updownTypeId}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsLogService.java

@ -14,7 +14,7 @@ public interface IWarehouseTrayGoodsLogService extends BaseService<WarehouseTray
void saveLogZero(DistributionStockArticleEntity stockArticleEntity, WarehouseTrayTypeEntity trayTypeEntity, Integer num, String bindingType, String remark, String palletizingType);
void saveLogStock(Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,Integer num, String bindingType, String remark, String palletizingType);
void saveLogStock(Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,Integer num, String bindingType, String remark, String palletizingType);
void saveLogByTrayGoodsList(List<WarehouseTrayGoodsEntity> sourceTrayGoodsList, String bindingType, String remark, String palletizingType);
}

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsService.java

@ -48,9 +48,9 @@ public interface IWarehouseTrayGoodsService extends BaseService<WarehouseTrayGoo
* */
Boolean delRelevanceByTray(Long id);
WarehouseTrayGoodsEntity getStockDataByMaterialIdAndMarketId(Long materialId, Long marketId, Long trayTypeId);
WarehouseTrayGoodsEntity getStockDataByMaterialIdAndMarketId(Long materialId, Long marketId, Long trayTypeId,String incomingBatch);
void saveEntityStock(Long materialId,Long marketId,WarehouseTrayTypeEntity trayTypeEntity,Integer num, String isException);
void saveEntityStock(Long materialId,Long marketId,WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,Integer num, String isException);

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java

@ -46,7 +46,7 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
R findAllMarket(String warehouseCode);
R enterStockNoDataMaterialCode(String trayCode, String trayType, String materialCode, Long marketId,Integer num);
R enterStockNoDataMaterialCode(String trayCode, String trayType, String materialCode, Long marketId,Integer num,String incomingBatch);
void downPackageByOrderPackageCode(String orderPackageCode,String remark);

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsLogServiceImpl.java

@ -51,7 +51,7 @@ public class WarehouseTrayGoodsLogServiceImpl extends BaseServiceImpl<WarehouseT
}
@Override
public void saveLogStock(Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,Integer num, String bindingType, String remark, String palletizingType) {
public void saveLogStock(Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,Integer num, String bindingType, String remark, String palletizingType) {
WarehouseTrayGoodsLogEntity trayGoodsLogEntity = new WarehouseTrayGoodsLogEntity();
trayGoodsLogEntity.setTrayId(trayTypeEntity.getTrayId());
trayGoodsLogEntity.setTrayTypeId(trayTypeEntity.getId());
@ -64,6 +64,7 @@ public class WarehouseTrayGoodsLogServiceImpl extends BaseServiceImpl<WarehouseT
trayGoodsLogEntity.setNum(num);
trayGoodsLogEntity.setMarketId(trayTypeEntity.getMarketId());
trayGoodsLogEntity.setMarketName(trayTypeEntity.getMarketName());
trayGoodsLogEntity.setIncomingBatch(incomingBatch);
save(trayGoodsLogEntity);
}

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

@ -156,16 +156,17 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
}
@Override
public WarehouseTrayGoodsEntity getStockDataByMaterialIdAndMarketId(Long materialId, Long marketId, Long trayTypeId) {
public WarehouseTrayGoodsEntity getStockDataByMaterialIdAndMarketId(Long materialId, Long marketId, Long trayTypeId,String incomingBatch) {
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_id",materialId)
.eq("market_id",marketId)
.eq("incoming_batch",incomingBatch)
.eq("tray_type_id",trayTypeId);
return baseMapper.selectOne(queryWrapper);
}
@Override
public void saveEntityStock(Long materialId,Long marketId,WarehouseTrayTypeEntity trayTypeEntity,Integer num, String isException) {
public void saveEntityStock(Long materialId,Long marketId,WarehouseTrayTypeEntity trayTypeEntity,String incomingBatch,Integer num, String isException) {
WarehouseTrayGoodsEntity trayGoodsEntity = new WarehouseTrayGoodsEntity();
trayGoodsEntity.setTrayId(trayTypeEntity.getTrayId());
trayGoodsEntity.setTrayCode(trayTypeEntity.getTrayCode());
@ -178,6 +179,7 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
trayGoodsEntity.setIsFleeing(isException);
trayGoodsEntity.setMarketId(trayTypeEntity.getMarketId());
trayGoodsEntity.setMarketName(trayTypeEntity.getMarketName());
trayGoodsEntity.setIncomingBatch(incomingBatch);
save(trayGoodsEntity);
}

105
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -824,6 +824,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
Long marketId = distributionStockListEntity.getMarketId();
String marketName = distributionStockListEntity.getMarketName();
Integer quantityStock = distributionStockListEntity.getQuantityStock();//在库数量
String incomingBatch = distributionStockListEntity.getIncomingBatch();//批次号
BasicMaterialEntity materialEntity = basicMaterialClient.getMaterialOwnId(materialId);
if(Objects.isNull(materialEntity)){
@ -847,7 +848,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
String filterValue = trayTypeEntity.getFilterValue();
Long trayTypeId = trayTypeEntity.getId();
Long mid = trayTypeEntity.getMarketId();
WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = warehouseTrayGoodsService.getStockDataByMaterialIdAndMarketId(materialId,marketId,trayTypeId);
WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = warehouseTrayGoodsService.getStockDataByMaterialIdAndMarketId(materialId,marketId,trayTypeId,incomingBatch);
Integer num = warehouseTrayGoodsEntity.getNum();
@ -880,20 +881,20 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if(chuanFlag){
if(Objects.isNull(warehouseTrayGoodsEntity)){
//存入有数据库存品与托盘绑定关系表
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,1, "1");
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,1, "1");
}else{
warehouseTrayGoodsService.updateEntityStock(warehouseTrayGoodsEntity,1);
}
}else{
if(Objects.isNull(warehouseTrayGoodsEntity)){
//存入有数据库存品与托盘绑定关系表
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,1, "0");
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,1, "0");
}else{
warehouseTrayGoodsService.updateEntityStock(warehouseTrayGoodsEntity,-1);
}
}
// //添加上拖日志表
warehouseTrayGoodsLogService.saveLogStock(materialId, marketId,trayTypeEntity,1, "1", "分拣打托:有数据库存品 分拣", "1");
warehouseTrayGoodsLogService.saveLogStock(materialId, marketId,trayTypeEntity,incomingBatch,1, "1", "分拣打托:有数据库存品 分拣", "1");
updateNumByTrayTypeId(trayTypeEntity);
@ -918,8 +919,9 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
Long materialId = trayGoodsEntity.getAssociationId();
Long marketId = trayGoodsEntity.getMarketId();
Long trayId = trayGoodsEntity.getTrayId();
String incomingBatch = trayGoodsEntity.getIncomingBatch();
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialId(marketId,materialId);
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialId(marketId,materialId,incomingBatch);
if(Objects.isNull(stockListEntity)){
log.warn("#############deleteStockByTrayGoodsId: 库存品数据不存在 marketId={} materialId={}",marketId,materialId);
return R.fail(403,"库存品数据不存在");
@ -943,36 +945,36 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
//添加下托日志
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,num,"0","分拣打托:有数据库存品分拣","2");
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,incomingBatch,num,"0","分拣打托:有数据库存品分拣","2");
updateNumByTrayTypeId(trayTypeEntity);
return R.success("删除成功");
}
private void changeStockTotalNumByTrayTypeId(DistributionStockListEntity distributionStockListEntity, Long trayTypeId,Integer num, int addSub) {
log.info("#########changeStockTotalNumByTrayTypeId: 变更打托方式上的数量 trayTypeId={} addSub={}", trayTypeId, addSub);
Long materialId = distributionStockListEntity.getMaterialId();//物料id
Long marketId = distributionStockListEntity.getMarketId();//商场id
Integer quantityStock = distributionStockListEntity.getQuantityStock();
WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = warehouseTrayGoodsService.getStockDataByMaterialIdAndMarketId(materialId,marketId,trayTypeId);
if(addSub == 1){
if (Objects.isNull(warehouseTrayGoodsEntity)) {
//需要同时添加订单总数量到打托方式
baseMapper.changeTotalNumAndOrderTotalNumByTrayTypeId(num, quantityStock, trayTypeId);
} else {
baseMapper.changeTotalNumByTrayTypeId(num, trayTypeId);
}
} else if (addSub == 2){
if (Objects.isNull(warehouseTrayGoodsEntity)) {
log.warn("#################changeStockTotalNumByTrayTypeId: 未找到对应的数据 trayTypeId={} materialId={} marketId={}",trayTypeId,materialId,marketId);
throw new CustomerException(403,"未找到对应的数据");
} else {
baseMapper.changeTotalNumAndOrderTotalNumByTrayTypeId(-num, -quantityStock, trayTypeId);
}
}
}
// private void changeStockTotalNumByTrayTypeId(DistributionStockListEntity distributionStockListEntity, Long trayTypeId,Integer num, int addSub) {
// log.info("#########changeStockTotalNumByTrayTypeId: 变更打托方式上的数量 trayTypeId={} addSub={}", trayTypeId, addSub);
// Long materialId = distributionStockListEntity.getMaterialId();//物料id
// Long marketId = distributionStockListEntity.getMarketId();//商场id
// Integer quantityStock = distributionStockListEntity.getQuantityStock();
// WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = warehouseTrayGoodsService.getStockDataByMaterialIdAndMarketId(materialId,marketId,trayTypeId);
// if(addSub == 1){
// if (Objects.isNull(warehouseTrayGoodsEntity)) {
// //需要同时添加订单总数量到打托方式
// baseMapper.changeTotalNumAndOrderTotalNumByTrayTypeId(num, quantityStock, trayTypeId);
//
// } else {
// baseMapper.changeTotalNumByTrayTypeId(num, trayTypeId);
// }
// } else if (addSub == 2){
// if (Objects.isNull(warehouseTrayGoodsEntity)) {
// log.warn("#################changeStockTotalNumByTrayTypeId: 未找到对应的数据 trayTypeId={} materialId={} marketId={}",trayTypeId,materialId,marketId);
// throw new CustomerException(403,"未找到对应的数据");
// } else {
// baseMapper.changeTotalNumAndOrderTotalNumByTrayTypeId(-num, -quantityStock, trayTypeId);
// }
// }
// }
private WarehouseTrayTypeEntity saveTrayTypeByStock(String trayType, String trayCode,Long trayId,Long materialId,String materialName,String materialCode, Long marketId,String marketName) {
log.info("#########saveTrayTypeByStock: 存入打托方式 trayType={},trayCode={} ",trayType,trayCode);
@ -1061,7 +1063,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
@Override
public R enterStockNoDataMaterialCode(String trayCode, String trayType, String materialCode, Long marketId,Integer num) {
public R enterStockNoDataMaterialCode(String trayCode, String trayType, String materialCode, Long marketId,Integer num,String incomingBatch) {
//查询托盘信息
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if(Objects.isNull(trayEntity)){
@ -1070,7 +1072,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
Long trayId = trayEntity.getId();
//查询库存品数据
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCode(marketId,materialCode);
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId,materialCode,incomingBatch);
if(Objects.isNull(stockListEntity)){
log.warn("#########saveTrayTypeByStock: 未找到库存品信息 marketId={} materialCode={}",marketId,materialCode);
throw new CustomerException(403,"未找到库存品信息");
@ -1106,7 +1108,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
//判断串货
WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = warehouseTrayGoodsService.getStockDataByMaterialIdAndMarketId(materialId,marketId,trayTypeId);
WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = warehouseTrayGoodsService.getStockDataByMaterialIdAndMarketId(materialId,marketId,trayTypeId,incomingBatch);
boolean chuanFlag = false;
@ -1133,20 +1135,20 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if(chuanFlag){
if(Objects.isNull(warehouseTrayGoodsEntity)){
//存入有数据库存品与托盘绑定关系表
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,num, "1");
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,num, "1");
}else{
warehouseTrayGoodsService.updateEntityStock(warehouseTrayGoodsEntity,num);
}
}else{
if(Objects.isNull(warehouseTrayGoodsEntity)){
//存入有数据库存品与托盘绑定关系表
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,num, "0");
warehouseTrayGoodsService.saveEntityStock(materialId, marketId,trayTypeEntity,incomingBatch,num, "0");
}else{
warehouseTrayGoodsService.updateEntityStock(warehouseTrayGoodsEntity,-num);
}
}
// //添加上拖日志表
warehouseTrayGoodsLogService.saveLogStock(materialId, marketId,trayTypeEntity,num, "1", "分拣打托:无数据库存品 分拣", "1");
warehouseTrayGoodsLogService.saveLogStock(materialId, marketId,trayTypeEntity,incomingBatch,num, "1", "分拣打托:无数据库存品 分拣", "1");
updateNumByTrayTypeId(trayTypeEntity);
@ -1192,12 +1194,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
Long trayTypeId = trayGoodsEntity.getTrayTypeId();
Long materialId = trayGoodsEntity.getAssociationId();
Long marketId = trayGoodsEntity.getMarketId();
String incomingBatch = trayGoodsEntity.getIncomingBatch();
WarehouseTrayTypeEntity trayTypeEntity = baseMapper.selectById(trayTypeId);
warehouseTrayGoodsService.updateEntityStock(trayGoodsEntity,enterNum);
//添加下托日志 Long materialId,Long marketId, WarehouseTrayTypeEntity trayTypeEntity,Integer num, String bindingType, String remark, String palletizingType
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,Math.abs(enterNum),"0","下架:库存品部分下架","2");
warehouseTrayGoodsLogService.saveLogStock(materialId,marketId,trayTypeEntity,incomingBatch,Math.abs(enterNum),"0","下架:库存品部分下架","2");
updateNumByTrayTypeId(trayTypeEntity);
}
@ -1429,22 +1432,26 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
public R selectStockByMaterialCodeAndMarketId(Long marketId, String materialCode) {
List<DistributionStockListEntity> ls = new ArrayList<>();
//根据商场id和物料编码查询对应的库存品
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCode(marketId, materialCode);
if(Objects.isNull(stockListEntity)){
List<DistributionStockListEntity> stockListEntityList = distributionStockListClient.getListByMarketIdAndMaterialCode(marketId, materialCode);
if(Objects.isNull(stockListEntityList) || stockListEntityList.size() == 0){
log.warn("################selectStockByMaterialCodeAndMarketId: 库存品不存在 marketId={} materialCode={}",marketId,materialCode);
return R.fail(403,"库存品不存在");
}
Integer quantityStock = stockListEntity.getQuantityStock();//在数量
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("market_id",marketId)
.eq("association_value",materialCode);
List<WarehouseTrayGoodsEntity> list = warehouseTrayGoodsService.list(queryWrapper);
Integer useNum = 0;
for (WarehouseTrayGoodsEntity trayGoodsEntity:list){
useNum = useNum +trayGoodsEntity.getNum();
}
stockListEntity.setQuantityStock(quantityStock-useNum);
ls.add(stockListEntity);
for(DistributionStockListEntity stockListEntity:stockListEntityList){
Integer quantityStock = stockListEntity.getQuantityStock();//在数量
String incomingBatch = stockListEntity.getIncomingBatch();
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("market_id",marketId)
.eq("association_value",materialCode)
.eq("incoming_batch",incomingBatch);
List<WarehouseTrayGoodsEntity> list = warehouseTrayGoodsService.list(queryWrapper);
Integer useNum = 0;
for (WarehouseTrayGoodsEntity trayGoodsEntity:list){
useNum = useNum +trayGoodsEntity.getNum();
}
stockListEntity.setQuantityStock(quantityStock-useNum);
ls.add(stockListEntity);
}
return R.data(ls);
}

124
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -328,9 +328,20 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
String trayCode = null;
//判断货位是否有托盘
BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
String trayType = null;
if(!Objects.isNull(trayEntity)){
trayCode = trayEntity.getPalletCode();
//如果有托盘
TrayTypeDataVO entityByTrayCode = warehouseTrayTypeService.getEntityByTrayCode(trayCode);
trayType = entityByTrayCode.getTrayType();
String type = entityByTrayCode.getType();//数据类型 1订制品 2零担 3 4 库存品
if(!"1".equals(type)){
log.warn("##############upShelfOrder: 库位上的托盘是定制品类型 allocationId={}",allocationId);
return R.fail(403,"库位上的托盘是定制品类型");
}
}
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){
log.warn("##############upShelfOrder: 库位不存在 allocationId={}",allocationId);
@ -375,9 +386,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//包件级别的上架
upShelfPackageNoTray(parcelListEntity,goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity);
if(StringUtil.hasLength(trayCode)){
//如果有托盘
TrayTypeDataVO entityByTrayCode = warehouseTrayTypeService.getEntityByTrayCode(trayCode);
String trayType = entityByTrayCode.getTrayType();
//存入托盘信息
warehouseTrayTypeService.orderScanOrderPackageCode(trayType,trayCode,orderPackageCode);
}
@ -398,10 +407,19 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
public R upShelfPackage(List<UpShelfPackageDTO> upShelfPackageList, Long allocationId) {
int num = 0;
String trayCode = null;
String trayType = null;
//判断货位是否有托盘
BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
if(!Objects.isNull(trayEntity)){
trayCode = trayEntity.getPalletCode();
//如果有托盘
TrayTypeDataVO entityByTrayCode = warehouseTrayTypeService.getEntityByTrayCode(trayCode);
trayType = entityByTrayCode.getTrayType();
String type = entityByTrayCode.getType();//数据类型 1订制品 2零担 3 4 库存品
if(!"1".equals(type)){
log.warn("##############upShelfOrder: 库位上的托盘是定制品类型 allocationId={}",allocationId);
return R.fail(403,"库位上的托盘是定制品类型");
}
}
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){
@ -441,9 +459,6 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//包件级别的上架
upShelfPackageNoTray(parcelListEntity,goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity);
if(StringUtil.hasLength(trayCode)){
//如果有托盘
TrayTypeDataVO entityByTrayCode = warehouseTrayTypeService.getEntityByTrayCode(trayCode);
String trayType = entityByTrayCode.getTrayType();
//存入托盘信息
warehouseTrayTypeService.orderScanOrderPackageCode(trayType,trayCode,orderPackageCode);
}
@ -524,10 +539,19 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
public R upShelfZeroOrder(List<UpShelfZeroOrderDTO> upShelfZeroOrderList, Long allocationId) {
int num = 0;
String trayCode = null;
String trayType = null;
//判断货位是否有托盘
BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
if(!Objects.isNull(trayEntity)){
trayCode = trayEntity.getPalletCode();
//如果有托盘
TrayTypeDataVO entityByTrayCode = warehouseTrayTypeService.getEntityByTrayCode(trayCode);
trayType = entityByTrayCode.getTrayType();
String type = entityByTrayCode.getType();//数据类型 1订制品 2零担 3 4 库存品
if(!"2".equals(type)){
log.warn("##############upShelfOrder: 库位上的托盘是零担类型 allocationId={}",allocationId);
return R.fail(403,"库位上的托盘是零担类型");
}
}
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){
@ -579,8 +603,6 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
zeroOrderVO.setNum(upShelfZeroOrderDTO.getEnterNum());
zeroOrderVOList.add(zeroOrderVO);
}
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeService.getEntityByTrayCode(trayCode);
String trayType = trayTypeDataVO.getTrayType();
R r = warehouseTrayTypeService.enterZeroOrderByTrayCode(trayType, trayCode, zeroOrderVOList);
int code = r.getCode();
if(code != 200){
@ -621,10 +643,12 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
if(1==stockType){
//物料编码
String materialCode = value;
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCode(marketId, materialCode);
if(!Objects.isNull(stockListEntity)){
UpdownStockVO vo = stockToUpdownStockVO(stockListEntity);
ls.add(vo);
List<DistributionStockListEntity> stockListEntityList = distributionStockListClient.getListByMarketIdAndMaterialCode(marketId, materialCode);
if(!Objects.isNull(stockListEntityList) && stockListEntityList.size() > 0){
for (DistributionStockListEntity stockListEntity:stockListEntityList){
UpdownStockVO vo = stockToUpdownStockVO(stockListEntity);
ls.add(vo);
}
}
}else if (2==stockType){
//物料名称
@ -643,10 +667,19 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
public R upShelfStockList(List<UpShelfStockDTO> upShelfStockList, Long allocationId) {
int num = 0;
String trayCode = null;
String trayType = null;
//判断货位是否有托盘
BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
if(!Objects.isNull(trayEntity)){
trayCode = trayEntity.getPalletCode();
//如果有托盘
TrayTypeDataVO entityByTrayCode = warehouseTrayTypeService.getEntityByTrayCode(trayCode);
trayType = entityByTrayCode.getTrayType();
String type = entityByTrayCode.getType();//数据类型 1订制品 2零担 3 4 库存品
if(!"3".equals(type) && !"4".equals(type) ){
log.warn("##############upShelfOrder: 库位上的托盘是库存品类型 allocationId={}",allocationId);
return R.fail(403,"库位上的托盘是库存品类型");
}
}
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){
@ -690,10 +723,8 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
updateUpdownTypeNum(updownTypeEntity);
if(!StringUtil.isBlank(trayCode)){
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeService.getEntityByTrayCode(trayCode);
String trayType = trayTypeDataVO.getTrayType();
for (UpShelfStockDTO upShelfStockDTO:upShelfStockList){
R r = warehouseTrayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,upShelfStockDTO.getMaterialCode(),upShelfStockDTO.getMarketId(),upShelfStockDTO.getEnterNum());
R r = warehouseTrayTypeService.enterStockNoDataMaterialCode(trayCode,trayType,upShelfStockDTO.getMaterialCode(),upShelfStockDTO.getMarketId(),upShelfStockDTO.getEnterNum(),upShelfStockDTO.getIncomingBatch());
int code = r.getCode();
if(code != 200){
throw new CustomerException(code,r.getMsg());
@ -1065,15 +1096,44 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
public R moveAllocationScanTrayCode(String trayCode) {
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);//托盘信息
if(Objects.isNull(trayEntity)){
log.warn("#################findUpShelfScanGoods: 托盘信息不存在 trayCode={}",trayCode);
log.warn("#################moveAllocationScanTrayCode: 托盘信息不存在 trayCode={}",trayCode);
return R.fail(403,"托盘信息不存在");
}
Long allocationId = warehouseTaryAllocationService.getAllocationIdByTrayId(trayEntity.getId());
if (Objects.isNull(allocationId)){
log.warn("#################findUpShelfScanGoods: 托盘未上架 trayCode={}",trayCode);
log.warn("#################moveAllocationScanTrayCode: 托盘未上架 trayCode={}",trayCode);
return R.fail(403,"托盘未上架");
}
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){
log.warn("##############moveAllocationScanTrayCode: 库位不存在 allocationId={}",allocationId);
return R.fail(403,"库位不存在");
}
String enableStatus = goodsAllocationEntity.getEnableStatus();
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId();
if("2".equals(enableStatus)){
log.warn("##############moveAllocationScanTrayCode: 库位已被禁用 allocationId={}",allocationId);
return R.fail(403,"库位已被禁用");
}
BasicdataGoodsShelfEntity goodsShelfEntity = basicdataGoodsShelfClient.getEntityByGoodsShelfId(goodsShelfId);
if(Objects.isNull(goodsShelfEntity)){
log.warn("##############moveAllocationScanTrayCode: 货架不存在 goodsShelfId={}",goodsShelfId);
return R.fail(403,"货架不存在");
}
Long goodsAreaId = goodsShelfEntity.getGoodsAreaId();
BasicdataGoodsAreaEntity goodsAreaEntity = basicdataGoodsAreaClient.getEntityByGoodsAreaId(goodsAreaId);
if(Objects.isNull(goodsAreaEntity)){
log.warn("##############moveAllocationScanTrayCode: 货区不存在 goodsAreaId={}",goodsAreaId);
return R.fail(403,"货区不存在");
}
Long warehouseId = goodsAreaEntity.getWarehouseId();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("##############moveAllocationScanTrayCode: 仓库不存在 warehouseId={}",warehouseId);
return R.fail(403,"仓库不存在");
}
Long trayId = trayEntity.getId();
QueryWrapper<WarehouseTrayTypeEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("tray_id",trayId)
@ -1085,6 +1145,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
Long trayTypeId = trayTypeEntity.getId();//打托方式id
String type = trayTypeEntity.getType();//打托分类
List<UpShelfDataVO> listByTrayTypeId = null;
if(PalletProductTypeConstant.CUSTOMIZED.equals(type)){
listByTrayTypeId = warehouseTrayGoodsService.getUpListByTrayTypeId(trayTypeId);
@ -1095,7 +1156,17 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}else if(PalletProductTypeConstant.STOCKNODATA.equals(type)){
listByTrayTypeId = warehouseTrayGoodsService.getStockUpListByTrayTypeId(trayTypeId);
}
return R.data(listByTrayTypeId);
Map<String,Object> map = new HashMap<>();
map.put("warehouseId",warehouseId);
map.put("warehouseName",warehouseEntity.getName());
map.put("areaId",goodsAreaId);
map.put("areaName",goodsAreaEntity.getHeadline());
map.put("shelfId",goodsShelfId);
map.put("shelfName",goodsShelfEntity.getGoodsShelfName());
map.put("allocationId",allocationId);
map.put("allocationName",goodsAllocationEntity.getGoodsAllocationName());
map.put("list",listByTrayTypeId);
return R.data(map);
}
@Override
@ -1130,7 +1201,8 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
Long marketId = upShelfStockDTO.getMarketId();
String materialCode = upShelfStockDTO.getMaterialCode();
Integer enterNum = upShelfStockDTO.getEnterNum();
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCode(marketId, materialCode);
String incomingBatch = upShelfStockDTO.getIncomingBatch();
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, materialCode,incomingBatch);
WarehouseUpdownGoodsEntity updownGoodsEntity = new WarehouseUpdownGoodsEntity();
updownGoodsEntity.setUpdownTypeId(updownTypeEntity.getId());
updownGoodsEntity.setAreaId(updownTypeEntity.getAreaId());
@ -1145,6 +1217,9 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
updownGoodsEntity.setAssociationType("4");
updownGoodsEntity.setGoodsName(stockListEntity.getDescriptionGoods());
updownGoodsEntity.setNum(enterNum);
updownGoodsEntity.setMarketId(stockListEntity.getMarketId());
updownGoodsEntity.setMarketName(stockListEntity.getMarketName());
updownGoodsEntity.setIncomingBatch(stockListEntity.getIncomingBatch());
updownGoodsList.add(updownGoodsEntity);
}
warehouseUpdownGoodsService.saveBatch(updownGoodsList);
@ -1156,7 +1231,13 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
Long marketId = stockListEntity.getMarketId();
Long materialId = stockListEntity.getMaterialId();
Integer quantityStock = stockListEntity.getQuantityStock();
String cargoNumber = stockListEntity.getCargoNumber();//物料编码
String descriptionGoods = stockListEntity.getDescriptionGoods();//物料名称
String incomingBatch = stockListEntity.getIncomingBatch();//批次号
UpdownStockVO updownStockVO = new UpdownStockVO();
updownStockVO.setMaterialCode(cargoNumber);
updownStockVO.setMaterialName(descriptionGoods);
updownStockVO.setIncomingBatch(incomingBatch);
updownStockVO.setWaybillCode("");
updownStockVO.setOrderCode(stockListEntity.getOrderCode());
updownStockVO.setTotalNumber(stockListEntity.getQuantityStock());
@ -1164,6 +1245,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_type", "4")
.eq("association_id", materialId)
.eq("incoming_batch",incomingBatch)
.eq("market_id",marketId);
List<WarehouseUpdownGoodsEntity> list = warehouseUpdownGoodsService.list(queryWrapper);
Integer useNum = 0;
@ -1286,6 +1368,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
updownGoodsEntity.setNum(trayGoodsEntity.getNum());
updownGoodsEntity.setMarketId(trayGoodsEntity.getMarketId());
updownGoodsEntity.setMarketName(trayGoodsEntity.getMarketName());
updownGoodsEntity.setIncomingBatch(trayGoodsEntity.getIncomingBatch());
updownGoodsList.add(updownGoodsEntity);
}
warehouseUpdownGoodsService.saveBatch(updownGoodsList);
@ -1351,6 +1434,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
String associationValue = updownGoodsEntity.getAssociationValue();
Long marketId = updownGoodsEntity.getMarketId();
Integer num = updownGoodsEntity.getNum();
String incomingBatch = updownGoodsEntity.getIncomingBatch();
if("1".equals(associationType)){
//零担订单数据
String orderCode = associationValue;
@ -1373,7 +1457,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
totalNum = totalNum + num;
}else if("4".equals(associationType)){
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialId(marketId, associationId);
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialId(marketId, associationId,incomingBatch);
Integer quantityStock = stockListEntity.getQuantityStock();
stockNum = stockNum + num;
stockTotalNum = stockTotalNum + quantityStock;

Loading…
Cancel
Save