From 6d08eec100243e0be59a207d57ab4db7974e51e4 Mon Sep 17 00:00:00 2001 From: yangbin <yangbin@qq.com> Date: 星期一, 29 七月 2024 15:26:26 +0800 Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/mdc_yituo --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcQualityMonthServiceImpl.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcQualityMonthServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcQualityMonthServiceImpl.java new file mode 100644 index 0000000..33dcb22 --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcQualityMonthServiceImpl.java @@ -0,0 +1,49 @@ +package org.jeecg.modules.mdcJc.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.mdc.util.DateUtils; +import org.jeecg.modules.mdcJc.entity.ClassMonthlyschedule; +import org.jeecg.modules.mdcJc.entity.MdcClassMonthlyschedule; +import org.jeecg.modules.mdcJc.entity.MdcQualityMonth; +import org.jeecg.modules.mdcJc.entity.QualityMonth; +import org.jeecg.modules.mdcJc.mapper.MdcQualityMonthMapper; +import org.jeecg.modules.mdcJc.service.IClassMonthlyscheduleService; +import org.jeecg.modules.mdcJc.service.IMdcQualityMonthService; +import org.jeecg.modules.utils.BeanMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author clown + * * @date 2024/7/17 + */ +@Service +public class MdcQualityMonthServiceImpl extends ServiceImpl<MdcQualityMonthMapper,MdcQualityMonth> implements IMdcQualityMonthService { + + @Autowired + private IClassMonthlyscheduleService classMonthlyscheduleService; + + @Override + public boolean saveQualityMonth() { + String date = DateUtils.format(DateUtils.getNow(),DateUtils.STR_YEAR_MONTH); + List<QualityMonth> list = classMonthlyscheduleService.findListQualityMonth(date); + if (list == null || list.isEmpty()) { + return true; + } + List<String> mdcListIds = super.baseMapper.selectDateList(date); + if (mdcListIds != null && !mdcListIds.isEmpty()) { + this.removeBatchByIds(mdcListIds); + } + List<MdcQualityMonth> mesC = new ArrayList<>(); + for ( QualityMonth c : list) { + MdcQualityMonth mdc = new MdcQualityMonth(); + BeanMapper.copy(c,mdc); + mesC.add(mdc); + } + boolean b = this.saveBatch(mesC); + return b; + } +} -- Gitblit v1.9.3