From 9386e23fb4e05b264ce38b56d95ab426757ebac7 Mon Sep 17 00:00:00 2001 From: guoqibing Date: Fri, 1 Aug 2025 16:59:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=B7=E4=B8=AD=E9=9C=80=E6=B1=82=E9=AA=8C?= =?UTF-8?q?=E6=94=B6=E5=8F=91=E9=80=81=E5=A4=9A=E4=BA=BA=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/sa/zentao/mapper/ZtProductMapper.java | 2 ++ .../sa/zentao/service/IZtProductService.java | 3 ++ .../service/impl/ZtProductServiceImpl.java | 5 +++ .../service/impl/ZtReleaseServiceImpl.java | 31 +++++++++++++++++-- .../java/com/sa/zentao/utils/SendEmail.java | 13 +++----- src/main/resources/application-dev.yml | 6 +++- src/main/resources/application-local.yml | 4 ++- src/main/resources/mapper/ZtProductMapper.xml | 7 +++++ 8 files changed, 58 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/sa/zentao/mapper/ZtProductMapper.java b/src/main/java/com/sa/zentao/mapper/ZtProductMapper.java index f60cac7..29a018b 100644 --- a/src/main/java/com/sa/zentao/mapper/ZtProductMapper.java +++ b/src/main/java/com/sa/zentao/mapper/ZtProductMapper.java @@ -22,4 +22,6 @@ public interface ZtProductMapper extends BaseMapper { List productPageList(@Param("qo") ZtProjectQo qo); + List productListByProgramName(@Param("programName") String programName); + } diff --git a/src/main/java/com/sa/zentao/service/IZtProductService.java b/src/main/java/com/sa/zentao/service/IZtProductService.java index 7c1d0b3..aad25c0 100644 --- a/src/main/java/com/sa/zentao/service/IZtProductService.java +++ b/src/main/java/com/sa/zentao/service/IZtProductService.java @@ -54,4 +54,7 @@ public interface IZtProductService extends IService { void productTeamUpdate(ZtProjectQo qo); List productTeamByPid(ZtProjectQo qo); + + List productListByProgramName(String programName); + } diff --git a/src/main/java/com/sa/zentao/service/impl/ZtProductServiceImpl.java b/src/main/java/com/sa/zentao/service/impl/ZtProductServiceImpl.java index b3b5e11..def69ee 100644 --- a/src/main/java/com/sa/zentao/service/impl/ZtProductServiceImpl.java +++ b/src/main/java/com/sa/zentao/service/impl/ZtProductServiceImpl.java @@ -658,6 +658,11 @@ public class ZtProductServiceImpl extends ServiceImpl o.getAccount()).collect(Collectors.toList()); } + @Override + public List productListByProgramName(String programName) { + return this.baseMapper.productListByProgramName(programName); + } + private Map> getChildrenMap(List result) { List ztProjects = this.baseMapper.selectList( diff --git a/src/main/java/com/sa/zentao/service/impl/ZtReleaseServiceImpl.java b/src/main/java/com/sa/zentao/service/impl/ZtReleaseServiceImpl.java index 56f9ad7..1cfd7c7 100644 --- a/src/main/java/com/sa/zentao/service/impl/ZtReleaseServiceImpl.java +++ b/src/main/java/com/sa/zentao/service/impl/ZtReleaseServiceImpl.java @@ -2,6 +2,7 @@ package com.sa.zentao.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -22,6 +23,7 @@ import com.sa.zentao.utils.SendEmail; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -69,6 +71,9 @@ public class ZtReleaseServiceImpl extends ServiceImpl"); b.append( ""); if(!CollectionUtils.isEmpty(mailTo)){ + SendEmail.sendMessage("需求发布提醒:",mailTo.stream().collect(Collectors.toList()), - null, + getFxcfCopyToMail(ztStories), b.toString()); } } + + /** + * 飞侠车服 抄送指定人 + * @param + * @return + */ + private List getFxcfCopyToMail(List ztStories) { + List ztProducts = this.productService.productListByProgramName("飞侠车服"); + //飞侠车服产品 + if(!CollectionUtils.isEmpty(ztProducts)&&xfxRelease!=null&&xfxRelease.length>0){ + List xfProductIds = ztProducts.stream().map(o -> o.getId()).collect(Collectors.toList()); + for (ZtStory story : ztStories) { + if(xfProductIds.contains(story.getProduct())){ + return Arrays.asList(xfxRelease); + } + } + } + return null; + } + //催促验收 private void urgeYsMail(List ztStories,ZtRelease release) { Map userMap = this.userService.userMapByIds(null); @@ -488,7 +514,7 @@ public class ZtReleaseServiceImpl extends ServiceImpl"); if(!CollectionUtils.isEmpty(mailTo)){ SendEmail.sendMessage("需求验收提醒:",mailTo.stream().collect(Collectors.toList()), - null, + getFxcfCopyToMail(ztStories), b.toString()); } for (ZtStory s:ztStories) { @@ -1045,5 +1071,4 @@ public class ZtReleaseServiceImpl extends ServiceImpl + +