代码更新完善

cert
1178634255 2 years ago
parent 8831259af1
commit 7e79828244

@ -2,14 +2,21 @@ package com.glxp.api.controller.purchase;
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.entity.auth.CustomerInfoEntity;
import com.glxp.api.entity.purchase.SupCertEntity;
import com.glxp.api.entity.purchase.SupCompanyEntity;
import com.glxp.api.req.purchase.FilterImageRequest;
import com.glxp.api.req.purchase.FilterSupCertRequest;
import com.glxp.api.req.purchase.FilterSupCompanyRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.auth.CustomerInfoService;
import com.glxp.api.service.purchase.SupCertService;
import com.glxp.api.service.purchase.SupCompanyService;
import com.glxp.api.service.system.CompanyService;
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;
@ -22,10 +29,12 @@ import java.util.List;
@RestController
public class SupCompanyController {
@Resource
private SupCertService supCertService;
@Resource
private SupCompanyService companyService;
@Resource
CustomerInfoService customerInfoService;
@AuthRuleAnnotation("")
@GetMapping("/api/pur/getSupComapnys")
public BaseResponse getSupComapnys(FilterSupCompanyRequest companyRequest) {
@ -37,6 +46,34 @@ public class SupCompanyController {
return ResultVOUtils.success(pageSimpleResponse);
}
@AuthRuleAnnotation("")
@GetMapping("api/pur/supCompany/getRoId")
public BaseResponse getRoId(String companyId) {
CustomerInfoEntity customerInfoEntity = customerInfoService.selectById(companyId);
return ResultVOUtils.success(customerInfoEntity);
}
@AuthRuleAnnotation("")
@GetMapping("/sup/company/cert/filter")
public BaseResponse filterCompanyCert(FilterSupCertRequest filterSupCertRequest,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<SupCertEntity> supCertEntityList
= supCertService.filterCompanyCert(filterSupCertRequest);
PageInfo<SupCertEntity> pageInfo;
pageInfo = new PageInfo<>(supCertEntityList);
PageSimpleResponse<SupCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(supCertEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
// //首营预览文件
// @PostMapping("/udiwms/image/register/file")
// public BaseResponse uploadRegisterFile(@RequestBody FilterImageRequest filterImageRequest) {

@ -0,0 +1,14 @@
package com.glxp.api.dao.auth;
import com.glxp.api.entity.auth.CustomerInfoEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CustomerInfoDao {
CustomerInfoEntity selectById(String customerId);
}

@ -0,0 +1,13 @@
package com.glxp.api.service.auth;
import com.glxp.api.entity.auth.CustomerInfoEntity;
public interface CustomerInfoService {
CustomerInfoEntity selectById(String customerId);
}

@ -0,0 +1,29 @@
package com.glxp.api.service.auth.impl;
import com.glxp.api.dao.auth.CustomerInfoDao;
import com.glxp.api.entity.auth.CustomerInfoEntity;
import com.glxp.api.service.auth.CustomerInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@Service
@Transactional(rollbackFor = Exception.class)
public class CustomerInfoServiceImpl implements CustomerInfoService {
@Resource
private CustomerInfoDao customerInfoDao;
@Override
public CustomerInfoEntity selectById(String customerId) {
return customerInfoDao.selectById(customerId);
}
}

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.auth.CustomerInfoDao">
<select id="selectById" parameterType="java.lang.String"
resultType="com.glxp.api.entity.auth.CustomerInfoEntity">
SELECT *
FROM customer_info
WHERE (customerId = #{customerId}) limit 1
</select>
</mapper>
Loading…
Cancel
Save