|
@@ -7,14 +7,17 @@ import com.dk.common.response.ResponseResultVO;
|
|
|
import com.dk.oauth.entity.Company;
|
|
import com.dk.oauth.entity.Company;
|
|
|
import com.dk.oauth.entity.UserLogin;
|
|
import com.dk.oauth.entity.UserLogin;
|
|
|
import com.dk.oauth.entity.UserWxLogin;
|
|
import com.dk.oauth.entity.UserWxLogin;
|
|
|
|
|
+import com.dk.oauth.feign.service.StaffFeign;
|
|
|
import com.dk.oauth.mapper.CompanyMapper;
|
|
import com.dk.oauth.mapper.CompanyMapper;
|
|
|
import com.dk.oauth.mapper.UserMapper;
|
|
import com.dk.oauth.mapper.UserMapper;
|
|
|
import com.dk.oauth.service.ICompanyService;
|
|
import com.dk.oauth.service.ICompanyService;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
@@ -32,6 +35,9 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
|
|
@Resource
|
|
@Resource
|
|
|
UserMapper userMapper;
|
|
UserMapper userMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ StaffFeign staffFeign;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @desc : 通过ID查询
|
|
* @desc : 通过ID查询
|
|
|
* @author : admin
|
|
* @author : admin
|
|
@@ -71,18 +77,32 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
|
|
c.setCpName(company.getCpName());
|
|
c.setCpName(company.getCpName());
|
|
|
Long aLong = companyMapper.countByCond(c);
|
|
Long aLong = companyMapper.countByCond(c);
|
|
|
if (aLong > 0) {
|
|
if (aLong > 0) {
|
|
|
- return ResponseResultUtil.error(ErrorCodeEnum.COMPANY_CODE_EXISTS.getCode(), ErrorCodeEnum.COMPANY_CODE_EXISTS.getMessage());
|
|
|
|
|
|
|
+ return ResponseResultUtil.error(ErrorCodeEnum.COMPANY_CODE_EXISTS.getCode(),
|
|
|
|
|
+ ErrorCodeEnum.COMPANY_CODE_EXISTS.getMessage());
|
|
|
}
|
|
}
|
|
|
company.setCurStaffNum(0);
|
|
company.setCurStaffNum(0);
|
|
|
company.setMaxStaffNum(0);
|
|
company.setMaxStaffNum(0);
|
|
|
|
|
+
|
|
|
|
|
+ //获取具体服务的地址
|
|
|
|
|
+ company.setSvcCode(companyMapper.selectServiceAllot(company.getGradeCode()));
|
|
|
companyMapper.insert(company);
|
|
companyMapper.insert(company);
|
|
|
|
|
|
|
|
|
|
+ // 组织机构 -顶级
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// 生成员工
|
|
// 生成员工
|
|
|
UserLogin userLogin = userMapper.selectById(company.getOwner());
|
|
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(map);
|
|
|
|
|
+
|
|
|
|
|
+ // 生成员工权限 角色 仓库 等等。
|
|
|
|
|
|
|
|
- // 生成员工权限
|
|
|
|
|
|
|
|
|
|
- //
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseResultUtil.success(company);
|
|
return ResponseResultUtil.success(company);
|