Browse Source

添加客户信息导入

training
caoyizhong 1 year ago
parent
commit
af525b7369
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java
  2. 2
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataStorageServicesEntity.java
  3. 15
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java
  4. 20
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicDataClienImporter.java
  5. 107
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataClientExcel.java
  6. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java
  7. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java
  8. 239
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  9. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  10. 34
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  11. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java
  12. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java

@ -84,6 +84,8 @@ public class DictBizConstant {
public static final String PALLET_STOCKNODATA_TYPE = "pallet_stocknodata_type";//打托类型 1服务号 2合同号 3商场 4门店 5客户 6仓库 7其他
public static final String PALLET_ARTIFICIAL_TYPE = "pallet_artificial_type";//人工打托类型
public static final String TRAY_TYPE = "tray_type";//托盘类型
public static final String CLIENT_TYPE = "client_type";//客户类型
public static final String BASIC_FREIGHT_TYPE = "basic_freight_type";//客户类型 干 仓 配
public static final String WAREHOUSE_TRAY_BINDING_TYPE = "warehouse_tray_binding_type";//托盘货物绑定类型
public static final String WAREHOUSE_TRAY_ENTRY_TYPE = "warehouse_tray_entry_type";//托盘货物录入类型

2
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataStorageServicesEntity.java

@ -68,7 +68,7 @@ public class BasicdataStorageServicesEntity extends TenantEntity {
@ApiModelProperty(value = "客户ID")
private Long clientId;
/**
* 区分类型
* 区分类型 1.门店 2. 客户
*/
@ApiModelProperty(value = "区分类型")
private Integer distinguish;

15
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataClientController.java

@ -24,6 +24,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataStoreContactEntity;
import com.logpm.basicdata.excel.BasicDataClienImporter;
import com.logpm.basicdata.excel.BasicdataClientExcel;
import com.logpm.basicdata.service.IBasicdataClientService;
import com.logpm.basicdata.service.IBasicdataStoreBusinessService;
@ -44,6 +45,7 @@ import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.feign.IUserClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
@ -233,4 +235,17 @@ public class BasicdataClientController extends BladeController {
ExcelUtil.export(response, "基础客户表数据" + DateUtil.time(), "基础客户表数据表", list, BasicdataClientExcel.class);
}
/**
* 导入数据
*/
@PostMapping("/import-basicDataClient")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导入数据", notes = "传入basicDataClient")
public R importBasicDataClient(MultipartFile file, Integer isCovered) {
isCovered = 1;
BasicDataClienImporter clientImporter = new BasicDataClienImporter(basicdataClientService, isCovered == 1);
ExcelUtil.save(file, clientImporter, BasicdataClientExcel.class);
return R.success("操作成功");
}
}

20
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicDataClienImporter.java

@ -0,0 +1,20 @@
package com.logpm.basicdata.excel;
import com.logpm.basicdata.service.IBasicdataClientService;
import lombok.RequiredArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import java.util.List;
@RequiredArgsConstructor
public class BasicDataClienImporter implements ExcelImporter<BasicdataClientExcel> {
private final IBasicdataClientService service;
private final Boolean isCovered;
@Override
public void save(List<BasicdataClientExcel> data) {
service.importClient(data, isCovered);
}
}

107
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataClientExcel.java

@ -21,6 +21,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ -42,77 +43,111 @@ public class BasicdataClientExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
* 客户名称
*/
@ColumnWidth(20)
@ExcelProperty("租户号")
private String tenantId;
@ExcelProperty("客户名称")
private String clientName;
/**
* 是否已删除
* 客户编码
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Integer isDeleted;
@ExcelProperty("客户编码")
private String clientCode;
/**
* 预留1
* 服务类型 暂无用
*/
@ColumnWidth(20)
@ExcelProperty("预留1")
private String reserve1;
@ExcelProperty("服务类型")
private String typeService;
/**
* 预留2
* 客户类型 暂无用
*/
@ColumnWidth(20)
@ExcelProperty("预留2")
private String reserve2;
@ExcelProperty("客户类型")
private String clientType;
/**
* 预留3
* 详细地址
*/
@ColumnWidth(20)
@ExcelProperty("预留3")
private String reserve3;
@ExcelProperty("详细地址")
private String detailedly;
/**
* 预留4
* 省份
*/
@ColumnWidth(20)
@ExcelProperty("预留4")
private String reserve4;
@ExcelProperty("")
private String bladeRegionProvinceId;
/**
* 预留5
*
*/
@ColumnWidth(20)
@ExcelProperty("预留5")
private String reserve5;
@ExcelProperty("")
private String bladeRegionCityId;
/**
* 客户名称
* /
*/
@ColumnWidth(20)
@ExcelProperty("客户名称")
private String clientName;
@ExcelProperty("区/县")
private String bladeRegionAreaId;
/**
* 客户类型;1 C端 2 B端
* 是否控货
*/
@ColumnWidth(20)
@ExcelProperty("客户类型;1 C端 2 B端")
private Integer typeService;
@ExcelProperty("是否控货")
private String cargoControl;
/**
* 省份
* 发站仓
*/
@ColumnWidth(20)
@ExcelProperty("省份")
private String bladeRegionProvinceId;
@ExcelProperty("发站仓")
private String sendWarehouseName;
/**
*
* 服务仓
*/
@ColumnWidth(20)
@ExcelProperty("")
private String bladeRegionCityId;
@ExcelProperty("服务仓")
private String serveWarehouseName;
/**
* /
* 联系人
*/
@ColumnWidth(20)
@ExcelProperty("区/县")
private String bladeRegionAreaId;
@ExcelProperty("联系人")
private String linkman;
/**
* 联系电话
*/
@ColumnWidth(20)
@ExcelProperty("联系电话")
private String phone;
/**
* 品牌
*/
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brandName;
/**
* 三方商场
*/
@ColumnWidth(20)
@ExcelProperty("三方商场编码")
private String tripartiteCoding;
/**
* 三方商场
*/
@ColumnWidth(20)
@ExcelProperty("三方商场名称")
private String tripartiteMall;
/**
* 配送类型
*/
@ColumnWidth(20)
@ExcelProperty("配送类型")
private String mold;
/**
* 合同附件
*/

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientService.java

@ -90,4 +90,6 @@ public interface IBasicdataClientService extends BaseService<BasicdataClientEnti
* @return
*/
List<BasicdataClientVO> dictList();
void importClient(List<BasicdataClientExcel> data, Boolean isCovered);
}

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java

@ -129,5 +129,9 @@ public interface IBasicdataWarehouseService extends BaseService<BasicdataWarehou
*/
List<BasicdataWarehouseEntity> warehouseListqx();
/**
* 仓库入库单 查询所属部门
* @return
*/
List<BasicdataWarehouseEntity> detailWarehouse();
}

239
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java

@ -24,21 +24,26 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.excel.BasicdataClientExcel;
import com.logpm.basicdata.excel.BasicdataStorageServicesExcel;
import com.logpm.basicdata.mapper.BasicdataClientMapper;
import com.logpm.basicdata.service.*;
import com.logpm.basicdata.vo.BasicdataClientVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.DictBiz;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
* 基础客户表 服务实现类
@ -53,9 +58,12 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
private final IBasicdataHistoricalContractService basicdataHistoricalContractService;
private final IBasicdataStoreContactService basicdataStoreContactService;
private final IBasicdataStoreContactService basicdataStoreContactService; //联系人
private final IBasicdataStoreBusinessService basicdataStoreBusinessService;
private final IBasicdataTripartiteMallService basicdataTripartiteMallService;
private final IBasicdataTripartiteMallService basicdataTripartiteMallService; //三方商场
private final IBasicdataStorageServicesService basicdataStorageServicesService; //服务仓
private final IBasicdataBrandService basicdataBrandService; //品牌
private final IBasicdataStoreBrandService basicdataStoreBrandService; //品牌
private final IBasicdataWarehouseService warehouseService;
// private final IBasicdataClientUserService basicdataClientUserService;
@ -255,4 +263,225 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
return list;
}
/**
* 导入数据
* @param data
* @param isCovered
*/
@Override
public void importClient(List<BasicdataClientExcel> data, Boolean isCovered) {
log.info("客户导入数据");
List<BasicdataStoreContactEntity> storeContactEntities = new ArrayList<>(); // 联系人
List<BasicdataTripartiteMallEntity> tripartiteMallEntities = new ArrayList<>(); // 三方商场
List<BasicdataStoreBrandEntity> storeBrandEntities = new ArrayList<>(); // 品牌
List<BasicdataStorageServicesEntity> storageServicesEntities = new ArrayList<>(); // 服务仓
List<BasicdataStoreBusinessEntity> storeBusinessEntities = new ArrayList<>(); // 服务类型
//查询仓库信息
List<BasicdataWarehouseEntity> list1 = warehouseService.warehouseListqx();
List<DictBiz> dictBizs = DictBizCache.getList(DictBizConstant.DISTRIBUTION_TYPE);//商 市 自
List<DictBiz> clientBiz = DictBizCache.getList(DictBizConstant.CLIENT_TYPE); //客 工
List<DictBiz> freightBiz = DictBizCache.getList(DictBizConstant.BASIC_FREIGHT_TYPE); //客 工
Set<String> set =new HashSet<>();
for (BasicdataClientExcel i : data) {
log.info("导入数据《》《》{}",i);
if(set.isEmpty()){
set.add(i.getClientCode());
}else{
boolean b = set.stream().anyMatch(a -> a.equals(i.getClientCode()));
if(b){
continue;
}
}
BasicdataClientEntity basicdataClient = new BasicdataClientEntity();
BeanUtil.copyProperties(i,basicdataClient);
// Optional<DictBiz> first = dictBizs.stream().filter(ii -> ii.getDictValue().equals(i.getTypeService())).findFirst();
Optional<DictBiz> clientFirst = clientBiz.stream().filter(ii -> ii.getDictValue().equals(i.getClientType())).findFirst();
// i.setTypeService(first.get().getDictValue());
basicdataClient.setClientType(clientFirst.get().getDictKey());
//查询是不是重复
List<BasicdataClientEntity> basicdataClientEntities = baseMapper.selectList(Wrappers.<BasicdataClientEntity>query().lambda().eq(BasicdataClientEntity::getClientCode, i.getClientCode()));
if(basicdataClientEntities.isEmpty()){
basicdataClient.setPid("0");
basicdataClient.setCargoControl(false);
basicdataClient.setStatus(0);
basicdataClient.setIsDeleted(0);
basicdataClient.setCreateTime(new Date());
baseMapper.insert(basicdataClient);
if(ObjectUtils.isNull(basicdataClient.getId())){
throw new ServiceException("客户ID不存在");
}
//添加服务类型
if(ObjectUtils.isNotNull(i.getTypeService())){
BasicdataStoreBusinessEntity storeBusinessEntity = new BasicdataStoreBusinessEntity();
storeBusinessEntity.setClientId(basicdataClient.getId().toString());
storeBusinessEntity.setTypeService(i.getTypeService());
storeBusinessEntity.setMold(i.getMold());
storeBusinessEntities.add(storeBusinessEntity);
}
//添加服务仓
if(ObjectUtils.isNotNull(i.getServeWarehouseName())){
BasicdataStorageServicesEntity servicesEntity = new BasicdataStorageServicesEntity();
servicesEntity.setClientId(basicdataClient.getId());
servicesEntity.setDistinguish(2);
if(ObjectUtils.isNotNull(i.getSendWarehouseName())){
// Long id = list1.stream().filter(q -> q.getName().equals(i.getSendWarehouseName())).findFirst().get().getId();
// servicesEntity.setSendWarehouseId(String.valueOf(id));
servicesEntity.setSendWarehouseName(i.getSendWarehouseName());
}
Long id = list1.stream().filter(q -> q.getName().equals(i.getServeWarehouseName())).findFirst().get().getId();
servicesEntity.setServeWarehouseId(id);
servicesEntity.setServeWarehouseName(i.getServeWarehouseName());
storageServicesEntities.add(servicesEntity);
}
//添加品牌
if(ObjectUtils.isNotNull(i.getBrandName())){
BasicdataStoreBrandEntity storeBrandEntity= new BasicdataStoreBrandEntity();
storeBrandEntity.setClientId(basicdataClient.getId());
storeBrandEntity.setShopId(basicdataClient.getId().toString());
BasicdataBrandEntity one = basicdataBrandService.getOne(Wrappers.<BasicdataBrandEntity>query().lambda().eq(BasicdataBrandEntity::getBrandName, i.getBrandName()));
if(ObjectUtils.isNull(one)){
throw new ServiceException("品牌不存在");
}
storeBrandEntity.setBrandId(String.valueOf(one.getId()));
storeBrandEntity.setBrandName(i.getBrandName());
storeBrandEntities.add(storeBrandEntity);
}
//添加联系人
if(ObjectUtils.isNotNull(i.getLinkman())){
BasicdataStoreContactEntity storeContactEntity = new BasicdataStoreContactEntity();
storeContactEntity.setShopId(basicdataClient.getId());
storeContactEntity.setPhone(i.getPhone());
storeContactEntity.setLinkman(i.getLinkman());
storeContactEntities.add(storeContactEntity);
}
//添加三方商场
if(ObjectUtils.isNotNull(i.getTripartiteMall())){
BasicdataTripartiteMallEntity tripartiteMallEntity = new BasicdataTripartiteMallEntity();
tripartiteMallEntity.setClientId(basicdataClient.getId());
tripartiteMallEntity.setTripartiteMall(i.getTripartiteMall());
tripartiteMallEntity.setTripartiteCoding(i.getTripartiteCoding());
tripartiteMallEntities.add(tripartiteMallEntity);
}
}
}
//品牌
if(!storeBrandEntities.isEmpty()){
List<BasicdataStoreBrandEntity> list = new ArrayList<>();
storeBrandEntities.stream().forEach(i ->{
if(i.getBrandName().contains(",")){
String[] split = i.getBrandName().split(",");
for (int j = 0; j < split.length; j++) {
BasicdataStoreBrandEntity business = new BasicdataStoreBrandEntity();
BeanUtil.copyProperties(i,business);
List<BasicdataBrandEntity> list2 = basicdataBrandService.list(Wrappers.<BasicdataBrandEntity>query().lambda()
.eq(BasicdataBrandEntity::getBrandName, i.getBrandName())
);
business.setBrandName(split[j]);
business.setBrandId(list2.get(0).getId().toString());
list.add(business);
}
}else{
List<BasicdataBrandEntity> list2 = basicdataBrandService.list(Wrappers.<BasicdataBrandEntity>query().lambda()
.eq(BasicdataBrandEntity::getBrandName, i.getBrandName())
);
i.setBrandName(i.getBrandName());
i.setBrandId(list2.get(0).getId().toString());
list.add(i);
}
});
basicdataStoreBrandService.saveBatch(list);
}
//服务类型
if(!storeBusinessEntities.isEmpty()){
List<BasicdataStoreBusinessEntity> list = new ArrayList<>();
storeBusinessEntities.stream().forEach(i ->{
// List<DictBiz> dictBizs = DictBizCache.getList(DictBizConstant.DISTRIBUTION_TYPE);
if(i.getTypeService().contains(",")){
String[] split = i.getTypeService().split(",");
for (int j = 0; j < split.length; j++) {
BasicdataStoreBusinessEntity business = new BasicdataStoreBusinessEntity();
BeanUtil.copyProperties(i,business);
int finalJ = j;
if(split[j].equals("配送")){
switch ( business.getMold()){
case "商配":
business.setMold("1");
break;
case "市配":
business.setMold("2");
break;
case "自提":
business.setMold("3");
break;
}
}else{
business.setMold(null);
}
String dictValue = freightBiz.stream().filter(q -> q.getDictValue().equals(split[finalJ])).findFirst().get().getDictKey();
business.setTypeService(dictValue);
list.add(business);
}
}else{
String dictValue = freightBiz.stream().filter(q -> q.getDictValue().equals(i.getTypeService())).findFirst().get().getDictKey();
i.setTypeService(dictValue);
if(i.getTypeService().equals("配送")){
String mold = i.getMold();
switch (mold){
case "商配":
i.setMold("1");
break;
case "市配":
i.setMold("2");
break;
case "自提":
i.setMold("3");
break;
}
}else{
i.setMold(null);
}
list.add(i);
}
});
basicdataStoreBusinessService.saveBatch(list);
}
//服务仓
if(!storageServicesEntities.isEmpty()){
List<BasicdataStorageServicesEntity> servicesEntityList = new ArrayList<>();
storageServicesEntities.stream().forEach(i ->{
if(i.getSendWarehouseName().contains(",")){
String[] split = i.getSendWarehouseName().split(",");
for (int j = 0; j < split.length; j++) {
BasicdataStorageServicesEntity servicesEntity = new BasicdataStorageServicesEntity();
Long id = list1.stream().filter(q -> q.getName().equals(i.getSendWarehouseName())).findFirst().get().getId();
BeanUtil.copyProperties(i,servicesEntity);
servicesEntity.setSendWarehouseId(id.toString());
servicesEntity.setSendWarehouseName(split[j]);
servicesEntityList.add(servicesEntity);
}
}else{
Long id = list1.stream().filter(q -> q.getName().equals(i.getSendWarehouseName())).findFirst().get().getId();
i.setSendWarehouseId(id.toString());
servicesEntityList.add(i);
}
});
basicdataStorageServicesService.saveBatch(servicesEntityList);
}
//联系人
if(!storeContactEntities.isEmpty()){
basicdataStoreContactService.saveBatch(storeContactEntities);
}
//三方
if(!tripartiteMallEntities.isEmpty()){
basicdataTripartiteMallService.saveBatch(tripartiteMallEntities);
}
}
}

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

@ -98,7 +98,7 @@
from logpm_distribution_stockup_info ldsi
LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id
LEFT JOIN logpm_distribution_stock_article ldsa on ldsa.id = ldbs.stock_article_id and ldsa.is_zero = '0'
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldsa.id and ldpl.order_package_grounding_status = 10
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldsa.id
LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id
where ldsi.stockup_id = #{stockupId} and ldsi.reservation_id = #{reservationId} and ldsa.is_zero = '0'
</select>

34
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -1361,16 +1361,22 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
@Override
@Transactional(rollbackFor = Exception.class)
public void stockupUpdateState(StockupDTO stockupDTO) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
//查询包件备货状态
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListMapper.selectList(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode()));
//修改
if(!distributionParcelListEntities.isEmpty()){
DistributionParcelListEntity distributionParcelListEntity = new DistributionParcelListEntity();
distributionParcelListEntity.setId(distributionParcelListEntities.get(0).getId());
distributionParcelListEntity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue());
distributionParcelListMapper.updateById(distributionParcelListEntity);
if(stockupDTO.getScanType().equals(1)){
//包件
//查询包件备货状态
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListMapper.selectList(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode())
.eq(ObjectUtils.isNotNull(myCurrentWarehouse),DistributionParcelListEntity::getWarehouseId,myCurrentWarehouse.getId() )
);
//修改
if(!distributionParcelListEntities.isEmpty()){
DistributionParcelListEntity distributionParcelListEntity = new DistributionParcelListEntity();
distributionParcelListEntity.setId(distributionParcelListEntities.get(0).getId());
distributionParcelListEntity.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue());
distributionParcelListMapper.updateById(distributionParcelListEntity);
}
}
//备货中
@ -1382,11 +1388,11 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
AtomicReference<Integer> nuy = new AtomicReference<>(0); // 以扫
AtomicReference<Integer> ku = new AtomicReference<>(0); // 库
//查询有没有零担数据
List<DistributionReservationZeroPackageEntity> zeroList = reservationZeroPackageService.getZeroList(stockupDTO.getReservationId());
if(!zeroList.isEmpty()){
int sum = zeroList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum();
nu.set(nu.get() + sum);
}
// List<DistributionReservationZeroPackageEntity> zeroList = reservationZeroPackageService.getZeroList(stockupDTO.getReservationId());
// if(!zeroList.isEmpty()){
// int sum = zeroList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum();
// nu.set(nu.get() + sum);
// }
distributionStockupInfoEntities.forEach(i -> {
//预约包件
//查询已扫描的数量

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

@ -359,13 +359,19 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
distributionStockupMapper.updateById(distributionStockupEntity);
}
/**
* 备货数量
* @param id
* @param parseLong
* @return
*/
@Override
public Integer selectCount(Long id,Long parseLong) {
return baseMapper.selectCount(Wrappers.<DistributionStockEntity>query().lambda()
.eq(ObjectUtils.isNotNull(id),DistributionStockEntity::getStockArticle,id)
.eq(DistributionStockEntity::getStockupId,parseLong)
).intValue();
List<DistributionStockEntity> stockEntityList = baseMapper.selectList(Wrappers.<DistributionStockEntity>query().lambda()
.eq(ObjectUtils.isNotNull(id), DistributionStockEntity::getStockArticle, id)
.eq(DistributionStockEntity::getStockupId, parseLong)
);
return stockEntityList.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum();
}
@Override

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -1271,11 +1271,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//查询订单数量 无库位
List<DistributionStockupSelfVO> distributionStockupSelfVOS = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
DistributionStockupSelfVO distributionStockup= new DistributionStockupSelfVO();
AtomicReference<Integer> j = new AtomicReference<>(0);
AtomicReference<Integer> y = new AtomicReference<>(0);
distributionStockupSelfVOS.forEach(i -> {
if(ObjectUtils.isNull(i.getAllocationId())){
j.updateAndGet(v -> v + 1);
y.updateAndGet(v -> v + i.getScanNum());
if(ObjectUtils.isNull(distributionStockup.getConsignee())){
distributionStockup.setConsignee(i.getConsignee());
@ -1295,7 +1293,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
}
});
distributionStockup.setPlanNum(j.get());
// distributionStockup.setPlanNum(j.get());
distributionStockup.setScanNum(y.get());
distributionStockupSelfVO = distributionStockup;
}
@ -1309,9 +1307,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
// }
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoSelfList(stockupDTO);
Iterator<PackageStockupVO> iterator = list.iterator();
AtomicReference<Integer> j = new AtomicReference<>(0);
if(Objects.isNull(stockupDTO.getAllocationId())){
while (iterator.hasNext()){
j.updateAndGet(v -> v + 1);
PackageStockupVO next = iterator.next();
if(ObjectUtils.isNotNull(next.getAllocationId()) ){
iterator.remove();
@ -1327,6 +1327,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
}else{
while (iterator.hasNext()){
j.updateAndGet(v -> v + 1);
PackageStockupVO next = iterator.next();
if(ObjectUtils.isNull(next.getPositionCode()) ){
iterator.remove();
@ -1341,6 +1342,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
}
}
distributionStockupSelfVO.setPlanNum(j.get());
DistributionStockupOrderInfoVO vo = new DistributionStockupOrderInfoVO();
vo.setReservationId(stockupDTO.getReservationId()); //预约id
vo.setCustomer(byId.getMallName()); //客户0

Loading…
Cancel
Save