Browse Source

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

training
pref_mail@163.com 1 year ago
parent
commit
accc032e75
  1. 8
      blade-service/logpm-distribution/pom.xml
  2. 34
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  3. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java
  4. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  5. 28
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  6. 33
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java
  7. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java
  8. 122
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

8
blade-service/logpm-distribution/pom.xml

@ -104,8 +104,12 @@
<artifactId>logpm-old-project-api</artifactId>
<version>${bladex.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
<version>3.1.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>

34
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -384,14 +384,14 @@ public class DistributionStockupAppController extends BladeController {
return R.fail(3002, "备货库存品ID不能为空");
}
List<DistributionStockupTrayVO> list = distributionStockupService.getLocationSelection(stockupDTO);
if(!list.isEmpty()){
if(!list.isEmpty() && ObjectUtils.isNotNull(list.get(0))){
return R.data(list);
}
List<DistributionStockupTrayVO> listMarket = distributionStockupService.getLocationMarketSelection(stockupDTO);
if(!listMarket.isEmpty()){
if(!listMarket.isEmpty() && ObjectUtils.isNotNull(listMarket.size())){
return R.data(listMarket);
}
return R.data(null);
return R.fail(3002,"当前物料未上架,请上架后在继续备货操作!!!");
}
@ -594,7 +594,17 @@ public class DistributionStockupAppController extends BladeController {
log.warn("##################allocationId: 货位ID为空!");
return R.fail("货位ID不能为空");
}
//判断是否可以继续备货
DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId);
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId());
warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch());
warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId());
warehouseUpdownGoodsEntity.setAssociationType("4");
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
if(ObjectUtils.isNull(locationInformation)){
return Resp.scanFail("当前货位的本物料已为0,请更换货位继续!!", "当前货位的本物料已为0,请更换货位继续!!");
}
Integer i = distributionStockupService.selectPackagePrint(stockupDTO);
switch (i) {
case 1:
@ -617,16 +627,16 @@ public class DistributionStockupAppController extends BladeController {
entity.setReservationId(reservationId);
entity.setStockListId(stockListId);
//添加物料信息
DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId);
// DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId);
if(ObjectUtils.isNotNull(byId.getMarketId())){
entity.setMarketId(byId.getMarketId());
entity.setMaterialId(byId.getMaterialId());
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId());
warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch());
warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId());
warehouseUpdownGoodsEntity.setAssociationType("4");
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
// WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
// warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId());
// warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch());
// warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId());
// warehouseUpdownGoodsEntity.setAssociationType("4");
// WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
if(!ObjectUtils.isNull(locationInformation)){
entity.setAllocationTitle(locationInformation.getPositionCode());
entity.setAllocationId(stockupDTO.getAllocationId());
@ -645,7 +655,7 @@ public class DistributionStockupAppController extends BladeController {
return R.fail(3002,"本货位的物料已为0,请更换货位继续!!");
}
}else{
return R.fail(3002,"物料信息查询失败,请联系TJJ!!");
return Resp.scanFail("物料信息查询失败,请联系TJJ!!", "物料信息查询失败,请联系TJJ!!");
}
entity.setConditions("0");
entity.setType(2);

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java

@ -43,6 +43,7 @@ import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.entity.User;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@ -171,19 +172,11 @@ public class DistributionStockupController extends BladeController {
@GetMapping("/listUser")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionStockup")
public R<BladeUser> listUser() {
public R<List<User>> listUser() {
//获取当前登录用户
BladeUser user = AuthUtil.getUser();
BladeUser u = new BladeUser();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(ObjectUtil.isNotEmpty(myCurrentWarehouse)){
}
u.setDeptId(user.getDeptId());
u.setTenantId(user.getTenantId());
u.setUserId(user.getUserId());
u.setUserName(user.getUserName());
return R.data(u);
List<User> cc = distributionStockupService.getRoleList(user.getDeptId(), user.getTenantId(), "叉车");
return R.data(cc);
}
/**

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java

@ -24,6 +24,7 @@ import com.logpm.distribution.excel.DistributionStockupExcel;
import com.logpm.distribution.vo.*;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.User;
import java.util.List;
import java.util.Map;
@ -194,4 +195,9 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
* @return
*/
List<DistributionStockupTrayVO> getLocationMarketSelection(StockupDTO stockupDTO);
/**
* @return
*/
List<User> getRoleList(String deptId, String tenantId, String roleNames);
}

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

@ -55,6 +55,9 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.User;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserSearchClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
@ -85,6 +88,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Autowired
private IDistributionDeliveryDetailsService distributionDeliveryDetailsService;
@Autowired
private ISysClient sysClient;
@Autowired
private IUserSearchClient userSearchClient;
@Autowired
private IDistributionReservationStocklistService distributionReservationStocklistService;
@ -1775,4 +1784,23 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return baseMapper.getLocationMarketSelection(stockupDTO);
}
/**
* @return
*/
@Override
public List<User> getRoleList(String deptId, String tenantId, String roleNames) {
R<String> roleIds = sysClient.getRoleIds(tenantId, roleNames);
R<List<User>> listR = userSearchClient.listByRole(roleIds.getData());
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
List<User> collect = listR.getData().stream().filter(i ->
ObjectUtils.isNotNull(i.getDeptId()) ? i.getDeptId().equals(myCurrentWarehouse.getDepartment().toString()) : false
).collect(Collectors.toList());
return collect;
}else{
return listR.getData();
}
}
}

33
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java

@ -908,6 +908,39 @@ public class WarehouseUpdownTypeApiController {
}
}
@ResponseBody
@PostMapping("/moveAllocationScanSourceAllocation")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "移库扫描来源库位", notes = "传入trayTypeDTO")
public R moveAllocationScanSourceAllocation(@RequestBody UpdownTypeDTO updownTypeDTO) {
String method = "###########moveAllocationScanSourceAllocation: ";
log.info(method + "移库扫描来源库位 updownTypeDTO={}", updownTypeDTO);
Long allocationId = updownTypeDTO.getAllocationId();//目标库位码
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息不能为空");
return R.fail(403,"仓库信息不能为空");
}
if(Objects.isNull(allocationId)){
log.warn(method+"库位码不能为空 allocationId={}",allocationId);
return R.fail(403,"库位码不能为空");
}
//查询该库位的货物信息
UpShelfAllocationVO upShelfAllocationVO = warehouseUpdownTypeService.moveAllocationScanSourceAllocation(allocationId,myCurrentWarehouse.getId());
return R.data(upShelfAllocationVO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/moveAllocationByAllocation")

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

@ -64,4 +64,6 @@ public interface IWarehouseUpdownTypeService extends BaseService<WarehouseUpdown
UpShelfAllocationVO moveAllocationScanAllocation(Long allocationId, Long warehouseId);
R moveAllocationByAllocation(Long allocationId, Long targetAllocationId, Long warehouseId);
UpShelfAllocationVO moveAllocationScanSourceAllocation(Long allocationId, Long warehouseId);
}

122
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -1663,7 +1663,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
return upShelfAllocationVO;
}else{
log.warn("#############moveAllocationScanAllocation: 库位已有绑定货物 allocationId={}",allocationId);
throw new CustomerException(403,"库位已绑定货物");
throw new CustomerException(403,"库位已绑定货物");
}
}
@ -1675,7 +1675,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
return Resp.scanFail(403,"库位信息不存在","库位信息不存在");
}
Long wid = goodsAllocationEntity.getWarehouseId();
if(wid.equals(warehouseId)){
if(!wid.equals(warehouseId)){
log.warn("#############moveAllocationByAllocation: 库位不在当前仓 allocationId={}",allocationId);
return Resp.scanFail(403,"库位不在当前仓","库位不在当前仓");
}
@ -1686,7 +1686,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
return Resp.scanFail(403,"目标库位信息不存在","目标库位信息不存在");
}
Long targetWid = targetGoodsAllocationEntity.getWarehouseId();
if(targetWid.equals(warehouseId)){
if(!targetWid.equals(warehouseId)){
log.warn("#############moveAllocationByAllocation: 目标库位不在当前仓 targetAllocationId={}",targetAllocationId);
return Resp.scanFail(403,"目标库位不在当前仓","目标库位不在当前仓");
}
@ -1726,6 +1726,122 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
return Resp.scanSuccess("整库移库成功","整库移库成功");
}
@Override
public UpShelfAllocationVO moveAllocationScanSourceAllocation(Long allocationId, Long warehouseId) {
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){
log.warn("#############upShelfScanAllocation: 库位信息不存在 allocationId={}",allocationId);
throw new CustomerException(403,"库位信息不存在");
}
String goodsAllocationName = goodsAllocationEntity.getGoodsAllocationName();
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId();
BasicdataGoodsShelfEntity basicdataGoodsShelfEntity = basicdataGoodsShelfClient.getEntityByGoodsShelfId(goodsShelfId);
if(Objects.isNull(basicdataGoodsShelfEntity)){
log.warn("#################upShelfScanAllocation: 货架信息不存在 goodsShelfId={}",goodsShelfId);
throw new CustomerException(403,"货架信息不存在");
}
String goodsShelfName = basicdataGoodsShelfEntity.getGoodsShelfName();
Long goodsAreaId = basicdataGoodsShelfEntity.getGoodsAreaId();//货区id
BasicdataGoodsAreaEntity basicdataGoodsAreaEntity = basicdataGoodsAreaClient.getEntityByGoodsAreaId(goodsAreaId);
if(Objects.isNull(basicdataGoodsAreaEntity)){
log.warn("#################upShelfScanAllocation: 货区信息不存在 goodsAreaId={}",goodsAreaId);
throw new CustomerException(403,"货区信息不存在");
}
String areaType = basicdataGoodsAreaEntity.getAreaType();
if("1".equals(areaType)){
log.warn("#################upShelfScanAllocation: 备货区不能上下架 goodsAreaId={}",goodsAreaId);
throw new CustomerException(403,"备货区不能上下架");
}
Long wid = basicdataGoodsAreaEntity.getWarehouseId();
String goodsAreaName = basicdataGoodsAreaEntity.getHeadline();//货区名称
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(wid);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("#################upShelfScanAllocation: 仓库信息不存在 wid={}",wid);
throw new CustomerException(403,"仓库信息不存在");
}
if(!wid.equals(warehouseId)){
log.warn("#################upShelfScanAllocation: 库位不在当前仓");
throw new CustomerException(403,"库位不在当前仓");
}
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("allocation_id",allocationId);
List<WarehouseUpdownGoodsEntity> list = warehouseUpdownGoodsService.list(queryWrapper);
if(list.isEmpty()){
log.warn("#################upShelfScanAllocation: 库位暂无货物绑定 allocationId={}",allocationId);
throw new CustomerException(403,"库位暂无货物绑定");
}
String warehouseName = basicdataWarehouseEntity.getName();//仓库名称
UpShelfAllocationVO upShelfAllocationVO = new UpShelfAllocationVO();
upShelfAllocationVO.setWarehouseId(warehouseId);
upShelfAllocationVO.setWarehouseName(warehouseName);
upShelfAllocationVO.setAreaId(goodsAreaId);
upShelfAllocationVO.setAreaTitle(goodsAreaName);
upShelfAllocationVO.setShelfId(goodsShelfId);
upShelfAllocationVO.setShelfTitle(goodsShelfName);
upShelfAllocationVO.setAllocationId(allocationId);
upShelfAllocationVO.setAllocationTitle(goodsAllocationName);
//就去查对应的库位绑定数据
QueryWrapper<WarehouseUpdownTypeEntity> updownTypeEntityQueryWrapper = new QueryWrapper<>();
updownTypeEntityQueryWrapper.eq("area_id",goodsAreaId)
.eq("shelf_id",goodsShelfId)
.eq("allocation_id",allocationId)
.eq("is_deleted",0);
WarehouseUpdownTypeEntity updownTypeEntity = baseMapper.selectOne(updownTypeEntityQueryWrapper);
if(Objects.isNull(updownTypeEntity)){
log.warn("#############upShelfScanAllocation: 库位暂无数据 allocationId={}",allocationId);
return upShelfAllocationVO;
}
upShelfAllocationVO.setTotalNum(updownTypeEntity.getTotalNum());
upShelfAllocationVO.setOrderTotalnum(updownTypeEntity.getOrderTotalNum());
upShelfAllocationVO.setStockNum(updownTypeEntity.getStockNum());
upShelfAllocationVO.setStockTotalNum(updownTypeEntity.getStockTotalNum());
Long updownTypeId = updownTypeEntity.getId();//库位打包货物方式id
//同一个货位上能存所有类型的货物,所以要分三类来查 association_type 1订单号(零担) 3包件码(订单号) 4库存品
List<UpShelfDataVO> packageList = warehouseUpdownGoodsService.findPackageByUpdownTypeId(updownTypeId);
List<UpShelfDataVO> zeroList = warehouseUpdownGoodsService.findZeroByUpdownTypeId(updownTypeId);
Integer orderNum = packageList.size() + zeroList.size();
upShelfAllocationVO.setOrderNum(orderNum);
List<UpShelfDataVO> stockList = warehouseUpdownGoodsService.findStockByUpdownTypeId(updownTypeId);
upShelfAllocationVO.getList().addAll(packageList);
upShelfAllocationVO.getList().addAll(zeroList);
upShelfAllocationVO.getList().addAll(stockList);
//查询货位上是否有托盘
BasicdataTrayEntity basicdataTrayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
if(!Objects.isNull(basicdataTrayEntity)){
//有托盘就查询托盘上的数据
Long trayId = basicdataTrayEntity.getId();
String trayCode = basicdataTrayEntity.getPalletCode();
upShelfAllocationVO.setTrayId(trayId);
upShelfAllocationVO.setTrayCode(trayCode);
QueryWrapper<WarehouseTrayTypeEntity> trayTypeEntityQueryWrapper = new QueryWrapper<>();
trayTypeEntityQueryWrapper.eq("tray_id",trayId)
.eq("is_deleted",0);
WarehouseTrayTypeEntity trayTypeEntity = warehouseTrayTypeService.getOne(trayTypeEntityQueryWrapper);
if(Objects.isNull(trayTypeEntity)){
log.warn("#############upShelfScanAllocation: 托盘未找到打托数据 trayId={}",trayId);
throw new CustomerException(403,"托盘未找到打托数据");
}
String type = trayTypeEntity.getType();//打托分类
upShelfAllocationVO.setTotalNum(trayTypeEntity.getTotalNum());
upShelfAllocationVO.setOrderTotalnum(trayTypeEntity.getOrderTotalNum());
upShelfAllocationVO.setStockNum(trayTypeEntity.getStockNum());
upShelfAllocationVO.setStockTotalNum(trayTypeEntity.getStockTotalNum());
if("1".equals(type) || "2".equals(type)){
upShelfAllocationVO.setTrayNum(trayTypeEntity.getTotalNum());
}else if("3".equals(type) || "4".equals(type)){
upShelfAllocationVO.setTrayNum(trayTypeEntity.getStockNum());
}
}
return upShelfAllocationVO;
}
private void changeUpdownGoodsToNewAllocation(List<WarehouseUpdownGoodsEntity> list, Long allocationId,WarehouseUpdownTypeEntity updownTypeEntity) {
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){

Loading…
Cancel
Save