自报待办事项

master
赵嘉伟 3 years ago
parent 399a4e812e
commit 5c37a5caf0

@ -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<SelfReport> {
List<SelfReport> selectListByCondition(@Param("ew") QueryWrapper<SelfReport> ew, @Param("locale") String locale, @Param("startTime") LocalDate startTime, @Param("endTime") LocalDate endTime);
List<SelfReport> selectListByCondition(@Param("ew") QueryWrapper<SelfReport> ew, @Param("locale") String locale, @Param("startTime") LocalDate startTime, @Param("endTime") LocalDate endTime, @Param("userGroupList")List<UserGroup> userGroupList);
}

@ -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<SelfReportMapper, SelfRep
private CommonService commonService;
@Autowired
private NcCodeService ncCodeService;
@Autowired
private UserGroupMapper userGroupMapper;
@Override
public IPage<SelfReport> selectPage(FrontPage<SelfReport> frontPage, SelfReport selfReport) {
@ -76,7 +80,18 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
}
@Override
public List<SelfReport> selectList(QueryWrapper<SelfReport> queryWrapper, String locale, LocalDate startTime, LocalDate endTime) {
return selfReportMapper.selectListByCondition(queryWrapper,locale,startTime,endTime);
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
List<UserGroup> 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

@ -586,6 +586,17 @@
<if test="ew.entity.createdDateTime!=null"> AND ZSR.CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND ZSR.MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND ZSR.MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="userGroupList != null">
<if test="userGroupList.size &lt;= 0">
AND 1 = 2
</if>
<if test="userGroupList.size > 0">
AND ZSR.REPORT_USER_GROUP IN
<foreach item="item" index="index" collection="userGroupList" separator="," open="(" close=")">
UPPER(#{item.userGroup})
</foreach>
</if>
</if>
</if>
<if test="startTime!=null"> AND ZSR.CREATED_DATE_TIME >=#{startTime}</if>
<if test="endTime!=null"> AND ZSR.CREATED_DATE_TIME &lt;=#{endTime}</if>

Loading…
Cancel
Save