Commit 55a2cebb by huangZW

新增接口获取wxUserId

parent fa69ad3c
...@@ -27,4 +27,5 @@ public interface StaffDepartmentRelatedApiService { ...@@ -27,4 +27,5 @@ public interface StaffDepartmentRelatedApiService {
StaffDepartmentRelatedDTO getOneByStaffIdAndDepartmentId(String staffId, String departmentId); StaffDepartmentRelatedDTO getOneByStaffIdAndDepartmentId(String staffId, String departmentId);
String getWxUserIdByClerkId(String clerkId);
} }
...@@ -45,5 +45,7 @@ public interface StaffDepartmentRelatedMapper { ...@@ -45,5 +45,7 @@ public interface StaffDepartmentRelatedMapper {
int countByDepartmentIds(@Param("departmentIds")List<String> departmentIds); int countByDepartmentIds(@Param("departmentIds")List<String> departmentIds);
List<TabHaobanStaffDepartmentRelated> listByWxUserId(@Param("wxUserId")String wxUserId); List<TabHaobanStaffDepartmentRelated> listByWxUserId(@Param("wxUserId")String wxUserId);
List<TabHaobanStaffDepartmentRelated> listByClerkCode(@Param("clerkCode")String clerkCode);
} }
\ No newline at end of file
...@@ -8,6 +8,9 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -8,6 +8,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.csp.sentinel.util.StringUtil;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.haoban.manage.api.dto.ApplicationDTO; import com.gic.haoban.manage.api.dto.ApplicationDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO; import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
...@@ -28,7 +31,8 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -28,7 +31,8 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
private StaffDepartmentRelatedService staffDepartmentRelatedService; private StaffDepartmentRelatedService staffDepartmentRelatedService;
@Autowired @Autowired
private StaffDepartmentRelatedMapper staffDepartmentRelatedMapper; private StaffDepartmentRelatedMapper staffDepartmentRelatedMapper;
@Autowired
private ClerkService clerkService;
@Override @Override
public List<StaffDepartmentRelatedDTO> listByDepartmentId( public List<StaffDepartmentRelatedDTO> listByDepartmentId(
String departmentId) { String departmentId) {
...@@ -86,6 +90,24 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -86,6 +90,24 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
StaffDepartmentRelatedDTO dto = EntityUtil.changeEntity(StaffDepartmentRelatedDTO.class, tab); StaffDepartmentRelatedDTO dto = EntityUtil.changeEntity(StaffDepartmentRelatedDTO.class, tab);
return dto; return dto;
} }
@Override
public String getWxUserIdByClerkId(String clerkId) {
ClerkDTO clerkDTO = clerkService.getclerkById(clerkId);
if(clerkDTO == null){
return null;
}
String clerkCode =clerkDTO.getClerkCode();
if(StringUtil.isEmpty(clerkCode) ){
return null;
}
List<TabHaobanStaffDepartmentRelated> list = staffDepartmentRelatedMapper.listByClerkCode(clerkCode);
if(CollectionUtil.isEmpty(list)){
return null;
}
String wxUserId = list.get(0).getWxUserId();
return wxUserId;
}
} }
...@@ -241,6 +241,14 @@ ...@@ -241,6 +241,14 @@
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="listByClerkCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_department_related
where clerk_code = #{clerkCode}
and status_flag = 1
</select>
<select id="countByDepartmentId" resultType="java.lang.Integer" parameterType="java.lang.String" > <select id="countByDepartmentId" resultType="java.lang.Integer" parameterType="java.lang.String" >
select select
......
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