Commit cb0a9ff7 by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-auth into developer
parents 62ff50a6 efd02a44
package com.gic.auth.service.impl;
import com.gic.auth.dao.mapper.TabAuditorAuditedGroupRelMapper;
import com.gic.auth.dao.mapper.TabAuditorMapper;
import com.gic.auth.dto.AuditorAuditedGroupRelDTO;
import com.gic.auth.dto.AuditorDTO;
import com.gic.auth.entity.TabAuditor;
import com.gic.auth.entity.TabAuditorAuditedGroupRel;
import com.gic.auth.qo.AuditorListQO;
import com.gic.auth.service.AuditorService;
import com.gic.commons.util.GlobalInfo;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
*
......@@ -25,6 +30,8 @@ public class AuditorServiceImpl implements AuditorService {
@Autowired
private TabAuditorMapper tabAuditorMapper;
@Autowired
private TabAuditorAuditedGroupRelMapper auditorAuditedGroupRelMapper;
@Override
public boolean validAuditorNameIsRepeat(Integer enterpriseId, String auditorName, Integer auditorId) {
......@@ -99,6 +106,17 @@ public class AuditorServiceImpl implements AuditorService {
@Override
public Page<TabAuditor> pageAuditor(AuditorListQO auditorListQO) {
if (auditorListQO.getAuditedGroupId() != null) {
AuditorAuditedGroupRelDTO auditedGroupRelDTO = new AuditorAuditedGroupRelDTO();
auditedGroupRelDTO.setAuditedGroupId(auditorListQO.getAuditedGroupId());
List<TabAuditorAuditedGroupRel> relList = auditorAuditedGroupRelMapper.listRel(auditedGroupRelDTO);
if (CollectionUtils.isEmpty(relList)) {
return new Page<>();
} else {
List<Integer> auditorIdList = relList.stream().map(TabAuditorAuditedGroupRel::getAuditorId).collect(Collectors.toList());
auditorListQO.setAuditorIdList(auditorIdList);
}
}
PageHelper.startPage(auditorListQO.getCurrentPage(), auditorListQO.getPageSize());
return tabAuditorMapper.listAuditor(auditorListQO);
}
......
......@@ -174,6 +174,9 @@
<if test="auditorId != null ">
and auditor_id = #{auditorId}
</if>
<if test="auditedGroupId != null ">
and audited_group_id = #{auditedGroupId}
</if>
<if test="null != auditorIdList">
and auditor_id in
<foreach collection="auditorIdList" index="index" item="item" open="(" separator="," close=")">
......
......@@ -189,9 +189,6 @@
<if test="auditorName != null and auditorName != '' ">
and auditor_name like concat('%', #{auditorName}, '%')
</if>
<if test="auditedGroupId != null ">
and audited_group_id = #{auditedGroupId}
</if>
<if test="isUse != null ">
and is_use = #{isUse}
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment