Browse Source

Merge branch 'master' of http://47.110.251.215:3000/java_org/bladex

liuyc 3 years ago
parent
commit
a1a0ec066d
34 changed files with 1317 additions and 29 deletions
  1. 2 2
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/constant/ProcessConstant.java
  2. 1 0
      blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/utils/FlowUtil.java
  3. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/FixedFlowDTO.java
  4. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/FixedFlowLinkDTO.java
  5. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TaskDTO.java
  6. 44 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/FixedFlow.java
  7. 87 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/FixedFlowLink.java
  8. 126 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/Task.java
  9. 34 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/FixedFlowLinkVO.java
  10. 66 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/FixedFlowVO.java
  11. 38 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TaskVO.java
  12. 3 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/FormData.java
  13. 10 0
      blade-service/blade-business/pom.xml
  14. 162 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/FixedFlowController.java
  15. 3 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/MileageController.java
  16. 63 0
      blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java
  17. 3 1
      blade-service/blade-business/src/main/java/org/springblade/business/excel/DatumPointExcel.java
  18. 3 1
      blade-service/blade-business/src/main/java/org/springblade/business/excel/DatumPointxyExcel.java
  19. 50 0
      blade-service/blade-business/src/main/java/org/springblade/business/excel/MileageExcel.java
  20. 0 1
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/FirstInformationMapper.java
  21. 38 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/FixedFlowLinkMapper.java
  22. 37 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/FixedFlowLinkMapper.xml
  23. 24 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/FixedFlowMapper.java
  24. 26 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/FixedFlowMapper.xml
  25. 30 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskMapper.java
  26. 31 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskMapper.xml
  27. 38 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IFixedFlowLinkService.java
  28. 21 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IFixedFlowService.java
  29. 33 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITaskService.java
  30. 49 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/FixedFlowLinkServiceImpl.java
  31. 73 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/FixedFlowServiceImpl.java
  32. 59 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  33. 21 2
      blade-service/blade-manager/src/main/java/com/mixsmart/utils/CustomFunction.java
  34. 40 22
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

+ 2 - 2
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/constant/ProcessConstant.java

@@ -29,9 +29,9 @@ public interface ProcessConstant {
 	String LEAVE_KEY = "Leave";
 
 	/**
-	 * 报销流程标识
+	 * 审批流程
 	 */
-	String EXPENSE_KEY = "Expense";
+	String EXAMINATION_AND_APPROVAL = "Approval";
 
 	/**
 	 * 同意标识

+ 1 - 0
blade-ops-api/blade-flow-api/src/main/java/org/springblade/flow/core/utils/FlowUtil.java

@@ -37,6 +37,7 @@ public class FlowUtil {
 
 	static {
 		BUSINESS_TABLE.put(ProcessConstant.LEAVE_KEY, "blade_process_leave");
+		BUSINESS_TABLE.put(ProcessConstant.EXAMINATION_AND_APPROVAL, "u_task");
 	}
 
 	/**

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/FixedFlowDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.dto;
+
+import org.springblade.business.entity.FixedFlow;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FixedFlowDTO extends FixedFlow {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/FixedFlowLinkDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.dto;
+
+import org.springblade.business.entity.FixedFlowLink;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FixedFlowLinkDTO extends FixedFlowLink {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/TaskDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.dto;
+
+import org.springblade.business.entity.Task;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 任务审核主表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TaskDTO extends Task {
+	private static final long serialVersionUID = 1L;
+
+}

+ 44 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/FixedFlow.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Data
+@TableName("u_fixed_flow")
+@EqualsAndHashCode(callSuper = true)
+public class FixedFlow extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 流程名称
+	*/
+		private String fixedFlowName;
+
+
+}

+ 87 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/FixedFlowLink.java

@@ -0,0 +1,87 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.secure.utils.AuthUtil;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Data
+@TableName("u_fixed_flow_link")
+@EqualsAndHashCode(callSuper = true)
+public class FixedFlowLink extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 固定流程ID
+     */
+    private Long fixedFlowId;
+    /**
+     * 流程环节
+     */
+    private String fixedFlowLink;
+    /**
+     * 环节处理人ID
+     */
+    private Long fixedFlowLinkUser;
+    /**
+     * 环节处理人姓名
+     */
+    private String fixedFlowLinkUserName;
+    /**
+     * 环节顺序
+     */
+    private Integer fixedFlowLinkSort;
+    /**
+     * 角色ID
+     */
+    private Long fixedFlowRole;
+    /**
+     * 角色名称
+     */
+    private String fixedFlowRoleName;
+    private Long projectId;
+    private Long contractId;
+
+    public FixedFlowLink(){}
+
+    public FixedFlowLink(String fixedFlowLinkUserName, String fixedFlowLinkUser, Long projectId, Long contractId, Long fixedFlowId, Integer sort){
+        this.fixedFlowLinkUserName = fixedFlowLinkUserName;
+        this.fixedFlowLinkUser = Long.parseLong(fixedFlowLinkUser);
+        this.projectId = projectId;
+        this.contractId = contractId;
+        this.fixedFlowId = fixedFlowId;
+        this.fixedFlowLinkSort = sort;
+        this.setCreateUser(AuthUtil.getUserId());
+        this.setCreateDept(AuthUtil.getDeptId().contains(",") ? Long.parseLong(AuthUtil.getDeptId().split(",")[0]) : Long.parseLong(AuthUtil.getDeptId()));
+        this.setCreateTime(new Date());
+    }
+
+}

+ 126 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/Task.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 任务审核主表实体类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Data
+@TableName("u_task")
+@EqualsAndHashCode(callSuper = true)
+public class Task extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 流程定义主键
+     */
+    @ApiModelProperty("流程定义主键")
+    private String processDefinitionId;
+
+    /**
+     * 流程实例主键
+     */
+    @ApiModelProperty("流程实例主键")
+    private String processInstanceId;
+
+    /**
+     * 开始时间
+     */
+    @ApiModelProperty("开始时间")
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    @ApiModelProperty("结束时间")
+    private String endTime;
+
+    /**
+     * 任务名称
+     */
+    @ApiModelProperty("任务名称")
+    private String taskName;
+
+    /**
+     * 任务内容
+     */
+    @ApiModelProperty("任务内容")
+    private String taskContent;
+
+    /**
+     * 第一环节审批人
+     */
+    @ApiModelProperty("第一环节审批人")
+    private String taskUser;
+
+    /**
+     * 固定流程ID
+     */
+    @ApiModelProperty("固定流程ID")
+    private Long fixedFlowId;
+
+    /**
+     * 数据指向
+     */
+    @ApiModelProperty("数据指向")
+    private Long formDataId;
+
+    /**
+     * 上报批次
+     */
+    @ApiModelProperty("上报批次")
+    private Integer batch;
+
+    /**
+     * 电签状态,1成功,99失败
+     */
+    @ApiModelProperty("电签状态,1成功,99失败")
+    private String eVisaStatus;
+
+    /**
+     * 电签结果内容
+     */
+    @ApiModelProperty("电签结果内容")
+    private String eVisaContent;
+
+    /**
+     * 上报人
+     */
+    @ApiModelProperty("上报人")
+    private String reportUser;
+
+    /**
+     * 上报人姓名
+     */
+    @ApiModelProperty("上报人姓名")
+    private String reportUserName;
+
+}

+ 34 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/FixedFlowLinkVO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.entity.FixedFlowLink;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FixedFlowLinkVO extends FixedFlowLink {
+	private static final long serialVersionUID = 1L;
+
+}

+ 66 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/FixedFlowVO.java

@@ -0,0 +1,66 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.entity.FixedFlow;
+import org.springblade.business.entity.FixedFlowLink;
+import org.springblade.core.mp.support.Query;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FixedFlowVO extends FixedFlow {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("环节处理人姓名及ID,拼接格式为:环节处理人姓名-环节处理人ID(英文逗号)环节处理人姓名-环节处理人ID")
+	private String linkUserJoinString;
+
+	@ApiModelProperty("项目ID")
+	private Long projectId;
+
+	@ApiModelProperty("合同段ID")
+	private Long contractId;
+
+	@ApiModelProperty("环节信息")
+	private List<FixedFlowLink> fixedFlowLinkList = new ArrayList<>();
+
+	@ApiModelProperty("当前页")
+	private Integer current;
+
+	@ApiModelProperty("当前页总数")
+	private Integer size;
+
+	private Query query;
+
+	public Query getQuery(Integer current, Integer size){
+		query = new Query();
+		query.setCurrent(current);
+		query.setSize(size);
+		return query;
+	}
+
+}

+ 38 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TaskVO.java

@@ -0,0 +1,38 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.business.entity.Task;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 任务审核主表视图实体类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TaskVO extends Task {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("限定审批时间(天)")
+	private Integer restrictDay;
+
+}

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/FormData.java

@@ -3,6 +3,7 @@ package org.springblade.manager.dto;
 import lombok.Data;
 import org.springblade.manager.entity.Formula;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -53,6 +54,8 @@ public class FormData {
      */
     private  Integer groupId;
 
+    private List<String> rely = new ArrayList<>();
+
     public FormData() {
     }
     public FormData(String code, List<List<Object>> values, Formula formula, Integer groupId) {

+ 10 - 0
blade-service/blade-business/pom.xml

@@ -54,6 +54,16 @@
             <groupId>com.alibaba</groupId>
             <artifactId>easyexcel</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-flow-api</artifactId>
+            <version>2.9.1.RELEASE</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-starter-excel</artifactId>
+        </dependency>
     </dependencies>
 
 </project>

+ 162 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/FixedFlowController.java

@@ -0,0 +1,162 @@
+package org.springblade.business.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.apache.commons.lang.StringUtils;
+import org.springblade.business.entity.FixedFlowLink;
+import org.springblade.business.service.IFixedFlowLinkService;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.beans.BeanUtils;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.business.entity.FixedFlow;
+import org.springblade.business.vo.FixedFlowVO;
+import org.springblade.business.service.IFixedFlowService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/fixedFlow")
+@Api(tags = "预设流程接口")
+public class FixedFlowController extends BladeController {
+
+	private final IFixedFlowService fixedFlowService;
+
+	private final IFixedFlowLinkService fixedFlowLinkService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "列表数据的id字段")
+	public R<FixedFlowVO> detail(String id) {
+		FixedFlow fixedFlow = this.fixedFlowService.getById(id);
+		//转换实体
+		FixedFlowVO fixedFlowVO = new FixedFlowVO();
+		BeanUtils.copyProperties(fixedFlow, fixedFlowVO);
+
+		//查询环节信息
+		List<FixedFlowLink> linkList = this.fixedFlowLinkService.selectFixedFlowLink(id);
+		fixedFlowVO.setFixedFlowLinkList(linkList);
+
+		return R.data(fixedFlowVO);
+	}
+
+	/**
+	 * 自定义分页 
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入fixedFlow")
+	public R<IPage<FixedFlowVO>> page(FixedFlowVO vo) {
+		if(vo.getCurrent() == null || vo.getSize() == null){
+			return R.data(-1, null, "缺少size或current参数");
+		}
+		return R.data(this.fixedFlowService.selectFixedFlowPage(vo));
+	}
+
+	/**
+	 * 新增 
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "新增", notes = "传入fixedFlow")
+	public R save(@Valid @RequestBody FixedFlowVO vo) {
+		//获取环节处理人顺序
+		String linkUserJoinString = vo.getLinkUserJoinString();
+		//生成主表主键
+		Long fixedFlowId = SnowFlakeUtil.getId();
+
+		if(StringUtils.isNotEmpty(linkUserJoinString)){
+			//新增环节集合
+			List<FixedFlowLink> linkList = new ArrayList<>();
+
+			String[] linkUsers = linkUserJoinString.split(",");
+			int sort = 1;
+			for(String linkUser : linkUsers){
+				//拆分姓名及ID
+				String[] links = linkUser.split("-");
+				linkList.add(new FixedFlowLink(links[0], links[1], vo.getProjectId(), vo.getContractId(), fixedFlowId, sort));
+				sort ++;
+			}
+			//保存环节
+			this.fixedFlowLinkService.saveBatch(linkList);
+		}
+		//生成主表数据
+		FixedFlow flow = new FixedFlow();
+		BeanUtils.copyProperties(vo, flow);
+		flow.setId(fixedFlowId);
+
+		return R.status(this.fixedFlowService.save(flow));
+	}
+
+	/**
+	 * 修改 
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "修改", notes = "传入fixedFlow对象")
+	public R update(@Valid @RequestBody FixedFlowVO vo) {
+		//获取环节处理人顺序
+		String linkUserJoinString = vo.getLinkUserJoinString();
+		if(StringUtils.isNotEmpty(linkUserJoinString)){
+			//清空原本环节
+			this.fixedFlowLinkService.update(Wrappers.<FixedFlowLink>lambdaUpdate().set(FixedFlowLink::getIsDeleted, 1).eq(FixedFlowLink::getFixedFlowId, vo.getId()));
+
+			//新增环节集合
+			List<FixedFlowLink> linkList = new ArrayList<>();
+
+			String[] linkUsers = linkUserJoinString.split(",");
+			int sort = 1;
+			for(String linkUser : linkUsers){
+				//拆分姓名及ID
+				String[] links = linkUser.split("-");
+				linkList.add(new FixedFlowLink(links[0], links[1], vo.getProjectId(), vo.getContractId(), vo.getId(), sort));
+			}
+			//保存环节
+			this.fixedFlowLinkService.saveBatch(linkList);
+		}
+
+		FixedFlow flow = new FixedFlow();
+		BeanUtils.copyProperties(vo, flow);
+
+		return R.status(this.fixedFlowService.updateById(flow));
+	}
+
+	
+	/**
+	 * 删除 
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		if(this.fixedFlowService.deleteLogic(Func.toLongList(ids))){
+			//同步删除环节
+			this.fixedFlowLinkService.deletedByFixedFlowId(ids);
+			return R.status(true);
+		}
+		return R.status(false);
+	}
+
+	
+}

+ 3 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/MileageController.java

@@ -13,10 +13,12 @@ import org.springblade.business.dto.MileagexyDTO;
 import org.springblade.business.entity.Mileage;
 import org.springblade.business.entity.MileagePart;
 import org.springblade.business.entity.Mileagexy;
+import org.springblade.business.excel.MileageExcel;
 import org.springblade.business.service.impl.MileagePartService;
 import org.springblade.business.service.impl.MileagexyService;
 import org.springblade.business.utils.MileageUtill;
 import org.springblade.business.vo.MileageVo;
+import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
@@ -127,6 +129,7 @@ public class MileageController {
     public R importXy(@RequestParam("file") MultipartFile file, String projectId,String partId,String contractId ) throws Exception {
         if(file != null&&Func.isNotEmpty(partId)) {
             if(Pattern.matches(".+(\\.xls)x?$", Objects.requireNonNull(file.getOriginalFilename()).toLowerCase(Locale.ROOT))) {
+              List<MileageExcel> data = ExcelUtil.read(file,MileageExcel.class);
              return   R.success(this.service.importMileagexy(file,AuthUtil.getUserId(),projectId,contractId,partId));
             } else {
                return   R.fail("文件格式不正确,请上传Excel文件");

+ 63 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/TaskController.java

@@ -0,0 +1,63 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.business.entity.Task;
+import org.springblade.business.vo.TaskVO;
+import org.springblade.business.service.ITaskService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 任务审核主表 控制器
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/task")
+@Api(value = "任务审核主表", tags = "任务审核主表接口")
+public class TaskController extends BladeController {
+
+	private final ITaskService taskService;
+
+	/**
+	 * 上报
+	 */
+	@PostMapping("start-approval")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "上报", notes = "taskVO对象")
+	public R startApproval(@RequestBody TaskVO taskVO){
+		return R.data(this.taskService.startApproval(taskVO));
+	}
+	
+}

+ 3 - 1
blade-service/blade-business/src/main/java/org/springblade/business/excel/DatumPointExcel.java

@@ -6,6 +6,8 @@ import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
 import lombok.Data;
 
+import java.io.Serializable;
+
 /**
  * @author yangyj
  * @Date 2022/6/9 10:59
@@ -15,7 +17,7 @@ import lombok.Data;
 @ColumnWidth(16)
 @HeadRowHeight(20)
 @ContentRowHeight(18)
-public class DatumPointExcel {
+public class DatumPointExcel implements Serializable {
     @ExcelProperty(value = "名称")
     private String name;
     @ExcelProperty(value = "高程")

+ 3 - 1
blade-service/blade-business/src/main/java/org/springblade/business/excel/DatumPointxyExcel.java

@@ -7,6 +7,8 @@ import com.alibaba.excel.annotation.write.style.HeadRowHeight;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.io.Serializable;
+
 /**
  * @author yangyj
  * @Date 2022/6/9 11:01
@@ -16,7 +18,7 @@ import lombok.EqualsAndHashCode;
 @ColumnWidth(16)
 @HeadRowHeight(20)
 @ContentRowHeight(18)
-public class DatumPointxyExcel {
+public class DatumPointxyExcel implements Serializable {
     @ExcelProperty(value = "名称")
     private String name;
     @ExcelProperty(value = "x坐标")

+ 50 - 0
blade-service/blade-business/src/main/java/org/springblade/business/excel/MileageExcel.java

@@ -0,0 +1,50 @@
+package org.springblade.business.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangyj
+ * @Date 2022/6/29 17:29
+ * @description TODO
+ */
+@Data
+@ColumnWidth(16)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class MileageExcel implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @ExcelProperty(value = "类型")
+    private String type;
+    @ExcelProperty(value = "开始里程")
+    private Double value;
+    @ExcelProperty(value = "X")
+    private Double x;
+    @ExcelProperty(value = "Y")
+    private Double y;
+    @ExcelProperty(value = "半径")
+    private Double r;
+    @ExcelProperty(value = "转向")
+    private String swing;
+    @ExcelProperty(value = "线长度")
+    private Double l;
+    @ExcelProperty(value = "方位角(度)")
+    private Integer du;
+    @ExcelProperty(value = "方位角(分)")
+    private Integer fen;
+    @ExcelProperty(value = "方位角(秒)")
+    private Double miao;
+    @ExcelProperty(value = "断链前里程")
+    private Double dlq;
+    @ExcelProperty(value = "断链后里程")
+    private Double dlh;
+    @ExcelProperty(value = "结束半径")
+    private Double r2;
+    @ExcelProperty(value = "顺序")
+    private Integer orderNum;
+}

+ 0 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/FirstInformationMapper.java

@@ -20,7 +20,6 @@ import org.apache.ibatis.annotations.Param;
 import org.springblade.business.entity.FirstInformation;
 import org.springblade.business.vo.FirstInformationVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import java.util.List;
 
 /**

+ 38 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/FixedFlowLinkMapper.java

@@ -0,0 +1,38 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.FixedFlowLink;
+import org.springblade.business.vo.FixedFlowLinkVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+public interface FixedFlowLinkMapper extends BaseMapper<FixedFlowLink> {
+
+	void deletedByFixedFlowId(@Param("fixedFlowIds") List<Long> fixedFlowIds);
+
+	List<FixedFlowLink> selectFixedFlowLink(@Param("fixedFlowId") String fixedFlowId);
+
+}

+ 37 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/FixedFlowLinkMapper.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.business.mapper.FixedFlowLinkMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="fixedFlowLinkResultMap" type="org.springblade.business.entity.FixedFlowLink">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="fixed_flow_id" property="fixedFlowId"/>
+        <result column="fixed_flow_link" property="fixedFlowLink"/>
+        <result column="fixed_flow_link_user" property="fixedFlowLinkUser"/>
+        <result column="fixed_flow_link_user_name" property="fixedFlowLinkUserName"/>
+        <result column="fixed_flow_link_sort" property="fixedFlowLinkSort"/>
+        <result column="fixed_flow_role" property="fixedFlowRole"/>
+        <result column="fixed_flow_role_name" property="fixedFlowRoleName"/>
+        <result column="project_id" property="projectId"/>
+        <result column="contract_id" property="contractId"/>
+    </resultMap>
+
+    <update id="deletedByFixedFlowId">
+        update u_fixed_flow_link set is_deleted = 1 where fixed_flow_id IN
+        <foreach collection="fixedFlowIds" item="fixedFlowId" open="(" separator="," close=")">
+            #{fixedFlowId}
+        </foreach>
+    </update>
+
+    <select id="selectFixedFlowLink" resultMap="fixedFlowLinkResultMap">
+        select id,fixed_flow_link_user,fixed_flow_link_user_name from u_fixed_flow_link where is_deleted = 0 and fixed_flow_id = #{fixedFlowId} order by fixed_flow_link_sort ASC
+    </select>
+
+</mapper>

+ 24 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/FixedFlowMapper.java

@@ -0,0 +1,24 @@
+package org.springblade.business.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.FixedFlow;
+import org.springblade.business.vo.FixedFlowVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+public interface FixedFlowMapper extends BaseMapper<FixedFlow> {
+
+	Integer countFixedFlow(@Param("vo") FixedFlowVO vo);
+
+	/**
+	 * 分页
+	 */
+	List<FixedFlow> selectFixedFlowPage(@Param("current") Long current, @Param("size") Integer size, @Param("vo") FixedFlowVO vo);
+
+}

+ 26 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/FixedFlowMapper.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.business.mapper.FixedFlowMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="fixedFlowResultMap" type="org.springblade.business.entity.FixedFlow">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="fixed_flow_name" property="fixedFlowName"/>
+    </resultMap>
+
+    <select id="countFixedFlow" resultType="java.lang.Integer">
+        select count(id) from u_fixed_flow where is_deleted = 0
+    </select>
+
+    <select id="selectFixedFlowPage" resultMap="fixedFlowResultMap">
+        select * from u_fixed_flow where is_deleted = 0 order by create_time DESC limit ${current}, ${size}
+    </select>
+
+</mapper>

+ 30 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskMapper.java

@@ -0,0 +1,30 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.mapper;
+
+import org.springblade.business.entity.Task;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 任务审核主表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+public interface TaskMapper extends BaseMapper<Task> {
+
+}

+ 31 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TaskMapper.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.business.mapper.TaskMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="taskResultMap" type="org.springblade.business.entity.Task">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="process_definition_id" property="processDefinitionId"/>
+        <result column="process_instance_id" property="processInstanceId"/>
+        <result column="start_time" property="startTime"/>
+        <result column="end_time" property="endTime"/>
+        <result column="task_name" property="taskName"/>
+        <result column="task_content" property="taskContent"/>
+        <result column="task_user" property="taskUser"/>
+        <result column="fixed_flow_id" property="fixedFlowId"/>
+        <result column="form_data_id" property="formDataId"/>
+        <result column="batch" property="batch"/>
+        <result column="e_visa_status" property="eVisaStatus"/>
+        <result column="e_visa_content" property="eVisaContent"/>
+        <result column="report_user" property="reportUser"/>
+        <result column="report_user_name" property="reportUserName"/>
+    </resultMap>
+
+</mapper>

+ 38 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IFixedFlowLinkService.java

@@ -0,0 +1,38 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service;
+
+import org.springblade.business.entity.FixedFlowLink;
+import org.springblade.business.vo.FixedFlowLinkVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+public interface IFixedFlowLinkService extends BaseService<FixedFlowLink> {
+
+	void deletedByFixedFlowId(String fixedFlowIds);
+
+	List<FixedFlowLink> selectFixedFlowLink(String fixedFlowId);
+
+}

+ 21 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/IFixedFlowService.java

@@ -0,0 +1,21 @@
+package org.springblade.business.service;
+
+import org.springblade.business.entity.FixedFlow;
+import org.springblade.business.vo.FixedFlowVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+public interface IFixedFlowService extends BaseService<FixedFlow> {
+
+	/**
+	 * 分页
+	 */
+	IPage<FixedFlowVO> selectFixedFlowPage(FixedFlowVO vo);
+
+}

+ 33 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/ITaskService.java

@@ -0,0 +1,33 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service;
+
+import org.springblade.business.entity.Task;
+import org.springblade.business.vo.TaskVO;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ * 任务审核主表 服务类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+public interface ITaskService extends BaseService<Task> {
+
+    Boolean startApproval(TaskVO vo);
+
+}

+ 49 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/FixedFlowLinkServiceImpl.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service.impl;
+
+import org.springblade.business.entity.FixedFlowLink;
+import org.springblade.business.vo.FixedFlowLinkVO;
+import org.springblade.business.mapper.FixedFlowLinkMapper;
+import org.springblade.business.service.IFixedFlowLinkService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Service
+public class FixedFlowLinkServiceImpl extends BaseServiceImpl<FixedFlowLinkMapper, FixedFlowLink> implements IFixedFlowLinkService {
+
+	@Override
+	public void deletedByFixedFlowId(String fixedFlowIds) {
+		this.baseMapper.deletedByFixedFlowId(Func.toLongList(fixedFlowIds));
+	}
+
+	@Override
+	public List<FixedFlowLink> selectFixedFlowLink(String fixedFlowId) {
+		return this.baseMapper.selectFixedFlowLink(fixedFlowId);
+	}
+
+}

+ 73 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/FixedFlowServiceImpl.java

@@ -0,0 +1,73 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.AllArgsConstructor;
+import org.springblade.business.entity.FixedFlow;
+import org.springblade.business.entity.FixedFlowLink;
+import org.springblade.business.service.IFixedFlowLinkService;
+import org.springblade.business.vo.FixedFlowVO;
+import org.springblade.business.mapper.FixedFlowMapper;
+import org.springblade.business.service.IFixedFlowService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.mp.support.Condition;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Service
+@AllArgsConstructor
+public class FixedFlowServiceImpl extends BaseServiceImpl<FixedFlowMapper, FixedFlow> implements IFixedFlowService {
+
+	private final IFixedFlowLinkService fixedFlowLinkService;
+
+	@Override
+	public IPage<FixedFlowVO> selectFixedFlowPage(FixedFlowVO vo) {
+		IPage<FixedFlowVO> iPage = Condition.getPage(vo.getQuery(vo.getCurrent(), vo.getSize()));
+		long current = (vo.getCurrent() - 1) * vo.getSize();
+		//统计
+		Integer count = this.baseMapper.countFixedFlow(vo);
+		//查询分页数据
+		List<FixedFlow> result = this.baseMapper.selectFixedFlowPage(current, vo.getSize(), vo);
+		List<FixedFlowVO> resultVO = JSONArray.parseArray(JSONObject.toJSONString(result), FixedFlowVO.class);
+		//查询环节信息
+		resultVO.forEach(vos -> {
+			List<FixedFlowLink> links = this.fixedFlowLinkService.selectFixedFlowLink(vos.getId().toString());
+			if(links != null && links.size() > 0){
+				//拼接环节
+				StringBuilder linkJoin = new StringBuilder();
+				links.forEach(link -> linkJoin.append(",").append(link.getFixedFlowLinkUserName()));
+				//去掉第一个逗号
+				vos.setLinkUserJoinString(linkJoin.toString().substring(1));
+			}
+		});
+		//设置总数
+		iPage.setTotal(count);
+
+		return iPage.setRecords(resultVO);
+	}
+
+}

+ 59 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -0,0 +1,59 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.service.impl;
+
+import org.apache.commons.lang.time.DateUtils;
+import org.springblade.business.entity.Task;
+import org.springblade.business.mapper.TaskMapper;
+import org.springblade.business.service.ITaskService;
+import org.springblade.business.vo.TaskVO;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.flow.core.constant.ProcessConstant;
+import org.springblade.flow.core.utils.FlowUtil;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+/**
+ * 任务审核主表 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-07-01
+ */
+@Service
+public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implements ITaskService {
+
+    @Override
+    public Boolean startApproval(TaskVO vo) {
+        //获取业务表
+        String businessTable = FlowUtil.getBusinessTable(ProcessConstant.EXAMINATION_AND_APPROVAL);
+        if(Func.isEmpty(vo.getId())){
+            //bean Copy
+            Task task = new Task();
+            BeanUtils.copyProperties(vo, task);
+            //设置开始/结束时间
+            Date nowTime = new Date();
+            task.setStartTime(DateUtil.format(nowTime, "yyyy-MM-dd"));
+            task.setEndTime(DateUtil.format(DateUtils.addDays(nowTime, vo.getRestrictDay()), "yyyy-MM-dd"));
+
+        }
+        return null;
+    }
+}

+ 21 - 2
blade-service/blade-manager/src/main/java/com/mixsmart/utils/CustomFunction.java

@@ -798,7 +798,8 @@ public class CustomFunction {
 	public static Object avg( List<Object> list) {
 		 if(list!=null){
 			 if(list.stream().noneMatch(CustomFunction::isNotNumber)){
-			       return list.stream().map(String::valueOf).mapToDouble(Double::parseDouble).average();
+				   OptionalDouble opd =  list.stream().map(String::valueOf).mapToDouble(Double::parseDouble).average();
+			       return  opd.orElse(0);
 			 }
 		 }
 	     return null;
@@ -2051,6 +2052,24 @@ public class CustomFunction {
 		 ari=ari.toString().replace("X",designv.toString());
          return  Expression.parse(ari.toString()).calculate().toString();
 	}
+
+	public static Object ifelse(Object b,Object t,Object f){
+		if(b!=null&&Func.isNotBlank(b.toString())){
+			String s = b.toString();
+			boolean fi  = true;
+			if(s.contains("<")&&s.contains(">")){
+				 String[] arr=s.split("&&");
+				 for(String e:arr){
+					 if(!Boolean.parseBoolean(Expression.parse(e).calculate())){
+					 	fi=false;
+					 	break;
+					 };
+				 }
+			}
+			return fi?t:f;
+		}
+        return t;
+	}
 	/**
 	 * @Description  空白或者/都判断为空
 	 * @Param [data]
@@ -2202,7 +2221,7 @@ public class CustomFunction {
 		if(CollectionUtil.isNotEmpty(nodes)&& Func.isNotBlank(param)){
 			List<String> result = new ArrayList<>();
 			param=param.replaceAll("(?i:c)","");
-			List<String> list = Arrays.asList(param.split("-"));
+			List<String> list = Arrays.asList(param.split("[^.\\d]"));
 			List<Integer> index =list.stream().map(Integer::parseInt).collect(Collectors.toList());
 			for(Integer i:index){
 				result.add(nodes.get(i));

+ 40 - 22
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -46,8 +46,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             List<FormData>total = new ArrayList<>();
             /*用来保存所有变量*/
             Map<String,Object> variables = new HashMap<>();
-
-            Map<String,Object> currentMap = new HashMap<>();
+            Map<String,Object> constantMap = new HashMap<>();
             /*预设变量start*/
             List<WbsTree> trees = new ArrayList<>();
             for(int i=0;i<6;i++){
@@ -77,10 +76,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
              }
 
             if(CollectionUtil.isNotEmpty(total)){
-                currentMap.put(WP,wpMap);
-                currentMap.put(CHAIN,trees.stream().map(WbsTree::getDeptName).collect(Collectors.toList()));
-                Map<String,Object> E=new HashMap<>();
-                currentMap.put("E",E);
+                constantMap.put(WP,wpMap);
+                constantMap.put(CHAIN,trees.stream().map(WbsTree::getDeptName).collect(Collectors.toList()));
                 for(FormData fd:total){
                       /*存入数据*/
                       if(CollectionUtil.isNotEmpty(fd.getValues())){
@@ -88,7 +85,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                            for(int i=0;i<fd.getValues().size();i++){
                               tmpMap.put("p"+i,fd.getValues().get(i));
                            }
-                          E.put(fd.getCode(),fd.getValues().get(0));
                            Map<String,Object> tableMap = (Map<String, Object>) variables.get(fd.getCode());
                            if(tableMap==null){
                                tableMap= new HashMap<>();
@@ -104,55 +100,77 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
                         tmp= tmp.replace(m.group(),"'"+m.group()+"'");
                       }
                        Matcher m2 = P.matcher(tmp);
-                    while (m2.find()){
-                        tmp= tmp.replace(m2.group(),"'"+m2.group()+"'");
-                    }
-                      fd.getFormula().setFormula(tmp);
+                      while (m2.find()){
+                          tmp= tmp.replace(m2.group(),"'"+m2.group()+"'");
+                          fd.getRely().add(m2.group());
+                      }
+                        fd.getFormula().setFormula(tmp);
                 }
                 /*执行公式*/
                 /*集合公式预处理*/
                 for(FormData fd:total){
                     String formula=fd.getFormula().getFormula();
+                    Map<String,Object> currentMap = new HashMap<>(constantMap);
+                    currentMap.put("E",variables);
                     if(formula.contains(CustomFunction.CLASS_CALL+"avg(")||formula.contains(CustomFunction.CLASS_CALL+"min(")||formula.contains(CustomFunction.CLASS_CALL+"max(")||formula.contains(CustomFunction.CLASS_CALL+"sum(")){
                         Matcher m = POLY.matcher(formula);
                         while (m.find()){
-                            Object data =   Expression.parse(m.group()).calculate(currentMap);
-                            formula = formula.replace(m.group(),data.toString());
+                            Object data =   Expression.parse(CustomFunction.CLASS_CALL+m.group()).calculate(currentMap);
+                            formula = formula.replace(CustomFunction.CLASS_CALL+m.group(),data.toString());
+                            fd.getFormula().setFormula(formula);
                         }
                     }
                 }
                 for(FormData fd:total){
                     if(Func.isNotBlank(fd.getFormula().getFormula())){
-                        Object data =   Expression.parse(fd.getFormula().getFormula()).calculate(currentMap);
-                        fd.getValues().add(new ArrayList<>(Collections.singletonList(data)));
+                           Map<String, Object> currentMap = new HashMap<>();
+                           Map<String,Object> elementMap = getMap(variables,"E");
+                           Map<String,Object> tmp = getMap(currentMap,"E");
+                           for(String key:fd.getRely()){
+                               tmp.put(key,elementMap.get(key));
+                           }
+                          System.out.println(slice(currentMap,constantMap,fd.getFormula().getFormula()));
                     }
                 }
             }
         System.out.println("执行结束");
     }
 
+    public  Map<String,Object> getMap(Map<String,Object> variables,String key){
+        Map<String,Object> CNDMap = (Map<String, Object>) variables.get(key);
+        if(CNDMap==null){
+            CNDMap = new HashMap<>();
+            variables.put(key,CNDMap);
+        }
+        CNDMap.put("A",100);
+        return CNDMap;
+    }
 
-    public static List<Object> slice(Map<String,Object> variables,String formula){
-        int min =0;
+    public  List<Object> slice(Map<String,Object> variables,Map<String,Object> constantMap,String formula){
+        int min =1;
         List<Object> result = new ArrayList<>();
         Map<String,Object> currentMap = new HashMap<>();
         Map<String,List<Object>> massMap = new HashMap<>();
-        for(Map.Entry<String,Object> entry:variables.entrySet()){
+        Map<String,Object> E=getMap(variables,"E");
+        Map<String,Object> E2=getMap(currentMap,"E");
+
+        for(Map.Entry<String,Object> entry:E.entrySet()){
                 if(entry.getValue() instanceof  List){
                     List<Object> tmp = (List<Object>) entry.getValue();
-                    if(min==0){
-                        min=tmp.size();
+                    if(min==1){
+                        min= Math.max(tmp.size(), 1);
                     }else{
                         min= Math.min(min,tmp.size());
                     }
                     massMap.put(entry.getKey(),tmp);
                 }else{
-                    currentMap.put(entry.getKey(),entry.getValue());
+                    E2.put(entry.getKey(),entry.getValue());
                 }
         }
+         currentMap.putAll(constantMap);
         for(int i=0;i<min;i++){
             for(Map.Entry<String,List<Object>> e:massMap.entrySet()){
-                currentMap.put(e.getKey(),e.getValue().get(i));
+                E2.put(e.getKey(),e.getValue().get(i));
             }
             Object data  = Expression.parse(formula).calculate(currentMap);
             result.add(data);