Commit 64f9d592 by 徐高华

企微托管账号

parent a3c9992d
...@@ -73,6 +73,19 @@ public class StaffListDTO implements Serializable { ...@@ -73,6 +73,19 @@ public class StaffListDTO implements Serializable {
private String loginEnterpriseId ; private String loginEnterpriseId ;
/**
* 企微托管页面查询1是0否
*/
private int qwOpenFlag ;
public int getQwOpenFlag() {
return qwOpenFlag;
}
public void setQwOpenFlag(int qwOpenFlag) {
this.qwOpenFlag = qwOpenFlag;
}
public String getLoginEnterpriseId() { public String getLoginEnterpriseId() {
return loginEnterpriseId; return loginEnterpriseId;
} }
......
...@@ -39,4 +39,6 @@ public interface OpenStaffMapper { ...@@ -39,4 +39,6 @@ public interface OpenStaffMapper {
List<OpenStaffDTO> list(OpenStaffPageQDTO qdto); List<OpenStaffDTO> list(OpenStaffPageQDTO qdto);
TabOpenStaff getByQwUserId(@Param("qwUserId")Long qwUserId); TabOpenStaff getByQwUserId(@Param("qwUserId")Long qwUserId);
List<String> listAllStaffId(String wxEnterpriseId);
} }
\ No newline at end of file
...@@ -7,6 +7,8 @@ import com.gic.haoban.manage.api.dto.OpenStaffDTO; ...@@ -7,6 +7,8 @@ import com.gic.haoban.manage.api.dto.OpenStaffDTO;
import com.gic.haoban.manage.api.qdto.OpenStaffPageQDTO; import com.gic.haoban.manage.api.qdto.OpenStaffPageQDTO;
import com.gic.haoban.manage.service.entity.TabOpenStaff; import com.gic.haoban.manage.service.entity.TabOpenStaff;
import java.util.List;
public interface OpenStaffService { public interface OpenStaffService {
public TabOpenStaff save(TabOpenStaff tab) ; public TabOpenStaff save(TabOpenStaff tab) ;
...@@ -16,4 +18,6 @@ public interface OpenStaffService { ...@@ -16,4 +18,6 @@ public interface OpenStaffService {
public void logout(String uuid) ; public void logout(String uuid) ;
ServiceResponse<Page<OpenStaffDTO>> page(OpenStaffPageQDTO qdto, BasePageInfo basePageInfo); ServiceResponse<Page<OpenStaffDTO>> page(OpenStaffPageQDTO qdto, BasePageInfo basePageInfo);
List<String> listAllStaffId(String wxEnterpriseId) ;
} }
...@@ -81,4 +81,9 @@ public class OpenStaffServiceImpl implements OpenStaffService { ...@@ -81,4 +81,9 @@ public class OpenStaffServiceImpl implements OpenStaffService {
Page<OpenStaffDTO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, OpenStaffDTO.class); Page<OpenStaffDTO> retPage = PageHelperUtils.changePageHelperToCurrentPage(list, OpenStaffDTO.class);
return ServiceResponse.success(retPage); return ServiceResponse.success(retPage);
} }
@Override
public List<String> listAllStaffId(String wxEnterpriseId) {
return this.openStaffMapper.listAllStaffId(wxEnterpriseId);
}
} }
...@@ -135,6 +135,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -135,6 +135,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private MessageApiService messageApiService ; private MessageApiService messageApiService ;
@Autowired @Autowired
private StoreService storeService ; private StoreService storeService ;
@Autowired
private OpenStaffService openStaffService ;
@Override @Override
public StaffDTO selectById(String staffId) { public StaffDTO selectById(String staffId) {
...@@ -174,6 +176,9 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -174,6 +176,9 @@ public class StaffApiServiceImpl implements StaffApiService {
String wxEnterpriseId = staffListDTO.getWxEnterpriseId(); String wxEnterpriseId = staffListDTO.getWxEnterpriseId();
BasePageInfo pageInfo = staffListDTO.getPageInfo(); BasePageInfo pageInfo = staffListDTO.getPageInfo();
String enterpriseIdParam = staffListDTO.getEnterpriseIdParam(); String enterpriseIdParam = staffListDTO.getEnterpriseIdParam();
if(staffListDTO.getQwOpenFlag()==1) {
enterpriseIdParam = staffListDTO.getLoginEnterpriseId() ;
}
List<String> staffIds = new ArrayList<>(); List<String> staffIds = new ArrayList<>();
//查询所属品牌成员id //查询所属品牌成员id
if(StrUtil.isNotBlank(enterpriseIdParam)){ if(StrUtil.isNotBlank(enterpriseIdParam)){
...@@ -196,6 +201,13 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -196,6 +201,13 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
} }
} }
if(staffListDTO.getQwOpenFlag()==1) {
List<String> list = this.openStaffService.listAllStaffId(wxEnterpriseId) ;
staffIds = staffIds.stream().filter(o->!list.contains(o)).collect(Collectors.toList());
}
if (CollectionUtils.isEmpty(staffIds)){
return new Page<>();
}
StaffListBO staffListBO = EntityUtil.changeEntityByJSON(StaffListBO.class, staffListDTO); StaffListBO staffListBO = EntityUtil.changeEntityByJSON(StaffListBO.class, staffListDTO);
staffListBO.setStaffIds(staffIds); staffListBO.setStaffIds(staffIds);
staffListBO.setRelationFlag(relationFlag); staffListBO.setRelationFlag(relationFlag);
......
...@@ -129,4 +129,9 @@ ...@@ -129,4 +129,9 @@
from tab_haoban_open_staff where qw_user_id = #{qwUserId} and delete_flag = 0 from tab_haoban_open_staff where qw_user_id = #{qwUserId} and delete_flag = 0
</select> </select>
<select id="listAllStaffId" resultType="java.lang.String">
select staff_id from tab_haoban_open_staff where wx_enterprise_id = #{wxEnterpriseId} and delete_flag = 0
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -52,11 +52,14 @@ public class QywxOpenController { ...@@ -52,11 +52,14 @@ public class QywxOpenController {
* @return * @return
*/ */
@RequestMapping("open-staff-page") @RequestMapping("open-staff-page")
public RestResponse<Page<OpenStaffVO>> page(@RequestBody OpenStaffQO qo,BasePageInfo basePageInfo) { public RestResponse<Page<OpenStaffVO>> page(@RequestBody OpenStaffQO qo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
OpenStaffPageQDTO qdto = EntityUtil.changeEntityByJSON(OpenStaffPageQDTO.class,qo) ; OpenStaffPageQDTO qdto = EntityUtil.changeEntityByJSON(OpenStaffPageQDTO.class,qo) ;
qdto.setWxEnterpriseId(loginUser.getWxEnterpriseId()); qdto.setWxEnterpriseId(loginUser.getWxEnterpriseId());
qdto.setEnterpriseId(loginUser.getEnterpriseId()); qdto.setEnterpriseId(loginUser.getEnterpriseId());
BasePageInfo basePageInfo = new BasePageInfo() ;
basePageInfo.setPageNum(qo.getPageNum());
basePageInfo.setPageSize(qo.getPageSize());
ServiceResponse<Page<OpenStaffDTO>> pageResp = this.openStaffApiService.page(qdto, basePageInfo); ServiceResponse<Page<OpenStaffDTO>> pageResp = this.openStaffApiService.page(qdto, basePageInfo);
Page<OpenStaffDTO> page = pageResp.getResult(); Page<OpenStaffDTO> page = pageResp.getResult();
Page<OpenStaffVO> retPage = PageHelperUtils.changePageToCurrentPage(page, OpenStaffVO.class); Page<OpenStaffVO> retPage = PageHelperUtils.changePageToCurrentPage(page, OpenStaffVO.class);
...@@ -64,7 +67,7 @@ public class QywxOpenController { ...@@ -64,7 +67,7 @@ public class QywxOpenController {
} }
/** /**
* 托管列表 * 托管列表导出
* @param qo * @param qo
* @return * @return
*/ */
...@@ -140,7 +143,7 @@ public class QywxOpenController { ...@@ -140,7 +143,7 @@ public class QywxOpenController {
* @return * @return
*/ */
@RequestMapping("check-code") @RequestMapping("check-code")
public RestResponse<OpenStaffDTO> checkCode(Long openStaffId , String code) { public RestResponse<Void> checkCode(Long openStaffId , String code) {
ServiceResponse<Void> resp = this.openStaffApiService.checkCode(openStaffId,code) ; ServiceResponse<Void> resp = this.openStaffApiService.checkCode(openStaffId,code) ;
if(!resp.isSuccess()) { if(!resp.isSuccess()) {
return RestResponse.failure("9999",resp.getMessage()) ; return RestResponse.failure("9999",resp.getMessage()) ;
......
...@@ -65,6 +65,19 @@ public class StaffListQO implements Serializable { ...@@ -65,6 +65,19 @@ public class StaffListQO implements Serializable {
private String clerkId ; private String clerkId ;
/**
* 企微托管页面查询1是0否
*/
private int qwOpenFlag ;
public int getQwOpenFlag() {
return qwOpenFlag;
}
public void setQwOpenFlag(int qwOpenFlag) {
this.qwOpenFlag = qwOpenFlag;
}
public String getClerkId() { public String getClerkId() {
return clerkId; return clerkId;
} }
......
package com.gic.haoban.manage.web.qo.open; package com.gic.haoban.manage.web.qo.open;
import com.gic.api.base.commons.BasePageInfo;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class OpenStaffQO extends BasePageInfo implements Serializable{
/**
* 1授权中 2已过期 3待验证 4待授权 0全部
*/
private int status ;
/**
* 导购
*/
private String clerkId ;
/**
* 成员
*/
private String staffParams ;
/**
* 门店分组
*/
private List<String> storeGroupIdList ;
/**
* 开始日期
*/
private Date startDate ;
/**
* 结束日期
*/
private Date endDate ;
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getStaffParams() {
return staffParams;
}
public void setStaffParams(String staffParams) {
this.staffParams = staffParams;
}
public List<String> getStoreGroupIdList() {
return storeGroupIdList;
}
public void setStoreGroupIdList(List<String> storeGroupIdList) {
this.storeGroupIdList = storeGroupIdList;
}
public class OpenStaffQO implements Serializable { public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
} }
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