|
@@ -20,6 +20,7 @@ import com.zjugis.module.adm.dal.dataobject.staff.*;
|
|
|
import com.zjugis.module.adm.dal.mysql.certificate.CertMapper;
|
|
|
import com.zjugis.module.adm.dal.mysql.staff.*;
|
|
|
import com.zjugis.module.infra.api.ding.DingApi;
|
|
|
+import com.zjugis.module.infra.api.ding.dto.DingMessageDto;
|
|
|
import com.zjugis.module.infra.api.ding.dto.StaffDTO;
|
|
|
import com.zjugis.module.system.api.user.AdminUserApi;
|
|
|
import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
|
|
@@ -350,15 +351,6 @@ public class RecordsServiceImpl implements RecordsService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- //钉钉邀请
|
|
|
- StaffDTO staff = new StaffDTO();
|
|
|
- staff.setNickname(staffRecordSDO.getNickname());
|
|
|
- staff.setMobile(staffRecordSDO.getMobilePhone());
|
|
|
- staff.setDeptName(staffRecordSDO.getDeptName());
|
|
|
- staff.setLoginName(staffRecordSDO.getLoginName());
|
|
|
- dingApi.entry(staff);
|
|
|
-
|
|
|
-
|
|
|
return user.getUserId();
|
|
|
}
|
|
|
|
|
@@ -439,7 +431,9 @@ public class RecordsServiceImpl implements RecordsService {
|
|
|
return recordsMapper.updateById(staffRecordSDO);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public String report(StaffReportDTO dto) {
|
|
|
StaffRecordSDO staffRecordSDO = new StaffRecordSDO();
|
|
|
if (StrUtil.isNotEmpty(dto.getUserId())) {
|
|
@@ -487,12 +481,27 @@ public class RecordsServiceImpl implements RecordsService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //钉钉邀请
|
|
|
+ StaffDTO staff = new StaffDTO();
|
|
|
+ staff.setNickname(staffRecordSDO.getNickname());
|
|
|
+ staff.setMobile(staffRecordSDO.getMobilePhone());
|
|
|
+ staff.setDeptName(staffRecordSDO.getDeptName());
|
|
|
+ staff.setLoginName(staffRecordSDO.getLoginName());
|
|
|
+ try {
|
|
|
+ dingApi.entry(staff).getCheckedData();
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("钉钉邀请失败:" + e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//新建员工账号以及其相关的关系 如果账号已经存在就开启账号的使用状态 以及修改其相关的权限和部门关系
|
|
|
UserBaseDTO user = initUser(staffRecordSDO);
|
|
|
CommonResult<String> result = userApi.createUser(user);
|
|
|
if (result.getCode() != 0) {
|
|
|
throw new RuntimeException(result.getMsg());
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
return result.getCheckedData();
|
|
|
}
|
|
|
|