Commit 6645a10b by songyinghui

Merge remote-tracking branch 'origin/master' into feature-content4

parents 83380e85 3386c8db
...@@ -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) ;
} }
...@@ -545,6 +545,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ ...@@ -545,6 +545,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
return "没有数据同步或权限没设置全部"; return "没有数据同步或权限没设置全部";
} }
logger.info("企微部门数={}",list.size()); logger.info("企微部门数={}",list.size());
syncTaskService.updateTaskStatus(taskId, SyncTaskStatusEnum.group_sync.getVal());
List<TabHaobanPreDealLog> dealLogList = list.stream().map(dto -> { List<TabHaobanPreDealLog> dealLogList = list.stream().map(dto -> {
TabHaobanPreDealLog dealLog = new TabHaobanPreDealLog(); TabHaobanPreDealLog dealLog = new TabHaobanPreDealLog();
dealLog.setDataId(dto.getId().toString()); dealLog.setDataId(dto.getId().toString());
...@@ -915,6 +916,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ ...@@ -915,6 +916,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
return false; return false;
} }
if(type==0) { if(type==0) {
this.syncTaskService.updateTaskStatus(taskId,4) ;
logger.info("部门成功,开始同步成员:{}", taskId); logger.info("部门成功,开始同步成员:{}", taskId);
String key = "haoban_sync_department_task_" + taskId; String key = "haoban_sync_department_task_" + taskId;
RedisUtil.lock(key, 3L); RedisUtil.lock(key, 3L);
......
...@@ -206,9 +206,9 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -206,9 +206,9 @@ public class MessageApiServiceImpl implements MessageApiService {
// 鸿星尔克 // 鸿星尔克
"e034e2bd5d0b44d3bf553c9f8204094c", "e034e2bd5d0b44d3bf553c9f8204094c",
// 润臣测试环境 // 润臣测试环境
"ca66a01b79474c40b3e7c7f93daf1a3b", "b18ffdc9d0644912865a248859914d80",
// 尊兴 // 尊兴
"c0c2186a947440aa8c0afbdd869ec043", "fb40256db41142a196b21ccf03e58507",
// 金华悦行 // 金华悦行
"ac451a350eed4a96958dd5c7377f8bd9"); "ac451a350eed4a96958dd5c7377f8bd9");
return wxSet.contains(wxEnterpriseId); return wxSet.contains(wxEnterpriseId);
...@@ -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);
} }
......
...@@ -203,7 +203,6 @@ public class QywxDeptSyncOperation implements BaseSyncOperation { ...@@ -203,7 +203,6 @@ public class QywxDeptSyncOperation implements BaseSyncOperation {
return dealLog; return dealLog;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
this.preDealService.insert(preDealLogList); this.preDealService.insert(preDealLogList);
this.syncTaskService.updateTaskStatus(taskId,4) ;
} }
return null ; return null ;
} }
......
...@@ -7,6 +7,7 @@ import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO; ...@@ -7,6 +7,7 @@ import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum; import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.service.HandoverOperationApiService; import com.gic.haoban.manage.api.service.HandoverOperationApiService;
import com.gic.haoban.manage.api.service.QywxTagApiService; import com.gic.haoban.manage.api.service.QywxTagApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService; import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
...@@ -35,10 +36,13 @@ public class ChatTest { ...@@ -35,10 +36,13 @@ public class ChatTest {
@Autowired @Autowired
private HandoverOperationApiService handoverOperationApiService; private HandoverOperationApiService handoverOperationApiService;
@Autowired
private StaffApiService staffApiService ;
@Test @Test
public void test() { public void test() {
this.handoverOperationApiService.dealQywxEnterpriseHandoverMq("ca66a01b79474c40b3e7c7f93daf1a3b") ; this.staffApiService.updateStaffHead("ca66a01b79474c40b3e7c7f93daf1a3b","d7c29cb654b543d1966181c2ec2186ea","https://pic01-10001430.image.myqcloud.com/04564abc-5e82-4ba7-9ef3-39803438bb2c") ;
// this.handoverOperationApiService.dealQywxEnterpriseHandoverMq("ca66a01b79474c40b3e7c7f93daf1a3b") ;
} }
@Test @Test
......
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