资质功能提交

20240109-yw
yuanwei 1 year ago
parent d00ed8529a
commit f6ecf859f9

@ -1,6 +1,7 @@
package com.glxp.api.controller.purchase;
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;
@ -139,15 +140,22 @@ public class SupCertController extends BaseController {
supCertEntity.setId(IdUtil.getSnowflakeNextId());
supCertService.save(supCertEntity);
SupProductAuthEntity supProductAuth = new SupProductAuthEntity();
supProductAuth.setAuthCompanyId( getCompanyId());
supProductAuth.setProductId(supCertEntity.getProductIdFk());
supProductAuth.setCurCompanyId( getCompanyId());
supProductAuth.setCreateTime(new Date());
supProductAuth.setCreateUser( getCompanyId());
supProductAuth.setUpdateTime(new Date());
supProductAuth.setUpdateUser( getCompanyId());
supProductAuthService.save(supProductAuth);
//默认给自己授权
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("productId",supCertEntity.getProductIdFk());
queryWrapper.eq("curCompanyId",getCompanyId());
List<SupProductAuthEntity> authList = supProductAuthService.list(queryWrapper);
if(CollectionUtil.isEmpty(authList)){
SupProductAuthEntity supProductAuth = new SupProductAuthEntity();
supProductAuth.setAuthCompanyId( getCompanyId());
supProductAuth.setProductId(supCertEntity.getProductIdFk());
supProductAuth.setCurCompanyId( getCompanyId());
supProductAuth.setCreateTime(new Date());
supProductAuth.setCreateUser( getCompanyId());
supProductAuth.setUpdateTime(new Date());
supProductAuth.setUpdateUser( getCompanyId());
supProductAuthService.save(supProductAuth);
}
return ResultVOUtils.success("添加成功!");
}

@ -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;
}
}

@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.basic.BasicManuYlqxzczhEntity;
import com.glxp.api.entity.purchase.SupCertEntity;
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.purchase.FilterPoductRequest;
import com.glxp.api.res.purchase.SupProductResponse;
import org.apache.ibatis.annotations.Mapper;
@ -18,5 +20,11 @@ import java.util.List;
@Mapper
public interface SupProductAuthMapper extends BaseMapper<SupProductAuthEntity> {
/**
*
* @param queryWrapper
* @return
*/
List<UserCompanyEntity> filterList(@Param(Constants.WRAPPER) QueryWrapper 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);
}

@ -2,6 +2,8 @@ package com.glxp.api.dao.sup;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.glxp.api.entity.purchase.SupCertEntity;
import com.glxp.api.req.purchase.FilterSupCertRequest;
import com.glxp.api.req.purchase.certRequest;
@ -18,4 +20,12 @@ public interface UserCertMapper extends BaseMapper<UserCertEntity> {
List<UserCertEntity> filterCompanyCert(certRequest certRequest);
List<UserCertEntity> filterZcCert(certRequest certRequest);
/**
*
* @param queryWrapper
* @return
*/
List<UserCertEntity> filterList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
}

@ -37,10 +37,10 @@ public class UserCertAuthEntity {
private String authCompanyId;
/**
* IDsup_product
* id
*/
@TableField("productId")
private String productId;
@TableField("corpId")
private String corpId;
/**
*

@ -58,6 +58,20 @@ public class UserCertEntity implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd")
private Date validDate;
/**
*
*/
@TableField("approvalDate")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date approvalDate;
/**
*
*/
@TableField("auditDept")
private String auditDept;
/**
*
*/
@ -135,5 +149,19 @@ public class UserCertEntity implements Serializable {
private String customerId;
/**
* 1:2.3.
*/
@TableField("type")
private String type;
/**
*
*/
@TableField(exist = false)
private String typeName;
private static final long serialVersionUID = 1L;
}

@ -113,6 +113,11 @@ public class UserCompanyEntity implements Serializable {
//自定义字典
@ApiModelProperty(value = "自定义字典")
@TableField(exist = false)
private boolean check;
private static final long serialVersionUID = 1L;
}

@ -29,5 +29,9 @@ public class FilterUserComapanyRequest extends ListPageRequest {
private String regionCode;
@ApiModelProperty(value = "产品ID")
private String productId;
@ApiModelProperty(value = "往来单位ID")
private String corpId;
}

@ -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;
}

@ -0,0 +1,162 @@
package com.glxp.api.req.purchase;
import com.glxp.api.util.page.ListPageRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class UserCertEntityRequest extends ListPageRequest {
private Long id;
@ApiModelProperty(value = "往来单位ID")
private String businessId;
/**
*
*/
private String code;
/**
*
*/
private String productName;
/**
*
*/
private String ggxh;
/**
* /
*/
private String zczbhhzbapzbh;
/**
*
*/
private String ylqxzcrbarywmc;
/**
*
*/
private String regCompanyName;
/**
*
*/
private String regCreditCode;
/**
*
*/
private String regAddress;
/**
*
*/
private String agentName;
/**
*
*/
private String agentCertCode;
/**
*
*/
private String agentAddress;
/**
*
*/
private String jgjzc;
/**
*
*/
private String useRange;
/**
*
*/
private String otherContent;
/**
*
*/
private String remark;
/**
*
*/
private String auditDept;
/**
*
*/
private String approvalDate;
/**
*
*/
private String expireDate;
/**
*
*/
private String effectDate;
/**
* :1:2:
*/
private String status;
/**
*
*/
private String filePath;
/**
*
*/
private String createUser;
/**
*
*/
private Date createTime;
/**
*
*/
private String updateUser;
/**
*
*/
private Date udpateTime;
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty(value = "企业名称")
private String companyName;
/**
*
*/
@ApiModelProperty(value = "统一社会信用号")
private String creditNum;
/**
* 1,2,3,.4.
*/
@ApiModelProperty(value = "企业类型 1生产企业,2流通企业,3,医疗机构.4.监管机构")
private String bussinessStatus;
}

@ -5,7 +5,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.basic.BasicManuProductMapper;
import com.glxp.api.dao.purchase.SupProductAuthMapper;
import com.glxp.api.entity.basic.BasicManuProductEntity;
import com.glxp.api.entity.purchase.SupCertEntity;
import com.glxp.api.entity.purchase.SupProductAuthEntity;
import com.glxp.api.entity.sup.UserCompanyEntity;
import com.glxp.api.req.purchase.SupProductSelectRequest;
import com.glxp.api.util.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
@ -13,5 +17,14 @@ import java.util.List;
@Service
public class SupProductAuthService extends ServiceImpl<SupProductAuthMapper, SupProductAuthEntity> {
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);
}
}

@ -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);
}
}

@ -2,7 +2,9 @@ package com.glxp.api.service.sup;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.purchase.SupCertEntity;
import com.glxp.api.entity.sup.UserCertEntity;
import com.glxp.api.req.purchase.FilterSupCertRequest;
import com.glxp.api.req.purchase.certRequest;
@ -19,4 +21,7 @@ public interface UserCertService extends IService<UserCertEntity>{
boolean updateCert(UserCertEntity userCert);
List<UserCertEntity> filterList(QueryWrapper queryWrapper);
}

@ -5,7 +5,9 @@ import java.util.List;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.glxp.api.entity.purchase.SupCertEntity;
import com.glxp.api.req.purchase.FilterSupCertRequest;
import com.glxp.api.req.purchase.certRequest;
import org.springframework.stereotype.Service;
@ -24,6 +26,11 @@ public class UserCertServiceImpl extends ServiceImpl<UserCertMapper, UserCertEnt
return userCertDao.selectByRegisterId(registerId);
}
@Override
public List<UserCertEntity> filterList(QueryWrapper queryWrapper){
return this.baseMapper.filterList(queryWrapper);
}
@Override
public List<UserCertEntity> selectByzcId(certRequest certRequest) {

@ -2,5 +2,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.purchase.SupProductAuthMapper">
<select id="filterList"
resultType="com.glxp.api.entity.sup.UserCompanyEntity">
SELECT auth.id,com.companyName,com.creditNum,com.status
,com.contacts,com.mobile,com.detailAddr,com.remark
FROM `sup_product_auth` auth
LEFT JOIN `user_company` com
ON auth.authCompanyId = com.id
<where>
${ew.sqlSegment}
</where>
</select>
</mapper>

@ -3,5 +3,16 @@
<mapper namespace="com.glxp.api.dao.sup.UserCertAuthMapper">
<select id="filterList"
resultType="com.glxp.api.entity.sup.UserCompanyEntity">
SELECT auth.id,com.companyName,com.creditNum,com.status
,com.contacts,com.mobile,com.detailAddr,com.remark
FROM `user_cert_auth` auth
LEFT JOIN `user_company` com
ON auth.authCompanyId = com.id
<where>
${ew.sqlSegment}
</where>
</select>
</mapper>

@ -20,6 +20,18 @@
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<select id="filterList"
resultType="com.glxp.api.entity.sup.UserCertEntity">
SELECT O.*
FROM user_cert o left join basic_corp uc on o.businessId = uc.id
left join user_cert_auth auth on uc.id = auth.corpId
<where>
${ew.sqlSegment}
</where>
</select>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, businessId, `name`, code, filePath, validDate, expireDate, checkStatus, checkComment,

Loading…
Cancel
Save