From 5c37a5caf0f5f6683fd484be337880119e0fb55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Fri, 20 Aug 2021 10:24:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E6=8A=A5=E5=BE=85=E5=8A=9E=E4=BA=8B?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/quality/mapper/SelfReportMapper.java | 3 ++- .../service/impl/SelfReportServiceImpl.java | 17 ++++++++++++++++- .../main/resources/mapper/SelfReportMapper.xml | 11 +++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/quality/src/main/java/com/foreverwin/mesnac/quality/mapper/SelfReportMapper.java b/quality/src/main/java/com/foreverwin/mesnac/quality/mapper/SelfReportMapper.java index b55e5bba..d9f8f19b 100644 --- a/quality/src/main/java/com/foreverwin/mesnac/quality/mapper/SelfReportMapper.java +++ b/quality/src/main/java/com/foreverwin/mesnac/quality/mapper/SelfReportMapper.java @@ -2,6 +2,7 @@ package com.foreverwin.mesnac.quality.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.foreverwin.mesnac.meapi.model.UserGroup; import com.foreverwin.mesnac.quality.model.SelfReport; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -20,5 +21,5 @@ import java.util.List; @Repository public interface SelfReportMapper extends BaseMapper { - List selectListByCondition(@Param("ew") QueryWrapper ew, @Param("locale") String locale, @Param("startTime") LocalDate startTime, @Param("endTime") LocalDate endTime); + List selectListByCondition(@Param("ew") QueryWrapper ew, @Param("locale") String locale, @Param("startTime") LocalDate startTime, @Param("endTime") LocalDate endTime, @Param("userGroupList")List userGroupList); } \ No newline at end of file diff --git a/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/SelfReportServiceImpl.java b/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/SelfReportServiceImpl.java index f2b44e84..07ee55f7 100644 --- a/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/SelfReportServiceImpl.java +++ b/quality/src/main/java/com/foreverwin/mesnac/quality/service/impl/SelfReportServiceImpl.java @@ -13,6 +13,8 @@ import com.foreverwin.mesnac.common.service.CommonService; import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.meapi.dto.NcCodeDto; import com.foreverwin.mesnac.meapi.dto.SfcDto; +import com.foreverwin.mesnac.meapi.mapper.UserGroupMapper; +import com.foreverwin.mesnac.meapi.model.UserGroup; import com.foreverwin.mesnac.meapi.service.NcCodeService; import com.foreverwin.mesnac.production.mapper.SfcCrossMapper; import com.foreverwin.mesnac.quality.dto.SelfReportRequest; @@ -60,6 +62,8 @@ public class SelfReportServiceImpl extends ServiceImpl selectPage(FrontPage frontPage, SelfReport selfReport) { @@ -76,7 +80,18 @@ public class SelfReportServiceImpl extends ServiceImpl selectList(QueryWrapper queryWrapper, String locale, LocalDate startTime, LocalDate endTime) { - return selfReportMapper.selectListByCondition(queryWrapper,locale,startTime,endTime); + String site = CommonMethods.getSite(); + String user = CommonMethods.getUser(); + List userGroupList = userGroupMapper.findUserGroupListByUser(site, user); + //ADMINISTRATORS,如果有的话就等于null + for (UserGroup userGroup : userGroupList){ + if("ADMINISTRATORS".equals(userGroup.getUserGroup())){ + userGroupList = null; + break; + } + } + + return selfReportMapper.selectListByCondition(queryWrapper,locale,startTime,endTime,userGroupList); } @Override diff --git a/quality/src/main/resources/mapper/SelfReportMapper.xml b/quality/src/main/resources/mapper/SelfReportMapper.xml index 03f8b45b..de56462e 100644 --- a/quality/src/main/resources/mapper/SelfReportMapper.xml +++ b/quality/src/main/resources/mapper/SelfReportMapper.xml @@ -586,6 +586,17 @@ AND ZSR.CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND ZSR.MODIFY_USER=#{ew.entity.modifyUser} AND ZSR.MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + + + AND 1 = 2 + + + AND ZSR.REPORT_USER_GROUP IN + + UPPER(#{item.userGroup}) + + + AND ZSR.CREATED_DATE_TIME >=#{startTime} AND ZSR.CREATED_DATE_TIME <=#{endTime}