Commit f18b9c20 by fudahua

搜索

parent b6b1bcbb
......@@ -42,5 +42,5 @@ public interface StaffClerkBindLogMapper {
* @return
*/
public List<TabHaobanStaffClerkBindLog> listStaffClerkBindLog(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("clerkIds") List<String> clerkIds
, @Param("staffIds") List<String> staffIds, @Param("enterpriseIds") List<String> enterpriseIds, @Param("optType") int optType);
, @Param("staffIds") List<String> staffIds, @Param("enterpriseIds") List<String> enterpriseIds, @Param("optType") int optType,@Param("search") String search);
}
\ No newline at end of file
......@@ -63,6 +63,8 @@ public class TabHaobanStaffClerkBindLog implements Serializable {
*/
private String clerkCode;
private String clerkPhone;
/**
* 关联id
*/
......@@ -90,6 +92,14 @@ public class TabHaobanStaffClerkBindLog implements Serializable {
*/
private static final long serialVersionUID = 1L;
public String getClerkPhone() {
return clerkPhone;
}
public void setClerkPhone(String clerkPhone) {
this.clerkPhone = clerkPhone;
}
public String getRelationId() {
return relationId;
}
......
......@@ -33,5 +33,5 @@ public interface StaffClerkBindLogService {
*
* @return
*/
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId,List<String> clerkIds, List<String> staffIds,List<String> enterpriseIds,int optType, BasePageInfo pageInfo);
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId,List<String> clerkIds, List<String> staffIds,List<String> enterpriseIds,int optType,String search, BasePageInfo pageInfo);
}
......@@ -62,9 +62,9 @@ public class StaffClerkBindLogServiceImpl implements StaffClerkBindLogService {
}
@Override
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId,List<String> clerkIds, List<String> staffIds, List<String> enterpriseIds, int optType, BasePageInfo pageInfo) {
public Page<StaffClerkBindLogDetailDTO> pageBindLog(String wxEnterpriseId,List<String> clerkIds, List<String> staffIds, List<String> enterpriseIds, int optType,String search, BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo);
List<TabHaobanStaffClerkBindLog> clerkBindLogList = staffClerkBindLogMapper.listStaffClerkBindLog(wxEnterpriseId, clerkIds, staffIds, enterpriseIds, optType);
List<TabHaobanStaffClerkBindLog> clerkBindLogList = staffClerkBindLogMapper.listStaffClerkBindLog(wxEnterpriseId, clerkIds, staffIds, enterpriseIds, optType,search);
Page<StaffClerkBindLogDetailDTO> retPage = PageUtil.changePageHelperToCurrentPage(new PageInfo<>(clerkBindLogList), StaffClerkBindLogDetailDTO.class);
return retPage;
}
......
......@@ -98,6 +98,11 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
logger.info("不存在绑定数据");
return;
}
ClerkDTO clerkDTO = clerkService.getClerkByClerkIdNoStatus(clerkRelation.getClerkId());
String phoneNumber="";
if (null != clerkDTO) {
phoneNumber=clerkDTO.getPhoneNumber();
}
TabHaobanStaffClerkBindLog staffClerkRelation=new TabHaobanStaffClerkBindLog();
staffClerkRelation.setClerkId(clerkRelation.getClerkId());
staffClerkRelation.setChannelCode(infoDTO.getChannelCode());
......@@ -110,6 +115,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
staffClerkRelation.setStaffId(clerkRelation.getStaffId());
staffClerkRelation.setWxEnterpriseId(clerkRelation.getWxEnterpriseId());
staffClerkRelation.setRelationId(infoDTO.getRelationId());
staffClerkRelation.setClerkPhone(phoneNumber);
staffClerkRelation.setUpdateTime(new Date());
staffClerkBindLogService.insert(staffClerkRelation);
......@@ -313,15 +319,15 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
return null;
}
List<String> clerkIds=null;
if (StringUtils.isNotBlank(search)) {
List<ClerkDTO> clerk = clerkNewService.listClerkByEnterpriseIdAndSearch(enterpriseList, search);
if (CollectionUtils.isEmpty(clerk)) {
logger.info("没有搜索到相应信息");
return new Page<StaffClerkBindLogDetailDTO>();
}
clerkIds = clerk.stream().map(ClerkDTO::getClerkId).collect(Collectors.toList());
}
Page<StaffClerkBindLogDetailDTO> retList = staffClerkBindLogService.pageBindLog(wxEnterpriseId, clerkIds, null, enterpriseList, optType, pageInfo);
// if (StringUtils.isNotBlank(search)) {
// List<ClerkDTO> clerk = clerkNewService.listClerkByEnterpriseIdAndSearch(enterpriseList, search);
// if (CollectionUtils.isEmpty(clerk)) {
// logger.info("没有搜索到相应信息");
// return new Page<StaffClerkBindLogDetailDTO>();
// }
// clerkIds = clerk.stream().map(ClerkDTO::getClerkId).collect(Collectors.toList());
// }
Page<StaffClerkBindLogDetailDTO> retList = staffClerkBindLogService.pageBindLog(wxEnterpriseId, clerkIds, null, enterpriseList, optType,search, pageInfo);
if (CollectionUtils.isNotEmpty(retList.getResult())) {
retList.getResult().forEach(staffClerkBindLogDetailDTO -> {
TabHaobanStaff haobanStaff = staffService.selectById(staffClerkBindLogDetailDTO.getStaffId());
......
......@@ -11,13 +11,14 @@
<result column="enterprise_id" jdbcType="VARCHAR" property="enterpriseId" />
<result column="clerk_id" jdbcType="VARCHAR" property="clerkId" />
<result column="clerk_code" jdbcType="VARCHAR" property="clerkCode" />
<result column="clerk_phone" jdbcType="VARCHAR" property="clerkPhone" />
<result column="status_flag" jdbcType="INTEGER" property="statusFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
log_id, staff_id, wx_enterprise_id, opt_staff_id, opt_type, channel_code, enterprise_id,
clerk_id, clerk_code, status_flag, create_time, update_time
clerk_id, clerk_code,clerk_phone, status_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -32,12 +33,12 @@
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog">
insert into tab_haoban_staff_clerk_bind_log (staff_id, wx_enterprise_id,
opt_staff_id, opt_type, channel_code,
enterprise_id, clerk_id, clerk_code,
enterprise_id, clerk_id, clerk_code, clerk_phone,
status_flag, create_time, update_time
)
values ( #{staffId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
#{optStaffId,jdbcType=VARCHAR}, #{optType,jdbcType=INTEGER}, #{channelCode,jdbcType=INTEGER},
#{enterpriseId,jdbcType=VARCHAR}, #{clerkId,jdbcType=VARCHAR}, #{clerkCode,jdbcType=VARCHAR},
#{enterpriseId,jdbcType=VARCHAR}, #{clerkId,jdbcType=VARCHAR}, #{clerkCode,jdbcType=VARCHAR},#{clerk_phone,jdbcType=VARCHAR},
#{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
......@@ -200,6 +201,9 @@
<if test="optType!=-1">
and opt_type=#{optType}
</if>
<if test="search!=null">
and (clerk_code = #{search} or clerk_phone = #{search})
</if>
order by create_time desc
</select>
</mapper>
\ No newline at end of file
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