Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/jiwei/wlyy2.0 into dev

Conflicts:
	svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java
yeshijie 6 years ago
parent
commit
adf1a442ce
24 changed files with 751 additions and 857 deletions
  1. 2 2
      common/common-entity/src/main/java/com/yihu/jw/entity/base/customize/UserHideModuleFunctionDO.java
  2. 0 85
      common/common-entity/src/main/java/com/yihu/jw/entity/base/function/FunctionDO.java
  3. 50 50
      common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasDefaultModuleFunctionDO.java
  4. 50 50
      common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasModuleFunctionDO.java
  5. 1 1
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/customize/UserHideModuleFunctionVO.java
  6. 82 82
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/function/FunctionVO.java
  7. 45 45
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/saas/SaasDefaultModuleFunctionVO.java
  8. 48 48
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/saas/SaasModuleFunctionVO.java
  9. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/customize/UserHideModuleFunctionDao.java
  10. 21 21
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/function/FunctionDao.java
  11. 19 19
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/saas/SaasDefaultModuleFunctionDao.java
  12. 13 13
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/saas/SaasModuleFunctionDao.java
  13. 15 15
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/customize/UserHideModuleFunctionEndpoint.java
  14. 96 96
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/function/FunctionEndpoint.java
  15. 96 96
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasDefaultModuleFunctionEndpoint.java
  16. 96 96
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasModuleFunctionEndpoint.java
  17. 3 10
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasTypeDictEndpoint.java
  18. 3 3
      svr/svr-base/src/main/java/com/yihu/jw/base/service/customize/UserHideModuleFunctionService.java
  19. 16 16
      svr/svr-base/src/main/java/com/yihu/jw/base/service/function/FunctionService.java
  20. 25 26
      svr/svr-base/src/main/java/com/yihu/jw/base/service/module/InterfaceService.java
  21. 22 22
      svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasDefaultModuleFunctionService.java
  22. 17 17
      svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasModuleFunctionService.java
  23. 14 21
      svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasService.java
  24. 15 21
      svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasTypeDictService.java

+ 2 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/base/customize/UserHideModuleFunctionDO.java

@ -12,8 +12,8 @@ import javax.persistence.Table;
 * @date Created on 2018/8/14.
 */
@Entity
@Table(name = "base_user_hide_module_function")
public class UserHideModuleFunctionDO extends IntegerIdentityEntity {
@Table(name = "base_user_hide_module_interface")
public class UserHideModuleInterfaceDO extends IntegerIdentityEntity {
    /**
     * 对象ID

+ 0 - 85
common/common-entity/src/main/java/com/yihu/jw/entity/base/function/FunctionDO.java

@ -1,85 +0,0 @@
package com.yihu.jw.entity.base.function;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * Entity - 功能
 * Created by progr1mmer on 2018/8/14.
 */
@Entity
@Table(name = "base_function")
public class FunctionDO extends UuidIdentityEntityWithOperator {
    //关联 base_module ID
    private String moduleId;
    //功能名称
    private String name;
    //网关url前缀
    private String prefix;
    //功能对应的后台url路径
    private String url;
    //备注
    private String remark;
    //用于jstree显示
    private String text;
    @Column(name = "module_id", nullable = false, length = 50)
    public String getModuleId() {
        return this.moduleId;
    }
    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }
    @Column(name = "name", length = 200)
    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "prefix")
    public String getPrefix() {
        return prefix;
    }
    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }
    @Column(name = "url")
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    @Column(name = "remark")
    public String getRemark() {
        return this.remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    @Transient
    public String getText() {
        return name;
    }
    public void setText(String text) {
        this.text = text;
    }
}

+ 50 - 50
common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasDefaultModuleFunctionDO.java

@ -1,50 +1,50 @@
package com.yihu.jw.entity.base.saas;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Entity - Saas默认模块功能
 * Created by progr1mmer on 2018/8/14.
 */
@Entity
@Table(name = "base_saas_default_module_function")
public class SaasDefaultModuleFunctionDO extends IntegerIdentityEntity {
    //Saas类型
    private Integer saasType;
    //模块ID
    private String moduleId;
    //功能ID
    private String functionId;
    @Column(name = "saas_type", nullable = false)
    public Integer getSaasType() {
        return saasType;
    }
    public void setSaasType(Integer saasType) {
        this.saasType = saasType;
    }
    @Column(name = "module_id", nullable = false, length = 50)
    public String getModuleId() {
        return moduleId;
    }
    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }
    @Column(name = "function_id", nullable = false, length = 50)
    public String getFunctionId() {
        return functionId;
    }
    public void setFunctionId(String functionId) {
        this.functionId = functionId;
    }
}
//package com.yihu.jw.entity.base.saas;
//
//import com.yihu.jw.entity.IntegerIdentityEntity;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.Table;
//
///**
// * Entity - Saas默认模块功能
// * Created by progr1mmer on 2018/8/14.
// */
//@Entity
//@Table(name = "base_saas_default_module_function")
//public class SaasDefaultModuleFunctionDO extends IntegerIdentityEntity {
//
//    //Saas类型
//    private Integer saasType;
//    //模块ID
//    private String moduleId;
//    //功能ID
//    private String functionId;
//
//    @Column(name = "saas_type", nullable = false)
//    public Integer getSaasType() {
//        return saasType;
//    }
//
//    public void setSaasType(Integer saasType) {
//        this.saasType = saasType;
//    }
//
//    @Column(name = "module_id", nullable = false, length = 50)
//    public String getModuleId() {
//        return moduleId;
//    }
//
//    public void setModuleId(String moduleId) {
//        this.moduleId = moduleId;
//    }
//
//    @Column(name = "function_id", nullable = false, length = 50)
//    public String getFunctionId() {
//        return functionId;
//    }
//
//    public void setFunctionId(String functionId) {
//        this.functionId = functionId;
//    }
//}

+ 50 - 50
common/common-entity/src/main/java/com/yihu/jw/entity/base/saas/SaasModuleFunctionDO.java

@ -1,50 +1,50 @@
package com.yihu.jw.entity.base.saas;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Entity - Saas所分配的模块功能
 * Created by progr1mmer on 2018/8/27.
 */
@Entity
@Table(name = "base_saas_module_function")
public class SaasModuleFunctionDO extends IntegerIdentityEntity {
    //Saas ID
    private String saasId;
    //模块ID
    private String moduleId;
    //功能ID
    private String functionId;
    @Column(name = "saas_id", nullable = false, length = 50)
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "module_id", nullable = false, length = 50)
    public String getModuleId() {
        return moduleId;
    }
    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }
    @Column(name = "function_id", nullable = false, length = 50)
    public String getFunctionId() {
        return functionId;
    }
    public void setFunctionId(String functionId) {
        this.functionId = functionId;
    }
}
//package com.yihu.jw.entity.base.saas;
//
//import com.yihu.jw.entity.IntegerIdentityEntity;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.Table;
//
///**
// * Entity - Saas所分配的模块功能
// * Created by progr1mmer on 2018/8/27.
// */
//@Entity
//@Table(name = "base_saas_module_function")
//public class SaasModuleFunctionDO extends IntegerIdentityEntity {
//
//    //Saas ID
//    private String saasId;
//    //模块ID
//    private String moduleId;
//    //功能ID
//    private String functionId;
//
//    @Column(name = "saas_id", nullable = false, length = 50)
//    public String getSaasId() {
//        return saasId;
//    }
//
//    public void setSaasId(String saasId) {
//        this.saasId = saasId;
//    }
//
//    @Column(name = "module_id", nullable = false, length = 50)
//    public String getModuleId() {
//        return moduleId;
//    }
//
//    public void setModuleId(String moduleId) {
//        this.moduleId = moduleId;
//    }
//
//    @Column(name = "function_id", nullable = false, length = 50)
//    public String getFunctionId() {
//        return functionId;
//    }
//
//    public void setFunctionId(String functionId) {
//        this.functionId = functionId;
//    }
//}

+ 1 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/customize/UserHideModuleFunctionVO.java

@ -11,7 +11,7 @@ import io.swagger.annotations.ApiModelProperty;
 * @date Created on 2018/9/11.
 */
@ApiModel(value = "UserHideModuleFunctionVO", description = "用户取消订阅的模块或者功能")
public class UserHideModuleFunctionVO extends IntegerIdentityVO {
public class UserHideModuleInterfaceVO extends IntegerIdentityVO {
    /**
     * 用户ID

+ 82 - 82
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/function/FunctionVO.java

@ -1,82 +1,82 @@
package com.yihu.jw.restmodel.base.function;
import com.yihu.jw.restmodel.UuidIdentityVOWithOperator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * VO - 功能
 * Created by progr1mmer on 2018/8/14.
 */
@ApiModel(value = "FunctionVO", description = "功能")
public class FunctionVO extends UuidIdentityVOWithOperator {
    //关联 base_module ID
    @ApiModelProperty(value = "关联 base_module ID", example = "0dae0003590016e5b3865e377b2f8615")
    private String moduleId;
    //功能名称
    @ApiModelProperty(value = "功能名称", example = "功能1")
    private String name;
    //网关url前缀
    @ApiModelProperty(value = "网关url前缀", example = "/base")
    private String prefix;
    //功能对应的后台url路径
    @ApiModelProperty(value = "功能对应的后台url路径", example = "/function/list")
    private String url;
    //备注
    @ApiModelProperty(value = "备注", example = "我是备注")
    private String remark;
    //用于jstree显示
    @ApiModelProperty(value = "用于jstree显示")
    private String text;
    public String getModuleId() {
        return this.moduleId;
    }
    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }
    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getPrefix() {
        return prefix;
    }
    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getRemark() {
        return this.remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getText() {
        return name;
    }
    public void setText(String text) {
        this.text = text;
    }
}
//package com.yihu.jw.restmodel.base.function;
//
//
//import com.yihu.jw.restmodel.UuidIdentityVOWithOperator;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//
//
///**
// * VO - 功能
// * Created by progr1mmer on 2018/8/14.
// */
//@ApiModel(value = "FunctionVO", description = "功能")
//public class FunctionVO extends UuidIdentityVOWithOperator {
//
//    //关联 base_module ID
//    @ApiModelProperty(value = "关联 base_module ID", example = "0dae0003590016e5b3865e377b2f8615")
//    private String moduleId;
//    //功能名称
//    @ApiModelProperty(value = "功能名称", example = "功能1")
//    private String name;
//    //网关url前缀
//    @ApiModelProperty(value = "网关url前缀", example = "/base")
//    private String prefix;
//    //功能对应的后台url路径
//    @ApiModelProperty(value = "功能对应的后台url路径", example = "/function/list")
//    private String url;
//    //备注
//    @ApiModelProperty(value = "备注", example = "我是备注")
//    private String remark;
//    //用于jstree显示
//    @ApiModelProperty(value = "用于jstree显示")
//    private String text;
//
//    public String getModuleId() {
//        return this.moduleId;
//    }
//
//    public void setModuleId(String moduleId) {
//        this.moduleId = moduleId;
//    }
//
//    public String getName() {
//        return this.name;
//    }
//
//    public void setName(String name) {
//        this.name = name;
//    }
//
//    public String getPrefix() {
//        return prefix;
//    }
//
//    public void setPrefix(String prefix) {
//        this.prefix = prefix;
//    }
//
//    public String getUrl() {
//        return url;
//    }
//
//    public void setUrl(String url) {
//        this.url = url;
//    }
//
//    public String getRemark() {
//        return this.remark;
//    }
//
//    public void setRemark(String remark) {
//        this.remark = remark;
//    }
//
//    public String getText() {
//        return name;
//    }
//
//    public void setText(String text) {
//        this.text = text;
//    }
//}

+ 45 - 45
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/saas/SaasDefaultModuleFunctionVO.java

@ -1,45 +1,45 @@
package com.yihu.jw.restmodel.base.saas;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.restmodel.IntegerIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * VO - Saas默认模块功能
 * Created by progr1mmer on 2018/8/14.
 */
@ApiModel(value = "SaasDefaultModuleFunctionVO", description = "Saas默认模块功能")
public class SaasDefaultModuleFunctionVO extends IntegerIdentityVO {
    @ApiModelProperty(value = "Saas类型编码(从1开始自增)", example = "1")
    private Integer saasType;
    @ApiModelProperty(value = "模块ID", example = "402303ee656498890234sf9ad2wa00sa")
    private String moduleId;
    @ApiModelProperty(value = "功能ID", example = "402303ee656498890sd24s9ad2wa00sd")
    private String functionId;
    public Integer getSaasType() {
        return saasType;
    }
    public void setSaasType(Integer saasType) {
        this.saasType = saasType;
    }
    public String getModuleId() {
        return moduleId;
    }
    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }
    public String getFunctionId() {
        return functionId;
    }
    public void setFunctionId(String functionId) {
        this.functionId = functionId;
    }
}
//package com.yihu.jw.restmodel.base.saas;
//
//import com.yihu.jw.entity.base.saas.SaasDO;
//import com.yihu.jw.restmodel.IntegerIdentityVO;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//
///**
// * VO - Saas默认模块功能
// * Created by progr1mmer on 2018/8/14.
// */
//@ApiModel(value = "SaasDefaultModuleFunctionVO", description = "Saas默认模块功能")
//public class SaasDefaultModuleFunctionVO extends IntegerIdentityVO {
//
//    @ApiModelProperty(value = "Saas类型编码(从1开始自增)", example = "1")
//    private Integer saasType;
//    @ApiModelProperty(value = "模块ID", example = "402303ee656498890234sf9ad2wa00sa")
//    private String moduleId;
//    @ApiModelProperty(value = "功能ID", example = "402303ee656498890sd24s9ad2wa00sd")
//    private String functionId;
//
//    public Integer getSaasType() {
//        return saasType;
//    }
//
//    public void setSaasType(Integer saasType) {
//        this.saasType = saasType;
//    }
//
//    public String getModuleId() {
//        return moduleId;
//    }
//
//    public void setModuleId(String moduleId) {
//        this.moduleId = moduleId;
//    }
//
//    public String getFunctionId() {
//        return functionId;
//    }
//
//    public void setFunctionId(String functionId) {
//        this.functionId = functionId;
//    }
//}

+ 48 - 48
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/saas/SaasModuleFunctionVO.java

@ -1,48 +1,48 @@
package com.yihu.jw.restmodel.base.saas;
import com.yihu.jw.restmodel.IntegerIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * VO - Saas所分配的模块功能
 * Created by progr1mmer on 2018/8/27.
 */
@ApiModel(value = "SaasModuleFunctionVO", description = "Saas所分配的模块功能")
public class SaasModuleFunctionVO extends IntegerIdentityVO {
    //Saas ID
    @ApiModelProperty(value = "Saas ID", example = "402303ee65634dfs0234sf9ad2wa00d2")
    private String saasId;
    //模块ID
    @ApiModelProperty(value = "模块ID", example = "402303ee656498890234sf9ad2wa00sa")
    private String moduleId;
    //功能ID
    @ApiModelProperty(value = "功能ID", example = "402303ee656498890sd24s9ad2wa00sd")
    private String functionId;
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getModuleId() {
        return moduleId;
    }
    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }
    public String getFunctionId() {
        return functionId;
    }
    public void setFunctionId(String functionId) {
        this.functionId = functionId;
    }
}
//package com.yihu.jw.restmodel.base.saas;
//
//import com.yihu.jw.restmodel.IntegerIdentityVO;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//
//
///**
// * VO - Saas所分配的模块功能
// * Created by progr1mmer on 2018/8/27.
// */
//@ApiModel(value = "SaasModuleFunctionVO", description = "Saas所分配的模块功能")
//public class SaasModuleFunctionVO extends IntegerIdentityVO {
//
//    //Saas ID
//    @ApiModelProperty(value = "Saas ID", example = "402303ee65634dfs0234sf9ad2wa00d2")
//    private String saasId;
//    //模块ID
//    @ApiModelProperty(value = "模块ID", example = "402303ee656498890234sf9ad2wa00sa")
//    private String moduleId;
//    //功能ID
//    @ApiModelProperty(value = "功能ID", example = "402303ee656498890sd24s9ad2wa00sd")
//    private String functionId;
//
//    public String getSaasId() {
//        return saasId;
//    }
//
//    public void setSaasId(String saasId) {
//        this.saasId = saasId;
//    }
//
//    public String getModuleId() {
//        return moduleId;
//    }
//
//    public void setModuleId(String moduleId) {
//        this.moduleId = moduleId;
//    }
//
//    public String getFunctionId() {
//        return functionId;
//    }
//
//    public void setFunctionId(String functionId) {
//        this.functionId = functionId;
//    }
//}

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/dao/customize/UserHideModuleFunctionDao.java

@ -1,6 +1,6 @@
package com.yihu.jw.base.dao.customize;
import com.yihu.jw.entity.base.customize.UserHideModuleFunctionDO;
import com.yihu.jw.entity.base.customize.UserHideModuleInterfaceDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -9,5 +9,5 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 * @author progr1mmer.
 * @date Created on 2018/8/20.
 */
public interface UserHideModuleFunctionDao extends PagingAndSortingRepository<UserHideModuleFunctionDO, Integer>, JpaSpecificationExecutor<UserHideModuleFunctionDO> {
public interface UserHideModuleInterfaceDao extends PagingAndSortingRepository<UserHideModuleInterfaceDO, Integer>, JpaSpecificationExecutor<UserHideModuleInterfaceDO> {
}

+ 21 - 21
svr/svr-base/src/main/java/com/yihu/jw/base/dao/function/FunctionDao.java

@ -1,21 +1,21 @@
package com.yihu.jw.base.dao.function;
import com.yihu.jw.entity.base.function.FunctionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import java.util.List;
/**
 * Dao - 功能
 * Created by chenweida on 2017/5/19.
 */
public interface FunctionDao extends PagingAndSortingRepository<FunctionDO, String>, JpaSpecificationExecutor<FunctionDO> {
    @Query("select f from FunctionDO  f where f.moduleId in (:moduleId)")
    List<FunctionDO> findFunctionDOSByModuleIdExists(@Param("moduleId") String[] moduleId);
}
//package com.yihu.jw.base.dao.function;
//
//import com.yihu.jw.entity.base.function.FunctionDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.data.repository.PagingAndSortingRepository;
//import org.springframework.data.repository.query.Param;
//
//import java.util.List;
//
///**
// * Dao - 功能
// * Created by chenweida on 2017/5/19.
// */
//public interface FunctionDao extends PagingAndSortingRepository<FunctionDO, String>, JpaSpecificationExecutor<FunctionDO> {
//
//    @Query("select f from FunctionDO  f where f.moduleId in (:moduleId)")
//    List<FunctionDO> findFunctionDOSByModuleIdExists(@Param("moduleId") String[] moduleId);
//
//
//}

+ 19 - 19
svr/svr-base/src/main/java/com/yihu/jw/base/dao/saas/SaasDefaultModuleFunctionDao.java

@ -1,19 +1,19 @@
package com.yihu.jw.base.dao.saas;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.entity.base.saas.SaasDefaultModuleFunctionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Dao - Saas默认模块功能
 * Created by progr1mmer on 2018/8/17.
 */
public interface SaasDefaultModuleFunctionDao extends PagingAndSortingRepository<SaasDefaultModuleFunctionDO, Integer>, JpaSpecificationExecutor<SaasDefaultModuleFunctionDO> {
    List<SaasDefaultModuleFunctionDO> findBySaasType(Integer saasType);
    void deleteBySaasType(Integer saasType);
}
//package com.yihu.jw.base.dao.saas;
//
//import com.yihu.jw.entity.base.saas.SaasDO;
//import com.yihu.jw.entity.base.saas.SaasDefaultModuleFunctionDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
//import java.util.List;
//
///**
// * Dao - Saas默认模块功能
// * Created by progr1mmer on 2018/8/17.
// */
//public interface SaasDefaultModuleFunctionDao extends PagingAndSortingRepository<SaasDefaultModuleFunctionDO, Integer>, JpaSpecificationExecutor<SaasDefaultModuleFunctionDO> {
//
//    List<SaasDefaultModuleFunctionDO> findBySaasType(Integer saasType);
//
//    void deleteBySaasType(Integer saasType);
//}

+ 13 - 13
svr/svr-base/src/main/java/com/yihu/jw/base/dao/saas/SaasModuleFunctionDao.java

@ -1,13 +1,13 @@
package com.yihu.jw.base.dao.saas;
import com.yihu.jw.entity.base.saas.SaasModuleFunctionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Dao - Saas所分配的模块功能
 * Created by progr1mmer on 2018/8/17.
 */
public interface SaasModuleFunctionDao extends PagingAndSortingRepository<SaasModuleFunctionDO, String>, JpaSpecificationExecutor<SaasModuleFunctionDO> {
}
//package com.yihu.jw.base.dao.saas;
//
//import com.yihu.jw.entity.base.saas.SaasModuleFunctionDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
///**
// * Dao - Saas所分配的模块功能
// * Created by progr1mmer on 2018/8/17.
// */
//public interface SaasModuleFunctionDao extends PagingAndSortingRepository<SaasModuleFunctionDO, String>, JpaSpecificationExecutor<SaasModuleFunctionDO> {
//
//}

+ 15 - 15
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/customize/UserHideModuleFunctionEndpoint.java

@ -1,8 +1,8 @@
package com.yihu.jw.base.endpoint.customize;
import com.yihu.jw.base.service.customize.UserHideModuleFunctionService;
import com.yihu.jw.entity.base.customize.UserHideModuleFunctionDO;
import com.yihu.jw.restmodel.base.customize.UserHideModuleFunctionVO;
import com.yihu.jw.base.service.customize.UserHideModuleInterfaceService;
import com.yihu.jw.entity.base.customize.UserHideModuleInterfaceDO;
import com.yihu.jw.restmodel.base.customize.UserHideModuleInterfaceVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -25,19 +25,19 @@ import java.util.List;
@RestController
@RequestMapping(value = BaseRequestMapping.UserHideModuleFunction.PREFIX)
@Api(value = "用户取消订阅的模块或功能(用户自定义)", description = "用户取消订阅的模块或功能(用户自定义)服务接口", tags = {"wlyy基础服务 - 用户取消订阅的模块或功能(用户自定义)服务接口"})
public class UserHideModuleFunctionEndpoint extends EnvelopRestEndpoint {
public class UserHideModuleInterfaceEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private UserHideModuleFunctionService userHideModuleFunctionService;
    private UserHideModuleInterfaceService userHideModuleFunctionService;
    @PostMapping(value = BaseRequestMapping.UserHideModuleFunction.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<UserHideModuleFunctionVO> create (
    public ObjEnvelop<UserHideModuleInterfaceVO> create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        UserHideModuleFunctionDO userHideModuleFunctionDO = toEntity(jsonData, UserHideModuleFunctionDO.class);
        UserHideModuleInterfaceDO userHideModuleFunctionDO = toEntity(jsonData, UserHideModuleInterfaceDO.class);
        userHideModuleFunctionDO = userHideModuleFunctionService.save(userHideModuleFunctionDO);
        return success(userHideModuleFunctionDO, UserHideModuleFunctionVO.class);
        return success(userHideModuleFunctionDO, UserHideModuleInterfaceVO.class);
    }
    @PostMapping(value = BaseRequestMapping.UserHideModuleFunction.DELETE)
@ -54,7 +54,7 @@ public class UserHideModuleFunctionEndpoint extends EnvelopRestEndpoint {
    public Envelop update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        UserHideModuleFunctionDO userHideModuleFunctionDO = toEntity(jsonData, UserHideModuleFunctionDO.class);
        UserHideModuleInterfaceDO userHideModuleFunctionDO = toEntity(jsonData, UserHideModuleInterfaceDO.class);
        if (null == userHideModuleFunctionDO.getId()) {
            return failed("ID不能为空", Envelop.class);
        }
@ -64,7 +64,7 @@ public class UserHideModuleFunctionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseRequestMapping.UserHideModuleFunction.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<UserHideModuleFunctionVO> page (
    public PageEnvelop<UserHideModuleInterfaceVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
@ -75,22 +75,22 @@ public class UserHideModuleFunctionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<UserHideModuleFunctionDO> userHideModuleFunctionDOS = userHideModuleFunctionService.search(fields, filters, sorts, page, size);
        List<UserHideModuleInterfaceDO> userHideModuleFunctionDOS = userHideModuleFunctionService.search(fields, filters, sorts, page, size);
        int count = (int)userHideModuleFunctionService.getCount(filters);
        return success(userHideModuleFunctionDOS, count, page, size, UserHideModuleFunctionVO.class);
        return success(userHideModuleFunctionDOS, count, page, size, UserHideModuleInterfaceVO.class);
    }
    @GetMapping(value = BaseRequestMapping.UserHideModuleFunction.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<UserHideModuleFunctionVO> list (
    public ListEnvelop<UserHideModuleInterfaceVO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<UserHideModuleFunctionDO> userHideModuleFunctionDOS = userHideModuleFunctionService.search(fields, filters, sorts);
        return success(userHideModuleFunctionDOS, UserHideModuleFunctionVO.class);
        List<UserHideModuleInterfaceDO> userHideModuleFunctionDOS = userHideModuleFunctionService.search(fields, filters, sorts);
        return success(userHideModuleFunctionDOS, UserHideModuleInterfaceVO.class);
    }
}

+ 96 - 96
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/function/FunctionEndpoint.java

@ -1,96 +1,96 @@
package com.yihu.jw.base.endpoint.function;
import com.yihu.jw.base.service.function.FunctionService;
import com.yihu.jw.entity.base.function.FunctionDO;
import com.yihu.jw.restmodel.base.function.FunctionVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Endpoint - 功能
 * Created by progr1mmer on 2018/8/16.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.Function.PREFIX)
@Api(value = "功能(接口)管理", description = "功能(接口)管理服务接口", tags = {"wlyy基础服务 - 功能(接口)管理服务接口"})
public class FunctionEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private FunctionService functionService;
    @PostMapping(value = BaseRequestMapping.Function.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<FunctionVO> create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        FunctionDO functionDO = toEntity(jsonData, FunctionDO.class);
        functionDO = functionService.save(functionDO);
        return success(functionDO, FunctionVO.class);
    }
    @PostMapping(value = BaseRequestMapping.Function.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        functionService.delete(ids.split(","));
        return success("success");
    }
    @PostMapping(value = BaseRequestMapping.Function.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<FunctionVO> update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        FunctionDO functionDO = toEntity(jsonData, FunctionDO.class);
        if (null == functionDO.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        functionDO = functionService.save(functionDO);
        return success(functionDO, FunctionVO.class);
    }
    @GetMapping(value = BaseRequestMapping.Function.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<FunctionVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<FunctionDO> functionDOS = functionService.search(fields, filters, sorts, page, size);
        int count = (int)functionService.getCount(filters);
        return success(functionDOS, count, page, size, FunctionVO.class);
    }
    @GetMapping(value = BaseRequestMapping.Function.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<FunctionVO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<FunctionDO> functionDOS = functionService.search(fields, filters, sorts);
        return success(functionDOS, FunctionVO.class);
    }
}
//package com.yihu.jw.base.endpoint.function;
//
//import com.yihu.jw.base.service.function.FunctionService;
//import com.yihu.jw.entity.base.function.FunctionDO;
//import com.yihu.jw.restmodel.base.function.FunctionVO;
//import com.yihu.jw.restmodel.web.Envelop;
//import com.yihu.jw.restmodel.web.ListEnvelop;
//import com.yihu.jw.restmodel.web.ObjEnvelop;
//import com.yihu.jw.restmodel.web.PageEnvelop;
//import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
//import com.yihu.jw.rm.base.BaseRequestMapping;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.MediaType;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * Endpoint - 功能
// * Created by progr1mmer on 2018/8/16.
// */
//@RestController
//@RequestMapping(value = BaseRequestMapping.Function.PREFIX)
//@Api(value = "功能(接口)管理", description = "功能(接口)管理服务接口", tags = {"wlyy基础服务 - 功能(接口)管理服务接口"})
//public class FunctionEndpoint extends EnvelopRestEndpoint {
//
//    @Autowired
//    private FunctionService functionService;
//
//    @PostMapping(value = BaseRequestMapping.Function.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    @ApiOperation(value = "创建")
//    public ObjEnvelop<FunctionVO> create (
//            @ApiParam(name = "json_data", value = "Json数据", required = true)
//            @RequestBody String jsonData) throws Exception {
//        FunctionDO functionDO = toEntity(jsonData, FunctionDO.class);
//        functionDO = functionService.save(functionDO);
//        return success(functionDO, FunctionVO.class);
//    }
//
//    @PostMapping(value = BaseRequestMapping.Function.DELETE)
//    @ApiOperation(value = "删除")
//    public Envelop delete(
//            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
//            @RequestParam(value = "ids") String ids) {
//        functionService.delete(ids.split(","));
//        return success("success");
//    }
//
//    @PostMapping(value = BaseRequestMapping.Function.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    @ApiOperation(value = "更新")
//    public ObjEnvelop<FunctionVO> update (
//            @ApiParam(name = "json_data", value = "Json数据", required = true)
//            @RequestBody String jsonData) throws Exception {
//        FunctionDO functionDO = toEntity(jsonData, FunctionDO.class);
//        if (null == functionDO.getId()) {
//            return failed("ID不能为空", ObjEnvelop.class);
//        }
//        functionDO = functionService.save(functionDO);
//        return success(functionDO, FunctionVO.class);
//    }
//
//    @GetMapping(value = BaseRequestMapping.Function.PAGE)
//    @ApiOperation(value = "获取分页")
//    public PageEnvelop<FunctionVO> page (
//            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
//            @RequestParam(value = "fields", required = false) String fields,
//            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
//            @RequestParam(value = "filters", required = false) String filters,
//            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
//            @RequestParam(value = "sorts", required = false) String sorts,
//            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
//            @RequestParam(value = "page") int page,
//            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
//            @RequestParam(value = "size") int size) throws Exception {
//        List<FunctionDO> functionDOS = functionService.search(fields, filters, sorts, page, size);
//        int count = (int)functionService.getCount(filters);
//        return success(functionDOS, count, page, size, FunctionVO.class);
//    }
//
//    @GetMapping(value = BaseRequestMapping.Function.LIST)
//    @ApiOperation(value = "获取列表")
//    public ListEnvelop<FunctionVO> list (
//            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
//            @RequestParam(value = "fields", required = false) String fields,
//            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
//            @RequestParam(value = "filters", required = false) String filters,
//            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
//            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
//        List<FunctionDO> functionDOS = functionService.search(fields, filters, sorts);
//        return success(functionDOS, FunctionVO.class);
//    }
//
//}

+ 96 - 96
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasDefaultModuleFunctionEndpoint.java

@ -1,96 +1,96 @@
package com.yihu.jw.base.endpoint.saas;
import com.yihu.jw.base.service.saas.SaasDefaultModuleFunctionService;
import com.yihu.jw.entity.base.saas.SaasDefaultModuleFunctionDO;
import com.yihu.jw.restmodel.base.saas.SaasDefaultModuleFunctionVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Endpoint - Saas默认模块功能
 * Created by progr1mmer on 2018/8/16.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.PREFIX)
@Api(value = "Saas默认模块功能管理", description = "Saas默认模块功能管理服务接口", tags = {"wlyy基础服务 - Saas默认模块功能管理服务接口"})
public class SaasDefaultModuleFunctionEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private SaasDefaultModuleFunctionService saasDefaultModuleService;
    @PostMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<SaasDefaultModuleFunctionVO> create (
            @ApiParam(name = "json", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        SaasDefaultModuleFunctionDO saasDefaultModuleDO = toEntity(jsonData, SaasDefaultModuleFunctionDO.class);
        saasDefaultModuleDO = saasDefaultModuleService.save(saasDefaultModuleDO);
        return success(saasDefaultModuleDO, SaasDefaultModuleFunctionVO.class);
    }
    @PostMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        saasDefaultModuleService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新")
    public Envelop update (
            @ApiParam(name = "json", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        SaasDefaultModuleFunctionDO saasDefaultModuleDO = toEntity(jsonData, SaasDefaultModuleFunctionDO.class);
        if (null == saasDefaultModuleDO.getId()) {
            return failed("ID不能为空", Envelop.class);
        }
        saasDefaultModuleDO = saasDefaultModuleService.save(saasDefaultModuleDO);
        return success(saasDefaultModuleDO);
    }
    @GetMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<SaasDefaultModuleFunctionVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<SaasDefaultModuleFunctionDO> saasDefaultModuleDOS = saasDefaultModuleService.search(fields, filters, sorts, page, size);
        int count = (int)saasDefaultModuleService.getCount(filters);
        return success(saasDefaultModuleDOS, count, page, size, SaasDefaultModuleFunctionVO.class);
    }
    @GetMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<SaasDefaultModuleFunctionVO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<SaasDefaultModuleFunctionDO> saasDefaultModuleDOS = saasDefaultModuleService.search(fields, filters, sorts);
        return success(saasDefaultModuleDOS, SaasDefaultModuleFunctionVO.class);
    }
}
//package com.yihu.jw.base.endpoint.saas;
//
//import com.yihu.jw.base.service.saas.SaasDefaultModuleFunctionService;
//import com.yihu.jw.entity.base.saas.SaasDefaultModuleFunctionDO;
//import com.yihu.jw.restmodel.base.saas.SaasDefaultModuleFunctionVO;
//import com.yihu.jw.restmodel.web.Envelop;
//import com.yihu.jw.restmodel.web.ListEnvelop;
//import com.yihu.jw.restmodel.web.ObjEnvelop;
//import com.yihu.jw.restmodel.web.PageEnvelop;
//import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
//import com.yihu.jw.rm.base.BaseRequestMapping;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.MediaType;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * Endpoint - Saas默认模块功能
// * Created by progr1mmer on 2018/8/16.
// */
//@RestController
//@RequestMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.PREFIX)
//@Api(value = "Saas默认模块功能管理", description = "Saas默认模块功能管理服务接口", tags = {"wlyy基础服务 - Saas默认模块功能管理服务接口"})
//public class SaasDefaultModuleFunctionEndpoint extends EnvelopRestEndpoint {
//
//    @Autowired
//    private SaasDefaultModuleFunctionService saasDefaultModuleService;
//
//    @PostMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    @ApiOperation(value = "创建")
//    public ObjEnvelop<SaasDefaultModuleFunctionVO> create (
//            @ApiParam(name = "json", value = "Json数据", required = true)
//            @RequestBody String jsonData) throws Exception {
//        SaasDefaultModuleFunctionDO saasDefaultModuleDO = toEntity(jsonData, SaasDefaultModuleFunctionDO.class);
//        saasDefaultModuleDO = saasDefaultModuleService.save(saasDefaultModuleDO);
//        return success(saasDefaultModuleDO, SaasDefaultModuleFunctionVO.class);
//    }
//
//    @PostMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.DELETE)
//    @ApiOperation(value = "删除")
//    public Envelop delete(
//            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
//            @RequestParam(value = "ids") String ids) {
//        saasDefaultModuleService.delete(ids.split(","));
//        return success("删除成功");
//    }
//
//    @PostMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    @ApiOperation(value = "更新")
//    public Envelop update (
//            @ApiParam(name = "json", value = "Json数据", required = true)
//            @RequestBody String jsonData) throws Exception {
//        SaasDefaultModuleFunctionDO saasDefaultModuleDO = toEntity(jsonData, SaasDefaultModuleFunctionDO.class);
//        if (null == saasDefaultModuleDO.getId()) {
//            return failed("ID不能为空", Envelop.class);
//        }
//        saasDefaultModuleDO = saasDefaultModuleService.save(saasDefaultModuleDO);
//        return success(saasDefaultModuleDO);
//    }
//
//    @GetMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.PAGE)
//    @ApiOperation(value = "获取分页")
//    public PageEnvelop<SaasDefaultModuleFunctionVO> page (
//            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
//            @RequestParam(value = "fields", required = false) String fields,
//            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
//            @RequestParam(value = "filters", required = false) String filters,
//            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
//            @RequestParam(value = "sorts", required = false) String sorts,
//            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
//            @RequestParam(value = "page") int page,
//            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
//            @RequestParam(value = "size") int size) throws Exception {
//        List<SaasDefaultModuleFunctionDO> saasDefaultModuleDOS = saasDefaultModuleService.search(fields, filters, sorts, page, size);
//        int count = (int)saasDefaultModuleService.getCount(filters);
//        return success(saasDefaultModuleDOS, count, page, size, SaasDefaultModuleFunctionVO.class);
//    }
//
//    @GetMapping(value = BaseRequestMapping.SaasDefaultModuleFunction.LIST)
//    @ApiOperation(value = "获取列表")
//    public ListEnvelop<SaasDefaultModuleFunctionVO> list (
//            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
//            @RequestParam(value = "fields", required = false) String fields,
//            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
//            @RequestParam(value = "filters", required = false) String filters,
//            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
//            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
//        List<SaasDefaultModuleFunctionDO> saasDefaultModuleDOS = saasDefaultModuleService.search(fields, filters, sorts);
//        return success(saasDefaultModuleDOS, SaasDefaultModuleFunctionVO.class);
//    }
//
//}

+ 96 - 96
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasModuleFunctionEndpoint.java

@ -1,96 +1,96 @@
package com.yihu.jw.base.endpoint.saas;
import com.yihu.jw.base.service.saas.SaasModuleFunctionService;
import com.yihu.jw.entity.base.saas.SaasModuleFunctionDO;
import com.yihu.jw.restmodel.base.saas.SaasModuleFunctionVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Endpoint - Saas所分配的模块功能
 * Created by progr1mmer on 2018/8/16.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.SaasModuleFunction.PREFIX)
@Api(value = "Saas模块功能管理", description = "Saas模块功能管理服务接口", tags = {"wlyy基础服务 - Saas模块功能管理服务接口"})
public class SaasModuleFunctionEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private SaasModuleFunctionService saasModuleFunctionService;
    @PostMapping(value = BaseRequestMapping.SaasModuleFunction.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<SaasModuleFunctionVO> create (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        SaasModuleFunctionDO saasModuleFunctionDO = toEntity(jsonData, SaasModuleFunctionDO.class);
        saasModuleFunctionDO = saasModuleFunctionService.save(saasModuleFunctionDO);
        return success(saasModuleFunctionDO, SaasModuleFunctionVO.class);
    }
    @PostMapping(value = BaseRequestMapping.SaasModuleFunction.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        saasModuleFunctionService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.SaasModuleFunction.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新")
    public Envelop update (
            @ApiParam(name = "json_data", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        SaasModuleFunctionDO saasModuleFunctionDO = toEntity(jsonData, SaasModuleFunctionDO.class);
        if (null == saasModuleFunctionDO.getId()) {
            return failed("ID不能为空", Envelop.class);
        }
        saasModuleFunctionDO = saasModuleFunctionService.save(saasModuleFunctionDO);
        return success(saasModuleFunctionDO);
    }
    @GetMapping(value = BaseRequestMapping.SaasModuleFunction.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<SaasModuleFunctionVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<SaasModuleFunctionDO> saasModuleFunctionDOS = saasModuleFunctionService.search(fields, filters, sorts, page, size);
        int count = (int)saasModuleFunctionService.getCount(filters);
        return success(saasModuleFunctionDOS, count, page, size, SaasModuleFunctionVO.class);
    }
    @GetMapping(value = BaseRequestMapping.SaasModuleFunction.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<SaasModuleFunctionVO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<SaasModuleFunctionDO> saasModuleFunctionDOS = saasModuleFunctionService.search(fields, filters, sorts);
        return success(saasModuleFunctionDOS, SaasModuleFunctionVO.class);
    }
}
//package com.yihu.jw.base.endpoint.saas;
//
//import com.yihu.jw.base.service.saas.SaasModuleFunctionService;
//import com.yihu.jw.entity.base.saas.SaasModuleFunctionDO;
//import com.yihu.jw.restmodel.base.saas.SaasModuleFunctionVO;
//import com.yihu.jw.restmodel.web.Envelop;
//import com.yihu.jw.restmodel.web.ListEnvelop;
//import com.yihu.jw.restmodel.web.ObjEnvelop;
//import com.yihu.jw.restmodel.web.PageEnvelop;
//import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
//import com.yihu.jw.rm.base.BaseRequestMapping;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.MediaType;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * Endpoint - Saas所分配的模块功能
// * Created by progr1mmer on 2018/8/16.
// */
//@RestController
//@RequestMapping(value = BaseRequestMapping.SaasModuleFunction.PREFIX)
//@Api(value = "Saas模块功能管理", description = "Saas模块功能管理服务接口", tags = {"wlyy基础服务 - Saas模块功能管理服务接口"})
//public class SaasModuleFunctionEndpoint extends EnvelopRestEndpoint {
//
//    @Autowired
//    private SaasModuleFunctionService saasModuleFunctionService;
//
//    @PostMapping(value = BaseRequestMapping.SaasModuleFunction.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    @ApiOperation(value = "创建")
//    public ObjEnvelop<SaasModuleFunctionVO> create (
//            @ApiParam(name = "json_data", value = "Json数据", required = true)
//            @RequestBody String jsonData) throws Exception {
//        SaasModuleFunctionDO saasModuleFunctionDO = toEntity(jsonData, SaasModuleFunctionDO.class);
//        saasModuleFunctionDO = saasModuleFunctionService.save(saasModuleFunctionDO);
//        return success(saasModuleFunctionDO, SaasModuleFunctionVO.class);
//    }
//
//    @PostMapping(value = BaseRequestMapping.SaasModuleFunction.DELETE)
//    @ApiOperation(value = "删除")
//    public Envelop delete(
//            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
//            @RequestParam(value = "ids") String ids) {
//        saasModuleFunctionService.delete(ids.split(","));
//        return success("删除成功");
//    }
//
//    @PostMapping(value = BaseRequestMapping.SaasModuleFunction.UPDATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    @ApiOperation(value = "更新")
//    public Envelop update (
//            @ApiParam(name = "json_data", value = "Json数据", required = true)
//            @RequestBody String jsonData) throws Exception {
//        SaasModuleFunctionDO saasModuleFunctionDO = toEntity(jsonData, SaasModuleFunctionDO.class);
//        if (null == saasModuleFunctionDO.getId()) {
//            return failed("ID不能为空", Envelop.class);
//        }
//        saasModuleFunctionDO = saasModuleFunctionService.save(saasModuleFunctionDO);
//        return success(saasModuleFunctionDO);
//    }
//
//    @GetMapping(value = BaseRequestMapping.SaasModuleFunction.PAGE)
//    @ApiOperation(value = "获取分页")
//    public PageEnvelop<SaasModuleFunctionVO> page (
//            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
//            @RequestParam(value = "fields", required = false) String fields,
//            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
//            @RequestParam(value = "filters", required = false) String filters,
//            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
//            @RequestParam(value = "sorts", required = false) String sorts,
//            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
//            @RequestParam(value = "page") int page,
//            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
//            @RequestParam(value = "size") int size) throws Exception {
//        List<SaasModuleFunctionDO> saasModuleFunctionDOS = saasModuleFunctionService.search(fields, filters, sorts, page, size);
//        int count = (int)saasModuleFunctionService.getCount(filters);
//        return success(saasModuleFunctionDOS, count, page, size, SaasModuleFunctionVO.class);
//    }
//
//    @GetMapping(value = BaseRequestMapping.SaasModuleFunction.LIST)
//    @ApiOperation(value = "获取列表")
//    public ListEnvelop<SaasModuleFunctionVO> list (
//            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
//            @RequestParam(value = "fields", required = false) String fields,
//            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
//            @RequestParam(value = "filters", required = false) String filters,
//            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
//            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
//        List<SaasModuleFunctionDO> saasModuleFunctionDOS = saasModuleFunctionService.search(fields, filters, sorts);
//        return success(saasModuleFunctionDOS, SaasModuleFunctionVO.class);
//    }
//
//}

+ 3 - 10
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasTypeDictEndpoint.java

@ -1,15 +1,8 @@
package com.yihu.jw.base.endpoint.saas;
import com.yihu.jw.base.service.saas.SaasDefaultModuleFunctionService;
import com.yihu.jw.base.service.saas.SaasService;
import com.yihu.jw.base.service.saas.SaasTypeDictService;
import com.yihu.jw.base.service.user.UserService;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.entity.base.saas.SaasTypeDictDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.restmodel.base.saas.SaasTypeDictVO;
import com.yihu.jw.restmodel.base.saas.SaasVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
@ -36,8 +29,8 @@ public class SaasTypeDictEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private SaasTypeDictService saasTypeDictService;
    @Autowired
    private SaasDefaultModuleFunctionService saasDefaultModuleFunctionService;
//    @Autowired
//    private SaasDefaultModuleFunctionService saasDefaultModuleFunctionService;
    @PostMapping(value = BaseRequestMapping.SaasTypeDict.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
@ -72,7 +65,7 @@ public class SaasTypeDictEndpoint extends EnvelopRestEndpoint {
            return failed("租户类型名称重复!", ObjEnvelop.class);
        }
        //删除关联的模块
        saasDefaultModuleFunctionService.deleteBySaasType(saasTypeDictDO.getCode());
//        saasDefaultModuleFunctionService.deleteBySaasType(saasTypeDictDO.getCode());
        saasTypeDictDO = saasTypeDictService.save(saasTypeDictDO, saasTypeDefaultModuleIds);
        return success("更新成功!", saasTypeDictDO, SaasTypeDictVO.class);
    }

+ 3 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/service/customize/UserHideModuleFunctionService.java

@ -1,7 +1,7 @@
package com.yihu.jw.base.service.customize;
import com.yihu.jw.base.dao.customize.UserHideModuleFunctionDao;
import com.yihu.jw.entity.base.customize.UserHideModuleFunctionDO;
import com.yihu.jw.base.dao.customize.UserHideModuleInterfaceDao;
import com.yihu.jw.entity.base.customize.UserHideModuleInterfaceDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
@ -11,5 +11,5 @@ import org.springframework.stereotype.Service;
 * @date Created on 2018/9/14.
 */
@Service
public class UserHideModuleFunctionService extends BaseJpaService<UserHideModuleFunctionDO, UserHideModuleFunctionDao> {
public class UserHideModuleInterfaceService extends BaseJpaService<UserHideModuleInterfaceDO, UserHideModuleInterfaceDao> {
}

+ 16 - 16
svr/svr-base/src/main/java/com/yihu/jw/base/service/function/FunctionService.java

@ -1,16 +1,16 @@
package com.yihu.jw.base.service.function;
import com.yihu.jw.base.dao.function.FunctionDao;
import com.yihu.jw.entity.base.function.FunctionDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * Service - 功能
 * Created by chenweida on 2017/5/19.
 */
@Service
public class FunctionService extends BaseJpaService<FunctionDO, FunctionDao> {
}
//package com.yihu.jw.base.service.function;
//
//import com.yihu.jw.base.dao.function.FunctionDao;
//import com.yihu.jw.entity.base.function.FunctionDO;
//import com.yihu.mysql.query.BaseJpaService;
//import org.springframework.stereotype.Service;
//
//
///**
// * Service - 功能
// * Created by chenweida on 2017/5/19.
// */
//@Service
//public class FunctionService extends BaseJpaService<FunctionDO, FunctionDao> {
//
//}

+ 25 - 26
svr/svr-base/src/main/java/com/yihu/jw/base/service/module/InterfaceService.java

@ -120,35 +120,11 @@ public class InterfaceService extends BaseJpaService<InterfaceDO, InterfaceDao>
                List<SaasInterfaceErrorCodeDO> saasErrorCodes = new ArrayList<>(16);
                saasInterfaceDao.save(saasInterfaceDO);
                entryParams.forEach(interfaceParamDO -> {
                    SaasInterfaceParamDO saasInterfaceParamDO = new SaasInterfaceParamDO();
                    saasInterfaceParamDO.setSaasId(saasInterfaceDO.getSaasId());
                    saasInterfaceParamDO.setDel(interfaceParamDO.getDel());
                    saasInterfaceParamDO.setName(interfaceParamDO.getName());
                    saasInterfaceParamDO.setDataType(interfaceParamDO.getDataType());
                    saasInterfaceParamDO.setDescription(interfaceParamDO.getDescription());
                    saasInterfaceParamDO.setExample(interfaceParamDO.getExample());
                    saasInterfaceParamDO.setIsRequire(interfaceParamDO.getIsRequire());
                    saasInterfaceParamDO.setMaxLength(interfaceParamDO.getMaxLength());
                    saasInterfaceParamDO.setParamType(interfaceParamDO.getParamType());
                    saasInterfaceParamDO.setSaasInterfaceId(saasInterfaceDO.getId());
                    saasInterfaceParamDO.setSort(interfaceParamDO.getSort());
                    saasInterfaceParamDO.setType(interfaceParamDO.getType());
                    SaasInterfaceParamDO saasInterfaceParamDO = addSaasInterfaceParamDO(saasInterfaceDO,interfaceParamDO);
                    saasEntryParams.add(saasInterfaceParamDO);
                });
                outParams.forEach(interfaceParamDO -> {
                    SaasInterfaceParamDO saasInterfaceParamDO = new SaasInterfaceParamDO();
                    saasInterfaceParamDO.setSaasId(saasInterfaceDO.getSaasId());
                    saasInterfaceParamDO.setDel(interfaceParamDO.getDel());
                    saasInterfaceParamDO.setName(interfaceParamDO.getName());
                    saasInterfaceParamDO.setDataType(interfaceParamDO.getDataType());
                    saasInterfaceParamDO.setDescription(interfaceParamDO.getDescription());
                    saasInterfaceParamDO.setExample(interfaceParamDO.getExample());
                    saasInterfaceParamDO.setIsRequire(interfaceParamDO.getIsRequire());
                    saasInterfaceParamDO.setMaxLength(interfaceParamDO.getMaxLength());
                    saasInterfaceParamDO.setParamType(interfaceParamDO.getParamType());
                    saasInterfaceParamDO.setSaasInterfaceId(saasInterfaceDO.getId());
                    saasInterfaceParamDO.setSort(interfaceParamDO.getSort());
                    saasInterfaceParamDO.setType(interfaceParamDO.getType());
                    SaasInterfaceParamDO saasInterfaceParamDO = addSaasInterfaceParamDO(saasInterfaceDO,interfaceParamDO);
                    saasOutParams.add(saasInterfaceParamDO);
                });
                errorCodes.forEach(interfaceErrorCodeDO -> {
@ -171,6 +147,29 @@ public class InterfaceService extends BaseJpaService<InterfaceDO, InterfaceDao>
        return interfaceDO;
    }
    /**
     * 新增租户接口参数
     * @param saasInterfaceDO
     * @param interfaceParamDO
     * @return
     */
    private SaasInterfaceParamDO addSaasInterfaceParamDO(SaasInterfaceDO saasInterfaceDO,InterfaceParamDO interfaceParamDO){
        SaasInterfaceParamDO saasInterfaceParamDO = new SaasInterfaceParamDO();
        saasInterfaceParamDO.setSaasId(saasInterfaceDO.getSaasId());
        saasInterfaceParamDO.setDel(interfaceParamDO.getDel());
        saasInterfaceParamDO.setName(interfaceParamDO.getName());
        saasInterfaceParamDO.setDataType(interfaceParamDO.getDataType());
        saasInterfaceParamDO.setDescription(interfaceParamDO.getDescription());
        saasInterfaceParamDO.setExample(interfaceParamDO.getExample());
        saasInterfaceParamDO.setIsRequire(interfaceParamDO.getIsRequire());
        saasInterfaceParamDO.setMaxLength(interfaceParamDO.getMaxLength());
        saasInterfaceParamDO.setParamType(interfaceParamDO.getParamType());
        saasInterfaceParamDO.setSaasInterfaceId(saasInterfaceDO.getId());
        saasInterfaceParamDO.setSort(interfaceParamDO.getSort());
        saasInterfaceParamDO.setType(interfaceParamDO.getType());
        return saasInterfaceParamDO;
    }
    /**
     * 设置生效和失效
     * @param id

+ 22 - 22
svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasDefaultModuleFunctionService.java

@ -1,22 +1,22 @@
package com.yihu.jw.base.service.saas;
import com.yihu.jw.base.dao.saas.SaasDefaultModuleFunctionDao;
import com.yihu.jw.base.dao.saas.SaasTypeDictDao;
import com.yihu.jw.entity.base.saas.SaasDefaultModuleFunctionDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * Service - Saas默认模块功能
 * Created by progr1mmer on 2018/8/17.
 */
@Service
public class SaasDefaultModuleFunctionService extends BaseJpaService<SaasDefaultModuleFunctionDO, SaasDefaultModuleFunctionDao> {
    @Autowired
    private SaasDefaultModuleFunctionDao saasDefaultModuleFunctionDao;
    public void deleteBySaasType(Integer saasType) {
        saasDefaultModuleFunctionDao.deleteBySaasType(saasType);
    }
}
//package com.yihu.jw.base.service.saas;
//
//import com.yihu.jw.base.dao.saas.SaasDefaultModuleFunctionDao;
//import com.yihu.jw.base.dao.saas.SaasTypeDictDao;
//import com.yihu.jw.entity.base.saas.SaasDefaultModuleFunctionDO;
//import com.yihu.mysql.query.BaseJpaService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
///**
// * Service - Saas默认模块功能
// * Created by progr1mmer on 2018/8/17.
// */
//@Service
//public class SaasDefaultModuleFunctionService extends BaseJpaService<SaasDefaultModuleFunctionDO, SaasDefaultModuleFunctionDao> {
//    @Autowired
//    private SaasDefaultModuleFunctionDao saasDefaultModuleFunctionDao;
//
//    public void deleteBySaasType(Integer saasType) {
//        saasDefaultModuleFunctionDao.deleteBySaasType(saasType);
//    }
//}

+ 17 - 17
svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasModuleFunctionService.java

@ -1,17 +1,17 @@
package com.yihu.jw.base.service.saas;
import com.yihu.jw.base.dao.saas.SaasModuleFunctionDao;
import com.yihu.jw.entity.base.saas.SaasModuleFunctionDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * Service - Saas所分配的模块功能
 * Created by progr1mmer on 2018/8/17.
 */
@Service
public class SaasModuleFunctionService extends BaseJpaService<SaasModuleFunctionDO, SaasModuleFunctionDao> {
}
//package com.yihu.jw.base.service.saas;
//
//import com.yihu.jw.base.dao.saas.SaasModuleFunctionDao;
//import com.yihu.jw.entity.base.saas.SaasModuleFunctionDO;
//import com.yihu.mysql.query.BaseJpaService;
//import org.springframework.stereotype.Service;
//
//
///**
// * Service - Saas所分配的模块功能
// * Created by progr1mmer on 2018/8/17.
// */
//@Service
//public class SaasModuleFunctionService extends BaseJpaService<SaasModuleFunctionDO, SaasModuleFunctionDao> {
//
//
//}

+ 14 - 21
svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasService.java

@ -2,14 +2,10 @@ package com.yihu.jw.base.service.saas;
import com.yihu.jw.base.dao.role.RoleDao;
import com.yihu.jw.base.dao.saas.SaasDao;
import com.yihu.jw.base.dao.saas.SaasDefaultModuleFunctionDao;
import com.yihu.jw.base.dao.saas.SaasModuleFunctionDao;
import com.yihu.jw.base.dao.user.UserDao;
import com.yihu.jw.base.dao.user.UserRoleDao;
import com.yihu.jw.entity.base.role.RoleDO;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.entity.base.saas.SaasDefaultModuleFunctionDO;
import com.yihu.jw.entity.base.saas.SaasModuleFunctionDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.base.user.UserRoleDO;
import com.yihu.mysql.query.BaseJpaService;
@ -19,9 +15,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
 * Service - SAAS
 * Created by progr1mmer on 2018/8/14.
@ -33,10 +26,10 @@ public class SaasService extends BaseJpaService<SaasDO, SaasDao> {
    private SaasDao saasDao;
    @Autowired
    private UserDao userDao;
    @Autowired
    private SaasDefaultModuleFunctionDao saasDefaultModuleFunctionDao;
    @Autowired
    private SaasModuleFunctionDao roleModuleFunctionDao;
//    @Autowired
//    private SaasDefaultModuleFunctionDao saasDefaultModuleFunctionDao;
//    @Autowired
//    private SaasModuleFunctionDao roleModuleFunctionDao;
    @Autowired
    private RoleDao roleDao;
    @Autowired
@ -69,21 +62,21 @@ public class SaasService extends BaseJpaService<SaasDO, SaasDao> {
        userRoleDO.setUserId(user.getId());
        userRoleDO.setRoleId(roleDO.getId());
        //初始化租户默认模块
        List<SaasDefaultModuleFunctionDO> saasDefaultModuleDOS = saasDefaultModuleFunctionDao.findBySaasType(saas.getType());
        List<SaasModuleFunctionDO> roleModuleFunctionDOS = new ArrayList<>();
        saasDefaultModuleDOS.forEach(item -> {
            SaasModuleFunctionDO saasModuleFunctionDO = new SaasModuleFunctionDO();
            saasModuleFunctionDO.setSaasId(saasId);
            saasModuleFunctionDO.setModuleId(item.getModuleId());
            saasModuleFunctionDO.setFunctionId(item.getFunctionId());
            roleModuleFunctionDOS.add(saasModuleFunctionDO);
        });
//        List<SaasDefaultModuleFunctionDO> saasDefaultModuleDOS = saasDefaultModuleFunctionDao.findBySaasType(saas.getType());
//        List<SaasModuleFunctionDO> roleModuleFunctionDOS = new ArrayList<>();
//        saasDefaultModuleDOS.forEach(item -> {
//            SaasModuleFunctionDO saasModuleFunctionDO = new SaasModuleFunctionDO();
//            saasModuleFunctionDO.setSaasId(saasId);
//            saasModuleFunctionDO.setModuleId(item.getModuleId());
//            saasModuleFunctionDO.setFunctionId(item.getFunctionId());
//            roleModuleFunctionDOS.add(saasModuleFunctionDO);
//        });
        //保存数据
        saas = saasDao.save(saas);
        roleDao.save(roleDO);
        userDao.save(user);
        userRoleDao.save(userRoleDO);
        roleModuleFunctionDao.save(roleModuleFunctionDOS);
//        roleModuleFunctionDao.save(roleModuleFunctionDOS);
        return saas;
    }

+ 15 - 21
svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasTypeDictService.java

@ -1,17 +1,11 @@
package com.yihu.jw.base.service.saas;
import com.yihu.jw.base.dao.function.FunctionDao;
import com.yihu.jw.base.dao.role.RoleDao;
import com.yihu.jw.base.dao.saas.SaasTypeDictDao;
import com.yihu.jw.base.dao.saas.SaasDefaultModuleFunctionDao;
import com.yihu.jw.base.dao.saas.SaasModuleFunctionDao;
import com.yihu.jw.base.dao.user.UserDao;
import com.yihu.jw.base.dao.user.UserRoleDao;
import com.yihu.jw.entity.base.function.FunctionDO;
import com.yihu.jw.entity.base.role.RoleDO;
import com.yihu.jw.entity.base.saas.SaasTypeDictDO;
import com.yihu.jw.entity.base.saas.SaasDefaultModuleFunctionDO;
import com.yihu.jw.entity.base.saas.SaasModuleFunctionDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.base.user.UserRoleDO;
import com.yihu.mysql.query.BaseJpaService;
@ -35,10 +29,10 @@ public class SaasTypeDictService extends BaseJpaService<SaasTypeDictDO, SaasType
    @Autowired
    private SaasTypeDictDao saasTypeDictDao;
    @Autowired
    private FunctionDao functionDao;
    @Autowired
    private SaasDefaultModuleFunctionDao saasDefaultModuleFunctionDao;
//    @Autowired
//    private FunctionDao functionDao;
//    @Autowired
//    private SaasDefaultModuleFunctionDao saasDefaultModuleFunctionDao;
    public SaasTypeDictDO save(SaasTypeDictDO saasTypeDictDO, String saasTypeDefaultModuleIds) {
@ -54,19 +48,19 @@ public class SaasTypeDictService extends BaseJpaService<SaasTypeDictDO, SaasType
        }
        //根据moduleId获取模块关联的接口id
        String[] ids = saasTypeDefaultModuleIds.split(",");
        List<FunctionDO> functionDOList = functionDao.findFunctionDOSByModuleIdExists(ids);
        //初始化租户默认模块
        List<SaasDefaultModuleFunctionDO> saasDefaultModuleDOS = new ArrayList<>();
        functionDOList.forEach(item -> {
            SaasDefaultModuleFunctionDO saasDefaultModuleFunctionDO = new SaasDefaultModuleFunctionDO();
            saasDefaultModuleFunctionDO.setSaasType(code);
            saasDefaultModuleFunctionDO.setModuleId(item.getModuleId());
            saasDefaultModuleFunctionDO.setFunctionId(item.getId());
            saasDefaultModuleDOS.add(saasDefaultModuleFunctionDO);
        });
//        List<FunctionDO> functionDOList = functionDao.findFunctionDOSByModuleIdExists(ids);
//        //初始化租户默认模块
//        List<SaasDefaultModuleFunctionDO> saasDefaultModuleDOS = new ArrayList<>();
//        functionDOList.forEach(item -> {
//            SaasDefaultModuleFunctionDO saasDefaultModuleFunctionDO = new SaasDefaultModuleFunctionDO();
//            saasDefaultModuleFunctionDO.setSaasType(code);
//            saasDefaultModuleFunctionDO.setModuleId(item.getModuleId());
//            saasDefaultModuleFunctionDO.setFunctionId(item.getId());
//            saasDefaultModuleDOS.add(saasDefaultModuleFunctionDO);
//        });
        //保存数据
        saasTypeDictDO = saasTypeDictDao.save(saasTypeDictDO);
        saasDefaultModuleFunctionDao.save(saasDefaultModuleDOS);
//        saasDefaultModuleFunctionDao.save(saasDefaultModuleDOS);
        return saasTypeDictDO;
    }