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 | 30 | format="yyyy-MM-dd HH:mm:ss" |
| 31 | 31 | value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束时间"> |
| 32 | 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 | 33 | </el-form-item> |
| 34 | + | |
| 38 | 35 | <el-form-item label="抽查状态" prop="checkStatus" v-if="this.queryParams.his==1"> |
| 39 | 36 | <el-select v-model="queryParams.checkStatus" placeholder="请选择抽查状态" size="small"> |
| 40 | 37 | <el-option label="未抽查" value="0" /> |
| 41 | 38 | <el-option label="已抽查" value="1" /> |
| 42 | 39 | </el-select> |
| 43 | 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 | 45 | </el-form> |
| 45 | 46 | |
| 46 | 47 | <el-row :gutter="10" class="mb8"> | ... | ... |
trash-unit/pom.xml
| ... | ... | @@ -20,5 +20,10 @@ |
| 20 | 20 | <groupId>com.trash</groupId> |
| 21 | 21 | <artifactId>trash-common</artifactId> |
| 22 | 22 | </dependency> |
| 23 | + | |
| 24 | + <dependency> | |
| 25 | + <groupId>com.trash</groupId> | |
| 26 | + <artifactId>trash-workflow</artifactId> | |
| 27 | + </dependency> | |
| 23 | 28 | </dependencies> |
| 24 | 29 | </project> |
| 25 | 30 | \ No newline at end of file | ... | ... |
trash-unit/src/main/java/com/trash/dropPointInfo/service/impl/DropPointInfoServiceImpl.java
| 1 | 1 | package com.trash.dropPointInfo.service.impl; |
| 2 | 2 | |
| 3 | 3 | import java.util.ArrayList; |
| 4 | +import java.util.HashMap; | |
| 4 | 5 | import java.util.List; |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 5 | 8 | import com.trash.common.utils.DateUtils; |
| 6 | 9 | import com.trash.common.utils.SecurityUtils; |
| 10 | +import com.trash.common.utils.spring.SpringUtils; | |
| 11 | + | |
| 7 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | +import org.springframework.security.core.annotation.AuthenticationPrincipal; | |
| 8 | 14 | import org.springframework.stereotype.Service; |
| 9 | 15 | import com.trash.dropPointInfo.mapper.DropPointInfoMapper; |
| 10 | 16 | import com.trash.dropPointInfo.domain.DropPointInfo; |
| 11 | 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 | 22 | * 投放点信息管理Service业务层处理 |
| ... | ... | @@ -60,12 +68,31 @@ public class DropPointInfoServiceImpl implements IDropPointInfoService |
| 60 | 68 | * @param dropPointInfo 投放点信息管理 |
| 61 | 69 | * @return 结果 |
| 62 | 70 | */ |
| 71 | + @Autowired | |
| 72 | + IWorkflowService workflow; | |
| 73 | + | |
| 63 | 74 | @Override |
| 64 | 75 | public int insertDropPointInfo(DropPointInfo dropPointInfo) |
| 65 | 76 | { |
| 66 | 77 | dropPointInfo.setCreateTime(DateUtils.getNowDate()); |
| 67 | 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
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 | 3 | import java.util.List; |
| 4 | 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 | 6 | import com.trash.business.domain.SupervisionThreestep; |
| 11 | 7 | import com.trash.caseOffline.domain.CaseOffline; |
| 12 | 8 | import com.trash.casefile.domain.ViolationCaseFile; |
| 9 | +import com.trash.casefile.domain.ViolationWarningInformation; | |
| 13 | 10 | import com.trash.workflow.domain.Workflow; |
| 14 | 11 | |
| 15 | -import net.sf.jsqlparser.statement.create.table.Index; | |
| 16 | - | |
| 17 | 12 | /** |
| 18 | 13 | * 请假Service接口 |
| 19 | 14 | * |
| ... | ... | @@ -79,6 +74,7 @@ public interface IWorkflowService |
| 79 | 74 | */ |
| 80 | 75 | int deleteWorkflowById(String id); |
| 81 | 76 | |
| 77 | + int createDropPointWorkFlow(Map<String,String> droppoint); | |
| 82 | 78 | |
| 83 | 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 | 4 | import java.util.Date; |
| 5 | 5 | import java.util.List; |
| 6 | 6 | import java.util.Map; |
| 7 | -import java.util.concurrent.TimeUnit; | |
| 8 | 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 | 9 | import org.activiti.api.process.model.ProcessInstance; |
| 17 | 10 | import org.activiti.api.process.model.builders.ProcessPayloadBuilder; |
| 18 | -import org.activiti.api.process.model.payloads.StartProcessPayload; | |
| 19 | 11 | import org.activiti.api.process.runtime.ProcessRuntime; |
| 20 | 12 | import org.activiti.api.task.runtime.TaskRuntime; |
| 21 | 13 | import org.activiti.engine.RuntimeService; |
| 22 | 14 | import org.activiti.engine.TaskService; |
| 23 | 15 | import org.activiti.engine.task.IdentityLink; |
| 24 | -import org.activiti.engine.task.IdentityLinkType; | |
| 25 | 16 | import org.activiti.engine.task.Task; |
| 26 | 17 | import org.apache.commons.collections4.map.HashedMap; |
| 27 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 28 | -import org.springframework.security.core.context.SecurityContext; | |
| 29 | 19 | import org.springframework.security.core.context.SecurityContextHolder; |
| 30 | 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 | 21 | import org.springframework.stereotype.Service; |
| 35 | 22 | import org.springframework.transaction.annotation.Transactional; |
| 36 | 23 | |
| ... | ... | @@ -44,11 +31,14 @@ import com.trash.business.service.IConstructionSignService; |
| 44 | 31 | import com.trash.business.service.ISupervisionThreestepService; |
| 45 | 32 | import com.trash.caseOffline.domain.CaseOffline; |
| 46 | 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 | 37 | import com.trash.common.utils.DateUtils; |
| 48 | 38 | import com.trash.common.utils.RemoteServerUtils; |
| 49 | 39 | import com.trash.common.utils.SecurityUtils; |
| 50 | 40 | import com.trash.common.utils.StringUtils; |
| 51 | -import com.trash.common.utils.uuid.UUID; | |
| 41 | +import com.trash.framework.web.service.SysLoginService; | |
| 52 | 42 | import com.trash.system.service.ISysUserService; |
| 53 | 43 | import com.trash.workflow.domain.Workflow; |
| 54 | 44 | import com.trash.workflow.mapper.WorkflowMapper; |
| ... | ... | @@ -280,6 +270,46 @@ public class WorkflowServiceImpl implements IWorkflowService { |
| 280 | 270 | |
| 281 | 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 | 314 | @Override |
| 285 | 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 | 12 | \ No newline at end of file | ... | ... |