Commit 9408fae754577ae43ebd6464764ee6695b97d7e1
1 parent
6397afed
m
Showing
17 changed files
with
219 additions
and
152 deletions
trash-activiti/src/main/java/com/trash/activiti/service/impl/ActTaskServiceImpl.java
| @@ -244,6 +244,7 @@ public class ActTaskServiceImpl implements IActTaskService { | @@ -244,6 +244,7 @@ public class ActTaskServiceImpl implements IActTaskService { | ||
| 244 | 244 | ||
| 245 | if(name != null) | 245 | if(name != null) |
| 246 | query.processInstanceNameLike(name); | 246 | query.processInstanceNameLike(name); |
| 247 | + | ||
| 247 | 248 | ||
| 248 | 249 | ||
| 249 | processInstanceList = query.list(); | 250 | processInstanceList = query.list(); |
trash-activiti/src/main/java/com/trash/activiti/service/impl/FormHistoryDataServiceImpl.java
| 1 | package com.trash.activiti.service.impl; | 1 | package com.trash.activiti.service.impl; |
| 2 | 2 | ||
| 3 | import org.activiti.engine.RuntimeService; | 3 | import org.activiti.engine.RuntimeService; |
| 4 | +import org.activiti.engine.TaskService; | ||
| 4 | import org.activiti.engine.runtime.ProcessInstance; | 5 | import org.activiti.engine.runtime.ProcessInstance; |
| 6 | +import org.activiti.engine.runtime.ProcessInstanceQuery; | ||
| 7 | +import org.activiti.engine.task.Task; | ||
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 7 | 10 | ||
| @@ -25,15 +28,37 @@ import java.util.stream.Collectors; | @@ -25,15 +28,37 @@ import java.util.stream.Collectors; | ||
| 25 | public class FormHistoryDataServiceImpl implements IFormHistoryDataService { | 28 | public class FormHistoryDataServiceImpl implements IFormHistoryDataService { |
| 26 | @Autowired | 29 | @Autowired |
| 27 | private IActWorkflowFormDataService actWorkflowFormDataService; | 30 | private IActWorkflowFormDataService actWorkflowFormDataService; |
| 28 | - | ||
| 29 | - | 31 | + |
| 30 | 32 | ||
| 31 | private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 33 | private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 34 | + | ||
| 35 | + | ||
| 36 | + @Autowired | ||
| 37 | + private RuntimeService runtimeService; | ||
| 32 | 38 | ||
| 39 | + @Autowired | ||
| 40 | + private TaskService taskService; | ||
| 41 | + | ||
| 33 | @Override | 42 | @Override |
| 34 | public List<ActWorkflowFormData> historyDataShow(String businessKey) { | 43 | public List<ActWorkflowFormData> historyDataShow(String businessKey) { |
| 35 | List<ActWorkflowFormData> returnHistoryFromDataDTOS=new ArrayList<>(); | 44 | List<ActWorkflowFormData> returnHistoryFromDataDTOS=new ArrayList<>(); |
| 36 | 45 | ||
| 46 | + List<Task> tasks =taskService.createTaskQuery().processInstanceBusinessKey(businessKey).list(); | ||
| 47 | + | ||
| 48 | + if(tasks.size() > 0){ | ||
| 49 | + | ||
| 50 | + ActWorkflowFormData afw = new ActWorkflowFormData(); | ||
| 51 | + | ||
| 52 | + | ||
| 53 | + afw.setControlName("审批"); | ||
| 54 | + afw.setControlValue("待审批"); | ||
| 55 | + afw.setTaskNodeName(tasks.get(0).getName()); | ||
| 56 | + afw.setCreateBy(tasks.get(0).getName()); | ||
| 57 | + afw.setCreateName(tasks.get(0).getName()); | ||
| 58 | + afw.setCreateTime(tasks.get(0).getCreateTime()); | ||
| 59 | + | ||
| 60 | + returnHistoryFromDataDTOS.add(afw); | ||
| 61 | + } | ||
| 37 | 62 | ||
| 38 | List<ActWorkflowFormData> actWorkflowFormData = actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey(businessKey); | 63 | List<ActWorkflowFormData> actWorkflowFormData = actWorkflowFormDataService.selectActWorkflowFormDataByBusinessKey(businessKey); |
| 39 | 64 | ||
| @@ -60,6 +85,7 @@ public class FormHistoryDataServiceImpl implements IFormHistoryDataService { | @@ -60,6 +85,7 @@ public class FormHistoryDataServiceImpl implements IFormHistoryDataService { | ||
| 60 | returnHistoryFromDataDTOS.add(one); | 85 | returnHistoryFromDataDTOS.add(one); |
| 61 | } | 86 | } |
| 62 | 87 | ||
| 88 | + | ||
| 63 | // Map<String, List<ActWorkflowFormData>> collect = actWorkflowFormData.stream().collect(Collectors.groupingBy(ActWorkflowFormData::getTaskNodeName)); | 89 | // Map<String, List<ActWorkflowFormData>> collect = actWorkflowFormData.stream().collect(Collectors.groupingBy(ActWorkflowFormData::getTaskNodeName)); |
| 64 | // collect.entrySet().forEach( | 90 | // collect.entrySet().forEach( |
| 65 | // entry -> { | 91 | // entry -> { |
| @@ -71,7 +97,10 @@ public class FormHistoryDataServiceImpl implements IFormHistoryDataService { | @@ -71,7 +97,10 @@ public class FormHistoryDataServiceImpl implements IFormHistoryDataService { | ||
| 71 | // returnHistoryFromDataDTOS.add(returnHistoryFromDataDTO); | 97 | // returnHistoryFromDataDTOS.add(returnHistoryFromDataDTO); |
| 72 | // } | 98 | // } |
| 73 | // ); | 99 | // ); |
| 74 | -// List<HistoryDataDTO> collect1 = returnHistoryFromDataDTOS.stream().sorted((x, y) -> x.getCreatedDate().compareTo(y.getCreatedDate())).collect(Collectors.toList()); | 100 | +// returnHistoryFromDataDTOS = returnHistoryFromDataDTOS.stream().sorted((x, y) -> x.getCreateTime().compareTo(y.getCreateTime())).collect(Collectors.toList()); |
| 101 | + | ||
| 102 | + | ||
| 103 | + | ||
| 75 | 104 | ||
| 76 | return returnHistoryFromDataDTOS; | 105 | return returnHistoryFromDataDTOS; |
| 77 | } | 106 | } |
trash-admin/src/main/resources/application-dev.yml
| @@ -16,10 +16,10 @@ trash: | @@ -16,10 +16,10 @@ trash: | ||
| 16 | # 验证码类型 math 数组计算 char 字符验证 | 16 | # 验证码类型 math 数组计算 char 字符验证 |
| 17 | captchaType: math | 17 | captchaType: math |
| 18 | # 远程服务器地址 | 18 | # 远程服务器地址 |
| 19 | - remotePath: http://175.6.47.84:8008 | ||
| 20 | - token: durable:auth:token:eyJhbGciOiJIUzUxMiJ9.eyJ5ZWEiOiJkdXJhYmxlIiwiZXhwIjo0MTAyNDE1OTk5LCJjcmVhdGVkIjoxNjg1NDE2NjEzMzU1fQ.58-J0KKfsK2pQhDQAzaBaUj-oFWMbYF1YzMAcshmcfidIkW16TZWIVhAVKPvCJvWfG54x7xB-ETxKCDLFnSctQ | ||
| 21 | - #remotePath: http://183.66.242.6:14601 | ||
| 22 | - #token: durable:auth:token:eyJhbGciOiJIUzUxMiJ9.eyJ5ZWEiOiJjc3poIiwiZXhwIjo0MTAyNDE1OTk5LCJjcmVhdGVkIjoxNjg0NDU5MjEzNzQ2fQ.85oIrOnU7cz7L_-IGt4Bt1LXDTkFtyrdqNt05K0v9-4nsrrzzpbjbemK-yMlbnUpe4Fx2FFES-Wbw8Yr8ML69w | 19 | + #remotePath: http://175.6.47.84:8008 |
| 20 | + #token: durable:auth:token:eyJhbGciOiJIUzUxMiJ9.eyJ5ZWEiOiJkdXJhYmxlIiwiZXhwIjo0MTAyNDE1OTk5LCJjcmVhdGVkIjoxNjg1NDE2NjEzMzU1fQ.58-J0KKfsK2pQhDQAzaBaUj-oFWMbYF1YzMAcshmcfidIkW16TZWIVhAVKPvCJvWfG54x7xB-ETxKCDLFnSctQ | ||
| 21 | + remotePath: http://183.66.242.6:14601 | ||
| 22 | + token: durable:auth:token:eyJhbGciOiJIUzUxMiJ9.eyJ5ZWEiOiJjc3poIiwiZXhwIjo0MTAyNDE1OTk5LCJjcmVhdGVkIjoxNjg0NDU5MjEzNzQ2fQ.85oIrOnU7cz7L_-IGt4Bt1LXDTkFtyrdqNt05K0v9-4nsrrzzpbjbemK-yMlbnUpe4Fx2FFES-Wbw8Yr8ML69w | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ||
| @@ -33,7 +33,7 @@ spring: | @@ -33,7 +33,7 @@ spring: | ||
| 33 | # 主库数据源 | 33 | # 主库数据源 |
| 34 | master: | 34 | master: |
| 35 | #url: jdbc:mysql://localhost:3306/trash?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true | 35 | #url: jdbc:mysql://localhost:3306/trash?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true |
| 36 | - url: jdbc:mysql://192.168.168.141:3306/trash?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true | 36 | + url: jdbc:mysql://192.168.168.141:3306/trash1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true |
| 37 | username: root | 37 | username: root |
| 38 | password: root | 38 | password: root |
| 39 | # 从库数据源 | 39 | # 从库数据源 |
trash-quartz/src/main/java/com/trash/quartz/task/DriverTask.java
| @@ -79,56 +79,15 @@ public class DriverTask | @@ -79,56 +79,15 @@ public class DriverTask | ||
| 79 | 79 | ||
| 80 | @SuppressWarnings("deprecation") | 80 | @SuppressWarnings("deprecation") |
| 81 | private void checkTruckActive() { | 81 | private void checkTruckActive() { |
| 82 | - int hour = new Date().getHours(); | ||
| 83 | - int minute = new Date().getMinutes(); | ||
| 84 | - if(hour < 8 && (hour==3 && minute>55)){ | ||
| 85 | - return; | 82 | + if(TOKEN == null){ |
| 83 | + TOKEN = trashConfig.getToken(); | ||
| 86 | } | 84 | } |
| 87 | - | ||
| 88 | - SupervisionThreestep param =new SupervisionThreestep(); | ||
| 89 | - | ||
| 90 | - param.setType(0L); | ||
| 91 | - param.setStatus(1L); | ||
| 92 | - | ||
| 93 | - String start, end; | ||
| 94 | - | ||
| 95 | - Date date = new Date(); | ||
| 96 | - | ||
| 97 | - if (new Date().getHours() < 8) { | ||
| 98 | - end = sdf.format(date); | ||
| 99 | - date.setDate(date.getDate() - 1); | ||
| 100 | - start = sdf.format(date); | ||
| 101 | - } else { | ||
| 102 | - start = sdf.format(date); | ||
| 103 | - date.setDate(date.getDate() + 1); | ||
| 104 | - end = sdf.format(date); | ||
| 105 | - } | ||
| 106 | - | ||
| 107 | - end += " 8:00:00"; | ||
| 108 | - start += " 8:00:00"; | ||
| 109 | - | ||
| 110 | - try { | ||
| 111 | - param.setWorkStartTime(sdf.parse(start)); | ||
| 112 | - param.setWorkEndTime(sdf.parse(end)); | 85 | + try { |
| 86 | + SpringUtils.getBean(ISupervisionThreestepService.class).checkDataToActiveTruck(TOKEN); | ||
| 113 | } catch (Exception e) { | 87 | } catch (Exception e) { |
| 114 | - // TODO Auto-generated catch block | ||
| 115 | - e.printStackTrace(); | 88 | + // TODO: handle exception |
| 116 | } | 89 | } |
| 117 | - | ||
| 118 | - | ||
| 119 | - | ||
| 120 | - List<SupervisionThreestep> cs = SpringUtils.getBean(SupervisionThreestepMapper.class).selectTodayDataList(param); | ||
| 121 | 90 | ||
| 122 | - for(SupervisionThreestep c:cs){ | ||
| 123 | - if(hour < 8 && (hour==3 && minute>55)){ | ||
| 124 | - return; | ||
| 125 | - } | ||
| 126 | - try { | ||
| 127 | - SpringUtils.getBean(ISupervisionThreestepService.class).checkDataToActiveTruck(c,TOKEN); | ||
| 128 | - } catch (Exception e) { | ||
| 129 | - // TODO: handle exception | ||
| 130 | - } | ||
| 131 | - } | ||
| 132 | 91 | ||
| 133 | } | 92 | } |
| 134 | 93 |
trash-ui/src/api/taskhismethod.js
| @@ -35,7 +35,6 @@ export default { | @@ -35,7 +35,6 @@ export default { | ||
| 35 | }, | 35 | }, |
| 36 | /** 查询请假列表 */ | 36 | /** 查询请假列表 */ |
| 37 | getList() { | 37 | getList() { |
| 38 | - debugger; | ||
| 39 | this.loading = true; | 38 | this.loading = true; |
| 40 | if (this.type == 1) { | 39 | if (this.type == 1) { |
| 41 | listEndTask(this.queryParams).then(response => { | 40 | listEndTask(this.queryParams).then(response => { |
| @@ -94,7 +93,7 @@ export default { | @@ -94,7 +93,7 @@ export default { | ||
| 94 | 93 | ||
| 95 | this.hisfromData = []; | 94 | this.hisfromData = []; |
| 96 | 95 | ||
| 97 | - this.hisfromData.push({createName:row.createBy,controlValue:row.reason,createTime:row.time}); | 96 | + // this.hisfromData.push({createName:row.createBy,controlValue:row.reason,createTime:row.time}); |
| 98 | for(let i in response.data){ | 97 | for(let i in response.data){ |
| 99 | 98 | ||
| 100 | this.hisfromData.push(response.data[i]); | 99 | this.hisfromData.push(response.data[i]); |
trash-ui/src/api/taskmethod.js
| @@ -177,7 +177,7 @@ export default { | @@ -177,7 +177,7 @@ export default { | ||
| 177 | this.taskName = row.name; | 177 | this.taskName = row.name; |
| 178 | historyFromData(this.businessKey).then(response => { | 178 | historyFromData(this.businessKey).then(response => { |
| 179 | this.hisfromData = []; | 179 | this.hisfromData = []; |
| 180 | - this.hisfromData.push({createName:row.createBy,controlValue:row.reason,createTime:row.time}) | 180 | + //this.hisfromData.push({createName:row.createBy,controlValue:row.reason,createTime:row.time}) |
| 181 | for(let i in response.data){ | 181 | for(let i in response.data){ |
| 182 | 182 | ||
| 183 | this.hisfromData.push(response.data[i]); | 183 | this.hisfromData.push(response.data[i]); |
| @@ -214,10 +214,10 @@ export default { | @@ -214,10 +214,10 @@ export default { | ||
| 214 | this.form.formData = formData; | 214 | this.form.formData = formData; |
| 215 | 215 | ||
| 216 | if (this.definitionKey == "workflow_threestep") { | 216 | if (this.definitionKey == "workflow_threestep") { |
| 217 | - | 217 | + |
| 218 | this.videos = []; | 218 | this.videos = []; |
| 219 | this.slides = []; | 219 | this.slides = []; |
| 220 | - | 220 | + |
| 221 | this.open2 = true; | 221 | this.open2 = true; |
| 222 | return; | 222 | return; |
| 223 | } | 223 | } |
| @@ -318,35 +318,38 @@ export default { | @@ -318,35 +318,38 @@ export default { | ||
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | if (this.definitionKey == "workflow_threestep") { | 320 | if (this.definitionKey == "workflow_threestep") { |
| 321 | - | ||
| 322 | - | ||
| 323 | - for (let i = 0; i < 13; i++) { | ||
| 324 | - if (this.form["sub_img" + i]) { | ||
| 325 | - let paths = ""; | ||
| 326 | - for (var j = 0; j < this.form["sub_img" + i].length; j++) { | ||
| 327 | - paths += this.form["sub_img" + i][j].split(":")[1] + ","; | 321 | + this.$refs["form"].validate(valid => { |
| 322 | + if (!valid) { | ||
| 323 | + return; | ||
| 324 | + } | ||
| 325 | + for (let i = 0; i < 13; i++) { | ||
| 326 | + if (this.form["sub_img" + i]) { | ||
| 327 | + let paths = ""; | ||
| 328 | + for (var j = 0; j < this.form["sub_img" + i].length; j++) { | ||
| 329 | + paths += this.form["sub_img" + i][j].split(":")[1] + ","; | ||
| 330 | + } | ||
| 331 | + this.form["sub_img" + i] = paths.substring(0, paths.length - 1); | ||
| 328 | } | 332 | } |
| 329 | - this.form["sub_img" + i] = paths.substring(0, paths.length - 1); | ||
| 330 | } | 333 | } |
| 331 | - } | ||
| 332 | 334 | ||
| 333 | - if (this.form.status == 1) { | ||
| 334 | - activeThreestep(this.form).then(res => { | 335 | + if (this.form.status == 1) { |
| 336 | + activeThreestep(this.form).then(res => { | ||
| 337 | + formDataSave(this.id, this.form.formData).then(response => { | ||
| 338 | + this.msgSuccess("审批成功"); | ||
| 339 | + this.open2 = false; | ||
| 340 | + this.taskList = []; | ||
| 341 | + this.getList(); | ||
| 342 | + }); | ||
| 343 | + }); | ||
| 344 | + } else { | ||
| 335 | formDataSave(this.id, this.form.formData).then(response => { | 345 | formDataSave(this.id, this.form.formData).then(response => { |
| 336 | this.msgSuccess("审批成功"); | 346 | this.msgSuccess("审批成功"); |
| 337 | this.open2 = false; | 347 | this.open2 = false; |
| 338 | this.taskList = []; | 348 | this.taskList = []; |
| 339 | this.getList(); | 349 | this.getList(); |
| 340 | }); | 350 | }); |
| 341 | - }); | ||
| 342 | - } else { | ||
| 343 | - formDataSave(this.id, this.form.formData).then(response => { | ||
| 344 | - this.msgSuccess("审批成功"); | ||
| 345 | - this.open2 = false; | ||
| 346 | - this.taskList = []; | ||
| 347 | - this.getList(); | ||
| 348 | - }); | ||
| 349 | - } | 351 | + } |
| 352 | + }); | ||
| 350 | return; | 353 | return; |
| 351 | } | 354 | } |
| 352 | 355 |
trash-ui/src/views/activiti/task/index.vue
| @@ -58,10 +58,10 @@ | @@ -58,10 +58,10 @@ | ||
| 58 | 58 | ||
| 59 | <el-dialog :title="title" :visible.sync="open2" width="800px" append-to-body> | 59 | <el-dialog :title="title" :visible.sync="open2" width="800px" append-to-body> |
| 60 | <threestepInfo :businessKey="businessKey" v-if="open2"/> | 60 | <threestepInfo :businessKey="businessKey" v-if="open2"/> |
| 61 | - <el-form :rules="rules" label-width="120px"> | 61 | + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
| 62 | <el-row type="flex" justify="center"> | 62 | <el-row type="flex" justify="center"> |
| 63 | <el-col> | 63 | <el-col> |
| 64 | - <el-form-item label="补充说明"> | 64 | + <el-form-item label="补充说明" prop="subReason"> |
| 65 | <el-input type="textarea" v-model="form.subReason" maxlength=100 show-word-limit='true'/> | 65 | <el-input type="textarea" v-model="form.subReason" maxlength=100 show-word-limit='true'/> |
| 66 | </el-form-item> | 66 | </el-form-item> |
| 67 | </el-col> | 67 | </el-col> |
| @@ -784,6 +784,8 @@ | @@ -784,6 +784,8 @@ | ||
| 784 | }; | 784 | }; |
| 785 | }, | 785 | }, |
| 786 | created() { | 786 | created() { |
| 787 | + console.log(this); | ||
| 788 | + console.log(this.$refs["form"]); | ||
| 787 | let dep = {type: "CSUserDepartmentType"}; | 789 | let dep = {type: "CSUserDepartmentType"}; |
| 788 | 790 | ||
| 789 | getDict(dep).then(res => { | 791 | getDict(dep).then(res => { |
| @@ -814,4 +816,3 @@ | @@ -814,4 +816,3 @@ | ||
| 814 | } | 816 | } |
| 815 | 817 | ||
| 816 | </script> | 818 | </script> |
| 817 | - |
trash-ui/src/views/activiti/task/sitePaper.vue
| @@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
| 53 | <el-col :span="18" class="bd_padding">{{infoData.effectiveFrom}} 至 {{infoData.effectiveEnd}}</el-col> | 53 | <el-col :span="18" class="bd_padding">{{infoData.effectiveFrom}} 至 {{infoData.effectiveEnd}}</el-col> |
| 54 | </el-row> | 54 | </el-row> |
| 55 | 55 | ||
| 56 | - <el-row class="bd_bottom"> | 56 | + <!-- <el-row class="bd_bottom"> |
| 57 | <el-col :span="6" >申报资料</el-col> | 57 | <el-col :span="6" >申报资料</el-col> |
| 58 | <el-col :span="18" class="bd_left"> | 58 | <el-col :span="18" class="bd_left"> |
| 59 | <el-row class="bd_bottom"> | 59 | <el-row class="bd_bottom"> |
| @@ -82,7 +82,7 @@ | @@ -82,7 +82,7 @@ | ||
| 82 | </el-row> | 82 | </el-row> |
| 83 | 83 | ||
| 84 | </el-col> | 84 | </el-col> |
| 85 | - </el-row> | 85 | + </el-row> --> |
| 86 | <el-row class="bd_bottom"> | 86 | <el-row class="bd_bottom"> |
| 87 | <el-col :span="6" class="bd_right bd_padding">消纳场地</el-col> | 87 | <el-col :span="6" class="bd_right bd_padding">消纳场地</el-col> |
| 88 | <el-col :span="18" class="bd_padding">{{infoData.earthName}}</el-col> | 88 | <el-col :span="18" class="bd_padding">{{infoData.earthName}}</el-col> |
trash-ui/src/views/activiti/task/taskCard.vue
| @@ -12,15 +12,15 @@ | @@ -12,15 +12,15 @@ | ||
| 12 | </el-col> | 12 | </el-col> |
| 13 | </el-row> | 13 | </el-row> |
| 14 | 14 | ||
| 15 | - <el-row class="card_row"> | 15 | + <el-row class="card_row" v-if="task.checkStatus == 0"> |
| 16 | <el-col :span="8" class="card_grid"> | 16 | <el-col :span="8" class="card_grid"> |
| 17 | - <div v-if="task.prev">上一节点: {{task.prev}}</div> | 17 | + <div >上一节点: {{task.prev}}</div> |
| 18 | </el-col> | 18 | </el-col> |
| 19 | <el-col :span="8" class="card_grid" v-if="task.name"> | 19 | <el-col :span="8" class="card_grid" v-if="task.name"> |
| 20 | <div >当前节点: {{task.name}}</div> | 20 | <div >当前节点: {{task.name}}</div> |
| 21 | </el-col> | 21 | </el-col> |
| 22 | <el-col :span="8" class="card_grid"> | 22 | <el-col :span="8" class="card_grid"> |
| 23 | - <div v-if="task.next">下一节点: {{task.next}}</div> | 23 | + <div >下一节点: {{task.next}}</div> |
| 24 | </el-col> | 24 | </el-col> |
| 25 | </el-row> | 25 | </el-row> |
| 26 | 26 |
trash-ui/src/views/h5/task/index.vue
| @@ -55,9 +55,9 @@ | @@ -55,9 +55,9 @@ | ||
| 55 | 55 | ||
| 56 | <el-dialog :title="title" :visible.sync="open2" width="400px" append-to-body> | 56 | <el-dialog :title="title" :visible.sync="open2" width="400px" append-to-body> |
| 57 | <threestepInfo :businessKey="businessKey" v-if="open2" /> | 57 | <threestepInfo :businessKey="businessKey" v-if="open2" /> |
| 58 | - <el-form :rules="rules" label-width="100px"> | 58 | + <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| 59 | <el-row > | 59 | <el-row > |
| 60 | - <el-form-item label="补充说明"> | 60 | + <el-form-item label="补充说明" prop="subReason"> |
| 61 | <el-input type="textarea" v-model="form.subReason" /> | 61 | <el-input type="textarea" v-model="form.subReason" /> |
| 62 | </el-form-item> | 62 | </el-form-item> |
| 63 | </el-row> | 63 | </el-row> |
trash-ui/src/views/h5/task/sitePaper.vue
| @@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
| 50 | <el-col :span="6" class="bd_right bd_padding">处置许可时间</el-col> | 50 | <el-col :span="6" class="bd_right bd_padding">处置许可时间</el-col> |
| 51 | <el-col :span="18" class="bd_padding">{{infoData.effectiveFrom}} 至 {{infoData.effectiveEnd}}</el-col> | 51 | <el-col :span="18" class="bd_padding">{{infoData.effectiveFrom}} 至 {{infoData.effectiveEnd}}</el-col> |
| 52 | </el-row> | 52 | </el-row> |
| 53 | - <el-row class="bd_bottom"> | 53 | +<!-- <el-row class="bd_bottom"> |
| 54 | <el-col :span="6" >申报资料</el-col> | 54 | <el-col :span="6" >申报资料</el-col> |
| 55 | <el-col :span="18" class="bd_left"> | 55 | <el-col :span="18" class="bd_left"> |
| 56 | <el-row class="bd_bottom"> | 56 | <el-row class="bd_bottom"> |
| @@ -79,7 +79,7 @@ | @@ -79,7 +79,7 @@ | ||
| 79 | </el-row> | 79 | </el-row> |
| 80 | 80 | ||
| 81 | </el-col> | 81 | </el-col> |
| 82 | - </el-row> | 82 | + </el-row> --> |
| 83 | <el-row class="bd_bottom"> | 83 | <el-row class="bd_bottom"> |
| 84 | <el-col :span="6" class="bd_right bd_padding">消纳场地</el-col> | 84 | <el-col :span="6" class="bd_right bd_padding">消纳场地</el-col> |
| 85 | <el-col :span="18" class="bd_padding">{{infoData.earthName}}</el-col> | 85 | <el-col :span="18" class="bd_padding">{{infoData.earthName}}</el-col> |
trash-ui/src/views/h5/task/taskCard.vue
| @@ -6,23 +6,26 @@ | @@ -6,23 +6,26 @@ | ||
| 6 | <el-row class="card_row"> | 6 | <el-row class="card_row"> |
| 7 | <div class="card_title">{{task.instanceName}}</div> | 7 | <div class="card_title">{{task.instanceName}}</div> |
| 8 | </el-row> | 8 | </el-row> |
| 9 | - | ||
| 10 | - <el-row class="card_row"> | 9 | + <el-row class="card_row" v-if="task.checkStatus == 0"> |
| 11 | <el-col :span="24" class="card_grid"> | 10 | <el-col :span="24" class="card_grid"> |
| 12 | - <div>时间: {{task.startTime}} - {{task.endTime}}</div> | 11 | + <div >上一节点: {{task.prev}}</div> |
| 13 | </el-col> | 12 | </el-col> |
| 14 | - | ||
| 15 | - </el-row> | 13 | + <el-col :span="24" class="card_grid" v-if="task.name"> |
| 14 | + <div >当前节点: {{task.name}}</div> | ||
| 15 | + </el-col> | ||
| 16 | + <el-col :span="24" class="card_grid"> | ||
| 17 | + <div >下一节点: {{task.next}}</div> | ||
| 18 | + </el-col> | ||
| 19 | + </el-row> | ||
| 16 | <el-row class="card_row"> | 20 | <el-row class="card_row"> |
| 17 | <el-col :span="24" class="card_grid"> | 21 | <el-col :span="24" class="card_grid"> |
| 18 | <div>申请类型: {{task.type}}</div> | 22 | <div>申请类型: {{task.type}}</div> |
| 19 | </el-col> | 23 | </el-col> |
| 24 | + <el-col :span="24" class="card_grid"> | ||
| 25 | + <div>接收时间: {{task.createdDate}}</div> | ||
| 26 | + </el-col> | ||
| 20 | </el-row> | 27 | </el-row> |
| 21 | - <el-row class="card_row"> | ||
| 22 | - <el-col :span="24"> | ||
| 23 | - <div>申请理由: {{task.reason}}</div> | ||
| 24 | - </el-col> | ||
| 25 | - </el-row> | 28 | + |
| 26 | </el-card></a> | 29 | </el-card></a> |
| 27 | </template> | 30 | </template> |
| 28 | 31 |
trash-ui/src/views/h5/taskhistory/index.vue
| @@ -34,6 +34,12 @@ | @@ -34,6 +34,12 @@ | ||
| 34 | 34 | ||
| 35 | <el-dialog :title="title" :visible.sync="open2" width="300px" append-to-body> | 35 | <el-dialog :title="title" :visible.sync="open2" width="300px" append-to-body> |
| 36 | <threestepInfo :businessKey="businessKey" v-if="open2"/> | 36 | <threestepInfo :businessKey="businessKey" v-if="open2"/> |
| 37 | + <el-table :data="hisfromData" v-if="hisfromData != null"> | ||
| 38 | + | ||
| 39 | + <el-table-column label="审批意见" align="center" prop="controlValue"/> | ||
| 40 | + <el-table-column label="审批人" align="center" prop="createName"/> | ||
| 41 | + <el-table-column label="审批时间" align="center" prop="createTime"/> | ||
| 42 | + </el-table> | ||
| 37 | </el-dialog> | 43 | </el-dialog> |
| 38 | 44 | ||
| 39 | <el-dialog :title="title" :visible.sync="construct" width="300px" append-to-body> | 45 | <el-dialog :title="title" :visible.sync="construct" width="300px" append-to-body> |
| @@ -275,6 +281,7 @@ import taskhismethod from '@/api/taskhismethod' | @@ -275,6 +281,7 @@ import taskhismethod from '@/api/taskhismethod' | ||
| 275 | company:false, | 281 | company:false, |
| 276 | driver:false, | 282 | driver:false, |
| 277 | vehicle:false, | 283 | vehicle:false, |
| 284 | + hisfromData:[], | ||
| 278 | }; | 285 | }; |
| 279 | }, | 286 | }, |
| 280 | created() { | 287 | created() { |
trash-workFlow/src/main/java/com/trash/business/controller/TruckActivateController.java
| @@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 18 | import org.springframework.web.bind.annotation.RequestMapping; | 18 | import org.springframework.web.bind.annotation.RequestMapping; |
| 19 | import org.springframework.web.bind.annotation.RestController; | 19 | import org.springframework.web.bind.annotation.RestController; |
| 20 | import com.trash.common.annotation.Log; | 20 | import com.trash.common.annotation.Log; |
| 21 | +import com.trash.common.annotation.RepeatSubmit; | ||
| 21 | import com.trash.common.core.controller.BaseController; | 22 | import com.trash.common.core.controller.BaseController; |
| 22 | import com.trash.common.core.domain.AjaxResult; | 23 | import com.trash.common.core.domain.AjaxResult; |
| 23 | import com.trash.common.enums.BusinessType; | 24 | import com.trash.common.enums.BusinessType; |
| @@ -182,6 +183,7 @@ public class TruckActivateController extends BaseController | @@ -182,6 +183,7 @@ public class TruckActivateController extends BaseController | ||
| 182 | */ | 183 | */ |
| 183 | @Log(title = "车辆激活", businessType = BusinessType.INSERT) | 184 | @Log(title = "车辆激活", businessType = BusinessType.INSERT) |
| 184 | @PostMapping | 185 | @PostMapping |
| 186 | + @RepeatSubmit | ||
| 185 | public AjaxResult add(@RequestBody TruckActivate truckActivate) | 187 | public AjaxResult add(@RequestBody TruckActivate truckActivate) |
| 186 | { | 188 | { |
| 187 | return truckActivateService.insertTruckActivate(truckActivate); | 189 | return truckActivateService.insertTruckActivate(truckActivate); |
trash-workFlow/src/main/java/com/trash/business/service/ISupervisionThreestepService.java
| @@ -68,7 +68,7 @@ public interface ISupervisionThreestepService | @@ -68,7 +68,7 @@ public interface ISupervisionThreestepService | ||
| 68 | * @return 结果 | 68 | * @return 结果 |
| 69 | */ | 69 | */ |
| 70 | 70 | ||
| 71 | - public void checkDataToActiveTruck(SupervisionThreestep supervisionThreestep, String tOKEN); | 71 | + public void checkDataToActiveTruck(String token); |
| 72 | 72 | ||
| 73 | int deleteSupervisionThreestepById(Long id); | 73 | int deleteSupervisionThreestepById(Long id); |
| 74 | 74 |
trash-workFlow/src/main/java/com/trash/business/service/impl/SupervisionThreestepServiceImpl.java
| @@ -809,28 +809,24 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer | @@ -809,28 +809,24 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer | ||
| 809 | } | 809 | } |
| 810 | 810 | ||
| 811 | @Override | 811 | @Override |
| 812 | - public void checkDataToActiveTruck(SupervisionThreestep construct,String token){ | ||
| 813 | - | ||
| 814 | - String trucks = construct.getCompanyTrucks(); | ||
| 815 | - | 812 | + public void checkDataToActiveTruck(String token){ |
| 813 | + | ||
| 816 | 814 | ||
| 817 | - String[] truckArray = trucks.split(","); | 815 | + String[] truckArray; |
| 818 | 816 | ||
| 819 | String unActiveTruck = ""; | 817 | String unActiveTruck = ""; |
| 820 | 818 | ||
| 821 | - for(String truckId:truckArray){ | ||
| 822 | - | ||
| 823 | TruckActivate truckActivate = new TruckActivate(); | 819 | TruckActivate truckActivate = new TruckActivate(); |
| 824 | - truckActivate.setObjectId(truckId); //设置ID | ||
| 825 | - truckActivate.setCreateTime(construct.getCheckTime()); | ||
| 826 | truckActivate.setStatus(0L); | 820 | truckActivate.setStatus(0L); |
| 821 | + truckActivate.setActivateStatus("0"); | ||
| 827 | 822 | ||
| 828 | List<TruckActivate> taList = truckActivateService.selectTruckActivateList(truckActivate); | 823 | List<TruckActivate> taList = truckActivateService.selectTruckActivateList(truckActivate); |
| 829 | 824 | ||
| 830 | - if(taList.size() == 0 || taList.get(0).getActivateTime() == null){ | ||
| 831 | - unActiveTruck += truckId + ","; | 825 | + for(TruckActivate ta:taList){ |
| 826 | + unActiveTruck += ta.getObjectId() + ","; | ||
| 832 | } | 827 | } |
| 833 | - } | 828 | + |
| 829 | + | ||
| 834 | 830 | ||
| 835 | 831 | ||
| 836 | if(!unActiveTruck.isEmpty()){ | 832 | if(!unActiveTruck.isEmpty()){ |
| @@ -841,7 +837,6 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer | @@ -841,7 +837,6 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer | ||
| 841 | 837 | ||
| 842 | truckArray = unActiveTruck.split(","); | 838 | truckArray = unActiveTruck.split(","); |
| 843 | 839 | ||
| 844 | - | ||
| 845 | params.put("vehicleIds", truckArray); | 840 | params.put("vehicleIds", truckArray); |
| 846 | params.put("page", 1); | 841 | params.put("page", 1); |
| 847 | params.put("size", 9999); | 842 | params.put("size", 9999); |
| @@ -850,49 +845,24 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer | @@ -850,49 +845,24 @@ public class SupervisionThreestepServiceImpl implements ISupervisionThreestepSer | ||
| 850 | array = RemoteServerUtils.getTruckOnline(params); | 845 | array = RemoteServerUtils.getTruckOnline(params); |
| 851 | else | 846 | else |
| 852 | array = RemoteServerUtils.getTruckOnline(params,token); | 847 | array = RemoteServerUtils.getTruckOnline(params,token); |
| 853 | - | 848 | + |
| 849 | + if(array == null) | ||
| 850 | + return; | ||
| 851 | + | ||
| 854 | for(Object object :array){ | 852 | for(Object object :array){ |
| 855 | JSONObject truckObject = (JSONObject)object; | 853 | JSONObject truckObject = (JSONObject)object; |
| 856 | 854 | ||
| 857 | - for(String truck: truckArray){ | 855 | + for(TruckActivate ta:taList){ |
| 858 | 856 | ||
| 859 | - if(truckObject.getString("vehicleId").equals(truck)){ | ||
| 860 | - TruckActivate truckActivate = new TruckActivate(); | ||
| 861 | - | ||
| 862 | - truckActivate.setStatus(0L); //当前数据 | ||
| 863 | - truckActivate.setObjectId(truck); //设置ID | ||
| 864 | - | ||
| 865 | - List<TruckActivate> taList = truckActivateService.selectTruckActivateList(truckActivate); | ||
| 866 | - | ||
| 867 | - if(taList.size() == 1){ | ||
| 868 | - if(taList.get(0).getActivateTime() != null){ //已激活 | ||
| 869 | - continue; | ||
| 870 | - } | ||
| 871 | - truckActivate = taList.get(0); | ||
| 872 | - } | ||
| 873 | - | ||
| 874 | - truckActivate.setConstruction(construct.getName()); | ||
| 875 | - truckActivate.setEarthsite(construct.getEarthsitesName()); | ||
| 876 | - | ||
| 877 | - if(truckObject != null) | ||
| 878 | - truckActivate.setLicensePlate(truckObject.getString("licenseplateNo"));//设置车牌号 | 857 | + if(truckObject.getString("vehicleId").equals(ta.getObjectId())){ |
| 879 | 858 | ||
| 880 | - | ||
| 881 | - JSONObject truckInfo = RemoteServerUtils.getTruckInfo(truck,token); | ||
| 882 | - if(truckInfo != null) | ||
| 883 | - truckActivate.setCompany(truckInfo.getString("companyName")); | ||
| 884 | if(truckObject.getInteger("vehicleStatus") == 1){ | 859 | if(truckObject.getInteger("vehicleStatus") == 1){ |
| 885 | - truckActivate.setActivateTime(new Date()); | ||
| 886 | - } | ||
| 887 | - | ||
| 888 | - if(taList.size() > 0){ | ||
| 889 | - truckActivate.setId(taList.get(0).getId()); | ||
| 890 | - truckActivateMapper.updateTruckActivate(truckActivate); | 860 | + ta.setActivateTime(new Date()); |
| 891 | }else{ | 861 | }else{ |
| 892 | - truckActivate.setCreateTime(new Date()); | ||
| 893 | - | ||
| 894 | - truckActivateMapper.insertTruckActivate(truckActivate); | 862 | + continue; |
| 895 | } | 863 | } |
| 864 | + | ||
| 865 | + truckActivateMapper.updateTruckActivate(ta); | ||
| 896 | 866 | ||
| 897 | break; | 867 | break; |
| 898 | } | 868 | } |
trash-workFlow/src/main/java/com/trash/workflow/service/impl/WorkflowServiceImpl.java
| @@ -36,6 +36,8 @@ import org.springframework.transaction.annotation.Transactional; | @@ -36,6 +36,8 @@ import org.springframework.transaction.annotation.Transactional; | ||
| 36 | 36 | ||
| 37 | import com.alibaba.fastjson.JSONArray; | 37 | import com.alibaba.fastjson.JSONArray; |
| 38 | import com.alibaba.fastjson.JSONObject; | 38 | import com.alibaba.fastjson.JSONObject; |
| 39 | +import com.trash.activiti.domain.ActWorkflowFormData; | ||
| 40 | +import com.trash.activiti.service.IActWorkflowFormDataService; | ||
| 39 | import com.trash.business.domain.ConstructionSign; | 41 | import com.trash.business.domain.ConstructionSign; |
| 40 | import com.trash.business.domain.SupervisionThreestep; | 42 | import com.trash.business.domain.SupervisionThreestep; |
| 41 | import com.trash.business.service.IConstructionSignService; | 43 | import com.trash.business.service.IConstructionSignService; |
| @@ -88,8 +90,12 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -88,8 +90,12 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 88 | 90 | ||
| 89 | 91 | ||
| 90 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 92 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 93 | + | ||
| 91 | 94 | ||
| 92 | @Autowired | 95 | @Autowired |
| 96 | + IActWorkflowFormDataService awfServer; | ||
| 97 | + | ||
| 98 | + @Autowired | ||
| 93 | RuntimeService runtimeService; | 99 | RuntimeService runtimeService; |
| 94 | 100 | ||
| 95 | @Autowired | 101 | @Autowired |
| @@ -132,6 +138,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -132,6 +138,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 132 | } | 138 | } |
| 133 | 139 | ||
| 134 | ProcessInstance processInstance = null; | 140 | ProcessInstance processInstance = null; |
| 141 | + ActWorkflowFormData awf = null; | ||
| 135 | 142 | ||
| 136 | try { | 143 | try { |
| 137 | 144 | ||
| @@ -158,6 +165,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -158,6 +165,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 158 | signService.insertConstructionSign(constructionSign); | 165 | signService.insertConstructionSign(constructionSign); |
| 159 | 166 | ||
| 160 | } | 167 | } |
| 168 | + | ||
| 161 | 169 | ||
| 162 | Workflow workflow = new Workflow(); | 170 | Workflow workflow = new Workflow(); |
| 163 | workflow.setId(businessKey); | 171 | workflow.setId(businessKey); |
| @@ -171,10 +179,16 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -171,10 +179,16 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 171 | workflow.setCreateTime(new Date()); | 179 | workflow.setCreateTime(new Date()); |
| 172 | workflow.setCreateBy(user.getUserName()); | 180 | workflow.setCreateBy(user.getUserName()); |
| 173 | 181 | ||
| 182 | + awf = insertAwf(user,workflow); | ||
| 183 | + | ||
| 174 | return workflowMapper.insertWorkflow(workflow); | 184 | return workflowMapper.insertWorkflow(workflow); |
| 175 | } catch (Exception e) { | 185 | } catch (Exception e) { |
| 176 | - | ||
| 177 | - processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | 186 | + |
| 187 | + if(processInstance != null) | ||
| 188 | + processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | ||
| 189 | + | ||
| 190 | + if(awf.getId() != null) | ||
| 191 | + awfServer.deleteActWorkflowFormDataById(awf.getId()); | ||
| 178 | 192 | ||
| 179 | e.printStackTrace(); | 193 | e.printStackTrace(); |
| 180 | } | 194 | } |
| @@ -182,11 +196,38 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -182,11 +196,38 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 182 | return 0; | 196 | return 0; |
| 183 | } | 197 | } |
| 184 | 198 | ||
| 199 | + private ActWorkflowFormData insertAwf(SysUser user ,Workflow workflow) { | ||
| 200 | + | ||
| 201 | + if(user == null){ | ||
| 202 | + user = new SysUser(); | ||
| 203 | + user.setUserName("定时器"); | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + ActWorkflowFormData awf; | ||
| 207 | + awf = new ActWorkflowFormData(); | ||
| 208 | + awf.setCreateBy(user.getUserName()); | ||
| 209 | + awf.setCreateName(user.getUserName()); | ||
| 210 | + awf.setCreateTime(new Date()); | ||
| 211 | + awf.setBusinessKey(workflow.getId()); | ||
| 212 | + awf.setControlId("CREATED"); | ||
| 213 | + awf.setControlName("发起人"); | ||
| 214 | + awf.setFormKey("CREATED"); | ||
| 215 | + awf.setTaskNodeName(user.getUserName() + "发起"); | ||
| 216 | + awf.setControlValue(workflow.getTitle()); | ||
| 217 | + | ||
| 218 | + awfServer.insertActWorkflowFormData(awf); | ||
| 219 | + return awf; | ||
| 220 | + } | ||
| 221 | + | ||
| 185 | @Override | 222 | @Override |
| 186 | @Transactional | 223 | @Transactional |
| 187 | public int createLeaveWorkFlow(Workflow workflow, int index) { | 224 | public int createLeaveWorkFlow(Workflow workflow, int index) { |
| 188 | ProcessInstance processInstance = null; | 225 | ProcessInstance processInstance = null; |
| 189 | 226 | ||
| 227 | + ActWorkflowFormData awf = null; | ||
| 228 | + | ||
| 229 | + SysUser user = SecurityUtils.getLoginUser().getUser(); | ||
| 230 | + | ||
| 190 | try { | 231 | try { |
| 191 | 232 | ||
| 192 | processInstance = processRuntime.start(ProcessPayloadBuilder.start() | 233 | processInstance = processRuntime.start(ProcessPayloadBuilder.start() |
| @@ -207,13 +248,18 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -207,13 +248,18 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 207 | 248 | ||
| 208 | taskService.saveTask(task); | 249 | taskService.saveTask(task); |
| 209 | } | 250 | } |
| 251 | + | ||
| 210 | 252 | ||
| 253 | + awf = insertAwf(user,workflow); | ||
| 254 | + | ||
| 211 | workflow.setInstanceId(processInstance.getId()); | 255 | workflow.setInstanceId(processInstance.getId()); |
| 212 | 256 | ||
| 213 | workflow.setCreateTime(new Date()); | 257 | workflow.setCreateTime(new Date()); |
| 214 | return workflowMapper.insertWorkflow(workflow); | 258 | return workflowMapper.insertWorkflow(workflow); |
| 215 | } catch (Exception e) { | 259 | } catch (Exception e) { |
| 216 | 260 | ||
| 261 | + if(awf.getId() != null) | ||
| 262 | + awfServer.deleteActWorkflowFormDataById(awf.getId()); | ||
| 217 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | 263 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); |
| 218 | 264 | ||
| 219 | e.printStackTrace(); | 265 | e.printStackTrace(); |
| @@ -226,6 +272,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -226,6 +272,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 226 | @Transactional | 272 | @Transactional |
| 227 | public int createThreeStepWorkFlow(SupervisionThreestep supervision) { // 三查 | 273 | public int createThreeStepWorkFlow(SupervisionThreestep supervision) { // 三查 |
| 228 | ProcessInstance processInstance = null; | 274 | ProcessInstance processInstance = null; |
| 275 | + ActWorkflowFormData awf = null; | ||
| 229 | try { | 276 | try { |
| 230 | String name = "报工自查:" + supervision.getName(); | 277 | String name = "报工自查:" + supervision.getName(); |
| 231 | processInstance = processRuntime.start(ProcessPayloadBuilder.start() | 278 | processInstance = processRuntime.start(ProcessPayloadBuilder.start() |
| @@ -244,10 +291,16 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -244,10 +291,16 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 244 | workflow.setInstanceId(processInstance.getId()); | 291 | workflow.setInstanceId(processInstance.getId()); |
| 245 | workflow.setState("0"); | 292 | workflow.setState("0"); |
| 246 | workflow.setCreateTime(new Date()); | 293 | workflow.setCreateTime(new Date()); |
| 294 | + | ||
| 295 | + | ||
| 296 | + SysUser user = SecurityUtils.getLoginUser().getUser(); | ||
| 297 | + awf = insertAwf(user,workflow); | ||
| 247 | 298 | ||
| 248 | return workflowMapper.insertWorkflow(workflow); | 299 | return workflowMapper.insertWorkflow(workflow); |
| 249 | } catch (Exception e) { | 300 | } catch (Exception e) { |
| 250 | e.printStackTrace(); | 301 | e.printStackTrace(); |
| 302 | + if(awf.getId() != null) | ||
| 303 | + awfServer.deleteActWorkflowFormDataById(awf.getId()); | ||
| 251 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | 304 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); |
| 252 | } | 305 | } |
| 253 | 306 | ||
| @@ -258,6 +311,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -258,6 +311,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 258 | @Transactional | 311 | @Transactional |
| 259 | public int createCaseFile(ViolationCaseFile caseFile, int index) { // 三查 | 312 | public int createCaseFile(ViolationCaseFile caseFile, int index) { // 三查 |
| 260 | ProcessInstance processInstance = null; | 313 | ProcessInstance processInstance = null; |
| 314 | + ActWorkflowFormData awf = null; | ||
| 261 | String title = "案卷号:" + caseFile.getNumber(); | 315 | String title = "案卷号:" + caseFile.getNumber(); |
| 262 | String flowType = "workflow_casefile"; | 316 | String flowType = "workflow_casefile"; |
| 263 | try { | 317 | try { |
| @@ -291,9 +345,13 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -291,9 +345,13 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 291 | workflow.setState("0"); | 345 | workflow.setState("0"); |
| 292 | workflow.setCreateTime(new Date()); | 346 | workflow.setCreateTime(new Date()); |
| 293 | 347 | ||
| 348 | + SysUser user = SecurityUtils.getLoginUser().getUser(); | ||
| 349 | + awf = insertAwf(user,workflow); | ||
| 294 | return workflowMapper.insertWorkflow(workflow); | 350 | return workflowMapper.insertWorkflow(workflow); |
| 295 | } catch (Exception e) { | 351 | } catch (Exception e) { |
| 296 | e.printStackTrace(); | 352 | e.printStackTrace(); |
| 353 | + if(awf.getId() != null) | ||
| 354 | + awfServer.deleteActWorkflowFormDataById(awf.getId()); | ||
| 297 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | 355 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); |
| 298 | throw new RuntimeException(e); | 356 | throw new RuntimeException(e); |
| 299 | } | 357 | } |
| @@ -310,6 +368,20 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -310,6 +368,20 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 310 | } | 368 | } |
| 311 | loginService.loginByRemote(trashConfig.getToken()); | 369 | loginService.loginByRemote(trashConfig.getToken()); |
| 312 | } | 370 | } |
| 371 | + | ||
| 372 | + | ||
| 373 | + | ||
| 374 | + SysUser user = null; | ||
| 375 | + | ||
| 376 | + try { | ||
| 377 | + user = SecurityUtils.getLoginUser().getUser(); | ||
| 378 | + } catch (Exception e) { | ||
| 379 | +// e.printStackTrace(); | ||
| 380 | + } | ||
| 381 | + | ||
| 382 | + | ||
| 383 | + | ||
| 384 | + | ||
| 313 | SecurityContextImpl securityContextImpl = new SecurityContextImpl(); | 385 | SecurityContextImpl securityContextImpl = new SecurityContextImpl(); |
| 314 | 386 | ||
| 315 | securityContextImpl.setAuthentication(SecurityContextHolder.getContext().getAuthentication()); | 387 | securityContextImpl.setAuthentication(SecurityContextHolder.getContext().getAuthentication()); |
| @@ -320,6 +392,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -320,6 +392,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 320 | if(index > 0 && caseFile.getOwningRegion().contains("湘江新区")){ | 392 | if(index > 0 && caseFile.getOwningRegion().contains("湘江新区")){ |
| 321 | index += 3; | 393 | index += 3; |
| 322 | } | 394 | } |
| 395 | + ActWorkflowFormData awf = null; | ||
| 323 | 396 | ||
| 324 | try { | 397 | try { |
| 325 | Map map = new HashedMap<>(); | 398 | Map map = new HashedMap<>(); |
| @@ -350,9 +423,14 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -350,9 +423,14 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 350 | workflow.setInstanceId(instance.getId()); | 423 | workflow.setInstanceId(instance.getId()); |
| 351 | workflow.setState("0"); | 424 | workflow.setState("0"); |
| 352 | workflow.setCreateTime(new Date()); | 425 | workflow.setCreateTime(new Date()); |
| 426 | + | ||
| 427 | + | ||
| 428 | + awf = insertAwf(user,workflow); | ||
| 353 | 429 | ||
| 354 | return workflowMapper.insertWorkflow(workflow); | 430 | return workflowMapper.insertWorkflow(workflow); |
| 355 | } catch (Exception e) { | 431 | } catch (Exception e) { |
| 432 | + if(awf.getId() != null) | ||
| 433 | + awfServer.deleteActWorkflowFormDataById(awf.getId()); | ||
| 356 | runtimeService.deleteProcessInstance(instance.getId(), "创建失败"); | 434 | runtimeService.deleteProcessInstance(instance.getId(), "创建失败"); |
| 357 | throw new RuntimeException(e); | 435 | throw new RuntimeException(e); |
| 358 | } | 436 | } |
| @@ -363,6 +441,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -363,6 +441,7 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 363 | @Transactional | 441 | @Transactional |
| 364 | public int createCaseOffline(CaseOffline caseOffline) { // 三查 | 442 | public int createCaseOffline(CaseOffline caseOffline) { // 三查 |
| 365 | ProcessInstance processInstance = null; | 443 | ProcessInstance processInstance = null; |
| 444 | + ActWorkflowFormData awf = null; | ||
| 366 | try { | 445 | try { |
| 367 | 446 | ||
| 368 | String title = "案卷号:" + caseOffline.getNumber(); | 447 | String title = "案卷号:" + caseOffline.getNumber(); |
| @@ -384,8 +463,22 @@ public class WorkflowServiceImpl implements IWorkflowService { | @@ -384,8 +463,22 @@ public class WorkflowServiceImpl implements IWorkflowService { | ||
| 384 | workflow.setState("0"); | 463 | workflow.setState("0"); |
| 385 | workflow.setCreateTime(new Date()); | 464 | workflow.setCreateTime(new Date()); |
| 386 | 465 | ||
| 466 | + SysUser user = null; | ||
| 467 | + | ||
| 468 | + try { | ||
| 469 | + user = SecurityUtils.getLoginUser().getUser(); | ||
| 470 | + } catch (Exception e) { | ||
| 471 | +// e.printStackTrace(); | ||
| 472 | + } | ||
| 473 | + | ||
| 474 | + | ||
| 475 | + awf = insertAwf(user,workflow); | ||
| 476 | + | ||
| 477 | + | ||
| 387 | return workflowMapper.insertWorkflow(workflow); | 478 | return workflowMapper.insertWorkflow(workflow); |
| 388 | } catch (Exception e) { | 479 | } catch (Exception e) { |
| 480 | + if(awf.getId() != null) | ||
| 481 | + awfServer.deleteActWorkflowFormDataById(awf.getId()); | ||
| 389 | e.printStackTrace(); | 482 | e.printStackTrace(); |
| 390 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); | 483 | processRuntime.delete(ProcessPayloadBuilder.delete(processInstance)); |
| 391 | } | 484 | } |