From e89d39969facd182bb495b28ea4f833bbcb09644 Mon Sep 17 00:00:00 2001 From: wanggeng888 <450292408@qq.com> Date: Thu, 15 Jul 2021 11:40:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=A1=88=E4=BB=B6=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apis/check/Check2Controller.java | 42 ++ .../service/check/ICheck2Service.java | 24 + .../service/check/impl/Check2ServiceImpl.java | 44 +- .../service/process/IProcessService.java | 38 +- .../process/impl/ProcessServiceImpl.java | 36 +- .../com/cm/inspection/startup/StartUp.java | 8 +- .../route/check/list-check2-city-of-mine.html | 578 ++++++++++++++++++ ...st-check2-district-department-of-mine.html | 578 ++++++++++++++++++ .../check/list-check2-district-of-mine.html | 578 ++++++++++++++++++ .../check/list-check2-street-of-mine.html | 578 ++++++++++++++++++ .../static/route/check/list-check2.html | 12 +- 11 files changed, 2487 insertions(+), 29 deletions(-) create mode 100644 src/main/resources/static/route/check/list-check2-city-of-mine.html create mode 100644 src/main/resources/static/route/check/list-check2-district-department-of-mine.html create mode 100644 src/main/resources/static/route/check/list-check2-district-of-mine.html create mode 100644 src/main/resources/static/route/check/list-check2-street-of-mine.html diff --git a/src/main/java/com/cm/inspection/controller/apis/check/Check2Controller.java b/src/main/java/com/cm/inspection/controller/apis/check/Check2Controller.java index 4520e52..fb93171 100644 --- a/src/main/java/com/cm/inspection/controller/apis/check/Check2Controller.java +++ b/src/main/java/com/cm/inspection/controller/apis/check/Check2Controller.java @@ -146,4 +146,46 @@ public class Check2Controller extends AbstractController { return check2Service.listPageStreetOfMine(page); } + @ApiOperation(value = "我的旗县区委办局案件列表", notes = "我的旗县区委办局案件列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage-district-department-of-mine") + public SuccessResultList> listPageDistrictDepartmentOfMine(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return check2Service.listPageDistrictDepartmentOfMine(page); + } + + @ApiOperation(value = "我的旗县区案件列表", notes = "我的旗县区案件列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage-district-of-mine") + public SuccessResultList> listPageDistrictOfMine(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return check2Service.listPageDistrictOfMine(page); + } + + @ApiOperation(value = "我的市案件列表", notes = "我的市案件列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage-city-of-mine") + public SuccessResultList> listPageCityOfMine(ListPage page) { + Map params = requestParams(); + page.setParams(params); + return check2Service.listPageCityOfMine(page); + } + } \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/service/check/ICheck2Service.java b/src/main/java/com/cm/inspection/service/check/ICheck2Service.java index 42ca40c..8cbc98f 100644 --- a/src/main/java/com/cm/inspection/service/check/ICheck2Service.java +++ b/src/main/java/com/cm/inspection/service/check/ICheck2Service.java @@ -120,4 +120,28 @@ public interface ICheck2Service { * @return */ SuccessResultList> listPageStreetOfMine(ListPage page); + + /** + * 我的旗县区委办局案件列表 + * + * @param page + * @return + */ + SuccessResultList> listPageDistrictDepartmentOfMine(ListPage page); + + /** + * 我的旗县区案件列表 + * + * @param page + * @return + */ + SuccessResultList> listPageDistrictOfMine(ListPage page); + + /** + * 我的市案件列表 + * + * @param page + * @return + */ + SuccessResultList> listPageCityOfMine(ListPage page); } diff --git a/src/main/java/com/cm/inspection/service/check/impl/Check2ServiceImpl.java b/src/main/java/com/cm/inspection/service/check/impl/Check2ServiceImpl.java index 52005cd..be48b49 100644 --- a/src/main/java/com/cm/inspection/service/check/impl/Check2ServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/check/impl/Check2ServiceImpl.java @@ -104,9 +104,15 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service { @Override public void remove(List ids) { + // 删除有关系的流程 Map params = getHashMap(2); - params.put("ids", ids); + params.put("checkIds", ids); check2Dao.removeCheck(params); + + ids.forEach(checkId -> { + processService.deleteProcessByBusinessKey(BUSINESS_KEY_PREFIX + ":" + checkId, "删除案件"); + }); + } @Override @@ -166,6 +172,42 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service { return listPage(page); } + @Override + public SuccessResultList> listPageDistrictDepartmentOfMine(ListPage page) { + String userId = securityComponent.getCurrentUser().getUserId(); + List tasks = processService.listTaskByAssigneeAndVariableKey(GridPersonnelTypeEnum.DISTRICT_DEPARTMENT.getValue(), userId); + List checkIds = listLastCheckId(tasks); + if (checkIds.isEmpty()) { + return new SuccessResultList<>(new ArrayList<>(), 1, 0L); + } + page.getParams().put("checkIds", checkIds); + return listPage(page); + } + + @Override + public SuccessResultList> listPageDistrictOfMine(ListPage page) { + String userId = securityComponent.getCurrentUser().getUserId(); + List tasks = processService.listTaskByAssigneeAndVariableKey(GridPersonnelTypeEnum.DISTRICT.getValue(), userId); + List checkIds = listLastCheckId(tasks); + if (checkIds.isEmpty()) { + return new SuccessResultList<>(new ArrayList<>(), 1, 0L); + } + page.getParams().put("checkIds", checkIds); + return listPage(page); + } + + @Override + public SuccessResultList> listPageCityOfMine(ListPage page) { + String userId = securityComponent.getCurrentUser().getUserId(); + List tasks = processService.listTaskByAssigneeAndVariableKey(GridPersonnelTypeEnum.CITY.getValue(), userId); + List checkIds = listLastCheckId(tasks); + if (checkIds.isEmpty()) { + return new SuccessResultList<>(new ArrayList<>(), 1, 0L); + } + page.getParams().put("checkIds", checkIds); + return listPage(page); + } + /** * 开启检查流程 * diff --git a/src/main/java/com/cm/inspection/service/process/IProcessService.java b/src/main/java/com/cm/inspection/service/process/IProcessService.java index 2e74ce9..fcd77df 100644 --- a/src/main/java/com/cm/inspection/service/process/IProcessService.java +++ b/src/main/java/com/cm/inspection/service/process/IProcessService.java @@ -52,6 +52,30 @@ public interface IProcessService { */ String startProcessByDeploymentId(String deploymentId, String businessKey, Map params); + /** + * 删除流程 + * + * @param processId 流程ID + * @param reason 原因 + */ + void deleteProcessByProcessId(String processId, String reason); + + /** + * 删除流程 + * + * @param processIds 流程ID + * @param reason 原因 + */ + void deleteProcessByProcessIds(List processIds, String reason); + + /** + * 删除流程 + * + * @param businessKey 业务主键 + * @param reason 原因 + */ + void deleteProcessByBusinessKey(String businessKey, String reason); + /** * 任务列表(通过执行人) * @@ -273,24 +297,18 @@ public interface IProcessService { List listHistoricTaskInstance(); /** - * 激活任务 + * 激活流程 * * @param processId */ - void activeTaskByProcessId(String processId); + void activeProcessByProcessId(String processId); /** - * 挂起任务 + * 挂起流程 * * @param processId */ - void suspendTaskByProcessId(String processId); + void suspendProcessByProcessId(String processId); - /** - * 删除任务 - * - * @param processId - */ - void deleteTaskByProcessId(String processId); } \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/service/process/impl/ProcessServiceImpl.java b/src/main/java/com/cm/inspection/service/process/impl/ProcessServiceImpl.java index c0fe284..11276b0 100644 --- a/src/main/java/com/cm/inspection/service/process/impl/ProcessServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/process/impl/ProcessServiceImpl.java @@ -56,16 +56,36 @@ public class ProcessServiceImpl implements IProcessService { @Override public String startProcessByDeploymentId(String deploymentId, String businessKey, Map params) { ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).singleResult(); - if(processDefinition == null) { + if (processDefinition == null) { throw new SystemException("流程不存在"); } - if(!processDefinition.isSuspended()) { + if (!processDefinition.isSuspended()) { throw new SystemException("流程未发布"); } ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinition.getId(), businessKey, params); return processInstance.getId(); } + @Override + public void deleteProcessByProcessId(String processId, String reason) { + runtimeService.deleteProcessInstance(processId, reason); + } + + @Override + public void deleteProcessByProcessIds(List processIds, String reason) { + processIds.forEach(processId -> { + runtimeService.deleteProcessInstance(processId, reason); + }); + } + + @Override + public void deleteProcessByBusinessKey(String businessKey, String reason) { + List processInstances = runtimeService.createProcessInstanceQuery().processInstanceBusinessKey(businessKey).list(); + processInstances.forEach(processInstance -> { + runtimeService.deleteProcessInstance(processInstance.getId(), reason); + }); + } + @Override public List listTaskByAssignee(String assignee) { TaskQuery taskQuery = taskService.createTaskQuery(); @@ -226,7 +246,7 @@ public class ProcessServiceImpl implements IProcessService { @Override public void removeRuntimeVariableByExecutionId(String executionId, String key) { - + runtimeService.removeVariable(executionId, key); } @Override @@ -250,19 +270,13 @@ public class ProcessServiceImpl implements IProcessService { } @Override - public void activeTaskByProcessId(String processId) { + public void activeProcessByProcessId(String processId) { runtimeService.activateProcessInstanceById(processId); } @Override - public void suspendTaskByProcessId(String processId) { + public void suspendProcessByProcessId(String processId) { runtimeService.suspendProcessInstanceById(processId); } - @Override - public void deleteTaskByProcessId(String processId) { - runtimeService.deleteProcessInstance(processId, "结束"); - } - - } diff --git a/src/main/java/com/cm/inspection/startup/StartUp.java b/src/main/java/com/cm/inspection/startup/StartUp.java index de7f2e3..914f890 100644 --- a/src/main/java/com/cm/inspection/startup/StartUp.java +++ b/src/main/java/com/cm/inspection/startup/StartUp.java @@ -7,6 +7,8 @@ import com.cm.inspection.service.dischargepermit.IDischargePermitService; import com.cm.inspection.service.eiareport.IEiaReportService; import com.cm.inspection.service.enterprise.IEnterpriseService; import com.cm.inspection.service.process.IProcessService; +import org.activiti.engine.RepositoryService; +import org.activiti.engine.RuntimeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.ApplicationArguments; @@ -43,13 +45,17 @@ public class StartUp implements ApplicationRunner { private ICountService countService; @Autowired private IEnterpriseService enterpriseService; + @Autowired + private RuntimeService runtimeService; + @Autowired + private RepositoryService repositoryService; @Override public void run(ApplicationArguments args) throws Exception { // 部署流程 - processService.deployProcess("bt-check-report-v2.bpmn20", "包头网格员检查上报流程v2"); processService.deployProcess("check-self", "网格员检查上报流程"); + processService.deployProcess("bt-check-report-v2.bpmn20", "包头网格员检查上报流程v2"); if (checkDetailReportForm) { // 初始化统计,防止第一次打开慢 diff --git a/src/main/resources/static/route/check/list-check2-city-of-mine.html b/src/main/resources/static/route/check/list-check2-city-of-mine.html new file mode 100644 index 0000000..184d378 --- /dev/null +++ b/src/main/resources/static/route/check/list-check2-city-of-mine.html @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+ +
+ + +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/check/list-check2-district-department-of-mine.html b/src/main/resources/static/route/check/list-check2-district-department-of-mine.html new file mode 100644 index 0000000..184d378 --- /dev/null +++ b/src/main/resources/static/route/check/list-check2-district-department-of-mine.html @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+ +
+ + +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/check/list-check2-district-of-mine.html b/src/main/resources/static/route/check/list-check2-district-of-mine.html new file mode 100644 index 0000000..184d378 --- /dev/null +++ b/src/main/resources/static/route/check/list-check2-district-of-mine.html @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+ +
+ + +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/check/list-check2-street-of-mine.html b/src/main/resources/static/route/check/list-check2-street-of-mine.html new file mode 100644 index 0000000..8f56210 --- /dev/null +++ b/src/main/resources/static/route/check/list-check2-street-of-mine.html @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+ +
+ + +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/check/list-check2.html b/src/main/resources/static/route/check/list-check2.html index 184d378..a39ef6a 100644 --- a/src/main/resources/static/route/check/list-check2.html +++ b/src/main/resources/static/route/check/list-check2.html @@ -412,7 +412,7 @@ yes: function (index) { top.dialog.close(index); var layIndex; - top.restAjax.delete(top.restAjax.path('api/check/removecheck/{ids}', [ids]), {}, null, function (code, data) { + top.restAjax.delete(top.restAjax.path('api/check2/remove/{ids}', [ids]), {}, null, function (code, data) { top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000}); reloadTable(); }, function (code, data) { @@ -450,7 +450,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/check/save-check.html', []), + content: top.restAjax.path('route/check2/save-check.html', []), end: function() { reloadTable(); } @@ -468,7 +468,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/check/update-check.html?checkId={checkId}', [checkDatas[0].checkId]), + content: top.restAjax.path('route/check2/update-check.html?checkId={checkId}', [checkDatas[0].checkId]), end: function() { reloadTable(); } @@ -494,7 +494,7 @@ var checkId = this.dataset.checkid; var nameJoinByEnterpriseId = this.dataset.name; top.dialog.open({ - url: top.restAjax.path('route/check/get-check-item.html?checkId={checkId}', [checkId]), + url: top.restAjax.path('route/check2/get-check-item.html?checkId={checkId}', [checkId]), title: '【'+ nameJoinByEnterpriseId + '】检、复查选项', width: '80%', height: '80%', @@ -512,7 +512,7 @@ photoArray: this.dataset.photoArray, } top.dialog.open({ - url: top.restAjax.path('route/check/get-map-location.html?lng={lng}&lat={lat}', [lng, lat]), + url: top.restAjax.path('route/check2/get-map-location.html?lng={lng}&lat={lat}', [lng, lat]), title: '企业位置信息', width: '80%', height: '80%', @@ -535,7 +535,7 @@ photoArray: this.dataset.photoArray, } top.dialog.open({ - url: top.restAjax.path('route/check/get-map-location.html?lng={lng}&lat={lat}', [lng, lat]), + url: top.restAjax.path('route/check2/get-map-location.html?lng={lng}&lat={lat}', [lng, lat]), title: '检查位置信息', width: '80%', height: '80%',