优化
This commit is contained in:
parent
1f1d2d8bf4
commit
ec5b329ddc
@ -4,7 +4,7 @@ import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Predicate;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.RequestHandler;
|
||||
@ -25,14 +25,17 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
@EnableKnife4j
|
||||
@ConditionalOnProperty(name = "swagger.enable", havingValue = "true")
|
||||
public class SwaggerConfig {
|
||||
// 定义分隔符
|
||||
private static final String splitor = ";";
|
||||
|
||||
@Value("${swagger.enable}")
|
||||
private boolean enable;
|
||||
|
||||
@Bean
|
||||
public Docket createRestApi() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.enable(enable)
|
||||
.groupName("A公共性接口文档")
|
||||
.apiInfo(apiInfo("公共性接口文档API","公共性接口前后端联调api文档","1.0"))
|
||||
.select()
|
||||
@ -47,6 +50,7 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public Docket docket1() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.enable(enable)
|
||||
.groupName("政务端个性化接口文档")
|
||||
.apiInfo(apiInfo("政务端个性化接口文档","政务端个性化前后端联调api文档","1.0"))
|
||||
.select()
|
||||
@ -58,6 +62,7 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public Docket docket2() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.enable(enable)
|
||||
.groupName("企业端个性化接口文档")
|
||||
.apiInfo(apiInfo("企业端个性化接口文档","企业端个性化前后端联调api文档","1.0"))
|
||||
.select()
|
||||
@ -69,6 +74,7 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public Docket docket3() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.enable(enable)
|
||||
.groupName("项目端个性化接口文档")
|
||||
.apiInfo(apiInfo("项目端个性化接口文档","项目端个性化前后端联调api文档","1.0"))
|
||||
.select()
|
||||
|
||||
@ -99,7 +99,7 @@ public class DataScopeHandler implements DataPermissionHandler {
|
||||
if (user.getAccountType() == 2) {
|
||||
Expression plainSelectWhere = plainSelect.getWhere();
|
||||
String whereString = plainSelectWhere.toString();
|
||||
if (!whereString.contains(getEngineeringSn() + " =") && !plainSelect.getFromItem().toString().equals("engineering")) {
|
||||
if (!whereString.contains(getEngineeringSn() + " =") && !plainSelect.getFromItem().toString().split(" ")[0].equals("engineering")) {
|
||||
equalsTo(getAliasColumn(plainSelect, getEngineeringSn()), "", plainSelect);
|
||||
}
|
||||
List<String> projectSns = projectService.getSnListForGov(user.getSn());
|
||||
|
||||
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.basicdata.controller.government;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
@ -10,6 +11,8 @@ import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.PageUtil;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.EngineeringPageDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.dto.ProjectPageDto;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Engineering;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IEngineeringService;
|
||||
import com.zhgd.xmgl.modules.safety.entity.ProjectNodePlan;
|
||||
import com.zhgd.xmgl.modules.safety.service.IProjectNodePlanService;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -44,6 +47,9 @@ public class GovProjectNodePlanController {
|
||||
@Autowired
|
||||
private IProjectNodePlanService projectNodePlanService;
|
||||
|
||||
@Autowired
|
||||
private IEngineeringService engineeringService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@ -117,6 +123,24 @@ public class GovProjectNodePlanController {
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param projectNodePlan
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目全景计划管理", operType = "新增", operDesc = "添加项目全景计划信息")
|
||||
@ApiOperation(value = " 添加项目全景计划信息", notes = "添加项目全景计划信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody ProjectNodePlan projectNodePlan) {
|
||||
if (StringUtils.isNotBlank(projectNodePlan.getEngineeringSn())) {
|
||||
String projectSn = engineeringService.getOne(Wrappers.<Engineering>lambdaQuery().eq(Engineering::getEngineeringSn, projectNodePlan.getEngineeringSn())).getProjectSn();
|
||||
projectNodePlan.setProjectSn(projectSn);
|
||||
}
|
||||
projectNodePlanService.save(projectNodePlan);
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
|
||||
@ -81,20 +81,20 @@ public class ProjectNodePlanController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param projectNodePlan
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目全景计划管理", operType = "新增", operDesc = "添加项目全景计划信息")
|
||||
@ApiOperation(value = " 添加项目全景计划信息", notes = "添加项目全景计划信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody ProjectNodePlan projectNodePlan) {
|
||||
projectNodePlan.setProjectSn(SecurityUtil.getUser().getSn());
|
||||
projectNodePlanService.save(projectNodePlan);
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
// /**
|
||||
// * 添加
|
||||
// *
|
||||
// * @param projectNodePlan
|
||||
// * @return
|
||||
// */
|
||||
// @OperLog(operModul = "项目全景计划管理", operType = "新增", operDesc = "添加项目全景计划信息")
|
||||
// @ApiOperation(value = " 添加项目全景计划信息", notes = "添加项目全景计划信息", httpMethod = "POST")
|
||||
// @PostMapping(value = "/add")
|
||||
// public Result<Object> add(@RequestBody ProjectNodePlan projectNodePlan) {
|
||||
// projectNodePlan.setProjectSn(SecurityUtil.getUser().getSn());
|
||||
// projectNodePlanService.save(projectNodePlan);
|
||||
// return Result.success("添加成功!");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
|
||||
@ -15,6 +15,7 @@ basePath=D:/itbgpImage/
|
||||
# 文件访问路径
|
||||
imagePath=http://192.168.34.155:6688/image/
|
||||
|
||||
swagger.enable=true
|
||||
# mqtt主题
|
||||
mqtt-scope=devTopic
|
||||
# redis 配置
|
||||
|
||||
@ -10,7 +10,10 @@ spring.datasource.username=root
|
||||
spring.datasource.password=JXJ@admin
|
||||
# 文件存储路径
|
||||
basePath=D:/itbgpImage/
|
||||
# 文件访问路径
|
||||
imagePath=http://192.168.34.155:6688/image/
|
||||
|
||||
swagger.enable=true
|
||||
# mqtt主题
|
||||
mqtt-scope=devTopic
|
||||
# redis 配置
|
||||
|
||||
@ -71,7 +71,6 @@ sms.hw.notice.signchannel=8821051731025
|
||||
sms.hw.notice.templateId.standardAlarm=790d907f70594b4893227fc1d97e78bc
|
||||
sms.hw.notice.templateId.standardDevState=10930770f5954d12881143e548f8483b
|
||||
sms.hw.notice.templateId.carPass=
|
||||
swagger.enable=true
|
||||
|
||||
#个推配置
|
||||
getui.baseUrl=https://restapi.getui.com/v2/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user