diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/common/utility/FlowUtility.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/common/utility/FlowUtility.java new file mode 100644 index 00000000..4ff07914 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/common/utility/FlowUtility.java @@ -0,0 +1,36 @@ +package com.jero.modules.activiti.process.common.utility; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @ClassName: FlowUtility + * @Description: + * @Author: yjz + * @Date: 2024-06-24 16:08 + * @Version: 1.0 + **/ +public class FlowUtility { + + /** + * 将Map中值为List类型的元素转换为以逗号分隔的字符串。 + * 这个方法遍历输入的Map,如果发现任何值是List类型,则将这个List转换为一个以逗号分隔的字符串。 + * 这样做可以简化Map的表示,尤其是当List中包含许多元素时。 + * + * @param map 原始的Map,可能包含值为List类型的元素。 + * @return 返回一个新的Map,其中所有值为List类型的元素都被转换为字符串。 + */ + public static Map listToString(Map map) { + // 使用流式编程来处理Map的每个条目 + return map.entrySet().stream().map(v -> { + // 检查当前条目的值是否为List类型 + if (v.getValue() instanceof List) { + // 如果是List类型,则将其转换为以逗号分隔的字符串 + v.setValue(String.join(",", (List) v.getValue())); + } + // 返回转换后的条目 + return v; + }).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + } +} diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/common/standardInterpret.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/common/standardInterpret.java new file mode 100644 index 00000000..d056ffcc --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/common/standardInterpret.java @@ -0,0 +1,19 @@ +package com.jero.modules.activiti.process.standardinterpret.common; + +/** + * @ClassName: standardInterpret + * @Description: + * @Author: yjz + * @Date: 2024-06-24 15:08 + * @Version: 1.0 + **/ +public class standardInterpret { + private standardInterpret(){ + + } + + /** + * 标准解读流程key + */ + public static final String KEY = "standard_interpret"; +} diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/ProcessStandardInterpretClauseController.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/ProcessStandardInterpretClauseController.java new file mode 100644 index 00000000..a24cf688 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/ProcessStandardInterpretClauseController.java @@ -0,0 +1,20 @@ +package com.jero.modules.activiti.process.standardinterpret.controller; + + +import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretClauseService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.RestController; + +/** + * 标准解读流程_条款中间表(ProcessStandardInterpretClause)表控制层 + * + * @author makejava + * @since 2024-06-24 14:46:05 + */ +@RestController("/processStandardInterpretClause") +@RequiredArgsConstructor +public class ProcessStandardInterpretClauseController { + + private ProcessStandardInterpretClauseService processStandardInterpretClauseService; +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/ProcessStandardInterpretClauseSublistController.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/ProcessStandardInterpretClauseSublistController.java new file mode 100644 index 00000000..7c4ddc7d --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/ProcessStandardInterpretClauseSublistController.java @@ -0,0 +1,21 @@ +package com.jero.modules.activiti.process.standardinterpret.controller; + + +import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretClauseSublistService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.RestController; + +/** + * 标准解读流程_条款中间表_子表(ProcessStandardInterpretClauseSublist)表控制层 + * + * @author makejava + * @since 2024-06-24 14:47:59 + */ +@RestController("/processStandardInterpretClauseSublist") +@RequiredArgsConstructor +public class ProcessStandardInterpretClauseSublistController { + + private ProcessStandardInterpretClauseSublistService processStandardInterpretClauseSublistService; + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/ProcessStandardInterpretController.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/ProcessStandardInterpretController.java new file mode 100644 index 00000000..8cf1ed18 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/ProcessStandardInterpretController.java @@ -0,0 +1,21 @@ +package com.jero.modules.activiti.process.standardinterpret.controller; + + +import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.RestController; + +/** + * 标准解读流程(ProcessStandardInterpret)表控制层 + * + * @author makejava + * @since 2024-06-24 14:41:16 + */ +@RequiredArgsConstructor +@RestController("/processStandardInterpret") +public class ProcessStandardInterpretController { + + private ProcessStandardInterpretService processStandardInterpretService; + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/StandardInterpretFlowController.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/StandardInterpretFlowController.java new file mode 100644 index 00000000..f3a4b731 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/StandardInterpretFlowController.java @@ -0,0 +1,57 @@ +package com.jero.modules.activiti.process.standardinterpret.controller; + +import com.jero.common.api.vo.Result; +import com.jero.common.api.vo.ResultCommon; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.common.constant.CommonConstant; +import com.jero.common.util.MessageUtils; +import com.jero.common.util.SnowflakeUtils; +import com.jero.modules.activiti.process.standardinterpret.dto.StandardInterpretFlowDTO; +import com.jero.modules.activiti.process.standardinterpret.service.StandardInterpretFlowService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.web.bind.annotation.*; + +/** + * @ClassName: 标准解读流程 + * @Description: + * @Author: yjz + * @Date: 2024-06-24 15:06 + * @Version: 1.0 + **/ +@Api(tags="标准解读流程") +@Slf4j +@RequiredArgsConstructor +@RestController +@RequestMapping("/process/standardInterpretFlow") +public class StandardInterpretFlowController { + + private StandardInterpretFlowService standardInterpretFlowService; + + /** + * 标准解读流程-生成项目id + * @return 项目id + */ + @AutoLog(value = "标准解读流程-生成项目id", operateType = CommonConstant.OPERATE_TYPE_1) + @ApiOperation(value="标准解读流程-生成项目id", notes="标准解读流程-生成项目id") + @GetMapping(value = "/getProjectId") + public String getProjectId() { + return String.valueOf(SnowflakeUtils.snowflake()); + } + + /** + * 标准解读流程-流程发起 + * @param standardInterpretFlowDTO 企标稽查计划流程VO对象 + * @return 结果对象 + */ + @AutoLog(value = "标准解读流程-流程发起") + @ApiOperation(value="标准解读流程-流程发起", notes="标准解读流程-流程发起") + @PostMapping(value = "/flowStart") + public Result flowStart(@RequestBody StandardInterpretFlowDTO standardInterpretFlowDTO) { + standardInterpretFlowService.flowStart(standardInterpretFlowDTO); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } +} diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretDTO.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretDTO.java new file mode 100644 index 00000000..d573aaf6 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretDTO.java @@ -0,0 +1,27 @@ +package com.jero.modules.activiti.process.standardinterpret.dto; + +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpret; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @ClassName: StandardInterpretDTO + * @Description: + * @Author: yjz + * @Date: 2024-06-24 15:29 + * @Version: 1.0 + **/ +@Data +public class StandardInterpretDTO implements Serializable { + /**标准解读流程*/ + @ApiModelProperty(value = "流程信息") + private ProcessStandardInterpret processStandardInterpret; + + /**标准解读流程_条款中间表*/ + @ApiModelProperty(value = "标准解读流程_条款中间表") + private List processStandardInterpretClauseList; +} diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretFlowDTO.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretFlowDTO.java new file mode 100644 index 00000000..00ae276b --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretFlowDTO.java @@ -0,0 +1,36 @@ +package com.jero.modules.activiti.process.standardinterpret.dto; + +import com.jero.modules.activiti.entity.ProcessAll; +import com.jero.modules.activiti.entity.ProcessApprovalRecord; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Map; + +/** + * @ClassName: StandardInterpretDTO + * @Description: + * @Author: yjz + * @Date: 2024-06-24 15:17 + * @Version: 1.0 + **/ +@Data +public class StandardInterpretFlowDTO implements Serializable { + + /**流程信息*/ + @ApiModelProperty(value = "流程信息") + private ProcessAll processAll; + + /**流程审批信息*/ + @ApiModelProperty(value = "流程审批信息") + private ProcessApprovalRecord processApprovalRecord; + + /**业务信息*/ + @ApiModelProperty(value = "业务信息") + private StandardInterpretDTO data; + + /**map(参数)*/ + @ApiModelProperty(value = "map(参数)") + private Map map; +} diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpret.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpret.java new file mode 100644 index 00000000..b9cd4d7f --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpret.java @@ -0,0 +1,44 @@ +package com.jero.modules.activiti.process.standardinterpret.entity; + + +import com.jero.modules.laws.documenttool.entity.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 标准解读流程(ProcessStandardInterpret)表实体类 + * + * @author makejava + * @since 2024-06-24 14:41:18 + */ +@Data +public class ProcessStandardInterpret extends BaseEntity { + /**主解读人*/ + @ApiModelProperty(value = "主解读人") + private String masterInterpretId; + /**父id*/ + @ApiModelProperty(value = "父id") + private String parentId; + /**标准id*/ + @ApiModelProperty(value = "标准id") + private String standardId; + /**项目id*/ + @ApiModelProperty(value = "项目id") + private String projectId; + /**分解单来源(字典)*/ + @ApiModelProperty(value = "分解单来源(字典)") + private String decompositionSource; + /**是否下发(字典:1:是,2:否)*/ + @ApiModelProperty(value = "是否下发(字典:1:是,2:否)") + private String isDistribute; + /**会签人员*/ + @ApiModelProperty(value = "会签人员") + private String countersignPersonIds; + /**审核人员*/ + @ApiModelProperty(value = "审核人员") + private String uploader; + /**批准人员*/ + @ApiModelProperty(value = "批准人员") + private String approvePersonId; +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClause.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClause.java new file mode 100644 index 00000000..13c67e2c --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClause.java @@ -0,0 +1,29 @@ +package com.jero.modules.activiti.process.standardinterpret.entity; + + +import com.jero.modules.laws.documenttool.entity.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 标准解读流程_条款中间表(ProcessStandardInterpretClause)表实体类 + * + * @author makejava + * @since 2024-06-24 14:46:07 + */ +@Data +public class ProcessStandardInterpretClause extends BaseEntity { + /**标准解读流程id*/ + @ApiModelProperty(value = "标准解读流程id") + private String standardInterpretId; + /**条款id/标准id*/ + @ApiModelProperty(value = "条款id/标准id") + private String clauseId; + /**各涉及部门解读人*/ + @ApiModelProperty(value = "各涉及部门解读人") + private String interpretPersonIds; + /**分解单来源(字典)*/ + @ApiModelProperty(value = "分解单来源(字典)") + private String decompositionSource; +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClauseSublist.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClauseSublist.java new file mode 100644 index 00000000..133c579a --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClauseSublist.java @@ -0,0 +1,113 @@ +package com.jero.modules.activiti.process.standardinterpret.entity; + + +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 标准解读流程_条款中间表_子表(ProcessStandardInterpretClauseSublist)表实体类 + * + * @author makejava + * @since 2024-06-24 14:47:59 + */ +@Data +public class ProcessStandardInterpretClauseSublist extends Model { + /**标准解读流程_条款中间表id*/ + @ApiModelProperty(value = "标准解读流程_条款中间表id") + private String standardInterpretClauseId; + /**条款id*/ + @ApiModelProperty(value = "条款id") + private String clauseId; + /**解读人*/ + @ApiModelProperty(value = "解读人") + private String interpretPersonId; + /**译文*/ + @ApiModelProperty(value = "译文") + private String translation; + /**是否与上一版相同(字典:1:是,0:否)*/ + @ApiModelProperty(value = "是否与上一版相同(字典:1:是,0:否)") + private String isSameAsPrevVersion; + /**变化点说明*/ + @ApiModelProperty(value = "变化点说明") + private String changeDescription; + /**法规注释*/ + @ApiModelProperty(value = "法规注释") + private String regulatoryNotes; + /**关键词*/ + @ApiModelProperty(value = "关键词") + private String keywords; + /**适用零部件*/ + @ApiModelProperty(value = "适用零部件") + private String applicableComponents; + /**责任部门*/ + @ApiModelProperty(value = "责任部门") + private String responsibleDepartment; + /**责任部门专业模块*/ + @ApiModelProperty(value = "责任部门专业模块") + private String responsibleModule; + /**关联部门*/ + @ApiModelProperty(value = "关联部门") + private String relatedDepartment; + /**关联部门专业模块*/ + @ApiModelProperty(value = "关联部门专业模块") + private String relatedModule; + /**适用车型*/ + @ApiModelProperty(value = "适用车型") + private String applications; + /**动力类型*/ + @ApiModelProperty(value = "动力类型") + private String powerType; + /**专业领域*/ + @ApiModelProperty(value = "专业领域") + private String domainArea; + /**配置需求*/ + @ApiModelProperty(value = "配置需求") + private String configurationRequirements; + /**新认证实施日期*/ + @ApiModelProperty(value = "新认证实施日期") + private String newCerImplementDate; + /**新生产车实施日期*/ + @ApiModelProperty(value = "新生产车实施日期") + private String newProductionImplementation; + /**注册日期*/ + @ApiModelProperty(value = "注册日期") + private String registrationDate; + /**企业标准*/ + @ApiModelProperty(value = "企业标准") + private String enterpriseStandard; + /**技术规范/设计指南*/ + @ApiModelProperty(value = "技术规范/设计指南") + private String technicalSpecificationDesignGuide; + /**图纸模板*/ + @ApiModelProperty(value = "图纸模板") + private String drawingTemplate; + /**技术协议模板*/ + @ApiModelProperty(value = "技术协议模板") + private String technicalAgreementTemplate; + /**校验报告模块/checklist*/ + @ApiModelProperty(value = "校验报告模块/checklist") + private String verificationReportTemplateChecklist; + /**DVP模板*/ + @ApiModelProperty(value = "DVP模板") + private String dvpTemplate; + /**DFEMA*/ + @ApiModelProperty(value = "DFEMA") + private String dfema; + /**关键技术分解表*/ + @ApiModelProperty(value = "关键技术分解表") + private String keyTechnologyDecompositionTable; + /**其他文件或模板*/ + @ApiModelProperty(value = "其他文件或模板") + private String otherDocumentsTemplates; + /**p3*/ + @ApiModelProperty(value = "p3") + private String p3; + /**p5*/ + @ApiModelProperty(value = "p5") + private String p5; + /**备注*/ + @ApiModelProperty(value = "备注") + private String remarks; +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseMapper.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseMapper.java new file mode 100644 index 00000000..4bba399c --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseMapper.java @@ -0,0 +1,15 @@ +package com.jero.modules.activiti.process.standardinterpret.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause; + +/** + * 标准解读流程_条款中间表(ProcessStandardInterpretClause)表数据库访问层 + * + * @author makejava + * @since 2024-06-24 14:46:05 + */ +public interface ProcessStandardInterpretClauseMapper extends BaseMapper { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseSublistMapper.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseSublistMapper.java new file mode 100644 index 00000000..b8dbc419 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretClauseSublistMapper.java @@ -0,0 +1,15 @@ +package com.jero.modules.activiti.process.standardinterpret.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClauseSublist; + +/** + * 标准解读流程_条款中间表_子表(ProcessStandardInterpretClauseSublist)表数据库访问层 + * + * @author makejava + * @since 2024-06-24 14:47:59 + */ +public interface ProcessStandardInterpretClauseSublistMapper extends BaseMapper { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretMapper.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretMapper.java new file mode 100644 index 00000000..2752703c --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/ProcessStandardInterpretMapper.java @@ -0,0 +1,15 @@ +package com.jero.modules.activiti.process.standardinterpret.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpret; + +/** + * 标准解读流程(ProcessStandardInterpret)表数据库访问层 + * + * @author makejava + * @since 2024-06-24 14:41:17 + */ +public interface ProcessStandardInterpretMapper extends BaseMapper { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml new file mode 100644 index 00000000..2c7b9753 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseSublistMapper.xml b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseSublistMapper.xml new file mode 100644 index 00000000..fb4a7c12 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseSublistMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretMapper.xml b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretMapper.xml new file mode 100644 index 00000000..b88df108 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseService.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseService.java new file mode 100644 index 00000000..3f399238 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseService.java @@ -0,0 +1,15 @@ +package com.jero.modules.activiti.process.standardinterpret.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause; + +/** + * 标准解读流程_条款中间表(ProcessStandardInterpretClause)表服务接口 + * + * @author makejava + * @since 2024-06-24 14:46:07 + */ +public interface ProcessStandardInterpretClauseService extends IService { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseSublistService.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseSublistService.java new file mode 100644 index 00000000..b836d34d --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretClauseSublistService.java @@ -0,0 +1,15 @@ +package com.jero.modules.activiti.process.standardinterpret.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClauseSublist; + +/** + * 标准解读流程_条款中间表_子表(ProcessStandardInterpretClauseSublist)表服务接口 + * + * @author makejava + * @since 2024-06-24 14:47:59 + */ +public interface ProcessStandardInterpretClauseSublistService extends IService { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretService.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretService.java new file mode 100644 index 00000000..e8e6a548 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/ProcessStandardInterpretService.java @@ -0,0 +1,15 @@ +package com.jero.modules.activiti.process.standardinterpret.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpret; + +/** + * 标准解读流程(ProcessStandardInterpret)表服务接口 + * + * @author makejava + * @since 2024-06-24 14:41:19 + */ +public interface ProcessStandardInterpretService extends IService { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/StandardInterpretFlowService.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/StandardInterpretFlowService.java new file mode 100644 index 00000000..d97b763f --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/StandardInterpretFlowService.java @@ -0,0 +1,18 @@ +package com.jero.modules.activiti.process.standardinterpret.service; + +import com.jero.modules.activiti.process.standardinterpret.dto.StandardInterpretFlowDTO; + +/** + * @InterfaceName: StandardInterpretFlowServicce + * @Description: + * @Author: yjz + * @Date: 2024-06-24 16:04 + * @Version: 1.0 + **/ +public interface StandardInterpretFlowService { + /** + * standardInterpretFlowDTO + * @param standardInterpretFlowDTO + */ + void flowStart(StandardInterpretFlowDTO standardInterpretFlowDTO); +} diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseServiceImpl.java new file mode 100644 index 00000000..2f12f4dd --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseServiceImpl.java @@ -0,0 +1,25 @@ +package com.jero.modules.activiti.process.standardinterpret.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause; +import com.jero.modules.activiti.process.standardinterpret.mapper.ProcessStandardInterpretClauseMapper; +import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretClauseService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 标准解读流程_条款中间表(ProcessStandardInterpretClause)表服务实现类 + * + * @author makejava + * @since 2024-06-24 14:46:07 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class ProcessStandardInterpretClauseServiceImpl + extends ServiceImpl + implements ProcessStandardInterpretClauseService { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseSublistServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseSublistServiceImpl.java new file mode 100644 index 00000000..6dc51058 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseSublistServiceImpl.java @@ -0,0 +1,22 @@ +package com.jero.modules.activiti.process.standardinterpret.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.modules.activiti.process.standardinterpret.mapper.ProcessStandardInterpretClauseSublistMapper; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClauseSublist; +import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretClauseSublistService; +import org.springframework.stereotype.Service; + +/** + * 标准解读流程_条款中间表_子表(ProcessStandardInterpretClauseSublist)表服务实现类 + * + * @author makejava + * @since 2024-06-24 14:48:00 + */ +@Service +public class ProcessStandardInterpretClauseSublistServiceImpl + extends ServiceImpl + implements ProcessStandardInterpretClauseSublistService { + + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretServiceImpl.java new file mode 100644 index 00000000..9c14ffa0 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretServiceImpl.java @@ -0,0 +1,21 @@ +package com.jero.modules.activiti.process.standardinterpret.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.modules.activiti.process.standardinterpret.mapper.ProcessStandardInterpretMapper; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpret; +import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretService; +import org.springframework.stereotype.Service; + +/** + * 标准解读流程(ProcessStandardInterpret)表服务实现类 + * + * @author makejava + * @since 2024-06-24 14:41:19 + */ +@Service +public class ProcessStandardInterpretServiceImpl + extends ServiceImpl + implements ProcessStandardInterpretService { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlowServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlowServiceImpl.java new file mode 100644 index 00000000..e8b4da10 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlowServiceImpl.java @@ -0,0 +1,137 @@ +package com.jero.modules.activiti.process.standardinterpret.service.impl; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.jero.common.system.vo.LoginUser; +import com.jero.common.util.SnowflakeUtils; +import com.jero.modules.activiti.entity.ProcessAll; +import com.jero.modules.activiti.entity.ProcessApprovalRecord; +import com.jero.modules.activiti.enums.FinishFlagEnum; +import com.jero.modules.activiti.enums.ProcessStatusEnum; +import com.jero.modules.activiti.process.common.enums.ProcessType; +import com.jero.modules.activiti.process.common.utility.FlowUtility; +import com.jero.modules.activiti.process.standardinterpret.common.standardInterpret; +import com.jero.modules.activiti.process.standardinterpret.dto.StandardInterpretDTO; +import com.jero.modules.activiti.process.standardinterpret.dto.StandardInterpretFlowDTO; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpret; +import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause; +import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretClauseService; +import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretService; +import com.jero.modules.activiti.process.standardinterpret.service.StandardInterpretFlowService; +import com.jero.modules.activiti.service.ProcessAllService; +import com.jero.modules.activiti.service.ProcessApprovalRecordService; +import com.jero.modules.activiti.service.ProcessNodeLinkService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.activiti.engine.RuntimeService; +import org.activiti.engine.TaskService; +import org.activiti.engine.runtime.ProcessInstance; +import org.activiti.engine.task.Task; +import org.apache.shiro.SecurityUtils; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: StandardInterpretFlowServiceImpl + * @Description: + * @Author: yjz + * @Date: 2024-06-24 16:04 + * @Version: 1.0 + **/ +@Service +@Slf4j +@RequiredArgsConstructor +public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowService { + + private RuntimeService runtimeService; + private TaskService taskService; + private ProcessAllService processAllService; + private ProcessApprovalRecordService processApprovalRecordService; + private ProcessNodeLinkService processNodeLinkService; + private ProcessStandardInterpretService processStandardInterpretService; + private ProcessStandardInterpretClauseService processStandardInterpretClauseService; + + @Override + public void flowStart(StandardInterpretFlowDTO standardInterpretFlowDTO) { + log.info("标准解读流程-流程发起 开始"); + // 流程信息 + ProcessAll processAll = standardInterpretFlowDTO.getProcessAll(); + // 流程审批信息 + ProcessApprovalRecord processApprovalRecord = standardInterpretFlowDTO.getProcessApprovalRecord(); + // map(参数) + Map map = standardInterpretFlowDTO.getMap(); + + // 根据流程key启动流程,设置流程变量,更新流程总表信息,更新流程审批信息,返回任务信息 + Task task = startProcessInstanceByKey(standardInterpret.KEY, map, processAll, processApprovalRecord); + + // 处理业务信息 + handleBusinessData(standardInterpretFlowDTO); + + // 自动完成第一个节点 + taskService.complete(task.getId()); + log.info("标准解读流程-流程发起 结束"); + } + + private void handleBusinessData(StandardInterpretFlowDTO standardInterpretFlowDTO) { + StandardInterpretDTO data = standardInterpretFlowDTO.getData(); + // 标准解读流程 + ProcessStandardInterpret processStandardInterpret = data.getProcessStandardInterpret(); + processStandardInterpretService.saveOrUpdate(processStandardInterpret); + + // 标准解读流程_条款中间表 + List processStandardInterpretClauseList = + data.getProcessStandardInterpretClauseList(); + for (ProcessStandardInterpretClause processStandardInterpretClause : processStandardInterpretClauseList) { + processStandardInterpretClause.setId(String.valueOf(SnowflakeUtils.snowflake())); + processStandardInterpretClause.setStandardInterpretId(processStandardInterpret.getId()); + } + processStandardInterpretClauseService.saveOrUpdateBatch(processStandardInterpretClauseList); + } + + private Task startProcessInstanceByKey(String key, Map map, ProcessAll processAll, + ProcessApprovalRecord processApprovalRecord) { + // 启动流程 + ProcessInstance processInstance = runtimeService + .startProcessInstanceByKey(key); + // 设置流程变量 + runtimeService.setVariables(processInstance.getId(), map); + + // 更新流程总表信息 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + processAll.setPrcType(Integer.valueOf(ProcessType.ES_INSPECT_REPORT.getValue())); + DateTime date = DateUtil.date(); + processAll.setPrcNum(DateUtil.format(date, DatePattern.PURE_DATETIME_MS_PATTERN)); + processAll.setPrcStatus(ProcessStatusEnum.INCOMPLETE.getValue()); + processAll.setCreateUserId(loginUser.getId()); + processAllService.update(processAll, + new LambdaUpdateWrapper() + .eq(ProcessAll::getProcessInstanceId, processInstance.getId())); + + // 根据流程实例id查询任务信息 + Task task = taskService.createTaskQuery() + .processInstanceId(processInstance.getId()) + .singleResult(); + + // 更新流程审批信息 + processApprovalRecord.setUserId(loginUser.getId()); + processApprovalRecord.setProjectId(processAll.getProjectId()); + processApprovalRecord.setFinishFlag(FinishFlagEnum.COMPLETE.getValue()); + processApprovalRecord.setEndTime(new Date()); + processApprovalRecordService.update(processApprovalRecord, + new LambdaUpdateWrapper() + .eq(ProcessApprovalRecord::getTaskId, task.getId())); + + // 新增流程实例节点关联用户表信息 + processNodeLinkService.saveNodeUserLink(processInstance.getProcessDefinitionId(), processInstance.getId() + , FlowUtility.listToString(map)); + + // 返回任务信息 + return task; + } + +}