Browse Source

Merge branch 'pre-production'

master
pref_mail@163.com 12 months ago
parent
commit
5f651c130a
  1. 26
      blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java
  2. 13
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataFactoryCategoryEntity.java
  3. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseUpdownStockupAreaEntity.java
  4. 12
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownStockUpAreaClient.java
  5. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataCategoryController.java
  6. 87
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFactoryCategoryController.java
  7. 19
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsShelfController.java
  8. 26
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java
  9. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/enums/FullVehicleTypeEnums.java
  10. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataCategoryExcel.java
  11. 65
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryExcel.java
  12. 160
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryImporter.java
  13. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsShelfService.java
  14. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceService.java
  15. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java
  16. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceRouteServiceImpl.java
  17. 38
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java
  18. 3
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapeer.java
  19. 25
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml
  20. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleStatisticsController.java
  21. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockArticleStatisticsDTO.java
  22. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  23. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  24. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleStatisticsMapper.java
  25. 128
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleStatisticsMapper.xml
  26. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleStatisticsService.java
  27. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  28. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  29. 76
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleStatisticsServiceImpl.java
  30. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  31. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java
  32. 11
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/NodeNeedEnums.java
  33. 2
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/resources/application-dev.yml
  34. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/OrderPackageStatusFallJob.java
  35. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java
  36. 13
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownStockupAreaClient.java
  37. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java
  38. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillReceivedRecordClient.java
  39. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaService.java
  40. 55
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java
  41. 206
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

26
blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java

@ -14,65 +14,65 @@ public interface ModuleNameConstant {
/**
* 工厂对接服务名称
*/
String APPLICATION_FACTORY_NAME = "logpm-factory"+DEVAUTH;
String APPLICATION_FACTORY_NAME = "logpm-factory" + DEVAUTH;
/**
* 工厂对接服务名称
*/
String APPLICATION_OLDPROJECT_NAME = "logpm-old-project"+DEVAUTH;
String APPLICATION_OLDPROJECT_NAME = "logpm-old-project" + DEVAUTH;
/**
* 基础信息服务名称
*/
String APPLICATION_BASIC_NAME = "logpm-basic"+DEVAUTH;
String APPLICATION_BASIC_NAME = "logpm-basic" + DEVAUTH;
/**
* 基础信息data服务名称
*/
String APPLICATION_BASICDATA_NAME = "logpm-basicdata"+DEVAUTH;
String APPLICATION_BASICDATA_NAME = "logpm-basicdata" + DEVAUTH;
/**
* 干线服务名称
*/
String APPLICATION_TRUNKLINE_NAME = "logpm-trunkline"+DEVAUTH;
String APPLICATION_TRUNKLINE_NAME = "logpm-trunkline" + DEVAUTH;
/**
* 售后服务名称
*/
String APPLICATION_AFTERSALES_NAME = "logpm-aftersales"+DEVAUTH;
String APPLICATION_AFTERSALES_NAME = "logpm-aftersales" + DEVAUTH;
String APPLICATION_XXLJOB_NAME = "blade-xxljob"+DEVAUTH;
String APPLICATION_XXLJOB_NAME = "blade-xxljob" + DEVAUTH;
/**
* 仓库服务名称
*/
String APPLICATION_WAREHOUSE_NAME = "logpm-warehouse"+DEVAUTH;
String APPLICATION_WAREHOUSE_NAME = "logpm-warehouse" + DEVAUTH;
/**
* 仓库服务名称
*/
String APPLICATION_WEBSTOCKET_NAME = "logpm-webstocket"+DEVAUTH;
String APPLICATION_WEBSTOCKET_NAME = "logpm-webstocket" + DEVAUTH;
/**
* 配送签收服务名称
*/
String APPLICATION_DISTRIBUTION_NAME = "logpm-distribution"+DEVAUTH;
String APPLICATION_DISTRIBUTION_NAME = "logpm-distribution" + DEVAUTH;
/**
* 网关
*/
String APPLICATION_GATEWAY_NAME = "blade-gateway"+DEVAUTH;
String APPLICATION_GATEWAY_NAME = "blade-gateway" + DEVAUTH;
/**
* 补丁服务名称
*/
String APPLICATION_PATCH_NAME = "logpm-patch"+DEVAUTH;
String APPLICATION_PATCH_NAME = "logpm-patch" + DEVAUTH;
/**
* 督察模块
*/
String APPLICATION_SUPERVISE_NAME = "logpm-supervise"+DEVAUTH;
String APPLICATION_SUPERVISE_NAME = "logpm-supervise" + DEVAUTH;
/**
* 报表模块

13
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataFactoryCategoryEntity.java

@ -40,12 +40,25 @@ public class BasicdataFactoryCategoryEntity extends TenantEntity {
private String reserve5;
@ApiModelProperty(value = "结算品类id")
private Long categoryId;
@ApiModelProperty(value = "结算品类名称")
private String category;
@ApiModelProperty(value = "一级品")
private String firsts;
@ApiModelProperty(value = "二级品")
private String seconds;
@ApiModelProperty(value = "三级品")
private String thirds;
@ApiModelProperty(value = "品牌名称")
private String brand;
@ApiModelProperty(value = "品牌id")
private Long brandId;

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

@ -61,8 +61,8 @@ public class WarehouseUpdownStockupAreaEntity extends TenantEntity {
/** 关联值 */
@ApiModelProperty(name = "关联值",notes = "")
private String associationValue ;
/** 关联类型;1.订单号 2运单号 3包件码 */
@ApiModelProperty(name = "关联类型",notes = "1.订单号 2运单号 3包件码 4库存品")
/** 1.包件 2库存品 3订单 4托盘 */
@ApiModelProperty(name = "关联类型",notes = "1.包件 2库存品 3订单 4托盘")
private String associationType ;
/** 货物名称 */
@ApiModelProperty(name = "货物名称",notes = "")

12
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownStockUpAreaClient.java

@ -46,4 +46,16 @@ public interface IWarehouseUpdownStockUpAreaClient {
@GetMapping(TOP+"/upStockUpShelf")
Boolean upStockUpShelf(@RequestParam String code,@RequestParam Long stockUpAllocationId,@RequestParam Long warehouseId,@RequestParam Integer type,@RequestParam Integer num);
/**
* 备货库位下架接口
* @param code
* @param warehouseId
* @param type
* @param num
* @return
*/
@GetMapping(TOP+"/downStockUpShelf")
Boolean downStockUpShelf(@RequestParam String code,@RequestParam Long warehouseId,@RequestParam Integer type,@RequestParam Integer num);
}

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

@ -177,7 +177,7 @@ public class BasicdataCategoryController extends BladeController {
ExcelUtil.export(response, "品类数据" + DateUtil.time(), "品类数据表", list, BasicdataCategoryExcel.class);
}
/**
* 导出数据
* 下载模板
*/
@GetMapping("/downTemplate")
@ApiOperationSupport(order = 9)

87
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFactoryCategoryController.java

@ -4,6 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.dto.BasicdataFactoryCategoryDTO;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.excel.BasicdataCategoryExcel;
import com.logpm.basicdata.excel.BasicdataCategoryImporter;
import com.logpm.basicdata.excel.BasicdataFactoryCategoryExcel;
import com.logpm.basicdata.excel.BasicdataFactoryCategoryImporter;
import com.logpm.basicdata.service.IBasicdataBrandService;
import com.logpm.basicdata.service.IBasicdataCategoryService;
import com.logpm.basicdata.service.IBasicdataFactoryCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -11,8 +17,15 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@RestController
@ -22,8 +35,8 @@ import org.springframework.web.bind.annotation.*;
public class BasicdataFactoryCategoryController extends BladeController {
private final IBasicdataFactoryCategoryService basicdataFactoryCategoryService;
private final IBasicdataBrandService basicdataBrandService;
private final IBasicdataCategoryService basicdataCategoryService;
@ResponseBody
@PostMapping("/pageList")
@ -31,17 +44,17 @@ public class BasicdataFactoryCategoryController extends BladeController {
@ApiOperation(value = "工厂物料列表", notes = "传入basicdataFactoryCategoryDTO")
public R pageList(@RequestBody BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO) {
String method = "############pageList: ";
log.info(method+"请求参数{}",basicdataFactoryCategoryDTO);
try{
log.info(method + "请求参数{}", basicdataFactoryCategoryDTO);
try {
IPage<BasicdataFactoryCategoryEntity> pages = basicdataFactoryCategoryService.pageList(basicdataFactoryCategoryDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,method+"系统异常");
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, method + "系统异常");
}
}
@ -52,15 +65,15 @@ public class BasicdataFactoryCategoryController extends BladeController {
@ApiOperation(value = "新增工厂物料", notes = "传入basicdataFactoryCategoryDTO")
public R save(@RequestBody BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO) {
String method = "############save: ";
log.info(method+"请求参数{}",basicdataFactoryCategoryDTO);
try{
log.info(method + "请求参数{}", basicdataFactoryCategoryDTO);
try {
return basicdataFactoryCategoryService.saveEntity(basicdataFactoryCategoryDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,method+"系统异常");
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, method + "系统异常");
}
}
@ -70,20 +83,42 @@ public class BasicdataFactoryCategoryController extends BladeController {
@ApiOperation(value = "移除工厂物料", notes = "传入basicdataFactoryCategoryDTO")
public R remove(@RequestBody BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO) {
String method = "############remove: ";
log.info(method+"请求参数{}",basicdataFactoryCategoryDTO);
log.info(method + "请求参数{}", basicdataFactoryCategoryDTO);
Long factoryCategoryId = basicdataFactoryCategoryDTO.getFactoryCategoryId();
try{
try {
return R.status(basicdataFactoryCategoryService.removeById(factoryCategoryId));
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,method+"系统异常");
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, method + "系统异常");
}
}
/**
* 下载模板
*/
@GetMapping("/downTemplate")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "下载导出模板", notes = "下载导出模板")
public void downTemplate(HttpServletResponse response) {
List<BasicdataFactoryCategoryExcel> list = new ArrayList<>();
ExcelUtil.export(response, "工厂品类数据" + DateUtil.time(), "工厂品类数据", list, BasicdataFactoryCategoryExcel.class);
}
@PostMapping("/import")
@ApiOperationSupport(order = 12)
@ApiOperation(value = "导入品类", notes = "传入excel")
public R importCategory(MultipartFile file) {
BasicdataFactoryCategoryImporter basicdataFactoryCategoryImporter = new BasicdataFactoryCategoryImporter(basicdataFactoryCategoryService,basicdataBrandService,basicdataCategoryService);
ExcelUtil.save(file, basicdataFactoryCategoryImporter, BasicdataFactoryCategoryExcel.class);
return R.success("操作成功");
}
}

19
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsShelfController.java

@ -245,16 +245,15 @@ public class BasicdataGoodsShelfController extends BladeController {
ExcelUtil.export(response, "货架数据" + DateUtil.time(), "货架数据表", list, BasicdataGoodsShelfExcel.class);
}
/**
* 导入货架前置条件
*/
@GetMapping("/preImport")
@ApiOperationSupport(order = 12)
@ApiOperation(value = "导入货架", notes = "传入ids")
public R preImport(Long ids) {
basicdataGoodsShelfService.saveIds(ids);
return R.success("操作成功");
}
// /**
// * 导入货架前置条件
// */
// @GetMapping("/preImport")
// @ApiOperationSupport(order = 12)
// @ApiOperation(value = "导入货架", notes = "传入ids")
// public R preImport(Long ids) {
// return R.success("操作成功");
// }
/**
* 导入货架

26
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java

@ -23,6 +23,8 @@ import com.logpm.basicdata.vo.BasicdataPriceBasicUpdateVO;
import com.logpm.basicdata.vo.BasicdataPricePageVO;
import com.logpm.basicdata.vo.PriceVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
@ -32,12 +34,16 @@ import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.io.InputStream;
/**
* 基础价格表 控制器
@ -90,12 +96,30 @@ public class BasicdataPriceController extends BladeController {
* 基础价格表 修改
*/
@PutMapping
@ApiOperationSupport(order = 3)
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入basicdataPrice")
public R<Boolean> update(@Valid @RequestBody PriceVO vo) {
Boolean res = basicdataPriceService.updatePrice(vo);
return R.status(res);
}
/**
* 基础价格表 导入
*/
@PostMapping("upload")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "导入", notes = "导入")
@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "文件", dataType = "MultipartFile")
})
public R<String> upload(@RequestPart("file") MultipartFile file) {
try (InputStream inputStream = file.getInputStream()) {
String res = basicdataPriceService.upload(inputStream);
return R.data(res);
} catch (Exception e) {
e.printStackTrace();
}
return R.data("上传失败");
}
}

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

@ -11,8 +11,8 @@ import org.springblade.common.model.IDict;
public enum FullVehicleTypeEnums implements IDict<Integer> {
PICK_UP(1, "提货整车"),
TRUNK_LINE(2, "配送干线整车"),
DISPATCH(4, "整车"),
TRUNK_LINE(2, "干线整车"),
DISPATCH(4, "配送整车"),
;
FullVehicleTypeEnums(Integer code, String text) {

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

@ -29,8 +29,8 @@ import java.io.Serializable;
/**
* 品类 Excel实体类
*
* @author cyz
* @since 2023-06-02
* @author chao
* @since 2024-04-19
*/
@Data
@ColumnWidth(25)

65
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryExcel.java

@ -0,0 +1,65 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.excel;
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;
/**
* 工厂品类导入
*
* @author chao
* @date 2024/04/19
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class BasicdataFactoryCategoryExcel implements Serializable {
private static final long serialVersionUID = 1L;
@ColumnWidth(20)
@ExcelProperty("品牌")
private String brand;
@ColumnWidth(20)
@ExcelProperty("结算品类")
private String category;
@ColumnWidth(20)
@ExcelProperty("一级品")
private String firsts;
@ColumnWidth(20)
@ExcelProperty("二级品")
private String seconds;
@ColumnWidth(20)
@ExcelProperty("三级品")
private String thirds;
}

160
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryImporter.java

@ -0,0 +1,160 @@
package com.logpm.basicdata.excel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.logpm.basicdata.entity.BasicdataBrandEntity;
import com.logpm.basicdata.entity.BasicdataCategoryEntity;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.service.IBasicdataBrandService;
import com.logpm.basicdata.service.IBasicdataCategoryService;
import com.logpm.basicdata.service.IBasicdataFactoryCategoryService;
import lombok.AllArgsConstructor;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
@AllArgsConstructor
public class BasicdataFactoryCategoryImporter implements ExcelImporter<BasicdataFactoryCategoryExcel> {
private final IBasicdataFactoryCategoryService basicdataFactoryCategoryService;
private final IBasicdataBrandService basicdataBrandService;
private final IBasicdataCategoryService basicdataCategoryService;
@Transactional(rollbackFor = RuntimeException.class)
@Override
public void save(List<BasicdataFactoryCategoryExcel> data) {
LambdaQueryWrapper<BasicdataBrandEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BasicdataBrandEntity::getIsDeleted, 0);
List<BasicdataBrandEntity> list = basicdataBrandService.list(queryWrapper);
LambdaQueryWrapper<BasicdataCategoryEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(BasicdataCategoryEntity::getIsDeleted, 0);
List<BasicdataCategoryEntity> basicdataCategoryEntities = basicdataCategoryService.list(lambdaQueryWrapper);
LambdaQueryWrapper<BasicdataFactoryCategoryEntity> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
lambdaQueryWrapper1.eq(BasicdataFactoryCategoryEntity::getIsDeleted, 0);
List<BasicdataFactoryCategoryEntity> allBasicdataFactoryCategoryEntities = basicdataFactoryCategoryService.list(lambdaQueryWrapper1);
//todo 这里的优化 是最好能进行品牌分组 获取对应的品牌数据 来进行匹配 这样可以减少循环次数
List<BasicdataFactoryCategoryEntity> basicdataFactoryCategoryEntities = new ArrayList<>();
for (BasicdataFactoryCategoryExcel datum : data) {
boolean isBrandFound = list.stream()
.anyMatch(entity -> entity.getBrandName().equals(datum.getBrand()));
// 根据 isBrandFound 的值进行相应的处理
if (!isBrandFound) {
// 或者执行其他逻辑,如记录到日志、抛出异常等
throw new ServiceException(datum.getBrand() + "品牌在系统中不存在!");
}
isBrandFound = basicdataCategoryEntities.stream().anyMatch(entity -> entity.getName().equals(datum.getCategory()));
if (!isBrandFound) {
// 或者执行其他逻辑,如记录到日志、抛出异常等
throw new ServiceException(datum.getCategory() + "结算品类在系统中不存在!");
}
// 需要判断目前增加的三方物料在系统中是否已经存在
checkAllBasicdataFactoryCategoryEntities(allBasicdataFactoryCategoryEntities, datum);
BasicdataFactoryCategoryEntity basicdataFactoryCategoryEntity = BeanUtil.copy(datum, BasicdataFactoryCategoryEntity.class);
if (ObjectUtil.isNotEmpty(basicdataFactoryCategoryEntity)) {
assert basicdataFactoryCategoryEntity != null;
basicdataFactoryCategoryEntity.setBrandId(list.stream().filter(entity -> entity.getBrandName().equals(basicdataFactoryCategoryEntity.getBrand())).findFirst().get().getId());
basicdataFactoryCategoryEntity.setCategoryId(basicdataCategoryEntities.stream().filter(entity -> entity.getName().equals(basicdataFactoryCategoryEntity.getCategory())).findFirst().get().getId());
}
basicdataFactoryCategoryEntities.add(basicdataFactoryCategoryEntity);
}
basicdataFactoryCategoryService.saveBatch(basicdataFactoryCategoryEntities);
}
/**
* 验证三方物料是否已经存在
*
* @param allBasicdataFactoryCategoryEntities
* @param datum
*/
private void checkAllBasicdataFactoryCategoryEntities(List<BasicdataFactoryCategoryEntity> allBasicdataFactoryCategoryEntities, BasicdataFactoryCategoryExcel datum) {
for (BasicdataFactoryCategoryEntity allBasicdataFactoryCategoryEntity : allBasicdataFactoryCategoryEntities) {
String equalString = buildEqualString(allBasicdataFactoryCategoryEntity);
String equalString2 = buildEqualString2(datum);
if (equalString2.equals(equalString)) {
throw new ServiceException("品牌:" + datum.getBrand() + " 品类:" + datum.getCategory() + "已存在相同的配置内容");
}
}
}
/**
* 构建字符串
*
* @param allBasicdataFactoryCategoryEntity
* @return
*/
private String buildEqualString(BasicdataFactoryCategoryEntity allBasicdataFactoryCategoryEntity) {
StringBuilder stringBuffer = new StringBuilder();
stringBuffer.append(allBasicdataFactoryCategoryEntity.getBrand()).append(allBasicdataFactoryCategoryEntity.getCategory());
if (ObjectUtil.isNotEmpty(allBasicdataFactoryCategoryEntity.getFirsts())) {
stringBuffer.append(allBasicdataFactoryCategoryEntity.getFirsts());
} else {
stringBuffer.append("-");
}
if (ObjectUtil.isNotEmpty(allBasicdataFactoryCategoryEntity.getSeconds())) {
stringBuffer.append(allBasicdataFactoryCategoryEntity.getSeconds());
} else {
stringBuffer.append("-");
}
if (ObjectUtil.isNotEmpty(allBasicdataFactoryCategoryEntity.getThirds())) {
stringBuffer.append(allBasicdataFactoryCategoryEntity.getThirds());
} else {
stringBuffer.append("-");
}
return stringBuffer.toString();
}
/**
* 构建匹配字符串
* @param datum
* @return
*/
private String buildEqualString2(BasicdataFactoryCategoryExcel datum) {
StringBuilder stringBuffer = new StringBuilder();
stringBuffer.append(datum.getBrand()).append(datum.getCategory());
if (ObjectUtil.isNotEmpty(datum.getFirsts())) {
stringBuffer.append(datum.getFirsts());
} else {
stringBuffer.append("-");
}
if (ObjectUtil.isNotEmpty(datum.getSeconds())) {
stringBuffer.append(datum.getSeconds());
} else {
stringBuffer.append("-");
}
if (ObjectUtil.isNotEmpty(datum.getThirds())) {
stringBuffer.append(datum.getThirds());
} else {
stringBuffer.append("-");
}
return stringBuffer.toString();
}
}

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsShelfService.java

@ -137,8 +137,5 @@ public interface IBasicdataGoodsShelfService extends BaseService<BasicdataGoodsS
* 货架 导入
*/
void importGoodsShelf(List<BasicdataGoodsShelfExcel> data);
/**
* 货架 ids
*/
void saveIds(Long ids);
}

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceService.java

@ -26,7 +26,9 @@ import com.logpm.basicdata.vo.BasicdataPricePageVO;
import com.logpm.basicdata.vo.PriceClientVO;
import com.logpm.basicdata.vo.PriceVO;
import org.springblade.core.mp.base.BaseService;
import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.util.List;
/**
@ -68,4 +70,12 @@ public interface IBasicdataPriceService extends BaseService<BasicdataPriceEntity
* @return
*/
PriceClientVO price(BasicdatPriceApiVO param);
/**
* 导入价格
*
* @param file 需要上传的文件类型为MultipartFile
* @return 返回上传结果一般为上传成功或失败的信息
*/
String upload(InputStream file);
}

8
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java

@ -94,7 +94,6 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
private IBasicdataWarehouseService basicdataWarehouseService;
private Long ids;
@Override
@ -884,7 +883,6 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
List<BasicdataGoodsShelfEntity> basicdataGoodsShelfEntities = baseMapper.selectList(new QueryWrapper<BasicdataGoodsShelfEntity>().lambda()
.eq(BasicdataGoodsShelfEntity::getGoodsShelfName, datum.getGoodsShelfName())
.eq(BasicdataGoodsShelfEntity::getWarehouseId, myCurrentWarehouse.getId())
.eq(BasicdataGoodsShelfEntity::getGoodsAreaId, Long.valueOf(ids))
.eq(BasicdataGoodsShelfEntity::getIsDeleted, 0)
);
if (!basicdataGoodsShelfEntities.isEmpty()) {
@ -894,7 +892,6 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
log.info("复制后>>>>>>>>>>>>{}", copy);
assert copy != null;
copy.setWarehouseId(myCurrentWarehouse.getId());
copy.setGoodsAreaId(Long.valueOf(ids));
arrayList.add(copy);
}
// 根据对象的value属性进行去重
@ -902,10 +899,7 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
this.saveBatch(collect);
}
@Override
public void saveIds(Long ids) {
this.ids = ids;
}
// @NotNull
// static Integer getLayerNum(@NotNull List<BasicdataGoodsAllocationEntity> products, String ColumnNum) {

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceRouteServiceImpl.java

@ -147,7 +147,7 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl<BasicdataPri
// 最低计费
if (ObjectUtil.isNotEmpty(vo.getMinCost())) {
List<BasicdataPriceGeneralEntity> priceGeneralEntities = new ArrayList<>();
biuldGeneral(route.getId(), generalServiceTypeEnums.getCode(), vo.getMinCost(), vo.getAdditionalCost(), priceGeneralEntities);
biuldGeneral(route, generalServiceTypeEnums.getCode(), vo.getMinCost(), vo.getAdditionalCost(), priceGeneralEntities);
generalService.saveOrUpdateBatch(priceGeneralEntities);
}
return route.getId();
@ -263,16 +263,16 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl<BasicdataPri
}
}
private void biuldGeneral(Long priceId, Integer code, Double minCost, Double additionalCost, List<BasicdataPriceGeneralEntity> generalList) {
private void biuldGeneral(BasicdataPriceRouteEntity routeEntity, Integer code, Double minCost, Double additionalCost, List<BasicdataPriceGeneralEntity> generalList) {
// 1 最低计费一个价格体系一个服务类型只存在一条
BasicdataPriceGeneralEntity generalEntity = generalService.getOne(Wrappers.<BasicdataPriceGeneralEntity>lambdaQuery()
.eq(BasicdataPriceGeneralEntity::getBoId, priceId)
.eq(BasicdataPriceGeneralEntity::getBoId, routeEntity.getId())
.eq(BasicdataPriceGeneralEntity::getServiceType, code)
);
if (ObjectUtil.isEmpty(generalEntity)) {
generalEntity = new BasicdataPriceGeneralEntity();
generalEntity.setBoId(priceId);
generalEntity.setPriceId(priceId);
generalEntity.setBoId(routeEntity.getId());
generalEntity.setPriceId(routeEntity.getPriceId());
generalEntity.setServiceType(code);
}
// 设置最低计费和加算价格

38
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

@ -23,6 +23,8 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -76,7 +78,9 @@ import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
@ -307,8 +311,8 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
if (StrUtil.contains(serviceType, ServiceTypeEnums.PICK_UP.getCode().toString())) {
// 提货不按区域计费
Integer pickupIsUnifyAreaBill = templateEntity.getPickupIsUnifyAreaBill();
if (ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode())) {
priceClientVO.setPickup(initPickUp(priceEntity, templateEntity, fullMap.get(1), basicMap.get(1), generalMap.get(1)));
if (ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.YES.getCode())) {
priceClientVO.setPickup(initPickUp(priceEntity, templateEntity, fullMap.get(FullVehicleTypeEnums.PICK_UP.getCode()), basicMap.get(ServiceTypeEnums.PICK_UP.getCode()), generalMap.get(GeneralServiceTypeEnums.PICK_UP.getCode())));
} else {
// 按区域计费,查询路径,返回价格
List<BasicdataPriceRouteEntity> routeEntities = basicdataPriceRouteService.list(Wrappers.<BasicdataPriceRouteEntity>lambdaQuery()
@ -336,7 +340,8 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
Integer trunklineIsUnifyAreaBill = templateEntity.getTrunklineIsUnifyAreaBill();
// 干线不按区域计费
if (ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode())) {
priceClientVO.setTrunkLine(initTrunkLine(priceEntity, templateEntity, fullMap.get(2), basicMap.get(3), generalMap.get(3)));
priceClientVO.setTrunkLine(initTrunkLine(priceEntity, templateEntity, fullMap.get(FullVehicleTypeEnums.TRUNK_LINE.getCode()),
basicMap.get(ServiceTypeEnums.TRUNK_LINE.getCode()), generalMap.get(GeneralServiceTypeEnums.TRUNK_LINE.getCode())));
} else {
// 按区域计费,查询路径,返回价格
List<BasicdataPriceRouteEntity> routeEntities = basicdataPriceRouteService.list(Wrappers.<BasicdataPriceRouteEntity>lambdaQuery()
@ -365,12 +370,27 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
}
// 配送费
if (StrUtil.contains(serviceType, ServiceTypeEnums.DISPATCH.getCode().toString())) {
priceClientVO.setDispatch(initDispatch(priceEntity, templateEntity, fullMap.get(3), dispatchMap, generalMap.get(5), generalMap.get(6)));
priceClientVO.setDispatch(initDispatch(priceEntity, templateEntity, fullMap.get(FullVehicleTypeEnums.DISPATCH.getCode()),
dispatchMap, generalMap.get(GeneralServiceTypeEnums.DISPATCH.getCode()), generalMap.get(GeneralServiceTypeEnums.DISPATCH_LEAVE_BEHIND.getCode())));
}
priceClientVO.setTemplate(templateEntity);
return priceClientVO;
}
@Override
public String upload(InputStream file) {
StringBuilder message = new StringBuilder();
ExcelReader build = null;
try {
build = EasyExcel.read(file).build();
// 从build中获取5个sheet的数据
}catch (Exception e){
}
return null;
}
private void buildDetailMap(BasicdataPriceEntity priceEntity, Map<Integer, List<BasicdataPriceFullVehicleEntity>> fullMap, Map<Integer, List<BasicdataPriceCategoryBasicEntity>> basicMap, Map<Integer, List<BasicdataPriceCategoryWarehouseEntity>> warehouseMap, Map<Integer, List<BasicdataPriceCategoryDispatchEntity>> dispatchMap, Map<Integer, List<BasicdataPriceGeneralEntity>> generalMap) {
// 获取整车数据
List<BasicdataPriceFullVehicleEntity> list = fullVehicleService.list(Wrappers.<BasicdataPriceFullVehicleEntity>lambdaQuery()
@ -455,7 +475,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
String dispatchPricingType = templateEntity.getDispatchPricingType();
//品类
Map<Integer, List<BasicdataPriceCategoryDispatchEntity>> categoryBasicMap = new HashMap<>();
List<BasicdataPriceCategoryDispatchEntity> dispatchEntities = dispatchMap.get(1);
List<BasicdataPriceCategoryDispatchEntity> dispatchEntities = dispatchMap.get(CostTypeEnums.NOMAL.getCode());
if (CollUtil.isNotEmpty(dispatchEntities)) {
// 将数据放到categoryBasicMap中
dispatchEntities.forEach(item -> {
@ -560,7 +580,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
priceDispatchVO.setTonKilometerCost(basicVOList);
}
//附加费
List<BasicdataPriceCategoryDispatchEntity> dispatchEntities1 = dispatchMap.get(2);
List<BasicdataPriceCategoryDispatchEntity> dispatchEntities1 = dispatchMap.get(CostTypeEnums.ADD.getCode());
if (CollUtil.isNotEmpty(dispatchEntities1)) {
List<PriceDispatchAdditionalVO> basicVOList = new ArrayList<>();
dispatchEntities1.forEach(item -> {
@ -592,7 +612,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
PriceWarehouseVO priceWarehouseVO = new PriceWarehouseVO();
Integer warehousePricingType = templateEntity.getWarehousePricingType();
Map<Integer, List<BasicdataPriceCategoryWarehouseEntity>> categoryBasicMap = new HashMap<>();
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities = warehouseMap.get(1);
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities = warehouseMap.get(CostTypeEnums.NOMAL.getCode());
if (CollUtil.isNotEmpty(warehouseEntities)) {
warehouseEntities.forEach(item -> {
Integer type = item.getType();
@ -647,7 +667,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
}
}
// 附加费
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities1 = warehouseMap.get(2);
List<BasicdataPriceCategoryWarehouseEntity> warehouseEntities1 = warehouseMap.get(CostTypeEnums.ADD.getCode());
if (CollUtil.isNotEmpty(warehouseEntities1)) {
List<PriceWarehouseAdditionalVO> additionalVOS = warehouseEntities1.stream().map(item -> {
PriceWarehouseAdditionalVO additionalVO = new PriceWarehouseAdditionalVO();
@ -735,7 +755,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
// fullVehicleEntities转为BasicdataPriceFullVehicleVO
String pickupPricingType = templateEntity.getPickupPricingType();
if (pickupPricingType.contains(PickupPricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) {
if(CollUtil.isNotEmpty(fullVehicleEntities)){
if (CollUtil.isNotEmpty(fullVehicleEntities)) {
List<BasicdataPriceFullVehicleVO> fullVehicleVOS = fullVehicleEntities.stream().map(item -> {
BasicdataPriceFullVehicleVO basicdataPriceFullVehicleVO = new BasicdataPriceFullVehicleVO();
BeanUtil.copyProperties(item, basicdataPriceFullVehicleVO);

3
blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapeer.java

@ -3,6 +3,7 @@ package com.logpm.datasharing.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.datasharing.dto.MerchantOrderDTO;
import com.logpm.datasharing.vo.MerchantPackageVO;
import com.logpm.datasharing.vo.MerchantZeroDispatchVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -41,4 +42,6 @@ public interface MerchantMapeer extends BaseMapper {
*/
List<MerchantPackageVO> findPackage(@Param("contractNumber") String contractNumber);
List<MerchantZeroDispatchVO> findZeroPackage(@Param("contractNumber") String contractNumber);
}

25
blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml

@ -54,5 +54,30 @@
group by lddl.id order by null) driver on driver.id = lddl.id
where t.order_code = #{contractNumber}
</select>
<select id="findZeroPackage" resultType="com.logpm.datasharing.vo.MerchantZeroDispatchVO">
select lww.shipper_address,
t.waybill_number,
lds.received_quantity,
ifnull(driver.lname, driver.ltname) distributionName,
ifnull(driver.lphone, driver.ltphone) distributionPhone
from logpm_distribution_stock_article t
left join logpm_distribution_reservation_stockarticle ldrs
on ldrs.stock_article_id = t.id and ldrs.stock_article_status != 2
left join logpm_distribution_reservation ldr
on ldr.id = ldrs.reservation_id and ldr.reservation_status != 40
left join logpm_warehouse_waybill lww on lww.waybill_no = t.waybill_number
left join logpm_distribution_signfor lds on lds.reservation_id = ldr.id
left join logpm_distribution_delivery_list lddl on lddl.id = lds.delivery_id
left join (select lddl.id,
group_concat(ldd.driver_name) lname,
group_concat(lddt.driver_name) ltname,
group_concat(ldd.driver_phone) lphone,
group_concat(lddt.driver_phone) ltphone
from logpm_distribution_delivery_list lddl
left join logpm_distribution_delivery_self ldd on ldd.delivery_id = lddl.id
left join logpm_distribution_delivery_tripartite lddt on lddt.delivery_id = lddl.id
group by lddl.id) driver on driver.id = lddl.id
where t.order_code = #{contractNumber}
</select>
</mapper>

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleStatisticsController.java

@ -0,0 +1,26 @@
package com.logpm.distribution.controller;
import com.logpm.distribution.dto.DistributionStockArticleOweDTO;
import com.logpm.distribution.dto.DistributionStockArticleStatisticsDTO;
import com.logpm.distribution.service.IDistributionStockArticleStatisticsService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
@RestController
@AllArgsConstructor
@Api(value = "配送在库订单统计", tags = "配送在库订单统计")
@RequestMapping(value = "/distributionStockArticleStatistics")
public class DistributionStockArticleStatisticsController extends BladeController {
private IDistributionStockArticleStatisticsService distributionStockArticleStatisticsService;
@GetMapping(value = "/collect")
public R<DistributionStockArticleStatisticsDTO> collect(DistributionStockArticleOweDTO distributionStockArticleOweDTO) {
DistributionStockArticleStatisticsDTO collect = distributionStockArticleStatisticsService.collect(distributionStockArticleOweDTO);
return R.data(collect);
}
}

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockArticleStatisticsDTO.java

@ -0,0 +1,26 @@
package com.logpm.distribution.dto;
import lombok.Data;
/**
* 在库订单统计数据
*/
@Data
public class DistributionStockArticleStatisticsDTO {
/**
* 订单总数
*/
private Long orderNum;
/**
* 运单总数
*/
private Long waybillNum;
/**
* 包件总数
*/
private Long packageCodeNum;
}

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -1221,9 +1221,12 @@
<select id="getCategoryByStockArticleIdAndReservationId" resultType="java.util.Map">
select IFNULL(ldpl.third_product,'其他') thirdProduct,
IFNULL(count( ldl.id ) ,0) AS aaa,
count(ldpl.id) num
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
LEFT JOIN logpm_distribution_loadscan AS ldl ON ldpl.id = ldl.package_id AND ldrp.reservation_id = ldl.reservation_id AND ldl.is_deleted = 0 AND ldl.scan_status != 1
where 1=1
and ldrp.reservation_id = #{reservationId}
and ldrp.stock_article_id = #{stockArticleId}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -841,12 +841,12 @@
group_concat(DISTINCT lwt.pallet_name) as trays,
group_concat(DISTINCT lwug.position_code) as allocation
from logpm_platform.logpm_distribution_stock_article ldsa
left join logpm_platform.logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id and ldpl.tenant_id = '627683'
left join logpm_platform.logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id
left join logpm_platform.logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
left join logpm_platform.logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
left JOIN logpm_warehouse_tray lwt on lwtg.tray_id= lwt.id
<where>
ldsa.is_deleted = 0 and ldsa.order_status != '80'
ldsa.is_deleted = 0 and ldsa.order_status IN ( 10, 20, 30, 40, 50, 60, 70 )
<if test="paramMap.warehouseId != null and paramMap.warehouseId != ''">
and ldsa.warehouse_id = #{paramMap.warehouseId}
</if>
@ -859,9 +859,7 @@
<if test="paramMap.trainNumber != null and paramMap.trainNumber != ''"> and ldsa.train_number = #{paramMap.trainNumber} </if>
<if test="paramMap.acceptWarehouseName != null and paramMap.acceptWarehouseName != ''"> and ldsa.accept_warehouse_name = #{paramMap.acceptWarehouseName} </if>
<if test="paramMap.tenantId != null and paramMap.tenantId != ''">
and ldsa.tenant_id = #{paramMap.tenantId}
</if>
<if test="paramMap.serviceNumber != null and paramMap.serviceNumber != ''">
and ldsa.servic_nNumber = #{paramMap.serviceNumber}
</if>

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleStatisticsMapper.java

@ -0,0 +1,13 @@
package com.logpm.distribution.mapper;
import com.logpm.distribution.dto.DistributionStockArticleOweDTO;
import com.logpm.distribution.dto.DistributionStockArticleStatisticsDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface DistributionStockArticleStatisticsMapper {
DistributionStockArticleStatisticsDTO collect(@Param("param") DistributionStockArticleOweDTO distributionStockArticleOweDTO);
}

128
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleStatisticsMapper.xml

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.distribution.mapper.DistributionStockArticleStatisticsMapper">
<select id="collect" resultType="com.logpm.distribution.dto.DistributionStockArticleStatisticsDTO">
select
count(distinct ldsa.waybill_id) waybillNum,
count(distinct ldsa.order_code) orderNum,
count(distinct ldpl.id) packageCodeNum
from logpm_distribution_stock_article ldsa
LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
WHERE
ldsa.is_deleted = 0
and ldsa.order_status in (10,20,30,40,50,60,70)
and ldsa.hand_quantity > 0
<if test="param.orderCodeNumList != null">
and ldsa.order_code in
<foreach collection="param.orderCodeNumList" separator="," close=")" item="a" open="(">
#{a}
</foreach>
</if>
<if test=" param.orderCodeNumLike != '' and param.orderCodeNumLike != null ">and ldsa.order_code like
concat('%',#{param.orderCodeNumLike},'%')
</if>
<if test=" param.reservation != '' and param.reservation != null ">
and ldsa.reservation_status in (10,20) and ldpl.order_package_reservation_status = 10
</if>
<if test=" param.waybillNumList != null ">
and ldpl.waybill_number in
<foreach collection="param.waybillNumList" open="(" item="a" close=")" separator=",">
#{a}
</foreach>
</if>
<if test="param.consigneeUnit != null and param.consigneeUnit != '' ">
and ldsa.consignee_unit like concat('%',#{param.consigneeUnit},'%')
</if>
<if test=" param.waybillNumLike != '' and param.waybillNumLike != null ">and ldsa.waybill_number like
concat('%',#{param.waybillNumLike},'%')
</if>
<if test=" param.typeService != '' and param.typeService != null ">
and ldsa.type_service = #{param.typeService}
</if>
<if test=" param.warehouseIdList != null ">and ldsa.warehouse_id in
<foreach collection="param.warehouseIdList" open="(" item="a" close=")" separator=",">
#{a}
</foreach>
</if>
<if test=" param.warehouseId != '' and param.warehouseId != null ">and ldsa.warehouse_id =
#{param.warehouseId}
</if>
<if test=" param.idsList != null ">and ldsa.id in
<foreach collection="param.idsList" open="(" item="a" close=")" separator=",">
#{a}
</foreach>
</if>
<if test=" param.idsLike != '' and param.idsLike != null ">and ldsa.id = #{param.idsLike}</if>
<if test=" param.reservationStatus != '' and param.reservationStatus != null ">and ldsa.reservation_status
= #{param.reservationStatus}
</if>
<if test=" param.startDate != null ">and ldsa.warehouse_entry_time between #{param.startDate} and
#{param.entDate}
</if>
<if test=" param.warehouseEntryTime != null ">and DATE(ldsa.warehouse_entry_time) =
#{param.warehouseEntryTime}
</if>
<if test=" param.warehouseEntryTimeEnd != null ">and DATE(ldsa.warehouse_entry_time) =
#{param.warehouseEntryTimeEnd}
</if>
<if test=" param.inventoryDate != null ">and DATE(ldsa.inventory_date) = #{param.inventoryDate}</if>
<if test=" param.serviceNumber != null and param.serviceNumber != '' ">and ldsa.service_number like
concat('%',#{param.serviceNumber},'%')
</if>
<if test=" param.orderCode != null and param.orderCode != '' ">and ldsa.order_code like
concat('%',#{param.orderCode},'%')
</if>
<if test=" param.waybillNumber != null and param.waybillNumber != '' ">and ldpl.waybill_number like
concat('%',#{param.waybillNumber},'%')
</if>
<if test=" param.mallName != null and param.mallName != '' ">and ldsa.mall_name like
concat('%',#{param.mallName},'%')
</if>
<if test=" param.descriptionGoods != null and param.descriptionGoods != '' ">and ldsa.description_goods
like concat('%',#{param.descriptionGoods},'%')
</if>
<if test=" param.warehouse != null and param.warehouse != '' ">and ldsa.warehouse like
concat('%',#{param.warehouse},'%')
</if>
<if test=" param.consigneePerson != null and param.consigneePerson != '' ">and ldsa.consignee_person like
concat('%',#{param.consigneePerson},'%')
</if>
<if test=" param.availableQuantity != null ">and ldsa.available_quantity like
concat('%',#{param.availableQuantity},'%')
</if>
<if test=" param.groundingStatus != null and param.groundingStatus != '' ">and ldsa.grounding_status = #{param.groundingStatus}</if>
<if test=" param.genre != null and param.groundingStatus != '' ">and ldsa.genre = #{param.genre}</if>
<if test=" param.freezeStatus != null and param.groundingStatus != '' ">and ldsa.freeze_status = #{param.freezeStatus}</if>
<if test=" param.orderStatus != null and param.groundingStatus != '' ">and ldsa.order_status = #{param.orderStatus}</if>
<if test=" param.reservationStatus != null and param.groundingStatus != '' ">and ldsa.reservation_status = #{param.reservationStatus}</if>
<if test=" param.stockupStatus != null and param.groundingStatus != '' ">and ldsa.stockup_status = #{param.stockupStatus}</if>
<if test=" param.notification != null and param.notification != '' ">and ldsa.notification = #{param.notification}</if>
<if test=" param.orderReceiveStatus != null and param.groundingStatus != '' ">and ldsa.order_receive_status =
#{param.orderReceiveStatus}
</if>
<if test=" param.completeSet != null ">and ldsa.complete_set like concat('%',#{param.completeSet},'%')
</if>
<if test=" param.typeService != null and param.groundingStatus != '' ">and ldsa.type_service like concat('%',#{param.typeService},'%')
</if>
<if test=" param.customerName != null and param.customerName != '' ">and ldsa.customer_name like
concat('%',#{param.customerName},'%')
</if>
<if test="param.isZero != null and param.isZero != '' ">
and ldsa.is_zero = #{param.isZero}
</if>
<if test=" param.customerTelephone != null and param.customerTelephone != '' ">and
ldsa.customer_telephone like concat('%',#{param.customerTelephone},'%')
</if>
<if test=" param.customerAddress != null and param.customerAddress != '' ">and ldsa.customer_address like
concat('%',#{param.customerAddress},'%')
</if>
<if test=" param.trays != null and param.trays != '' ">and lwtg.tray_code like
concat('%',#{param.trays},'%')
</if>
<if test=" param.allocation != null and param.allocation != '' ">and lwug.position_code like
concat('%',#{param.allocation},'%')
</if>
</select>
</mapper>

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleStatisticsService.java

@ -0,0 +1,8 @@
package com.logpm.distribution.service;
import com.logpm.distribution.dto.DistributionStockArticleOweDTO;
import com.logpm.distribution.dto.DistributionStockArticleStatisticsDTO;
public interface IDistributionStockArticleStatisticsService {
DistributionStockArticleStatisticsDTO collect(DistributionStockArticleOweDTO distributionStockArticleOweDTO);
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -6577,17 +6577,22 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
for (Map<String, Object> m : mapList) {
String thirdProduct = (String) m.get("thirdProduct");
Long num = (Long) m.get("num");
Long signNum = (Long) m.get("aaa");
if (thirdProduct.equals(key)) {
numObj.put(key, num);
tn = tn + num.intValue();
}
orderMap.put("签收件数", signNum);
}
}
}
orderMap.put("合计数量", tn);
orderMap.put("产品明细", numObj);
orderMap.put("产品明细长度", numObj.size());
//通过订单id和预约id查询对应包件的物料信息
List<String> materialNameStrList = distributionReservationMapper.getMaterialNameByStockArticleIdAndReservationId(stockArticleId, reservationId);
String materialNameStr = StringUtils.join(materialNameStrList, ",");

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -2816,6 +2816,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (parcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
return Resp.scanFail("操作失败", "该包件已签收");
}
//确认该包件确实不属于该配送任务
List<DistributionParcelListEntity> parcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
boolean flag = parcelListEntities.stream().anyMatch(p -> p.getOrderPackageStatus().equals(distrilbutionloadingscanDTO.getBarcode()));
@ -2840,11 +2841,23 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//查询装车扫描表
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
// .eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
DistributionLoadscanEntity loadscanEntity = null;
if (loadscanEntityList.isEmpty()){
if (loadscanEntityList.size() > 1){
log.error("##############异常签收包件在其他车次进行装车reservationId:{}", loadscanEntityList.stream().map(DistributionLoadscanEntity::getReservationId).map(String::valueOf).collect(Collectors.joining(",")));
return Resp.scanFail("操作失败", "包件已出库");
}
if (loadscanEntityList.size() == 1){
loadscanEntity = loadscanEntityList.get(0);
}
}
if (Func.isNotEmpty(loadscanEntity)) {
if (loadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
return Resp.scanFail("重复操作!!", "重复操作");

76
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleStatisticsServiceImpl.java

@ -0,0 +1,76 @@
package com.logpm.distribution.service.impl;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.DistributionStockArticleOweDTO;
import com.logpm.distribution.dto.DistributionStockArticleStatisticsDTO;
import com.logpm.distribution.mapper.DistributionStockArticleStatisticsMapper;
import com.logpm.distribution.service.IDistributionStockArticleStatisticsService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 在库订单的统计
*/
@Service
@AllArgsConstructor
@Slf4j
public class DistributionStockArticleStatisticsServiceImpl implements IDistributionStockArticleStatisticsService {
private final DistributionStockArticleStatisticsMapper distributionStockArticleStatisticsMapper;
private final IBasicdataWarehouseClient warehouseClient;
@Override
public DistributionStockArticleStatisticsDTO collect(DistributionStockArticleOweDTO distributionStockArticleOweDTO) {
if (distributionStockArticleOweDTO == null) {
distributionStockArticleOweDTO = new DistributionStockArticleOweDTO();
}
if (Func.isNotEmpty(distributionStockArticleOweDTO.getOrderCodeNum())) {
String anumbering = distributionStockArticleOweDTO.getOrderCodeNum().trim();
List<String> list = CommonUtil.stringNum(anumbering);
if (list.size() > 1) {
distributionStockArticleOweDTO.setOrderCodeNumList(list);
} else {
distributionStockArticleOweDTO.setOrderCodeNumLike(anumbering);
}
}
if (Func.isNotEmpty(distributionStockArticleOweDTO.getWaybillNum())) {
String waybill = distributionStockArticleOweDTO.getWaybillNum().trim();
List<String> list = CommonUtil.stringNum(waybill);
if (list.size() > 1) {
distributionStockArticleOweDTO.setWaybillNumList(list);
} else {
distributionStockArticleOweDTO.setWaybillNumLike(waybill);
}
}
if (ObjectUtil.isNotEmpty(distributionStockArticleOweDTO.getIds())) {
String ids = distributionStockArticleOweDTO.getIds().trim();
List<String> list = CommonUtil.stringNum(ids);
if (list.size() > 1) {
distributionStockArticleOweDTO.setIdsList(list);
} else {
distributionStockArticleOweDTO.setIdsLike(ids);
}
}
List<BasicdataWarehouseEntity> myWarehouseList = warehouseClient.getMyWatchWarehouse();
List<Long> collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
if (collect.size() > 1) {
distributionStockArticleOweDTO.setWarehouseIdList(collect);
} else if (collect.size() == 1) {
distributionStockArticleOweDTO.setWarehouseId(collect.get(0));
}
return distributionStockArticleStatisticsMapper.collect(distributionStockArticleOweDTO);
}
}

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

@ -2720,7 +2720,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
handQuantity = handQuantity - sum;
for (WarehouseUpdownGoodsEntity updownGoodsEntity : locationStockListInformation) {
Map<String,Object> map = new HashMap<>();
map.put("allocation",updownGoodsEntity.getPositionCode());
map.put("allocationName",updownGoodsEntity.getPositionCode());
map.put("allocationid",updownGoodsEntity.getAllocationId());
map.put("num",updownGoodsEntity.getNum());
allocationMapList.add(map);
}
@ -2744,6 +2745,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
BasicdataTrayEntity trayByTrayCode = basicdataTrayClient.getTrayByTrayCode(next.getTrayCode());
Map<String,Object> map = new HashMap<>();
map.put("trayCode",next.getTrayCode());
map.put("trayId",next.getTrayId());
map.put("trayName",trayByTrayCode.getPalletName());
map.put("num",next.getNum());
trayMapList.add(map);

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java

@ -36,6 +36,7 @@ import com.logpm.distribution.vo.*;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
@ -47,6 +48,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 提货单订单信息关联 服务实现类
@ -110,7 +112,6 @@ public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl<Distrilbu
i.setStockupCreateUser(userR.getData().getRealName());
}
}
});
return billOrderPack;
}

11
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/NodeNeedEnums.java

@ -13,11 +13,12 @@ import java.io.Serializable;
@Getter
public enum NodeNeedEnums implements Serializable {
INITIAL_WAREHOUSE_DEPART(40, "始发仓发车"),
TRANSFER_WAREHOUSE_UNLOADING(50, "中转仓卸车确认"),
TRANSFER_WAREHOUSE_DEPART(60, "中转仓发车"),
END_WAREHOUSE_UNLOADING(70, "末端仓卸车确认"),
CLERK_REVIEW(140, "文员复核");
INITIAL_WAREHOUSE_DEPART(60, "始发仓发车"),
TRANSFER_WAREHOUSE_UNLOADING(110, "中转仓卸车确认"),
TRANSFER_WAREHOUSE_DEPART(120, "中转仓发车"),
SIGN_DIRECT_SHIPPER(160,"直发商家签收"),
END_WAREHOUSE_UNLOADING(170, "末端仓卸车确认"),
CLERK_REVIEW(290, "文员复核");
private Integer code;
private String value;

2
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/resources/application-dev.yml

@ -2,6 +2,8 @@
server:
port: 18910
zb:
enable: false
#数据源配置
#spring:
# datasource:

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/OrderPackageStatusFallJob.java

@ -47,6 +47,7 @@ public class OrderPackageStatusFallJob {
orderPackageStatusPushFailLogEntity.setDataStatus(1);
}catch (CustomerException e){
XxlJobLogger.log(e);
log.error("##################getOrderPackageFromOldSystem: 处理推送失败数据",e);

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

@ -16,7 +16,7 @@ import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@NonDS
//@NonDS
@ApiIgnore
@RestController
@AllArgsConstructor

13
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownStockupAreaClient.java

@ -40,4 +40,17 @@ public class WarehouseUpdownStockupAreaClient implements IWarehouseUpdownStockUp
return warehouseUpdownStockupAreaService.upStockUpShelf(code,stockUpAllocationId,warehouseId,type,num);
}
/**
* @param code
* @param warehouseId
* @param type
* @param num
* @return
*/
@Override
public Boolean downStockUpShelf(String code, Long warehouseId, Integer type, Integer num) {
return warehouseUpdownStockupAreaService.downStockUpShelf(code,warehouseId,type,num);
}
}

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

@ -15,7 +15,7 @@ import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@NonDS
//@NonDS
@ApiIgnore
@RestController
@AllArgsConstructor

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

@ -31,7 +31,7 @@ import java.util.List;
* @author zhy
* @since 2023-07-28
*/
@NonDS
//@NonDS
@ApiIgnore
@RestController
@AllArgsConstructor

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaService.java

@ -56,4 +56,14 @@ public interface IWarehouseUpdownStockupAreaService extends BaseService<Warehous
Boolean upStockUpShelf(String code, Long stockUpAllocationId, Long warehouseId, Integer type,Integer num);
BasicdataGoodsAllocationEntity upShelfScanAllocation(Long allocationId, Long warehouseId);
/**
* 备货库位下架
* @param code
* @param warehouseId
* @param type
* @param num
* @return
*/
Boolean downStockUpShelf(String code, Long warehouseId, Integer type, Integer num);
}

55
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java

@ -230,4 +230,59 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh
BasicdataGoodsAllocationEntity stockUpAllocationById = basicdataGoodsAllocationClient.findStockUpAllocationById(warehouseId, allocationId);
return stockUpAllocationById;
}
/**
* @param code
* @param warehouseId
* @param type
* @param num
* @return
*/
@Override
@Transactional
public Boolean downStockUpShelf(String code, Long warehouseId, Integer type, Integer num) {
String method = "######################WarehouseUpdownStockupAreaServiceImpl.upStockUpShelf";
//查询上架货物
List<WarehouseUpdownStockupAreaEntity> warehouseUpdownStockupAreaEntityList = this.list(Wrappers.<WarehouseUpdownStockupAreaEntity>query().lambda()
.eq(WarehouseUpdownStockupAreaEntity::getAssociationValue, code)
.eq(WarehouseUpdownStockupAreaEntity::getWarehouseId, warehouseId)
);
if (warehouseUpdownStockupAreaEntityList.isEmpty()){
log.error(method+"无上架记录AssociationValue:{},warehouseId:{}",code,warehouseId);
return false;
}
if (warehouseUpdownStockupAreaEntityList.size() > 1){
log.error(method+"多条上架记录AssociationValue:{},warehouseId:{}",code,warehouseId);
return false;
}
WarehouseUpdownStockupAreaEntity warehouseUpdownStockupArea = warehouseUpdownStockupAreaEntityList.get(0);
switch (warehouseUpdownStockupArea.getAssociationType()){
case "1" :
case "2" :
case "4" :
//库存品包件
//订制品
this.removeById(warehouseUpdownStockupArea.getId());
break;
case "3":
//零担
int i = warehouseUpdownStockupArea.getNum() - num;
warehouseUpdownStockupArea.setNum(i);
if (i == 0){
this.removeById(warehouseUpdownStockupArea.getId());
}else {
this.updateById(warehouseUpdownStockupArea);
}
break;
default:
log.error(method+"type错误type:{}",type);
return false;
}
WarehouseUpdownStockupAreaLogEntity warehouseUpdownStockupAreaLogEntity = Func.copy(warehouseUpdownStockupArea, WarehouseUpdownStockupAreaLogEntity.class);
warehouseUpdownStockupAreaLogEntity.setNum(num);
warehouseUpdownStockupAreaLogEntity.setBindingType(2);
warehouseUpdownStockupAreaLogService.save(warehouseUpdownStockupAreaLogEntity);
return true;
}
}

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

@ -87,8 +87,6 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
private final IBasicdataWarehouseClient warehouseClient;
@Override
public IPage<WarehouseWarehousingEntryVO> selectWarehouseWarehousingEntryPage(IPage<WarehouseWarehousingEntryVO> page, WarehouseWarehousingEntryVO warehouseWarehousingEntry) {
return page.setRecords(baseMapper.selectWarehouseWarehousingEntryPage(page, warehouseWarehousingEntry));
@ -107,16 +105,16 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean saveOrUpdateOwn(WarehouseWarehousingEntryDTO warehouseWarehousingEntryDTO) {
if(ObjectUtils.isNull(warehouseWarehousingEntryDTO.getType())){
if (ObjectUtils.isNull(warehouseWarehousingEntryDTO.getType())) {
throw new ServiceException("入库类型不能为空!!");
}
if("2".equals(warehouseWarehousingEntryDTO.getType())){
if ("2".equals(warehouseWarehousingEntryDTO.getType())) {
//直接入库
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingEntryDTO.getList();
WarehouseWarehousingEntryEntity warehouseWarehousingEntry = new WarehouseWarehousingEntryEntity();
BeanUtil.copyProperties(warehouseWarehousingEntryDTO,warehouseWarehousingEntry);
BeanUtil.copyProperties(warehouseWarehousingEntryDTO, warehouseWarehousingEntry);
//入库批次号
if(ObjectUtils.isNull( warehouseWarehousingEntry.getReceiptBatch() )){
if (ObjectUtils.isNull(warehouseWarehousingEntry.getReceiptBatch())) {
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
String s = "RK" + myCurrentWarehouse.getWarehouseCode() + time;
@ -126,21 +124,21 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
WarehouseWarehousingEntryEntity entryEntity = new WarehouseWarehousingEntryEntity();
entryEntity.setId(warehouseWarehousingEntryDTO.getId());
//添加
//获取当前登录人仓库
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(basicdataWarehouseEntity)) {
log.warn("#####操作人,当前未查询到仓库信息");
return false;
}
warehouseWarehousingEntry.setWarehouseId(basicdataWarehouseEntity.getId());
warehouseWarehousingEntry.setWarehouse(basicdataWarehouseEntity.getName());
warehouseWarehousingEntry.setSource("添加");
warehouseWarehousingEntry.setConditions("3");
this.save(warehouseWarehousingEntry);
list.forEach( i ->{
//添加
//获取当前登录人仓库
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(basicdataWarehouseEntity)) {
log.warn("#####操作人,当前未查询到仓库信息");
return false;
}
warehouseWarehousingEntry.setWarehouseId(basicdataWarehouseEntity.getId());
warehouseWarehousingEntry.setWarehouse(basicdataWarehouseEntity.getName());
warehouseWarehousingEntry.setSource("添加");
warehouseWarehousingEntry.setConditions("3");
this.save(warehouseWarehousingEntry);
list.forEach(i -> {
//添加库存品
addInventory(i.getCreateInventory(),warehouseWarehousingEntryDTO,i);
addInventory(i.getCreateInventory(), warehouseWarehousingEntryDTO, i);
});
//添加入库明细
// Iterator<WarehouseWarehousingDetailEntity> iterator = list.iterator();
@ -149,8 +147,8 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
// iterator.remove();
// }
// }
if(!list.isEmpty()){
list.forEach(i ->{
if (!list.isEmpty()) {
list.forEach(i -> {
i.setWarehousingEntryId(warehouseWarehousingEntry.getId());
i.setConditions("3");
}
@ -158,46 +156,46 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
warehouseWarehousingDetailService.saveBatch(list);
}
return true;
}else if("1".equals(warehouseWarehousingEntryDTO.getType())){
} else if ("1".equals(warehouseWarehousingEntryDTO.getType())) {
//预计入库
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingEntryDTO.getList();
WarehouseWarehousingEntryEntity warehouseWarehousingEntry = new WarehouseWarehousingEntryEntity();
BeanUtil.copyProperties(warehouseWarehousingEntryDTO,warehouseWarehousingEntry);
BeanUtil.copyProperties(warehouseWarehousingEntryDTO, warehouseWarehousingEntry);
WarehouseWarehousingEntryEntity entryEntity = new WarehouseWarehousingEntryEntity();
BeanUtil.copyProperties(warehouseWarehousingEntryDTO,entryEntity);
BeanUtil.copyProperties(warehouseWarehousingEntryDTO, entryEntity);
//入库批次号
if(ObjectUtils.isNull( warehouseWarehousingEntry.getReceiptBatch() )){
if (ObjectUtils.isNull(warehouseWarehousingEntry.getReceiptBatch())) {
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
warehouseWarehousingEntry.setReceiptBatch("RK"+myCurrentWarehouse.getWarehouseCode()+time);
warehouseWarehousingEntry.setReceiptBatch("RK" + myCurrentWarehouse.getWarehouseCode() + time);
}
entryEntity.setId(warehouseWarehousingEntryDTO.getId());
if(ObjectUtils.isNotNull(warehouseWarehousingEntryDTO.getId())){
if (ObjectUtils.isNotNull(warehouseWarehousingEntryDTO.getId())) {
//修改
List<Long> detailEntityList = new ArrayList<>();
List<WarehouseWarehousingDetailEntity> list1 = warehouseWarehousingDetailService.list(Wrappers.<WarehouseWarehousingDetailEntity>query().lambda()
.eq(WarehouseWarehousingDetailEntity::getWarehousingEntryId, warehouseWarehousingEntry.getId())
.apply("conditions in (1,2) ")
);//查询不是确定的数据
if(!list1.isEmpty()){
if (!list1.isEmpty()) {
AtomicReference<Integer> num = new AtomicReference<>(0);
list1.forEach( i ->{
list1.forEach(i -> {
boolean b = list.stream().anyMatch(w -> w.getMaterialId().equals(i.getMaterialId()));
if(b){
if (b) {
//存在
Iterator<WarehouseWarehousingDetailEntity> iterator = list.iterator();
while (iterator.hasNext()){
while (iterator.hasNext()) {
WarehouseWarehousingDetailEntity next = iterator.next();
if(next.getMaterialId().equals(i.getMaterialId())){
if (next.getMaterialId().equals(i.getMaterialId())) {
//修改
WarehouseWarehousingDetailEntity detailEntity = new WarehouseWarehousingDetailEntity();
detailEntity.setId(i.getId());
detailEntity.setActualReceipt(next.getActualReceipt()); //实际
if(next.getActualReceipt().equals(i.getCreateInventory()) || next.getActualReceipt() > i.getCreateInventory()){
if (next.getActualReceipt().equals(i.getCreateInventory()) || next.getActualReceipt() > i.getCreateInventory()) {
detailEntity.setConditions("3");
num.updateAndGet(v -> v + 1);
}else if(next.getActualReceipt() > 0 ){
} else if (next.getActualReceipt() > 0) {
detailEntity.setConditions("2");
entryEntity.setConditions("2");
warehouseWarehousingEntry.setConditions("2");
@ -206,13 +204,13 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
//当前入库数量
int i1 = next.getActualReceipt() - i.getActualReceipt();
//添加库存品
addInventory(i1,warehouseWarehousingEntryDTO,i);
addInventory(i1, warehouseWarehousingEntryDTO, i);
iterator.remove();
}
}
}else{
if("1".equals(i.getConditions())){
} else {
if ("1".equals(i.getConditions())) {
//删除
detailEntityList.add(i.getId());
}
@ -220,18 +218,18 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
});
Integer teger = num.get();
if(list1.size() == teger){
if (list1.size() == teger) {
//完成这个任务
entryEntity.setConditions("3");
}
baseMapper.updateById(entryEntity);
if(!detailEntityList.isEmpty()){
if (!detailEntityList.isEmpty()) {
//删除多余的
warehouseWarehousingDetailService.deleteLogic(detailEntityList);
}
}
}else{
} else {
//添加
//获取当前登录人仓库
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getMyCurrentWarehouse();
@ -247,14 +245,14 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
//添加入库明细
Iterator<WarehouseWarehousingDetailEntity> iterator = list.iterator();
while (iterator.hasNext()){
while (iterator.hasNext()) {
WarehouseWarehousingDetailEntity next = iterator.next();
if(ObjectUtils.isNotNull(next.getConditions() ) && "3".equals(next.getConditions())){
if (ObjectUtils.isNotNull(next.getConditions()) && "3".equals(next.getConditions())) {
iterator.remove();
}
}
if(!list.isEmpty()){
list.forEach(i ->{
if (!list.isEmpty()) {
list.forEach(i -> {
i.setWarehousingEntryId(warehouseWarehousingEntry.getId());
i.setConditions("1");
}
@ -262,7 +260,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
warehouseWarehousingDetailService.saveBatch(list);
}
return true;
}else{
} else {
return false;
}
@ -270,19 +268,20 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
/**
* 添加库存品
* @param num 添加数量
*
* @param num 添加数量
* @param warehousingEntryDTO 客户信息
* @param warehousingDetail 物品信息
* @param warehousingDetail 物品信息
* @return
*/
public Boolean addInventory(Integer num,WarehouseWarehousingEntryDTO warehousingEntryDTO,WarehouseWarehousingDetailEntity warehousingDetail){
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){
if (num < 1) {
return true;
}else{
} else {
//查询库存品信息
DistributionStockListEntity stockListEntity = new DistributionStockListEntity();
stockListEntity.setStoreId(warehousingEntryDTO.getStoreId());
@ -306,10 +305,10 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
distributionStockListEntity.setCargoUnit(warehousingDetail.getProductUnit()); //货物单位
distributionStockListEntity.setWarehousingTime(warehousingEntryDTO.getReceiptDate()); //入库时间
distributionStockListEntity.setLicensePlate(Optional.ofNullable(warehousingEntryDTO.getLicensePlate()).orElse(null)); //车牌
if(Func.isNotEmpty(warehousingEntryDTO.getStoreId())){
if (Func.isNotEmpty(warehousingEntryDTO.getStoreId())) {
distributionStockListEntity.setStoreId(warehousingEntryDTO.getStoreId()); //门店
}
if(Func.isNotEmpty(warehousingEntryDTO.getLicensePlate())){
if (Func.isNotEmpty(warehousingEntryDTO.getLicensePlate())) {
distributionStockListEntity.setDespatch(warehousingEntryDTO.getTrainNumber());//车次号运单
}
distributionStockListEntity.setServiceType(warehousingEntryDTO.getServiceType());
@ -328,7 +327,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
distributionStockListEntity.setBrandId(warehousingDetail.getBrandId());//品牌ID
// distributionStockListEntity.setFactory("工厂车次");//工厂车次
// distributionStockListEntity.setCategory("品分类");//品分类
distributionStockListEntity.setMaterialId( warehousingDetail.getMaterialId());//货物ID
distributionStockListEntity.setMaterialId(warehousingDetail.getMaterialId());//货物ID
// distributionStockListEntity.setStoreName("门店名称");//门店名称
// distributionStockListEntity.setParcelListId(distributionParcelList.getId());//包件id
distributionStockListEntity.setQuantityOccupied(0);//冻结数量
@ -338,57 +337,54 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
distributionStockListEntity.setSku(warehousingDetail.getSku());
distributionStockListEntity.setSourceType("2");//导入
if(Func.isNotEmpty(queryData)){
if (Func.isNotEmpty(queryData)) {
// distributionStockListEntity.setQuantityStock( queryData.getQuantityStock()+num ); //库存数量
// distributionStockListEntity.setOutboundQuantity(queryData.getOutboundQuantity()); //出库数量
//修改
DistributionStockListEntity distributionStockList = new DistributionStockListEntity();
distributionStockList.setQuantityStock(queryData.getQuantityStock()+num );
distributionStockList.setQuantityStock(queryData.getQuantityStock() + num);
distributionStockList.setOutboundQuantity(queryData.getOutboundQuantity());
distributionStockList.setId(queryData.getId());
distributionStockListClient.getUpdateStockList(distributionStockList);
}else{
} else {
distributionStockListClient.getAddStockList(distributionStockListEntity);
}
DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity();
BeanUtil.copyProperties(distributionStockListEntity,distributionStockListInfo);
BeanUtil.copyProperties(distributionStockListEntity, distributionStockListInfo);
distributionStockListInfo.setSourceType("2");//导入
return distributionStockListInfoClient.addStockListInfoEntity(distributionStockListInfo);
}
}
/**
*
* @param warehouseWarehousingEntry
* @return
*/
@Override
public WarehouseWarehousingEntryVO getOneOwn(WarehouseWarehousingEntryEntity warehouseWarehousingEntry) {
WarehouseWarehousingEntryEntity one = this.getOne(Condition.getQueryWrapper(warehouseWarehousingEntry));
log.info("one>>>>>>>>>>>>{}",one);
if(ObjectUtils.isNotNull(one) && ObjectUtils.isNotNull(one.getId())){
log.info("one>>>>>>>>>>>>{}", one);
if (ObjectUtils.isNotNull(one) && ObjectUtils.isNotNull(one.getId())) {
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingDetailService.list(Wrappers.<WarehouseWarehousingDetailEntity>query().lambda()
.eq(WarehouseWarehousingDetailEntity::getWarehousingEntryId, one.getId())
);
WarehouseWarehousingEntryVO warehouseWarehousingEntryVO = new WarehouseWarehousingEntryVO();
BeanUtils.copyProperties(one,warehouseWarehousingEntryVO);
BeanUtils.copyProperties(one, warehouseWarehousingEntryVO);
warehouseWarehousingEntryVO.setList(list);
return warehouseWarehousingEntryVO;
}else{
} else {
return null;
}
}
/**
* 导入
*
* @param data
* @param isCovered
*/
@ -398,51 +394,51 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
//分组
Map<String, List<WarehousingEntryDetailExcel>> collect = data.stream().map(x -> {
return x;
}).collect(Collectors.groupingBy(o ->{
System.out.println("====<<<<<<<<"+o);
if(ObjectUtils.isEmpty(o) || ObjectUtils.isNull(o.getCustomerName()) || ObjectUtils.isNull(o.getCustomerCode()) ){
}).collect(Collectors.groupingBy(o -> {
System.out.println("====<<<<<<<<" + o);
if (ObjectUtils.isEmpty(o) || ObjectUtils.isNull(o.getCustomerName()) || ObjectUtils.isNull(o.getCustomerCode())) {
return "";
}else{
} else {
WarehouseWarehousingEntryEntity entryEntity = new WarehouseWarehousingEntryEntity();
if(ObjectUtils.isNull(o.getReceiptBatch())){
if (ObjectUtils.isNull(o.getReceiptBatch())) {
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
entryEntity.setReceiptBatch("RK"+myCurrentWarehouse.getWarehouseCode()+time);
}else{
entryEntity.setReceiptBatch("RK" + myCurrentWarehouse.getWarehouseCode() + time);
} else {
entryEntity.setReceiptBatch(o.getReceiptBatch());
}
entryEntity.setReceiptDate(o.getReceiptDate());
//入库批次号
if(ObjectUtils.isNull( o.getReceiptBatch() )){
if (ObjectUtils.isNull(o.getReceiptBatch())) {
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
entryEntity.setReceiptBatch("RK"+myCurrentWarehouse.getWarehouseCode()+time);
entryEntity.setReceiptBatch("RK" + myCurrentWarehouse.getWarehouseCode() + time);
}
entryEntity.setConditions("1");
// entryEntity.setReceiptBatch("1");
BasicdataClientEntity customer = basicdataClientClient.getCustomer(o.getCustomerName(), o.getCustomerCode());
if(ObjectUtils.isNotEmpty(customer) ){
if(StringUtils.isNotBlank(o.getStoreName())){
if (ObjectUtils.isNotEmpty(customer)) {
if (StringUtils.isNotBlank(o.getStoreName())) {
BasicdataClientEntity customer1 = basicdataClientClient.findByName(o.getStoreName());
if(Func.isNotEmpty(customer1)){
if (Func.isNotEmpty(customer1)) {
entryEntity.setStoreId(customer1.getId());
entryEntity.setStoreName(o.getStoreName());
}else{
throw new ServiceException(o.getCustomerName()+o.getCustomerCode()+"门店信息不存在!!请维护门店数据!!!");
} else {
throw new ServiceException(o.getCustomerName() + o.getCustomerCode() + "门店信息不存在!!请维护门店数据!!!");
}
}
entryEntity.setClientId(customer.getId());//客户id
entryEntity.setCustomerName(o.getCustomerName());
entryEntity.setCustomerCode(o.getCustomerCode());
}else{
throw new ServiceException(o.getCustomerName()+o.getCustomerCode()+"客户信息不存在!!请维护客户数据!!!");
} else {
throw new ServiceException(o.getCustomerName() + o.getCustomerCode() + "客户信息不存在!!请维护客户数据!!!");
}
BasicdataWarehouseEntity warehouse = basicdataWarehouseClient.getWarehouse(o.getWarehouse(), o.getWarehouseCode());
if(Func.isNotEmpty(warehouse)){
if (Func.isNotEmpty(warehouse)) {
entryEntity.setWarehouseId(warehouse.getId());//仓库id
entryEntity.setWarehouse(o.getWarehouse());//仓库名称
}else{
throw new ServiceException(o.getCustomerName()+o.getCustomerCode()+"仓库信息不存在!!请维护仓库数据!!!");
} else {
throw new ServiceException(o.getCustomerName() + o.getCustomerCode() + "仓库信息不存在!!请维护仓库数据!!!");
}
entryEntity.setLogisticsCompany(Optional.ofNullable(o.getLogisticsCompany()).orElse(null));
entryEntity.setTrainNumber(Optional.ofNullable(o.getTrainNumber()).orElse(null)); //仓库名称
@ -451,7 +447,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
entryEntity.setRemark(Optional.ofNullable(o.getRemark()).orElse(null)); //备注
entryEntity.setSource("导入");
R<List<DictBiz>> distriType = dictBizClient.getList("distribution_type");
if(ObjectUtils.isNotNull(distriType)){
if (ObjectUtils.isNotNull(distriType)) {
List<DictBiz> data1 = distriType.getData();
// data1.forEach( a ->{
// if(o.getServiceType().equals(a.getDictValue())){
@ -469,15 +465,15 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
return s;
}
} , Collectors.toList()));
}, Collectors.toList()));
collect.forEach((k,v) ->{
collect.forEach((k, v) -> {
// System.out.println(">>>>>>>>>>>+++++"+k+v);
WarehouseWarehousingEntryEntity entryEntity = JSON.parseObject(k, WarehouseWarehousingEntryEntity.class);
// WarehouseWarehousingEntryEntity entryEntity = JSONObject.parseObject(JSONObject.toJSONString(k), WarehouseWarehousingEntryEntity.class);
this.save(entryEntity);
List<WarehouseWarehousingDetailEntity> detailEntityList = new ArrayList<>();
v.forEach( i ->{
v.forEach(i -> {
WarehouseWarehousingDetailEntity detail = new WarehouseWarehousingDetailEntity();
detail.setConditions("1");
detail.setSku(i.getSku());
@ -492,28 +488,28 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
detail.setActualReceipt(0);
//品牌
BasicdataStoreBrandEntity brandList = basicdataStoreBrandClient.getBrandList(entryEntity.getClientId(), i.getBrandName());
if(Func.isNotEmpty(brandList)){
if (Func.isNotEmpty(brandList)) {
detail.setBrandName(brandList.getBrandName());
detail.setBrandId(brandList.getBrandId());
}else{
throw new ServiceException(i.getProductName()+i.getProductCode()+i.getSku()+"品牌信息不存在!!请维护客户品牌数据!!!");
} else {
throw new ServiceException(i.getProductName() + i.getProductCode() + i.getSku() + "品牌信息不存在!!请维护客户品牌数据!!!");
}
BasicMaterialEntity materialOwn = basicMaterialClient.getMaterialOwn(detail.getProductCode(), detail.getProductName(), detail.getSku());
if(Func.isNotEmpty(materialOwn)){
if (Func.isNotEmpty(materialOwn)) {
detail.setMaterialId(materialOwn.getId());//物料ID
}else{
throw new ServiceException(i.getProductName()+i.getProductCode()+i.getSku()+"物料信息不存在!!请维护基础数据!!!");
} else {
throw new ServiceException(i.getProductName() + i.getProductCode() + i.getSku() + "物料信息不存在!!请维护基础数据!!!");
}
if(!detailEntityList.isEmpty()){
if (!detailEntityList.isEmpty()) {
boolean b = detailEntityList.stream().anyMatch(a -> a.getProductCode().equals(detail.getProductCode()) && a.getProductName().equals(detail.getProductName()) && a.getSku().equals(detail.getSku()));
if(b){
detailEntityList.stream().filter(a -> a.getProductCode().equals(detail.getProductCode()) && a.getProductName().equals(detail.getProductName()) && a.getSku().equals(detail.getSku())).forEach( f->f.setCreateInventory(f.getCreateInventory()+detail.getCreateInventory()));
}else{
if (b) {
detailEntityList.stream().filter(a -> a.getProductCode().equals(detail.getProductCode()) && a.getProductName().equals(detail.getProductName()) && a.getSku().equals(detail.getSku())).forEach(f -> f.setCreateInventory(f.getCreateInventory() + detail.getCreateInventory()));
} else {
detailEntityList.add(detail);
}
}else{
} else {
detailEntityList.add(detail);
}
});
@ -525,13 +521,13 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
public List<WarehouseWarehousingEntryExcel> exportWarehouseWarehousing(Map<String, Object> paramMap) {
// 获取当前登录的仓库信息
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull(myCurrentWarehouse)){
if (ObjectUtils.isNull(myCurrentWarehouse)) {
throw new ServiceException("没有仓库信息!");
}
// 用户勾选数据的ids
Object ids = paramMap.get("ids");
List<String> idArr = null;
if (null != ids && !ids.toString().isEmpty()){
if (null != ids && !ids.toString().isEmpty()) {
idArr = Arrays.asList(paramMap.get("ids").toString().split(","));
}
@ -539,9 +535,9 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
List<WarehouseWarehousingEntryEntity> list = baseMapper.exportWarehouseWarehousing(paramMap, idArr);
List<WarehouseWarehousingEntryExcel> listExcel = new ArrayList<>();
list.forEach(s->{
list.forEach(s -> {
WarehouseWarehousingEntryExcel excel = new WarehouseWarehousingEntryExcel();
switch (s.getConditions()){
switch (s.getConditions()) {
case "1":
s.setConditions("待确定");
break;
@ -552,7 +548,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
s.setConditions("已确定");
break;
}
BeanUtil.copyProperties(s,excel);
BeanUtil.copyProperties(s, excel);
listExcel.add(excel);
});

Loading…
Cancel
Save