Commit f18b9c20 by fudahua

搜索

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