|
|
@@ -2,6 +2,9 @@ package com.dk.oauth.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.dk.common.infrastructure.enums.ErrorCodeEnum;
|
|
|
+import com.dk.common.model.response.mst.StaffResponse;
|
|
|
+import com.dk.common.model.vo.mst.StaffVO;
|
|
|
+import com.dk.common.response.ResponseCodeEnum;
|
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
import com.dk.oauth.entity.Company;
|
|
|
@@ -92,14 +95,24 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
|
|
|
|
|
// 生成员工
|
|
|
UserLogin userLogin = userMapper.selectById(company.getOwner());
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
- map.put("staffName",userLogin.getUserPhone());
|
|
|
- map.put("staffPhone",userLogin.getUserPhone());
|
|
|
- map.put("orgId",userLogin.getUserPhone());
|
|
|
- map.put("staffPhone",userLogin.getUserPhone());
|
|
|
-
|
|
|
- staffFeign.insertFeignStaff(null);
|
|
|
-
|
|
|
+ StaffVO staffVO = new StaffVO();
|
|
|
+ staffVO.setCpId(company.getCpId());
|
|
|
+ staffVO.setStaffName(userLogin.getUserPhone());
|
|
|
+ staffVO.setStaffPhone(userLogin.getUserPhone());
|
|
|
+ staffVO.setOrgId(userLogin.getUserPhone());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ResponseResultVO<StaffResponse> staffResponseResponseResultVO = staffFeign.insertFeignStaff(staffVO);
|
|
|
+ StaffResponse staffResponse;
|
|
|
+ // 如果没有成功返回,状态设置为待审
|
|
|
+ if (staffResponseResponseResultVO.getCode() != ResponseCodeEnum.SUCCESS.getCode()) {
|
|
|
+ // 无用户
|
|
|
+ return ResponseResultUtil.error(ErrorCodeEnum.USER_REGISTER_ERROR.getCode(),
|
|
|
+ ErrorCodeEnum.USER_REGISTER_ERROR.getMessage());
|
|
|
+ } else {
|
|
|
+ staffResponse = staffResponseResponseResultVO.getData();
|
|
|
+ }
|
|
|
// 生成员工权限 角色 仓库 等等。
|
|
|
|
|
|
|