bug修改,查询企业信息返回系统负责人

master
anthonywj 2 years ago
parent 20306d4530
commit fef372c30d

@ -13,6 +13,7 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.entity.purchase.*;
import com.glxp.api.entity.sup.UserCertEntity;
import com.glxp.api.entity.sup.UserCertSetEntity;
@ -27,6 +28,7 @@ import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.auth.registComPerResponse;
import com.glxp.api.res.purchase.SupProductResponse;
import com.glxp.api.service.auth.AuthAdminService;
import com.glxp.api.service.basic.BasicCorpService;
import com.glxp.api.service.purchase.SupCertService;
import com.glxp.api.service.purchase.SupCompanyService;
import com.glxp.api.service.purchase.SupManufacturerService;
@ -93,15 +95,25 @@ public class SupCertController {
return ResultVOUtils.success(pageSimpleResponse);
}
@Resource
BasicCorpService basicCorpService;
//查询往来单位资质证书
@GetMapping("/sup/app/corp/cert/list")
public BaseResponse filterCorpCert(certRequest certRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
// if (certRequest.getCompanyIdFk() == null) {
// return ResultVOUtils.error(500, "企业ID不能为空");
// }
if (StrUtil.isEmpty(certRequest.getCustomerId())) {
if (StrUtil.isNotEmpty(certRequest.getCompanyName())) {
BasicCorpEntity basicCorpEntity = basicCorpService.selectByName(certRequest.getCompanyName());
if (basicCorpEntity != null)
certRequest.setCustomerId(basicCorpEntity.getErpId());
}
}
if (StrUtil.isEmpty(certRequest.getCustomerId())) {
return ResultVOUtils.error(500, "企业ID不能为空");
}
certRequest.setCompanyIdFk(null);
certRequest.setType(4);
List<SupCertEntity> supCertEntities = supCertService.selectBybId(certRequest);

@ -15,6 +15,7 @@ import com.glxp.api.entity.basic.ProductInfoEntity;
import com.glxp.api.entity.basic.TyCompanySearchEntity;
import com.glxp.api.entity.sup.UserCompanyEntity;
import com.glxp.api.entity.sup.UserCompanyOnlineEntity;
import com.glxp.api.entity.sup.UserPersonEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.http.YyHttpClient;
import com.glxp.api.req.auth.FilterUserComapanyRequest;
@ -25,6 +26,7 @@ import com.glxp.api.res.sup.UserCompanyOnlineResponse;
import com.glxp.api.res.sup.UserCompanyResponse;
import com.glxp.api.service.sup.UserCompanyOnlineService;
import com.glxp.api.service.sup.UserCompanyService;
import com.glxp.api.service.sup.UserPersonService;
import com.glxp.api.util.DateUtil;
import com.glxp.api.util.UnifiedCodeUtil;
import io.swagger.annotations.Api;
@ -116,6 +118,8 @@ public class UserComanyController extends BaseController {
@Resource
YyHttpClient yyHttpClient;
@Resource
private UserPersonService userPersonService;
@ApiOperation(value = "查询用户企业信息", response = UserCompanyEntity.class)
@GetMapping("udi/auth/user/comapny/info")
@ -129,7 +133,18 @@ public class UserComanyController extends BaseController {
UserCompanyResponse userCompanyResponse = new UserCompanyResponse();
List<UserCompanyEntity> userCompanyEntities = userCompanyService.filterCompanyName(filterUserComapanyRequest);
if (CollUtil.isNotEmpty(userCompanyEntities)) {
UserCompanyEntity userCompanyEntity = userCompanyEntities.get(0);
UserPersonEntity userPersonEntity = userPersonService.findByCompanyId(userCompanyEntity.getId());
if (userPersonEntity != null) {
userCompanyResponse.setPersonEmail(userPersonEntity.getEmail());
userCompanyResponse.setPersonMobile(userPersonEntity.getMobile());
userCompanyResponse.setPersonName(userPersonEntity.getName());
userCompanyResponse.setPersonQq(userPersonEntity.getQq());
userCompanyResponse.setPersonWeChat(userPersonEntity.getWeChat());
userCompanyResponse.setPersonTel(userPersonEntity.getTel());
userCompanyResponse.setPersonEmail(userPersonEntity.getEmail());
}
BeanUtil.copyProperties(userCompanyEntity, userCompanyResponse);
userCompanyResponse.setRegStatus(1);
return ResultVOUtils.success(userCompanyResponse);

@ -123,6 +123,7 @@ public class certRequest extends ListPageRequest {
private String productIdFk;
private Integer auditStatus;
private Integer type;
private String companyName;
private String mobile;
@ApiModelProperty(value = "企业ID")

@ -39,4 +39,41 @@ public class UserCompanyResponse extends UserCompanyEntity {
private String email;
@ApiModelProperty(value = "注册状态 1已注册2已禁用; 3:未注册")
private Integer regStatus;
/**
*
*/
@ApiModelProperty(value = "姓名")
private String personName;
/**
*
*/
@ApiModelProperty(value = "电话")
private String personTel;
/**
*
*/
@ApiModelProperty(value = "手机")
private String personMobile;
/**
* qq
*/
@ApiModelProperty(value = "qq")
private String personQq;
/**
*
*/
@ApiModelProperty(value = "微信")
private String personWeChat;
/**
*
*/
@ApiModelProperty(value = "邮箱")
private String personEmail;
}

@ -1,11 +1,14 @@
package com.glxp.api.service.sup;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.entity.sup.UserPersonEntity;
import com.glxp.api.dao.sup.UserPersonMapper;
import javax.annotation.Resource;
import java.util.List;
@Service
public class UserPersonService extends ServiceImpl<UserPersonMapper, UserPersonEntity> {
@ -26,7 +29,15 @@ public class UserPersonService extends ServiceImpl<UserPersonMapper, UserPersonE
}
public boolean add(UserPersonEntity userPerson) {
return userPersonMapper.insert(userPerson)> 0;
return userPersonMapper.insert(userPerson) > 0;
}
public UserPersonEntity findByCompanyId(Long companyId) {
List<UserPersonEntity> userPersonEntities = userPersonMapper.selectList(new QueryWrapper<UserPersonEntity>().eq("companyId", companyId));
if (CollUtil.isNotEmpty(userPersonEntities))
return userPersonEntities.get(0);
return null;
}
}

Loading…
Cancel
Save