From 6e3235749965e3d5393f5ad8f11a5a0c50ee2f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Sun, 12 Mar 2023 17:35:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E8=B4=A8=E5=AE=A1=E6=A0=B8=E5=8A=A0?= =?UTF-8?q?=E4=B8=AA=E4=BE=9B=E5=BA=94=E5=95=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/controller/auth/SysRoleController.java | 9 +++++++++ .../controller/purchase/SupCompanyController.java | 12 ++++++++++++ .../glxp/api/entity/purchase/SupCompanyEntity.java | 3 +++ .../com/glxp/api/req/auth/FilterRoleRequest.java | 1 + .../com/glxp/api/service/auth/ISysRoleService.java | 7 +++++++ .../api/service/auth/impl/SysRoleServiceImpl.java | 7 +++++++ .../resources/mybatis/mapper/auth/SysRoleMapper.xml | 3 +++ 7 files changed, 42 insertions(+) diff --git a/src/main/java/com/glxp/api/controller/auth/SysRoleController.java b/src/main/java/com/glxp/api/controller/auth/SysRoleController.java index a87b5a9d..208bf80f 100644 --- a/src/main/java/com/glxp/api/controller/auth/SysRoleController.java +++ b/src/main/java/com/glxp/api/controller/auth/SysRoleController.java @@ -217,4 +217,13 @@ public class SysRoleController extends BaseController { return ResultVOUtils.success("授权成功!"); } + /** + * 获取供应商角色信息列表 + */ + @GetMapping("/customerlist") + public BaseResponse customerlist() { + List sysRoles = roleService.selectCustomer(); + return ResultVOUtils.success(sysRoles); + } + } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupCompanyController.java b/src/main/java/com/glxp/api/controller/purchase/SupCompanyController.java index 35d788fd..b9f0535e 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupCompanyController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupCompanyController.java @@ -10,6 +10,7 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.ConstantStatus; import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.auth.CustomerInfoEntity; import com.glxp.api.entity.basic.BasicCorpEntity; import com.glxp.api.entity.purchase.CustomerContactEntity; import com.glxp.api.entity.purchase.SupCertEntity; @@ -23,6 +24,7 @@ import com.glxp.api.req.purchase.SelectCorpBindRequest; 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.auth.CustomerInfoService; import com.glxp.api.service.basic.BasicCorpService; import com.glxp.api.service.purchase.CustomerContactService; import com.glxp.api.service.purchase.SupCertService; @@ -63,6 +65,8 @@ public class SupCompanyController { SupCertSetService supCertSetService; @Resource SupCompanyService supCompanyService; + @Resource + CustomerInfoService customerInfoService; @AuthRuleAnnotation("") @@ -259,6 +263,14 @@ public class SupCompanyController { } } + if(companyEntity.getRoleId()!=null){ + CustomerInfoEntity customerInfoEntity=new CustomerInfoEntity(); + customerInfoEntity.setCustomerId(Long.valueOf(companyEntity.getCustomerId())); + customerInfoEntity.setRoleId(companyEntity.getRoleId()); + customerInfoService.updateCustomerInfo(customerInfoEntity); + + } + AuthAdmin authAdmin = getUser(); companyEntity.setAuditor(authAdmin.getId() + ""); diff --git a/src/main/java/com/glxp/api/entity/purchase/SupCompanyEntity.java b/src/main/java/com/glxp/api/entity/purchase/SupCompanyEntity.java index a1041436..021959cf 100644 --- a/src/main/java/com/glxp/api/entity/purchase/SupCompanyEntity.java +++ b/src/main/java/com/glxp/api/entity/purchase/SupCompanyEntity.java @@ -302,5 +302,8 @@ public class SupCompanyEntity { @TableField(exist = false) private String auditor; + @TableField(exist = false) + private String roleId; + } diff --git a/src/main/java/com/glxp/api/req/auth/FilterRoleRequest.java b/src/main/java/com/glxp/api/req/auth/FilterRoleRequest.java index 6ed7d13a..d7d703c9 100644 --- a/src/main/java/com/glxp/api/req/auth/FilterRoleRequest.java +++ b/src/main/java/com/glxp/api/req/auth/FilterRoleRequest.java @@ -13,5 +13,6 @@ public class FilterRoleRequest extends ListPageRequest { private String neRoleName; private String neRoleKey; private Long neRoleId; + private Integer isCustomer; } diff --git a/src/main/java/com/glxp/api/service/auth/ISysRoleService.java b/src/main/java/com/glxp/api/service/auth/ISysRoleService.java index c8ed50c1..45878d16 100644 --- a/src/main/java/com/glxp/api/service/auth/ISysRoleService.java +++ b/src/main/java/com/glxp/api/service/auth/ISysRoleService.java @@ -173,4 +173,11 @@ public interface ISysRoleService { * @return 结果 */ int insertAuthUsers(Long roleId, Long[] userIds); + + /** + * 获取供应商角色 + * @param + * @return + */ + List selectCustomer(); } diff --git a/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java index 262089ae..b3e9e09e 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java @@ -403,4 +403,11 @@ public class SysRoleServiceImpl implements ISysRoleService { } return rows; } + + @Override + public List selectCustomer() { + FilterRoleRequest filterRoleRequest=new FilterRoleRequest(); + filterRoleRequest.setIsCustomer(1); + return sysRoleMapper.selectRoleList(filterRoleRequest); + } } diff --git a/src/main/resources/mybatis/mapper/auth/SysRoleMapper.xml b/src/main/resources/mybatis/mapper/auth/SysRoleMapper.xml index 71a82860..a435e4ee 100644 --- a/src/main/resources/mybatis/mapper/auth/SysRoleMapper.xml +++ b/src/main/resources/mybatis/mapper/auth/SysRoleMapper.xml @@ -110,6 +110,9 @@ AND `role_key` = #{roleKey} + + AND `isCustomer` = #{isCustomer} + AND `status` = #{status}