提交 444ccb63 作者: zhenjie

单位查询返回手机号及账号修改修复

上级 9416bdc1
...@@ -37,11 +37,11 @@ public class PmsClient { ...@@ -37,11 +37,11 @@ public class PmsClient {
} }
public Integer removeMallGoods(Integer id, String token) { public Integer removeMallGoods(Integer id, Integer companyInfoId, String token) {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.add("token", token); headers.add("token", token);
HttpEntity<String> entity = new HttpEntity<>(null, headers); HttpEntity<String> entity = new HttpEntity<>(null, headers);
ResponseEntity<ResultBody> responseEntity = restTemplate.exchange(pmsAppUri + "/pms/mall/goods/feignRemoveGoodsByBackUserAccountId" + "?id=" + id, HttpMethod.GET, entity, ResultBody.class); ResponseEntity<ResultBody> responseEntity = restTemplate.exchange(pmsAppUri + "/pms/mall/goods/feignRemoveGoodsByBackUserAccountId" + "?id=" + id + "&companyInfoId=" + companyInfoId, HttpMethod.GET, entity, ResultBody.class);
ResultBody body = responseEntity.getBody(); ResultBody body = responseEntity.getBody();
if (body.getCode().equals(ResultEnum.SUCCESS.getResultCode())) { if (body.getCode().equals(ResultEnum.SUCCESS.getResultCode())) {
return 1; return 1;
......
...@@ -2,9 +2,7 @@ package com.mmc.iuav.user.controller; ...@@ -2,9 +2,7 @@ package com.mmc.iuav.user.controller;
import com.mmc.iuav.group.Insert; import com.mmc.iuav.group.Insert;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.vo.AppUserSucVO;
import com.mmc.iuav.user.model.vo.CompanyAuthVO; import com.mmc.iuav.user.model.vo.CompanyAuthVO;
import com.mmc.iuav.user.model.vo.WxLoginVO;
import com.mmc.iuav.user.service.CompanyAuthService; import com.mmc.iuav.user.service.CompanyAuthService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -20,29 +18,29 @@ import javax.servlet.http.HttpServletRequest; ...@@ -20,29 +18,29 @@ import javax.servlet.http.HttpServletRequest;
@Api(tags = "企业认证相关") @Api(tags = "企业认证相关")
@RequestMapping("/company-auth/") @RequestMapping("/company-auth/")
@RestController @RestController
public class CompanyAuthController extends BaseController{ public class CompanyAuthController extends BaseController {
@Autowired @Autowired
private CompanyAuthService companyAuthService; private CompanyAuthService companyAuthService;
@ApiOperation(value = "提交企业认证") @ApiOperation(value = "提交企业认证")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ResultBody.class) }) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("add") @PostMapping("add")
public ResultBody add(@Validated(value = {Insert.class})@RequestBody CompanyAuthVO companyAuthVO, HttpServletRequest request){ public ResultBody add(@Validated(value = {Insert.class}) @RequestBody CompanyAuthVO companyAuthVO, HttpServletRequest request) {
Integer userAccountId = this.getUserLoginInfoFromRedis(request).getUserAccountId(); Integer userAccountId = this.getUserLoginInfoFromRedis(request).getUserAccountId();
companyAuthVO.setUserAccountId(userAccountId); companyAuthVO.setUserAccountId(userAccountId);
return companyAuthService.add(companyAuthVO); return companyAuthService.add(companyAuthVO);
} }
@ApiOperation(value = "企业工商模糊搜索") @ApiOperation(value = "企业工商模糊搜索")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ResultBody.class) }) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("fuzzyQueryCompany") @GetMapping("fuzzyQueryCompany")
public ResultBody fuzzyQueryCompany(@ApiParam(value = "企业名称", required = true) @RequestParam String searchKey) { public ResultBody fuzzyQueryCompany(@ApiParam(value = "企业名称", required = true) @RequestParam String searchKey) {
return companyAuthService.fuzzyQueryCompany(searchKey); return companyAuthService.fuzzyQueryCompany(searchKey);
} }
@ApiOperation(value = "企业认证详情") @ApiOperation(value = "企业认证详情")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CompanyAuthVO.class) }) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = CompanyAuthVO.class)})
@GetMapping("getCompanyAuthInfo") @GetMapping("getCompanyAuthInfo")
public ResultBody getCompanyAuthInfo(@RequestParam Integer userAccountId) { public ResultBody getCompanyAuthInfo(@RequestParam Integer userAccountId) {
return ResultBody.success(companyAuthService.getCompanyAuthByUId(userAccountId)); return ResultBody.success(companyAuthService.getCompanyAuthByUId(userAccountId));
......
...@@ -10,6 +10,7 @@ import com.mmc.iuav.user.model.vo.CompanyAuthVO; ...@@ -10,6 +10,7 @@ import com.mmc.iuav.user.model.vo.CompanyAuthVO;
public interface CompanyAuthService { public interface CompanyAuthService {
/** /**
* 添加企业认证 * 添加企业认证
*
* @param companyAuthVO * @param companyAuthVO
* @return * @return
*/ */
...@@ -17,6 +18,7 @@ public interface CompanyAuthService { ...@@ -17,6 +18,7 @@ public interface CompanyAuthService {
/** /**
* 根据企业名称模糊查询 * 根据企业名称模糊查询
*
* @param searchKey * @param searchKey
* @return * @return
*/ */
...@@ -24,6 +26,7 @@ public interface CompanyAuthService { ...@@ -24,6 +26,7 @@ public interface CompanyAuthService {
/** /**
* 根据用户账号查询企业认证 * 根据用户账号查询企业认证
*
* @param userAccountId * @param userAccountId
* @return * @return
*/ */
......
...@@ -79,7 +79,8 @@ public class BackUserAccountServiceImpl implements BackUserAccountService { ...@@ -79,7 +79,8 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
if (companyInfoVO != null && companyInfoVO.getCompanyType().equals(CompanyTypeEnums.FRANCHISEE.getType())) { if (companyInfoVO != null && companyInfoVO.getCompanyType().equals(CompanyTypeEnums.FRANCHISEE.getType())) {
// 绑定企业为加盟公司,不能生成多个账号 // 绑定企业为加盟公司,不能生成多个账号
int bindingCount = companyService.countCompanyBackUser(companyInfoVO.getId()); int bindingCount = companyService.countCompanyBackUser(companyInfoVO.getId());
if (bindingCount > 0) { CompanyBackUserDO companyBackDO = companyService.getCompanyBackUserByCompanyId(bUserAccountVO.getCompanyId());
if (bindingCount > 0 && companyBackDO != null && !companyBackDO.getBackUserAccountId().equals(bUserAccountVO.getId())) {
return ResultBody.error(ResultEnum.FRANCHISEE_ACCOUNT_MORE_THAN_ONE_ERROR); return ResultBody.error(ResultEnum.FRANCHISEE_ACCOUNT_MORE_THAN_ONE_ERROR);
} }
} }
...@@ -126,7 +127,8 @@ public class BackUserAccountServiceImpl implements BackUserAccountService { ...@@ -126,7 +127,8 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
if (companyInfoVO != null && companyInfoVO.getCompanyType().equals(CompanyTypeEnums.FRANCHISEE.getType())) { if (companyInfoVO != null && companyInfoVO.getCompanyType().equals(CompanyTypeEnums.FRANCHISEE.getType())) {
// 绑定企业为加盟公司,不能生成多个账号 // 绑定企业为加盟公司,不能生成多个账号
int bindingCount = companyService.countCompanyBackUser(companyInfoVO.getId()); int bindingCount = companyService.countCompanyBackUser(companyInfoVO.getId());
if (bindingCount > 0) { CompanyBackUserDO companyBackDO = companyService.getCompanyBackUserByCompanyId(bUserAccountVO.getCompanyId());
if (bindingCount > 0 && companyBackDO != null && !companyBackDO.getBackUserAccountId().equals(bUserAccountVO.getId())) {
return ResultBody.error(ResultEnum.FRANCHISEE_ACCOUNT_MORE_THAN_ONE_ERROR); return ResultBody.error(ResultEnum.FRANCHISEE_ACCOUNT_MORE_THAN_ONE_ERROR);
} }
} }
...@@ -163,7 +165,7 @@ public class BackUserAccountServiceImpl implements BackUserAccountService { ...@@ -163,7 +165,7 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
} }
String accountNo = "DISABLE_" + backUserAccountDO.getAccountNo() + RandomStringUtils.randomAlphanumeric(3); String accountNo = "DISABLE_" + backUserAccountDO.getAccountNo() + RandomStringUtils.randomAlphanumeric(3);
backUserAccountDao.disableBackUserAccountDO(accountId, accountNo); backUserAccountDao.disableBackUserAccountDO(accountId, accountNo);
pmsClient.removeMallGoods(accountId, null); pmsClient.removeMallGoods(accountId, companyInfoVO.getId(), null);
return ResultBody.success(); return ResultBody.success();
} }
......
...@@ -4,11 +4,9 @@ import com.mmc.iuav.page.PageResult; ...@@ -4,11 +4,9 @@ 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.PmsClient; import com.mmc.iuav.user.client.PmsClient;
import com.mmc.iuav.user.dao.BackUserAccountDao;
import com.mmc.iuav.user.dao.CompanyDao; import com.mmc.iuav.user.dao.CompanyDao;
import com.mmc.iuav.user.entity.CompanyBackUserDO; import com.mmc.iuav.user.entity.*;
import com.mmc.iuav.user.entity.CompanyInfoDO;
import com.mmc.iuav.user.entity.CompanyMemberDO;
import com.mmc.iuav.user.entity.UserAccountDO;
import com.mmc.iuav.user.model.dto.LoginSuccessDTO; import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
import com.mmc.iuav.user.model.qo.CompanyInfoQO; import com.mmc.iuav.user.model.qo.CompanyInfoQO;
import com.mmc.iuav.user.model.vo.CompanyInfoVO; import com.mmc.iuav.user.model.vo.CompanyInfoVO;
...@@ -35,6 +33,9 @@ public class CompanyServiceImpl implements CompanyService { ...@@ -35,6 +33,9 @@ public class CompanyServiceImpl implements CompanyService {
@Autowired @Autowired
private PmsClient pmsClient; private PmsClient pmsClient;
@Autowired
private BackUserAccountDao backUserAccountDao;
@Override @Override
public ResultBody addCompanyInfo(CompanyInfoVO companyInfo) { public ResultBody addCompanyInfo(CompanyInfoVO companyInfo) {
int count = companyDao.countCompanyNames(companyInfo.getId(), companyInfo.getCompanyName()); int count = companyDao.countCompanyNames(companyInfo.getId(), companyInfo.getCompanyName());
...@@ -82,7 +83,16 @@ public class CompanyServiceImpl implements CompanyService { ...@@ -82,7 +83,16 @@ public class CompanyServiceImpl implements CompanyService {
public ResultBody<CompanyInfoVO> getCompanyInfoById(Integer id) { public ResultBody<CompanyInfoVO> getCompanyInfoById(Integer id) {
CompanyInfoDO companyInfoDO = companyDao.getCompanyInfoById(id); CompanyInfoDO companyInfoDO = companyDao.getCompanyInfoById(id);
if (companyInfoDO != null) { if (companyInfoDO != null) {
return ResultBody.success(companyInfoDO.buildCompanyInfoVO()); CompanyInfoVO companyInfoVO = companyInfoDO.buildCompanyInfoVO();
// 设置手机号
CompanyBackUserDO companyBackUserDO = companyDao.getCompanyBackUserByCompanyId(id);
if (companyBackUserDO != null) {
BackUserAccountDO backUserAccountDO = backUserAccountDao.getBackUserAccountDO(companyBackUserDO.getBackUserAccountId());
if (backUserAccountDO != null) {
companyInfoVO.setPhoneNum(backUserAccountDO.getPhoneNum());
}
}
return ResultBody.success(companyInfoVO);
} }
return ResultBody.success(); return ResultBody.success();
} }
......
...@@ -21,6 +21,7 @@ data-filter: ...@@ -21,6 +21,7 @@ data-filter:
- /userapp/back-user/listTest - /userapp/back-user/listTest
- /userapp/company/listCompanyPageBack - /userapp/company/listCompanyPageBack
- /userapp/company/getCompanyInfoById - /userapp/company/getCompanyInfoById
- /userapp/company/listCompanyInfoByIds
- /userapp/cooperation/service/bitmap - /userapp/cooperation/service/bitmap
- /userapp/cooperation/listCompanyInfoByCoopId - /userapp/cooperation/listCompanyInfoByCoopId
- /userapp/cooperation/appBrandList - /userapp/cooperation/appBrandList
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论