Commit a8a6fa0e by 墨竹

fix:userid调整

parent c002d98b
...@@ -32,14 +32,6 @@ public interface HandoverOperationApiService { ...@@ -32,14 +32,6 @@ public interface HandoverOperationApiService {
public void dealQywxEnterpriseHandoverMq(String wxEnterpriseId); public void dealQywxEnterpriseHandoverMq(String wxEnterpriseId);
/** /**
* 定时处理企业微信 离职基础的结果(废弃)
*
* @param params
*/
@Deprecated
public void BatchQywxHandoverResultTimeTask(String params);
/**
* 处理企业微信信息 * 处理企业微信信息
* *
* @param wxEnterpriseId * @param wxEnterpriseId
......
package com.gic.haoban.manage.web.controller.test; package com.gic.haoban.manage.web.controller.test;
import static org.slf4j.LoggerFactory.getLogger;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.GICMQClientUtil; import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.enums.QuartzEnum; import com.gic.haoban.manage.api.enums.QuartzEnum;
import com.gic.haoban.manage.api.enums.SyncTaskTypeEnum; import com.gic.haoban.manage.api.enums.SyncTaskTypeEnum;
import com.gic.haoban.manage.api.service.DealSyncOperationApiService; import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.TestApiService;
import com.gic.haoban.manage.api.service.fee.HaobanQywxFeeApiService; import com.gic.haoban.manage.api.service.fee.HaobanQywxFeeApiService;
import com.gic.haoban.manage.web.controller.WebBaseController; import com.gic.haoban.manage.web.controller.WebBaseController;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
...@@ -31,6 +17,17 @@ import com.gic.mq.sdk.GicMQClient; ...@@ -31,6 +17,17 @@ import com.gic.mq.sdk.GicMQClient;
import com.gic.sharing.core.service.api.service.MqApiService; import com.gic.sharing.core.service.api.service.MqApiService;
import com.task.allocation.qo.AllocationTaskQo; import com.task.allocation.qo.AllocationTaskQo;
import com.task.allocation.qo.TaskAllocationComputed; import com.task.allocation.qo.TaskAllocationComputed;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.stream.Collectors;
import static org.slf4j.LoggerFactory.getLogger;
/** /**
* Created 2018/12/17. * Created 2018/12/17.
...@@ -60,6 +57,8 @@ public class TestController extends WebBaseController { ...@@ -60,6 +57,8 @@ public class TestController extends WebBaseController {
private HaobanQywxFeeApiService haobanQywxFeeApiService; private HaobanQywxFeeApiService haobanQywxFeeApiService;
@Autowired @Autowired
private ExternalClerkRelatedApiService externalClerkRelatedApiService ; private ExternalClerkRelatedApiService externalClerkRelatedApiService ;
@Autowired
private WxEnterpriseApiService wxEnterpriseApiService;
/** /**
* 创建定时器 * 创建定时器
...@@ -155,7 +154,12 @@ public class TestController extends WebBaseController { ...@@ -155,7 +154,12 @@ public class TestController extends WebBaseController {
continue; continue;
} }
String wxEnterpriseId = staff.getWxEnterpriseId(); String wxEnterpriseId = staff.getWxEnterpriseId();
String wxUserId = staff.getWxUserId(); String wxUserId = staff.getWxUserId();
WxEnterpriseQwDTO qwInfo = wxEnterpriseApiService.getQwInfo(wxEnterpriseId);
if (qwInfo.needOpenUserId3th()) {
wxUserId = staff.getWxOpenUseId();
}
String taskName = "刷新企业微信好友(" + staff.getStaffName() + ")"; String taskName = "刷新企业微信好友(" + staff.getStaffName() + ")";
String taskId = dealSyncOperationApiService.createWxFriendTaskSingle(staff.getWxEnterpriseId(), taskName, staffId, staff.getStaffName(), SyncTaskTypeEnum.FRIEND_SINGLE.getType()); String taskId = dealSyncOperationApiService.createWxFriendTaskSingle(staff.getWxEnterpriseId(), taskName, staffId, staff.getStaffName(), SyncTaskTypeEnum.FRIEND_SINGLE.getType());
if (StringUtils.isNotBlank(taskId)) { if (StringUtils.isNotBlank(taskId)) {
......
...@@ -77,24 +77,10 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ ...@@ -77,24 +77,10 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
@Override @Override
public void dealQywxEnterpriseHandoverMq(String wxEnterpriseId) { public void dealQywxEnterpriseHandoverMq(String wxEnterpriseId) {
logger.info("离职继承start...{}",wxEnterpriseId); logger.info("离职继承start...{}", wxEnterpriseId);
dealQywxEnterpriseHandover(wxEnterpriseId); dealQywxEnterpriseHandover(wxEnterpriseId);
dealQywxEnterpriseHandoverResult(wxEnterpriseId); dealQywxEnterpriseHandoverResult(wxEnterpriseId);
logger.info("离职继承end...{}",wxEnterpriseId); logger.info("离职继承end...{}", wxEnterpriseId);
}
@Override
public void BatchQywxHandoverResultTimeTask(String params) {
logger.info("离职基础结果开始:{}", params);
List<YwWxEnterpriseDTO> dtoList = wxEnterpriseApiService.listAll();
for (YwWxEnterpriseDTO enterpriseDTO : dtoList) {
try {
dealQywxEnterpriseHandoverResult(enterpriseDTO.getWxEnterpriseId());
} catch (Exception e) {
e.printStackTrace();
logger.info("商户处理异常:{},{}", JSONObject.toJSONString(enterpriseDTO), e);
}
}
} }
@Override @Override
...@@ -107,11 +93,12 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ ...@@ -107,11 +93,12 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
/** /**
* 获取离职成员客户列表 * 获取离职成员客户列表
* @param wxEnterpriseDTO *
* @param wxEnterpriseId
* @return * @return
*/ */
private List<QywxUnassignedInfoDTO> getAllQywxUnassigned(String wxEnterpriseId) { private List<QywxUnassignedInfoDTO> getAllQywxUnassigned(String wxEnterpriseId) {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ; WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
List<QywxUnassignedInfoDTO> ret = new ArrayList<>(); List<QywxUnassignedInfoDTO> ret = new ArrayList<>();
QywxGetUnassignedListDTO unassignedListDTO = null; QywxGetUnassignedListDTO unassignedListDTO = null;
String cursor = null; String cursor = null;
...@@ -138,7 +125,7 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ ...@@ -138,7 +125,7 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
@Override @Override
public void dealQywxEnterpriseHandoverResult(String wxEnterpriseId) { public void dealQywxEnterpriseHandoverResult(String wxEnterpriseId) {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ; WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
Date date = DateUtils.addDays(new Date(), -3); Date date = DateUtils.addDays(new Date(), -3);
String day = DateFormatUtils.format(date, "yyyy-MM-dd"); String day = DateFormatUtils.format(date, "yyyy-MM-dd");
List<TabHandoverTransfer> transfers = handoverService.listTransferByWxEnterpriseId(wxEnterpriseId, day); List<TabHandoverTransfer> transfers = handoverService.listTransferByWxEnterpriseId(wxEnterpriseId, day);
...@@ -243,8 +230,12 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ ...@@ -243,8 +230,12 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
@Override @Override
public void transferFriend(String wxEnterpriseId, List<String> handoverExternalIds, String disStaffId, String storeId) { public void transferFriend(String wxEnterpriseId, List<String> handoverExternalIds, String disStaffId, String storeId) {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ; WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
TabHaobanStaff tabHaobanStaff = staffService.selectById(disStaffId); TabHaobanStaff tabHaobanStaff = staffService.selectById(disStaffId);
String takeoverUserId = tabHaobanStaff.getWxUserId();
if (qwDTO.needOpenUserId3th()) {
takeoverUserId = tabHaobanStaff.getWxOpenUseId();
}
List<TabHandoverExternal> externalList = handoverService.listByIds(wxEnterpriseId, handoverExternalIds); List<TabHandoverExternal> externalList = handoverService.listByIds(wxEnterpriseId, handoverExternalIds);
//分配人与客户的关联map //分配人与客户的关联map
Map<String, List<String>> handoverStaffExternalMap = externalList.stream().collect(Collectors.groupingBy(dto -> dto.getUserId(), Collectors.mapping(TabHandoverExternal::getExternalUserId, Collectors.toList()))); Map<String, List<String>> handoverStaffExternalMap = externalList.stream().collect(Collectors.groupingBy(dto -> dto.getUserId(), Collectors.mapping(TabHandoverExternal::getExternalUserId, Collectors.toList())));
...@@ -253,14 +244,16 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ ...@@ -253,14 +244,16 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
//TabHandoverExternal 根据分配人wxUserId 分类 主键id //TabHandoverExternal 根据分配人wxUserId 分类 主键id
Map<String, List<String>> userByIdMap = externalList.stream().collect(Collectors.groupingBy(dto -> dto.getUserId(), Collectors.mapping(dto -> dto.getHandoverExternalId(), Collectors.toList()))); Map<String, List<String>> userByIdMap = externalList.stream().collect(Collectors.groupingBy(dto -> dto.getUserId(), Collectors.mapping(dto -> dto.getHandoverExternalId(), Collectors.toList())));
handoverStaffExternalMap.forEach((wxUserId, list) -> { for (Map.Entry<String, List<String>> entry : handoverStaffExternalMap.entrySet()) {
QywxTransferCustomerDTO transferCustomerResp = qywxUserApiService.transferCustomer(qwDTO.getThirdCorpid(), config.getWxSuiteid(), wxUserId, tabHaobanStaff.getWxUserId(), list); String wxUserId = entry.getKey();
List<String> list = entry.getValue();
QywxTransferCustomerDTO transferCustomerResp = qywxUserApiService.transferCustomer(qwDTO.getThirdCorpid(), config.getWxSuiteid(), wxUserId, takeoverUserId, list);
if (transferCustomerResp.getErrcode() != 0) { if (transferCustomerResp.getErrcode() != 0) {
logger.info("转移异常"); logger.info("转移异常");
} }
List<QywxTransferCustomerInfoDTO> customer = transferCustomerResp.getCustomer(); List<QywxTransferCustomerInfoDTO> customer = transferCustomerResp.getCustomer();
if (CollectionUtils.isEmpty(customer)) { if (CollectionUtils.isEmpty(customer)) {
return; continue;
} }
TabHandoverTransfer transfer = new TabHandoverTransfer(); TabHandoverTransfer transfer = new TabHandoverTransfer();
transfer.setExternalCount(list.size()); transfer.setExternalCount(list.size());
...@@ -270,8 +263,7 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ ...@@ -270,8 +263,7 @@ public class HandoverOperationApiServiceImpl implements HandoverOperationApiServ
transfer.setWxEnterpriseId(wxEnterpriseId); transfer.setWxEnterpriseId(wxEnterpriseId);
//执行保存分配后结果 //执行保存分配后结果
handoverService.saveHandoverTransfer(transfer, userByIdMap.get(wxUserId)); handoverService.saveHandoverTransfer(transfer, userByIdMap.get(wxUserId));
}
});
} }
@Override @Override
......
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import java.io.UnsupportedEncodingException; import cn.hutool.core.collection.CollectionUtil;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.clerk.api.dto.ClerkDTO; import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
...@@ -35,14 +19,22 @@ import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMappe ...@@ -35,14 +19,22 @@ import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMappe
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper; import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation; import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated; import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService; import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.wechat.api.dto.qywx.ItemDTO; import com.gic.wechat.api.dto.qywx.ItemDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO; import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import cn.hutool.core.collection.CollectionUtil; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
@Service @Service
public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRelatedApiService { public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRelatedApiService {
...@@ -179,11 +171,9 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -179,11 +171,9 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
return map; return map;
} }
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(staffDTO.getWxEnterpriseId()) ; WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(staffDTO.getWxEnterpriseId()) ;
String wxUserId = ""; String wxUserId = staffDTO.getWxUserId();
if (qwDTO.needOpenUserId3th()) { if (qwDTO.needOpenUserId3th()) {
wxUserId = staffDTO.getWxOpenUseId(); wxUserId = staffDTO.getWxOpenUseId();
} else {
wxUserId = staffDTO.getWxUserId();
} }
map.put("wxUserId", wxUserId); map.put("wxUserId", wxUserId);
map.put("wxEnterpriseId", qwDTO.getWxEnterpriseId()); map.put("wxEnterpriseId", qwDTO.getWxEnterpriseId());
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import java.util.ArrayList; import cn.hutool.core.collection.CollectionUtil;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
...@@ -38,27 +18,9 @@ import com.gic.haoban.common.utils.AuthWebRequestUtil; ...@@ -38,27 +18,9 @@ import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.common.utils.EntityUtil; import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.ClerkMainStoreRelatedDTO; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
import com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO;
import com.gic.haoban.manage.api.dto.StaffClerkInfoDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.dto.WxApplicationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.enums.ChannelCodeEnum; import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService; import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.api.service.DealSyncOperationApiService;
import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.HaobanUserApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.api.service.WxApplicationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.StaffEditJsonQO; import com.gic.haoban.manage.web.qo.StaffEditJsonQO;
import com.gic.haoban.manage.web.vo.ClerkInfoVo; import com.gic.haoban.manage.web.vo.ClerkInfoVo;
...@@ -66,8 +28,19 @@ import com.gic.haoban.manage.web.vo.StaffExportVO; ...@@ -66,8 +28,19 @@ import com.gic.haoban.manage.web.vo.StaffExportVO;
import com.gic.haoban.manage.web.vo.StaffVO; import com.gic.haoban.manage.web.vo.StaffVO;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.hutool.core.collection.CollectionUtil; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Collectors;
@RestController @RestController
...@@ -99,7 +72,7 @@ public class StaffController extends WebBaseController { ...@@ -99,7 +72,7 @@ public class StaffController extends WebBaseController {
@Autowired @Autowired
private ClerkMainStoreRelatedApiService clerkMainStoreRelatedApiService; private ClerkMainStoreRelatedApiService clerkMainStoreRelatedApiService;
@Autowired @Autowired
private HaobanUserApiService haobanUserApiService ; private HaobanUserApiService haobanUserApiService;
@Autowired @Autowired
private DealSyncOperationApiService dealSyncOperationApiService; private DealSyncOperationApiService dealSyncOperationApiService;
...@@ -107,9 +80,9 @@ public class StaffController extends WebBaseController { ...@@ -107,9 +80,9 @@ public class StaffController extends WebBaseController {
@RequestMapping("set-default-gicenterprise") @RequestMapping("set-default-gicenterprise")
public HaobanResponse updateDefaultGicEid(String enterpriseId) { public HaobanResponse updateDefaultGicEid(String enterpriseId) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser(); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String userId = login.getHanbaoUserId() ; String userId = login.getHanbaoUserId();
this.haobanUserApiService.updateDefaultGicEid(userId, enterpriseId); this.haobanUserApiService.updateDefaultGicEid(userId, enterpriseId);
return this.success(null) ; return this.success(null);
} }
@RequestMapping("staff-sel") @RequestMapping("staff-sel")
...@@ -154,7 +127,7 @@ public class StaffController extends WebBaseController { ...@@ -154,7 +127,7 @@ public class StaffController extends WebBaseController {
} }
} }
//员工 //员工
Page<StaffDTO> page = staffApiService.pageStaff(departmentIds, activeFlag, keyWord, pageInfo, relationFlag,wxEnterpriseId); Page<StaffDTO> page = staffApiService.pageStaff(departmentIds, activeFlag, keyWord, pageInfo, relationFlag, wxEnterpriseId);
logger.info("pages={},totalPage={}", page.getCurrentPage(), page.getTotalPage()); logger.info("pages={},totalPage={}", page.getCurrentPage(), page.getTotalPage());
...@@ -192,6 +165,10 @@ public class StaffController extends WebBaseController { ...@@ -192,6 +165,10 @@ public class StaffController extends WebBaseController {
if (staff != null) { if (staff != null) {
String userId = staff.getWxUserId(); String userId = staff.getWxUserId();
wxEnterpriseId = staff.getWxEnterpriseId(); wxEnterpriseId = staff.getWxEnterpriseId();
WxEnterpriseQwDTO qwDTO = wxEnterpriseApiService.getQwInfo(wxEnterpriseId);
if (qwDTO.needOpenUserId3th()) {
userId = staff.getWxOpenUseId();
}
userArr.add(userId); userArr.add(userId);
} }
} }
...@@ -329,11 +306,11 @@ public class StaffController extends WebBaseController { ...@@ -329,11 +306,11 @@ public class StaffController extends WebBaseController {
logger.info("没有权限门店"); logger.info("没有权限门店");
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
logger.info("好办门店数={},wxEnterpriseId={},enterpriseIds={}",storeIds.size(),wxEnterpriseId,enterpriseIds); logger.info("好办门店数={},wxEnterpriseId={},enterpriseIds={}", storeIds.size(), wxEnterpriseId, enterpriseIds);
List<ClerkDTO> clerkDTOList = clerkNewService.listClerkByEnterpriseIdAndSearchAndClerkType(enterpriseIds, storeIds, search); List<ClerkDTO> clerkDTOList = clerkNewService.listClerkByEnterpriseIdAndSearchAndClerkType(enterpriseIds, storeIds, search);
List<ClerkInfoVo> retList = EntityUtil.changeEntityListByJSON(ClerkInfoVo.class, clerkDTOList); List<ClerkInfoVo> retList = EntityUtil.changeEntityListByJSON(ClerkInfoVo.class, clerkDTOList);
if (CollectionUtils.isNotEmpty(retList)) { if (CollectionUtils.isNotEmpty(retList)) {
logger.info("导购数量={}",retList.size()); logger.info("导购数量={}", retList.size());
List<String> clerkIds = retList.stream().map(ClerkInfoVo::getClerkId).collect(Collectors.toList()); List<String> clerkIds = retList.stream().map(ClerkInfoVo::getClerkId).collect(Collectors.toList());
List<StaffClerkRelationDTO> dtos = staffClerkRelationApiService.listByClerkIds(clerkIds); List<StaffClerkRelationDTO> dtos = staffClerkRelationApiService.listByClerkIds(clerkIds);
if (CollectionUtils.isNotEmpty(dtos)) { if (CollectionUtils.isNotEmpty(dtos)) {
...@@ -407,7 +384,7 @@ public class StaffController extends WebBaseController { ...@@ -407,7 +384,7 @@ public class StaffController extends WebBaseController {
@RequestMapping("staff-clerk-bind-log") @RequestMapping("staff-clerk-bind-log")
public HaobanResponse bindLogs(String search, @RequestParam(defaultValue = "-1") Integer optType, BasePageInfo qo) { public HaobanResponse bindLogs(String search, @RequestParam(defaultValue = "-1") Integer optType, BasePageInfo qo) {
WebLoginDTO login = AuthWebRequestUtil.getLoginUser(); WebLoginDTO login = AuthWebRequestUtil.getLoginUser();
String enterpriseId = login.getEnterpriseId() ; String enterpriseId = login.getEnterpriseId();
Page<StaffClerkBindLogDetailDTO> page = staffClerkRelationApiService.pageStaffClerkBindLog(login.getWxEnterpriseId(), search, enterpriseId, optType, qo); Page<StaffClerkBindLogDetailDTO> page = staffClerkRelationApiService.pageStaffClerkBindLog(login.getWxEnterpriseId(), search, enterpriseId, optType, qo);
return resultResponse(HaoBanErrCode.ERR_1, page); return resultResponse(HaoBanErrCode.ERR_1, page);
} }
...@@ -432,7 +409,7 @@ public class StaffController extends WebBaseController { ...@@ -432,7 +409,7 @@ public class StaffController extends WebBaseController {
int pageNum = 1; int pageNum = 1;
while (true) { while (true) {
pageInfo.setPageNum(pageNum); pageInfo.setPageNum(pageNum);
Page<StaffDTO> page = staffApiService.pageStaff(departmentIds, activeFlag, keyWord, pageInfo, relationFlag,wxEnterpriseId); Page<StaffDTO> page = staffApiService.pageStaff(departmentIds, activeFlag, keyWord, pageInfo, relationFlag, wxEnterpriseId);
List<StaffDTO> list = page.getResult(); List<StaffDTO> list = page.getResult();
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
break; break;
......
...@@ -817,7 +817,6 @@ public class ClerkController extends WebBaseController { ...@@ -817,7 +817,6 @@ public class ClerkController extends WebBaseController {
staffClerkRelation.setStoreId(clerk.getStoreId()); staffClerkRelation.setStoreId(clerk.getStoreId());
staffClerkRelation.setEnterpriseId(clerk.getEnterpriseId()); staffClerkRelation.setEnterpriseId(clerk.getEnterpriseId());
staffClerkRelation.setWxEnterpriseId(wxEnterpriseId); staffClerkRelation.setWxEnterpriseId(wxEnterpriseId);
// staffClerkRelation.setWxUserId(wxUserId);
staffClerkRelation.setStaffId(staffId); staffClerkRelation.setStaffId(staffId);
staffClerkRelationApiService.delAndInsert(staffClerkRelation, staffId, ChannelCodeEnum.SELF_BIND.getCode()); staffClerkRelationApiService.delAndInsert(staffClerkRelation, staffId, ChannelCodeEnum.SELF_BIND.getCode());
...@@ -848,7 +847,6 @@ public class ClerkController extends WebBaseController { ...@@ -848,7 +847,6 @@ public class ClerkController extends WebBaseController {
audit.setCommitTime(new Date()); audit.setCommitTime(new Date());
audit.setAuditType(2); audit.setAuditType(2);
auditApiService.insert(audit); auditApiService.insert(audit);
//返回一个dto给陈大爷
StaffClerkRelationDTO resultDTO = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkCode, clerk.getEnterpriseId()); StaffClerkRelationDTO resultDTO = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkCode, clerk.getEnterpriseId());
return resultResponse(HaoBanErrCode.ERR_1, resultDTO); return resultResponse(HaoBanErrCode.ERR_1, resultDTO);
} else { } else {
......
...@@ -383,25 +383,23 @@ public class WxEnterpriseInfoController extends WebBaseController { ...@@ -383,25 +383,23 @@ public class WxEnterpriseInfoController extends WebBaseController {
List<StoreMemberVO> retList = new ArrayList<>(); List<StoreMemberVO> retList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(result)) { if (CollectionUtils.isNotEmpty(result)) {
result.stream().filter(staffClerkInfoDTO -> { result.stream().filter(staffClerkInfoDTO -> staffClerkInfoDTO.getEnterpriseId().equals(qo.getGicEnterpriseId())).forEach(dto -> {
return staffClerkInfoDTO.getEnterpriseId().equals(qo.getGicEnterpriseId()); StoreMemberVO storeMemberVO = new StoreMemberVO();
}).forEach(dto -> {
StoreMemberVO VO = new StoreMemberVO();
StoreDTO store = storeService.getStore(dto.getStoreId()); StoreDTO store = storeService.getStore(dto.getStoreId());
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(dto.getClerkId()); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(dto.getClerkId());
if (null != store && clerkDTO != null) { if (null != store && clerkDTO != null) {
VO.setUserId(staffDTO.getWxUserId()); storeMemberVO.setUserId(staffDTO.getWxUserId());
VO.setStoreId(dto.getStoreId());//为空,则无该值 storeMemberVO.setStoreId(dto.getStoreId());//为空,则无该值
VO.setStoreName(dto.getStoreName()); storeMemberVO.setStoreName(dto.getStoreName());
VO.setWxEnterpriseId(dto.getWxEnterpriseId()); storeMemberVO.setWxEnterpriseId(dto.getWxEnterpriseId());
VO.setEnterpriseId(store.getEnterpriseId()); storeMemberVO.setEnterpriseId(store.getEnterpriseId());
VO.setStoreImg(store.getImageUrl());//先置空 storeMemberVO.setStoreImg(store.getImageUrl());//先置空
VO.setBindFlag(1); storeMemberVO.setBindFlag(1);
VO.setClerkCode(clerkDTO.getClerkCode()); storeMemberVO.setClerkCode(clerkDTO.getClerkCode());
VO.setClerkType(clerkDTO.getClerkType()); storeMemberVO.setClerkType(clerkDTO.getClerkType());
VO.setStaffId(staffDTO.getStaffId()); storeMemberVO.setStaffId(staffDTO.getStaffId());
VO.setClerkId(clerkDTO.getClerkId()); storeMemberVO.setClerkId(clerkDTO.getClerkId());
retList.add(VO); retList.add(storeMemberVO);
} }
}); });
......
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