Browse Source

修改入库修改

dev-warehouse
caoyizhong 1 year ago
parent
commit
98d527c246
  1. 12
      blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicMaterialEntity.java
  2. 10
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWarehousingDetailEntity.java
  3. 15
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWarehousingEntryEntity.java
  4. 5
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseWarehousingEntryVO.java
  5. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWarehousingEntryController.java
  6. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWarehousingEntryService.java
  7. 99
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

12
blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicMaterialEntity.java

@ -101,27 +101,27 @@ public class BasicMaterialEntity extends TenantEntity {
*
*/
@ApiModelProperty(value = "长")
private BigDecimal extent;
private String extent;
/**
*
*/
@ApiModelProperty(value = "宽")
private BigDecimal breadth;
private String breadth;
/**
* 高度
*/
@ApiModelProperty(value = "高度")
private BigDecimal altitude;
private String altitude;
/**
* 体积
*/
@ApiModelProperty(value = "体积")
private BigDecimal volume;
private String volume;
/**
* 总量
*/
@ApiModelProperty(value = "总量")
private BigDecimal weight;
private String weight;
/**
* 备注
*/
@ -140,6 +140,6 @@ public class BasicMaterialEntity extends TenantEntity {
private String sku;
@ApiModelProperty(value = "包装数量")
private Integer packageNum;
private String packageNum;
}

10
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWarehousingDetailEntity.java

@ -86,11 +86,21 @@ public class WarehouseWarehousingDetailEntity extends TenantEntity {
*/
@ApiModelProperty(value = "包装数量")
private String packagingNumber;
/**
* 物料ID
*/
@ApiModelProperty(value = "物料Id")
private Long materialId;
/**
* 包装规格
*/
@ApiModelProperty(value = "包装规格")
private String packagingSpecifications;
/**
* 详情状态 1.待确定 2部分入库 3.已确定
*/
@ApiModelProperty(value = "详情状态")
private String conditions;
/**
* 创建入库数量
*/

15
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWarehousingEntryEntity.java

@ -123,6 +123,21 @@ public class WarehouseWarehousingEntryEntity extends TenantEntity {
*/
@ApiModelProperty(value = "入库状态")
private String conditions;
/**
* 客户ID
*/
@ApiModelProperty(value = "客户ID")
private Long clientId;
/**
* 门店
*/
@ApiModelProperty(value = "门店")
private Long storeId;
/**
* 仓库Id
*/
@ApiModelProperty(value = "仓库Id")
private Long warehouseId;
/**
* 入库总件数
*/

5
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseWarehousingEntryVO.java

@ -16,11 +16,14 @@
*/
package com.logpm.warehouse.vo;
import com.logpm.warehouse.entity.WarehouseWarehousingDetailEntity;
import com.logpm.warehouse.entity.WarehouseWarehousingEntryEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 仓库入库单 视图实体类
*
@ -32,4 +35,6 @@ import lombok.EqualsAndHashCode;
public class WarehouseWarehousingEntryVO extends WarehouseWarehousingEntryEntity {
private static final long serialVersionUID = 1L;
private List<WarehouseWarehousingDetailEntity> list;
}

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

@ -69,6 +69,16 @@ public class WarehouseWarehousingEntryController extends BladeController {
WarehouseWarehousingEntryEntity detail = warehouseWarehousingEntryService.getOne(Condition.getQueryWrapper(warehouseWarehousingEntry));
return R.data(detail);
}
/**
* 仓库入库单 详情
*/
@GetMapping("/detailOwn")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入warehouseWarehousingEntry")
public R<WarehouseWarehousingEntryVO> detailOwn(WarehouseWarehousingEntryEntity warehouseWarehousingEntry) {
WarehouseWarehousingEntryVO detail = warehouseWarehousingEntryService.getOneOwn(warehouseWarehousingEntry);
return R.data(detail);
}
/**
* 仓库入库单 分页
*/

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWarehousingEntryService.java

@ -56,4 +56,11 @@ public interface IWarehouseWarehousingEntryService extends BaseService<Warehouse
* @return
*/
Boolean saveOrUpdateOwn(WarehouseWarehousingEntryDTO warehouseWarehousingEntryDTO);
/**
* 入库单详情
* @param warehouseWarehousingEntry
* @return
*/
WarehouseWarehousingEntryVO getOneOwn(WarehouseWarehousingEntryEntity warehouseWarehousingEntry);
}

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

@ -17,6 +17,7 @@
package com.logpm.warehouse.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.eventbus.AllowConcurrentEvents;
import com.logpm.warehouse.dto.WarehouseWarehousingEntryDTO;
import com.logpm.warehouse.entity.WarehouseWarehousingDetailEntity;
@ -27,11 +28,18 @@ import com.logpm.warehouse.excel.WarehouseWarehousingEntryExcel;
import com.logpm.warehouse.mapper.WarehouseWarehousingEntryMapper;
import com.logpm.warehouse.service.IWarehouseWarehousingEntryService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.BeanUtils;
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 org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
@ -45,6 +53,9 @@ import java.util.List;
public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<WarehouseWarehousingEntryMapper, WarehouseWarehousingEntryEntity> implements IWarehouseWarehousingEntryService {
private final IWarehouseWarehousingDetailService warehouseWarehousingDetailService;
@Override
public IPage<WarehouseWarehousingEntryVO> selectWarehouseWarehousingEntryPage(IPage<WarehouseWarehousingEntryVO> page, WarehouseWarehousingEntryVO warehouseWarehousingEntry) {
return page.setRecords(baseMapper.selectWarehouseWarehousingEntryPage(page, warehouseWarehousingEntry));
@ -61,13 +72,52 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean saveOrUpdateOwn(WarehouseWarehousingEntryDTO warehouseWarehousingEntryDTO) {
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingEntryDTO.getList();
WarehouseWarehousingEntryEntity warehouseWarehousingEntry = new WarehouseWarehousingEntryEntity();
BeanUtil.copyProperties(warehouseWarehousingEntryDTO,warehouseWarehousingEntry);
if(ObjectUtils.isNotNull(warehouseWarehousingEntryDTO.getId())){
List<Long> detailEntityList = new ArrayList<>();
//修改
this.updateById(warehouseWarehousingEntry);
List<WarehouseWarehousingDetailEntity> list1 = warehouseWarehousingDetailService.list(Wrappers.<WarehouseWarehousingDetailEntity>query().lambda()
.eq(WarehouseWarehousingDetailEntity::getWarehousingEntryId, warehouseWarehousingEntry.getId())
);
list1.forEach( i ->{
boolean b = list.stream().anyMatch(w -> w.getMaterialId().equals(i.getMaterialId()));
if(b){
Iterator<WarehouseWarehousingDetailEntity> iterator = list.iterator();
while (iterator.hasNext()){
WarehouseWarehousingDetailEntity next = iterator.next();
if(next.getMaterialId().equals(i.getMaterialId())){
//修改
WarehouseWarehousingDetailEntity detailEntity = new WarehouseWarehousingDetailEntity();
detailEntity.setId(i.getId());
detailEntity.setActualReceipt(next.getActualReceipt());
if(next.getActualReceipt().equals(i.getCreateInventory())){
detailEntity.setConditions("3");
}else{
detailEntity.setConditions("2");
}
warehouseWarehousingDetailService.updateById(detailEntity);//修改数据
//当前入库数量
int i1 = next.getActualReceipt() - i.getActualReceipt();
//添加库存品
addInventory(i1,warehouseWarehousingEntryDTO,i);
iterator.remove();
}
}
}else{
//删除
detailEntityList.add(i.getId());
}
});
if(detailEntityList.size() > 0){
//删除多余的
warehouseWarehousingDetailService.deleteLogic(detailEntityList);
}
}else{
//添加
warehouseWarehousingEntry.setSource("添加");
@ -75,11 +125,52 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
this.save(warehouseWarehousingEntry);
}
//添加入库明细
list.forEach(i ->
i.setWarehousingEntryId(warehouseWarehousingEntry.getId())
);
warehouseWarehousingDetailService.saveBatch(list);
if(list.size() > 0){
list.forEach(i ->{
i.setWarehousingEntryId(warehouseWarehousingEntry.getId());
i.setConditions("1");
}
);
warehouseWarehousingDetailService.saveBatch(list);
}
return true;
}
/**
* 添加库存品
* @param num
* @param warehousingEntryDTO
* @param warehousingDetail
* @return
*/
public Boolean addInventory(Integer num,WarehouseWarehousingEntryDTO warehousingEntryDTO,WarehouseWarehousingDetailEntity warehousingDetail){
return null;
}
/**
*
* @param warehouseWarehousingEntry
* @return
*/
@Override
public WarehouseWarehousingEntryVO getOneOwn(WarehouseWarehousingEntryEntity warehouseWarehousingEntry) {
WarehouseWarehousingEntryEntity one = this.getOne(Condition.getQueryWrapper(warehouseWarehousingEntry));
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingDetailService.list(Wrappers.<WarehouseWarehousingDetailEntity>query().lambda()
.eq(WarehouseWarehousingDetailEntity::getWarehousingEntryId, one.getId())
);
WarehouseWarehousingEntryVO warehouseWarehousingEntryVO = new WarehouseWarehousingEntryVO();
BeanUtils.copyProperties(one,warehouseWarehousingEntryVO);
warehouseWarehousingEntryVO.setList(list);
return warehouseWarehousingEntryVO;
}
}

Loading…
Cancel
Save