From 3f07ab2e03e501ae55d1d1b0d031daf50c8e13e5 Mon Sep 17 00:00:00 2001 From: dongyukun <1208714201@qq.com> Date: 星期二, 10 十二月 2024 17:27:44 +0800 Subject: [PATCH] common依赖排除父类 --- iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/wash/service/impl/QualityWashTargetServiceImpl.java | 78 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 78 insertions(+), 0 deletions(-) diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/wash/service/impl/QualityWashTargetServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/wash/service/impl/QualityWashTargetServiceImpl.java new file mode 100644 index 0000000..3e58321 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/wash/service/impl/QualityWashTargetServiceImpl.java @@ -0,0 +1,78 @@ +package com.iailab.module.pms.coalquality.modules.wash.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.framework.common.util.object.ConvertUtils; +import com.iailab.module.pms.coalquality.modules.wash.dao.QualityWashTargetDao; +import com.iailab.module.pms.coalquality.modules.wash.dto.QualityWashTargetDTO; +import com.iailab.module.pms.coalquality.modules.wash.entity.QualityWashTargetEntity; +import com.iailab.module.pms.coalquality.modules.wash.service.QualityWashTargetService; +import com.iailab.module.pms.coalquality.modules.wash.vo.WashTargetPageReqVO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Date; +import java.util.Map; + +/** + * @author PanZhibao + * @Description + * @createTime 2023年12月12日 13:36:00 + */ +@Service +public class QualityWashTargetServiceImpl extends BaseServiceImpl<QualityWashTargetDao, QualityWashTargetEntity> + implements QualityWashTargetService { + + @Override + public PageResult<QualityWashTargetDTO> page(WashTargetPageReqVO washTargetPageReqVO) { + + PageResult<QualityWashTargetEntity> page = baseDao.selectPage(washTargetPageReqVO); + + return BeanUtils.toBean(page, QualityWashTargetDTO.class); + } + + private QueryWrapper<QualityWashTargetEntity> getWrapper(Map<String, Object> params){ + String code = (String)params.get("code"); + String cyrq = (String)params.get("cyrq"); + + QueryWrapper<QualityWashTargetEntity> wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(code), "code", code) + .eq(StringUtils.isNotBlank(cyrq), "cyrq", cyrq); + + return wrapper; + } + + @Override + public QualityWashTargetDTO get(String id) { + QualityWashTargetEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, QualityWashTargetDTO.class); + } + + @Override + public void save(QualityWashTargetDTO dto) { + QualityWashTargetEntity entity = ConvertUtils.sourceToTarget(dto, QualityWashTargetEntity.class); + entity.setCreateDate(new Date()); +// entity.setCreator(SecurityUser.getUserId().toString()); + insert(entity); + } + + @Override + public void update(QualityWashTargetDTO dto) { + QualityWashTargetEntity entity = ConvertUtils.sourceToTarget(dto, QualityWashTargetEntity.class); + entity.setUpdateDate(new Date()); +// entity.setUpdater(SecurityUser.getUserId().toString()); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + baseDao.deleteByIds(Arrays.asList(ids)); + } +} -- Gitblit v1.9.3