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/detection/service/impl/QualityMediumServiceImpl.java | 90 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 90 insertions(+), 0 deletions(-) diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/detection/service/impl/QualityMediumServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/detection/service/impl/QualityMediumServiceImpl.java new file mode 100644 index 0000000..bcb2bd5 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/detection/service/impl/QualityMediumServiceImpl.java @@ -0,0 +1,90 @@ +package com.iailab.module.pms.coalquality.modules.detection.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.iems.common.utils.SerialNumUtils; +import com.iailab.module.pms.coalquality.modules.detection.dao.QualityMediumDao; +import com.iailab.module.pms.coalquality.modules.detection.dto.QualityMediumDTO; +import com.iailab.module.pms.coalquality.modules.detection.entity.QualityMediumEntity; +import com.iailab.module.pms.coalquality.modules.detection.service.QualityMediumService; +import com.iailab.module.pms.coalquality.modules.detection.vo.MediumPageReqVO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Date; + +/** + * 介质粉检测 + * + * @author PanZhibao + * @Description + * @createTime 2023年02月07日 17:27:00 + */ +@Slf4j +@Service +public class QualityMediumServiceImpl extends BaseServiceImpl<QualityMediumDao, QualityMediumEntity> + implements QualityMediumService { + + @Autowired + private SerialNumUtils serialNumUtils; + + + private String BUSINESS_CODE = "QualityMedium"; + + @Override + public PageResult<QualityMediumDTO> page(MediumPageReqVO reqVO) { + PageResult<QualityMediumEntity> page = baseDao.selectPage(reqVO); + + return BeanUtils.toBean(page, QualityMediumDTO.class); + } + + @Override + public QualityMediumDTO get(String id) { + QualityMediumEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, QualityMediumDTO.class); + } + + @Override + public void save(QualityMediumDTO dto) { + dto.setCode(serialNumUtils.getByBusinessDate(BUSINESS_CODE, dto.getRq(), 4)); + QualityMediumEntity entity = ConvertUtils.sourceToTarget(dto, QualityMediumEntity.class); + entity.setCreateDate(new Date()); +// entity.setCreator(SecurityUser.getUserId().toString()); + insert(entity); + } + + @Override + public void update(QualityMediumDTO dto) { + QualityMediumEntity entity = ConvertUtils.sourceToTarget(dto, QualityMediumEntity.class); + entity.setUpdateDate(new Date()); +// entity.setUpdater(SecurityUser.getUserId().toString()); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Long cheack(QualityMediumDTO dto) { + String id = dto.getId(); + String code = dto.getCode(); + + QueryWrapper<QualityMediumEntity> queryWrapper = new QueryWrapper<>(); + queryWrapper.ne(StringUtils.isNotBlank(id), "id", id); + queryWrapper.and(wrapper -> wrapper.eq("code", code)); + return baseDao.selectCount(queryWrapper); + } + +} -- Gitblit v1.9.3