|
@@ -0,0 +1,64 @@
|
|
|
+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.InventorySheet;
|
|
|
+import org.dromara.InventoryManagement.domain.bo.InventorySheetBo;
|
|
|
+import org.dromara.InventoryManagement.domain.vo.InventorySheetVo;
|
|
|
+import org.dromara.InventoryManagement.mapper.InventorySheetMapper;
|
|
|
+import org.dromara.InventoryManagement.service.InventorySheetService;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import org.dromara.common.core.utils.MapstructUtils;
|
|
|
+import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
+import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 盘点单服务实现
|
|
|
+ */
|
|
|
+@Service
|
|
|
+@RequiredArgsConstructor
|
|
|
+public class InventorySheetServiceImpl implements InventorySheetService {
|
|
|
+ private final InventorySheetMapper inventorySheetMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据InventorySheet对象分页查询盘点单数据
|
|
|
+ *
|
|
|
+ * @param inventorySheetBo inventorySheetBo对象
|
|
|
+ * @param pageQuery 查询条件
|
|
|
+ * @return 分页结果
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public TableDataInfo<InventorySheetVo> selectPageInventorySheetList(InventorySheetBo inventorySheetBo, PageQuery pageQuery) {
|
|
|
+ QueryWrapper<InventorySheet> qw = new QueryWrapper<>();
|
|
|
+ qw.like(StringUtils.isNotBlank(inventorySheetBo.getIdSn()), "id_sn", inventorySheetBo.getIdSn());
|
|
|
+ qw.like(inventorySheetBo.getStatus() != null, "status", inventorySheetBo.getStatus());
|
|
|
+ Page<InventorySheetVo> page=inventorySheetMapper.selectVoPage(pageQuery.build(),qw);
|
|
|
+ return TableDataInfo.build(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增盘点单数据
|
|
|
+ *
|
|
|
+ * @param inventorySheetBo 盘点单Bo对象
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int insertInventorySheet(InventorySheetBo inventorySheetBo) {
|
|
|
+ InventorySheet inventorySheet = MapstructUtils.convert(inventorySheetBo, InventorySheet.class);
|
|
|
+ return inventorySheetMapper.insert(inventorySheet);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除盘点单数据
|
|
|
+ * @param inventorySheetIds InventorySheetIds
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int deleteInventorySheetByIds(Long[] inventorySheetIds) {
|
|
|
+ return inventorySheetMapper.deleteByIds(Arrays.asList(inventorySheetIds));
|
|
|
+ }
|
|
|
+}
|