Browse Source

save 单位流程配置

master
PoffyZhang 1 year ago
parent
commit
bfe921d358
9 changed files with 102 additions and 21 deletions
  1. +16
    -2
      ningda-generator/pom.xml
  2. BIN
      ningda-generator/src/lib/kingbase8-8.2.0.jar
  3. +62
    -0
      ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java
  4. +0
    -1
      pmapi/pom.xml
  5. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java
  6. +17
    -13
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java
  7. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/WebSecurityConfig.java
  8. +1
    -0
      pmapi/src/main/resources/security/auth-dev.yml
  9. +1
    -1
      pom.xml

+ 16
- 2
ningda-generator/pom.xml View File

@@ -26,9 +26,23 @@
<artifactId>freemarker</artifactId>
</dependency>
<!--Mysql数据库驱动-->
<!-- <dependency>-->
<!-- <groupId>mysql</groupId>-->
<!-- <artifactId>mysql-connector-java</artifactId>-->
<!-- </dependency>-->
<!--KingBase-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<groupId>com.kingbase8</groupId>
<artifactId>kingbase8-8.2.0</artifactId>
<scope>system</scope>
<systemPath>${project.basedir}/src/lib/kingbase8-8.2.0.jar</systemPath>
</dependency>

<dependency>
<groupId>com.kingbase.dialect</groupId>
<artifactId>kingbase8-8.2.0</artifactId>
<scope>system</scope>
<systemPath>${project.basedir}/src/lib/kingbase8-8.2.0.jar</systemPath>
</dependency>
</dependencies>
</project>

BIN
ningda-generator/src/lib/kingbase8-8.2.0.jar View File


+ 62
- 0
ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java View File

@@ -0,0 +1,62 @@
package com.ningdatech.generator.config;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

/**
* @description: 自动生成code代码
* @author: zpf
* @date: 2023/01/03 09:20
*/
public class GeneratorCodeKingbaseConfig {

private static final String PATH_LXX = "/Users/liuxinxin/IdeaProjects/project-management/pmapi/src/main/java";
private static final String PATH_YYD = "";
private static final String PATH_LS = "";
private static final String PATH_ZPF = "D:\\ningda\\project-management\\pmapi\\src\\main\\java";
private static final String PATH_CMM = "";

private static final String URL = "jdbc:kingbase8://120.26.44.207:54321/nd_project_management?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8";
private static final String USER_NAME = "SYSTEM";
private static final String PASSWORD = "Ndkj1234";

private static void generate(String author, String packageName, String path, String... tableNames) {
FastAutoGenerator.create(URL, USER_NAME, PASSWORD)
.globalConfig(builder -> {
// 设置作者
builder.author(author)
// 开启 swagger 模式
.enableSwagger()
// 覆盖已生成文件
.fileOverride()
// 指定输出目录
.outputDir(path);
})
.packageConfig(builder -> {
// 设置父包名
builder.parent("com.ningdatech")
// 设置父包模块名
.moduleName("pmapi." + packageName)
// 设置mapperXml生成路径
.pathInfo(Collections.singletonMap(OutputFile.mapperXml,
//设置自己的生成路径
path + "/com/ningdatech/pmapi/" + packageName + "/mapper"));
})
.strategyConfig(builder -> {
builder.addTablePrefix("wflow");
// 设置需要生成的表名
builder.addInclude(tableNames);
})
// 使用Freemarker引擎模板,默认的是Velocity引擎模板
.templateEngine(new FreemarkerTemplateEngine())
.execute();
}

public static void main(String[] args) {
generate("ZPF", "testuser", PATH_ZPF, "wflow_users");
}

}

+ 0
- 1
pmapi/pom.xml View File

@@ -206,7 +206,6 @@
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-flowable-starter</artifactId>
<scope>true</scope>
</dependency>

<dependency>


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java View File

@@ -38,8 +38,8 @@ public class GlobalResponseHandler implements ResponseBodyAdvice<Object> {
if (o instanceof String) {
return JSONUtil.toJsonStr(apiResponse);
}
return ApiResponse.ofSuccess(o);
// return o;
// return ApiResponse.ofSuccess(o);
return o;
}

private Boolean filter(MethodParameter methodParameter) {


+ 17
- 13
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java View File

@@ -1,17 +1,15 @@
package com.ningdatech.pmapi.organization.controller;

import com.ningdatech.basic.model.PageVo;
import com.wflow.bean.dto.WflowOrgProcdefDto;
import com.wflow.bean.vo.OrgProcdefVo;
import com.wflow.service.OrgProcdefService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import org.springframework.web.bind.annotation.*;

/**
* @Classname OrganizationProcessController
@@ -27,12 +25,18 @@ import javax.validation.Valid;
@RequiredArgsConstructor
public class OrganizationProcdefController {

// private final
//
// @ApiOperation(value = "单位流程列表", notes = "单位流程列表")
// @GetMapping("/list")
// public PageVo<UserInfoVO> processList(@Valid @ModelAttribute UserPageQuery userPageQuery) {
// return userManage.queryUserList(userPageQuery);
// }
private final OrgProcdefService orgProcdefService;

@ApiOperation(value = "单位流程配置列表", notes = "单位流程配置列表")
@GetMapping("/list")
public PageVo<OrgProcdefVo> list(@RequestParam String orgCode, @RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "10") Integer pageSize) {
return orgProcdefService.getOrgProcessByOrgCode(orgCode,pageNum,pageSize);
}

@ApiOperation(value = "单位流程配置保存", notes = "单位流程列表")
@PostMapping("/save")
public Boolean save(@Validated @RequestBody WflowOrgProcdefDto wflowOrgProcdefDto) {
return orgProcdefService.save(wflowOrgProcdefDto);
}
}

+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/WebSecurityConfig.java View File

@@ -1,5 +1,7 @@
package com.ningdatech.pmapi.user.security.auth;

import com.google.common.collect.Lists;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.NdJsonUtil;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.common.constant.BizConst;
@@ -16,6 +18,7 @@ import org.springframework.security.web.authentication.logout.LogoutSuccessHandl
import org.springframework.security.web.csrf.CookieCsrfTokenRepository;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Map;
import java.util.Set;

@@ -93,6 +96,4 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
}
}
}


}

+ 1
- 0
pmapi/src/main/resources/security/auth-dev.yml View File

@@ -15,6 +15,7 @@ security:
- /api/v1/user/auth/invalid-session
- /api/v1/user/auth/login/password
- /api/v1/user/auth/forget-password
- /api/v1/**
- /doc.html
- /ok.html
- /open/api/**


+ 1
- 1
pom.xml View File

@@ -99,7 +99,7 @@
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-flowable-starter</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.flowable</groupId>


Loading…
Cancel
Save