Commit 0d928abbcd650c46192e55644e6955810dc74838

Authored by youxiw2000
1 parent f4045e9e

m

trash-activiti/src/main/java/com/trash/activiti/service/impl/ActTaskServiceImpl.java
... ... @@ -85,18 +85,17 @@ public class ActTaskServiceImpl implements IActTaskService {
85 85 Page<ActTaskDTO> list = new Page<ActTaskDTO>();
86 86  
87 87 if (ServletUtils.getParameter("role") != null) {
88   - List<String> posts = new ArrayList<>();
89   - posts.add(ServletUtils.getParameter("role"));
90   - SecurityUtils.getLoginUser().getUser().setPostIds(posts);
  88 + List<String> posts = new ArrayList<>();
  89 + posts.add(ServletUtils.getParameter("role"));
  90 + SecurityUtils.getLoginUser().getUser().setPostIds(posts);
91 91 }
92 92 if (ServletUtils.getParameter("dept") != null) {
93   - List<String> roles = new ArrayList<>();
94   - roles.add(ServletUtils.getParameter("dept"));
95   - SecurityUtils.getLoginUser().getUser().setRoleIds(roles);
  93 + List<String> roles = new ArrayList<>();
  94 + roles.add(ServletUtils.getParameter("dept"));
  95 + SecurityUtils.getLoginUser().getUser().setRoleIds(roles);
96 96 }
97   - if (SecurityUtils.getLoginUser().getUser().getPostIds().size() == 0
98   - || SecurityUtils.getLoginUser().getUser().getRoleIds().size() == 0) {
99   - return list;
  97 + if (SecurityUtils.getLoginUser().getUser().getPostIds().size() == 0 || SecurityUtils.getLoginUser().getUser().getRoleIds().size() == 0) {
  98 + return list;
100 99 }
101 100  
102 101 org.activiti.api.runtime.shared.query.Page<Task> pageTasks = taskRuntime
... ... @@ -159,8 +158,7 @@ public class ActTaskServiceImpl implements IActTaskService {
159 158  
160 159 if (processInstanceList.size() > 0) {
161 160 for (HistoricProcessInstance p : processInstanceList) {
162   - ActTaskDTO actTaskDTOS = new ActTaskDTO(p, maps.parallelStream()
163   - .filter(pi -> p.getId().equals(pi.get("instance_id"))).findAny().get());
  161 + ActTaskDTO actTaskDTOS = new ActTaskDTO(p, maps.parallelStream().filter(pi -> p.getId().equals(pi.get("instance_id"))).findAny().get());
164 162  
165 163 getCheckData(actTaskDTOS);
166 164  
... ...
trash-admin/src/main/resources/application-dev.yml
... ... @@ -16,9 +16,9 @@ trash:
16 16 # 验证码类型 math 数组计算 char 字符验证
17 17 captchaType: math
18 18 # 远程服务器地址
19   - remotePath: http://175.6.47.84:8008
  19 + #remotePath: http://175.6.47.84:8008
20 20 #token: durable:auth:token:eyJhbGciOiJIUzUxMiJ9.eyJ5ZWEiOiJjc3poIiwiZXhwIjo0MTAyNDE1OTk5LCJjcmVhdGVkIjoxNjg0MzI3NzQ1ODkyfQ.4BrpgD9i_1TwjLRGqa3wo4Ikx8t8Gcl3FzHfjL_uolPnNMm2rd7fCvrUoBBN4Qp4cMGzg9h2Nt4NNx8PYThTaQ
21   - #remotePath: http://183.66.242.6:14601
  21 + remotePath: http://183.66.242.6:14601
22 22 token: durable:auth:token:eyJhbGciOiJIUzUxMiJ9.eyJ5ZWEiOiJjc3poIiwiZXhwIjo0MTAyNDE1OTk5LCJjcmVhdGVkIjoxNjg0NDU5MjEzNzQ2fQ.85oIrOnU7cz7L_-IGt4Bt1LXDTkFtyrdqNt05K0v9-4nsrrzzpbjbemK-yMlbnUpe4Fx2FFES-Wbw8Yr8ML69w
23 23  
24 24 # 数据源配置
... ...
trash-admin/src/main/resources/application.yml
... ... @@ -76,12 +76,11 @@ pagehelper:
76 76 # Swagger配置
77 77 swagger:
78 78 # 是否开启swagger
79   - enabled: true
  79 + enabled: false
80 80 # 请求前缀
81 81 pathMapping: /dev-api
82 82  
83 83  
84   -
85 84 # 防止XSS攻击
86 85 xss:
87 86 # 过滤开关
... ...
trash-common/src/main/java/com/trash/common/utils/RemoteServerUtils.java
... ... @@ -37,6 +37,8 @@ public class RemoteServerUtils {
37 37  
38 38 public static String TruckStatusListRequestPath = "/api/gpsservice/cs/basevehicle/statusquery";
39 39  
  40 +
  41 +
40 42 public static String TruckInfo = "/api/gpsservice/cs/basevehicle/";
41 43 public static String EarthSitesInfo = "/api/siteservice/cs/earthsites/";
42 44  
... ... @@ -61,10 +63,14 @@ public class RemoteServerUtils {
61 63  
62 64 public static String DriverListPath = "/api/gpsservice/v1/drivers/search";
63 65  
64   -
  66 + public static String CompanyUpdateAudit = "/api/gpsservice/cs/companies/audit/status";
65 67  
  68 + public static String TruckUpdateAudit = "/api/gpsservice/cs/basevehicle/audit/status";
  69 +
  70 + public static String DriverUpdateAudit = "/api/gpsservice/v1/drivers/audit/status";
  71 +
66 72 public static String BasevehicleInfo = "/api/gpsservice/cs/basevehicle/";
67   -
  73 +
68 74 public static JSONArray getEarthSitesList(Map map){
69 75 JSONArray list=null;
70 76 Object object = post(EarthSitesList,map);
... ... @@ -138,6 +144,21 @@ public class RemoteServerUtils {
138 144 return object;
139 145 }
140 146  
  147 + public static Object updateCompanyAudit(List<Map> map){
  148 + Object object = post(CompanyUpdateAudit,map);
  149 + return object;
  150 + }
  151 +
  152 + public static Object updateTruckAudit(List<Map> map){
  153 + Object object = post(TruckUpdateAudit,map);
  154 + return object;
  155 + }
  156 +
  157 + public static Object updateDriverAudit(List<Map> map){
  158 + Object object = post(DriverUpdateAudit,map);
  159 + return object;
  160 + }
  161 +
141 162 public static Object updateEarthSitesCreditAndStatus(List<Map> map){
142 163 JSONArray turckList=null;
143 164 Object object = post(UpdateEarthSiteRequestPath,map);
... ...
trash-ui/src/api/dict.js
... ... @@ -120,7 +120,25 @@ export function getConstructionTruck(id) {
120 120 });
121 121 }
122 122  
  123 +export function getTruckInfo(id) {
  124 + return requestRemote({
  125 + url: '/api/gpsservice/cs/basevehicle/' + id,
  126 + method: 'get',
  127 + });
  128 +}
123 129  
  130 +export function getCompanyInfo(id) {
  131 + return requestRemote({
  132 + url: '/api/gpsservice/cs/companies/' + id,
  133 + method: 'get',
  134 + });
  135 +}
  136 +export function getDriverInfo(id) {
  137 + return requestRemote({
  138 + url: '/api/gpsservice/v1/drivers/' + id,
  139 + method: 'get',
  140 + });
  141 +}
124 142  
125 143  
126 144 export function getArea(params) {
... ...
trash-ui/src/api/three_step.js
... ... @@ -193,7 +193,6 @@
193 193 },
194 194 created() {
195 195 if(window.location.search){
196   - debugger;
197 196 let arr = window.location.search.split("&");
198 197 if(arr[0].split("=")[0] != "?token")
199 198 this.queryParams.pageStatus = arr[0].split("=")[1];
... ... @@ -237,6 +236,17 @@
237 236 this.form.objectId = item.constructionSiteID;
238 237 this.form.earthsitesName = item.earthSiteName;
239 238 this.form.earthsitesId = item.earthSiteID;
  239 +
  240 + let constru;
  241 + for(let i in this.remoteData){
  242 + if(this.remoteData[i].name == item.constructionSiteName){
  243 + constru = this.remoteData[i];
  244 + break;
  245 + }
  246 + }
  247 +
  248 + this.filterCompany(constru);
  249 +
240 250 }else{
241 251 this.form.earthsitesName = item.constructionSiteName;
242 252 this.form.earthsitesId = item.constructionSiteID;
... ... @@ -309,15 +319,15 @@
309 319 this.form.objectId = item.id;
310 320 this.form.place = Number(item.areaCode);
311 321 this.filterConract();
312   -
  322 +
313 323 if(this.filterContract.length == 0){
314 324 this.$message("未找到对应消纳合同");
315 325 this.form.objectId = null;
316 326 this.form.name = null;
317 327 }
318   -
  328 +
319 329 this.filterConract();
320   -
  330 +
321 331 for(let i in this.filterContract){
322 332 if(this.filterContract[i].constructionSiteID == objId || this.filterContract[i].earthSiteID == objId){
323 333 this.form.earthsitesName = name;
... ... @@ -332,46 +342,51 @@
332 342 'size':9999,
333 343 }
334 344  
335   - this.form.companys = null;
336   - this.form.companyTrucks = null;
337   - this.companyList = [];
338   - this.truckList = [];
339   -
340   - mainworkcompany(item.id).then(response => {
  345 +
341 346  
342   - this.companyList.push({id:item.transportCompanyId , name: item.transportCompany});
  347 + this.filterCompany(item);
  348 + }
343 349  
344   - let query = {
345   - 'page':1,
346   - 'size':9999,
347   - 'dishonestState':0,
348   - 'valid':0
349   - }
  350 + },
  351 + filterCompany(item){
  352 + this.form.companys = null;
  353 + this.form.companyTrucks = null;
  354 + this.companyList = [];
  355 + this.truckList = [];
  356 +
  357 + mainworkcompany(item.id).then(response => {
  358 +
  359 + this.companyList.push({id:item.transportCompanyId , name: item.transportCompany});
  360 +
  361 + let query = {
  362 + 'page':1,
  363 + 'size':9999,
  364 + 'dishonestState':0,
  365 + 'valid':0
  366 + }
350 367  
351   - let ids = [];
  368 + let ids = [];
352 369  
353   - ids.push(item.transportCompanyId);
  370 + ids.push(item.transportCompanyId);
354 371  
355   - query.companyID = ids +"";
356   - query.valid = 0;
  372 + query.companyID = ids +"";
  373 + query.valid = 0;
357 374  
358   - getConstructionTruck(item.id).then(res=>{
359   - for(let i in res.result){
360   - this.companyList.push({id:res.result[i].companyId , name: res.result[i].companyName});
361   - for(let j in res.result[i].vehicleList){
362   - this.truckList.push({id:res.result[i].vehicleList[j].id,licenseplateNo:res.result[i].vehicleList[j].licenseplateNo,companyName:res.result[i].companyName});
363   - }
  375 + getConstructionTruck(item.id).then(res=>{
  376 + for(let i in res.result){
  377 + this.companyList.push({id:res.result[i].companyId , name: res.result[i].companyName});
  378 + for(let j in res.result[i].vehicleList){
  379 + this.truckList.push({id:res.result[i].vehicleList[j].id,licenseplateNo:res.result[i].vehicleList[j].licenseplateNo,companyName:res.result[i].companyName});
364 380 }
365   - truckList(query).then(res=>{
366   - for(let i in res.result.list){
367   - this.truckList.push(res.result.list[i]);
368   - }
369   - });
370   -
371   - });
  381 + }
  382 + truckList(query).then(res=>{
  383 + for(let i in res.result.list){
  384 + this.truckList.push(res.result.list[i]);
  385 + }
372 386 });
373   - }
374 387  
  388 + });
  389 + });
375 390 },
376 391 filterConract(){
377 392 let cId;
... ... @@ -449,7 +464,7 @@
449 464 this.form.earthSiteID = null;
450 465 this.$message("未找到对应消纳合同!!");
451 466 }
452   -
  467 +
453 468 this.filterConract();
454 469  
455 470 for(let i in this.filterContract){
... ...
trash-ui/src/layout/index.vue
1 1 <template>
2   - <div :class="classObj" class="app-wrapper">
3   - <sidebar class="sidebar-container" />
4   - <div :class="{hasTagsView:needTagsView}" class="main-container">
5   - <tags-view v-if="needTagsView" />
6 2 <app-main />
7   -
8   - </div>
9   - </div>
10 3 </template>
11 4  
12 5 <script>
... ...
trash-ui/src/layout/index5.vue renamed to trash-ui/src/layout/index4.vue
1 1 <template>
  2 + <div :class="classObj" class="app-wrapper">
  3 + <sidebar class="sidebar-container" />
  4 + <div :class="{hasTagsView:needTagsView}" class="main-container">
  5 + <tags-view v-if="needTagsView" />
2 6 <app-main />
  7 +
  8 + </div>
  9 + </div>
3 10 </template>
4 11  
5 12 <script>
... ...
trash-ui/src/views/activiti/task/companyInfo.vue 0 → 100644
  1 +<template>
  2 + <div v-loading="loading" style="border: 1px solid black;">
  3 + <el-row >
  4 + <el-col :span="6" class="bd">企业名称</el-col>
  5 + <el-col :span="6" class="bd">{{infoData.name}}</el-col>
  6 +
  7 + <el-col :span="6" class="bd bd_left">企业简称</el-col>
  8 + <el-col :span="6" class="bd">{{infoData.abbreviation}}</el-col>
  9 +
  10 + </el-row>
  11 + <el-row >
  12 + <el-col :span="6" class="bd">注册所属区域</el-col>
  13 + <el-col :span="6" class="bd">{{infoData.areaName}}</el-col>
  14 +
  15 + <el-col :span="6" class="bd">实际办公地址</el-col>
  16 + <el-col :span="6" class="bd">{{infoData.officeAddress}}</el-col>
  17 +
  18 +
  19 + </el-row>
  20 +
  21 + <el-row >
  22 + <el-col :span="6" class="bd">社会统一信用代码编号</el-col>
  23 + <el-col :span="6" class="bd">{{infoData.creditCode}}</el-col>
  24 + <el-col :span="6" class="bd bd_left">法人代表姓名及联系方式</el-col>
  25 + <el-col :span="6" class="bd">{{infoData.corporation}}:{{infoData.corporationPhoneNo}}</el-col>
  26 + </el-row>
  27 +
  28 + <el-row >
  29 + <el-col :span="6" class="bd">企业安全负责人姓名及联系方式</el-col>
  30 + <el-col :span="6" class="bd">{{infoData.principal}}:{{infoData.principalPhoneNo}}</el-col>
  31 + <el-col :span="6" class="bd bd_left">安全管理人员</el-col>
  32 + <el-col :span="6" class="bd">{{infoData.safetyOfficer}}</el-col>
  33 + </el-row>
  34 +
  35 + <el-row >
  36 + <el-col :span="6" class="bd">停车场面积</el-col>
  37 + <el-col :span="6" class="bd">{{infoData.parkingArea}}</el-col>
  38 + <el-col :span="6" class="bd bd_left">停车场位置</el-col>
  39 + <el-col :span="6" class="bd">{{infoData.parkingAddress}}</el-col>
  40 + </el-row>
  41 + <el-row >
  42 + <el-col :span="6" class="bd">企业营业执照有效期</el-col>
  43 + <el-col :span="6" class="bd">{{infoData.businessLicenseValidTime}}</el-col>
  44 + <el-col :span="6" class="bd bd_left">企业道路运输经营许可证有效期</el-col>
  45 + <el-col :span="6" class="bd">{{infoData.registrationValidTime}}</el-col>
  46 + </el-row>
  47 + <el-row >
  48 + <el-col :span="6" class="bd bd_left">企业入市时间</el-col>
  49 + <el-col :span="6" class="bd">{{infoData.entryTime}}</el-col>
  50 + <el-col :span="6" class="bd bd_left">备注</el-col>
  51 + <el-col :span="6" class="bd">{{infoData.comment}}</el-col>
  52 + </el-row>
  53 +
  54 + <a v-for="item in infoData.attachmentList" @click="downloadFile(item.attachmentPath);">{{item.name}}</a>
  55 + </div>
  56 +</template>
  57 +
  58 +<script>
  59 +
  60 +
  61 +import store from "@/store";
  62 + import {
  63 + getToken
  64 + } from "@/utils/auth";
  65 +
  66 +
  67 + import {
  68 + getCompanyInfo,
  69 + getArea
  70 + } from "@/api/dict";
  71 +
  72 +
  73 + export default {
  74 + name: "ThreestepInfo",
  75 + props: {
  76 + businessKey: {
  77 + type: String
  78 + },
  79 + },
  80 + data() {
  81 + return {
  82 + sign: store.getters.avatar, //裁剪图片的地址
  83 + areas: [],
  84 + loading: null,
  85 + objectDict: {
  86 + constructionSiteID:"工地ID",
  87 + constructionSiteName:"工地名称",
  88 + earthSiteID:"消纳场ID",
  89 + earthSiteName:"消纳场名称",
  90 + absorbCapacity:"消纳容量",
  91 + startTime:"有效期开始时间 yyyy-mM-dd",
  92 + endTime:"有效期结束时间 yyyy-mM-dd",
  93 + type:"建筑垃圾类型ID",
  94 + typeName:"垃圾类型名称",
  95 + contractNo:"消纳合同编号",
  96 + routeName:"线路名称",
  97 + routeWidth:"线路宽度",
  98 + auditStatus:"审核状态 0-审核中 1-审核通过 2-审核驳回",
  99 + auditStatusName:"审核状态名称",
  100 + contractStatus:"合同状态",
  101 + contractStatusName:"合同状态名称",
  102 + routePoints:"线路信息"},
  103 +
  104 + infoData: {},
  105 + }
  106 + },
  107 + created() {
  108 + this.loading = true;
  109 + this.getInfo();
  110 +
  111 + },
  112 + methods: {
  113 + getInfo() {
  114 + let id;
  115 + if (this.businessKey.split(":").length == 2) {
  116 + id = this.businessKey.split(":")[1];
  117 + } else {
  118 + id = this.businessKey;
  119 + }
  120 +
  121 + getCompanyInfo(id).then(response => {
  122 +
  123 + this.infoData = response.result;
  124 + // getArea().then(res => {
  125 + // this.areas = res.result;
  126 + // this.loading = false;
  127 + // for (let i = 0; i < this.areas.length; i++) {
  128 + // if (Number(this.infoData.place) == this.areas[i].code) {
  129 + // this.infoData.place = this.areas[i].name;
  130 + // }
  131 + // }
  132 + // });
  133 +
  134 + // for(let i in obj){
  135 + // if(this.objectDict[i]){
  136 + // this.infoData.push({label:this.objectDict[i] ,value:obj[i]})
  137 + // }
  138 + // }
  139 + this.loading = false;
  140 + });
  141 + },
  142 + downloadFile(path){
  143 + window.location.href = "/remotedown/" + path;
  144 + }
  145 + }
  146 +
  147 + }
  148 +</script>
  149 +<style>
  150 + .bd{
  151 + padding:5px;
  152 + }
  153 +
  154 +
  155 +
  156 +</style>
... ...
trash-ui/src/views/activiti/task/driverInfo.vue 0 → 100644
  1 +<template>
  2 + <div v-loading="loading" style="border: 1px solid black;">
  3 + <el-row >
  4 + <el-col :span="12" class="bd">姓名</el-col>
  5 + <el-col :span="12" class="bd">{{infoData.name}}</el-col>
  6 + </el-row>
  7 + <el-row >
  8 + <el-col :span="12" class="bd">证件号</el-col>
  9 + <el-col :span="12" class="bd">{{infoData.identityNo}}</el-col>
  10 + </el-row>
  11 + <el-row >
  12 + <el-col :span="12" class="bd">所属公司</el-col>
  13 + <el-col :span="12" class="bd">{{infoData.companyName}}</el-col>
  14 + </el-row>
  15 +
  16 + <el-row >
  17 + <el-col :span="12" class="bd">从业资格证有效期</el-col>
  18 + <el-col :span="12" class="bd">{{infoData.qualificationCertValidEndAt}}</el-col>
  19 + </el-row>
  20 + <el-row >
  21 + <el-col :span="12" class="bd">驾驶证有效期</el-col>
  22 + <el-col :span="12" class="bd">{{infoData.endAt}}</el-col>
  23 + </el-row>
  24 +
  25 + <el-row >
  26 + <el-col :span="12" class="bd">安全教育培训</el-col>
  27 + <el-col :span="6" class="bd">{{infoData.safetyEducationDate}}</el-col>
  28 + <el-col :span="6" class="bd">{{infoData.safetyEducationContent}}</el-col>
  29 + </el-row>
  30 +
  31 + <el-row >
  32 + <el-col :span="12" class="bd">备注</el-col>
  33 + <el-col :span="12" class="bd">{{infoData.remark}}</el-col>
  34 + </el-row>
  35 +
  36 + <a v-for="item in infoData.attachmentList" @click="downloadFile(item.attachmentPath);">{{item.name}}</a>
  37 + </div>
  38 +</template>
  39 +
  40 +<script>
  41 +
  42 +
  43 +import store from "@/store";
  44 + import {
  45 + getToken
  46 + } from "@/utils/auth";
  47 +
  48 +
  49 + import {
  50 + getDriverInfo,
  51 + getArea
  52 + } from "@/api/dict";
  53 +
  54 +
  55 + export default {
  56 + name: "ThreestepInfo",
  57 + props: {
  58 + businessKey: {
  59 + type: String
  60 + },
  61 + },
  62 + data() {
  63 + return {
  64 + sign: store.getters.avatar, //裁剪图片的地址
  65 + areas: [],
  66 + loading: null,
  67 + infoData: {},
  68 + }
  69 + },
  70 + created() {
  71 + this.loading = true;
  72 + this.getInfo();
  73 +
  74 + },
  75 + methods: {
  76 + getInfo() {
  77 + let id;
  78 + if (this.businessKey.split(":").length == 2) {
  79 + id = this.businessKey.split(":")[1];
  80 + } else {
  81 + id = this.businessKey;
  82 + }
  83 +
  84 + getDriverInfo(id).then(response => {
  85 +
  86 + this.infoData = response;
  87 + // getArea().then(res => {
  88 + // this.areas = res.result;
  89 + // this.loading = false;
  90 + // for (let i = 0; i < this.areas.length; i++) {
  91 + // if (Number(this.infoData.place) == this.areas[i].code) {
  92 + // this.infoData.place = this.areas[i].name;
  93 + // }
  94 + // }
  95 + // });
  96 +
  97 + // for(let i in obj){
  98 + // if(this.objectDict[i]){
  99 + // this.infoData.push({label:this.objectDict[i] ,value:obj[i]})
  100 + // }
  101 + // }
  102 + this.loading = false;
  103 + });
  104 + },
  105 +
  106 + downloadFile(path){
  107 + window.location.href = "/remotedown/" + path;
  108 + }
  109 + }
  110 +
  111 + }
  112 +</script>
  113 +<style>
  114 + .bd{
  115 + padding:5px;
  116 + }
  117 +
  118 +
  119 +
  120 +</style>
... ...
trash-ui/src/views/activiti/task/index.vue
... ... @@ -330,12 +330,37 @@
330 330 </el-dialog>
331 331  
332 332 <el-dialog :title="title" :visible.sync="supervisionOpen" width="700px" append-to-body :close-on-click-modal="false">
333   - <supervisionInfo :infoData="supervisionData"/>
  333 + <supervisionInfo :infoData="supervisionData" v-if="supervisionOpen"/>
334 334 <div slot="footer" class="dialog-footer">
335 335 <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)">驳回</el-button>
336 336 <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">通过</el-button>
337 337 </div>
338 338 </el-dialog>
  339 +
  340 + <el-dialog :title="title" :visible.sync="company" width="700px" append-to-body :close-on-click-modal="false">
  341 + <companyInfo :businessKey="businessKey" v-if="company"/>
  342 + <div slot="footer" class="dialog-footer">
  343 + <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)">驳回</el-button>
  344 + <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">通过</el-button>
  345 + </div>
  346 + </el-dialog>
  347 +
  348 + <el-dialog :title="title" :visible.sync="vehicle" width="700px" append-to-body :close-on-click-modal="false">
  349 + <vehicleInfo :businessKey="businessKey" v-if="vehicle"/>
  350 + <div slot="footer" class="dialog-footer">
  351 + <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)">驳回</el-button>
  352 + <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">通过</el-button>
  353 + </div>
  354 + </el-dialog>
  355 +
  356 + <el-dialog :title="title" :visible.sync="driver" width="700px" append-to-body :close-on-click-modal="false">
  357 + <driverInfo :businessKey="businessKey" v-if="driver"/>
  358 + <div slot="footer" class="dialog-footer">
  359 + <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)">驳回</el-button>
  360 + <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">通过</el-button>
  361 + </div>
  362 + </el-dialog>
  363 +
339 364 </div>
340 365 </template>
341 366  
... ... @@ -391,6 +416,10 @@ import violationCaseFileInfo from &quot;@/views/casefile/violationCaseFile/violationC
391 416 import violationWarningInformationInfo from "@/views/casefile/violationWarningInformation/violationWarningInformationInfo";
392 417 import supervisionInfo from "./SupervisionInfo";
393 418  
  419 +import companyInfo from "@/views/activiti/task/companyInfo";
  420 +import driverInfo from "@/views/activiti/task/driverInfo";
  421 +import vehicleInfo from "@/views/activiti/task/vehicleInfo";
  422 +
394 423 export default {
395 424 name: "task",
396 425 components: {
... ... @@ -408,7 +437,10 @@ export default {
408 437 caseOfflineInfo,
409 438 violationCaseFileInfo,
410 439 violationWarningInformationInfo,
411   - supervisionInfo
  440 + supervisionInfo,
  441 + companyInfo,
  442 + driverInfo,
  443 + vehicleInfo
412 444 },
413 445 data() {
414 446 return {
... ... @@ -498,6 +530,9 @@ export default {
498 530 construct: false,
499 531 leaveApplicationOpen: false,
500 532 userNodes:[],
  533 + company:false,
  534 + driver:false,
  535 + vehicle:false,
501 536 };
502 537 },
503 538 created() {
... ... @@ -581,6 +616,10 @@ export default {
581 616 this.conferenceOpen=false;
582 617 this.construct=false;
583 618 this.leaveApplicationOpen=false;
  619 +
  620 + this.company=false;
  621 + this.driver=false;
  622 + this.vehicle=false;
584 623 this.reset();
585 624 },
586 625 // 表单重置
... ... @@ -699,6 +738,18 @@ export default {
699 738 })
700 739 return;
701 740 }
  741 + if(this.definitionKey == "workflow_company"){
  742 + this.company = true;
  743 + return;
  744 + }
  745 + if(this.definitionKey == "workflow_vehicle"){
  746 + this.vehicle = true;
  747 + return;
  748 + }
  749 + if(this.definitionKey == "workflow_driver"){
  750 + this.driver = true;
  751 + return;
  752 + }
702 753 this.open = true;
703 754 this.title = "审批";
704 755 });
... ... @@ -938,7 +989,15 @@ export default {
938 989 this.getList();
939 990 });
940 991 }
941   -
  992 + if(this.definitionKey == "workflow_company" ||
  993 + this.definitionKey == "workflow_driver" ||
  994 + this.definitionKey == "workflow_vehicle" ){
  995 + formDataSave(this.id, this.form.formData).then(response => {
  996 + this.msgSuccess("审批成功");
  997 + this.cancel();
  998 + this.getList();
  999 + });
  1000 + }
942 1001 },
943 1002 conferenceSubmitForm(value) {
944 1003 this.form.formData[0].controlValue = value;
... ...
trash-ui/src/views/activiti/task/vehicleInfo.vue 0 → 100644
  1 +<template>
  2 + <div v-loading="loading" style="border: 1px solid black;">
  3 + <el-row >
  4 + <el-col :span="6" class="bd">公司名称</el-col>
  5 + <el-col :span="6" class="bd">{{infoData.companyName}}</el-col>
  6 + <el-col :span="6" class="bd bd_left">所属区域</el-col>
  7 + <el-col :span="6" class="bd">{{infoData.areaName}}</el-col>
  8 + </el-row>
  9 + <el-row >
  10 + <el-col :span="6" class="bd">车辆类型</el-col>
  11 + <el-col :span="6" class="bd">{{infoData.energyTypeName}}</el-col>
  12 + <el-col :span="6" class="bd bd_left">车牌号码</el-col>
  13 + <el-col :span="6" class="bd">{{infoData.licenseplateNo}}</el-col>
  14 + </el-row>
  15 + <el-row >
  16 + <el-col :span="6" class="bd">车辆品牌</el-col>
  17 + <el-col :span="6" class="bd">{{infoData.brandName}}</el-col>
  18 + <el-col :span="6" class="bd bd_left">注册日期</el-col>
  19 + <el-col :span="6" class="bd">{{infoData.registerAt}}</el-col>
  20 + </el-row>
  21 +
  22 + <el-row >
  23 + <el-col :span="6" class="bd">道路运输证有效期</el-col>
  24 + <el-col :span="6" class="bd">{{infoData.transportCertValid}}</el-col>
  25 + <el-col :span="6" class="bd bd_left">行驶证有效期</el-col>
  26 + <el-col :span="6" class="bd">{{infoData.licenseValid}}</el-col>
  27 + </el-row>
  28 + <el-row >
  29 + <el-col :span="6" class="bd">货箱体积</el-col>
  30 + <el-col :span="6" class="bd">{{infoData.containerVolume}}</el-col>
  31 + <el-col :span="6" class="bd bd_left">车牌颜色</el-col>
  32 + <el-col :span="6" class="bd">{{infoData.licenseplateColorName}}</el-col>
  33 + </el-row>
  34 + <el-row >
  35 + <el-col :span="6" class="bd">车辆颜色</el-col>
  36 + <el-col :span="6" class="bd">{{infoData.vehicleColorName}}</el-col>
  37 + <el-col :span="6" class="bd bd_left">排放标准</el-col>
  38 + <el-col :span="6" class="bd">{{infoData.emissionStan}}</el-col>
  39 + </el-row>
  40 +
  41 + <el-row >
  42 + <el-col :span="6" class="bd">车辆标识牌</el-col>
  43 + <el-col :span="6" class="bd">{{infoData.abbreviation}}</el-col>
  44 + <el-col :span="6" class="bd bd_left">车架号</el-col>
  45 + <el-col :span="6" class="bd">{{infoData.frmaeNo}}</el-col>
  46 + </el-row>
  47 + <el-row >
  48 + <el-col :span="6" class="bd">关联驾驶员</el-col>
  49 + <el-col :span="6" class="bd">{{infoData.driverName}}</el-col>
  50 + <el-col :span="6" class="bd bd_left">备注</el-col>
  51 + <el-col :span="6" class="bd">{{infoData.comment}}</el-col>
  52 + </el-row>
  53 +
  54 + <a v-for="item in infoData.attachmentList" @click="downloadFile(item.attachmentPath);">{{item.name}}</a>
  55 +
  56 + </div>
  57 +</template>
  58 +
  59 +<script>
  60 +
  61 +
  62 +import store from "@/store";
  63 + import {
  64 + getToken
  65 + } from "@/utils/auth";
  66 +
  67 +
  68 + import {
  69 + getTruckInfo,
  70 + getArea
  71 + } from "@/api/dict";
  72 +
  73 +
  74 + export default {
  75 + name: "truckInfo",
  76 + props: {
  77 + businessKey: {
  78 + type: String
  79 + },
  80 + },
  81 + data() {
  82 + return {
  83 + areas: [],
  84 + loading: null,
  85 + infoData: {},
  86 + }
  87 + },
  88 + created() {
  89 + this.loading = true;
  90 + this.getInfo();
  91 +
  92 + },
  93 + methods: {
  94 + getInfo() {
  95 + let id;
  96 + if (this.businessKey.split(":").length == 2) {
  97 + id = this.businessKey.split(":")[1];
  98 + } else {
  99 + id = this.businessKey;
  100 + }
  101 +
  102 + getTruckInfo(id).then(response => {
  103 +
  104 + this.infoData = response.result;
  105 +
  106 + this.loading = false;
  107 + });
  108 + },
  109 + downloadFile(path){
  110 + window.location.href = "/remotedown/" + path;
  111 + }
  112 + }
  113 +
  114 + }
  115 +</script>
  116 +<style>
  117 + .bd{
  118 + padding:5px;
  119 + }
  120 +
  121 +
  122 +
  123 +</style>
... ...
trash-ui/src/views/activiti/taskhistory/index.vue
... ... @@ -76,6 +76,18 @@
76 76 :close-on-click-modal="false">
77 77 <supervisionInfo :infoData="supervisionData"/>
78 78 </el-dialog>
  79 +
  80 + <el-dialog :title="title" :visible.sync="company" width="850px" append-to-body :close-on-click-modal="false">
  81 + <companyInfo :businessKey="businessKey" v-if="company"/>
  82 + </el-dialog>
  83 +
  84 + <el-dialog :title="title" :visible.sync="vehicle" width="850px" append-to-body :close-on-click-modal="false">
  85 + <vehicleInfo :businessKey="businessKey" v-if="vehicle"/>
  86 + </el-dialog>
  87 +
  88 + <el-dialog :title="title" :visible.sync="driver" width="850px" append-to-body :close-on-click-modal="false">
  89 + <driverInfo :businessKey="businessKey" v-if="driver"/>
  90 + </el-dialog>
79 91 </div>
80 92 </template>
81 93  
... ... @@ -100,9 +112,13 @@ import logisticsInfo from &quot;@/views/office/logistics/logisticsInfo&quot;;
100 112 import handleInfo from "@/views/office/handle/handleInfo";
101 113 import caseOfflineInfo from "@/views/caseOffline/caseOffline/caseOfflineInfo";
102 114 import violationCaseFileInfo from "@/views/casefile/violationCaseFile/violationCaseFileInfo";
103   -import violationWarningInformationInfo
104   - from "@/views/casefile/violationWarningInformation/violationWarningInformationInfo";
  115 +import violationWarningInformationInfo from "@/views/casefile/violationWarningInformation/violationWarningInformationInfo";
105 116 import supervisionInfo from "../task/SupervisionInfo";
  117 +
  118 +import companyInfo from "@/views/activiti/task/companyInfo";
  119 +import driverInfo from "@/views/activiti/task/driverInfo";
  120 +import vehicleInfo from "@/views/activiti/task/vehicleInfo";
  121 +
106 122 import {
107 123 getArea,
108 124 getDict,
... ... @@ -131,7 +147,10 @@ export default {
131 147 caseOfflineInfo,
132 148 violationCaseFileInfo,
133 149 violationWarningInformationInfo,
134   - supervisionInfo
  150 + supervisionInfo,
  151 + companyInfo,
  152 + driverInfo,
  153 + vehicleInfo
135 154 },
136 155 data() {
137 156 return {
... ... @@ -184,6 +203,9 @@ export default {
184 203 conferenceOpen: false,
185 204 construct: false,
186 205 leaveApplicationOpen: false,
  206 + company:false,
  207 + driver:false,
  208 + vehicle:false,
187 209 };
188 210 },
189 211 created() {
... ... @@ -353,6 +375,18 @@ export default {
353 375 return;
354 376 }
355 377  
  378 + if(this.definitionKey == "workflow_company"){
  379 + this.company = true;
  380 + return;
  381 + }
  382 + if(this.definitionKey == "workflow_vehicle"){
  383 + this.vehicle = true;
  384 + return;
  385 + }
  386 + if(this.definitionKey == "workflow_driver"){
  387 + this.driver = true;
  388 + return;
  389 + }
356 390  
357 391 },
358 392 /** 提交按钮 */
... ...
trash-ui/src/views/business/threestep/index.vue
... ... @@ -333,3 +333,19 @@
333 333  
334 334  
335 335 <script src="../../../api/three_step.js" />
  336 +
  337 +<style scope>
  338 + .el-select-dropdown__item{
  339 + width:300px;
  340 + }
  341 +
  342 + .card_title{
  343 + word-break: break-all;
  344 + }
  345 +
  346 + .el-select__tags{
  347 + max-height: 200px;
  348 + overflow: auto;
  349 + }
  350 +
  351 +</style>
... ...
trash-ui/src/views/h5/task/index.vue
... ... @@ -339,6 +339,29 @@
339 339 </div>
340 340 </el-dialog>
341 341  
  342 + <el-dialog :title="title" :visible.sync="company" width="300px" append-to-body :close-on-click-modal="false">
  343 + <companyInfo :businessKey="businessKey" v-if="company"/>
  344 + <div slot="footer" class="dialog-footer">
  345 + <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)">驳回</el-button>
  346 + <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">通过</el-button>
  347 + </div>
  348 + </el-dialog>
  349 +
  350 + <el-dialog :title="title" :visible.sync="vehicle" width="300px" append-to-body :close-on-click-modal="false">
  351 + <vehicleInfo :businessKey="businessKey" v-if="vehicle"/>
  352 + <div slot="footer" class="dialog-footer">
  353 + <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)">驳回</el-button>
  354 + <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">通过</el-button>
  355 + </div>
  356 + </el-dialog>
  357 +
  358 + <el-dialog :title="title" :visible.sync="driver" width="300px" append-to-body :close-on-click-modal="false">
  359 + <driverInfo :businessKey="businessKey" v-if="driver"/>
  360 + <div slot="footer" class="dialog-footer">
  361 + <el-button type="danger" @click="submitForm(form.formData[0].controlId,1)">驳回</el-button>
  362 + <el-button type="primary" @click="submitForm(form.formData[0].controlId,0)">通过</el-button>
  363 + </div>
  364 + </el-dialog>
342 365 </div>
343 366 </template>
344 367  
... ... @@ -391,7 +414,10 @@ import handleInfo from &quot;@/views/h5/task/handleInfo&quot;;
391 414 import caseOfflineInfo from "@/views/h5/caseOffline/caseOfflineInfo";
392 415 import violationCaseFileInfo from "@/views/h5/task/violationCaseFileInfo";
393 416 import violationWarningInformationInfo from "@/views/h5/task/violationWarningInformationInfo";
394   -import supervisionInfo from "./SupervisionInfo";
  417 +import supervisionInfo from "@/views/h5/task/SupervisionInfo";
  418 +import companyInfo from "@/views/activiti/task/companyInfo";
  419 +import driverInfo from "@/views/activiti/task/driverInfo";
  420 +import vehicleInfo from "@/views/activiti/task/vehicleInfo";
395 421  
396 422 export default {
397 423 name: "task",
... ... @@ -410,7 +436,9 @@ export default {
410 436 violationCaseFileInfo,
411 437 violationWarningInformationInfo,
412 438 supervisionInfo,
413   -
  439 + companyInfo,
  440 + driverInfo,
  441 + vehicleInfo,
414 442 pagination,
415 443 },
416 444 data() {
... ... @@ -498,6 +526,10 @@ export default {
498 526 options: [],
499 527 usersName: [],
500 528 deptName:null,
  529 +
  530 + company:false,
  531 + driver:false,
  532 + vehicle:false,
501 533 };
502 534 },
503 535 created() {
... ... @@ -581,6 +613,9 @@ export default {
581 613 this.violationCaseFile=false;
582 614 this.violationCaseFile1=false;
583 615  
  616 + this.company=false;
  617 + this.driver=false;
  618 + this.vehicle=false;
584 619 this.reset();
585 620 },
586 621 // 表单重置
... ... @@ -692,6 +727,18 @@ export default {
692 727 })
693 728 return;
694 729 }
  730 + if(this.definitionKey == "workflow_company"){
  731 + this.company = true;
  732 + return;
  733 + }
  734 + if(this.definitionKey == "workflow_vehicle"){
  735 + this.vehicle = true;
  736 + return;
  737 + }
  738 + if(this.definitionKey == "workflow_driver"){
  739 + this.driver = true;
  740 + return;
  741 + }
695 742 this.open = true;
696 743 this.title = "审批";
697 744 });
... ... @@ -907,7 +954,7 @@ export default {
907 954 })
908 955 return;
909 956 } else {
910   -
  957 +
911 958 let postData = {};
912 959 postData.tableName = this.businessKey;
913 960 postData.replyImg = this.form.replyImg;
... ... @@ -920,9 +967,26 @@ export default {
920 967 });
921 968 });
922 969  
923   -
  970 +
924 971 }
925 972 }
  973 +
  974 + if(this.definitionKey.indexOf("supervision")>-1){
  975 + formDataSave(this.id, this.form.formData).then(response => {
  976 + this.msgSuccess("审批成功");
  977 + this.supervisionOpen = false;
  978 + this.getList();
  979 + });
  980 + }
  981 + if(this.definitionKey == "workflow_company" ||
  982 + this.definitionKey == "workflow_driver" ||
  983 + this.definitionKey == "workflow_vehicle" ){
  984 + formDataSave(this.id, this.form.formData).then(response => {
  985 + this.msgSuccess("审批成功");
  986 + this.cancel();
  987 + this.getList();
  988 + });
  989 + }
926 990 },
927 991 conferenceSubmitForm(value) {
928 992 this.form.formData[0].controlValue = value;
... ... @@ -1166,4 +1230,4 @@ export default {
1166 1230 .el-select-dropdown__item{
1167 1231 width:300px;
1168 1232 }
1169   -</style>
1170 1233 \ No newline at end of file
  1234 +</style>
... ...
trash-ui/src/views/h5/taskhistory/index.vue
... ... @@ -62,6 +62,22 @@
62 62 <el-dialog :title="title" :visible.sync="violationCaseFile1" width="300px" append-to-body :close-on-click-modal="false">
63 63 <violationWarningInformationInfo :idInfo="businessKey" v-if="violationCaseFile1"/>
64 64 </el-dialog>
  65 +
  66 + <el-dialog :title="title" :visible.sync="supervisionOpen" width="300px" append-to-body :close-on-click-modal="false">
  67 + <supervisionInfo :infoData="supervisionData"/>
  68 + </el-dialog>
  69 + <el-dialog :title="title" :visible.sync="company" width="300px" append-to-body :close-on-click-modal="false">
  70 + <companyInfo :businessKey="businessKey" v-if="company"/>
  71 + </el-dialog>
  72 +
  73 + <el-dialog :title="title" :visible.sync="vehicle" width="300px" append-to-body :close-on-click-modal="false">
  74 + <vehicleInfo :businessKey="businessKey" v-if="vehicle"/>
  75 + </el-dialog>
  76 +
  77 + <el-dialog :title="title" :visible.sync="driver" width="300px" append-to-body :close-on-click-modal="false">
  78 + <driverInfo :businessKey="businessKey" v-if="driver"/>
  79 + </el-dialog>
  80 +
65 81 </div>
66 82 </template>
67 83  
... ... @@ -91,6 +107,11 @@
91 107 import caseOfflineInfo from "@/views/h5/caseOffline/caseOfflineInfo";
92 108 import violationCaseFileInfo from "@/views/h5/task/violationCaseFileInfo";
93 109 import violationWarningInformationInfo from "@/views/h5/task/violationWarningInformationInfo";
  110 + import supervisionInfo from "@/views/h5/task/SupervisionInfo";
  111 + import companyInfo from "@/views/activiti/task/companyInfo";
  112 + import driverInfo from "@/views/activiti/task/driverInfo";
  113 + import vehicleInfo from "@/views/activiti/task/vehicleInfo";
  114 +
94 115 import {
95 116 getArea,
96 117 getDict,
... ... @@ -119,7 +140,11 @@
119 140 caseOfflineInfo,
120 141 violationCaseFileInfo,
121 142 pagination,
122   - violationWarningInformationInfo
  143 + violationWarningInformationInfo,
  144 + supervisionInfo,
  145 + companyInfo,
  146 + driverInfo,
  147 + vehicleInfo
123 148 },
124 149 data() {
125 150 return {
... ... @@ -173,6 +198,10 @@
173 198 conferenceOpen: false,
174 199 construct: false,
175 200 leaveApplicationOpen: false,
  201 +
  202 + company:false,
  203 + driver:false,
  204 + vehicle:false,
176 205 };
177 206 },
178 207 created() {
... ... @@ -226,6 +255,10 @@
226 255 this.conferenceOpen=false;
227 256 this.construct=false;
228 257 this.leaveApplicationOpen=false;
  258 +
  259 + this.company=false;
  260 + this.driver=false;
  261 + this.vehicle=false;
229 262 this.reset();
230 263 },
231 264 // 表单重置
... ... @@ -343,6 +376,19 @@
343 376 return;
344 377 }
345 378  
  379 + if(this.definitionKey == "workflow_company"){
  380 + this.company = true;
  381 + return;
  382 + }
  383 + if(this.definitionKey == "workflow_vehicle"){
  384 + this.vehicle = true;
  385 + return;
  386 + }
  387 + if(this.definitionKey == "workflow_driver"){
  388 + this.driver = true;
  389 + return;
  390 + }
  391 +
346 392 },
347 393  
348 394 }
... ...
trash-ui/src/views/h5/threestep/index.vue
... ... @@ -303,4 +303,10 @@
303 303 .card_title{
304 304 word-break: break-all;
305 305 }
  306 +
  307 + .el-select__tags{
  308 + max-height: 200px;
  309 + overflow: auto;
  310 + }
  311 +
306 312 </style>
... ...
trash-ui/src/views/login.vue
1 1 <template>
2 2 <div class="login">
3   - <div class="main" >
  3 + 404
  4 + <!-- <div class="main" >
4 5 <img src="@/assets/logo/logo.jpg" alt="" class="img2">
5 6 <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
6 7 <h2 class="title">欢迎登录</h2>
... ... @@ -52,7 +53,7 @@
52 53 </el-button>
53 54 </el-form-item>
54 55 </el-form>
55   - </div>
  56 + </div> -->
56 57 </div>
57 58 </template>
58 59  
... ...
trash-ui/vue.config.js
... ... @@ -45,6 +45,11 @@ module.exports = {
45 45 target: `http://175.6.47.84:8008`,
46 46 changeOrigin: true,
47 47 },
  48 + ['/remotedown']: {
  49 + // target: `http://183.66.242.6:14601`,
  50 + target: `http://175.6.47.84:8008/upload_files`,
  51 + changeOrigin: true,
  52 + },
48 53  
49 54 },
50 55 disableHostCheck: true
... ...
trash-workFlow/src/main/java/com/trash/workflow/listener/leaveEndListener.java renamed to trash-workFlow/src/main/java/com/trash/workflow/listener/baseDataListener.java
... ... @@ -2,19 +2,44 @@ package com.trash.workflow.listener;
2 2  
3 3 import com.trash.office.domain.Conference;
4 4 import com.trash.office.mapper.ConferenceMapper;
  5 +import com.trash.common.utils.RemoteServerUtils;
5 6 import com.trash.common.utils.spring.SpringUtils;
6 7  
  8 +import java.util.ArrayList;
  9 +import java.util.HashMap;
  10 +import java.util.List;
  11 +import java.util.Map;
  12 +
7 13 import org.activiti.engine.delegate.DelegateExecution;
8 14 import org.activiti.engine.delegate.ExecutionListener;
9 15 import org.activiti.engine.delegate.Expression;
10 16  
11 17  
12   -public class leaveEndListener implements ExecutionListener {
  18 +public class baseDataListener implements ExecutionListener {
13 19 private Expression state;
14 20  
15 21 @Override
16 22 public void notify(DelegateExecution delegateExecution) {
17   -
18   - System.out.println(state.getValue(delegateExecution));
  23 +
  24 + List<Map> list = new ArrayList<Map>();
  25 + Map map = new HashMap();
  26 +
  27 + map.put("id", delegateExecution.getProcessInstanceBusinessKey().split(":")[1]);
  28 +
  29 + map.put("auditState", state.getValue(delegateExecution));
  30 +
  31 + list.add(map);
  32 +
  33 + if(delegateExecution.getProcessInstanceBusinessKey().contains("company")){
  34 + RemoteServerUtils.updateCompanyAudit(list);
  35 + }
  36 + if(delegateExecution.getProcessInstanceBusinessKey().contains("vehicle")){
  37 + RemoteServerUtils.updateTruckAudit(list);
  38 + }
  39 + if(delegateExecution.getProcessInstanceBusinessKey().contains("driver")){
  40 + RemoteServerUtils.updateDriverAudit(list);
  41 + }
  42 +
  43 + workflowUtils.sendDataToHisTory(delegateExecution, state);
19 44 }
20 45 }
... ...
trash-workFlow/src/main/java/com/trash/workflow/service/impl/WorkflowServiceImpl.java
... ... @@ -61,548 +61,483 @@ import com.trash.workflow.service.IWorkflowService;
61 61 @Service
62 62 public class WorkflowServiceImpl implements IWorkflowService {
63 63  
64   - @Autowired
65   - private WorkflowMapper workflowMapper;
66   - @Autowired
67   - private ProcessRuntime processRuntime;
68   - @Autowired
69   - private ISysUserService sysUserService;
70   - @Autowired
71   - private TaskService taskService;
72   -
73   - @Autowired
74   - private TaskRuntime taskRuntime;
75   -
76   - @Autowired
77   - IConstructionSignService signService;
  64 + @Autowired
  65 + private WorkflowMapper workflowMapper;
  66 + @Autowired
  67 + private ProcessRuntime processRuntime;
  68 + @Autowired
  69 + private ISysUserService sysUserService;
  70 + @Autowired
  71 + private TaskService taskService;
78 72  
  73 + @Autowired
  74 + private TaskRuntime taskRuntime;
79 75  
80   - @Autowired
81   - com.trash.common.config.trashConfig trashConfig;
82   -
83   - @Autowired
84   - SysLoginService loginService;
85   -
86   - String siteType[] = {"消纳场", "建筑垃圾资源化处置场", "盾构土环保处置场", "盾构土应急消纳场", "回填场"};
  76 + @Autowired
  77 + IConstructionSignService signService;
87 78  
88   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  79 + @Autowired
  80 + com.trash.common.config.trashConfig trashConfig;
89 81  
90   - @Autowired
91   - RuntimeService runtimeService;
  82 + @Autowired
  83 + SysLoginService loginService;
92 84  
93   - @Autowired
94   - ISupervisionThreestepService server;
  85 + String siteType[] = { "消纳场", "建筑垃圾资源化处置场", "盾构土环保处置场", "盾构土应急消纳场", "回填场" };
95 86  
96   - @Autowired
97   - RedisCache redisCache;
  87 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
98 88  
99   - @Override
100   - @Transactional
101   - public int createWorkFlow(Map<String, Object> data) { //第三方通用接收接口
  89 + @Autowired
  90 + RuntimeService runtimeService;
102 91  
103   - String flowType = data.get("type").toString();
  92 + @Autowired
  93 + ISupervisionThreestepService server;
104 94  
105   - Map map = (Map) data.get("data");
  95 + @Autowired
  96 + RedisCache redisCache;
106 97  
107   - String businessKey = flowType + ":" + map.get("id"); // 流程对应事务key
108   - String title = map.get("title").toString();
  98 + @Override
  99 + @Transactional
  100 + public int createWorkFlow(Map<String, Object> data) { // 第三方通用接收接口
109 101  
110   - String reason = map.get("reason").toString();
111   - String startTime = map.get("startTime").toString();
112   - String endTime = map.get("endTime").toString();
113   - String areaCode = null;
114   - if(map.get("area") != null)
115   - areaCode = map.get("area").toString();
  102 + String flowType = data.get("type").toString();
116 103  
117   - ProcessInstance processInstance = null;
  104 + Map map = (Map) data.get("data");
118 105  
119   - try {
  106 + String businessKey = flowType + ":" + map.get("id"); // 流程对应事务key
  107 + String title = map.get("title").toString();
120 108  
121   - processInstance = processRuntime.start(ProcessPayloadBuilder.start().withProcessDefinitionKey(flowType)
122   - .withName(title).withBusinessKey(businessKey).build());
  109 + String reason = map.get("reason").toString();
  110 + String startTime = map.get("startTime").toString();
  111 + String endTime = map.get("endTime").toString();
  112 + String areaCode = null;
  113 + if (map.get("area") != null)
  114 + areaCode = map.get("area").toString();
123 115  
  116 + ProcessInstance processInstance = null;
124 117  
125   - if (flowType.equals("workflow_earthsites")) {
126   - PorcThreeStepTask(processInstance, areaCode);
127   - }
128   -
129   - if(flowType.equals("workflow_constructsite")){
130   -
131   - ConstructionSign constructionSign = new ConstructionSign();
132   -
133   - constructionSign.setObjectId(map.get("id").toString());
134   -
135   - SysUser user = SecurityUtils.getLoginUser().getUser();
136   -
137   - if(!user.getAvatar().contains("null")){
138   - constructionSign.setSign1(SecurityUtils.getLoginUser().getUser().getAvatar());
139   - constructionSign.setSign1Time(new Date());
140   - }
141   -
142   - signService.insertConstructionSign(constructionSign);
143   -
144   - }
  118 + try {
145 119  
146   - Workflow workflow = new Workflow();
147   - workflow.setId(businessKey);
148   - workflow.setTitle(title);
149   - workflow.setReason(reason);
150   - workflow.setStartTime(startTime);
151   - workflow.setEndTime(endTime);
152   - workflow.setType(map.get("type").toString());
153   - workflow.setInstanceId(processInstance.getId());
154   - workflow.setState("0");
155   - workflow.setCreateTime(new Date());
  120 + processInstance = processRuntime.start(ProcessPayloadBuilder.start().withProcessDefinitionKey(flowType)
  121 + .withName(title).withBusinessKey(businessKey).build());
156 122  
157   - return workflowMapper.insertWorkflow(workflow);
158   - } catch (Exception e) {
  123 + if (areaCode != null) {
  124 + PorcThreeStepTask(processInstance, areaCode);
  125 + }
159 126  
160   - processRuntime.delete(ProcessPayloadBuilder.delete(processInstance));
  127 + if (flowType.equals("workflow_constructsite")) {
161 128  
162   - e.printStackTrace();
163   - }
164   -
165   - return 0;
166   - }
  129 + ConstructionSign constructionSign = new ConstructionSign();
167 130  
  131 + constructionSign.setObjectId(map.get("id").toString());
168 132  
169   - @Override
170   - @Transactional
171   - public int createLeaveWorkFlow(Workflow workflow, int index) {
172   - ProcessInstance processInstance = null;
  133 + SysUser user = SecurityUtils.getLoginUser().getUser();
173 134  
174   - try {
  135 + if (!user.getAvatar().contains("null")) {
  136 + constructionSign.setSign1(SecurityUtils.getLoginUser().getUser().getAvatar());
  137 + constructionSign.setSign1Time(new Date());
  138 + }
175 139  
176   - processInstance = processRuntime.start(ProcessPayloadBuilder
177   - .start()
178   - .withProcessDefinitionKey("workflow_leave")
179   - .withName(workflow.getTitle())
180   - .withBusinessKey(workflow.getId())
181   - .withVariable("route", index)
182   - .build());
  140 + signService.insertConstructionSign(constructionSign);
183 141  
  142 + }
184 143  
185   - Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
  144 + Workflow workflow = new Workflow();
  145 + workflow.setId(businessKey);
  146 + workflow.setTitle(title);
  147 + workflow.setReason(reason);
  148 + workflow.setStartTime(startTime);
  149 + workflow.setEndTime(endTime);
  150 + workflow.setType(map.get("type").toString());
  151 + workflow.setInstanceId(processInstance.getId());
  152 + workflow.setState("0");
  153 + workflow.setCreateTime(new Date());
186 154  
187   - if (task != null) {
  155 + return workflowMapper.insertWorkflow(workflow);
  156 + } catch (Exception e) {
188 157  
189   - task.setDescription(SecurityUtils.getLoginUser().getUser().getRoleIds().get(0));
190   -
191   - List<IdentityLink> list = taskService.getIdentityLinksForTask(task.getId());
192   -
193   - if (list.size() == 1) {
194   - taskService.addCandidateUser(task.getId(), task.getDescription());
195   - }
196   -
197   - taskService.saveTask(task);
198   - }
199   -
200   -
201   - workflow.setInstanceId(processInstance.getId());
202   -
203   - workflow.setCreateTime(new Date());
204   - return workflowMapper.insertWorkflow(workflow);
205   - } catch (Exception e) {
206   -
207   - processRuntime.delete(ProcessPayloadBuilder.delete(processInstance));
208   -
209   - e.printStackTrace();
210   - }
211   -
212   - return 0;
213   - }
214   -
215   - @Override
216   - @Transactional
217   - public int createThreeStepWorkFlow(SupervisionThreestep supervision) { //三查
218   - ProcessInstance processInstance = null;
219   - try {
220   - processInstance = processRuntime.start(ProcessPayloadBuilder
221   - .start()
222   - .withProcessDefinitionKey("workflow_threestep")
223   - .withName("报工自查:" + supervision.getContract())
224   - .withBusinessKey("workflow_threestep:" + supervision.getId())
225   - .build());
226   -
227   - PorcThreeStepTask(processInstance, supervision.getPlace());
228   -
229   - Workflow workflow = new Workflow();
230   - workflow.setId("workflow_threestep:" + supervision.getId());
231   - workflow.setTitle("报工自查-合同编号:" + supervision.getContract());
232   - workflow.setReason("报工自查");
233   - workflow.setStartTime(sdf.format(supervision.getSelfCheckTime()));
234   - workflow.setEndTime(sdf.format(supervision.getSelfCheckTime()));
235   - workflow.setType(supervision.getType() == 0 ? "工地" : "消纳场");
236   - workflow.setInstanceId(processInstance.getId());
237   - workflow.setState("0");
238   - workflow.setCreateTime(new Date());
239   -
240   - return workflowMapper.insertWorkflow(workflow);
241   - } catch (Exception e) {
242   - e.printStackTrace();
243   - processRuntime.delete(ProcessPayloadBuilder.delete(processInstance));
244   - }
245   -
246   - return 0;
247   - }
248   -
249   -
250   - @Override
251   - @Transactional
252   - public int createCaseFile(ViolationCaseFile caseFile, int index) { //三查
253   - ProcessInstance processInstance = null;
254   - String title = "案卷号:" + caseFile.getNumber();
255   - String flowType = "workflow_casefile";
256   - try {
257   -
258   - processInstance = processRuntime.start(ProcessPayloadBuilder
259   - .start()
260   - .withProcessDefinitionKey(flowType)
261   - .withName(title)
262   - .withBusinessKey(flowType + ":" + caseFile.getId())
263   - .withVariable("route", index)
264   - .build());
265   -
266   -
267   - if (index == 0) {
268   - Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
269   -
270   - task.setAssignee(caseFile.getAbbreviation());
271   -
272   - taskService.saveTask(task);
273   - } else {
274   - updateProcess(processInstance, caseFile.getOwningRegion());
275   - }
276   -
277   -
278   - Workflow workflow = new Workflow();
279   - workflow.setId(flowType + ":" + caseFile.getId());
280   - workflow.setTitle(title);
281   - workflow.setReason("平台案卷");
282   - workflow.setStartTime(sdf.format(caseFile.getCreateTime()));
283   - workflow.setEndTime(sdf.format(caseFile.getCreateTime()));
284   - workflow.setType("案卷");
285   - workflow.setInstanceId(processInstance.getId());
286   - workflow.setState("0");
287   - workflow.setCreateTime(new Date());
288   -
289   - return workflowMapper.insertWorkflow(workflow);
290   - } catch (Exception e) {
291   - e.printStackTrace();
292   - processRuntime.delete(ProcessPayloadBuilder.delete(processInstance));
293   - throw new RuntimeException(e);
294   - }
295   - }
296   -
297   - @Override
298   - @Transactional
299   - public int createCaseFile1(ViolationWarningInformation caseFile, int index, int isAuto) { //违规预警案卷
300   - if (isAuto == 1) {
301   - if (StringUtils.isEmpty(RemoteServerUtils.remote)) {
302   - RemoteServerUtils.remote = trashConfig.getRemotePath();
303   - }
304   - loginService.loginByRemote(trashConfig.getToken());
305   - }
306   - SecurityContextImpl securityContextImpl = new SecurityContextImpl();
307   -
308   - securityContextImpl.setAuthentication(SecurityContextHolder.getContext().getAuthentication());
309   - org.activiti.engine.runtime.ProcessInstance instance = null;
310   - String title = "案卷号:" + caseFile.getNumber();
311   - String flowType = "violation_warning";
312   - try {
313   - Map map = new HashedMap<>();
314   -
315   - map.put("route", index);
316   - instance = runtimeService.createProcessInstanceBuilder()
317   - .businessKey(flowType + ":" + caseFile.getId())
318   - .name(title)
319   - .variable("route", index)
320   - .processDefinitionKey(flowType)
321   - .variables(map)
322   - .start();
323   -
324   -
325   - //runtimeService.startProcessInstanceById(instance.getProcessDefinitionId(),map);
  158 + processRuntime.delete(ProcessPayloadBuilder.delete(processInstance));
326 159  
  160 + e.printStackTrace();
  161 + }
327 162  
328   - if (index == 0) {
329   - Task task = taskService.createTaskQuery().processInstanceId(instance.getId()).singleResult();
  163 + return 0;
  164 + }
330 165  
331   - task.setAssignee(caseFile.getAbbreviation());
  166 + @Override
  167 + @Transactional
  168 + public int createLeaveWorkFlow(Workflow workflow, int index) {
  169 + ProcessInstance processInstance = null;
332 170  
333   - taskService.saveTask(task);
334   - } else {
335   - updateProcessKafka(instance, caseFile.getOwningRegion(), trashConfig.getToken());
336   - }
  171 + try {
337 172  
338   - Workflow workflow = new Workflow();
339   - workflow.setId(flowType + ":" + caseFile.getId());
340   - workflow.setTitle(title);
341   - workflow.setReason("违规预警信息");
342   - workflow.setStartTime(sdf.format(caseFile.getCreateTime()));
343   - workflow.setEndTime(sdf.format(caseFile.getCreateTime()));
344   - workflow.setType("违规预警信息案卷");
345   - workflow.setInstanceId(instance.getId());
346   - workflow.setState("0");
347   - workflow.setCreateTime(new Date());
  173 + processInstance = processRuntime.start(ProcessPayloadBuilder.start()
  174 + .withProcessDefinitionKey("workflow_leave").withName(workflow.getTitle())
  175 + .withBusinessKey(workflow.getId()).withVariable("route", index).build());
348 176  
349   - return workflowMapper.insertWorkflow(workflow);
350   - } catch (Exception e) {
351   - runtimeService.deleteProcessInstance(instance.getId(), "创建失败");
352   - throw new RuntimeException(e);
353   - }
  177 + Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
354 178  
355   - }
  179 + if (task != null) {
356 180  
  181 + task.setDescription(SecurityUtils.getLoginUser().getUser().getRoleIds().get(0));
357 182  
358   - @Override
359   - @Transactional
360   - public int createCaseOffline(CaseOffline caseOffline) { //三查
361   - ProcessInstance processInstance = null;
362   - try {
  183 + List<IdentityLink> list = taskService.getIdentityLinksForTask(task.getId());
363 184  
364   - String title = "案卷号:" + caseOffline.getNumber();
  185 + if (list.size() == 1) {
  186 + taskService.addCandidateUser(task.getId(), task.getDescription());
  187 + }
365 188  
366   - processInstance = processRuntime.start(ProcessPayloadBuilder
367   - .start()
368   - .withProcessDefinitionKey("workflow_caseoffline")
369   - .withName(title)
370   - .withBusinessKey("workflow_caseoffline:" + caseOffline.getId())
371   - .build());
  189 + taskService.saveTask(task);
  190 + }
372 191  
373   - PorcThreeStepTask(processInstance, caseOffline.getPlace());
  192 + workflow.setInstanceId(processInstance.getId());
374 193  
  194 + workflow.setCreateTime(new Date());
  195 + return workflowMapper.insertWorkflow(workflow);
  196 + } catch (Exception e) {
375 197  
376   - Workflow workflow = new Workflow();
377   - workflow.setId("workflow_caseoffline:" + caseOffline.getId());
378   - workflow.setTitle(title);
379   - workflow.setReason("案卷线下交办");
380   - workflow.setStartTime(sdf.format(caseOffline.getCreateTime()));
381   - workflow.setEndTime(sdf.format(caseOffline.getCreateTime()));
382   - workflow.setType("案卷");
383   - workflow.setInstanceId(processInstance.getId());
384   - workflow.setState("0");
385   - workflow.setCreateTime(new Date());
  198 + processRuntime.delete(ProcessPayloadBuilder.delete(processInstance));
386 199  
387   - return workflowMapper.insertWorkflow(workflow);
388   - } catch (Exception e) {
389   - e.printStackTrace();
390   - processRuntime.delete(ProcessPayloadBuilder.delete(processInstance));
391   - }
  200 + e.printStackTrace();
  201 + }
392 202  
393   - return 0;
394   - }
  203 + return 0;
  204 + }
395 205  
  206 + @Override
  207 + @Transactional
  208 + public int createThreeStepWorkFlow(SupervisionThreestep supervision) { // 三查
  209 + ProcessInstance processInstance = null;
  210 + try {
  211 + processInstance = processRuntime.start(ProcessPayloadBuilder.start()
  212 + .withProcessDefinitionKey("workflow_threestep").withName("报工自查:" + supervision.getContract())
  213 + .withBusinessKey("workflow_threestep:" + supervision.getId()).build());
396 214  
397   - public void PorcThreeStepTask(ProcessInstance processInstance, String place) {
  215 + PorcThreeStepTask(processInstance, supervision.getPlace());
398 216  
399   - JSONArray array = RemoteServerUtils.getAreas();
400   -
401   -
402   - String placeName = null;
403   -
404   - for (Object obj : array) {
405   - if (((JSONObject) (obj)).getString("code").equals(place)) {
406   -
407   - placeName = ((JSONObject) (obj)).getString("name");
408   -
409   - break;
410   - }
411   -
412   - }
413   -
414   - if (placeName != null) {
415   -
416   - updateProcess(processInstance, placeName);
417   - }
418   -
419   - }
420   -
421   - void updateProcess(ProcessInstance processInstance, String placeName) {
422   - Map map = new HashedMap<>();
423   -
424   - map.put("type", "CSUserDepartmentType");
425   -
426   - JSONArray array2 = RemoteServerUtils.getDict(map);
427   -
428   -
429   - String placeCode = null;
430   - String code = null;
431   -
432   - for (Object obj : array2) {
433   - if (((JSONObject) obj).getString("name").equals("渣土办")) {
434   - code = ((JSONObject) (obj)).getString("code");
435   - }
436   - if (((JSONObject) obj).getString("name").replace("渣土办", "").equals(placeName)) {
437   - placeCode = ((JSONObject) (obj)).getString("code");
438   -
439   - if (code != null) {
440   - break;
441   - }
442   - }
443   -
444   - }
445   -
446   - if (placeCode != null) {
447   - Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
448   -
449   -
450   - List<IdentityLink> list = taskService.getIdentityLinksForTask(task.getId());
451   -
452   - for (IdentityLink identityLink : list) {
453   -// if(identityLink.getGroupId() != null)
454   -// taskService.deleteGroupIdentityLink(task.getId(), identityLink.getGroupId(), identityLink.getType());
455   - if (identityLink.getUserId() != null)
456   - taskService.deleteUserIdentityLink(task.getId(), identityLink.getUserId(), identityLink.getType());
457   - }
458   -
459   - taskService.addCandidateUser(task.getId(), placeCode);
460   -
461   - task.setDescription(placeCode);
462   -
463   - taskService.saveTask(task);
464   - }
465   - }
466   -
467   - void updateProcessKafka(org.activiti.engine.runtime.ProcessInstance processInstance, String placeName, String token) {
468   - Map map = new HashedMap<>();
469   -
470   - map.put("type", "CSUserDepartmentType");
471   -
472   -
473   - JSONArray array2 = redisCache.getCacheObject("dict");
474   - if (array2 == null || array2.size() == 0) {
475   - array2 = RemoteServerUtils.getDict(map, token);
476   - redisCache.setCacheObject("dict", array2, 24, TimeUnit.HOURS);
477   - }
478   - String placeCode = null;
479   - String code = null;
480   -
481   - for (Object obj : array2) {
482   - if (((JSONObject) obj).getString("name").equals("渣土办")) {
483   - code = ((JSONObject) (obj)).getString("code");
484   - }
485   - if (((JSONObject) obj).getString("name").replace("渣土办", "").equals(placeName)) {
486   - placeCode = ((JSONObject) (obj)).getString("code");
487   -
488   - if (code != null) {
489   - break;
490   - }
491   - }
492   -
493   - }
494   -
495   - if (placeCode != null) {
496   - Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
497   -
498   -
499   - List<IdentityLink> list = taskService.getIdentityLinksForTask(task.getId());
500   -
501   - for (IdentityLink identityLink : list) {
502   -// if(identityLink.getGroupId() != null)
503   -// taskService.deleteGroupIdentityLink(task.getId(), identityLink.getGroupId(), identityLink.getType());
504   - if (identityLink.getUserId() != null)
505   - taskService.deleteUserIdentityLink(task.getId(), identityLink.getUserId(), identityLink.getType());
506   - }
507   -
508   - taskService.addCandidateUser(task.getId(), placeCode);
509   -
510   - task.setDescription(placeCode);
511   -
512   - taskService.saveTask(task);
513   - }
514   - }
515   -
516   - /**
517   - * 查询请假
518   - *
519   - * @param id 请假ID
520   - * @return 请假
521   - */
522   - @Override
523   - public Workflow selectWorkflowById(String id) {
524   - return workflowMapper.selectWorkflowById(id);
525   - }
526   -
527   - /**
528   - * 查询请假列表
529   - *
530   - * @param Workflow 请假
531   - * @return 请假
532   - */
533   - @Override
534   - public List<Workflow> selectWorkflowList(Workflow Workflow) {
535   - return workflowMapper.selectWorkflowListByWorkflowAndDeptId(Workflow,
536   - SecurityUtils.getLoginUser().getUser().getDeptId());
537   - }
538   -
539   - /**
540   - * 查询请假列表带任务状态
541   - *
542   - * @param Workflow 请假
543   - * @return 请假
544   - */
545   - @Override
546   - public List<Workflow> selectWorkflowAndTaskNameList(Workflow Workflow) {
547   - List<Workflow> Workflows = workflowMapper.selectWorkflowList(Workflow);
548   - List<String> collect = Workflows.parallelStream().map(wl -> wl.getInstanceId()).collect(Collectors.toList());
549   - if (collect != null && !collect.isEmpty()) {
550   - List<Task> tasks = taskService.createTaskQuery().processInstanceIdIn(collect).list();
551   - Workflows.forEach(wl -> {
552   - Task task = tasks.parallelStream().filter(t -> t.getProcessInstanceId().equals(wl.getInstanceId()))
553   - .findAny().orElse(null);
554   - if (task != null) {
555   - wl.setTaskName(task.getName());
556   - }
557   - });
558   - }
559   - return Workflows;
560   - }
561   -
562   -
563   - /**
564   - * 修改请假
565   - *
566   - * @param Workflow 请假
567   - * @return 结果
568   - */
569   - @Override
570   - public int updateWorkflow(Workflow Workflow) {
571   - Workflow.setUpdateTime(DateUtils.getNowDate());
572   - return workflowMapper.updateWorkflow(Workflow);
573   - }
574   -
575   - /**
576   - * 批量删除请假
577   - *
578   - * @param ids 需要删除的请假ID
579   - * @return 结果
580   - */
581   - @Override
582   - public int deleteWorkflowByIds(String[] ids) {
583   - return workflowMapper.deleteWorkflowByIds(ids);
584   - }
585   -
586   - /**
587   - * 删除请假信息
588   - *
589   - * @param id 请假ID
590   - * @return 结果
591   - */
592   - @Override
593   - public int deleteWorkflowById(String id) {
594   - return workflowMapper.deleteWorkflowById(id);
595   - }
596   -
597   - @Override
598   - public void deleteWorkflowByName(String name) {
599   - workflowMapper.deleteWorkflowByName(name);
600   - }
601   -
602   - @Override
603   - public Workflow selectWorkflowByInstanceId(String instanceId) {
604   -
605   - return workflowMapper.selectWorkflowByInstanceId(instanceId);
606   - }
  217 + Workflow workflow = new Workflow();
  218 + workflow.setId("workflow_threestep:" + supervision.getId());
  219 + workflow.setTitle("报工自查-合同编号:" + supervision.getContract());
  220 + workflow.setReason("报工自查");
  221 + workflow.setStartTime(sdf.format(supervision.getSelfCheckTime()));
  222 + workflow.setEndTime(sdf.format(supervision.getSelfCheckTime()));
  223 + workflow.setType(supervision.getType() == 0 ? "工地" : "消纳场");
  224 + workflow.setInstanceId(processInstance.getId());
  225 + workflow.setState("0");
  226 + workflow.setCreateTime(new Date());
  227 +
  228 + return workflowMapper.insertWorkflow(workflow);
  229 + } catch (Exception e) {
  230 + e.printStackTrace();
  231 + processRuntime.delete(ProcessPayloadBuilder.delete(processInstance));
  232 + }
  233 +
  234 + return 0;
  235 + }
  236 +
  237 + @Override
  238 + @Transactional
  239 + public int createCaseFile(ViolationCaseFile caseFile, int index) { // 三查
  240 + ProcessInstance processInstance = null;
  241 + String title = "案卷号:" + caseFile.getNumber();
  242 + String flowType = "workflow_casefile";
  243 + try {
  244 +
  245 + processInstance = processRuntime
  246 + .start(ProcessPayloadBuilder.start().withProcessDefinitionKey(flowType).withName(title)
  247 + .withBusinessKey(flowType + ":" + caseFile.getId()).withVariable("route", index).build());
  248 +
  249 + if (index == 0) {
  250 + Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
  251 +
  252 + task.setAssignee(caseFile.getAbbreviation());
  253 +
  254 + taskService.saveTask(task);
  255 + } else {
  256 + updateProcess(processInstance, caseFile.getOwningRegion());
  257 + }
  258 +
  259 + Workflow workflow = new Workflow();
  260 + workflow.setId(flowType + ":" + caseFile.getId());
  261 + workflow.setTitle(title);
  262 + workflow.setReason("平台案卷");
  263 + workflow.setStartTime(sdf.format(caseFile.getCreateTime()));
  264 + workflow.setEndTime(sdf.format(caseFile.getCreateTime()));
  265 + workflow.setType("案卷");
  266 + workflow.setInstanceId(processInstance.getId());
  267 + workflow.setState("0");
  268 + workflow.setCreateTime(new Date());
  269 +
  270 + return workflowMapper.insertWorkflow(workflow);
  271 + } catch (Exception e) {
  272 + e.printStackTrace();
  273 + processRuntime.delete(ProcessPayloadBuilder.delete(processInstance));
  274 + throw new RuntimeException(e);
  275 + }
  276 + }
  277 +
  278 +
  279 +
  280 + @Override
  281 + @Transactional
  282 + public int createCaseFile1(ViolationWarningInformation caseFile, int index, int isAuto) { // 违规预警案卷
  283 + if (isAuto == 1) {
  284 + if (StringUtils.isEmpty(RemoteServerUtils.remote)) {
  285 + RemoteServerUtils.remote = trashConfig.getRemotePath();
  286 + }
  287 + loginService.loginByRemote(trashConfig.getToken());
  288 + }
  289 + SecurityContextImpl securityContextImpl = new SecurityContextImpl();
  290 +
  291 + securityContextImpl.setAuthentication(SecurityContextHolder.getContext().getAuthentication());
  292 + org.activiti.engine.runtime.ProcessInstance instance = null;
  293 + String title = "案卷号:" + caseFile.getNumber();
  294 + String flowType = "violation_warning";
  295 + try {
  296 + Map map = new HashedMap<>();
  297 +
  298 + map.put("route", index);
  299 + instance = runtimeService.createProcessInstanceBuilder().businessKey(flowType + ":" + caseFile.getId())
  300 + .name(title).variable("route", index).processDefinitionKey(flowType).variables(map).start();
  301 +
  302 + // runtimeService.startProcessInstanceById(instance.getProcessDefinitionId(),map);
  303 +
  304 + if (index == 0) {
  305 + Task task = taskService.createTaskQuery().processInstanceId(instance.getId()).singleResult();
  306 +
  307 + task.setAssignee(caseFile.getAbbreviation());
  308 +
  309 + taskService.saveTask(task);
  310 + } else {
  311 + updateProcessKafka(instance, caseFile.getOwningRegion(), trashConfig.getToken());
  312 + }
  313 +
  314 + Workflow workflow = new Workflow();
  315 + workflow.setId(flowType + ":" + caseFile.getId());
  316 + workflow.setTitle(title);
  317 + workflow.setReason("违规预警信息");
  318 + workflow.setStartTime(sdf.format(caseFile.getCreateTime()));
  319 + workflow.setEndTime(sdf.format(caseFile.getCreateTime()));
  320 + workflow.setType("违规预警信息案卷");
  321 + workflow.setInstanceId(instance.getId());
  322 + workflow.setState("0");
  323 + workflow.setCreateTime(new Date());
  324 +
  325 + return workflowMapper.insertWorkflow(workflow);
  326 + } catch (Exception e) {
  327 + runtimeService.deleteProcessInstance(instance.getId(), "创建失败");
  328 + throw new RuntimeException(e);
  329 + }
  330 +
  331 + }
  332 +
  333 + @Override
  334 + @Transactional
  335 + public int createCaseOffline(CaseOffline caseOffline) { // 三查
  336 + ProcessInstance processInstance = null;
  337 + try {
  338 +
  339 + String title = "案卷号:" + caseOffline.getNumber();
  340 +
  341 + processInstance = processRuntime
  342 + .start(ProcessPayloadBuilder.start().withProcessDefinitionKey("workflow_caseoffline")
  343 + .withName(title).withBusinessKey("workflow_caseoffline:" + caseOffline.getId()).build());
  344 +
  345 + PorcThreeStepTask(processInstance, caseOffline.getPlace());
  346 +
  347 + Workflow workflow = new Workflow();
  348 + workflow.setId("workflow_caseoffline:" + caseOffline.getId());
  349 + workflow.setTitle(title);
  350 + workflow.setReason("案卷线下交办");
  351 + workflow.setStartTime(sdf.format(caseOffline.getCreateTime()));
  352 + workflow.setEndTime(sdf.format(caseOffline.getCreateTime()));
  353 + workflow.setType("案卷");
  354 + workflow.setInstanceId(processInstance.getId());
  355 + workflow.setState("0");
  356 + workflow.setCreateTime(new Date());
  357 +
  358 + return workflowMapper.insertWorkflow(workflow);
  359 + } catch (Exception e) {
  360 + e.printStackTrace();
  361 + processRuntime.delete(ProcessPayloadBuilder.delete(processInstance));
  362 + }
  363 +
  364 + return 0;
  365 + }
  366 +
  367 + private void updateProcess(ProcessInstance processInstance, String owningRegion) {
  368 +
  369 + JSONArray array = RemoteServerUtils.getAreas();
  370 +
  371 +
  372 + String placeCode = null;
  373 +
  374 + for (Object obj : array) {
  375 + if (((JSONObject) (obj)).getString("name").equals(owningRegion)) {
  376 +
  377 + placeCode = ((JSONObject) (obj)).getString("code");
  378 +
  379 + break;
  380 + }
  381 + }
  382 +
  383 + if(placeCode != null){
  384 + PorcThreeStepTask(processInstance,placeCode);
  385 + }
  386 +
  387 + }
  388 +
  389 + public void PorcThreeStepTask(ProcessInstance processInstance, String areaCode) {
  390 + Map map = new HashedMap<>();
  391 +
  392 + map.put("type", "CSUserDepartmentType");
  393 +
  394 + Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
  395 +
  396 + List<IdentityLink> list = taskService.getIdentityLinksForTask(task.getId());
  397 +
  398 + if (list.size() == 1) {
  399 + taskService.addCandidateUser(task.getId(), areaCode);
  400 + }
  401 +
  402 + task.setDescription(areaCode);
  403 +
  404 + taskService.saveTask(task);
  405 + }
  406 +
  407 +
  408 + void updateProcessKafka(org.activiti.engine.runtime.ProcessInstance processInstance, String placeName,
  409 + String token) {
  410 + JSONArray array = RemoteServerUtils.getAreas();
  411 +
  412 +
  413 + String placeCode = null;
  414 +
  415 + for (Object obj : array) {
  416 + if (((JSONObject) (obj)).getString("name").equals(placeName)) {
  417 +
  418 + placeCode = ((JSONObject) (obj)).getString("code");
  419 +
  420 + break;
  421 + }
  422 + }
  423 +
  424 +
  425 + if (placeCode != null) {
  426 + Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
  427 +
  428 + List<IdentityLink> list = taskService.getIdentityLinksForTask(task.getId());
  429 +
  430 + for (IdentityLink identityLink : list) {
  431 + // if(identityLink.getGroupId() != null)
  432 + // taskService.deleteGroupIdentityLink(task.getId(),
  433 + // identityLink.getGroupId(), identityLink.getType());
  434 + if (identityLink.getUserId() != null)
  435 + taskService.deleteUserIdentityLink(task.getId(), identityLink.getUserId(), identityLink.getType());
  436 + }
  437 +
  438 + taskService.addCandidateUser(task.getId(), placeCode);
  439 +
  440 + task.setDescription(placeCode);
  441 +
  442 + taskService.saveTask(task);
  443 + }
  444 + }
  445 +
  446 + /**
  447 + * 查询请假
  448 + *
  449 + * @param id
  450 + * 请假ID
  451 + * @return 请假
  452 + */
  453 + @Override
  454 + public Workflow selectWorkflowById(String id) {
  455 + return workflowMapper.selectWorkflowById(id);
  456 + }
  457 +
  458 + /**
  459 + * 查询请假列表
  460 + *
  461 + * @param Workflow
  462 + * 请假
  463 + * @return 请假
  464 + */
  465 + @Override
  466 + public List<Workflow> selectWorkflowList(Workflow Workflow) {
  467 + return workflowMapper.selectWorkflowListByWorkflowAndDeptId(Workflow,
  468 + SecurityUtils.getLoginUser().getUser().getDeptId());
  469 + }
  470 +
  471 + /**
  472 + * 查询请假列表带任务状态
  473 + *
  474 + * @param Workflow
  475 + * 请假
  476 + * @return 请假
  477 + */
  478 + @Override
  479 + public List<Workflow> selectWorkflowAndTaskNameList(Workflow Workflow) {
  480 + List<Workflow> Workflows = workflowMapper.selectWorkflowList(Workflow);
  481 + List<String> collect = Workflows.parallelStream().map(wl -> wl.getInstanceId()).collect(Collectors.toList());
  482 + if (collect != null && !collect.isEmpty()) {
  483 + List<Task> tasks = taskService.createTaskQuery().processInstanceIdIn(collect).list();
  484 + Workflows.forEach(wl -> {
  485 + Task task = tasks.parallelStream().filter(t -> t.getProcessInstanceId().equals(wl.getInstanceId()))
  486 + .findAny().orElse(null);
  487 + if (task != null) {
  488 + wl.setTaskName(task.getName());
  489 + }
  490 + });
  491 + }
  492 + return Workflows;
  493 + }
  494 +
  495 + /**
  496 + * 修改请假
  497 + *
  498 + * @param Workflow
  499 + * 请假
  500 + * @return 结果
  501 + */
  502 + @Override
  503 + public int updateWorkflow(Workflow Workflow) {
  504 + Workflow.setUpdateTime(DateUtils.getNowDate());
  505 + return workflowMapper.updateWorkflow(Workflow);
  506 + }
  507 +
  508 + /**
  509 + * 批量删除请假
  510 + *
  511 + * @param ids
  512 + * 需要删除的请假ID
  513 + * @return 结果
  514 + */
  515 + @Override
  516 + public int deleteWorkflowByIds(String[] ids) {
  517 + return workflowMapper.deleteWorkflowByIds(ids);
  518 + }
  519 +
  520 + /**
  521 + * 删除请假信息
  522 + *
  523 + * @param id
  524 + * 请假ID
  525 + * @return 结果
  526 + */
  527 + @Override
  528 + public int deleteWorkflowById(String id) {
  529 + return workflowMapper.deleteWorkflowById(id);
  530 + }
  531 +
  532 + @Override
  533 + public void deleteWorkflowByName(String name) {
  534 + workflowMapper.deleteWorkflowByName(name);
  535 + }
  536 +
  537 + @Override
  538 + public Workflow selectWorkflowByInstanceId(String instanceId) {
  539 +
  540 + return workflowMapper.selectWorkflowByInstanceId(instanceId);
  541 + }
607 542  
608 543 }
... ...