Commit 0b4aa2ab by 徐高华

鸿星尔克

parent 68f061ac
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.QywxCallBackDTO; import com.gic.haoban.manage.api.dto.QywxCallBackDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum; import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import java.util.List; import java.util.List;
...@@ -64,4 +65,19 @@ public interface MessageApiService { ...@@ -64,4 +65,19 @@ public interface MessageApiService {
ServiceResponse<Void> sendOrderMessage(String enterpriseId, NoticeMessageTypeEnum noticeType, String relationId, ServiceResponse<Void> sendOrderMessage(String enterpriseId, NoticeMessageTypeEnum noticeType, String relationId,
String refundStoreId , String clerkId, String memberId, List<String> valueList); String refundStoreId , String clerkId, String memberId, List<String> valueList);
/**
* 通过通讯录-鸿星尔克
* @param wxEnterpriseId
* @param staffName
* @param qwDTO
* @param qwUserId
* @param mainDeptId
* @param position
* @param gender
* @param mobile
* @param nationcode
*/
public void updateForSyncStaff(String wxEnterpriseId, String staffName , WxEnterpriseQwDTO qwDTO , String qwUserId , String mainDeptId , String position ,
Integer gender, String mobile , String nationcode) ;
} }
...@@ -222,11 +222,12 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -222,11 +222,12 @@ public class MessageApiServiceImpl implements MessageApiService {
* @param secret * @param secret
*/ */
private void dealClerkUser(QywxCallBackDTO dto, String enterpriseId, String secret, String staffName , WxEnterpriseQwDTO qwDTO) { private void dealClerkUser(QywxCallBackDTO dto, String enterpriseId, String secret, String staffName , WxEnterpriseQwDTO qwDTO) {
log.info("鸿星尔克={}",JSONObject.toJSONString(dto));
ClerkQwDTO clerkQwDTO = new ClerkQwDTO(); ClerkQwDTO clerkQwDTO = new ClerkQwDTO();
clerkQwDTO.setEnterpriseId(enterpriseId); clerkQwDTO.setEnterpriseId(enterpriseId);
String mainDeptId = dto.getMainDepartment(); String mainDeptId = dto.getMainDepartment();
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> departments = qywxDepartmentApiService List<com.gic.wechat.api.dto.qywx.DepartmentDTO> departments = qywxDepartmentApiService
.listSelfDepartment(dto.getAuthCorpId(), secret, Integer.valueOf(mainDeptId),qwDTO.getUrlHost()); .listSelfDepartment(qwDTO.getDkCorpid(), secret, Integer.valueOf(mainDeptId),qwDTO.getUrlHost());
if (CollectionUtils.isEmpty(departments)) { if (CollectionUtils.isEmpty(departments)) {
log.info("通过主部门查询部门列表为空 mainDeptId:{}", mainDeptId); log.info("通过主部门查询部门列表为空 mainDeptId:{}", mainDeptId);
return; return;
...@@ -515,6 +516,22 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -515,6 +516,22 @@ public class MessageApiServiceImpl implements MessageApiService {
log.info("处理部门end:{}", JSON.toJSONString(qywxCallBackDTO)); log.info("处理部门end:{}", JSON.toJSONString(qywxCallBackDTO));
} }
public void updateForSyncStaff(String wxEnterpriseId, String staffName , WxEnterpriseQwDTO qwDTO , String qwUserId , String mainDeptId , String position ,
Integer gender, String mobile , String nationcode ) {
boolean suitWxEnterpriseIid = checkSuitEnterpriseId(wxEnterpriseId);
if (suitWxEnterpriseIid) {
QywxCallBackDTO qwUser = new QywxCallBackDTO() ;
qwUser.setUserid(qwUserId);
qwUser.setChangeType("create_user");
qwUser.setMainDepartment(mainDeptId);
qwUser.setPosition(position);
qwUser.setGender(gender);
qwUser.setMobile(mobile);
qwUser.setTelephone(nationcode);
// 鸿星尔克定制
dealErKe(qwUser, wxEnterpriseId, staffName,qwDTO);
}
}
/** /**
* 处理鸿星尔克定制需求 * 处理鸿星尔克定制需求
* *
......
...@@ -32,6 +32,7 @@ import com.gic.haoban.manage.api.enums.ChannelCodeEnum; ...@@ -32,6 +32,7 @@ import com.gic.haoban.manage.api.enums.ChannelCodeEnum;
import com.gic.haoban.manage.api.enums.SecretTypeEnum; import com.gic.haoban.manage.api.enums.SecretTypeEnum;
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.DealSyncOperationApiService;
import com.gic.haoban.manage.api.service.MessageApiService;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper; import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper;
...@@ -131,6 +132,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -131,6 +132,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private HaobanQywxFeeOrderAccountService haobanQywxFeeOrderAccountService; private HaobanQywxFeeOrderAccountService haobanQywxFeeOrderAccountService;
@Autowired @Autowired
private HaobanQywxFeeOrderService haobanQywxFeeOrderService; private HaobanQywxFeeOrderService haobanQywxFeeOrderService;
@Autowired
private MessageApiService messageApiService ;
@Override @Override
public StaffDTO selectById(String staffId) { public StaffDTO selectById(String staffId) {
...@@ -355,6 +358,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -355,6 +358,8 @@ public class StaffApiServiceImpl implements StaffApiService {
staff.setActiveFlag(0); staff.setActiveFlag(0);
staff.setCreateTime(new Date()); staff.setCreateTime(new Date());
staffService.add(staff); staffService.add(staff);
this.messageApiService.updateForSyncStaff(wxEnterpriseId,staff.getStaffName(),qwDTO,staff.getWxUserId(),
user.getMain_department(),user.getPosition(),staff.getSex(),user.getMobile(), staff.getNationCode());
} else { } else {
staffService.updateByPrimaryKey(staff); staffService.updateByPrimaryKey(staff);
} }
......
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