提交 b4c9bbbb 作者: 刘明祎-运维用途

调整培训机构加盟入住

上级 84c82088
流水线 #7102 已通过 于阶段
in 2 分 27 秒
...@@ -79,4 +79,7 @@ public class LicenseOrganizationsVO { ...@@ -79,4 +79,7 @@ public class LicenseOrganizationsVO {
@NotNull(message = "机构详情", groups = {Create.class, Update.class}) @NotNull(message = "机构详情", groups = {Create.class, Update.class})
private String detail; private String detail;
@ApiModelProperty(value = "后台用户id")
private Integer backUserId;
} }
package com.mmc.iuav.user.client; package com.mmc.iuav.user.client;
import com.alibaba.fastjson2.JSONArray;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.response.ResultEnum;
import com.mmc.iuav.user.entity.CompanyInfoDO; import com.mmc.iuav.user.entity.CompanyInfoDO;
import com.mmc.iuav.user.model.vo.LicenseOrganizationsVO; import com.mmc.iuav.user.model.vo.LicenseOrganizationsVO;
import com.mmc.iuav.user.model.vo.WalletUsersVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static com.alibaba.fastjson2.JSON.parseObject;
@Component @Component
public class ImsClient { public class ImsClient {
...@@ -22,13 +31,18 @@ public class ImsClient { ...@@ -22,13 +31,18 @@ public class ImsClient {
@Autowired @Autowired
private RestTemplate restTemplate; private RestTemplate restTemplate;
public ResultBody insertOrganizations(CompanyInfoDO companyInfoDO, String token) { public ResultBody insertOrganizations(CompanyInfoDO companyInfoDO, String token,Integer backUserId){
LicenseOrganizationsVO licenseOrganizationsVO = companyInfoDO.buildLicenseOrganizationsVO(); LicenseOrganizationsVO licenseOrganizationsVO = companyInfoDO.buildLicenseOrganizationsVO();
licenseOrganizationsVO.setDetail("无");
licenseOrganizationsVO.setTestCenter(0);
licenseOrganizationsVO.setBackUserId(backUserId);
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON); headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("token", token); headers.add("token", token);
HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(licenseOrganizationsVO), headers); HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(licenseOrganizationsVO), headers);
ResponseEntity<ResultBody> responseEntity = restTemplate.exchange(imsAppUri + "/licence/background/insertOrg", HttpMethod.POST, entity, ResultBody.class); ResponseEntity<ResultBody> responseEntity = restTemplate.exchange(imsAppUri + "/release/licence/background/insertOrg", HttpMethod.POST, entity, ResultBody.class);
return responseEntity.getBody(); return responseEntity.getBody();
} }
} }
...@@ -14,6 +14,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -14,6 +14,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
...@@ -126,7 +127,7 @@ public class CooperationController extends BaseController { ...@@ -126,7 +127,7 @@ public class CooperationController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("approvalApplyTag") @GetMapping("approvalApplyTag")
public ResultBody approvalApplyTag( public ResultBody approvalApplyTag(
@RequestParam(value = "id") Integer id, @RequestParam(value = "status") Boolean status,HttpServletRequest request) { @RequestParam(value = "id") Integer id, @RequestParam(value = "status") Boolean status,HttpServletRequest request){
return cooperationService.approvalApplyTag(id, status , request.getHeader("token")); return cooperationService.approvalApplyTag(id, status , request.getHeader("token"));
} }
......
...@@ -7,6 +7,7 @@ import com.mmc.iuav.user.model.qo.ApplyQO; ...@@ -7,6 +7,7 @@ import com.mmc.iuav.user.model.qo.ApplyQO;
import com.mmc.iuav.user.model.qo.CompanyInfoQO; import com.mmc.iuav.user.model.qo.CompanyInfoQO;
import com.mmc.iuav.user.model.vo.*; import com.mmc.iuav.user.model.vo.*;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
......
...@@ -86,6 +86,7 @@ public class BackUserAccountServiceImpl implements BackUserAccountService { ...@@ -86,6 +86,7 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
} }
} }
backUserAccountDao.insertBackUserAccount(backUserAccountDO); backUserAccountDao.insertBackUserAccount(backUserAccountDO);
bUserAccountVO.setId(backUserAccountDO.getId());
// 添加角色 // 添加角色
roleDao.insertUserRoleRel(backUserAccountDO.getId(), bUserAccountVO.getRoleId()); roleDao.insertUserRoleRel(backUserAccountDO.getId(), bUserAccountVO.getRoleId());
// 添加单位信息 // 添加单位信息
......
...@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -29,6 +29,7 @@ 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 java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
...@@ -198,7 +199,7 @@ public class CooperationServiceImpl implements CooperationService { ...@@ -198,7 +199,7 @@ public class CooperationServiceImpl implements CooperationService {
@Transactional @Transactional
@Override @Override
public ResultBody approvalApplyTag(Integer id, Boolean status,String token) { public ResultBody approvalApplyTag(Integer id, Boolean status,String token){
// 判断用户是否已经是该渠道 // 判断用户是否已经是该渠道
UserApplyTagDO userApplyTag = cooperationDao.getUserApplyTag(id); UserApplyTagDO userApplyTag = cooperationDao.getUserApplyTag(id);
int count = int count =
...@@ -225,7 +226,7 @@ public class CooperationServiceImpl implements CooperationService { ...@@ -225,7 +226,7 @@ public class CooperationServiceImpl implements CooperationService {
//如果加盟商是培训机构还要生成这个培训机构的基本信息 //如果加盟商是培训机构还要生成这个培训机构的基本信息
if(userApplyTag.getCooperationTagId() == 4) { if(userApplyTag.getCooperationTagId() == 4) {
log.info("飞手培训机构信息 =====》,{}",userApplyTag.getCompanyInfoDO()); log.info("飞手培训机构信息 =====》,{}",userApplyTag.getCompanyInfoDO());
imsClient.insertOrganizations(userApplyTag.getCompanyInfoDO(),token); return imsClient.insertOrganizations(userApplyTag.getCompanyInfoDO(),token,bUserAccountVO.getId());
} }
SmsUtil.sendPassCooperationApply(bUserAccountVO.getPhoneNum()); SmsUtil.sendPassCooperationApply(bUserAccountVO.getPhoneNum());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论