Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev-warehouse
0.0 2 years ago
parent
commit
7dfcfea0af
  1. 29
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java
  2. 33
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockListClient.java
  3. 30
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockListClient.java
  4. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  5. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  6. 51
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  7. 71
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

29
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java

@ -102,12 +102,12 @@ public class DistributionStockListEntity extends TenantEntity {
* 货物ID
*/
@ApiModelProperty(value = "货物id")
private String material;
private Long materialId;
/**
* 仓库
*/
@ApiModelProperty(value = "仓库")
private String warehouse;
private Long warehouse;
/**
* 拆分包件
*/
@ -124,21 +124,21 @@ public class DistributionStockListEntity extends TenantEntity {
*/
@ApiModelProperty(value = "品分类")
private String category;
// /**
// * 商场
// */
// @ApiModelProperty(value = "商场")
// private String market;
/**
* 商场ID
*/
@ApiModelProperty(value = "商场ID")
private Long marketId;
/**
* 货物单位
*/
@ApiModelProperty(value = "货物单位")
private String cargoUnit;
/**
* 门店
*/
@ApiModelProperty(value = "门店")
private String shop;
// /**
// * 门店
// */
// @ApiModelProperty(value = "门店")
// private String shop;
/**
* 库位信息
*/
@ -195,12 +195,12 @@ public class DistributionStockListEntity extends TenantEntity {
* 门店ID
*/
@ApiModelProperty(value = "门店ID")
private String storeId;
private Long storeId;
/**
* 所属商场
*/
@ApiModelProperty(value = "所属商场")
private String shoppingMall;
private Long shoppingMall;
/**
* 商场编码
*/
@ -230,5 +230,4 @@ public class DistributionStockListEntity extends TenantEntity {
}

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

@ -16,11 +16,11 @@
*/
package com.logpm.distribution.feign;
import com.logpm.distribution.vo.DistributionStockListVO;
import org.springblade.core.mp.support.BladePage;
import com.logpm.distribution.entity.DistributionStockListEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
/**
* 库存品管理 Feign接口类
@ -29,12 +29,15 @@ import org.springframework.web.bind.annotation.RequestParam;
* @since 2023-06-15
*/
@FeignClient(
value = "blade-distributionStockList"
value = "logpm-distribution-cyz"
)
public interface IDistributionStockListClient {
String API_PREFIX = "/client";
String TOP = API_PREFIX + "/t1op";
String QUERYDATA = API_PREFIX + "/getQueryData";
String ADDSTOCKLIST = API_PREFIX + "/addStockList";
String PUTSTOCKLIST = API_PREFIX + "/putStockList";
/**
* 获取库存品管理列表
@ -46,4 +49,28 @@ public interface IDistributionStockListClient {
@GetMapping(TOP)
BladePage<DistributionStockListEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
/**
* 查询某个客户信息及物品信息
*
* @return BladePage
*/
@GetMapping(QUERYDATA)
DistributionStockListVO getQueryData(@RequestParam("storeId") Long storeId,@RequestParam("clientId") Long clientId,@RequestParam("materialId") Long materialId);
/**
* 添加某个客户信息及物品信息
*
* @return BladePage
*/
@PostMapping(ADDSTOCKLIST)
Boolean getAddStockList(@RequestBody DistributionStockListEntity distributionStockListEntity);
// /**
// * 修改某个客户信息及物品信息
// *
// * @return BladePage
// */
// @PutMapping(PUTSTOCKLIST)
// Boolean putStockList(@RequestBody DistributionStockListEntity distributionStockListEntity);
}

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

@ -17,6 +17,7 @@
package com.logpm.distribution.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.vo.DistributionStockListVO;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
@ -24,6 +25,8 @@ import org.springblade.core.mp.support.Query;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.service.IDistributionStockListService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ -50,4 +53,31 @@ public class DistributionStockListClient implements IDistributionStockListClient
return BladePage.of(page);
}
/**
*
* @param
* @return
*/
@Override
@GetMapping(QUERYDATA)
public DistributionStockListVO getQueryData( Long storeId, Long clientId,Long materialId) {
DistributionStockListVO distributionStockListVO = distributionStockListService.getQueryData(storeId, clientId, materialId);
return distributionStockListVO ;
}
/**
* 添加
* @param distributionStockListEntity
* @return
*/
@Override
@PostMapping(ADDSTOCKLIST)
public Boolean getAddStockList(DistributionStockListEntity distributionStockListEntity) {
Boolean dis = distributionStockListService.getAddStockList(distributionStockListEntity);
return dis ;
}
}

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

@ -69,4 +69,8 @@ public interface IDistributionStockListService extends BaseService<DistributionS
void importUser(List<DistributionStockListExcel> data, Boolean isCovered);
Boolean parcels(DistributionStockListEntity distributionStockList);
DistributionStockListVO getQueryData(Long storeId, Long clientId,Long materialId);
Boolean getAddStockList(DistributionStockListEntity distributionStockListEntity);
}

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -225,10 +225,10 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
distributionStockListEntity.setServiceNumber("服务号"); //服务号
distributionStockListEntity.setDescriptionGoods(distributionStockArticleEntity.getDescriptionGoods()); //货物名称
distributionStockListEntity.setCargoNumber("货物编号"); //货物编号
distributionStockListEntity.setWarehouse(distributionStockArticleEntity.getWarehouse()); //仓库
// distributionStockListEntity.setMarket("商场"); //商场
distributionStockListEntity.setWarehouse(Long.parseLong( distributionStockArticleEntity.getWarehouse()) ); //仓库
distributionStockListEntity.setMarketId(Long.parseLong("456456465")); //商场
distributionStockListEntity.setCargoUnit("货物单位"); //货物单位
distributionStockListEntity.setShop("门店"); //门店
// distributionStockListEntity.setShop("门店"); //门店
distributionStockListEntity.setStorageLocation("库位信息"); //库位信息
distributionStockListEntity.setMallName(distributionStockArticleEntity.getMallName()); //商场名称
distributionStockListEntity.setQuantityStock(distributionStockArticleEntity.getHandQuantity()); //库存数量
@ -236,16 +236,16 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
distributionStockListEntity.setDespatch("车次号");//车次号
distributionStockListEntity.setUnit("单位");//单位
distributionStockListEntity.setWarehouseName("仓库名称");//仓库名称
distributionStockListEntity.setStoreId("门店ID");//门店ID
distributionStockListEntity.setShoppingMall("所属商场");//所属商场
distributionStockListEntity.setShoppingMall("所属商场");//所属商场
distributionStockListEntity.setStoreId(Long.parseLong("12312"));//门店ID
// distributionStockListEntity.setShoppingMall("所属商场");//所属商场
// distributionStockListEntity.setShoppingMall("所属商场");//所属商场
distributionStockListEntity.setMarketCode("商场编码");//商场编码
distributionStockListEntity.setMarketName("商场名称");//商场名称
distributionStockListEntity.setStoreCode("门店编码");//门店编码
distributionStockListEntity.setStoreName("门店名称");//门店名称
distributionStockListEntity.setFactory("工厂车次");//工厂车次
distributionStockListEntity.setCategory("品分类");//品分类
distributionStockListEntity.setMaterial("货物ID");//货物ID
distributionStockListEntity.setMaterialId(Long.parseLong("456456") );//货物ID
distributionStockListEntity.setStoreName("门店名称");//门店名称
distributionStockListEntity.setParcelListId(distributionParcelList.getId());//包件id
distributionStockListEntity.setQuantityOccupied(0);//冻结数量

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

@ -19,18 +19,15 @@ package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basic.feign.IBasicTenantCodeClient;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionUnpackingDetailsExcel;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.distribution.excel.DistributionStockListExcel;
import com.logpm.distribution.mapper.DistributionStockListMapper;
import lombok.AllArgsConstructor;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
import org.springblade.system.cache.DictCache;
import org.springblade.system.enums.DictEnum;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -40,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
/**
@ -168,4 +166,49 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return true;
}
/**
* 查询客户信息
* @param
* @return
*/
@Override
public DistributionStockListVO getQueryData(Long storeId, Long clientId,Long materialId) {
DistributionStockListVO distributionStockListVO = new DistributionStockListVO();
List<DistributionStockListEntity> list = new ArrayList<>();
if(Func.isNotEmpty(storeId)){
//门店
list = baseMapper.selectList(Wrappers.<DistributionStockListEntity>query().lambda()
.eq(DistributionStockListEntity::getStoreId,storeId)//门店
.eq(DistributionStockListEntity::getMaterialId,materialId)//货物
);
}else if(Func.isNotEmpty(clientId)){
//客户商场
list = baseMapper.selectList(Wrappers.<DistributionStockListEntity>query().lambda()
.eq(DistributionStockListEntity::getMarketId,clientId)//商场
.eq(DistributionStockListEntity::getMaterialId,materialId)//货物
);
}
if(list.size() > 0){
AtomicReference<Integer> num = new AtomicReference<>(0);
list.forEach(i ->{
num.updateAndGet(v -> v + i.getQuantityStock());
});
DistributionStockListEntity distributionStockList= list.get(0);
distributionStockList.setQuantityStock(num.get());
BeanUtils.copyProperties(distributionStockList,distributionStockListVO);
return distributionStockListVO;
}
return null;
}
/**
* 添加
* @param distributionStockList
* @return
*/
@Override
public Boolean getAddStockList(DistributionStockListEntity distributionStockList) {
return this.save(distributionStockList);
}
}

71
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

@ -19,6 +19,9 @@ package com.logpm.warehouse.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.eventbus.AllowConcurrentEvents;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.feign.IDistributionStockListClient;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.warehouse.dto.WarehouseWarehousingEntryDTO;
import com.logpm.warehouse.entity.WarehouseWarehousingDetailEntity;
import com.logpm.warehouse.entity.WarehouseWarehousingEntryEntity;
@ -52,6 +55,7 @@ import java.util.List;
@Service
public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<WarehouseWarehousingEntryMapper, WarehouseWarehousingEntryEntity> implements IWarehouseWarehousingEntryService {
private final IWarehouseWarehousingDetailService warehouseWarehousingDetailService;
private final IDistributionStockListClient distributionStockListClient;
@ -138,21 +142,80 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
/**
* 添加库存品
* @param num
* @param warehousingEntryDTO
* @param warehousingDetail
* @param num 添加数量
* @param warehousingEntryDTO 客户信息
* @param warehousingDetail 物品信息
* @return
*/
public Boolean addInventory(Integer num,WarehouseWarehousingEntryDTO warehousingEntryDTO,WarehouseWarehousingDetailEntity warehousingDetail){
// DistributionStockListEntity distributionStockList = new DistributionStockListEntity();
// distributionStockList.setStoreId(warehousingEntryDTO.getStoreId()); //门店
// distributionStockList.setMarketId(warehousingEntryDTO.getClientId()); //客户id
// distributionStockList.setMaterialId(warehousingDetail.getMaterialId()); //物料id
if(num < 1){
return true;
}else{
DistributionStockListVO queryData = distributionStockListClient.getQueryData(warehousingEntryDTO.getStoreId(),warehousingEntryDTO.getClientId(),warehousingDetail.getMaterialId());
//添加
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity();
if(Func.isNotEmpty(queryData)){
distributionStockListEntity.setQuantityStock( queryData.getQuantityStock()+num ); //库存数量
distributionStockListEntity.setOutboundQuantity(queryData.getOutboundQuantity()); //出库数量
}else{
distributionStockListEntity.setQuantityStock(num); //库存数量
distributionStockListEntity.setOutboundQuantity(0); //出库数量
}
distributionStockListEntity.setUnpack(false);
// distributionStockListEntity.setStockArticleId(distributionParcelList.getStockArticleId()); //订单ID
// distributionStockListEntity.setOrderSelfNumbering(distributionStockArticleEntity.getOrderSelfNumbering()); //订单自编号
distributionStockListEntity.setIncomingBatch(warehousingEntryDTO.getReceiptBatch()); //入库批次号
// distributionStockListEntity.setServiceNumber("服务号"); //服务号
distributionStockListEntity.setDescriptionGoods(warehousingDetail.getProductName()); //货物名称
distributionStockListEntity.setCargoNumber(warehousingDetail.getPackagingNumber()); //货物编号
distributionStockListEntity.setWarehouse(warehousingEntryDTO.getWarehouseId()); //仓库
distributionStockListEntity.setMarketId(warehousingEntryDTO.getClientId()); //商场及客户
distributionStockListEntity.setCargoUnit(warehousingDetail.getProductUnit()); //货物单位
if(Func.isNotEmpty(warehousingEntryDTO.getStoreId())){
distributionStockListEntity.setStoreId(warehousingEntryDTO.getStoreId()); //门店
}
if(Func.isNotEmpty(warehousingEntryDTO.getLicensePlate())){
distributionStockListEntity.setDespatch(warehousingEntryDTO.getTrainNumber());//车次号运单
}
// distributionStockListEntity.setStorageLocation("库位信息"); //库位信息
// distributionStockListEntity.setMallName(warehousingEntryDTO.getCustomerName()); //商场名称
// distributionStockListEntity.setUnit("单位");//单位
distributionStockListEntity.setWarehouseName(warehousingEntryDTO.getWarehouse());//仓库名称
// distributionStockListEntity.setStoreId(Long.parseLong("12312"));//门店ID
distributionStockListEntity.setShoppingMall(warehousingEntryDTO.getClientId());//所属商场
// distributionStockListEntity.setMarketCode(warehousingEntryDTO.get);//商场编码
distributionStockListEntity.setMarketName(warehousingEntryDTO.getCustomerName());//商场名称
// distributionStockListEntity.setStoreCode("门店编码");//门店编码
distributionStockListEntity.setStoreName(warehousingEntryDTO.getStoreName());//门店名称
// distributionStockListEntity.setFactory("工厂车次");//工厂车次
distributionStockListEntity.setCategory("品分类");//品分类
distributionStockListEntity.setMaterialId( warehousingDetail.getMaterialId());//货物ID
// distributionStockListEntity.setStoreName("门店名称");//门店名称
// distributionStockListEntity.setParcelListId(distributionParcelList.getId());//包件id
distributionStockListEntity.setQuantityOccupied(0);//冻结数量
return distributionStockListClient.getAddStockList(distributionStockListEntity);
}
return null;
}

Loading…
Cancel
Save