Commit 02a40d1c by 林冲

Merge branch 'v5.7.0' into 'master'

上线合并

See merge request !15
2 parents 34bee665 f6d3fc0c
......@@ -7,7 +7,7 @@
</parent>
<groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.7.0-SNAPSHOT</version>
<name>platform-merchants-api</name>
<properties>
<deploy.scanPackage>cn.com.glsx.merchants.remote</deploy.scanPackage>
......@@ -30,7 +30,7 @@
<dependency>
<groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.7.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
......
......@@ -98,6 +98,18 @@ public interface MerchantStaffRemote {
@ApiResponse("根据商户查询员工")
RpcResponse<List<MerchantStaffResponse>> findMerchantStaffListRemote(MerchantStaffRequest merchantStaffRequest);
/**
* 根据商户分页查询在职员工
* 在职:北森在职状态
*
* @param pagination 请求参数
* @return 返回参数
* @
*/
@ApiMethod("根据商户分页查询员工")
@ApiParams({@ApiParam(name = "pagination", notes = "根据商户分页查询员工", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)})
@ApiResponse("根据商户分页查询员工")
RpcResponse<RpcPagination<MerchantStaffResponse>> findOnJobMerchantStaffPageRemote(RpcPagination<MerchantStaffRequest> pagination);
/**
* 查询员工列表
......
......@@ -14,7 +14,7 @@
<dependency>
<groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId>
<version>5.6.4-SNAPSHOT</version>
<version>5.7.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.glsx</groupId>
......
......@@ -23,6 +23,15 @@ public interface MerchantStaffMapper extends CommonBaseMapper<MerchantStaff> {
List<MerchantStaffResponse> findMerchantStaff(@Param("merchantStaffRequest") MerchantStaffRequest merchantStaffRequest);
/**
* 分页查询在职员工
* 在职:北森在职状态
*
* @param merchantStaffRequest
* @return
*/
List<MerchantStaffResponse> findOnJobMerchantStaff(@Param("merchantStaffRequest") MerchantStaffRequest merchantStaffRequest);
Page<MerchantStaffResponse> merchantProductByPage(@Param("merchantStaffRequest") MerchantStaffRequest condition);
Page<MerchantStaffResponse> findClaimStaff(@Param("merchantStaffRequest") MerchantStaffRequest condition);
......
......@@ -146,6 +146,23 @@ public class MerchantStaffRemoteImpl implements MerchantStaffRemote {
}
/**
* 根据条件分页查询在职员工信息
* 在职:北森在职状态
*
* @param pagination 请求参数
* @return
*/
@Override
public RpcResponse<RpcPagination<MerchantStaffResponse>> findOnJobMerchantStaffPageRemote(RpcPagination<MerchantStaffRequest> pagination) {
try {
Page<MerchantStaffResponse> list = merchantStaffService.findOnJobMerchantStaffPage(pagination);
return RpcResponse.success(RpcPagination.copyPage(list));
} catch (RpcServiceException e) {
return RpcResponse.error(e);
}
}
/**
* 查询员工列表
*
* @param pagination 入参
......
......@@ -38,7 +38,6 @@ import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.text.NamingCase;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.glsx.plat.common.utils.StringUtils;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
......@@ -407,6 +406,19 @@ public class MerchantStaffService {
return null;
}
public Page<MerchantStaffResponse> findOnJobMerchantStaffPage(RpcPagination<MerchantStaffRequest> pagination) {
MerchantStaffRequest condition = pagination.getCondition();
Page<MerchantStaffResponse> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
String staffLable = condition.getStaffLabel();
if (StringUtils.isNotEmpty(staffLable)) {
List<String> list = Lists.newArrayList(staffLable.split(","));
condition.setStaffLableList(list);
}
merchantStaffMapper.findOnJobMerchantStaff(condition);
return page;
}
/**
* 查询员工列表
*
......
......@@ -214,6 +214,95 @@
and (st.staff_name like concat('%', #{merchantStaffRequest.keyword},'%') or st.staff_phone like concat('%',
#{merchantStaffRequest.keyword},'%'))
</if>
<if test="merchantStaffRequest.staffName!=null and merchantStaffRequest.staffName != ''">
and st.staff_name like concat('%', #{merchantStaffRequest.staffName},'%')
</if>
<if test="merchantStaffRequest.staffPhone!=null and merchantStaffRequest.staffPhone != ''">
and st.staff_phone = #{merchantStaffRequest.staffPhone}
</if>
<if test="merchantStaffRequest.staffLableList != null and merchantStaffRequest.staffLableList.size > 0">
<foreach collection="merchantStaffRequest.staffLableList" item="item" index="index">
and FIND_IN_SET(#{item},staff_label)
</foreach>
</if>
<if test="merchantStaffRequest.staffPhoneList != null and merchantStaffRequest.staffPhoneList.size > 0">
and st.staff_phone in
<foreach collection="merchantStaffRequest.staffPhoneList" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="merchantStaffRequest.staffLabelFlag != null and merchantStaffRequest.staffLabelFlag">
and st.staff_label is not null and st.staff_label != ''
</if>
<if test="merchantStaffRequest.roleName != null and merchantStaffRequest.roleName != ''">
and ro.role_name = #{merchantStaffRequest.roleName}
</if>
<if test="merchantStaffRequest.roleNameLike != null and merchantStaffRequest.roleNameLike != ''">
and ro.role_name like concat('%', #{merchantStaffRequest.roleNameLike},'%')
</if>
<if test="merchantStaffRequest.staffUuid != null and merchantStaffRequest.staffUuid != ''">
and st.staff_uuid = #{merchantStaffRequest.staffUuid}
</if>
<if test="merchantStaffRequest.staffUuidList != null and merchantStaffRequest.staffUuidList.size>0">
and st.staff_uuid in
<foreach collection="merchantStaffRequest.staffUuidList" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="merchantStaffRequest.shareStaffUuid != null and merchantStaffRequest.shareStaffUuid != ''">
and st.share_staff_uuid = #{merchantStaffRequest.shareStaffUuid}
</if>
<if test="merchantStaffRequest.merchantNoList != null and merchantStaffRequest.merchantNoList.size > 0">
and pm.merchantNo in
<foreach collection="merchantStaffRequest.merchantNoList" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="merchantStaffRequest.staffBusinessType != null">
and st.staff_business_type = #{merchantStaffRequest.staffBusinessType}
</if>
<if test="merchantStaffRequest.delFlag != null">
and st.del_flag = #{merchantStaffRequest.delFlag}
</if>
order by st.created_time desc
</select>
<select id="findOnJobMerchantStaff" resultMap="resultMap"
parameterType="cn.com.glsx.merchants.model.request.MerchantStaffRequest">
select st.id, st.staff_name, st.staff_job, st.staff_phone as staff_phone, st.visible_inferior_mer,
st.department,st.staff_uuid ,st.we_chat_avatar_url ,st.staff_business_type,
st.created_by,
st.created_time, st.updated_by, st.updated_time, st.del_flag, st.merchant_id, st.staff_email,
st.staff_code,ro.role_name as roleName,pm.merchant_name as merchantName,
st.effective_time,
st.entmicro_name,
pm.merchantNo,
st.created_name as createdAccount
from platform_merchant_staff st
inner join beisen_employee_info b on st.staff_phone=CONVERT(b.mobile_phone USING utf8mb4) and b.std_is_deleted=0 and b.zz_status = 0
left join platform_merchant_role_staff_relation pr on st.id=pr.staff_id and pr.del_flag=0
left join platform_merchant_role ro on pr.role_id=ro.id and ro.del_flag=0
left join platform_merchant pm on st.merchant_id=pm.id and pm.del_flag=0
where 1=1 and st.del_flag IN (0,2)
<if test="merchantStaffRequest.id !=null and merchantStaffRequest.id != ''">
and st.id=#{merchantStaffRequest.id}
</if>
<if test="merchantStaffRequest.merchantId !=null and merchantStaffRequest.merchantId != ''">
and st.merchant_id=#{merchantStaffRequest.merchantId}
</if>
<if test="merchantStaffRequest.merchantNo !=null ">
and pm.merchantNo=#{merchantStaffRequest.merchantNo}
</if>
<if test="merchantStaffRequest.keyword!=null and merchantStaffRequest.keyword != ''">
and (st.staff_name like concat('%', #{merchantStaffRequest.keyword},'%') or st.staff_phone like concat('%',
#{merchantStaffRequest.keyword},'%'))
</if>
<if test="merchantStaffRequest.staffName!=null and merchantStaffRequest.staffName != ''">
and st.staff_name like concat('%', #{merchantStaffRequest.staffName},'%')
</if>
<if test="merchantStaffRequest.staffPhone!=null and merchantStaffRequest.staffPhone != ''">
and st.staff_phone = #{merchantStaffRequest.staffPhone}
</if>
<if test="merchantStaffRequest.staffLableList != null and merchantStaffRequest.staffLableList.size > 0">
<foreach collection="merchantStaffRequest.staffLableList" item="item" index="index">
and FIND_IN_SET(#{item},staff_label)
......
package cn.com.glsx.merchants.service;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.merchants.model.request.MerchantStaffRequest;
import cn.com.glsx.merchants.model.response.MerchantStaffResponse;
import com.github.pagehelper.Page;
import junit.framework.TestCase;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2026/3/14
**/
public class MerchantStaffServiceTest extends BaseServiceTest {
@Autowired
private MerchantStaffService merchantStaffService;
@Test
public void testFindMerchantStaffPageRemote() {
RpcPagination<MerchantStaffRequest> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(2);
MerchantStaffRequest condition = new MerchantStaffRequest();
condition.setMerchantNo(44209813);// 广联内部使用 商户号
condition.setRoleName("飞行督导");
condition.setDelFlag((byte) 0);
// condition.setStaffName("谢海旭");
condition.setStaffPhone("13603070903");
pagination.setCondition(condition);
Page<MerchantStaffResponse> page = merchantStaffService.findOnJobMerchantStaffPage(pagination);
TestCase.assertNotNull(page);
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!