From 6957a05f032c2962af99ac2f71e3e2410a5f1e80 Mon Sep 17 00:00:00 2001 From: yuanwei Date: Wed, 6 Mar 2024 18:15:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/SupCertController.java | 100 ++++++++++++++---- .../purchase/SupProductAuthController.java | 2 +- .../purchase/SupProductController.java | 1 + .../sup/UserCertAuthController.java | 4 +- .../controller/sup/UserCertController.java | 97 ++++++++++++++--- .../api/entity/purchase/SupCertEntity.java | 8 ++ .../glxp/api/entity/sup/UserCertEntity.java | 6 ++ .../req/auth/FilterUserComapanyRequest.java | 3 + .../req/purchase/SupProductAuthRequest.java | 3 + .../api/service/purchase/SupCertService.java | 2 + .../purchase/impl/SupCertServiceImpl.java | 10 ++ .../api/service/sup/UserCertAuthService.java | 4 +- .../glxp/api/service/sup/UserCertService.java | 2 + .../service/sup/impl/UserCertServiceImpl.java | 8 ++ .../com/glxp/api/upload/uploadController.java | 9 ++ .../mybatis/mapper/purchase/SupCertDao.xml | 1 - .../mybatis/mapper/sup/UserCertMapper.xml | 1 - .../mybatis/mapper/sup/UserCompanyMapper.xml | 3 + 18 files changed, 219 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java index 866685e..1460ae2 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCertController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCertController.java @@ -6,6 +6,7 @@ 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.beust.jcommander.internal.Lists; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -28,6 +29,7 @@ import com.glxp.api.entity.sup.UserCompanyEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.exception.JsonException; +import com.glxp.api.req.auth.FilterUserComapanyRequest; import com.glxp.api.req.basic.BasicManuYlqxzczhRequest; import com.glxp.api.req.inout.InspectionPDFTemplateRequest; import com.glxp.api.req.purchase.*; @@ -140,23 +142,6 @@ public class SupCertController extends BaseController { supCertEntity.setId(IdUtil.getSnowflakeNextId()); supCertService.save(supCertEntity); - //默认给自己授权 - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("productId",supCertEntity.getProductIdFk()); - queryWrapper.eq("curCompanyId",getCompanyId()); - List 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("添加成功!"); } @@ -184,6 +169,83 @@ public class SupCertController extends BaseController { return ResultVOUtils.success("添加成功!"); } + @AuthRuleAnnotation("获取被授权的产品资质") + @GetMapping("/directToCpt/sup/cert/filterMyAuth") + public BaseResponse filterMyAuth(SupCertEntityRequest request) { + + PageSimpleResponse basicUdiRelResponsePageSimpleResponse = new PageSimpleResponse<>(); + //判断是否有资质授权 + QueryWrapper authWrapper = new QueryWrapper(); + authWrapper.eq("productId",request.getProductIdFk()); + authWrapper.eq("authCompanyId",getCompanyId()); + List authList = supProductAuthService.list(authWrapper); + if(CollectionUtil.isEmpty(authList)){ + return ResultVOUtils.success(basicUdiRelResponsePageSimpleResponse); + } + + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("productIdFk",request.getProductIdFk()); + queryWrapper.isNull("relationCertId"); + int offset = (request.getPage() - 1) * request.getLimit(); + Page pages = PageHelper.offsetPage(offset, request.getLimit()); + List list = supCertService.filterList(queryWrapper); + queryWrapper = new QueryWrapper(); + queryWrapper.eq("enabled", 1); + List typeList = supCertTypeService.list(queryWrapper); + Map typeMap = typeList.stream().collect(Collectors.toMap(SupCertTypeEntity::getCode, s->s, (l, r) -> l)); + for(SupCertEntity supCertEntity:list){ + SupCertTypeEntity supCertTypeEntity = typeMap.get(supCertEntity.getType()); + if(supCertTypeEntity != null){ + supCertEntity.setTypeName(supCertTypeEntity.getName()); + } + } + + basicUdiRelResponsePageSimpleResponse.setTotal(pages.getTotal()); + basicUdiRelResponsePageSimpleResponse.setList(list); + + for (SupCertEntity supCertEntity : list) { + Boolean isExit = supCertService.isExit(Long.parseLong(getCompanyId()),supCertEntity.getId()); + if (isExit) { + supCertEntity.setCheck(true); + } else + supCertEntity.setCheck(false); + } + return ResultVOUtils.success(basicUdiRelResponsePageSimpleResponse); + } + + @ApiOperation(value = "批量授权", response = BaseResponse.class) + @PostMapping("/directToCpt/sup/cert/batchAddAuth") + public BaseResponse batchAddAuth(@RequestBody SupProductAuthSelectRequest request) { + //判断是否有资质授权 + QueryWrapper authWrapper = new QueryWrapper(); + authWrapper.eq("productId",request.getProductId()); + authWrapper.eq("authCompanyId",getCompanyId()); + List authList = supProductAuthService.list(authWrapper); + if(CollectionUtil.isEmpty(authList)){ + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL,"您没有权限!"); + } + String userId = getCompanyId(); + if (CollUtil.isNotEmpty(request.getIds())) { + for (String id : request.getIds()) { + if (!supCertService.isExit(Long.parseLong(getCompanyId()),Long.parseLong(id))) { + SupCertEntity oldSupCertEntity = supCertService.getById(id); + SupCertEntity supCertEntity = new SupCertEntity(); + BeanUtils.copyProperties(oldSupCertEntity, supCertEntity); + supCertEntity.setRelationCertId(oldSupCertEntity.getId()); + supCertEntity.setCreateTime(new Date()); + supCertEntity.setCreateUser( getCompanyId()); + supCertEntity.setUpdateTime(new Date()); + supCertEntity.setUpdateUser( getCompanyId()); + supCertEntity.setCompanyIdFk(Long.parseLong(userId)); + supCertEntity.setId(IdUtil.getSnowflakeNextId()); + supCertService.save(supCertEntity); + } + } + } + return ResultVOUtils.success("添加成功!"); + } + + public QueryWrapper getQueryWrapper(SupCertEntityRequest request) { QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq(StringUtils.isNotEmpty(request.getYlqxzcrbarywmc()),"ylqxzcrbarywmc",request.getYlqxzcrbarywmc()); @@ -191,10 +253,6 @@ public class SupCertController extends BaseController { queryWrapper.eq(StringUtils.isNotEmpty(request.getProductName()),"productName",request.getProductName()); queryWrapper.eq(StringUtils.isNotEmpty(request.getStatus()),"status",request.getStatus()); queryWrapper.eq(StringUtils.isNotEmpty(request.getProductIdFk()),"productIdFk",request.getProductIdFk()); - - String companyId = getCompanyId(); - queryWrapper.eq(StringUtils.isNotEmpty(companyId),"auth.curCompanyId",companyId); - return queryWrapper; } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupProductAuthController.java b/src/main/java/com/glxp/api/controller/purchase/SupProductAuthController.java index 79452cd..7e137a2 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupProductAuthController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupProductAuthController.java @@ -114,6 +114,7 @@ public class SupProductAuthController extends BaseController { @GetMapping("/filterRel") public BaseResponse filterGroupRel(FilterUserComapanyRequest request) { + request.setExitId(getCompanyId()); List list = userCompanyService.filterCompanyName(request); PageInfo basicUdiRelResponsePageInfo = new PageInfo<>(list); PageSimpleResponse basicUdiRelResponsePageSimpleResponse = new PageSimpleResponse<>(); @@ -139,7 +140,6 @@ public class SupProductAuthController extends BaseController { String companyId = getCompanyId(); queryWrapper.eq(StringUtils.isNotEmpty(companyId),"auth.curCompanyId",companyId); - queryWrapper.ne(StringUtils.isNotEmpty(companyId),"auth.authCompanyId",companyId); return queryWrapper; } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupProductController.java b/src/main/java/com/glxp/api/controller/purchase/SupProductController.java index d2c58b9..26582a7 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupProductController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupProductController.java @@ -186,6 +186,7 @@ public class SupProductController extends BaseController { productInfoFilterRequest.setDiType("1"); } try { + productInfoFilterRequest.setCompanyIdFk(Long.parseLong(getCompanyId())); BaseResponse> udiDlDeviceResponse = syncUdiService.filterUdiGroup(productInfoFilterRequest); if (udiDlDeviceResponse.getCode() == 20000) { if (filterUdiRelRequest.getIsCheck() != null && filterUdiRelRequest.getIsCheck()) { diff --git a/src/main/java/com/glxp/api/controller/sup/UserCertAuthController.java b/src/main/java/com/glxp/api/controller/sup/UserCertAuthController.java index 5fc916c..1f5410f 100644 --- a/src/main/java/com/glxp/api/controller/sup/UserCertAuthController.java +++ b/src/main/java/com/glxp/api/controller/sup/UserCertAuthController.java @@ -107,6 +107,7 @@ public class UserCertAuthController extends BaseController { @GetMapping("/filterRel") public BaseResponse filterGroupRel(FilterUserComapanyRequest request) { + request.setExitId(getCompanyId()); List list = userCompanyService.filterCompanyName(request); PageInfo basicUdiRelResponsePageInfo = new PageInfo<>(list); PageSimpleResponse basicUdiRelResponsePageSimpleResponse = new PageSimpleResponse<>(); @@ -128,11 +129,10 @@ public class UserCertAuthController extends BaseController { 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()); + queryWrapper.eq(StringUtils.isNotEmpty(request.getCorpId()),"corpId",request.getCorpId()); String companyId = getCompanyId(); queryWrapper.eq(StringUtils.isNotEmpty(companyId),"auth.curCompanyId",companyId); - queryWrapper.ne(StringUtils.isNotEmpty(companyId),"auth.authCompanyId",companyId); return queryWrapper; } diff --git a/src/main/java/com/glxp/api/controller/sup/UserCertController.java b/src/main/java/com/glxp/api/controller/sup/UserCertController.java index da1d67b..8f1f5bd 100644 --- a/src/main/java/com/glxp/api/controller/sup/UserCertController.java +++ b/src/main/java/com/glxp/api/controller/sup/UserCertController.java @@ -116,26 +116,10 @@ public class UserCertController extends BaseController { userCertEntity.setCreateUser( getCompanyId()); userCertEntity.setUpdateTime(new Date()); userCertEntity.setUpdateUser( getCompanyId()); + userCertEntity.setCustomerId(getCompanyId()); userCertEntity.setId(IdUtil.getSnowflakeNextId()); userCertService.save(userCertEntity); - //默认给自己授权 - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("corpId",userCertEntity.getBusinessId()); - queryWrapper.eq("curCompanyId",getCompanyId()); - List 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("添加成功!"); } @@ -163,6 +147,85 @@ public class UserCertController extends BaseController { return ResultVOUtils.success("添加成功!"); } + + @AuthRuleAnnotation("获取被授权的产品资质") + @GetMapping("/directToCpt/user/cert/filterMyAuth") + public BaseResponse filterMyAuth(UserCertEntityRequest request) { + + PageSimpleResponse basicUdiRelResponsePageSimpleResponse = new PageSimpleResponse<>(); + //判断是否有资质授权 + QueryWrapper authWrapper = new QueryWrapper(); + authWrapper.eq("corpId",request.getBusinessId()); + authWrapper.eq("authCompanyId",getCompanyId()); + List authList = userCertAuthService.list(authWrapper); + if(CollectionUtil.isEmpty(authList)){ + return ResultVOUtils.success(basicUdiRelResponsePageSimpleResponse); + } + + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("businessId",request.getBusinessId()); + queryWrapper.isNull("relationCertId"); + int offset = (request.getPage() - 1) * request.getLimit(); + Page pages = PageHelper.offsetPage(offset, request.getLimit()); + List list = userCertService.filterList(queryWrapper); + queryWrapper = new QueryWrapper(); + queryWrapper.eq("enabled", 1); + List typeList = supCertTypeService.list(queryWrapper); + Map 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()); + } + } + + basicUdiRelResponsePageSimpleResponse.setTotal(pages.getTotal()); + basicUdiRelResponsePageSimpleResponse.setList(list); + + for (UserCertEntity userCertEntity : list) { + Boolean isExit = userCertService.isExit(Long.parseLong(getCompanyId()),userCertEntity.getId()); + if (isExit) { + userCertEntity.setCheck(true); + } else + userCertEntity.setCheck(false); + } + return ResultVOUtils.success(basicUdiRelResponsePageSimpleResponse); + } + + @ApiOperation(value = "批量授权", response = BaseResponse.class) + @PostMapping("/directToCpt/user/cert/batchAddAuth") + public BaseResponse batchAddAuth(@RequestBody UserCertAuthSelectRequest request) { + //判断是否有资质授权 + QueryWrapper authWrapper = new QueryWrapper(); + authWrapper.eq("corpId",request.getCorpId()); + authWrapper.eq("authCompanyId",getCompanyId()); + List authList = userCertAuthService.list(authWrapper); + if(CollectionUtil.isEmpty(authList)){ + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL,"您没有权限!"); + } + String userId = getCompanyId(); + if (CollUtil.isNotEmpty(request.getIds())) { + for (String id : request.getIds()) { + if (!userCertService.isExit(Long.parseLong(getCompanyId()),Long.parseLong(id))) { + UserCertEntity oldCertEntity = userCertService.getById(id); + UserCertEntity userCertEntity = new UserCertEntity(); + BeanUtils.copyProperties(oldCertEntity, userCertEntity); + userCertEntity.setRelationCertId(oldCertEntity.getId()); + userCertEntity.setCreateTime(new Date()); + userCertEntity.setCreateUser( getCompanyId()); + userCertEntity.setUpdateTime(new Date()); + userCertEntity.setUpdateUser( getCompanyId()); + userCertEntity.setCustomerId(userId); + userCertEntity.setId(IdUtil.getSnowflakeNextId()); + userCertService.save(userCertEntity); + } + } + } + return ResultVOUtils.success("添加成功!"); + } + + + public QueryWrapper getQueryWrapper(UserCertEntityRequest request) { QueryWrapper queryWrapper = new QueryWrapper(); diff --git a/src/main/java/com/glxp/api/entity/purchase/SupCertEntity.java b/src/main/java/com/glxp/api/entity/purchase/SupCertEntity.java index 98379b2..9e76ea2 100644 --- a/src/main/java/com/glxp/api/entity/purchase/SupCertEntity.java +++ b/src/main/java/com/glxp/api/entity/purchase/SupCertEntity.java @@ -153,6 +153,9 @@ public class SupCertEntity { @TableField("companyIdFk") private Long companyIdFk; + @TableField("relationCertId") + private Long relationCertId; + /** * 企业名称 */ @@ -173,4 +176,9 @@ public class SupCertEntity { @ApiModelProperty(value = "企业类型 1生产企业,2流通企业,3,医疗机构.4.监管机构") @TableField(exist = false) private String bussinessStatus; + + //自定义字典 + @ApiModelProperty(value = "自定义字典") + @TableField(exist = false) + private boolean check; } diff --git a/src/main/java/com/glxp/api/entity/sup/UserCertEntity.java b/src/main/java/com/glxp/api/entity/sup/UserCertEntity.java index 988c8ad..8734ac4 100644 --- a/src/main/java/com/glxp/api/entity/sup/UserCertEntity.java +++ b/src/main/java/com/glxp/api/entity/sup/UserCertEntity.java @@ -149,12 +149,18 @@ public class UserCertEntity implements Serializable { private String customerId; + @TableField("relationCertId") + private Long relationCertId; /** * 证书类型:1:供应商;2.生产企业;3.产品品种 */ @TableField("type") private String type; + //自定义字典 + @ApiModelProperty(value = "自定义字典") + @TableField(exist = false) + private boolean check; /** * 证书类型 diff --git a/src/main/java/com/glxp/api/req/auth/FilterUserComapanyRequest.java b/src/main/java/com/glxp/api/req/auth/FilterUserComapanyRequest.java index 48860ab..9e32ff6 100644 --- a/src/main/java/com/glxp/api/req/auth/FilterUserComapanyRequest.java +++ b/src/main/java/com/glxp/api/req/auth/FilterUserComapanyRequest.java @@ -34,4 +34,7 @@ public class FilterUserComapanyRequest extends ListPageRequest { @ApiModelProperty(value = "往来单位ID") private String corpId; + + @ApiModelProperty(value = "排除id") + private String exitId; } diff --git a/src/main/java/com/glxp/api/req/purchase/SupProductAuthRequest.java b/src/main/java/com/glxp/api/req/purchase/SupProductAuthRequest.java index 0dea855..0d52260 100644 --- a/src/main/java/com/glxp/api/req/purchase/SupProductAuthRequest.java +++ b/src/main/java/com/glxp/api/req/purchase/SupProductAuthRequest.java @@ -15,6 +15,9 @@ public class SupProductAuthRequest extends ListPageRequest { @ApiModelProperty(value = "产品ID") private String productIdFk; + @ApiModelProperty(value = "往来单位ID") + private String corpId; + @ApiModelProperty(value = "关键字查询") private String searchKey; diff --git a/src/main/java/com/glxp/api/service/purchase/SupCertService.java b/src/main/java/com/glxp/api/service/purchase/SupCertService.java index f3708cc..20a7000 100644 --- a/src/main/java/com/glxp/api/service/purchase/SupCertService.java +++ b/src/main/java/com/glxp/api/service/purchase/SupCertService.java @@ -54,4 +54,6 @@ public interface SupCertService extends IService { List filterList(QueryWrapper queryWrapper); + + Boolean isExit(Long companyIdFk,Long relationCertId); } diff --git a/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java b/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java index 97e4eee..da8e28f 100644 --- a/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java +++ b/src/main/java/com/glxp/api/service/purchase/impl/SupCertServiceImpl.java @@ -13,6 +13,7 @@ import com.glxp.api.req.purchase.FilterSupCertRequest; import com.glxp.api.req.purchase.certRequest; import com.glxp.api.req.purchase.purPlanPrintRequest; import com.glxp.api.service.purchase.SupCertService; +import com.glxp.api.util.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -31,6 +32,15 @@ public class SupCertServiceImpl extends ServiceImpl i public List filterList(QueryWrapper queryWrapper){ return this.baseMapper.filterList(queryWrapper); } + + @Override + public Boolean isExit(Long companyIdFk, Long relationCertId) { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq(companyIdFk != null,"companyIdFk",companyIdFk); + queryWrapper.eq(relationCertId != null,"relationCertId",relationCertId); + return this.baseMapper.exists(queryWrapper); + } + @Override public List selectBybId(certRequest certRequest) { diff --git a/src/main/java/com/glxp/api/service/sup/UserCertAuthService.java b/src/main/java/com/glxp/api/service/sup/UserCertAuthService.java index 36ce2c0..4382e8b 100644 --- a/src/main/java/com/glxp/api/service/sup/UserCertAuthService.java +++ b/src/main/java/com/glxp/api/service/sup/UserCertAuthService.java @@ -19,10 +19,10 @@ public class UserCertAuthService extends ServiceImpl{ List filterList(QueryWrapper queryWrapper); + + Boolean isExit(Long companyIdFk,Long relationCertId); } diff --git a/src/main/java/com/glxp/api/service/sup/impl/UserCertServiceImpl.java b/src/main/java/com/glxp/api/service/sup/impl/UserCertServiceImpl.java index 4680ffa..b4d0f00 100644 --- a/src/main/java/com/glxp/api/service/sup/impl/UserCertServiceImpl.java +++ b/src/main/java/com/glxp/api/service/sup/impl/UserCertServiceImpl.java @@ -21,6 +21,14 @@ import com.glxp.api.service.sup.UserCertService; public class UserCertServiceImpl extends ServiceImpl implements UserCertService { @Resource UserCertMapper userCertDao; + @Override + public Boolean isExit(Long companyIdFk, Long relationCertId) { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq(companyIdFk != null,"customerId",companyIdFk); + queryWrapper.eq(relationCertId != null,"relationCertId",relationCertId); + return this.baseMapper.exists(queryWrapper); + } + @Override public List selectByRegisterId(String registerId) { return userCertDao.selectByRegisterId(registerId); diff --git a/src/main/java/com/glxp/api/upload/uploadController.java b/src/main/java/com/glxp/api/upload/uploadController.java index 339da68..59d3bdb 100644 --- a/src/main/java/com/glxp/api/upload/uploadController.java +++ b/src/main/java/com/glxp/api/upload/uploadController.java @@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -111,6 +113,13 @@ public class uploadController { if (file.isEmpty()) { return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件不能为空"); } + try { + BufferedImage image = ImageIO.read(file.getInputStream()); + System.out.println(image.getWidth()); + System.out.println(image.getHeight()); + } catch (IOException e) { + e.printStackTrace(); + } if (StringUtils.isBlank(type)) { return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件类型不能为空"); } diff --git a/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml b/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml index 5cb58e5..76c98b4 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupCertDao.xml @@ -6,7 +6,6 @@ resultType="com.glxp.api.entity.purchase.SupCertEntity"> SELECT O.*,uc.companyName,uc.bussinessStatus,uc.creditNum FROM sup_cert o left join user_company uc on o.companyIdFk = uc.id - left join sup_product_auth auth on o.productIdFk = auth.productId ${ew.sqlSegment} diff --git a/src/main/resources/mybatis/mapper/sup/UserCertMapper.xml b/src/main/resources/mybatis/mapper/sup/UserCertMapper.xml index 21ab250..5eb457a 100644 --- a/src/main/resources/mybatis/mapper/sup/UserCertMapper.xml +++ b/src/main/resources/mybatis/mapper/sup/UserCertMapper.xml @@ -25,7 +25,6 @@ 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 ${ew.sqlSegment} diff --git a/src/main/resources/mybatis/mapper/sup/UserCompanyMapper.xml b/src/main/resources/mybatis/mapper/sup/UserCompanyMapper.xml index e506897..f678156 100644 --- a/src/main/resources/mybatis/mapper/sup/UserCompanyMapper.xml +++ b/src/main/resources/mybatis/mapper/sup/UserCompanyMapper.xml @@ -9,6 +9,9 @@ and id = #{id} + + and id != #{exitId} + AND companyName LIKE concat('%', #{companyName}, '%')