|
|
|
@ -16,9 +16,7 @@
|
|
|
|
|
*/ |
|
|
|
|
package com.logpm.distribution.service.impl; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ArrayUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
@ -62,6 +60,7 @@ import org.springblade.core.mp.support.Query;
|
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.constant.BladeConstant; |
|
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
@ -132,14 +131,49 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return page.setRecords(distributionStockArticleVOS); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 导出数据 |
|
|
|
|
* @param distributionStockArticle@return |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<DistributionStockArticleExcel> exportDistributionStockArticle(Wrapper<DistributionStockArticleEntity> queryWrapper) { |
|
|
|
|
List<DistributionStockArticleExcel> distributionStockArticleList = baseMapper.exportDistributionStockArticle(queryWrapper); |
|
|
|
|
//distributionStockArticleList.forEach(distributionStockArticle -> {
|
|
|
|
|
// distributionStockArticle.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionStockArticle.getType()));
|
|
|
|
|
//});
|
|
|
|
|
return distributionStockArticleList; |
|
|
|
|
public List<DistributionStockArticleExcel> exportDistributionStockArticle(Map<String, Object> distributionStockArticle) { |
|
|
|
|
|
|
|
|
|
Object o = distributionStockArticle.get("ids"); |
|
|
|
|
if(ObjectUtils.isNotNull(o)){ |
|
|
|
|
distributionStockArticle.remove("ids"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<DistributionStockArticleEntity> queryWrapper = Condition.getQueryWrapper(distributionStockArticle, DistributionStockArticleEntity.class); |
|
|
|
|
//if (!AuthUtil.isAdministrator()) {
|
|
|
|
|
// queryWrapper.lambda().eq(DistributionStockArticle::getTenantId, bladeUser.getTenantId());
|
|
|
|
|
//}
|
|
|
|
|
queryWrapper.lambda().eq(DistributionStockArticleEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
|
|
|
|
if(ObjectUtils.isNotNull(o)){ |
|
|
|
|
queryWrapper.in("id",String.valueOf(o).split(",")); |
|
|
|
|
} |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if(ObjectUtils.isNull(myCurrentWarehouse)){ |
|
|
|
|
throw new ServiceException("没有仓库信息!"); |
|
|
|
|
} |
|
|
|
|
queryWrapper.eq("warehouse_id",myCurrentWarehouse.getId()); |
|
|
|
|
queryWrapper.apply("order_status != 70"); |
|
|
|
|
List<DistributionStockArticleEntity> list = baseMapper.exportDistributionStockArticle(queryWrapper); |
|
|
|
|
List<DistributionStockArticleExcel> listExcel = new ArrayList<>(); |
|
|
|
|
list.forEach(s -> { |
|
|
|
|
// distributionStockArticle.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionStockArticle.getType()));
|
|
|
|
|
DistributionStockArticleExcel stockArticleExcel = new DistributionStockArticleExcel(); |
|
|
|
|
BasicdataWarehouseEntity entityWarehouse = warehouseClient.getEntityWarehouseId(s.getWarehouseId()); |
|
|
|
|
BeanUtil.copyProperties(s,stockArticleExcel); |
|
|
|
|
stockArticleExcel.setWarehouseCode(entityWarehouse.getWarehouseCode()); |
|
|
|
|
String s1 = s.getCompleteSet().equals("1") ? "否" : "是"; |
|
|
|
|
stockArticleExcel.setCompleteSet(s1); |
|
|
|
|
String value = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, s.getTypeService()); |
|
|
|
|
stockArticleExcel.setTypeService(value); |
|
|
|
|
listExcel.add(stockArticleExcel); |
|
|
|
|
}); |
|
|
|
|
return listExcel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -1013,7 +1047,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
stockArticleEntity.setFreezeStatus("10"); |
|
|
|
|
stockArticleEntity.setBrand(i.getBrand()); |
|
|
|
|
stockArticleEntity.setDescriptionGoods(i.getDescriptionGoods()); |
|
|
|
|
stockArticleEntity.setOrderCode(i.getOrderSelfNumbering()); |
|
|
|
|
stockArticleEntity.setOrderCode(i.getOrderCode()); |
|
|
|
|
stockArticleEntity.setMallName(i.getMallName()); |
|
|
|
|
stockArticleEntity.setTotalNumber(i.getTotalNumber()); |
|
|
|
|
stockArticleEntity.setHandQuantity(i.getHandQuantity()); |
|
|
|
@ -1038,7 +1072,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
parcelListEntity.setWarehouse(i.getWarehouse()); |
|
|
|
|
parcelListEntity.setWarehouseId(warehouse.getId()); |
|
|
|
|
parcelListEntity.setConditions(1); |
|
|
|
|
parcelListEntity.setOrderCode(i.getOrderSelfNumbering()); |
|
|
|
|
parcelListEntity.setOrderCode(i.getOrderCode()); |
|
|
|
|
parcelListEntity.setServiceNumber(i.getServiceNumber()); |
|
|
|
|
parcelListEntity.setBrandName(Optional.ofNullable(i.getBrand()).orElse(null)); |
|
|
|
|
if(i.getDescriptionGoods().contains(",")){ |
|
|
|
|