Browse Source

1.货位编辑

dev-warehouse
0.0 2 years ago
parent
commit
2ca45f3d94
  1. 4
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java
  2. 229
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseParcelListEntity.java
  3. 53
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java
  4. 64
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseParcelListVO.java
  5. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/BasicDataApplication.java
  6. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsShelfController.java
  7. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsShelfService.java
  8. 324
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java
  9. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionCallDeliveryServiceImpl.java
  10. 151
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseUpdownGoodsController.java
  11. 34
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseUpdownGoodsDTO.java
  12. 172
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehouseUpdownGoodsExcel.java
  13. 36
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java
  14. 60
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.java
  15. 78
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml
  16. 65
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownGoodsService.java
  17. 68
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java
  18. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseTrayTypeWrapper.java
  19. 50
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseUpdownGoodsWrapper.java

4
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java

@ -23,6 +23,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.List;
/**
* 货位 实体类
*
@ -130,4 +132,6 @@ public class BasicdataGoodsAllocationEntity extends TenantEntity {
@ApiModelProperty(value = "旧库位码")
private String oldQrCode;
}

229
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseParcelListEntity.java

@ -0,0 +1,229 @@
///*
// * 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.warehouse.entity;
//
//import com.baomidou.mybatisplus.annotation.TableField;
//import com.baomidou.mybatisplus.annotation.TableName;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import org.springblade.core.tenant.mp.TenantEntity;
//
//import java.util.Date;
//
///**
// * 在库订单包件清单 实体类
// *
// * @author cyz
// * @since 2023-06-13
// */
//@Data
//@TableName("logpm_distribution_parcel_list")
//@ApiModel(value = "DistributionParcelList对象", description = "在库订单包件清单")
//@EqualsAndHashCode(callSuper = true)
//public class WarehouseParcelListEntity extends TenantEntity {
//
// /**
// * 预留1
// */
// @ApiModelProperty(value = "预留1")
// private String reserve1;
// /**
// * 预留2
// */
// @ApiModelProperty(value = "预留2")
// private String reserve2;
// /**
// * 预留3
// */
// @ApiModelProperty(value = "预留3")
// private String reserve3;
// /**
// * 预留4
// */
// @ApiModelProperty(value = "预留4")
// private String reserve4;
// /**
// * 预留5
// */
// @ApiModelProperty(value = "预留5")
// private String reserve5;
// /**
// * 订单自编号
// */
// @ApiModelProperty(value = "订单自编号")
// private String orderCode;
// /**
// * 仓库
// */
// @ApiModelProperty(value = "仓库")
// private String warehouse;
//
// @ApiModelProperty(value = "仓库ID")
// private Long warehouseId;
// /**
// * 状态
// */
// @ApiModelProperty(value = "状态")
// private Integer conditions;
// /**
// * 包条码
// */
// @ApiModelProperty(value = "包条码")
// @TableField("order_package_code")
// private String orderPackageCode;
//
// @ApiModelProperty(value = "货区信息")
// private String cargoTitle;
//
// @ApiModelProperty(value = "货架信息")
// private String shelfTitle;
// /**
// * 货位信息
// */
// @ApiModelProperty(value = "货位信息")
// private String goodsAllocation;
// /**
// * 所在托盘
// */
// @ApiModelProperty(value = "所在托盘")
// private String pallet;
// /**
// * 一级品
// */
// @ApiModelProperty(value = "一级品")
// private String firsts;
// /**
// * 二级品
// */
// @ApiModelProperty(value = "二级品")
// private String second;
// /**
// * 三级品
// */
// @ApiModelProperty(value = "三级品")
// private String thirdProduct;
// /**
// * 入库时间
// */
// @ApiModelProperty(value = "入库时间")
// private Date warehouseEntryTimeEnd;
// /**
// * 运单号
// */
// @ApiModelProperty(value = "运单号")
// private String waybillNumber;
// /**
// * 运单ID
// */
// @ApiModelProperty(value = "运单ID")
// private String waybillId;
// /**
// * 客户id
// */
// @ApiModelProperty(value = "客户id")
// @TableField(exist = false)
// private String marketId;
// /**
// * 物料Id
// */
// @ApiModelProperty(value = "物料ID")
// private Long materialId;
//
// /**
// * 物料名称
// */
// @ApiModelProperty(value = "物料名称")
// private String materialName;
// /**
// * 物料编号
// */
// @ApiModelProperty(value = "物料编号")
// private String materialCode;
// /**
// * 物料单位
// */
// @ApiModelProperty(value = "物料单位")
// private String materialUnit;
// /**
// * 数量
// */
// @ApiModelProperty(value = "数量")
// private Integer quantity;
// /**
// * 车次号
// */
// @ApiModelProperty(value = "车次号")
// private String trainNumber;
// /**
// * 在库订单ID
// */
// @ApiModelProperty(value = "在库订单ID")
// private Long stockArticleId;
//
// /**
// * 服务号
// */
// @ApiModelProperty(value = "服务号")
// private String serviceNumber;
// /**
// * 品牌ID
// */
// @ApiModelProperty(value = "品牌ID")
// private Long brandId;
// /**
// * 品牌名称
// */
// @ApiModelProperty(value = "品牌名称")
// private String brandName;
//// /**
//// * 配送状态
//// */
//// @ApiModelProperty(value = "配送状态")
//// private String deliveryState;
// /**
// * 包件状态
// */
// @ApiModelProperty(value = "包件状态")
// private String orderPackageStatus;
//
// @ApiModelProperty(value = "包件冻结状态")
// private String orderPackageFreezeStatus;
//
// @ApiModelProperty(value = "包件冻结状态")
// private String orderPackageReservationStatus;
//
//
//
// @ApiModelProperty(value = "备货状态")
// private String orderPackageStockupStatus;
//
// @ApiModelProperty(value = "上架状态")
// private String orderPackageGroundingStatus;
//
//
//
//
//
//// /**
//// * 配送状态
//// */
//// @ApiModelProperty(value = "配送状态")
//// private String orderPackageStatus;
//
//}

53
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java

@ -0,0 +1,53 @@
/*
* 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.warehouse.feign;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 货位与货物绑定 Feign接口类
*
* @author lmy
* @since 2023-08-14
*/
@FeignClient(
value = ModuleNameConstant.APPLICATION_WAREHOUSE_NAME
)
public interface IWarehouseUpdownGoodsClient {
String API_PREFIX = "updownGoods/client";
String TOP = API_PREFIX + "/top";
// /**
// *查询包条
// */
// @GetMapping(TOP + "/selectListByAllo")
// List<WarehouseParcelListVO> selectListByAllo(@RequestParam Long alloId);
/**
*改货位有无物品
*/
@GetMapping(TOP + "/selectCountByAllo")
Integer selectCountByAllo(@RequestParam Long alloId);
}

64
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseParcelListVO.java

@ -0,0 +1,64 @@
///*
// * 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.warehouse.vo;
//
//import com.logpm.distribution.entity.DistributionParcelListEntity;
//import com.logpm.warehouse.entity.WarehouseParcelListEntity;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//
//import java.util.Date;
//
///**
// * 在库订单包件清单 视图实体类
// *
// * @author cyz
// * @since 2023-06-13
// */
//@Data
//@EqualsAndHashCode(callSuper = true)
//public class WarehouseParcelListVO extends WarehouseParcelListEntity {
// private static final long serialVersionUID = 1L;
//
// private String stockupStatus;
// private Date stockupDate;
// private String stockupArea;
// private String goodsAllocation;
// /**
// * 包件状态名称
// */
// private String orderPackageStatusName;
// /**
// * 包件冻结状态
// */
// private String orderPackageFreezeStatusName;
// /**
// * 包件上架状态
// */
// private String orderPackageGroundingStatusName;
// /**
// * 包件备货状态
// */
// private String orderPackageStockupStatusName;
//
// /**
// * 包件预约状态
// */
// private String orderPackageReservationStatusName;
//
//
//}

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/BasicDataApplication.java

@ -2,6 +2,7 @@
package com.logpm.basicdata;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.common.constant.TenantNum;
import org.springblade.core.cloud.client.BladeCloudApplication;
import org.springblade.core.launch.BladeApplication;

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

@ -104,6 +104,16 @@ public class BasicdataGoodsShelfController extends BladeController {
return R.status(basicdataGoodsShelfService.insertGoodsshelf(basicdataGoodsShelfDTO));
}
/**
* 货架 编辑货位
*/
@PostMapping("/allocation")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入BasicdataGoodsShelf")
public R allocation(@Valid @RequestBody BasicdataGoodsShelfDTO basicdataGoodsShelfDTO) {
return basicdataGoodsShelfService.insertallocation(basicdataGoodsShelfDTO);
}
/**
* 货架 修改
*/

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

@ -117,5 +117,8 @@ public interface IBasicdataGoodsShelfService extends BaseService<BasicdataGoodsS
* @return
*/
R<?> getShowTemplate(Map<String, Object> params, HttpServletResponse response);
/**
* 货架 编辑货位
*/
R insertallocation(BasicdataGoodsShelfDTO basicdataGoodsShelfDTO);
}

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

@ -19,6 +19,7 @@ package com.logpm.basicdata.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.logpm.basic.entity.BasicPrintTemplateEntity;
@ -28,10 +29,13 @@ import com.logpm.basicdata.dto.BasicdataGoodsShelfDTO;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataGoodsShelfEntity;
import com.logpm.basicdata.excel.BasicdataGoodsShelfExcel;
import com.logpm.basicdata.mapper.BasicdataGoodsAllocationMapper;
import com.logpm.basicdata.mapper.BasicdataGoodsShelfMapper;
import com.logpm.basicdata.service.IBasicdataGoodsAllocationService;
import com.logpm.basicdata.service.IBasicdataGoodsShelfService;
import com.logpm.basicdata.vo.BasicdataGoodsShelfVO;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j;
import lombok.extern.log4j.Log4j2;
@ -57,6 +61,7 @@ import java.io.IOException;
import java.util.*;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* 货架 服务实现类
@ -77,6 +82,11 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
private IBasicdataGoodsAllocationService basicdataGoodsAllocationService;
private BasicdataGoodsAllocationMapper basicdataGoodsAllocationMapper;
private IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient;
@Override
public IPage<BasicdataGoodsShelfVO> selectBasicdataGoodsShelfPage(IPage<BasicdataGoodsShelfVO> page, BasicdataGoodsShelfVO basicdataGoodsShelfVO) {
@ -150,6 +160,7 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
Integer storeyNum = basicdataGoodsShelfEntity.getStoreyNum();
//查询租户对应的库位码前缀规则
//String allocationCode = basicTenantCodeClient.shelfCode(user.getTenantId(),"5");
// ArrayList<BasicdataGoodsAllocationEntity> arrayList = new ArrayList<>();
// for (Integer i = 0; i < rowNum; i++) {
// for (Integer j = 0; j < storeyNum; j++) {
// BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
@ -159,16 +170,17 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
// basicdataGoodsAllocationEntity.setLayerNum(j + 1);
// int row = i + 1;
// int layer = j + 1;
// basicdataGoodsAllocationEntity.setQrCode(allocationCode + "-" + row + "-" + layer);
// basicdataGoodsAllocationEntity.setWarehouseId(basicdataGoodsShelfEntity.getWarehouseId());
// // basicdataGoodsAllocationEntity.setQrCode(allocationCode + "-" + row + "-" + layer);
// // basicdataGoodsAllocationEntity.setWarehouseId(basicdataGoodsShelfEntity.getWarehouseId());
// basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfEntity.getGoodsAreaId());
// basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfEntity.getId());
// basicdataGoodsAllocationEntity.setGoodsAllocationName(row + "-" + "-" + layer + "-货位");
// basicdataGoodsAllocationEntity.setAllocationStatuc("1");
// basicdataGoodsAllocationEntity.setEnableStatus("1");
// basicdataGoodsAllocationService.save(basicdataGoodsAllocationEntity);
// basicdataGoodsAllocationEntity.setGoodsAllocationName(shelfCode+"-"+row + "-" + layer + "-货位");
//// basicdataGoodsAllocationEntity.setAllocationStatuc("1");
//// basicdataGoodsAllocationEntity.setEnableStatus("1");
// arrayList.add(basicdataGoodsAllocationEntity);
// }
// }
// basicdataGoodsAllocationService.saveBatch(arrayList);
return result;
}
@ -289,4 +301,304 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
}
return R.success("二维码模板");
}
@Override
@Transactional(rollbackFor = Exception.class)
public R insertallocation(BasicdataGoodsShelfDTO basicdataGoodsShelfDTO) {
//这里需要根据货架的列数和层数进行货位信息的生成
Integer rowNum = basicdataGoodsShelfDTO.getRowNum();//列
log.info("列>>>>>>>>>>{}",rowNum);
Integer storeyNum = basicdataGoodsShelfDTO.getStoreyNum();//行
log.info("行>>>>>>>>>>{}",storeyNum);
//查询租户对应的库位码前缀规则
// String allocationCode = basicTenantCodeClient.shelfCode(user.getTenantId(),"5");
//判断新增货位
List<BasicdataGoodsAllocationEntity> basicdataGoodsAllocationEntities = basicdataGoodsAllocationMapper.selectList(new QueryWrapper<BasicdataGoodsAllocationEntity>().lambda()
.eq(BasicdataGoodsAllocationEntity::getIsDeleted, 0)
.eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId())
);
if (basicdataGoodsAllocationEntities.size()<=0){
ArrayList<BasicdataGoodsAllocationEntity> arrayList = new ArrayList<>();
for (Integer i = 0; i < rowNum; i++) {
for (Integer j = 0; j < storeyNum; j++) {
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
//设置所在列
basicdataGoodsAllocationEntity.setColumnNum(i + 1);
//设置所在层
basicdataGoodsAllocationEntity.setLayerNum(j + 1);
int row = i + 1;
int layer = j + 1;
// basicdataGoodsAllocationEntity.setQrCode(allocationCode + "-" + row + "-" + layer);
// basicdataGoodsAllocationEntity.setWarehouseId(basicdataGoodsShelfEntity.getWarehouseId());
basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId());
basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId());
basicdataGoodsAllocationEntity.setGoodsAllocationName( layer+ "-" + row);
// basicdataGoodsAllocationEntity.setAllocationStatuc("1");
// basicdataGoodsAllocationEntity.setEnableStatus("1");
arrayList.add(basicdataGoodsAllocationEntity);
}
}
basicdataGoodsAllocationService.saveBatch(arrayList);
//更新数量
this.updateById(basicdataGoodsShelfDTO);
return R.success("新增成功");
}else {
//查询原有的行
List<BasicdataGoodsAllocationEntity> layerSort = basicdataGoodsAllocationEntities.stream().collect(Collectors.toMap(BasicdataGoodsAllocationEntity::getColumnNum, a -> a, (s1, s2) -> s1)).values().stream().sorted(Comparator.comparingInt(BasicdataGoodsAllocationEntity::getLayerNum).thenComparing(BasicdataGoodsAllocationEntity::getColumnNum)).collect(Collectors.toList());
//查询原有的列
List<BasicdataGoodsAllocationEntity> columnSort = basicdataGoodsAllocationEntities.stream().collect(Collectors.toMap(BasicdataGoodsAllocationEntity::getLayerNum, a -> a, (s1, s2) -> s1)).values().stream().sorted(Comparator.comparingInt(BasicdataGoodsAllocationEntity::getColumnNum).thenComparing(BasicdataGoodsAllocationEntity::getLayerNum)).collect(Collectors.toList());
log.info("layerSort排序后>>>>>>>>>>>>>{}",layerSort);
log.info("columnSort排序后>>>>>>>>>>>>>{}",columnSort);
if (layerSort.get(layerSort.size()-1).getColumnNum()<rowNum){
if (columnSort.get(columnSort.size()-1).getLayerNum()<=storeyNum){
log.info("都增加>>>>>>>行不变列加>>>>>>>>>>>");
//TODO 都增加
//TODO 行不变列加
// //增加列数
// int i = rowNum - layerSort.get(layerSort.size() - 1).getColumnNum();
// //增加行数
// int j =storeyNum- columnSort.get(columnSort.size()-1).getLayerNum();
ArrayList<BasicdataGoodsAllocationEntity> arrayList = new ArrayList<>();
// for (Integer k = layerSort.get(layerSort.size()-1).getColumnNum()+1; k <= rowNum; k++) {
// for (Integer z = columnSort.get(columnSort.size()-1).getLayerNum()+1; z <= storeyNum; z++) {
// BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
// //设置所在列
// basicdataGoodsAllocationEntity.setColumnNum(k);
// //设置所在层
// basicdataGoodsAllocationEntity.setLayerNum(z);
// basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId());
// basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId());
// basicdataGoodsAllocationEntity.setGoodsAllocationName(k + "-" + z);
// arrayList.add(basicdataGoodsAllocationEntity);
// }
// }
//原有列
for (Integer k = 1; k <= layerSort.get(layerSort.size()-1).getColumnNum(); k++) {
for (Integer z = columnSort.get(columnSort.size()-1).getLayerNum()+1; z <= storeyNum; z++) {
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
//设置所在列
basicdataGoodsAllocationEntity.setColumnNum(k);
//设置所在层
basicdataGoodsAllocationEntity.setLayerNum(z);
basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId());
basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId());
basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + k);
arrayList.add(basicdataGoodsAllocationEntity);
}
}
//新加列
for (Integer k = layerSort.get(layerSort.size()-1).getColumnNum()+1; k <= rowNum; k++) {
for (Integer z = 1; z <= storeyNum; z++) {
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
//设置所在列
basicdataGoodsAllocationEntity.setColumnNum(k);
//设置所在层
basicdataGoodsAllocationEntity.setLayerNum(z);
basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId());
basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId());
basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + k);
arrayList.add(basicdataGoodsAllocationEntity);
}
}
basicdataGoodsAllocationService.saveBatch(arrayList);
//更新数量
this.updateById(basicdataGoodsShelfDTO);
return R.success("更新成功");
}else if (columnSort.get(columnSort.size()-1).getLayerNum()>storeyNum){
log.info("行减列加>>>>>>>>>>>>>>>>>>");
//TODO 行减列加
//行减
for (Integer z = layerSort.get(layerSort.size()-1).getColumnNum(); z > storeyNum; z--) {
List<BasicdataGoodsAllocationEntity> basicdataGoodsAllocationEntitiesDate = basicdataGoodsAllocationMapper.selectList(new QueryWrapper<BasicdataGoodsAllocationEntity>().lambda()
.eq(BasicdataGoodsAllocationEntity::getLayerNum, z)
.eq(BasicdataGoodsAllocationEntity::getGoodsAreaId, basicdataGoodsShelfDTO.getGoodsAreaId())
.eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId())
);
ArrayList<Long> longs = new ArrayList<>();
for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity : basicdataGoodsAllocationEntitiesDate) {
Long id = basicdataGoodsAllocationEntity.getId();
//查询有无绑定货物
Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(id);
if (integer>0)return R.fail(basicdataGoodsAllocationEntity.getGoodsAllocationName()+"有货物存在");
longs.add(id);
}
basicdataGoodsAllocationService.deleteLogic(longs);
}
//列加
ArrayList<BasicdataGoodsAllocationEntity> arrayList = new ArrayList<>();
for (int i = 1; i <=storeyNum ; i++) {
for (Integer k = layerSort.get(layerSort.size()-1).getColumnNum()+1; k <= rowNum; k++) {
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
//设置所在列
basicdataGoodsAllocationEntity.setColumnNum(k);
//设置所在层
basicdataGoodsAllocationEntity.setLayerNum(i);
basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId());
basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId());
basicdataGoodsAllocationEntity.setGoodsAllocationName(i + "-" + k);
arrayList.add(basicdataGoodsAllocationEntity);
}
}
basicdataGoodsAllocationService.saveBatch(arrayList);
//更新数量
this.updateById(basicdataGoodsShelfDTO);
return R.success("更新成功");
}else {
log.info("行不变列加>>>>>>>>>>>>>>>>>>");
//TODO 行不变列加 合并
}
}else if (layerSort.get(layerSort.size()-1).getColumnNum()>rowNum){
if (columnSort.get(columnSort.size()-1).getLayerNum()<storeyNum){
log.info("行加列减>>>>>>>>>>>>>>>>>>");
//TODO 行加列减
//列减
for (Integer k = layerSort.get(layerSort.size()-1).getColumnNum(); k > rowNum; k--) {
List<BasicdataGoodsAllocationEntity> basicdataGoodsAllocationEntitiesDate = basicdataGoodsAllocationMapper.selectList(new QueryWrapper<BasicdataGoodsAllocationEntity>().lambda()
.eq(BasicdataGoodsAllocationEntity::getColumnNum, k)
.eq(BasicdataGoodsAllocationEntity::getGoodsAreaId, basicdataGoodsShelfDTO.getGoodsAreaId())
.eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId())
);
ArrayList<Long> longs = new ArrayList<>();
for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity : basicdataGoodsAllocationEntitiesDate) {
Long id = basicdataGoodsAllocationEntity.getId();
//查询有无绑定货物
Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(id);
if (integer>0)return R.fail(basicdataGoodsAllocationEntity.getGoodsAllocationName()+"有货物存在");
longs.add(id);
}
basicdataGoodsAllocationService.deleteLogic(longs);
}
//行加
ArrayList<BasicdataGoodsAllocationEntity> arrayList = new ArrayList<>();
for (int i = 1; i <=rowNum ; i++) {
for (Integer z = columnSort.get(columnSort.size()-1).getLayerNum()+1; z <= storeyNum; z++) {
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
//设置所在列
basicdataGoodsAllocationEntity.setColumnNum(i);
//设置所在层
basicdataGoodsAllocationEntity.setLayerNum(z);
basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId());
basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId());
basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + i);
arrayList.add(basicdataGoodsAllocationEntity);
}
}
basicdataGoodsAllocationService.saveBatch(arrayList);
//更新数量
this.updateById(basicdataGoodsShelfDTO);
return R.success("更新成功");
}else if (columnSort.get(columnSort.size()-1).getLayerNum()>=storeyNum){
log.info("都减少>>>>>行不变列减>>>>>>>>>>>>>>");
//TODO 都减少 行不变列减
//列减
for (Integer k = layerSort.get(layerSort.size()-1).getColumnNum(); k > rowNum; k--) {
List<BasicdataGoodsAllocationEntity> basicdataGoodsAllocationEntitiesDate = basicdataGoodsAllocationMapper.selectList(new QueryWrapper<BasicdataGoodsAllocationEntity>().lambda()
.eq(BasicdataGoodsAllocationEntity::getColumnNum, k)
.eq(BasicdataGoodsAllocationEntity::getGoodsAreaId, basicdataGoodsShelfDTO.getGoodsAreaId())
.eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId())
);
ArrayList<Long> longs = new ArrayList<>();
for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity : basicdataGoodsAllocationEntitiesDate) {
Long id = basicdataGoodsAllocationEntity.getId();
//查询有无绑定货物
Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(id);
if (integer>0)return R.fail(basicdataGoodsAllocationEntity.getGoodsAllocationName()+"有货物存在");
longs.add(id);
}
basicdataGoodsAllocationService.deleteLogic(longs);
}
//行减
for (Integer z = layerSort.get(layerSort.size()-1).getColumnNum(); z > storeyNum; z--) {
List<BasicdataGoodsAllocationEntity> basicdataGoodsAllocationEntitiesDate = basicdataGoodsAllocationMapper.selectList(new QueryWrapper<BasicdataGoodsAllocationEntity>().lambda()
.eq(BasicdataGoodsAllocationEntity::getLayerNum, z)
.eq(BasicdataGoodsAllocationEntity::getGoodsAreaId, basicdataGoodsShelfDTO.getGoodsAreaId())
.eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId())
);
ArrayList<Long> longs = new ArrayList<>();
for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity : basicdataGoodsAllocationEntitiesDate) {
Long id = basicdataGoodsAllocationEntity.getId();
//查询有无绑定货物
Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(id);
if (integer>0)return R.fail(basicdataGoodsAllocationEntity.getGoodsAllocationName()+"有货物存在");
longs.add(id);
}
basicdataGoodsAllocationService.deleteLogic(longs);
}
//更新数量
this.updateById(basicdataGoodsShelfDTO);
return R.success("更新成功");
}else {
log.info("行不变列减>>>>>>>>>>>>>>>>>>");
//TODO 行不变列减 合并
}
}else {
if (columnSort.get(columnSort.size()-1).getLayerNum()>storeyNum){
log.info("行减列不变>>>>>>>>>>>>>>>>>>");
//TODO 行减列不变
//行减
for (Integer z = layerSort.get(layerSort.size()-1).getColumnNum(); z > storeyNum; z--) {
List<BasicdataGoodsAllocationEntity> basicdataGoodsAllocationEntitiesDate = basicdataGoodsAllocationMapper.selectList(new QueryWrapper<BasicdataGoodsAllocationEntity>().lambda()
.eq(BasicdataGoodsAllocationEntity::getLayerNum, z)
.eq(BasicdataGoodsAllocationEntity::getGoodsAreaId, basicdataGoodsShelfDTO.getGoodsAreaId())
.eq(BasicdataGoodsAllocationEntity::getGoodsShelfId, basicdataGoodsShelfDTO.getId())
);
ArrayList<Long> longs = new ArrayList<>();
for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity : basicdataGoodsAllocationEntitiesDate) {
Long id = basicdataGoodsAllocationEntity.getId();
//查询有无绑定货物
Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(id);
if (integer>0)return R.fail(basicdataGoodsAllocationEntity.getGoodsAllocationName()+"有货物存在");
longs.add(id);
}
basicdataGoodsAllocationService.deleteLogic(longs);
}
//更新数量
this.updateById(basicdataGoodsShelfDTO);
return R.success("更新成功");
}else if (columnSort.get(columnSort.size()-1).getLayerNum()<storeyNum){
log.info("行加列不变>>>>>>>>>>>>>>>>>>");
//TODO 行加列不变
//行加
ArrayList<BasicdataGoodsAllocationEntity> arrayList = new ArrayList<>();
for (int i = 1; i <=rowNum ; i++) {
for (Integer z = columnSort.get(columnSort.size()-1).getLayerNum()+1; z <= storeyNum; z++) {
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
//设置所在列
basicdataGoodsAllocationEntity.setColumnNum(i);
//设置所在层
basicdataGoodsAllocationEntity.setLayerNum(z);
basicdataGoodsAllocationEntity.setGoodsAreaId(basicdataGoodsShelfDTO.getGoodsAreaId());
basicdataGoodsAllocationEntity.setGoodsShelfId(basicdataGoodsShelfDTO.getId());
basicdataGoodsAllocationEntity.setGoodsAllocationName(z + "-" + i);
arrayList.add(basicdataGoodsAllocationEntity);
}
}
basicdataGoodsAllocationService.saveBatch(arrayList);
//更新数量
this.updateById(basicdataGoodsShelfDTO);
return R.success("更新成功");
}else {
log.info("无变化>>>>>>>>>>>>>>>>>>");
return R.success("无变化");
}
}
}
return R.fail("无法新增");
}
static Integer getLayerNum(List<BasicdataGoodsAllocationEntity> products, String ColumnNum) {
return products.stream()
.filter(e -> e.getColumnNum().equals(ColumnNum))
.mapToInt(BasicdataGoodsAllocationEntity::getLayerNum)
.findFirst()
.orElse(0);
}
}

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

@ -85,7 +85,7 @@ public class DistrilbutionCallDeliveryServiceImpl extends BaseServiceImpl<Distri
DistributionStockArticleEntity byId = distributionStockArticleService.getById(s);
DistrilbutionCallDeliveryEntity deliveryEntity = new DistrilbutionCallDeliveryEntity();
BeanUtils.copyProperties(distrilbutionCallDelivery,deliveryEntity);
deliveryEntity.setWaybillNumber(byId.getWaybillCode());
deliveryEntity.setWaybillNumber(byId.getWaybillNumber());
deliveryEntity.setStockArticleId(s);
this.save(deliveryEntity);
}

151
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseUpdownGoodsController.java

@ -0,0 +1,151 @@
/*
* 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.warehouse.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.vo.WarehouseUpdownGoodsVO;
import com.logpm.warehouse.excel.WarehouseUpdownGoodsExcel;
import com.logpm.warehouse.wrapper.WarehouseUpdownGoodsWrapper;
import com.logpm.warehouse.service.IWarehouseUpdownGoodsService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Map;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
/**
* 货位与货物绑定表 控制器
*
* @author lmy
* @since 2023-08-14
*/
@RestController
@AllArgsConstructor
@RequestMapping("/warehouseUpdownGoods")
@Api(value = "货位与货物绑定表", tags = "货位与货物绑定表接口")
public class WarehouseUpdownGoodsController extends BladeController {
private final IWarehouseUpdownGoodsService warehouseUpdownGoodsService;
/**
* 货位与货物绑定表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入warehouseUpdownGoods")
public R<WarehouseUpdownGoodsVO> detail(WarehouseUpdownGoodsEntity warehouseUpdownGoods) {
WarehouseUpdownGoodsEntity detail = warehouseUpdownGoodsService.getOne(Condition.getQueryWrapper(warehouseUpdownGoods));
return R.data(WarehouseUpdownGoodsWrapper.build().entityVO(detail));
}
/**
* 货位与货物绑定表 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入warehouseUpdownGoods")
public R<IPage<WarehouseUpdownGoodsVO>> list(@ApiIgnore @RequestParam Map<String, Object> warehouseUpdownGoods, Query query) {
IPage<WarehouseUpdownGoodsEntity> pages = warehouseUpdownGoodsService.page(Condition.getPage(query), Condition.getQueryWrapper(warehouseUpdownGoods, WarehouseUpdownGoodsEntity.class));
return R.data(WarehouseUpdownGoodsWrapper.build().pageVO(pages));
}
/**
* 货位与货物绑定表 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入warehouseUpdownGoods")
public R<IPage<WarehouseUpdownGoodsVO>> page(WarehouseUpdownGoodsVO warehouseUpdownGoods, Query query) {
IPage<WarehouseUpdownGoodsVO> pages = warehouseUpdownGoodsService.selectWarehouseUpdownGoodsPage(Condition.getPage(query), warehouseUpdownGoods);
return R.data(pages);
}
/**
* 货位与货物绑定表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入warehouseUpdownGoods")
public R save(@Valid @RequestBody WarehouseUpdownGoodsEntity warehouseUpdownGoods) {
return R.status(warehouseUpdownGoodsService.save(warehouseUpdownGoods));
}
/**
* 货位与货物绑定表 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入warehouseUpdownGoods")
public R update(@Valid @RequestBody WarehouseUpdownGoodsEntity warehouseUpdownGoods) {
return R.status(warehouseUpdownGoodsService.updateById(warehouseUpdownGoods));
}
/**
* 货位与货物绑定表 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入warehouseUpdownGoods")
public R submit(@Valid @RequestBody WarehouseUpdownGoodsEntity warehouseUpdownGoods) {
return R.status(warehouseUpdownGoodsService.saveOrUpdate(warehouseUpdownGoods));
}
/**
* 货位与货物绑定表 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(warehouseUpdownGoodsService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@GetMapping("/export-warehouseUpdownGoods")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入warehouseUpdownGoods")
public void exportWarehouseUpdownGoods(@ApiIgnore @RequestParam Map<String, Object> warehouseUpdownGoods, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = Condition.getQueryWrapper(warehouseUpdownGoods, WarehouseUpdownGoodsEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(WarehouseUpdownGoods::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(WarehouseUpdownGoodsEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<WarehouseUpdownGoodsExcel> list = warehouseUpdownGoodsService.exportWarehouseUpdownGoods(queryWrapper);
ExcelUtil.export(response, "货位与货物绑定表数据" + DateUtil.time(), "货位与货物绑定表数据表", list, WarehouseUpdownGoodsExcel.class);
}
}

34
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseUpdownGoodsDTO.java

@ -0,0 +1,34 @@
/*
* 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.warehouse.dto;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 货位与货物绑定表 数据传输对象实体类
*
* @author lmy
* @since 2023-08-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class WarehouseUpdownGoodsDTO extends WarehouseUpdownGoodsEntity {
private static final long serialVersionUID = 1L;
}

172
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehouseUpdownGoodsExcel.java

@ -0,0 +1,172 @@
/*
* 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.warehouse.excel;
import lombok.Data;
import java.util.Date;
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 java.io.Serializable;
/**
* 货位与货物绑定表 Excel实体类
*
* @author lmy
* @since 2023-08-14
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class WarehouseUpdownGoodsExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("租户号")
private String tenantId;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Integer isDeleted;
/**
* 预留1
*/
@ColumnWidth(20)
@ExcelProperty("预留1")
private String reserve1;
/**
* 预留2
*/
@ColumnWidth(20)
@ExcelProperty("预留2")
private String reserve2;
/**
* 预留3
*/
@ColumnWidth(20)
@ExcelProperty("预留3")
private String reserve3;
/**
* 预留4
*/
@ColumnWidth(20)
@ExcelProperty("预留4")
private String reserve4;
/**
* 预留5
*/
@ColumnWidth(20)
@ExcelProperty("预留5")
private String reserve5;
/**
* 上架方式id
*/
@ColumnWidth(20)
@ExcelProperty("上架方式id")
private Long updownTypeId;
/**
* 货区id
*/
@ColumnWidth(20)
@ExcelProperty("货区id")
private Long areaId;
/**
* 货区名称
*/
@ColumnWidth(20)
@ExcelProperty("货区名称")
private String areaTitle;
/**
* 货架id
*/
@ColumnWidth(20)
@ExcelProperty("货架id")
private Long shelfId;
/**
* 货架名称
*/
@ColumnWidth(20)
@ExcelProperty("货架名称")
private String shelfTitle;
/**
* 货位id
*/
@ColumnWidth(20)
@ExcelProperty("货位id")
private Long allocationId;
/**
* 货位名称
*/
@ColumnWidth(20)
@ExcelProperty("货位名称")
private String allocationTitle;
/**
* 完整货位
*/
@ColumnWidth(20)
@ExcelProperty("完整货位")
private String positionCode;
/**
* 货物类型;1有数据 2无数据
*/
@ColumnWidth(20)
@ExcelProperty("货物类型;1有数据 2无数据")
private String goodsType;
/**
* 关联id
*/
@ColumnWidth(20)
@ExcelProperty("关联id")
private Long associationId;
/**
* 关联值
*/
@ColumnWidth(20)
@ExcelProperty("关联值")
private String associationValue;
/**
* 关联类型;1.订单号 2运单号 3包件码 4库存品
*/
@ColumnWidth(20)
@ExcelProperty("关联类型;1.订单号 2运单号 3包件码 4库存品")
private String associationType;
/**
* 货物名称
*/
@ColumnWidth(20)
@ExcelProperty("货物名称")
private String goodsName;
/**
* 数量
*/
@ColumnWidth(20)
@ExcelProperty("数量")
private String num;
}

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

@ -0,0 +1,36 @@
package com.logpm.warehouse.feign;
import com.logpm.warehouse.service.IWarehouseUpdownGoodsService;
import lombok.AllArgsConstructor;
import org.springblade.core.tenant.annotation.NonDS;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@NonDS
@ApiIgnore
@RestController
@AllArgsConstructor
public class WarehouseUpdownGoodsClient implements IWarehouseUpdownGoodsClient {
private final IWarehouseUpdownGoodsService warehouseUpdownGoodsService;
// @Override
// @GetMapping(TOP + "/selectListByAllo")
// public List<WarehouseParcelListVO> selectListByAllo(Long alloId) {
// return warehouseUpdownGoodsService.selectListByAllo(alloId);
// }
@Override
@GetMapping(TOP + "/selectCountByAllo")
public Integer selectCountByAllo(Long alloId) {
return warehouseUpdownGoodsService.selectCountByAllo(alloId);
}
}

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

@ -0,0 +1,60 @@
/*
* 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.warehouse.mapper;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.vo.WarehouseUpdownGoodsVO;
import com.logpm.warehouse.excel.WarehouseUpdownGoodsExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 货位与货物绑定表 Mapper 接口
*
* @author lmy
* @since 2023-08-14
*/
public interface WarehouseUpdownGoodsMapper extends BaseMapper<WarehouseUpdownGoodsEntity> {
/**
* 自定义分页
*
* @param page
* @param warehouseUpdownGoods
* @return
*/
List<WarehouseUpdownGoodsVO> selectWarehouseUpdownGoodsPage(IPage page, WarehouseUpdownGoodsVO warehouseUpdownGoods);
/**
* 获取导出数据
*
* @param queryWrapper
* @return
*/
List<WarehouseUpdownGoodsExcel> exportWarehouseUpdownGoods(@Param("ew") Wrapper<WarehouseUpdownGoodsEntity> queryWrapper);
// /**
// * 根据货位查询货物
// *
// * @param alloId
// * @return
// */
// List<WarehouseParcelListVO> selectListByAllo(@Param("alloId") Long alloId);
}

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

@ -0,0 +1,78 @@
<?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.warehouse.mapper.WarehouseUpdownGoodsMapper">
<!-- 通用查询映射结果 -->
<resultMap id="warehouseUpdownGoodsResultMap" type="com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity">
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="id" property="id"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="updown_type_id" property="updownTypeId"/>
<result column="area_id" property="areaId"/>
<result column="area_title" property="areaTitle"/>
<result column="shelf_id" property="shelfId"/>
<result column="shelf_title" property="shelfTitle"/>
<result column="allocation_id" property="allocationId"/>
<result column="allocation_title" property="allocationTitle"/>
<result column="position_code" property="positionCode"/>
<result column="goods_type" property="goodsType"/>
<result column="association_id" property="associationId"/>
<result column="association_value" property="associationValue"/>
<result column="association_type" property="associationType"/>
<result column="goods_name" property="goodsName"/>
<result column="num" property="num"/>
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="id" property="id"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="updown_type_id" property="updownTypeId"/>
<result column="area_id" property="areaId"/>
<result column="area_title" property="areaTitle"/>
<result column="shelf_id" property="shelfId"/>
<result column="shelf_title" property="shelfTitle"/>
<result column="allocation_id" property="allocationId"/>
<result column="allocation_title" property="allocationTitle"/>
<result column="position_code" property="positionCode"/>
<result column="goods_type" property="goodsType"/>
<result column="association_id" property="associationId"/>
<result column="association_value" property="associationValue"/>
<result column="association_type" property="associationType"/>
<result column="goods_name" property="goodsName"/>
<result column="num" property="num"/>
</resultMap>
<select id="selectWarehouseUpdownGoodsPage" resultMap="warehouseUpdownGoodsResultMap">
select * from logpm_warehouse_updown_goods where is_deleted = 0
</select>
<select id="exportWarehouseUpdownGoods" resultType="com.logpm.warehouse.excel.WarehouseUpdownGoodsExcel">
SELECT * FROM logpm_warehouse_updown_goods ${ew.customSqlSegment}
</select>
<!-- <select id="selectListByAllo" resultType="com.logpm.warehouse.vo.WarehouseParcelListVO">-->
<!-- SELECT ldpl.* FROM logpm_warehouse_updown_goods lwug join logpm_distribution_parcel_list ldpl WHERE lwug.allocation_id = #{alloId}-->
<!-- </select>-->
</mapper>

65
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownGoodsService.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.warehouse.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.vo.WarehouseUpdownGoodsVO;
import com.logpm.warehouse.excel.WarehouseUpdownGoodsExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 货位与货物绑定表 服务类
*
* @author lmy
* @since 2023-08-14
*/
public interface IWarehouseUpdownGoodsService extends BaseService<WarehouseUpdownGoodsEntity> {
/**
* 自定义分页
*
* @param page
* @param warehouseUpdownGoods
* @return
*/
IPage<WarehouseUpdownGoodsVO> selectWarehouseUpdownGoodsPage(IPage<WarehouseUpdownGoodsVO> page, WarehouseUpdownGoodsVO warehouseUpdownGoods);
/**
* 导出数据
*
* @param queryWrapper
* @return
*/
List<WarehouseUpdownGoodsExcel> exportWarehouseUpdownGoods(Wrapper<WarehouseUpdownGoodsEntity> queryWrapper);
// /**
// * 关联查询货物
// *
// * @param alloId
// * @return
// */
// List<WarehouseParcelListVO> selectListByAllo(Long alloId);
/**
* 关联查询货位有无货物
*
* @param alloId
* @return
*/
Integer selectCountByAllo(Long alloId);
}

68
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java

@ -0,0 +1,68 @@
/*
* 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.warehouse.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.vo.WarehouseUpdownGoodsVO;
import com.logpm.warehouse.excel.WarehouseUpdownGoodsExcel;
import com.logpm.warehouse.mapper.WarehouseUpdownGoodsMapper;
import com.logpm.warehouse.service.IWarehouseUpdownGoodsService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 货位与货物绑定表 服务实现类
*
* @author lmy
* @since 2023-08-14
*/
@Service
public class WarehouseUpdownGoodsServiceImpl extends BaseServiceImpl<WarehouseUpdownGoodsMapper, WarehouseUpdownGoodsEntity> implements IWarehouseUpdownGoodsService {
@Override
public IPage<WarehouseUpdownGoodsVO> selectWarehouseUpdownGoodsPage(IPage<WarehouseUpdownGoodsVO> page, WarehouseUpdownGoodsVO warehouseUpdownGoods) {
return page.setRecords(baseMapper.selectWarehouseUpdownGoodsPage(page, warehouseUpdownGoods));
}
@Override
public List<WarehouseUpdownGoodsExcel> exportWarehouseUpdownGoods(Wrapper<WarehouseUpdownGoodsEntity> queryWrapper) {
List<WarehouseUpdownGoodsExcel> warehouseUpdownGoodsList = baseMapper.exportWarehouseUpdownGoods(queryWrapper);
//warehouseUpdownGoodsList.forEach(warehouseUpdownGoods -> {
// warehouseUpdownGoods.setTypeName(DictCache.getValue(DictEnum.YES_NO, WarehouseUpdownGoods.getType()));
//});
return warehouseUpdownGoodsList;
}
//
// @Override
// public List<BParcelListVO> selectListByAllo(Long alloId) {
// return baseMapper.selectListByAllo(alloId);
// }
@Override
public Integer selectCountByAllo(Long alloId) {
return baseMapper.selectCount(new QueryWrapper<WarehouseUpdownGoodsEntity>().lambda()
.eq(WarehouseUpdownGoodsEntity::getIsDeleted,0)
.eq(WarehouseUpdownGoodsEntity::getAllocationId,alloId)
).intValue();
}
}

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

@ -40,8 +40,8 @@ public class WarehouseTrayTypeWrapper extends BaseEntityWrapper<WarehouseTrayTyp
@Override
public WarehouseTrayTypeVO entityVO(WarehouseTrayTypeEntity warehouseTrayTypeEntity) {
WarehouseTrayTypeVO warehouseTrayTypeVO = Objects.requireNonNull(BeanUtil.copy(warehouseTrayTypeEntity, WarehouseTrayTypeVO.class));
String palletTypeName = DictBizCache.getValue(DictBizConstant.PALLET_TYPE, warehouseTrayTypeVO.getTrayType());
warehouseTrayTypeVO.setTrayTypeName(palletTypeName);
// String palletTypeName = DictBizCache.getValue(DictBizConstant.PALLET_TYPE, warehouseTrayTypeVO.getTrayType());
// warehouseTrayTypeVO.setTrayTypeName(palletTypeName);
return warehouseTrayTypeVO;
}

50
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseUpdownGoodsWrapper.java

@ -0,0 +1,50 @@
/*
* 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.warehouse.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.vo.WarehouseUpdownGoodsVO;
import java.util.Objects;
/**
* 货位与货物绑定表 包装类,返回视图层所需的字段
*
* @author lmy
* @since 2023-08-14
*/
public class WarehouseUpdownGoodsWrapper extends BaseEntityWrapper<WarehouseUpdownGoodsEntity, WarehouseUpdownGoodsVO> {
public static WarehouseUpdownGoodsWrapper build() {
return new WarehouseUpdownGoodsWrapper();
}
@Override
public WarehouseUpdownGoodsVO entityVO(WarehouseUpdownGoodsEntity warehouseUpdownGoods) {
WarehouseUpdownGoodsVO warehouseUpdownGoodsVO = Objects.requireNonNull(BeanUtil.copy(warehouseUpdownGoods, WarehouseUpdownGoodsVO.class));
//User createUser = UserCache.getUser(warehouseUpdownGoods.getCreateUser());
//User updateUser = UserCache.getUser(warehouseUpdownGoods.getUpdateUser());
//warehouseUpdownGoodsVO.setCreateUserName(createUser.getName());
//warehouseUpdownGoodsVO.setUpdateUserName(updateUser.getName());
return warehouseUpdownGoodsVO;
}
}
Loading…
Cancel
Save