Commit 8d3a7fc6 by 东州 翁

Merge branch 'develop' of 120.24.24.239:8timerv2/8timerapiv200 into wdz

# Conflicts:
#	src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
parents 8070bfa4 5e14da02
...@@ -14,6 +14,30 @@ ...@@ -14,6 +14,30 @@
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<name>8timerV200</name> <name>8timerV200</name>
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
<profiles>
<profile>
<id>dev</id>
<properties>
<environment>dev</environment>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>test</id>
<properties>
<environment>test</environment>
</properties>
</profile>
<profile>
<id>pro</id>
<properties>
<environment>pro</environment>
</properties>
</profile>
</profiles>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
...@@ -342,6 +366,16 @@ ...@@ -342,6 +366,16 @@
<build> <build>
<finalName>8timer-api</finalName> <finalName>8timer-api</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.xml</include>
<include>**/*.yml</include>
</includes>
</resource>
</resources>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
......
...@@ -67,6 +67,9 @@ public class ZzglBmgwM extends Model<ZzglBmgwM> { ...@@ -67,6 +67,9 @@ public class ZzglBmgwM extends Model<ZzglBmgwM> {
@ApiModelProperty(value = "备注 ", example = "备注") @ApiModelProperty(value = "备注 ", example = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "部门领导id ", example = "9688")
private Integer leader;
@TableField(fill = FieldFill.UPDATE) @TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "更新时间 ", example = "2019-10-01") @ApiModelProperty(value = "更新时间 ", example = "2019-10-01")
private Date updateTime; private Date updateTime;
......
...@@ -32,8 +32,13 @@ public class Swagger2Config { ...@@ -32,8 +32,13 @@ public class Swagger2Config {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Bean @Bean
public ApiInfo apiInfo() { public ApiInfo apiInfo() {
return new ApiInfoBuilder().title("8小时-Api接口文档").description("快速进行Api接口调试").termsOfServiceUrl("127.0.0.1:8080") return new ApiInfoBuilder()
.contact("TangZhaoQian").version("1.0").build(); .title("8小时-Api接口文档")
.description("快速进行Api接口调试")
.termsOfServiceUrl("127.0.0.1:8080")
.contact("TangZhaoQian")
.version("1.0")
.build();
} }
/** /**
......
...@@ -9,8 +9,11 @@ import javax.servlet.http.HttpServletRequest; ...@@ -9,8 +9,11 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -52,6 +55,12 @@ import io.swagger.annotations.ApiOperation; ...@@ -52,6 +55,12 @@ import io.swagger.annotations.ApiOperation;
public class LoginController { public class LoginController {
@Autowired @Autowired
private Environment env;
@Value("${configtest.patht}")
public String port;
@Autowired
private HttpSession session; private HttpSession session;
@Autowired @Autowired
...@@ -59,10 +68,16 @@ public class LoginController { ...@@ -59,10 +68,16 @@ public class LoginController {
@Autowired @Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper; private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
// @Autowired // @Autowired
// private DataSourceTransactionManager transactionManager; // private DataSourceTransactionManager transactionManager;
@GetMapping(value = "/testPro")
public Result<String> testPro() {
System.out.print(port);
return ResultUtil.success("configtest:" + port);
}
/** /**
* 发送验证码 * 发送验证码
* *
......
...@@ -232,8 +232,8 @@ public class DzhtController { ...@@ -232,8 +232,8 @@ public class DzhtController {
list.add(map13); list.add(map13);
return ResultUtil.data(list); return ResultUtil.data(list);
} }
final static String savePath = "E:\\esignHtmb";// 本地服务器文件保存路径 final static String savePath = "esignTemplate";// 本地服务器文件保存路径
final static String APP_ID = ConfigConstant.PROJECT_ID;// 项目id final static String APP_ID = ConfigConstant.PROJECT_ID;// 项目id
final static String APP_SECRET = ConfigConstant.PROJECT_SECRET;// 项目密码 final static String APP_SECRET = ConfigConstant.PROJECT_SECRET;// 项目密码
// final static String RE_TOKEN = "8b58973c290cc848b67ff0017cd424ff"; // final static String RE_TOKEN = "8b58973c290cc848b67ff0017cd424ff";
...@@ -678,10 +678,18 @@ public class DzhtController { ...@@ -678,10 +678,18 @@ public class DzhtController {
} }
@GetMapping("/queryName") @GetMapping("/queryName")
@ApiOperation(value = "查员工名字", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "查版本名字", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> getName(@RequestParam String empNum) { public Result<Object> getName(@RequestParam String empNum) {
return ResultUtil.data(YgglMainEmp.builder().build() String a = System.getProperty("os.name");
.selectOne(new QueryWrapper<YgglMainEmp>().eq("emp_num", empNum)).getName()); String b = System.getProperty("os.arch");
String c = System.getProperty("os.version");
Map<String, String> map = new HashMap<>();
map.put("os.name", a);
map.put("os.arch", b);
map.put("os.version", c);
return ResultUtil.data(map);
// return ResultUtil.data(YgglMainEmp.builder().build()
// .selectOne(new QueryWrapper<YgglMainEmp>().eq("emp_num", empNum)).getName());
} }
/*************************** 设置请求头 ***************************************/ /*************************** 设置请求头 ***************************************/
......
...@@ -192,7 +192,8 @@ public class DzhtController2 { ...@@ -192,7 +192,8 @@ public class DzhtController2 {
@ApiOperation(value = "创建机构模板印章", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "创建机构模板印章", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> orgTemplate(@CurrentUser UserBean userBean, @RequestBody DzhtAssoQyyz qyyz) { public Result<Object> orgTemplate(@CurrentUser UserBean userBean, @RequestBody DzhtAssoQyyz qyyz) {
String orgId = DzhtAssoQyzc.builder().build().selectOne( String orgId = DzhtAssoQyzc.builder().build().selectOne(
new QueryWrapper<DzhtAssoQyzc>().eq("third_party_user_id", qyyz.getThirdPartyUserId()).select("org_id")) // new QueryWrapper<DzhtAssoQyzc>().eq("third_party_user_id", qyyz.getThirdPartyUserId()).select("org_id"))
new QueryWrapper<DzhtAssoQyzc>().eq("org_code", userBean.getOrgCode()).select("org_id"))
.getOrgId();// 查询orgId .getOrgId();// 查询orgId
// String orgId = "dfd84b9a58d345ea90f6711bad853435";// 测试公司账户 // String orgId = "dfd84b9a58d345ea90f6711bad853435";// 测试公司账户
// 印章参数 // 印章参数
......
package cn.timer.api.controller.spmk; package cn.timer.api.controller.spmk;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -21,9 +22,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -21,9 +22,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.timer.api.bean.spmk.SpmkIcon; import cn.timer.api.bean.spmk.SpmkIcon;
import cn.timer.api.bean.spmk.SpmkJqgz; import cn.timer.api.bean.spmk.SpmkJqgz;
import cn.timer.api.bean.spmk.SpmkLcjd; import cn.timer.api.bean.spmk.SpmkLcjd;
...@@ -33,12 +37,15 @@ import cn.timer.api.bean.spmk.SpmkSpcz; ...@@ -33,12 +37,15 @@ import cn.timer.api.bean.spmk.SpmkSpcz;
import cn.timer.api.bean.spmk.SpmkSpgl; import cn.timer.api.bean.spmk.SpmkSpgl;
import cn.timer.api.bean.spmk.SpmkSpz; import cn.timer.api.bean.spmk.SpmkSpz;
import cn.timer.api.bean.spmk.SpmkSxpz; import cn.timer.api.bean.spmk.SpmkSxpz;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enums.CommonEnum; import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.dao.spmk.SpmkSpglMapper; import cn.timer.api.dao.spmk.SpmkSpglMapper;
import cn.timer.api.dao.spmk.SpmkSpzMapper; import cn.timer.api.dao.spmk.SpmkSpzMapper;
import cn.timer.api.dto.spmk.SpmkMbKjDto; import cn.timer.api.dto.spmk.SpmkMbKjDto;
import cn.timer.api.dto.spmk.Router;
import cn.timer.api.dto.spmk.Spmk;
import cn.timer.api.dto.spmk.SpmkSpglDto; import cn.timer.api.dto.spmk.SpmkSpglDto;
import cn.timer.api.dto.spmk.SpmkSpglMoveDto; import cn.timer.api.dto.spmk.SpmkSpglMoveDto;
import cn.timer.api.dto.spmk.SpmkSpglSortDto; import cn.timer.api.dto.spmk.SpmkSpglSortDto;
...@@ -47,6 +54,7 @@ import cn.timer.api.dto.spmk.SpmkSpzSortDto; ...@@ -47,6 +54,7 @@ import cn.timer.api.dto.spmk.SpmkSpzSortDto;
import cn.timer.api.dto.spmk.SpmkSpzSpglDto; import cn.timer.api.dto.spmk.SpmkSpzSpglDto;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
import cn.timer.api.utils.RouterUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -392,12 +400,104 @@ public class SpmkServiceImpl { ...@@ -392,12 +400,104 @@ public class SpmkServiceImpl {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
IPage<SpmkJqgz> sPage = SpmkJqgz.builder().build().selectPage(p, new QueryWrapper<SpmkJqgz>().eq("org_code",orgCode)); IPage<SpmkJqgz> sPage = SpmkJqgz.builder().build().selectPage(p, new QueryWrapper<SpmkJqgz>().eq("org_code",orgCode));
List<SpmkJqgz> spmkJqgzs = sPage.getRecords(); List<SpmkJqgz> spmkJqgzs = sPage.getRecords();
sPage.getCurrent();
sPage.getPages();
sPage.getTotal();
sPage.getSize();
return ResultUtil.data(sPage, spmkJqgzs, "获取假期规则列表成功"); return ResultUtil.data(sPage, spmkJqgzs, "获取假期规则列表成功");
} }
/**
* 流程节点解析
*/
@PostMapping(value = "/jsonparse")
@ApiOperation(value = "流程节点解析", httpMethod = "POST", notes = "流程节点解析")
@ApiOperationSupport(order = 1)
public Result<Object> jsonToObj(@RequestBody Object jsonObj){
JSONObject obj = JSONUtil.parseObj(jsonObj, false, true);
Router Router = obj.get("router", Router.class);
Console.log("obj:" + obj.toStringPretty());
Console.log("Router:" + Router.toPrettyString());
Console.log("Router:" + Router.toJSONString());
return ResultUtil.success("解析成功!");
}
/**
* 流程节点解析
*/
@PostMapping(value = "/jsonparse_plus")
@ApiOperation(value = "流程节点解析_plus", httpMethod = "POST", notes = "流程节点解析_plus")
@ApiOperationSupport(order = 1)
public Result<Object> jsonToObj2(@RequestBody Router jsonObj){
Console.log("jsonObj:" + jsonObj);
Console.log("jsonObj:" + jsonObj.getChildren());
return ResultUtil.data(jsonObj, "解析成功!");
}
/**
* 流程节点解析
*/
@PostMapping(value = "/jsonparse_plusx")
@ApiOperation(value = "流程节点解析_plus", httpMethod = "POST", notes = "流程节点解析_plus")
@ApiOperationSupport(order = 1)
public Result<Object> jsonToObj3(@RequestBody Object jsonObj){
JSONObject obj = JSONUtil.parseObj(jsonObj, false, true);
obj.put("orgCode", 4);
Console.log("jsonObj:" + obj.get("name"));
Console.log("jsonObj:" + obj.get("id"));
Console.log("jsonObj:" + obj.get("aaa"));
return ResultUtil.data(jsonObj, "解析成功!");
}
/**
* 部门id 查询 员工
*/
@PostMapping(value = "/deptSelectEmp")
@ApiOperation(value = "部门id 查询 员工", httpMethod = "POST", notes = "流程节点解析_plus")
@ApiOperationSupport(order = 1)
public Result<Object> selectEmpBydept(@RequestParam Integer id){
List<YgglMainEmp> ygglMainEmp = RouterUtils.selectOtherlistent(4,id);
return ResultUtil.data(ygglMainEmp, "解析成功!");
}
/**
* 流程节点解析123
*/
@PostMapping(value = "/jsonparse_plus_plus")
@ApiOperation(value = "流程节点解析_plus", httpMethod = "POST", notes = "流程节点解析_plus")
@ApiOperationSupport(order = 1)
public Result<Object> jsonToObj123(@RequestBody Spmk spmk){
List<Router> listRouter = new ArrayList<Router>();
listRouter.add(spmk.getRouter());
return ResultUtil.data(RouterUtils.NextNode(listRouter, spmk.getData()), "解析成功!");
}
} }
...@@ -46,7 +46,7 @@ public class ZzglController { ...@@ -46,7 +46,7 @@ public class ZzglController {
ZzglBmgwMMapper zzglBmgwMMapper; ZzglBmgwMMapper zzglBmgwMMapper;
@Autowired @Autowired
ZzglLogDgjlMapper zzglLogDgjlMapper; ZzglLogDgjlMapper zzglLogDgjlMapper;
/** /**
* 架构树/架构图/导出 * 架构树/架构图/导出
...@@ -71,7 +71,7 @@ public class ZzglController { ...@@ -71,7 +71,7 @@ public class ZzglController {
*/ */
@GetMapping(value = "/otherlistent/{id}") @GetMapping(value = "/otherlistent/{id}")
@ApiOperation(value = "获取岗位成员列表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "获取岗位成员列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<YgglMainEmp>> selectOtherlistent(@CurrentUser UserBean userBean, @PathVariable Integer id){ public Result<List<YgglMainEmp>> selectOtherlistent(@CurrentUser UserBean userBean, @PathVariable Integer id) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>(); ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper) List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
...@@ -79,6 +79,9 @@ public class ZzglController { ...@@ -79,6 +79,9 @@ public class ZzglController {
list.add(id); list.add(id);
ZzglBmgwM.getDepts(list, id, zzglBmgwMs); ZzglBmgwM.getDepts(list, id, zzglBmgwMs);
ZzglBmgwM messsage = ZzglBmgwM.builder().build().selectOne(new QueryWrapper<ZzglBmgwM>().eq("id", id));
Integer lead = messsage.getLeader(); // 获取部门或岗位领导id
if (list == null || list.size() == 0) { if (list == null || list.size() == 0) {
return ResultUtil.error("部门信息不存在,请先添加部门!"); return ResultUtil.error("部门信息不存在,请先添加部门!");
} else { } else {
...@@ -86,11 +89,11 @@ public class ZzglController { ...@@ -86,11 +89,11 @@ public class ZzglController {
ygglMainEmpsLambdaQueryWrapper ygglMainEmpsLambdaQueryWrapper
.select(YgglMainEmp::getId, YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getPhone, .select(YgglMainEmp::getId, YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getPhone,
YgglMainEmp::getBmgwId) YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getOrgCode, orgCode).and(i -> i.in(YgglMainEmp::getBmgwId, list.toArray())); .eq(YgglMainEmp::getOrgCode, orgCode).and(i -> i.in(YgglMainEmp::getBmgwId, list.toArray()))
.last(lead != null, "order by if (emp_num='" + lead + "',0,1)");
List<YgglMainEmp> ygglMainEmps = YgglMainEmp.builder().build().selectList(ygglMainEmpsLambdaQueryWrapper); List<YgglMainEmp> ygglMainEmps = YgglMainEmp.builder().build().selectList(ygglMainEmpsLambdaQueryWrapper);
return ResultUtil.data(ygglMainEmps); return ResultUtil.data(ygglMainEmps);
} }
} }
/** /**
...@@ -101,7 +104,8 @@ public class ZzglController { ...@@ -101,7 +104,8 @@ public class ZzglController {
*/ */
@PostMapping(value = "/listdgjl") @PostMapping(value = "/listdgjl")
@ApiOperation(value = "获取调岗记录(weng)", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "获取调岗记录(weng)", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> selectlistdgjl(@CurrentUser UserBean userBean, @RequestBody LogDgjlsQueryDto logDgjlsQueryDto){ public Result<Object> selectlistdgjl(@CurrentUser UserBean userBean,
@RequestBody LogDgjlsQueryDto logDgjlsQueryDto) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
ArrayList<Integer> list = new ArrayList<Integer>(); ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper) List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
...@@ -112,10 +116,10 @@ public class ZzglController { ...@@ -112,10 +116,10 @@ public class ZzglController {
if (list == null || list.size() == 0) { if (list == null || list.size() == 0) {
return ResultUtil.error("部门信息不存在,请先添加部门!"); return ResultUtil.error("部门信息不存在,请先添加部门!");
} else { } else {
logDgjlsQueryDto.setDeptIdList(list); logDgjlsQueryDto.setDeptIdList(list);
logDgjlsQueryDto.setOrgCode(orgCode); logDgjlsQueryDto.setOrgCode(orgCode);
IPage<LogDgjlsDto> page = new Page<LogDgjlsDto>( IPage<LogDgjlsDto> page = new Page<LogDgjlsDto>(
logDgjlsQueryDto.getCurrentPage() == null ? 1 : logDgjlsQueryDto.getCurrentPage(), logDgjlsQueryDto.getCurrentPage() == null ? 1 : logDgjlsQueryDto.getCurrentPage(),
logDgjlsQueryDto.getTotalPage() == null ? 10 : logDgjlsQueryDto.getTotalPage()); logDgjlsQueryDto.getTotalPage() == null ? 10 : logDgjlsQueryDto.getTotalPage());
...@@ -155,7 +159,7 @@ public class ZzglController { ...@@ -155,7 +159,7 @@ public class ZzglController {
*/ */
@PostMapping(value = "/dept") @PostMapping(value = "/dept")
@ApiOperation(value = "添加/修改部门", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "添加/修改部门", httpMethod = "POST", notes = "接口发布说明")
public Result<ZzglBmgwM> adddept(@CurrentUser UserBean userBean, @RequestBody ZzglBmgwM zzglBmgwM){ public Result<ZzglBmgwM> adddept(@CurrentUser UserBean userBean, @RequestBody ZzglBmgwM zzglBmgwM) {
Boolean a = zzglBmgwM.getId() == null; Boolean a = zzglBmgwM.getId() == null;
if (a && zzglBmgwM.getType() == null) if (a && zzglBmgwM.getType() == null)
zzglBmgwM.setType((Integer) 0); zzglBmgwM.setType((Integer) 0);
...@@ -164,7 +168,6 @@ public class ZzglController { ...@@ -164,7 +168,6 @@ public class ZzglController {
if (a) if (a)
return ResultUtil.data(zzglBmgwM); return ResultUtil.data(zzglBmgwM);
return ResultUtil.success(); return ResultUtil.success();
} }
/** /**
......
package cn.timer.api.dto.spmk;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Condition {
private String key;
private String format;
private String value;
}
package cn.timer.api.dto.spmk;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Relation {
/**
* 类型
*/
private String type;
/**
* 名称
*/
private String name;
/**
* 部门ID
*/
private String departmentId;
/**
* 用户
*/
private List<User> users;
}
package cn.timer.api.dto.spmk;
import java.util.List;
import cn.hutool.json.JSONSupport;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Router extends JSONSupport {
/**
* 节点类型
* 1.creator-发起
* 2.audit-审批
* 3.copy-抄送
* 4.rules-规则
*/
private String className;
/**
* 执行
*/
private String execute;
/**
* 通过
*/
private Boolean flow;
/**
* 关系
*/
private List<Relation> relation;
/**
* 条件
*/
private List<Condition> condition;
/**
* 下一级
*/
private List<Router> children;
}
package cn.timer.api.dto.spmk;
import cn.hutool.json.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Spmk {
private Router router;
private JSONObject data;
}
package cn.timer.api.dto.spmk;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class User{
private String name;
private String id;
private String execute;
}
package cn.timer.api.utils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zcgl.ZcglAssoZcgx;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.spmk.Condition;
import cn.timer.api.dto.spmk.Relation;
import cn.timer.api.dto.spmk.Router;
import cn.timer.api.dto.spmk.User;
/**
* 流程节点工具类
*
* @author Administrator
*
*/
public class RouterUtils {
private final static String UNEXECUTED = "0";
private final static String EXECUTING = "1";
private final static String EXECUTED = "2";
private final static String CREATOR = "creator";
private final static String RULES = "rules";
private final static String AUDIT = "audit";
private final static String COPY = "copy";
private final static String RELATION_TYPE_DEPARTMENT = "department";
private final static String RELATION_TYPE_USERS = "users";
// 执行下一个节点
public static List<Router> NextNode(List<Router> listRouter,JSONObject obj) {
Router router;
if (listRouter != null && listRouter.size() != 0) {
// 非条件节点
if (listRouter.size() == 1) {
router = listRouter.get(0);
// 0未执行 1执行中 2已执行
switch (router.getExecute()) {
case UNEXECUTED:
switch (router.getClassName()) {
case CREATOR:
Console.log("发起人逻辑");
router.setExecute(EXECUTED);
router.setFlow(true);
router.getRelation().get(0).setName(obj.get("name",String.class));
NextNode(router.getChildren(),obj);
break;
case AUDIT:
Console.log("审批人逻辑");
router.setExecute(EXECUTING);
router.setFlow(true);
List<User> listUser = router.getRelation().get(0).getUsers();
user:
for (int i = 0; i < listUser.size(); i++) {
String execute = listUser.get(i).getExecute();
switch (execute) {
case UNEXECUTED:
listUser.get(i).setExecute(EXECUTING);
break user;
case EXECUTING:
listUser.get(i).setExecute(EXECUTED);
break;
}
}
break;
case COPY:
Console.log("抄送人逻辑");
router.setExecute(EXECUTED);
router.setFlow(true);
List<Relation> listRelations = router.getRelation();
for (int i = 0; i < listRelations.size(); i++) {
// 装配 部门人员
if (RELATION_TYPE_DEPARTMENT.equals(listRelations.get(i).getType())) {
List<YgglMainEmp> listYgglMainEmp = selectOtherlistent(obj.get("orgCode",Integer.class), Integer.valueOf(listRelations.get(i).getDepartmentId()));
List<User> listUsers = new ArrayList<User>();
for (YgglMainEmp emp : listYgglMainEmp) {
User user = new User();
user.setName(emp.getName());
user.setId(String.valueOf(emp.getEmpNum()));
listUsers.add(user);
}
}else if (RELATION_TYPE_USERS.equals(listRelations.get(i).getType())) {
}
}
NextNode(router.getChildren(),obj);
break;
default:
break;
}
break;
case EXECUTING:
switch (router.getClassName()) {
case AUDIT:
Console.log("下一个审批人逻辑");
router.setFlow(true);
boolean executeFlog = true;
List<User> listUser = router.getRelation().get(0).getUsers();
user:
for (int i = 0; i < listUser.size(); i++) {
String execute = listUser.get(i).getExecute();
switch (execute) {
case UNEXECUTED:
listUser.get(i).setExecute(EXECUTING);
if (!EXECUTED.equals(listUser.get(i).getExecute())) {
executeFlog = false;
}
break user;
case EXECUTING:
listUser.get(i).setExecute(EXECUTED);
break;
}
}
if (executeFlog) {
router.setExecute(EXECUTED);
}
NextNode(router.getChildren(),obj);
break;
default:
break;
}
break;
case EXECUTED:
Console.log("下一个节点");
NextNode(router.getChildren(),obj);
break;
}
} else {
// 条件节点
rulefor:
for (Router routerRule : listRouter) {
switch (routerRule.getExecute()) {
case UNEXECUTED:
boolean condition_b = true;
List<Condition> listCondition = routerRule.getCondition();
if (listCondition == null || listCondition.size() == 0) {
routerRule.setFlow(true);
}else {
for (Condition condition : listCondition) {
// 判断条件
if (!stringCompare(obj.get(condition.getKey(),String.class), condition.getValue(), condition.getFormat())) {
condition_b = false;
}
}
}
routerRule.setFlow(condition_b);
routerRule.setExecute(EXECUTED);
if (routerRule.getFlow() == true) {
Console.log("条件逻辑");
NextNode(routerRule.getChildren(),obj);
}
break;
case EXECUTED:
NextNode(routerRule.getChildren(),obj);
break rulefor;
}
}
Console.log("特殊情况!");
}
}
return listRouter;
};
// 执行下一个节点
public static List<Router> NextNodeing(List<Router> listRouter,JSONObject obj) {
Router router;
if (listRouter != null && listRouter.size() != 0) {
// 非条件节点
if (listRouter.size() == 1) {
router = listRouter.get(0);
// 0未执行 1执行中 2已执行
switch (router.getExecute()) {
case UNEXECUTED:
switch (router.getClassName()) {
case CREATOR:
Console.log("发起人逻辑");
router.setExecute(EXECUTED);
router.setFlow(true);
router.getRelation().get(0).setName(obj.get("name",String.class));
NextNode(router.getChildren(),obj);
break;
case AUDIT:
Console.log("审批人逻辑");
router.setExecute(EXECUTING);
router.setFlow(true);
List<User> listUser = router.getRelation().get(0).getUsers();
user:
for (int i = 0; i < listUser.size(); i++) {
String execute = listUser.get(i).getExecute();
switch (execute) {
case UNEXECUTED:
listUser.get(i).setExecute(EXECUTING);
break user;
case EXECUTING:
listUser.get(i).setExecute(EXECUTED);
break;
}
}
break;
case COPY:
Console.log("抄送人逻辑");
router.setExecute(EXECUTED);
router.setFlow(true);
List<Relation> listRelations = router.getRelation();
for (int i = 0; i < listRelations.size(); i++) {
// 装配 部门人员
if (RELATION_TYPE_DEPARTMENT.equals(listRelations.get(i).getType())) {
List<YgglMainEmp> listYgglMainEmp = selectOtherlistent(obj.get("orgCode",Integer.class), Integer.valueOf(listRelations.get(i).getDepartmentId()));
List<User> listUsers = new ArrayList<User>();
for (YgglMainEmp emp : listYgglMainEmp) {
User user = new User();
user.setName(emp.getName());
user.setId(String.valueOf(emp.getEmpNum()));
listUsers.add(user);
}
}else if (RELATION_TYPE_USERS.equals(listRelations.get(i).getType())) {
}
}
NextNode(router.getChildren(),obj);
break;
default:
break;
}
break;
case EXECUTING:
switch (router.getClassName()) {
case AUDIT:
Console.log("下一个审批人逻辑");
router.setFlow(true);
boolean executeFlog = true;
List<User> listUser = router.getRelation().get(0).getUsers();
user:
for (int i = 0; i < listUser.size(); i++) {
String execute = listUser.get(i).getExecute();
switch (execute) {
case UNEXECUTED:
listUser.get(i).setExecute(EXECUTING);
break user;
case EXECUTING:
listUser.get(i).setExecute(EXECUTED);
break;
}
if (!EXECUTED.equals(listUser.get(i).getExecute())) {
executeFlog = false;
}
}
if (executeFlog) {
router.setExecute(EXECUTED);
}
NextNode(router.getChildren(),obj);
break;
default:
break;
}
break;
case EXECUTED:
Console.log("下一个节点");
NextNode(router.getChildren(),obj);
break;
}
} else {
// 条件节点
rulefor:
for (Router routerRule : listRouter) {
switch (routerRule.getExecute()) {
case UNEXECUTED:
boolean condition_b = true;
List<Condition> listCondition = routerRule.getCondition();
if (listCondition == null || listCondition.size() == 0) {
routerRule.setFlow(true);
}else {
for (Condition condition : listCondition) {
// 判断条件
if (!stringCompare(obj.get(condition.getKey(),String.class), condition.getValue(), condition.getFormat())) {
condition_b = false;
}
}
}
routerRule.setFlow(condition_b);
routerRule.setExecute(EXECUTED);
if (routerRule.getFlow() == true) {
Console.log("条件逻辑");
NextNode(routerRule.getChildren(),obj);
}
break;
case EXECUTED:
NextNode(routerRule.getChildren(),obj);
break rulefor;
}
}
Console.log("特殊情况!");
}
}
return listRouter;
};
public static List<YgglMainEmp> selectOtherlistent(Integer orgCode, Integer id){
ArrayList<Integer> list = new ArrayList<Integer>();
QueryWrapper<ZzglBmgwM> queryWrapper = new QueryWrapper<ZzglBmgwM>();
queryWrapper.eq("org_code", orgCode);
List<ZzglBmgwM> zzglBmgwMs = ZzglBmgwM.builder().build().selectList(queryWrapper);
list.add(id);
ZzglBmgwM.getDepts(list, id, zzglBmgwMs);
if (list == null || list.size() == 0) {
return null;
} else {
LambdaQueryWrapper<YgglMainEmp> ygglMainEmpsLambdaQueryWrapper = new LambdaQueryWrapper<>();
ygglMainEmpsLambdaQueryWrapper
.select(YgglMainEmp::getId, YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getPhone,
YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getOrgCode, orgCode).and(i -> i.in(YgglMainEmp::getBmgwId, list.toArray()));
List<YgglMainEmp> ygglMainEmps = YgglMainEmp.builder().build().selectList(ygglMainEmpsLambdaQueryWrapper);
return ygglMainEmps;
}
}
private static boolean stringCompare(String s1,String s2,String symbol) {
double d1;
double d2;
switch (symbol) {
case "<":
d1 = Double.parseDouble(s1);
d2 = Double.parseDouble(s2);
if (NumberUtil.compare(d1,d2) == -1) return true;
break;
case "<=":
d1 = Double.parseDouble(s1);
d2 = Double.parseDouble(s2);
if (NumberUtil.compare(d1,d2) == -1 || NumberUtil.compare(d1,d2) == 0) return true;
break;
case "=":
if (s2.equals(s1)) return true;
break;
case ">":
d1 = Double.parseDouble(s1);
d2 = Double.parseDouble(s2);
if (NumberUtil.compare(d1,d2) == 1) return true;
break;
case ">=":
d1 = Double.parseDouble(s1);
d2 = Double.parseDouble(s2);
if (NumberUtil.compare(d1,d2) == 0 || NumberUtil.compare(d1,d2) == 1) return true;
break;
}
return false;
};
}
#开发环境 #生产环境
server: server:
port: 8080 port: 8089
servlet: servlet:
# context-path: /YoulinghrApiV100 # context-path: /YoulinghrApiV100
session: session:
timeout: 2h # session会话过期时间 timeout: 3600 # session会话过期时间
spring: spring:
servlet: servlet:
multipart: multipart:
...@@ -13,20 +13,27 @@ spring: ...@@ -13,20 +13,27 @@ spring:
jpa: jpa:
# 配置生成表 存储引擎InnoDB # 配置生成表 存储引擎InnoDB
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
# database: # database:
# open-in-view: false open-in-view: false
#naming: # naming:
# spring boot jpa hibernate 根据实体类生成表以及字段的命名策略 # spring boot jpa hibernate 根据实体类生成表以及字段的命名策略
# 无修改命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl # 无修改命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# 遇到大写字母 加”_”的命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl # 遇到大写字母 加”_”的命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
#physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl # physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
hibernate: hibernate:
ddl-auto: update ddl-auto: update
show-sql: true show-sql: true
datasource: datasource:
username: heimao # username: root
password: 999999 # password: youlingHR73!
url: jdbc:mysql://192.168.172.200:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL username: youling8timer
password: (!0YouLing8Timer0!)
# username: tang
# password: Tang123456!
# url: jdbc:mysql://120.24.172.51:3306/youlingrc_tang?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
url: jdbc:mysql://120.24.24.239:3306/8timer_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
# url: jdbc:mysql://192.168.172.200:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
# url: jdbc:mysql://db.hhlsz.com:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
druid: druid:
...@@ -110,11 +117,13 @@ pagehelper: ...@@ -110,11 +117,13 @@ pagehelper:
logging: logging:
level: level:
root: info root: info
cn.timer.api.dao: debug cn.timer.api.dao: error
pattern: pattern:
console: '--%p--%m%n' console: '--%p--%m%n'
#swagger: #swagger:
# ui-config: # ui-config:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序 # operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
\ No newline at end of file configtest:
patht: 'devPath-dev'
\ No newline at end of file
...@@ -124,4 +124,6 @@ logging: ...@@ -124,4 +124,6 @@ logging:
#swagger: #swagger:
# ui-config: # ui-config:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序 # operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
\ No newline at end of file configtest:
patht: 'devPath-pro'
\ No newline at end of file
#生产环境
server:
port: 8089
servlet:
# context-path: /YoulinghrApiV100
session:
timeout: 3600 # session会话过期时间
spring:
servlet:
multipart:
max-file-size: 20MB
max-request-size: 20MB
jpa:
# 配置生成表 存储引擎InnoDB
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
# database:
open-in-view: false
# naming:
# spring boot jpa hibernate 根据实体类生成表以及字段的命名策略
# 无修改命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# 遇到大写字母 加”_”的命名 org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
# physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
hibernate:
ddl-auto: update
show-sql: true
datasource:
# username: root
# password: youlingHR73!
username: youling8timer
password: (!0YouLing8Timer0!)
# username: tang
# password: Tang123456!
# url: jdbc:mysql://120.24.172.51:3306/youlingrc_tang?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
url: jdbc:mysql://120.24.24.239:3306/8timer_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
# url: jdbc:mysql://192.168.172.200:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
# url: jdbc:mysql://db.hhlsz.com:3306/youlingrc_8timer201?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
druid:
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 60000 # 配置获取连接等待超时的时间
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位是毫秒
validation-query: SELECT 1 FROM DUAL
test-while-idle: true # 当连接空闲时,是否执行连接测试
test-on-borrow: false # 当从连接池借用连接时,是否测试该连接
test-on-return: false # 在连接归还到连接池时是否测试该连接
# 打开PSCache,并且指定每个连接上PSCache的大小
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 ,不能用log4j,不然报错:Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource:
filters: stat,slf4j
use-global-data-source-stat: true
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
#connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 配置监控服务器
stat-view-servlet:
login-username: Tang
login-password: 123
reset-enable: false
url-pattern: /druid/*
# 添加IP白名单
#allow:
# 添加IP黑名单,当白名单和黑名单重复时,黑名单优先级更高
#deny:
web-stat-filter:
# 添加过滤规则
url-pattern: /*
# 忽略过滤格式
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
# 时间戳统一转换
jackson:
date-format: yyyy-MM-dd HH:mm:ss
# spring boot启动打印横幅 配置
banner:
charset: UTF-8 # Banner file encoding.
location: banner.txt # Banner text resource location.
image:
location: banner.gif # Banner image file location (jpg or png can also be used).
width: 76 # Width of the banner image in chars.
height: 76 # Height of the banner image in chars (default based on image height).
margin: 2 # Left hand image margin in chars.
invert: false # Whether images should be inverted for dark terminal themes.
# mybatis-plus
mybatis-plus:
mapper-locations: classpath:mapping/**/*Mapper.xml # dao到xml文件映射
type-aliases-package: cn.timer.api.bean # xml中#全局类名别名
configuration:
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # sql日志打印
call-setters-on-nulls: true # Map做返回体时 字段值为null依然返回
cache-enabled: true
global-config:
db-config:
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
#id-type: uuid
id-type: auto
#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
# field-strategy: not_null
#驼峰下划线转换
table-underline: true
#逻辑删除配置
#logic-delete-value: 0
#logic-not-delete-value: 1
# 分页插件
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
#showSql
logging:
level:
root: info
cn.timer.api.dao: error
pattern:
console: '--%p--%m%n'
#swagger:
# ui-config:
# operations-sorter: method # 它提供了两个配置项:alpha和method,分别代表了按字母表排序以及按方法定义顺序排序
configtest:
patht: 'devPath-test'
\ No newline at end of file
spring: spring:
profiles: profiles:
active: pro active: '@environment@'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment