Commit 9d293256 by 墨竹

fix:员工查询判断空

parent b431904b
...@@ -120,12 +120,14 @@ public class AuditApiServiceImpl implements AuditApiService { ...@@ -120,12 +120,14 @@ public class AuditApiServiceImpl implements AuditApiService {
} }
if (CollectionUtil.isNotEmpty(page.getResult())) { if (CollectionUtil.isNotEmpty(page.getResult())) {
List<String> commitStaffIds = page.getResult().stream().map(s -> s.getCommitStaffId()).collect(Collectors.toList()); List<String> commitStaffIds = page.getResult().stream().map(s -> s.getCommitStaffId()).collect(Collectors.toList());
List<TabHaobanStaff> staffList = staffMapper.listByIds(commitStaffIds); if (CollectionUtil.isNotEmpty(commitStaffIds)) {
Map<String, TabHaobanStaff> map = com.gic.commons.util.CollectionUtil.toMap(staffList, "staffId"); List<TabHaobanStaff> staffList = staffMapper.listByIds(commitStaffIds);
for (TabHaobanAudit tab : page.getResult()) { Map<String, TabHaobanStaff> map = com.gic.commons.util.CollectionUtil.toMap(staffList, "staffId");
String commitStaffId = tab.getCommitStaffId(); for (TabHaobanAudit tab : page.getResult()) {
tab.setCommitStaffName(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getStaffName()); String commitStaffId = tab.getCommitStaffId();
tab.setCommitStaffImg(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getHeadImg()); tab.setCommitStaffName(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getStaffName());
tab.setCommitStaffImg(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getHeadImg());
}
} }
} }
return PageUtil.changePageHelperToCurrentPage(page, AuditDTO.class); return PageUtil.changePageHelperToCurrentPage(page, AuditDTO.class);
......
...@@ -45,7 +45,8 @@ ...@@ -45,7 +45,8 @@
<update id="delOtherStaffByWxUserId"> <update id="delOtherStaffByWxUserId">
update tab_haoban_staff update tab_haoban_staff
set status_flag = 0,update_time = now() set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId} and wx_user_id = #{wxUserId}
and status_flag = 1 and status_flag = 1
...@@ -295,12 +296,10 @@ ...@@ -295,12 +296,10 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_staff from tab_haoban_staff
where status_flag = 1 where status_flag = 1
<if test="staffIds != null and staffIds.size() > 0"> and staff_id IN
and staff_id IN <foreach collection="staffIds" item="id" index="index" open="(" close=")" separator=",">
<foreach collection="staffIds" item="id" index="index" open="(" close=")" separator=","> #{id,jdbcType=VARCHAR}
#{id,jdbcType=VARCHAR} </foreach>
</foreach>
</if>
</select> </select>
<select id="listByWxUserId" resultMap="BaseResultMap"> <select id="listByWxUserId" resultMap="BaseResultMap">
select select
...@@ -344,12 +343,10 @@ ...@@ -344,12 +343,10 @@
from tab_haoban_staff from tab_haoban_staff
where status_flag = 1 where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
<if test="userIds != null and userIds.size() > 0"> and wx_user_id IN
and wx_user_id IN <foreach collection="userIds" item="id" index="index" open="(" close=")" separator=",">
<foreach collection="userIds" item="id" index="index" open="(" close=")" separator=","> #{id,jdbcType=VARCHAR}
#{id,jdbcType=VARCHAR} </foreach>
</foreach>
</if>
</select> </select>
<update id="cleanStaff" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff"> <update id="cleanStaff" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff">
...@@ -473,7 +470,8 @@ ...@@ -473,7 +470,8 @@
<update id="delStaffByWxUserId"> <update id="delStaffByWxUserId">
update tab_haoban_staff update tab_haoban_staff
set status_flag = 0,update_time = now() set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId} and wx_user_id = #{wxUserId}
and status_flag = 1 and status_flag = 1
...@@ -482,7 +480,8 @@ ...@@ -482,7 +480,8 @@
<update id="delStaffByPhoneNumber"> <update id="delStaffByPhoneNumber">
update tab_haoban_staff update tab_haoban_staff
set status_flag = 0,update_time = now() set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} where wx_enterprise_id = #{wxEnterpriseId}
and phone_number = #{phoneNumber} and phone_number = #{phoneNumber}
and status_flag = 1 and status_flag = 1
......
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