|
@@ -3,7 +3,6 @@ package org.dromara.InventoryManagement.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import org.dromara.InventoryManagement.domain.PutInStorageType;
|
|
|
import org.dromara.InventoryManagement.domain.Storage;
|
|
|
import org.dromara.InventoryManagement.domain.StorageProduct;
|
|
|
import org.dromara.InventoryManagement.domain.bo.PutInStorageBo;
|
|
@@ -14,7 +13,6 @@ import org.dromara.InventoryManagement.mapper.PutInStorageMapper;
|
|
|
import org.dromara.InventoryManagement.mapper.PutInStorageProductMapper;
|
|
|
import org.dromara.InventoryManagement.mapstruct.NewStorageMapstruct;
|
|
|
import org.dromara.InventoryManagement.service.PutInStorageService;
|
|
|
-import org.dromara.commodityManagement.domain.DiBu;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
import org.dromara.common.core.utils.OrderNumberGenerator;
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
@@ -35,9 +33,9 @@ public class PutInStorageServiceImpl implements PutInStorageService {
|
|
|
|
|
|
/**
|
|
|
* 查询入库订单分页列表
|
|
|
- * @param storageBo
|
|
|
- * @param pageQuery
|
|
|
- * @return
|
|
|
+ * @param storageBo 入库订单表Bo
|
|
|
+ * @param pageQuery 分页对象
|
|
|
+ * @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
public TableDataInfo<StorageVo> selectPutInStoragePageList(StorageBo storageBo, PageQuery pageQuery) {
|
|
@@ -49,6 +47,11 @@ public class PutInStorageServiceImpl implements PutInStorageService {
|
|
|
return TableDataInfo.build(supplierVoList);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 新增入库订单
|
|
|
+ * @param putInStorageBo 传入Bo类
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public int insertStorage(PutInStorageBo putInStorageBo) {
|
|
@@ -71,4 +74,30 @@ public class PutInStorageServiceImpl implements PutInStorageService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除入库订单
|
|
|
+ * @param ids id集合
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int deleteById(List<Integer> ids) {
|
|
|
+ putInStorageProductMapper.deleteByStorageIds(ids);
|
|
|
+ QueryWrapper<Storage> qw = new QueryWrapper<>();
|
|
|
+ qw.in("id", ids);
|
|
|
+ return putInStorageMapper.delete(qw);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改入库订单
|
|
|
+ * @param putInStorageBo 传入Bo类
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int updateStorage(PutInStorageBo putInStorageBo) {
|
|
|
+ for (StorageListBo storageListBo : putInStorageBo.getStorageList()){
|
|
|
+ // 关联表修改
|
|
|
+ putInStorageProductMapper.updateById(newStorageMapstruct.toStorageProduct(putInStorageBo, storageListBo, putInStorageBo.getId()));
|
|
|
+ }
|
|
|
+ return putInStorageMapper.updateById(newStorageMapstruct.toStorage(putInStorageBo, putInStorageBo.getInCode()));
|
|
|
+ }
|
|
|
}
|