Commit 48fb41dcf078d6685a356c394c0cc0d28a4b12b9
1 parent
f8cea7e4
m
Showing
10 changed files
with
160 additions
and
26 deletions
trash-ui/dist.7z
No preview for this file type
trash-ui/src/views/h5/threestep/index.vue
| @@ -30,17 +30,18 @@ | @@ -30,17 +30,18 @@ | ||
| 30 | format="yyyy-MM-dd HH:mm:ss" | 30 | format="yyyy-MM-dd HH:mm:ss" |
| 31 | value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束时间"> | 31 | value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束时间"> |
| 32 | </el-date-picker> | 32 | </el-date-picker> |
| 33 | - </el-form-item> | ||
| 34 | - <el-form-item> | ||
| 35 | - <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> | ||
| 36 | - <el-button size="mini" @click="resetQuery">重置</el-button> | ||
| 37 | </el-form-item> | 33 | </el-form-item> |
| 34 | + | ||
| 38 | <el-form-item label="抽查状态" prop="checkStatus" v-if="this.queryParams.his==1"> | 35 | <el-form-item label="抽查状态" prop="checkStatus" v-if="this.queryParams.his==1"> |
| 39 | <el-select v-model="queryParams.checkStatus" placeholder="请选择抽查状态" size="small"> | 36 | <el-select v-model="queryParams.checkStatus" placeholder="请选择抽查状态" size="small"> |
| 40 | <el-option label="未抽查" value="0" /> | 37 | <el-option label="未抽查" value="0" /> |
| 41 | <el-option label="已抽查" value="1" /> | 38 | <el-option label="已抽查" value="1" /> |
| 42 | </el-select> | 39 | </el-select> |
| 43 | </el-form-item> | 40 | </el-form-item> |
| 41 | + <el-form-item> | ||
| 42 | + <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> | ||
| 43 | + <el-button size="mini" @click="resetQuery">重置</el-button> | ||
| 44 | + </el-form-item> | ||
| 44 | </el-form> | 45 | </el-form> |
| 45 | 46 | ||
| 46 | <el-row :gutter="10" class="mb8"> | 47 | <el-row :gutter="10" class="mb8"> |
trash-unit/pom.xml
| @@ -20,5 +20,10 @@ | @@ -20,5 +20,10 @@ | ||
| 20 | <groupId>com.trash</groupId> | 20 | <groupId>com.trash</groupId> |
| 21 | <artifactId>trash-common</artifactId> | 21 | <artifactId>trash-common</artifactId> |
| 22 | </dependency> | 22 | </dependency> |
| 23 | + | ||
| 24 | + <dependency> | ||
| 25 | + <groupId>com.trash</groupId> | ||
| 26 | + <artifactId>trash-workflow</artifactId> | ||
| 27 | + </dependency> | ||
| 23 | </dependencies> | 28 | </dependencies> |
| 24 | </project> | 29 | </project> |
| 25 | \ No newline at end of file | 30 | \ No newline at end of file |
trash-unit/src/main/java/com/trash/dropPointInfo/service/impl/DropPointInfoServiceImpl.java
| 1 | package com.trash.dropPointInfo.service.impl; | 1 | package com.trash.dropPointInfo.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.ArrayList; | 3 | import java.util.ArrayList; |
| 4 | +import java.util.HashMap; | ||
| 4 | import java.util.List; | 5 | import java.util.List; |
| 6 | +import java.util.Map; | ||
| 7 | + | ||
| 5 | import com.trash.common.utils.DateUtils; | 8 | import com.trash.common.utils.DateUtils; |
| 6 | import com.trash.common.utils.SecurityUtils; | 9 | import com.trash.common.utils.SecurityUtils; |
| 10 | +import com.trash.common.utils.spring.SpringUtils; | ||
| 11 | + | ||
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | +import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
| 8 | import org.springframework.stereotype.Service; | 14 | import org.springframework.stereotype.Service; |
| 9 | import com.trash.dropPointInfo.mapper.DropPointInfoMapper; | 15 | import com.trash.dropPointInfo.mapper.DropPointInfoMapper; |
| 10 | import com.trash.dropPointInfo.domain.DropPointInfo; | 16 | import com.trash.dropPointInfo.domain.DropPointInfo; |
| 11 | import com.trash.dropPointInfo.service.IDropPointInfoService; | 17 | import com.trash.dropPointInfo.service.IDropPointInfoService; |
| 18 | +import com.trash.office.mapper.UploadFileMapper; | ||
| 19 | +import com.trash.workflow.service.IWorkflowService; | ||
| 12 | 20 | ||
| 13 | /** | 21 | /** |
| 14 | * 投放点信息管理Service业务层处理 | 22 | * 投放点信息管理Service业务层处理 |
| @@ -60,12 +68,31 @@ public class DropPointInfoServiceImpl implements IDropPointInfoService | @@ -60,12 +68,31 @@ public class DropPointInfoServiceImpl implements IDropPointInfoService | ||
| 60 | * @param dropPointInfo 投放点信息管理 | 68 | * @param dropPointInfo 投放点信息管理 |
| 61 | * @return 结果 | 69 | * @return 结果 |
| 62 | */ | 70 | */ |
| 71 | + @Autowired | ||
| 72 | + IWorkflowService workflow; | ||
| 73 | + | ||
| 63 | @Override | 74 | @Override |
| 64 | public int insertDropPointInfo(DropPointInfo dropPointInfo) | 75 | public int insertDropPointInfo(DropPointInfo dropPointInfo) |
| 65 | { | 76 | { |
| 66 | dropPointInfo.setCreateTime(DateUtils.getNowDate()); | 77 | dropPointInfo.setCreateTime(DateUtils.getNowDate()); |
| 67 | dropPointInfo.setCreateBy(SecurityUtils.getUsername()); | 78 | dropPointInfo.setCreateBy(SecurityUtils.getUsername()); |
| 68 | - return dropPointInfoMapper.insertDropPointInfo(dropPointInfo); | 79 | + |
| 80 | + int i = dropPointInfoMapper.insertDropPointInfo(dropPointInfo); | ||
| 81 | + | ||
| 82 | + if(i == 0){ | ||
| 83 | + return i; | ||
| 84 | + } | ||
| 85 | + Map<String, String> map = new HashMap<String, String>(); | ||
| 86 | + map.put("name", dropPointInfo.getDropPointName()); | ||
| 87 | + map.put("area", dropPointInfo.getDistrict()); | ||
| 88 | + map.put("id", dropPointInfo.getId()+""); | ||
| 89 | + | ||
| 90 | + i = workflow.createDropPointWorkFlow(map); | ||
| 91 | + if (i == 0) { | ||
| 92 | + dropPointInfoMapper.deleteDropPointInfoById(dropPointInfo.getId()); | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + return i; | ||
| 69 | } | 96 | } |
| 70 | 97 | ||
| 71 | /** | 98 | /** |
trash-workFlow/pom.xml
| @@ -21,7 +21,6 @@ | @@ -21,7 +21,6 @@ | ||
| 21 | <groupId>com.trash</groupId> | 21 | <groupId>com.trash</groupId> |
| 22 | <artifactId>trash-common</artifactId> | 22 | <artifactId>trash-common</artifactId> |
| 23 | </dependency> | 23 | </dependency> |
| 24 | - | ||
| 25 | <!-- kafka --> | 24 | <!-- kafka --> |
| 26 | <dependency> | 25 | <dependency> |
| 27 | <groupId>org.springframework.kafka</groupId> | 26 | <groupId>org.springframework.kafka</groupId> |
trash-workFlow/src/main/java/com/trash/business/mapper/GarMapper.java
0 → 100644
| 1 | +package com.trash.business.mapper; | ||
| 2 | + | ||
| 3 | +import org.apache.ibatis.annotations.Param; | ||
| 4 | + | ||
| 5 | +import com.trash.activiti.domain.vo.ActReDeploymentVO; | ||
| 6 | + | ||
| 7 | +import java.util.List; | ||
| 8 | +import java.util.Map; | ||
| 9 | +import java.util.Set; | ||
| 10 | + | ||
| 11 | +public interface GarMapper { | ||
| 12 | + | ||
| 13 | + public int updateDropPointById(@Param("id")String id ,@Param("status") String status); | ||
| 14 | + | ||
| 15 | +} |
trash-workFlow/src/main/java/com/trash/workflow/listener/DropPointListener.java
0 → 100644
| 1 | +package com.trash.workflow.listener; | ||
| 2 | + | ||
| 3 | +import com.trash.business.domain.SupervisionTrack; | ||
| 4 | +import com.trash.business.mapper.GarMapper; | ||
| 5 | +import com.trash.business.mapper.SupervisionTrackMapper; | ||
| 6 | +import com.trash.casefile.service.IViolationCaseFileService; | ||
| 7 | +import com.trash.common.utils.RemoteServerUtils; | ||
| 8 | +import com.trash.common.utils.spring.SpringUtils; | ||
| 9 | +import com.trash.workflow.service.IWorkflowService; | ||
| 10 | +import org.activiti.engine.delegate.DelegateExecution; | ||
| 11 | +import org.activiti.engine.delegate.ExecutionListener; | ||
| 12 | +import org.activiti.engine.delegate.Expression; | ||
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | + | ||
| 15 | +import java.util.ArrayList; | ||
| 16 | +import java.util.Date; | ||
| 17 | +import java.util.HashMap; | ||
| 18 | +import java.util.List; | ||
| 19 | +import java.util.Map; | ||
| 20 | + | ||
| 21 | + | ||
| 22 | +public class DropPointListener implements ExecutionListener { | ||
| 23 | + | ||
| 24 | + private Expression state; | ||
| 25 | + | ||
| 26 | + | ||
| 27 | + @Autowired | ||
| 28 | + GarMapper mapper; | ||
| 29 | + | ||
| 30 | + | ||
| 31 | + @Override | ||
| 32 | + public void notify(DelegateExecution delegateExecution) { | ||
| 33 | + | ||
| 34 | + List<Map> maps = new ArrayList<Map>(); | ||
| 35 | + | ||
| 36 | + SupervisionTrack supervisionTrack = new SupervisionTrack(); | ||
| 37 | + | ||
| 38 | + String idString = (delegateExecution.getProcessInstanceBusinessKey().split(":")[1]); | ||
| 39 | + String status = (state.getValue(delegateExecution).toString()); | ||
| 40 | + | ||
| 41 | + mapper.updateDropPointById(idString, status); | ||
| 42 | + | ||
| 43 | + workflowUtils.sendDataToHisTory(delegateExecution, state,null); | ||
| 44 | + | ||
| 45 | + System.out.println("纪检督察流程状态更新 更新ID:" + delegateExecution.getProcessInstanceBusinessKey() + "状态:" + state.getValue(delegateExecution).toString()); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + | ||
| 49 | + | ||
| 50 | +} |
trash-workFlow/src/main/java/com/trash/workflow/service/IWorkflowService.java
| @@ -3,17 +3,12 @@ package com.trash.workflow.service; | @@ -3,17 +3,12 @@ package com.trash.workflow.service; | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import java.util.Map; | 4 | import java.util.Map; |
| 5 | 5 | ||
| 6 | -import com.trash.casefile.domain.ViolationWarningInformation; | ||
| 7 | -import org.activiti.api.process.model.ProcessInstance; | ||
| 8 | - | ||
| 9 | -import com.trash.activiti.domain.dto.HistoryDataDTO; | ||
| 10 | import com.trash.business.domain.SupervisionThreestep; | 6 | import com.trash.business.domain.SupervisionThreestep; |
| 11 | import com.trash.caseOffline.domain.CaseOffline; | 7 | import com.trash.caseOffline.domain.CaseOffline; |
| 12 | import com.trash.casefile.domain.ViolationCaseFile; | 8 | import com.trash.casefile.domain.ViolationCaseFile; |
| 9 | +import com.trash.casefile.domain.ViolationWarningInformation; | ||
| 13 | import com.trash.workflow.domain.Workflow; | 10 | import com.trash.workflow.domain.Workflow; |
| 14 | 11 | ||
| 15 | -import net.sf.jsqlparser.statement.create.table.Index; | ||
| 16 | - | ||
| 17 | /** | 12 | /** |
| 18 | * 请假Service接口 | 13 | * 请假Service接口 |
| 19 | * | 14 | * |
| @@ -79,6 +74,7 @@ public interface IWorkflowService | @@ -79,6 +74,7 @@ public interface IWorkflowService | ||
| 79 | */ | 74 | */ |
| 80 | int deleteWorkflowById(String id); | 75 | int deleteWorkflowById(String id); |
| 81 | 76 | ||
| 77 | + int createDropPointWorkFlow(Map<String,String> droppoint); | ||
| 82 | 78 | ||
| 83 | int createLeaveWorkFlow(Workflow workflow,int index); | 79 | int createLeaveWorkFlow(Workflow workflow,int index); |
| 84 | 80 |
trash-workFlow/src/main/java/com/trash/workflow/service/impl/WorkflowServiceImpl.java
| @@ -4,33 +4,20 @@ import java.text.SimpleDateFormat; | @@ -4,33 +4,20 @@ import java.text.SimpleDateFormat; | ||
| 4 | import java.util.Date; | 4 | import java.util.Date; |
| 5 | import java.util.List; | 5 | import java.util.List; |
| 6 | import java.util.Map; | 6 | import java.util.Map; |
| 7 | -import java.util.concurrent.TimeUnit; | ||
| 8 | import java.util.stream.Collectors; | 7 | import java.util.stream.Collectors; |
| 9 | 8 | ||
| 10 | -import com.trash.casefile.domain.ViolationWarningInformation; | ||
| 11 | -import com.trash.common.config.trashConfig; | ||
| 12 | -import com.trash.common.core.redis.RedisCache; | ||
| 13 | -import com.trash.common.core.domain.entity.SysUser; | ||
| 14 | -import com.trash.common.core.domain.model.LoginUser; | ||
| 15 | -import com.trash.framework.web.service.SysLoginService; | ||
| 16 | import org.activiti.api.process.model.ProcessInstance; | 9 | import org.activiti.api.process.model.ProcessInstance; |
| 17 | import org.activiti.api.process.model.builders.ProcessPayloadBuilder; | 10 | import org.activiti.api.process.model.builders.ProcessPayloadBuilder; |
| 18 | -import org.activiti.api.process.model.payloads.StartProcessPayload; | ||
| 19 | import org.activiti.api.process.runtime.ProcessRuntime; | 11 | import org.activiti.api.process.runtime.ProcessRuntime; |
| 20 | import org.activiti.api.task.runtime.TaskRuntime; | 12 | import org.activiti.api.task.runtime.TaskRuntime; |
| 21 | import org.activiti.engine.RuntimeService; | 13 | import org.activiti.engine.RuntimeService; |
| 22 | import org.activiti.engine.TaskService; | 14 | import org.activiti.engine.TaskService; |
| 23 | import org.activiti.engine.task.IdentityLink; | 15 | import org.activiti.engine.task.IdentityLink; |
| 24 | -import org.activiti.engine.task.IdentityLinkType; | ||
| 25 | import org.activiti.engine.task.Task; | 16 | import org.activiti.engine.task.Task; |
| 26 | import org.apache.commons.collections4.map.HashedMap; | 17 | import org.apache.commons.collections4.map.HashedMap; |
| 27 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 28 | -import org.springframework.security.core.context.SecurityContext; | ||
| 29 | import org.springframework.security.core.context.SecurityContextHolder; | 19 | import org.springframework.security.core.context.SecurityContextHolder; |
| 30 | import org.springframework.security.core.context.SecurityContextImpl; | 20 | import org.springframework.security.core.context.SecurityContextImpl; |
| 31 | -import org.springframework.security.authentication.AuthenticationManager; | ||
| 32 | -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; | ||
| 33 | -import org.springframework.security.core.Authentication; | ||
| 34 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
| 35 | import org.springframework.transaction.annotation.Transactional; | 22 | import org.springframework.transaction.annotation.Transactional; |
| 36 | 23 | ||
| @@ -44,11 +31,14 @@ import com.trash.business.service.IConstructionSignService; | @@ -44,11 +31,14 @@ import com.trash.business.service.IConstructionSignService; | ||
| 44 | import com.trash.business.service.ISupervisionThreestepService; | 31 | import com.trash.business.service.ISupervisionThreestepService; |
| 45 | import com.trash.caseOffline.domain.CaseOffline; | 32 | import com.trash.caseOffline.domain.CaseOffline; |
| 46 | import com.trash.casefile.domain.ViolationCaseFile; | 33 | import com.trash.casefile.domain.ViolationCaseFile; |
| 34 | +import com.trash.casefile.domain.ViolationWarningInformation; | ||
| 35 | +import com.trash.common.core.domain.entity.SysUser; | ||
| 36 | +import com.trash.common.core.redis.RedisCache; | ||
| 47 | import com.trash.common.utils.DateUtils; | 37 | import com.trash.common.utils.DateUtils; |
| 48 | import com.trash.common.utils.RemoteServerUtils; | 38 | import com.trash.common.utils.RemoteServerUtils; |
| 49 | import com.trash.common.utils.SecurityUtils; | 39 | import com.trash.common.utils.SecurityUtils; |
| 50 | import com.trash.common.utils.StringUtils; | 40 | import com.trash.common.utils.StringUtils; |
| 51 | -import com.trash.common.utils.uuid.UUID; | 41 | +import com.trash.framework.web.service.SysLoginService; |
| 52 | import com.trash.system.service.ISysUserService; | 42 | import com.trash.system.service.ISysUserService; |
| 53 | import com.trash.workflow.domain.Workflow; | 43 | import com.trash.workflow.domain.Workflow; |
| 54 | import com.trash.workflow.mapper.WorkflowMapper; | 44 | import com.trash.workflow.mapper.WorkflowMapper; |
| @@ -280,6 +270,46 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -280,6 +270,46 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 280 | 270 | ||
| 281 | return 0; | 271 | return 0; |
| 282 | } | 272 | } |
| 273 | + | ||
| 274 | + @Override | ||
| 275 | + @Transactional | ||
| 276 | + public int createDropPointWorkFlow(Map<String,String> droppoint) { // 三查 | ||
| 277 | + ProcessInstance processInstance = null; | ||
| 278 | + ActWorkflowFormData awf = null; | ||
| 279 | + try { | ||
| 280 | + String name = "投放点审批:" + droppoint.get("name"); | ||
| 281 | + | ||
| 282 | + processInstance = processRuntime.start(ProcessPayloadBuilder.start() | ||
| 283 | + .withProcessDefinitionKey("workflow_drop_point").withName(name) | ||
| 284 | + .withBusinessKey("workflow_drop_point:" + droppoint.get("id")).build()); | ||
| 285 | + | ||
| 286 | + PorcThreeStepTask(processInstance, droppoint.get("area")); | ||
| 287 | + | ||
| 288 | + Workflow workflow = new Workflow(); | ||
| 289 | + workflow.setId("workflow_drop_point:" + droppoint.get("id")); | ||
| 290 | + workflow.setTitle(name); | ||
| 291 | + workflow.setReason(droppoint.get("name") + "审批流程"); | ||
| 292 | + workflow.setStartTime(sdf.format(new Date())); | ||
| 293 | + workflow.setEndTime(sdf.format(new Date())); | ||
| 294 | + workflow.setType("投放点审批"); | ||
| 295 | + workflow.setInstanceId(processInstance.getId()); | ||
| 296 | + workflow.setState("0"); | ||
| 297 | + workflow.setCreateTime(new Date()); | ||
| 298 | + | ||
| 299 | + | ||
| 300 | + SysUser user = SecurityUtils.getLoginUser().getUser(); | ||
| 301 | + awf = insertAwf(user,workflow); | ||
| 302 | + | ||
| 303 | + return workflowMapper.insertWorkflow(workflow); | ||
| 304 | + } catch (Exception e) { | ||
| 305 | + e.printStackTrace(); | ||
| 306 | + if(awf.getId() != null) | ||
| 307 | + awfServer.deleteActWorkflowFormDataById(awf.getId()); | ||
| 308 | + processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | ||
| 309 | + } | ||
| 310 | + | ||
| 311 | + return 0; | ||
| 312 | + } | ||
| 283 | 313 | ||
| 284 | @Override | 314 | @Override |
| 285 | @Transactional | 315 | @Transactional |
trash-workFlow/src/main/resources/mapper/GarMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | +<!DOCTYPE mapper | ||
| 3 | +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | +<mapper namespace="com.trash.activiti.mapper.GarMapper"> | ||
| 6 | + | ||
| 7 | + <update id="updateDropPointInfo" parameterType="DropPointInfo"> | ||
| 8 | + update drop_point_info Set update_time = NOW(),status = #{status} | ||
| 9 | + where id = #{id} | ||
| 10 | + </update> | ||
| 11 | +</mapper> | ||
| 0 | \ No newline at end of file | 12 | \ No newline at end of file |