Explorar o código

租户列表的提交

dongxin hai 1 ano
pai
achega
1825213d96

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

@@ -0,0 +1,38 @@
+package com.jzg.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jzg.core.page.HttpResult;
+import com.jzg.entity.vo.SysRoleVo;
+import com.jzg.entity.vo.SysSystemVo;
+import com.jzg.service.SysSystemService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 租户管理接口
+ *
+ * @author dongxin
+ */
+@Tag(name="租户接口")
+@RestController
+@RequestMapping("/sys/system")
+public class SysSystemController {
+
+    @Autowired
+    private SysSystemService sysSystemService;
+
+    /**
+     * 租户分页列表
+     * @param sysSystemVo
+     * @return
+     */
+    @PostMapping("page")
+    @Operation(summary = "租户分页列表")
+    public HttpResult page(@RequestBody SysSystemVo sysSystemVo){
+        Page page = sysSystemVo.getPage();
+        return HttpResult.ok(sysSystemService.queryPage(page,sysSystemVo));
+    }
+
+}

+ 2 - 180
platform/src/main/java/com/jzg/entity/po/SysOperLog.java

@@ -1,6 +1,7 @@
 package com.jzg.entity.po;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -10,6 +11,7 @@ import java.util.Date;
  * 
  * @author dongxin
  */
+@Data
 public class SysOperLog {
 
     /** 日志主键 */
@@ -66,184 +68,4 @@ public class SysOperLog {
 
     /** 消耗时间 */
     private Long costTime;
-
-    public Long getOperId()
-    {
-        return operId;
-    }
-
-    public void setOperId(Long operId)
-    {
-        this.operId = operId;
-    }
-
-    public String getTitle()
-    {
-        return title;
-    }
-
-    public void setTitle(String title)
-    {
-        this.title = title;
-    }
-
-    public Integer getBusinessType()
-    {
-        return businessType;
-    }
-
-    public void setBusinessType(Integer businessType)
-    {
-        this.businessType = businessType;
-    }
-
-    public Integer[] getBusinessTypes()
-    {
-        return businessTypes;
-    }
-
-    public void setBusinessTypes(Integer[] businessTypes)
-    {
-        this.businessTypes = businessTypes;
-    }
-
-    public String getMethod()
-    {
-        return method;
-    }
-
-    public void setMethod(String method)
-    {
-        this.method = method;
-    }
-
-    public String getRequestMethod()
-    {
-        return requestMethod;
-    }
-
-    public void setRequestMethod(String requestMethod)
-    {
-        this.requestMethod = requestMethod;
-    }
-
-    public Integer getOperatorType()
-    {
-        return operatorType;
-    }
-
-    public void setOperatorType(Integer operatorType)
-    {
-        this.operatorType = operatorType;
-    }
-
-    public String getOperName()
-    {
-        return operName;
-    }
-
-    public void setOperName(String operName)
-    {
-        this.operName = operName;
-    }
-
-    public String getDeptName()
-    {
-        return deptName;
-    }
-
-    public void setDeptName(String deptName)
-    {
-        this.deptName = deptName;
-    }
-
-    public String getOperUrl()
-    {
-        return operUrl;
-    }
-
-    public void setOperUrl(String operUrl)
-    {
-        this.operUrl = operUrl;
-    }
-
-    public String getOperIp()
-    {
-        return operIp;
-    }
-
-    public void setOperIp(String operIp)
-    {
-        this.operIp = operIp;
-    }
-
-    public String getOperLocation()
-    {
-        return operLocation;
-    }
-
-    public void setOperLocation(String operLocation)
-    {
-        this.operLocation = operLocation;
-    }
-
-    public String getOperParam()
-    {
-        return operParam;
-    }
-
-    public void setOperParam(String operParam)
-    {
-        this.operParam = operParam;
-    }
-
-    public String getJsonResult()
-    {
-        return jsonResult;
-    }
-
-    public void setJsonResult(String jsonResult)
-    {
-        this.jsonResult = jsonResult;
-    }
-
-    public Integer getStatus()
-    {
-        return status;
-    }
-
-    public void setStatus(Integer status)
-    {
-        this.status = status;
-    }
-
-    public String getErrorMsg()
-    {
-        return errorMsg;
-    }
-
-    public void setErrorMsg(String errorMsg)
-    {
-        this.errorMsg = errorMsg;
-    }
-
-    public Date getOperTime()
-    {
-        return operTime;
-    }
-
-    public void setOperTime(Date operTime)
-    {
-        this.operTime = operTime;
-    }
-
-    public Long getCostTime()
-    {
-        return costTime;
-    }
-
-    public void setCostTime(Long costTime)
-    {
-        this.costTime = costTime;
-    }
 }

+ 1 - 1
platform/src/main/java/com/jzg/entity/po/SysRole.java

@@ -12,7 +12,7 @@ public class SysRole extends BaseModel {
     @TableId
     private String id;
 
-    private String systemId;
+    private Long systemId;
 
     private String name;
 

+ 55 - 5
platform/src/main/java/com/jzg/entity/po/SysSystem.java

@@ -1,17 +1,67 @@
 package com.jzg.entity.po;
 
+import java.io.Serializable;
+import java.util.Date;
+
+import com.jzg.core.base.BaseModel;
 import lombok.Data;
 
+/**
+ * 租户管理表实体 sys_system
+ *
+ * @author dongxin
+ */
 @Data
-public class SysSystem {
-
-    private String id;
-
-    private String parentId;
+public class SysSystem extends BaseModel {
+    /** 租户id */
+    private Long sysId;
 
+    /** 租户Code */
     private String sysCode;
 
+    /** 租户名称 */
     private String sysName;
 
+    /** 租户简称 */
+    private String shortName;
+
+    /** 系统图标 */
     private String sysIcon;
+
+    /** 租户类型 0-保险公司 1-保险分公司 2-保险经济公司 3-汽车经销商 4-保险代理公司 */
+    private Integer sysType;
+
+    /** 租户状态 0-停用 1-在用 */
+    private Integer available;
+
+    /** 省 */
+    private String provinceId;
+
+    /** 市 */
+    private String cityId;
+
+    /** 区 */
+    private String districtId;
+
+    /** 详细地址 */
+    private String address;
+
+    /** 联系人 */
+    private String contact;
+
+    /** 联系电话 */
+    private String telephone;
+
+    /** 联系人地址 */
+    private String contactAdress;
+
+    /** 联系人职务 */
+    private String contactJob;
+
+    /** 企业规模(人)*/
+    private Integer businessSize;
+
+    /** 法人代表 */
+    private String legalName;
+
 }

+ 1 - 1
platform/src/main/java/com/jzg/entity/vo/SysRoleVo.java

@@ -23,7 +23,7 @@ public class SysRoleVo extends PageRequest {
 
     @NotNull(message = "系统id不能为空")
     @Schema(description = "系统id")
-    private String system;
+    private Long system;
 
     @NotNull(message = "角色名称不能为空")
     @Size(min=1,max=100,message = "角色名称长度不能大于100")

+ 44 - 0
platform/src/main/java/com/jzg/entity/vo/SysSystemVo.java

@@ -0,0 +1,44 @@
+package com.jzg.entity.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.jzg.core.base.PageRequest;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "租户表VO")
+@Data
+public class SysSystemVo extends PageRequest {
+
+    @Schema(description = "租户id")
+    private String id;
+
+    /** 省 */
+    @Schema(description = "省id")
+    private String provinceId;
+
+    /** 市 */
+    @Schema(description = "市id")
+    private String cityId;
+
+    /** 区 */
+    @Schema(description = "区id")
+    private String districtId;
+
+    /** 租户类型 0-保险公司 1-保险分公司 2-保险经济公司 3-汽车经销商 4-保险代理公司 */
+    @Schema(description = "租户类型  0-保险公司 1-保险分公司 2-保险经济公司 3-汽车经销商 4-保险代理公司 ")
+    private Integer sysType;
+
+    /**
+     * 租户信息搜索值
+     */
+    @Schema(description = "租户信息搜索值")
+    private String searchValue;
+
+    /**
+     * 联系人信息搜索值
+     */
+    @Schema(description = "联系人信息搜索值")
+    private String contactValue;
+
+}

+ 11 - 2
platform/src/main/java/com/jzg/mapper/SysSystemMapper.java

@@ -1,10 +1,19 @@
 package com.jzg.mapper;
 
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.jzg.entity.po.SysRoleMenu;
 import com.jzg.entity.po.SysSystem;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 
+/**
+ * 租户管理表Mapper sys_system
+ *
+ * @author dongxin
+ */
 @Mapper
 public interface SysSystemMapper extends BaseMapper<SysSystem> {
+
 }
+
+
+
+

+ 7 - 7
platform/src/main/java/com/jzg/service/SysOperLogService.java

@@ -1,26 +1,26 @@
 package com.jzg.service;
-
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.jzg.entity.po.SysOperLog;
 
 import java.util.List;
 
 /**
  * 操作日志 服务层
- * 
+ *
  * @author dongxin
  */
-public interface SysOperLogService
+public interface SysOperLogService extends IService<SysOperLog>
 {
     /**
      * 新增操作日志
-     * 
+     *
      * @param operLog 操作日志对象
      */
     public void insertOperlog(SysOperLog operLog);
 
     /**
      * 查询系统操作日志集合
-     * 
+     *
      * @param operLog 操作日志对象
      * @return 操作日志集合
      */
@@ -28,7 +28,7 @@ public interface SysOperLogService
 
     /**
      * 批量删除系统操作日志
-     * 
+     *
      * @param operIds 需要删除的操作日志ID
      * @return 结果
      */
@@ -36,7 +36,7 @@ public interface SysOperLogService
 
     /**
      * 查询操作日志详细
-     * 
+     *
      * @param operId 操作ID
      * @return 操作日志对象
      */

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

@@ -1,8 +1,15 @@
 package com.jzg.service;
 
-import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.entity.po.SysSystem;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.jzg.entity.vo.SysSystemVo;
 
+/**
+ * 租户管理表服务层 sys_system
+ *
+ * @author dongxin
+ */
 public interface SysSystemService extends IService<SysSystem> {
 
     /**
@@ -10,7 +17,7 @@ public interface SysSystemService extends IService<SysSystem> {
      * @param systemCode
      * @return
      */
-    public SysSystem getBySystemCode(String systemCode);
+    public SysSystem getBySystemCode(Long systemCode);
 
     /**
      * 根据systemCode 判断是否存在数据
@@ -19,4 +26,11 @@ public interface SysSystemService extends IService<SysSystem> {
      */
     public boolean isExists(String systemCode);
 
+    /**
+     * 租户分页列表
+     * @param page
+     * @param sysSystemVo
+     * @return
+     */
+    Page<SysSystem> queryPage(Page page, SysSystemVo sysSystemVo);
 }

+ 3 - 1
platform/src/main/java/com/jzg/service/impl/SysOperLogServiceImpl.java

@@ -1,5 +1,6 @@
 package com.jzg.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jzg.entity.po.SysOperLog;
 import com.jzg.mapper.SysOperLogMapper;
 import com.jzg.service.SysOperLogService;
@@ -14,7 +15,8 @@ import java.util.List;
  * @author dongxin
  */
 @Service
-public class SysOperLogServiceImpl implements SysOperLogService
+public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog>
+        implements SysOperLogService
 {
     @Autowired
     private SysOperLogMapper operLogMapper;

+ 32 - 2
platform/src/main/java/com/jzg/service/impl/SysSystemServiceImpl.java

@@ -1,14 +1,24 @@
 package com.jzg.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jzg.entity.po.SysSystem;
+import com.jzg.entity.vo.SysSystemVo;
 import com.jzg.mapper.SysSystemMapper;
 import com.jzg.service.SysSystemService;
+import com.jzg.util.StringUtils;
+import jodd.util.StringUtil;
 import org.springframework.stereotype.Service;
 
+/**
+ * 租户管理表 服务层处理 sys_system
+ *
+ * @author dongxin
+ */
 @Service
-public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem> implements SysSystemService {
+public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem>
+    implements SysSystemService {
 
     /**
      * 根据SystemCode 查询 System对象
@@ -16,7 +26,7 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
      * @return
      */
     @Override
-    public SysSystem getBySystemCode(String systemCode) {
+    public SysSystem getBySystemCode(Long systemCode) {
         return this.getOne(new LambdaQueryWrapper<SysSystem>()
                 .eq(SysSystem::getSysCode, systemCode));
     }
@@ -32,4 +42,24 @@ public class SysSystemServiceImpl extends ServiceImpl<SysSystemMapper, SysSystem
                 .eq(SysSystem::getSysCode, systemCode));
         return count > 0;
     }
+
+    @Override
+    public Page<SysSystem> queryPage(Page page, SysSystemVo sysSystemVo) {
+        LambdaQueryWrapper<SysSystem> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(StringUtils.isNotEmpty(sysSystemVo.getProvinceId()), SysSystem::getProvinceId, sysSystemVo.getProvinceId())
+                .eq(StringUtils.isNotEmpty(sysSystemVo.getCityId()), SysSystem::getCityId, sysSystemVo.getCityId())
+                .eq(StringUtils.isNotEmpty(sysSystemVo.getDistrictId()), SysSystem::getDistrictId, sysSystemVo.getDistrictId())
+                .eq(StringUtils.isNotNull(sysSystemVo.getSysType()), SysSystem::getSysType, sysSystemVo.getSysType())
+                .eq(StringUtils.isNotEmpty(sysSystemVo.getSearchValue()), SysSystem::getSysName, sysSystemVo.getSearchValue())
+                .eq(StringUtils.isNotEmpty(sysSystemVo.getSearchValue()), SysSystem::getSysCode, sysSystemVo.getSearchValue())
+                .eq(StringUtils.isNotEmpty(sysSystemVo.getContactValue()), SysSystem::getContact, sysSystemVo.getContactValue())
+                .eq(StringUtils.isNotEmpty(sysSystemVo.getContactValue()), SysSystem::getTelephone, sysSystemVo.getContactValue());
+        Page<SysSystem> sysPage = page(page, wrapper);
+        return sysPage;
+    }
+
 }
+
+
+
+

+ 1 - 1
platform/src/main/java/com/jzg/service/impl/UserRoleServiceImpl.java

@@ -64,7 +64,7 @@ public class UserRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
             throw new SystemException("系统不存在,请修改");
         }
         List<SysRolePerms> sysRolePermsList = new ArrayList<>();
-        sysRole.setSystemId(bySystemCode.getId());
+        sysRole.setSystemId(bySystemCode.getSysId());
         for(int i=0;i<sysRoleVo.getPermsId().size();i++){
             SysRolePerms perms = new SysRolePerms();
             perms.setId(IdGenerate.nextId());

+ 41 - 0
platform/src/main/resources/mapper/SysSystemMapper.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jzg.mapper.SysSystemMapper">
+
+    <resultMap id="SysSystemResult" type="com.jzg.entity.po.SysSystem">
+            <id property="sysId" column="sys_id" jdbcType="BIGINT"/>
+            <result property="sysCode" column="sys_code" jdbcType="VARCHAR"/>
+            <result property="sysName" column="sys_name" jdbcType="VARCHAR"/>
+            <result property="shortName" column="short_name" jdbcType="VARCHAR"/>
+            <result property="sysIcon" column="sys_icon" jdbcType="VARCHAR"/>
+            <result property="sysType" column="sys_type" jdbcType="TINYINT"/>
+            <result property="available" column="available" jdbcType="TINYINT"/>
+            <result property="provinceId" column="province_id" jdbcType="VARCHAR"/>
+            <result property="cityId" column="city_id" jdbcType="VARCHAR"/>
+            <result property="districtId" column="district_id" jdbcType="VARCHAR"/>
+            <result property="address" column="address" jdbcType="VARCHAR"/>
+            <result property="contact" column="contact" jdbcType="VARCHAR"/>
+            <result property="telephone" column="telephone" jdbcType="VARCHAR"/>
+            <result property="contactAdress" column="contact_adress" jdbcType="VARCHAR"/>
+            <result property="contactJob" column="contact_job" jdbcType="VARCHAR"/>
+            <result property="businessSize" column="business_size" jdbcType="INTEGER"/>
+            <result property="legalName" column="legal_name" jdbcType="VARCHAR"/>
+            <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="selectSystemVo">
+        select sys_id,sys_code,sys_name,
+               short_name,sys_icon,sys_type,
+               available,province_id,city_id,
+               district_id,address,contact,
+               telephone,contact_adress,contact_job,
+               business_size,legal_name,create_by,
+               create_time,update_by,update_time
+        from sys_oper_log
+    </sql>
+</mapper>