|
@@ -0,0 +1,92 @@
|
|
|
+package com.imcs.admin.business.service.impl;
|
|
|
+
|
|
|
+import com.imcs.admin.entity.WPInventoryCountPlan;
|
|
|
+import com.imcs.admin.entity.WPInventoryCountTask;
|
|
|
+import com.imcs.admin.business.dao.WPInventoryCountTaskDao;
|
|
|
+import com.imcs.admin.business.service.WPInventoryCountTaskService;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.PageImpl;
|
|
|
+import org.springframework.data.domain.PageRequest;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 盘点任务表(WPInventoryCountTask)表服务实现类
|
|
|
+ *
|
|
|
+ * @author wds
|
|
|
+ * @since 2024-06-04 13:01:01
|
|
|
+ */
|
|
|
+@Service("wPInventoryCountTaskService")
|
|
|
+public class WPInventoryCountTaskServiceImpl extends BaseServiceImpl implements WPInventoryCountTaskService {
|
|
|
+ @Resource
|
|
|
+ private WPInventoryCountTaskDao wPInventoryCountTaskDao;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过ID查询单条数据
|
|
|
+ *
|
|
|
+ * @param id 主键
|
|
|
+ * @return 实例对象
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public WPInventoryCountTask queryById(Long id) {
|
|
|
+ return this.wPInventoryCountTaskDao.queryById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询
|
|
|
+ *
|
|
|
+ * @param wPInventoryCountTask 筛选条件
|
|
|
+ * @param pageRequest 分页对象
|
|
|
+ * @return 查询结果
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Page<WPInventoryCountTask> queryByPage(WPInventoryCountTask wPInventoryCountTask, PageRequest pageRequest) {
|
|
|
+ long total = this.wPInventoryCountTaskDao.count(wPInventoryCountTask);
|
|
|
+ return new PageImpl<>(this.wPInventoryCountTaskDao.queryAllByLimit(wPInventoryCountTask, pageRequest), pageRequest, total);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增数据
|
|
|
+ *
|
|
|
+ * @param plan 实例对象
|
|
|
+ * @return 实例对象
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public WPInventoryCountTask insert(WPInventoryCountPlan plan) {
|
|
|
+
|
|
|
+
|
|
|
+ WPInventoryCountTask wpInventoryCountTask=new WPInventoryCountTask();
|
|
|
+ wpInventoryCountTask.setTaskCode(generateSerial.generateSerialNumber("planTaskCode"));
|
|
|
+ wpInventoryCountTask.setStatus(0);
|
|
|
+ wpInventoryCountTask.setWPInventoryCountPlanId(plan.getId());
|
|
|
+ wpInventoryCountTask.setCreatedAt(new Date());
|
|
|
+ wpInventoryCountTask.setCreatedBy(getUserId());
|
|
|
+ this.wPInventoryCountTaskDao.insert(wpInventoryCountTask);
|
|
|
+ return wpInventoryCountTask;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改数据
|
|
|
+ *
|
|
|
+ * @param wPInventoryCountTask 实例对象
|
|
|
+ * @return 实例对象
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public WPInventoryCountTask update(WPInventoryCountTask wPInventoryCountTask) {
|
|
|
+ this.wPInventoryCountTaskDao.update(wPInventoryCountTask);
|
|
|
+ return this.queryById(wPInventoryCountTask.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过主键删除数据
|
|
|
+ *
|
|
|
+ * @param id 主键
|
|
|
+ * @return 是否成功
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public boolean deleteById(Long id) {
|
|
|
+ return this.wPInventoryCountTaskDao.deleteById(id) > 0;
|
|
|
+ }
|
|
|
+}
|