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/QualityTailingServiceImpl.java | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 100 insertions(+), 0 deletions(-) diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/detection/service/impl/QualityTailingServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/detection/service/impl/QualityTailingServiceImpl.java new file mode 100644 index 0000000..470905c --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/detection/service/impl/QualityTailingServiceImpl.java @@ -0,0 +1,100 @@ +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.QualityTailingDao; +import com.iailab.module.pms.coalquality.modules.detection.dto.QualityTailingDTO; +import com.iailab.module.pms.coalquality.modules.detection.entity.QualityTailingEntity; +import com.iailab.module.pms.coalquality.modules.detection.service.QualityTailingService; +import com.iailab.module.pms.coalquality.modules.detection.vo.TailingPageReqVO; +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; +import java.util.Map; + +/** + * 尾矿检测 + * + * @author PanZhibao + * @Description + * @createTime 2023年02月07日 17:27:00 + */ +@Slf4j +@Service +public class QualityTailingServiceImpl extends BaseServiceImpl<QualityTailingDao, QualityTailingEntity> + implements QualityTailingService { + + @Autowired + private SerialNumUtils serialNumUtils; + + private String BUSINESS_CODE = "QualityTailing"; + + @Override + public PageResult<QualityTailingDTO> page(TailingPageReqVO reqVO) { + PageResult<QualityTailingEntity> page = baseDao.selectPage(reqVO); + + return BeanUtils.toBean(page, QualityTailingDTO.class); + } + + private QueryWrapper<QualityTailingEntity> getWrapper(Map<String, Object> params){ + String rq = (String)params.get("rq"); + + QueryWrapper<QualityTailingEntity> wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(rq), "rq", rq); + return wrapper; + } + + @Override + public QualityTailingDTO get(String id) { + QualityTailingEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, QualityTailingDTO.class); + } + + @Override + public void save(QualityTailingDTO dto) { + + dto.setCode(SerialNumUtils.getSerialNum("", dto.getRq(), dto.getBc())); + QualityTailingEntity entity = ConvertUtils.sourceToTarget(dto, QualityTailingEntity.class); + entity.setCreateDate(new Date()); +// entity.setCreator(SecurityUser.getUserId().toString()); + insert(entity); + } + + @Override + public void update(QualityTailingDTO dto) { + QualityTailingEntity entity = ConvertUtils.sourceToTarget(dto, QualityTailingEntity.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(QualityTailingDTO dto) { + String id = dto.getId(); + String code = dto.getCode(); + + QueryWrapper<QualityTailingEntity> 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