This commit is contained in:
pengjie 2023-07-15 17:33:34 +08:00
parent 1f1d2d8bf4
commit ec5b329ddc
7 changed files with 51 additions and 18 deletions

View File

@ -4,7 +4,7 @@ import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.google.common.base.Function; import com.google.common.base.Function;
import com.google.common.base.Optional; import com.google.common.base.Optional;
import com.google.common.base.Predicate; 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.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import springfox.documentation.RequestHandler; import springfox.documentation.RequestHandler;
@ -25,14 +25,17 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration @Configuration
@EnableSwagger2 @EnableSwagger2
@EnableKnife4j @EnableKnife4j
@ConditionalOnProperty(name = "swagger.enable", havingValue = "true")
public class SwaggerConfig { public class SwaggerConfig {
// 定义分隔符 // 定义分隔符
private static final String splitor = ";"; private static final String splitor = ";";
@Value("${swagger.enable}")
private boolean enable;
@Bean @Bean
public Docket createRestApi() { public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2)
.enable(enable)
.groupName("A公共性接口文档") .groupName("A公共性接口文档")
.apiInfo(apiInfo("公共性接口文档API","公共性接口前后端联调api文档","1.0")) .apiInfo(apiInfo("公共性接口文档API","公共性接口前后端联调api文档","1.0"))
.select() .select()
@ -47,6 +50,7 @@ public class SwaggerConfig {
@Bean @Bean
public Docket docket1() { public Docket docket1() {
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2)
.enable(enable)
.groupName("政务端个性化接口文档") .groupName("政务端个性化接口文档")
.apiInfo(apiInfo("政务端个性化接口文档","政务端个性化前后端联调api文档","1.0")) .apiInfo(apiInfo("政务端个性化接口文档","政务端个性化前后端联调api文档","1.0"))
.select() .select()
@ -58,6 +62,7 @@ public class SwaggerConfig {
@Bean @Bean
public Docket docket2() { public Docket docket2() {
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2)
.enable(enable)
.groupName("企业端个性化接口文档") .groupName("企业端个性化接口文档")
.apiInfo(apiInfo("企业端个性化接口文档","企业端个性化前后端联调api文档","1.0")) .apiInfo(apiInfo("企业端个性化接口文档","企业端个性化前后端联调api文档","1.0"))
.select() .select()
@ -69,6 +74,7 @@ public class SwaggerConfig {
@Bean @Bean
public Docket docket3() { public Docket docket3() {
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2)
.enable(enable)
.groupName("项目端个性化接口文档") .groupName("项目端个性化接口文档")
.apiInfo(apiInfo("项目端个性化接口文档","项目端个性化前后端联调api文档","1.0")) .apiInfo(apiInfo("项目端个性化接口文档","项目端个性化前后端联调api文档","1.0"))
.select() .select()

View File

@ -99,7 +99,7 @@ public class DataScopeHandler implements DataPermissionHandler {
if (user.getAccountType() == 2) { if (user.getAccountType() == 2) {
Expression plainSelectWhere = plainSelect.getWhere(); Expression plainSelectWhere = plainSelect.getWhere();
String whereString = plainSelectWhere.toString(); 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); equalsTo(getAliasColumn(plainSelect, getEngineeringSn()), "", plainSelect);
} }
List<String> projectSns = projectService.getSnListForGov(user.getSn()); List<String> projectSns = projectService.getSnListForGov(user.getSn());

View File

@ -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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.annotation.OperLog; import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result; 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.jeecg.common.util.PageUtil;
import com.zhgd.xmgl.modules.basicdata.dto.EngineeringPageDto; import com.zhgd.xmgl.modules.basicdata.dto.EngineeringPageDto;
import com.zhgd.xmgl.modules.basicdata.dto.ProjectPageDto; 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.entity.ProjectNodePlan;
import com.zhgd.xmgl.modules.safety.service.IProjectNodePlanService; import com.zhgd.xmgl.modules.safety.service.IProjectNodePlanService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -44,6 +47,9 @@ public class GovProjectNodePlanController {
@Autowired @Autowired
private IProjectNodePlanService projectNodePlanService; private IProjectNodePlanService projectNodePlanService;
@Autowired
private IEngineeringService engineeringService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -117,6 +123,24 @@ public class GovProjectNodePlanController {
return Result.success(list); 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查询 * 通过id查询
* *

View File

@ -81,20 +81,20 @@ public class ProjectNodePlanController {
} }
/** // /**
* 添加 // * 添加
* // *
* @param projectNodePlan // * @param projectNodePlan
* @return // * @return
*/ // */
@OperLog(operModul = "项目全景计划管理", operType = "新增", operDesc = "添加项目全景计划信息") // @OperLog(operModul = "项目全景计划管理", operType = "新增", operDesc = "添加项目全景计划信息")
@ApiOperation(value = " 添加项目全景计划信息", notes = "添加项目全景计划信息", httpMethod = "POST") // @ApiOperation(value = " 添加项目全景计划信息", notes = "添加项目全景计划信息", httpMethod = "POST")
@PostMapping(value = "/add") // @PostMapping(value = "/add")
public Result<Object> add(@RequestBody ProjectNodePlan projectNodePlan) { // public Result<Object> add(@RequestBody ProjectNodePlan projectNodePlan) {
projectNodePlan.setProjectSn(SecurityUtil.getUser().getSn()); // projectNodePlan.setProjectSn(SecurityUtil.getUser().getSn());
projectNodePlanService.save(projectNodePlan); // projectNodePlanService.save(projectNodePlan);
return Result.success("添加成功!"); // return Result.success("添加成功!");
} // }
/** /**
* 编辑 * 编辑

View File

@ -15,6 +15,7 @@ basePath=D:/itbgpImage/
# 文件访问路径 # 文件访问路径
imagePath=http://192.168.34.155:6688/image/ imagePath=http://192.168.34.155:6688/image/
swagger.enable=true
# mqtt主题 # mqtt主题
mqtt-scope=devTopic mqtt-scope=devTopic
# redis 配置 # redis 配置

View File

@ -10,7 +10,10 @@ spring.datasource.username=root
spring.datasource.password=JXJ@admin spring.datasource.password=JXJ@admin
# 文件存储路径 # 文件存储路径
basePath=D:/itbgpImage/ basePath=D:/itbgpImage/
# 文件访问路径
imagePath=http://192.168.34.155:6688/image/
swagger.enable=true
# mqtt主题 # mqtt主题
mqtt-scope=devTopic mqtt-scope=devTopic
# redis 配置 # redis 配置

View File

@ -71,7 +71,6 @@ sms.hw.notice.signchannel=8821051731025
sms.hw.notice.templateId.standardAlarm=790d907f70594b4893227fc1d97e78bc sms.hw.notice.templateId.standardAlarm=790d907f70594b4893227fc1d97e78bc
sms.hw.notice.templateId.standardDevState=10930770f5954d12881143e548f8483b sms.hw.notice.templateId.standardDevState=10930770f5954d12881143e548f8483b
sms.hw.notice.templateId.carPass= sms.hw.notice.templateId.carPass=
swagger.enable=true
#个推配置 #个推配置
getui.baseUrl=https://restapi.getui.com/v2/ getui.baseUrl=https://restapi.getui.com/v2/