本企业信息相关代码提交

cert
schry 2 years ago
parent fe8c6fcaac
commit 4e7bc6a290

@ -7,6 +7,7 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.sup.UserCertEntity;
import com.glxp.api.entity.sup.UserCertSetEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.purchase.certRequest;
import com.glxp.api.req.system.DeleteCompanyFileRequest;
import com.glxp.api.res.PageSimpleResponse;
@ -18,9 +19,12 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.Date;
import java.util.List;
@ -59,6 +63,7 @@ public class ResgitserCertController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
certRequest.setBusinessId(Long.valueOf(getCompanyId()));
List<UserCertEntity> userCertEntities = userCertService.selectBybId(certRequest);
PageInfo<UserCertEntity> pageInfo;
pageInfo = new PageInfo<>(userCertEntities);
@ -68,6 +73,16 @@ public class ResgitserCertController {
return ResultVOUtils.success(pageSimpleResponse);
}
public String getCompanyId() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
throw new JsonException(ResultEnum.NOT_NETWORK);
}
HttpServletRequest request = attributes.getRequest();
String companyId = request.getHeader("companyId");
return companyId;
}
//资质证书添加
@PostMapping("/reg/company/cert/isertCert")

@ -7,6 +7,7 @@ import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.sup.UserPersonEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.auth.UserPersonFilterRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.sup.UserPersonService;
@ -14,11 +15,15 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
@ -33,11 +38,14 @@ public class userPersonController {
private UserPersonService userPersonService;
@ApiOperation(value = "获取用户个人信息", response = UserPersonEntity.class)
@PostMapping("/sup/company/person/filterList")
public BaseResponse filterCompanyCert(@RequestBody UserPersonFilterRequest userPersonFilterRequest, BindingResult bindingResult) {
@GetMapping("/sup/company/person/filterList")
public BaseResponse filterCompanyCert(UserPersonFilterRequest userPersonFilterRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (StrUtil.isBlank(userPersonFilterRequest.getCompanyId())) {
userPersonFilterRequest.setCompanyId(getCompanyId());
}
QueryWrapper<UserPersonEntity> and;
if (StrUtil.isNotBlank(userPersonFilterRequest.getUserName())) {
and = new QueryWrapper<UserPersonEntity>().like("userName", userPersonFilterRequest.getUserName()).and(i -> i.eq("companyId", userPersonFilterRequest.getCompanyId()));
@ -82,5 +90,15 @@ public class userPersonController {
return ResultVOUtils.success();
}
public String getCompanyId() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
throw new JsonException(ResultEnum.NOT_NETWORK);
}
HttpServletRequest request = attributes.getRequest();
String companyId = request.getHeader("companyId");
return companyId;
}
}

@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.basic.ProductInfoEntity;
import com.glxp.api.entity.sup.UserCompanyEntity;
import com.glxp.api.entity.sup.UserCompanyOnlineEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.auth.FilterUserComapanyRequest;
import com.glxp.api.req.basic.ProductInfoFilterRequest;
import com.glxp.api.res.PageSimpleResponse;
@ -26,9 +28,12 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
@ -91,6 +96,20 @@ public class UserComanyController extends BaseController {
return ResultVOUtils.success(pageSimpleResponse);
}
@ApiOperation(value = "查询注册企业信息",response = UserCompanyEntity.class)
@AuthRuleAnnotation("")
@GetMapping("udi/auth/user/comapny/filterRegCompany")
public BaseResponse filterRegCompanyInfo(FilterUserComapanyRequest filterUserComapanyRequest) {
filterUserComapanyRequest.setId(getCompanyId());
UserCompanyResponse userCompanyResponse = userCompanyService.filterCompanyInfo(filterUserComapanyRequest);
// PageInfo<UserCompanyResponse> pageInfo = new PageInfo<>(userCompanyEntities);
// PageSimpleResponse<UserCompanyResponse> pageSimpleResponse = new PageSimpleResponse<>();
// pageSimpleResponse.setTotal(pageInfo.getTotal());
// pageSimpleResponse.setList(userCompanyEntities);
return ResultVOUtils.success(userCompanyResponse);
}
@Resource
UserCompanyOnlineService userCompanyOnlineService;
@ -140,4 +159,14 @@ public class UserComanyController extends BaseController {
return ResultVOUtils.success(pageSimpleResponse);
}
public String getCompanyId() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
throw new JsonException(ResultEnum.NOT_NETWORK);
}
HttpServletRequest request = attributes.getRequest();
String companyId = request.getHeader("companyId");
return companyId;
}
}

@ -5,6 +5,7 @@ import com.glxp.api.entity.basic.ProductInfoEntity;
import com.glxp.api.entity.sup.UserCompanyEntity;
import com.glxp.api.req.auth.FilterUserComapanyRequest;
import com.glxp.api.req.basic.ProductInfoFilterRequest;
import com.glxp.api.res.sup.UserCompanyResponse;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -13,4 +14,6 @@ import java.util.List;
public interface UserCompanyMapper extends BaseMapper<UserCompanyEntity> {
List<UserCompanyEntity> filterCompanyName(FilterUserComapanyRequest filterUserComapanyRequest);
UserCompanyResponse filterCompanyInfo(FilterUserComapanyRequest filterUserComapanyRequest);
}

@ -12,6 +12,9 @@ public class FilterUserComapanyRequest extends ListPageRequest {
@ApiModelProperty(value = "查询键")
private String searchKey;
@ApiModelProperty(value = "企业ID")
private String id;
@ApiModelProperty(value = "企业名称")
private String companyName;

@ -32,6 +32,9 @@ public class UserCompanyResponse extends UserCompanyEntity {
@ApiModelProperty(value = "备注")
private String remark;
private Integer companyType;
private String mobile;
private String realName;
private String fmobile;
private String email;
}

@ -6,6 +6,7 @@ import com.glxp.api.entity.sup.UserCompanyEntity;
import com.glxp.api.entity.sup.UserRegisterEntity;
import com.glxp.api.req.auth.FilterUserComapanyRequest;
import com.glxp.api.req.basic.ProductInfoFilterRequest;
import com.glxp.api.res.sup.UserCompanyResponse;
import java.util.List;
@ -17,4 +18,6 @@ public interface UserCompanyService extends IService<UserCompanyEntity> {
List<UserCompanyEntity> filterCompanyName(FilterUserComapanyRequest filterUserComapanyRequest);
UserCompanyResponse filterCompanyInfo(FilterUserComapanyRequest filterUserComapanyRequest);
}

@ -5,6 +5,7 @@ import com.glxp.api.entity.basic.ProductInfoEntity;
import com.glxp.api.entity.sup.UserCompanyEntity;
import com.glxp.api.req.auth.FilterUserComapanyRequest;
import com.glxp.api.req.basic.ProductInfoFilterRequest;
import com.glxp.api.res.sup.UserCompanyResponse;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.sup.UserCompanyMapper;
@ -40,4 +41,15 @@ public class UserCompanyServiceImpl extends ServiceImpl<UserCompanyMapper, UserC
List<UserCompanyEntity> data = userCompanyMapper.filterCompanyName(filterUserComapanyRequest);
return data;
}
@Override
public UserCompanyResponse filterCompanyInfo(FilterUserComapanyRequest filterUserComapanyRequest) {
if (filterUserComapanyRequest == null) {
return null;
}
int offset = (filterUserComapanyRequest.getPage() - 1) * filterUserComapanyRequest.getLimit();
PageHelper.offsetPage(offset, filterUserComapanyRequest.getLimit());
UserCompanyResponse data = userCompanyMapper.filterCompanyInfo(filterUserComapanyRequest);
return data;
}
}

@ -6,6 +6,9 @@
SELECT *
FROM user_company
<where>
<if test="id != '' and id != null">
and id = #{id}
</if>
<if test="companyName != '' and companyName != null">
AND companyName LIKE concat('%', #{companyName}, '%')
</if>
@ -18,4 +21,16 @@
</where>
GROUP BY companyName
</select>
<select id="filterCompanyInfo" parameterType="com.glxp.api.req.auth.FilterUserComapanyRequest"
resultType="com.glxp.api.res.sup.UserCompanyResponse">
SELECT uc.*,ur.mobile,ur.realName,ur.fmobile,ur.email
FROM user_company uc
LEFT JOIN user_register ur ON uc.id = ur.companyId
<where>
<if test="id != '' and id != null">
and uc.id = #{id}
</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save