package com.iailab.module.data.plan.item.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.data.ind.item.dao.IndItemDao; import com.iailab.module.data.ind.item.entity.IndItemEntity; import com.iailab.module.data.ind.item.service.IndItemService; import com.iailab.module.data.ind.item.vo.IndItemPageReqVO; import com.iailab.module.data.ind.item.vo.IndItemSaveReqVO; import com.iailab.module.data.plan.item.dao.PlanItemDao; import com.iailab.module.data.plan.item.entity.PlanItemEntity; import com.iailab.module.data.plan.item.service.PlanItemService; import com.iailab.module.data.plan.item.vo.PlanItemPageReqVO; import com.iailab.module.data.plan.item.vo.PlanItemSaveReqVO; import org.springframework.stereotype.Service; import java.util.Date; import java.util.List; import java.util.UUID; /** * @author PanZhibao * @Description * @createTime 2024年11月01日 */ @Service public class PlanItemServiceImpl extends BaseServiceImpl implements PlanItemService { @Override public PageResult page(PlanItemPageReqVO reqVO) { return baseDao.selectPage(reqVO); } @Override public List list() { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.orderByDesc("create_time"); return baseDao.selectList(queryWrapper); } @Override public void create(PlanItemSaveReqVO createReqVO) { PlanItemEntity entity = BeanUtils.toBean(createReqVO, PlanItemEntity.class); entity.setId(UUID.randomUUID().toString()); entity.setCreateTime(new Date()); baseDao.insert(entity); } @Override public void update(PlanItemSaveReqVO updateReqVO) { PlanItemEntity entity = BeanUtils.toBean(updateReqVO, PlanItemEntity.class); entity.setUpdateTime(new Date()); baseDao.updateById(entity); } @Override public PlanItemEntity get(String id) { return baseDao.selectById(id); } @Override public PlanItemEntity getInfoByNo(String no) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("item_no", no); return baseDao.selectOne(queryWrapper); } @Override public void delete(String id) { baseDao.deleteById(id); } }