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

调整培训机构加盟入住

上级 8637e8b9
流水线 #7099 已通过 于阶段
in 2 分 10 秒
package com.mmc.iuav.user.model.vo;
import com.mmc.iuav.group.Create;
import com.mmc.iuav.group.Update;
import io.swagger.annotations.ApiModelProperty;
import jdk.nashorn.internal.runtime.Debug;
import lombok.*;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
/**
* @Author small
* @Date 2023/7/13 16:07
* @Version 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class LicenseOrganizationsVO {
private static final long serialVersionUID = -5814724843819090363L;
@ApiModelProperty(value = "机构id", example = "1")
@NotNull(message = "机构id", groups = Update.class)
private Integer id;
@ApiModelProperty(value = "机构主图不能为空", example = "http://", required = true)
@NotBlank(message = "机构主图不能为空", groups = {Create.class, Update.class})
private String mainImage;
@ApiModelProperty(value = "机构副图不能为空", example = "http://", required = true)
//@NotBlank(message = "机构副图不能为空", groups = {Create.class, Update.class})
private String auxiliaryPicture;
@ApiModelProperty(value = "机构视频", example = "http://")
private String video;
@ApiModelProperty(value = "机构名称不能为空", example = "科比特智能教育", required = true)
@NotBlank(message = "机构名称不能为空", groups = {Create.class, Update.class})
@Size(max = 25, message = "机构名称不能超过25个字符")
private String name;
@ApiModelProperty(value = "机构地区编号", example = "110000,130100", required = true)
@NotBlank(message = "机构地区不能为空", groups = {Create.class, Update.class})
private String region;
@ApiModelProperty(value = "机构地区名称", example = "河北省,石家庄市", required = false)
//@NotBlank(message = "机构地区名称", groups = {Create.class, Update.class})
private String regionName;
@ApiModelProperty(value = "经度", example = "40.892313123", required = true)
private Double longitude;
@ApiModelProperty(value = "纬度", example = "50.892313123", required = true)
private Double latitude;
@ApiModelProperty(value = "机构详细地址", example = "南山区", required = false)
//@NotBlank(message = "机构详细地址不能为空", groups = {Create.class, Update.class})
private String detailedAddress;
@ApiModelProperty(value = "是否是考点机构 0否 1是", example = "0", required = true)
@NotNull(message = "考点机构不能为空 0否 1是", groups = {Create.class, Update.class})
private Integer testCenter;
@ApiModelProperty(value = "机构规模id不能为空", example = "1")
//@NotNull(message = "机构规模id不能为空", groups = {Create.class, Update.class})
// @Size(max = 4, message = "机构规模id不能超过4", groups = {Create.class, Update.class})
@Max(value = 4, groups = {Create.class, Update.class},message = "机构规模id不能超过4")
private Integer scaleId;
@ApiModelProperty(value = "机构描述", example = "机构描述0001")
//@NotNull(message = "机构描述", groups = {Create.class, Update.class})
private String description;
@ApiModelProperty(value = "机构详情", example = "机构详情0001", required = true)
@NotNull(message = "机构详情", groups = {Create.class, Update.class})
private String detail;
}
package com.mmc.iuav.user.client;
import com.alibaba.fastjson2.JSONObject;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.response.ResultEnum;
import com.mmc.iuav.user.entity.CompanyInfoDO;
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.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
@Component
public class ImsClient {
@Value("${iuav.ims.uri}")
private String imsAppUri;
@Autowired
private RestTemplate restTemplate;
public ResultBody insertOrganizations(CompanyInfoDO companyInfoDO, String token) {
LicenseOrganizationsVO licenseOrganizationsVO = companyInfoDO.buildLicenseOrganizationsVO();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("token", token);
HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(licenseOrganizationsVO), headers);
ResponseEntity<ResultBody> responseEntity = restTemplate.exchange(imsAppUri + "/licence/background/insertOrg", HttpMethod.POST, entity, ResultBody.class);
return responseEntity.getBody();
}
}
...@@ -126,8 +126,8 @@ public class CooperationController extends BaseController { ...@@ -126,8 +126,8 @@ 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) { @RequestParam(value = "id") Integer id, @RequestParam(value = "status") Boolean status,HttpServletRequest request) {
return cooperationService.approvalApplyTag(id, status); return cooperationService.approvalApplyTag(id, status , request.getHeader("token"));
} }
@ApiOperation(value = "app-获取合同标签") @ApiOperation(value = "app-获取合同标签")
......
...@@ -3,6 +3,7 @@ package com.mmc.iuav.user.entity; ...@@ -3,6 +3,7 @@ package com.mmc.iuav.user.entity;
import com.mmc.iuav.user.model.vo.ApplyTagEditVO; import com.mmc.iuav.user.model.vo.ApplyTagEditVO;
import com.mmc.iuav.user.model.vo.CompanyAuthVO; import com.mmc.iuav.user.model.vo.CompanyAuthVO;
import com.mmc.iuav.user.model.vo.CompanyInfoVO; import com.mmc.iuav.user.model.vo.CompanyInfoVO;
import com.mmc.iuav.user.model.vo.LicenseOrganizationsVO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -80,6 +81,15 @@ public class CompanyInfoDO implements Serializable { ...@@ -80,6 +81,15 @@ public class CompanyInfoDO implements Serializable {
return CompanyAuthVO.builder().id(this.id).companyName(this.companyName).creditCode(this.creditCode).licenseImg(this.licenseImg).build(); return CompanyAuthVO.builder().id(this.id).companyName(this.companyName).creditCode(this.creditCode).licenseImg(this.licenseImg).build();
} }
public LicenseOrganizationsVO buildLicenseOrganizationsVO() {
return LicenseOrganizationsVO.builder()
.latitude(this.lat)
.longitude(this.lon)
.name(this.companyName)
.mainImage(this.brandLogo)
.build();
}
public CompanyInfoDO(CompanyInfoVO companyInfo) { public CompanyInfoDO(CompanyInfoVO companyInfo) {
this.id = companyInfo.getId(); this.id = companyInfo.getId();
this.companyType = companyInfo.getCompanyType(); this.companyType = companyInfo.getCompanyType();
......
...@@ -52,7 +52,7 @@ public interface CooperationService { ...@@ -52,7 +52,7 @@ public interface CooperationService {
ResultBody applyTagDetails(Integer id, Integer userAccountId); ResultBody applyTagDetails(Integer id, Integer userAccountId);
ResultBody approvalApplyTag(Integer id, Boolean status); ResultBody approvalApplyTag(Integer id, Boolean status,String token);
ResultBody getTagIdByUserId(Integer userAccountId); ResultBody getTagIdByUserId(Integer userAccountId);
ResultBody getContractNoAndStatus(Integer tagId, Integer userAccountId); ResultBody getContractNoAndStatus(Integer tagId, Integer userAccountId);
......
...@@ -7,6 +7,7 @@ import com.mmc.iuav.http.BizException; ...@@ -7,6 +7,7 @@ import com.mmc.iuav.http.BizException;
import com.mmc.iuav.page.PageResult; import com.mmc.iuav.page.PageResult;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.response.ResultEnum; import com.mmc.iuav.response.ResultEnum;
import com.mmc.iuav.user.client.ImsClient;
import com.mmc.iuav.user.constant.fdd.FddConstant; import com.mmc.iuav.user.constant.fdd.FddConstant;
import com.mmc.iuav.user.dao.CompanyAuthDao; import com.mmc.iuav.user.dao.CompanyAuthDao;
import com.mmc.iuav.user.dao.CompanyDao; import com.mmc.iuav.user.dao.CompanyDao;
...@@ -54,6 +55,9 @@ public class CooperationServiceImpl implements CooperationService { ...@@ -54,6 +55,9 @@ public class CooperationServiceImpl implements CooperationService {
@Autowired @Autowired
private CompanyDao companyDao; private CompanyDao companyDao;
@Autowired
private ImsClient imsClient;
@Override @Override
public List<CooperationTagVO> listTag() { public List<CooperationTagVO> listTag() {
List<CooperationTagDO> list = cooperationDao.listTags(); List<CooperationTagDO> list = cooperationDao.listTags();
...@@ -194,7 +198,7 @@ public class CooperationServiceImpl implements CooperationService { ...@@ -194,7 +198,7 @@ public class CooperationServiceImpl implements CooperationService {
@Transactional @Transactional
@Override @Override
public ResultBody approvalApplyTag(Integer id, Boolean status) { public ResultBody approvalApplyTag(Integer id, Boolean status,String token) {
// 判断用户是否已经是该渠道 // 判断用户是否已经是该渠道
UserApplyTagDO userApplyTag = cooperationDao.getUserApplyTag(id); UserApplyTagDO userApplyTag = cooperationDao.getUserApplyTag(id);
int count = int count =
...@@ -218,6 +222,12 @@ public class CooperationServiceImpl implements CooperationService { ...@@ -218,6 +222,12 @@ public class CooperationServiceImpl implements CooperationService {
// 生成账号失败处理 // 生成账号失败处理
throw new BizException(ResultEnum.COOPERATION_CHECK_NOT_PASS_ERROR); throw new BizException(ResultEnum.COOPERATION_CHECK_NOT_PASS_ERROR);
} }
//如果加盟商是培训机构还要生成这个培训机构的基本信息
if(userApplyTag.getCooperationTagId() == 4) {
log.info("飞手培训机构信息 =====》,{}",userApplyTag.getCompanyInfoDO());
imsClient.insertOrganizations(userApplyTag.getCompanyInfoDO(),token);
}
SmsUtil.sendPassCooperationApply(bUserAccountVO.getPhoneNum()); SmsUtil.sendPassCooperationApply(bUserAccountVO.getPhoneNum());
} else { } else {
SmsUtil.sendNotPassCooperationApply(account.getPhoneNum()); SmsUtil.sendNotPassCooperationApply(account.getPhoneNum());
......
...@@ -10,9 +10,8 @@ spring: ...@@ -10,9 +10,8 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
redis: redis:
database: 1 database: 1
host: 8.139.4.51 host: 127.0.0.1
port: 6379 port: 6379
password: MMC@2022&REDIS
#rabbitMQ #rabbitMQ
rabbitmq: rabbitmq:
host: 8.139.4.51 host: 8.139.4.51
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论