785834757 1 год назад
Родитель
Сommit
5d9785a9b2

+ 3 - 3
commons/src/main/java/com/jzg/commons/entity/system/po/SysSystemBusPerms.java

@@ -27,8 +27,8 @@ public class SysSystemBusPerms implements Serializable {
     @TableId
     private String id;
 
-    @Schema(description = "保司id")
-    private String companyId;
+//    @Schema(description = "保司id")
+//    private String companyId;
 
     @Schema(description = "系统编码")
     private String systemCode;
@@ -59,7 +59,7 @@ public class SysSystemBusPerms implements Serializable {
         }else{
             this.id = IdGenerate.nextId();
         }
-        this.companyId = sysSystemBusPermsVo.getCompanyId();
+//        this.companyId = sysSystemBusPermsVo.getCompanyId();
         this.systemCode = sysSystemBusPermsVo.getSystemCode();
         this.quoteCompany = sysSystemBusPermsVo.getQuoteCompany();
         this.orderMode = sysSystemBusPermsVo.getOrderMode();

+ 3 - 3
commons/src/main/java/com/jzg/commons/entity/system/vo/SysSystemBusPermsVo.java

@@ -29,8 +29,8 @@ public class SysSystemBusPermsVo implements Serializable {
     @TableId
     private String id;
 
-    @Schema(description = "保司id")
-    private String companyId;
+//    @Schema(description = "保司id")
+//    private String companyId;
 
     @Schema(description = "系统编码")
     private String systemCode;
@@ -70,7 +70,7 @@ public class SysSystemBusPermsVo implements Serializable {
 
     public SysSystemBusPermsVo(SysSystemBusPerms sysSystemBusPerms, List<SysSystemBusPermsLink> links) {
         this.id = sysSystemBusPerms.getId();
-        this.companyId = sysSystemBusPerms.getCompanyId();
+//        this.companyId = sysSystemBusPerms.getCompanyId();
         this.systemCode = sysSystemBusPerms.getSystemCode();
         this.quoteCompany = sysSystemBusPerms.getQuoteCompany();
         this.orderMode = sysSystemBusPerms.getOrderMode();

+ 2 - 2
platform/src/main/java/com/jzg/controller/SysSystemController.java

@@ -213,8 +213,8 @@ public class SysSystemController {
 
     @GetMapping("/getBusPerms")
     @Operation(summary = "获取租户业务权限")
-    public HttpResult getBusPerms(String systemCode,String companyId) {
-        return HttpResult.ok(sysSystemService.getBusPerms(systemCode,companyId));
+    public HttpResult getBusPerms(String systemCode) {
+        return HttpResult.ok(sysSystemService.getBusPerms(systemCode));
     }
 
 

+ 1 - 2
platform/src/main/java/com/jzg/service/SysSystemService.java

@@ -170,10 +170,9 @@ public interface SysSystemService extends IService<SysSystem> {
     /**
      * 获取租户业务权限
      * @param systemCode
-     * @param companyId
      * @return
      */
-    SysSystemBusPermsVo getBusPerms(String systemCode,String companyId);
+    SysSystemBusPermsVo getBusPerms(String systemCode);
 
     //endregion
 }

+ 10 - 6
platform/src/main/java/com/jzg/service/impl/SysSystemServiceImpl.java

@@ -20,6 +20,7 @@ import com.jzg.commons.entity.vo.SysSystemPermsVo;
 import com.jzg.commons.entity.vo.SysSystemVo;
 import com.jzg.commons.entity.vo.UpAndDownVo;
 import com.jzg.commons.exception.SystemException;
+import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.MinioUtils;
 import com.jzg.commons.util.StringUtils;
 import com.jzg.mapper.*;
@@ -31,9 +32,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -513,7 +512,11 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean saveBusPerms(SysSystemBusPermsVo sysSystemBusPermsVo) {
+        SysSystemBusPerms busOne = sysSystemBusPermsMapper.selectOne(new LambdaQueryWrapper<SysSystemBusPerms>().eq(SysSystemBusPerms::getSystemCode, sysSystemBusPermsVo.getSystemCode()));
         SysSystemBusPerms sysSystemBusPerms = new SysSystemBusPerms(sysSystemBusPermsVo);
+        if(Objects.nonNull(busOne)){
+            sysSystemBusPerms.setId(busOne.getId());
+        }
         sysSystemBusPermsMapper.insertOrUpdate(sysSystemBusPerms);
         sysSystemBusPermsVo.setId(sysSystemBusPermsVo.getId());
         List<SysSystemBusPermsLink> sysSystemBusPermsLink = SysSystemBusPermsLink.getSystemBusPermsLink(sysSystemBusPermsVo);
@@ -528,11 +531,12 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
     }
 
     @Override
-    public SysSystemBusPermsVo getBusPerms(String systemCode,String companyId) {
+    public SysSystemBusPermsVo getBusPerms(String systemCode) {
 
         SysSystemBusPerms sysSystemBusPerms = sysSystemBusPermsMapper.selectOne(new LambdaQueryWrapper<SysSystemBusPerms>()
-                .eq(SysSystemBusPerms::getSystemCode, systemCode)
-                .eq(SysSystemBusPerms::getCompanyId, companyId));
+                .eq(SysSystemBusPerms::getSystemCode, systemCode));
+
+        AssertionUtils.isFail(Objects.isNull(sysSystemBusPerms),"该租户不存在租户功能配置");
 
         List<SysSystemBusPermsLink> sysSystemBusPermsLinks = sysSystemBusPermsLinkMapper.selectList(new LambdaQueryWrapper<SysSystemBusPermsLink>()
                 .eq(SysSystemBusPermsLink::getPermsId, sysSystemBusPerms.getId()));

+ 1 - 0
platform/src/main/resources/mapper/InsCompanyClauseMapper.xml

@@ -30,6 +30,7 @@
         <if test="param.clauseContent != null and param.clauseContent != ''">
             AND clause_content LIKE CONCAT('%', #{param.clauseContent}, '%')
         </if>
+        order by icc.create_time desc
     </select>
 
     <select id="getClause" resultType="com.jzg.commons.entity.vo.InsCompanyClauseVo">

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysDeptServiceImpl.java

@@ -178,7 +178,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
 
                     // 设置负责人信息
                     Optional.ofNullable(item.getLeaderId())
-                            .map(sysUserJzgInfoService::getUserByUserId)
+                            .map(sysUserJzgInfoService::getUserById)
                             .map(SysUserJzgInfo::getName)
                             .ifPresent(sysDeptVo::setLeaderName);