Commit a7621da1 by huangZW

111

parent 310fe0c9
......@@ -8,6 +8,8 @@ import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
public interface StaffDepartmentRelatedApiService {
List<StaffDepartmentRelatedDTO> listByDepartmentId(String departmentId);
List<StaffDepartmentRelatedDTO> listByDepartmentIds(List<String> departmentIds);
List<StaffDepartmentRelatedDTO> listByStaffId(String staffId);
......
......@@ -51,6 +51,8 @@ public interface StaffDepartmentRelatedMapper {
List<TabHaobanStaffDepartmentRelated> listByWxEnterpriseIdAndClerkCode(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("clerkCode")String clerkCode);
List<TabHaobanStaffDepartmentRelated> listStaffDepartmentByStaffIds(@Param("staffIds")List<String> staffIds);
List<TabHaobanStaffDepartmentRelated> listByDepartmentIds(@Param("departmentIds")List<String> departmentIds);
int cleanStaffDepartment(@Param("wxEnterpriseId")String wxEnterpriseId,@Param("staffIds")List<String> staffIds);
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ import com.gic.haoban.manage.api.dto.AuditDTO;
import com.gic.haoban.manage.api.dto.AuditStaffDTO;
import com.gic.haoban.manage.api.dto.BatchAuditLogDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.dto.StoreAddressDTO;
import com.gic.haoban.manage.api.enums.AppPageType;
import com.gic.haoban.manage.api.enums.AuditRsultType;
......@@ -96,21 +97,33 @@ public class AuditApiServiceImpl implements AuditApiService{
@Override
public Page<AuditDTO> page(Integer auditType, String search,String wxEnterpriseId,
String enterpriseId,Integer auditStatus,Integer auditFlag, BasePageInfo pageInfo) {
List<String> storeIds = new ArrayList<>();
//部门关联表修改,服务层调整
List<String> departmentIds = new ArrayList<>();
List<String> staffIds = new ArrayList<>();
List<String> storeIds = new ArrayList<>();
if(StringUtils.isNotEmpty(search)){
List<TabHaobanDepartment> storeList = departmentMapper.listStoreLikeName(search);
if(CollectionUtil.isNotEmpty(storeList)){
storeIds = storeList.stream().map(s->s.getRelatedId()).collect(Collectors.toList());
List<TabHaobanDepartment> departmentList = departmentMapper.listStoreLikeName(search);
if(CollectionUtil.isNotEmpty(departmentList)){
departmentIds = departmentList.stream().map(s->s.getDepartmentId()).collect(Collectors.toList());
}else{
storeIds = Arrays.asList("-999");
departmentIds = Arrays.asList("-999");
}
if(CollectionUtil.isNotEmpty(departmentList)){
List<StaffDepartmentRelatedDTO> staffDepartments = staffDepartmentRelatedApiService.listByDepartmentIds(departmentIds);
if(CollectionUtil.isNotEmpty(staffDepartments)){
List<String> staffIds1 = staffDepartments.stream().map(s->s.getStaffId()).collect(Collectors.toList());
staffIds.addAll(staffIds1);
}
}
List<TabHaobanStaff> staffList = staffMapper.listLikeName(search);
if(CollectionUtil.isNotEmpty(staffList)){
staffIds = staffList.stream().map(s->s.getStaffId()).collect(Collectors.toList());
}else{
staffIds = Arrays.asList("-999");
List<String> staffIds2 = staffList.stream().map(s->s.getStaffId()).collect(Collectors.toList());
staffIds.addAll(staffIds2);
}
if(CollectionUtil.isEmpty(staffIds)){
staffIds.add("-999");
}
storeIds.add("-999");
}
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
com.github.pagehelper.Page<TabHaobanAudit> page = new com.github.pagehelper.Page<TabHaobanAudit>();
......@@ -119,7 +132,6 @@ public class AuditApiServiceImpl implements AuditApiService{
}else{
page = auditMapper.page(auditType, storeIds, staffIds, wxEnterpriseId,enterpriseId,auditStatus,auditFlag);
}
// List<TabHaobanAudit> list = page.getResult();
if(CollectionUtil.isNotEmpty( page.getResult())){
List<String> commitStaffIds = page.getResult().stream().map(s->s.getCommitStaffId()).collect(Collectors.toList());
List<TabHaobanStaff> staffList = staffMapper.listByIds(commitStaffIds);
......
......@@ -75,7 +75,14 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
List<StaffDepartmentRelatedDTO> resultList = EntityUtil.changeEntityListByJSON(StaffDepartmentRelatedDTO.class, list);
return resultList;
}
@Override
public List<StaffDepartmentRelatedDTO> listByDepartmentIds(
List<String> departmentIds) {
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedMapper.listByDepartmentIds(departmentIds);
List<StaffDepartmentRelatedDTO> resultList = EntityUtil.changeEntityListByJSON(StaffDepartmentRelatedDTO.class, list);
return resultList;
}
@Override
public void updateById(StaffDepartmentRelatedDTO dto) {
TabHaobanStaffDepartmentRelated tab = EntityUtil.changeEntityByJSON(TabHaobanStaffDepartmentRelated.class, dto);
......
......@@ -308,6 +308,17 @@
</foreach>
and status_flag = 1
</select>
<select id="listByDepartmentIds" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_department_related
where department_id in
<foreach collection="departmentIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
and status_flag = 1
</select>
<update id="cleanStaffDepartment" >
update tab_haoban_staff_department_related
......
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