资质功能提交
parent
d00ed8529a
commit
f6ecf859f9
@ -0,0 +1,146 @@
|
||||
package com.glxp.api.controller.purchase;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
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.BasicManuYlqxzczhEntity;
|
||||
import com.glxp.api.entity.basic.BasicUdiProductEntity;
|
||||
import com.glxp.api.entity.basic.ProductInfoEntity;
|
||||
import com.glxp.api.entity.basic.UdiEntity;
|
||||
import com.glxp.api.entity.purchase.SupProductAuthEntity;
|
||||
import com.glxp.api.entity.purchase.SupProductEntity;
|
||||
import com.glxp.api.entity.sup.UserCompanyEntity;
|
||||
import com.glxp.api.req.auth.FilterUserComapanyRequest;
|
||||
import com.glxp.api.req.basic.BasicManuYlqxzczhRequest;
|
||||
import com.glxp.api.req.basic.FilterUdiRelRequest;
|
||||
import com.glxp.api.req.basic.ProductInfoFilterRequest;
|
||||
import com.glxp.api.req.purchase.SupProductAuthRequest;
|
||||
import com.glxp.api.req.purchase.SupProductAuthSelectRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.res.basic.UdiProductGroupResponse;
|
||||
import com.glxp.api.service.basic.BasicManuYlqxzczhService;
|
||||
import com.glxp.api.service.purchase.SupProductAuthService;
|
||||
import com.glxp.api.service.sup.UserCompanyService;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import com.glxp.api.util.udi.FilterUdiUtils;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
*/
|
||||
@ApiIgnore
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/udiwms/sup/auth")
|
||||
public class SupProductAuthController extends BaseController {
|
||||
|
||||
private final SupProductAuthService supProductAuthService;
|
||||
|
||||
|
||||
@Resource
|
||||
UserCompanyService userCompanyService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public BaseResponse list(SupProductAuthRequest request, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
int offset = (request.getPage() - 1) * request.getLimit();
|
||||
Page<UserCompanyEntity> pages = PageHelper.offsetPage(offset, request.getLimit());
|
||||
List<UserCompanyEntity> list = supProductAuthService.filterList(getQueryWrapper(request));
|
||||
PageSimpleResponse<UserCompanyEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pages.getTotal());
|
||||
pageSimpleResponse.setList(list);
|
||||
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
//医疗器械信息字典编辑保存
|
||||
@AuthRuleAnnotation("")
|
||||
@ApiOperation(value = "添加", response = BaseResponse.class)
|
||||
@PostMapping("/batchAdd")
|
||||
public BaseResponse batchAdd(@RequestBody SupProductAuthSelectRequest request) {
|
||||
|
||||
String userId = getCompanyId();
|
||||
if (CollUtil.isNotEmpty(request.getIds())) {
|
||||
for (String id : request.getIds()) {
|
||||
if (!supProductAuthService.isExit(id,request.getProductId())) {
|
||||
SupProductAuthEntity supProductAuthEntity = new SupProductAuthEntity();
|
||||
supProductAuthEntity.setUpdateTime(new Date());
|
||||
supProductAuthEntity.setUpdateUser(userId);
|
||||
supProductAuthEntity.setAuthCompanyId(id);
|
||||
supProductAuthEntity.setProductId(request.getProductId());
|
||||
supProductAuthEntity.setCurCompanyId(userId);
|
||||
supProductAuthService.save(supProductAuthEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@ApiOperation(value = "删除", response = BaseResponse.class)
|
||||
@PostMapping("/delete")
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
supProductAuthService.removeById(deleteRequest.getId());
|
||||
return ResultVOUtils.success("删除成功!");
|
||||
}
|
||||
|
||||
//获取同步库UDI信息
|
||||
@ApiIgnore
|
||||
@AuthRuleAnnotation("获取同步库UDI关联信息")
|
||||
@ApiOperation(value = "",response = ProductInfoEntity.class)
|
||||
@GetMapping("/filterRel")
|
||||
public BaseResponse filterGroupRel(FilterUserComapanyRequest request) {
|
||||
|
||||
List<UserCompanyEntity> list = userCompanyService.filterCompanyName(request);
|
||||
PageInfo<UserCompanyEntity> basicUdiRelResponsePageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<UserCompanyEntity> basicUdiRelResponsePageSimpleResponse = new PageSimpleResponse<>();
|
||||
basicUdiRelResponsePageSimpleResponse.setTotal(basicUdiRelResponsePageInfo.getTotal());
|
||||
basicUdiRelResponsePageSimpleResponse.setList(list);
|
||||
|
||||
for (UserCompanyEntity userCompanyEntity : list) {
|
||||
Boolean isExit = supProductAuthService.isExit(userCompanyEntity.getId()+"",request.getProductId());
|
||||
if (isExit) {
|
||||
userCompanyEntity.setCheck(true);
|
||||
} else
|
||||
userCompanyEntity.setCheck(false);
|
||||
}
|
||||
return ResultVOUtils.success(basicUdiRelResponsePageSimpleResponse);
|
||||
}
|
||||
|
||||
public QueryWrapper<UserCompanyEntity> getQueryWrapper(SupProductAuthRequest request) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(request.getCompanyName()),"com.companyName",request.getCompanyName());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(request.getCreditNum()),"com.creditNum",request.getCreditNum());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(request.getStatus()),"com.status",request.getStatus());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(request.getProductIdFk()),"productId",request.getProductIdFk());
|
||||
|
||||
String companyId = getCompanyId();
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(companyId),"auth.curCompanyId",companyId);
|
||||
queryWrapper.ne(StringUtils.isNotEmpty(companyId),"auth.authCompanyId",companyId);
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
package com.glxp.api.controller.sup;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
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.dao.sup.UserCertAuthMapper;
|
||||
import com.glxp.api.entity.basic.ProductInfoEntity;
|
||||
import com.glxp.api.entity.purchase.SupProductAuthEntity;
|
||||
import com.glxp.api.entity.sup.UserCertAuthEntity;
|
||||
import com.glxp.api.entity.sup.UserCompanyEntity;
|
||||
import com.glxp.api.req.auth.FilterUserComapanyRequest;
|
||||
import com.glxp.api.req.purchase.SupProductAuthRequest;
|
||||
import com.glxp.api.req.purchase.SupProductAuthSelectRequest;
|
||||
import com.glxp.api.req.purchase.UserCertAuthSelectRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.purchase.SupProductAuthService;
|
||||
import com.glxp.api.service.sup.UserCertAuthService;
|
||||
import com.glxp.api.service.sup.UserCompanyService;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
*/
|
||||
@ApiIgnore
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/udiwms/user/auth")
|
||||
public class UserCertAuthController extends BaseController {
|
||||
|
||||
private final UserCertAuthService userCertAuthService;
|
||||
|
||||
|
||||
@Resource
|
||||
UserCompanyService userCompanyService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public BaseResponse list(SupProductAuthRequest request, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
int offset = (request.getPage() - 1) * request.getLimit();
|
||||
Page<UserCompanyEntity> pages = PageHelper.offsetPage(offset, request.getLimit());
|
||||
List<UserCompanyEntity> list = userCertAuthService.filterList(getQueryWrapper(request));
|
||||
PageSimpleResponse<UserCompanyEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pages.getTotal());
|
||||
pageSimpleResponse.setList(list);
|
||||
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
//医疗器械信息字典编辑保存
|
||||
@AuthRuleAnnotation("")
|
||||
@ApiOperation(value = "添加", response = BaseResponse.class)
|
||||
@PostMapping("/batchAdd")
|
||||
public BaseResponse batchAdd(@RequestBody UserCertAuthSelectRequest request) {
|
||||
|
||||
String userId = getCompanyId();
|
||||
if (CollUtil.isNotEmpty(request.getIds())) {
|
||||
for (String id : request.getIds()) {
|
||||
if (!userCertAuthService.isExit(id,request.getCorpId())) {
|
||||
UserCertAuthEntity userCertAuthEntity = new UserCertAuthEntity();
|
||||
userCertAuthEntity.setUpdateTime(new Date());
|
||||
userCertAuthEntity.setUpdateUser(userId);
|
||||
userCertAuthEntity.setAuthCompanyId(id);
|
||||
userCertAuthEntity.setCorpId(request.getCorpId());
|
||||
userCertAuthEntity.setCurCompanyId(userId);
|
||||
userCertAuthService.save(userCertAuthEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@ApiOperation(value = "删除", response = BaseResponse.class)
|
||||
@PostMapping("/delete")
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
userCertAuthService.removeById(deleteRequest.getId());
|
||||
return ResultVOUtils.success("删除成功!");
|
||||
}
|
||||
|
||||
//获取同步库UDI信息
|
||||
@ApiIgnore
|
||||
@AuthRuleAnnotation("获取同步库UDI关联信息")
|
||||
@ApiOperation(value = "",response = ProductInfoEntity.class)
|
||||
@GetMapping("/filterRel")
|
||||
public BaseResponse filterGroupRel(FilterUserComapanyRequest request) {
|
||||
|
||||
List<UserCompanyEntity> list = userCompanyService.filterCompanyName(request);
|
||||
PageInfo<UserCompanyEntity> basicUdiRelResponsePageInfo = new PageInfo<>(list);
|
||||
PageSimpleResponse<UserCompanyEntity> basicUdiRelResponsePageSimpleResponse = new PageSimpleResponse<>();
|
||||
basicUdiRelResponsePageSimpleResponse.setTotal(basicUdiRelResponsePageInfo.getTotal());
|
||||
basicUdiRelResponsePageSimpleResponse.setList(list);
|
||||
|
||||
for (UserCompanyEntity userCompanyEntity : list) {
|
||||
Boolean isExit = userCertAuthService.isExit(userCompanyEntity.getId()+"",request.getCorpId());
|
||||
if (isExit) {
|
||||
userCompanyEntity.setCheck(true);
|
||||
} else
|
||||
userCompanyEntity.setCheck(false);
|
||||
}
|
||||
return ResultVOUtils.success(basicUdiRelResponsePageSimpleResponse);
|
||||
}
|
||||
|
||||
public QueryWrapper<UserCompanyEntity> getQueryWrapper(SupProductAuthRequest request) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(request.getCompanyName()),"com.companyName",request.getCompanyName());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(request.getCreditNum()),"com.creditNum",request.getCreditNum());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(request.getStatus()),"com.status",request.getStatus());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(request.getProductIdFk()),"productId",request.getProductIdFk());
|
||||
|
||||
String companyId = getCompanyId();
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(companyId),"auth.curCompanyId",companyId);
|
||||
queryWrapper.ne(StringUtils.isNotEmpty(companyId),"auth.authCompanyId",companyId);
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,176 @@
|
||||
package com.glxp.api.controller.sup;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.annotation.Log;
|
||||
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.constant.BusinessType;
|
||||
import com.glxp.api.constant.ConstantStatus;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.entity.basic.BasicCorpEntity;
|
||||
import com.glxp.api.entity.purchase.*;
|
||||
import com.glxp.api.entity.sup.UserCertAuthEntity;
|
||||
import com.glxp.api.entity.sup.UserCertEntity;
|
||||
import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity;
|
||||
import com.glxp.api.entity.system.SystemPDFTemplateEntity;
|
||||
import com.glxp.api.req.inout.InspectionPDFTemplateRequest;
|
||||
import com.glxp.api.req.purchase.*;
|
||||
import com.glxp.api.req.system.DeleteCompanyFileRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.auth.AuthAdminService;
|
||||
import com.glxp.api.service.basic.BasicCorpService;
|
||||
import com.glxp.api.service.purchase.*;
|
||||
import com.glxp.api.service.sup.UserCertAuthService;
|
||||
import com.glxp.api.service.sup.UserCertService;
|
||||
import com.glxp.api.service.sup.UserCompanyService;
|
||||
import com.glxp.api.service.system.SystemPDFModuleService;
|
||||
import com.glxp.api.service.system.SystemPDFTemplateService;
|
||||
import com.glxp.api.util.JasperUtils;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
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 springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author : zhangsan
|
||||
* @date : 2023/5/18 9:38
|
||||
* @modyified By :
|
||||
*/
|
||||
@Api(tags = "供应商资质相关接口")
|
||||
@ApiIgnore
|
||||
@RestController
|
||||
public class UserCertController extends BaseController {
|
||||
@Resource
|
||||
private UserCertService userCertService;
|
||||
@Resource
|
||||
private SupCertTypeService supCertTypeService;
|
||||
|
||||
@Resource
|
||||
private UserCertAuthService userCertAuthService;
|
||||
|
||||
|
||||
@Resource
|
||||
UserCompanyService userCompanyService;
|
||||
|
||||
@GetMapping("/directToCpt/user/cert/list")
|
||||
public BaseResponse list(UserCertEntityRequest request, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
int offset = (request.getPage() - 1) * request.getLimit();
|
||||
Page<UserCertEntity> pages = PageHelper.offsetPage(offset, request.getLimit());
|
||||
List<UserCertEntity> list = userCertService.filterList(getQueryWrapper(request));
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("enabled", 1);
|
||||
List<SupCertTypeEntity> typeList = supCertTypeService.list(queryWrapper);
|
||||
Map<String,SupCertTypeEntity> typeMap = typeList.stream().collect(Collectors.toMap(SupCertTypeEntity::getCode, s->s, (l, r) -> l));
|
||||
for(UserCertEntity userCertEntity:list){
|
||||
SupCertTypeEntity supCertTypeEntity = typeMap.get(userCertEntity.getType());
|
||||
if(supCertTypeEntity != null){
|
||||
userCertEntity.setTypeName(supCertTypeEntity.getName());
|
||||
}
|
||||
}
|
||||
PageSimpleResponse<UserCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pages.getTotal());
|
||||
pageSimpleResponse.setList(list);
|
||||
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
|
||||
//医疗器械信息字典编辑保存
|
||||
@AuthRuleAnnotation("")
|
||||
@ApiOperation(value = "添加", response = BaseResponse.class)
|
||||
@PostMapping("/directToCpt/user/cert/save")
|
||||
public BaseResponse save(@RequestBody UserCertEntity entityRequest) {
|
||||
|
||||
UserCertEntity userCertEntity = new UserCertEntity();
|
||||
BeanUtils.copyProperties(entityRequest, userCertEntity);
|
||||
userCertEntity.setCreateTime(new Date());
|
||||
userCertEntity.setCreateUser( getCompanyId());
|
||||
userCertEntity.setUpdateTime(new Date());
|
||||
userCertEntity.setUpdateUser( getCompanyId());
|
||||
userCertEntity.setId(IdUtil.getSnowflakeNextId());
|
||||
userCertService.save(userCertEntity);
|
||||
|
||||
//默认给自己授权
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("corpId",userCertEntity.getBusinessId());
|
||||
queryWrapper.eq("curCompanyId",getCompanyId());
|
||||
List<SupProductAuthEntity> authList = userCertAuthService.list(queryWrapper);
|
||||
if(CollectionUtil.isEmpty(authList)){
|
||||
UserCertAuthEntity userCertAuthEntity = new UserCertAuthEntity();
|
||||
userCertAuthEntity.setAuthCompanyId( getCompanyId());
|
||||
userCertAuthEntity.setCorpId(userCertEntity.getBusinessId()+"");
|
||||
userCertAuthEntity.setCurCompanyId( getCompanyId());
|
||||
userCertAuthEntity.setCreateTime(new Date());
|
||||
userCertAuthEntity.setCreateUser( getCompanyId());
|
||||
userCertAuthEntity.setUpdateTime(new Date());
|
||||
userCertAuthEntity.setUpdateUser( getCompanyId());
|
||||
userCertAuthService.save(userCertAuthEntity);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@ApiOperation(value = "删除", response = BaseResponse.class)
|
||||
@PostMapping("/directToCpt/user/cert/delete")
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
userCertService.removeById(deleteRequest.getId());
|
||||
return ResultVOUtils.success("删除成功!");
|
||||
}
|
||||
|
||||
|
||||
//产品信息关联修改
|
||||
@AuthRuleAnnotation("")
|
||||
@ApiOperation(value = "更新", response = BaseResponse.class)
|
||||
@PostMapping("/directToCpt/user/cert/edit")
|
||||
public BaseResponse update(@RequestBody UserCertEntity entityRequest) {
|
||||
|
||||
|
||||
UserCertEntity userCertEntity = new UserCertEntity();
|
||||
BeanUtils.copyProperties(entityRequest, userCertEntity);
|
||||
userCertEntity.setUpdateTime(new Date());
|
||||
userCertEntity.setUpdateUser( getCompanyId());
|
||||
userCertService.updateById(userCertEntity);
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
public QueryWrapper<UserCertEntity> getQueryWrapper(UserCertEntityRequest request) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(request.getBusinessId()),"businessId",request.getBusinessId());
|
||||
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,13 +1,26 @@
|
||||
package com.glxp.api.dao.sup;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.glxp.api.entity.purchase.SupProductAuthEntity;
|
||||
import com.glxp.api.entity.sup.UserCertAuthEntity;
|
||||
import com.glxp.api.entity.sup.UserCompanyEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface UserCertAuthMapper extends BaseMapper<UserCertAuthEntity> {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param queryWrapper
|
||||
* @return
|
||||
*/
|
||||
List<UserCompanyEntity> filterList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SupProductAuthRequest extends ListPageRequest {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long companyIdFk;
|
||||
|
||||
@ApiModelProperty(value = "产品ID")
|
||||
private String productIdFk;
|
||||
|
||||
@ApiModelProperty(value = "关键字查询")
|
||||
private String searchKey;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "企业ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String companyName;
|
||||
|
||||
@ApiModelProperty(value = "统一社会信用号")
|
||||
private String creditNum;
|
||||
|
||||
@ApiModelProperty(value = "企业类型")
|
||||
private String bussinessStatus;
|
||||
|
||||
private String regionCode;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SupProductAuthSelectRequest {
|
||||
|
||||
|
||||
private List<String> ids;
|
||||
private String productId;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class UserCertAuthSelectRequest {
|
||||
|
||||
|
||||
private List<String> ids;
|
||||
private String corpId;
|
||||
}
|
@ -1,14 +1,28 @@
|
||||
package com.glxp.api.service.sup;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.glxp.api.dao.purchase.SupProductAuthMapper;
|
||||
import com.glxp.api.dao.sup.UserCertAuthMapper;
|
||||
import com.glxp.api.entity.purchase.SupProductAuthEntity;
|
||||
import com.glxp.api.entity.sup.UserCertAuthEntity;
|
||||
import com.glxp.api.entity.sup.UserCompanyEntity;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class UserCertAuthService extends ServiceImpl<UserCertAuthMapper, UserCertAuthEntity> {
|
||||
|
||||
public List<UserCompanyEntity> filterList(QueryWrapper queryWrapper){
|
||||
return this.baseMapper.filterList(queryWrapper);
|
||||
}
|
||||
|
||||
public boolean isExit(String authCompanyId,String productId){
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(authCompanyId),"authCompanyId",authCompanyId);
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(productId),"productId",productId);
|
||||
return this.baseMapper.exists(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue