From dd60de8d90f05c64e3cf166bc617b95a82102c52 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Thu, 11 Apr 2024 16:38:58 +0800
Subject: [PATCH] 新增自定义异常类
---
src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java | 84 ++++++++++++++++++++++++++----------------
1 files changed, 52 insertions(+), 32 deletions(-)
diff --git a/src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java b/src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java
index a1e281f..2e8c65e 100644
--- a/src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java
+++ b/src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java
@@ -24,6 +24,7 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
+import org.springblade.common.constant.CommonConstant;
import org.springblade.common.constant.DictConstant;
import org.springblade.common.param.CommonParamSet;
import org.springblade.common.utils.SpringUtils;
@@ -115,7 +116,7 @@
// if (AuthUtil.getUserAccount().equals("18879306957")) {
// task.setCommunityCode("361102003027");
// }
- CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskVO.class,task);
+ CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskVO.class, task);
if (null != task.getReportType() && task.getReportType() == 1) {
// 查询取保候审任务列表(人房相关)
return page.setRecords(baseMapper.selectTaskPageByPerson(page, task, commonParamSet.getRegionChildCodesList(),
@@ -225,22 +226,23 @@
taskVO.setNeiCode(neiCode);
taskVO.setReportType(5);
taskVO.setIsDeleted(0);
- CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskVO.class,taskVO);
+ CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskVO.class, taskVO);
// 标签报事-二手交易
- Integer bqsj = baseMapper.selectTaskCount(taskVO,commonParamSet.getRegionChildCodesList(),
- commonParamSet.getIsAdministrator(),commonParamSet.getGridCodeList());
+ Integer bqsj = baseMapper.selectTaskCount(taskVO, commonParamSet.getRegionChildCodesList(),
+ commonParamSet.getIsAdministrator(), commonParamSet.getGridCodeList());
taskVO.setReportType(1);
// 取保候审
- Integer qbhs = baseMapper.selectTaskCount(taskVO,commonParamSet.getRegionChildCodesList(),
- commonParamSet.getIsAdministrator(),commonParamSet.getGridCodeList());
+ Integer qbhs = baseMapper.selectTaskCount(taskVO, commonParamSet.getRegionChildCodesList(),
+ commonParamSet.getIsAdministrator(), commonParamSet.getGridCodeList());
// 报事报修
Integer bsbx = SpringUtils.getBean(ITaskReportForRepairsService.class).getStatistics(roleType > 0 ? AuthUtil.getUserId() : null, neiCode);
// 住户审核
- Integer zhsh = iHouseholdService.statistics(roleType > 0 ? AuthUtil.getUserId() : null, neiCode,0);
+ Integer zhsh = iHouseholdService.statistics(roleType > 0 ? AuthUtil.getUserId() : null, neiCode, 0);
// 出租审核
HouseRentalTenantVO houseRentalTenantVO = new HouseRentalTenantVO();
- houseRentalTenantVO.setNeiCode(neiCode);
+ houseRentalTenantVO.setCommunityCode(neiCode);
+ houseRentalTenantVO.setAuditStatus(2);
Integer czsh = iHouseRentalService.getStatisticsCount(houseRentalTenantVO);
// 场所审核
Integer cssh = SpringUtils.getBean(IPlaceExtService.class).selectCount(roleType > 0 ? AuthUtil.getUserId() : null, neiCode, 1);
@@ -254,6 +256,10 @@
Integer xfyhzg = SpringUtils.getBean(ITaskPlaceRectificationService.class).getCount(neiCode, 1);
// 居住证申请
Integer jzzsq = SpringUtils.getBean(ITaskResidencePermitApplyService.class).getCount(neiCode, 1);
+ // 无诈统计
+ taskVO.setReportType(6);
+ Integer wztj = baseMapper.selectTaskCount(taskVO, commonParamSet.getRegionChildCodesList(),
+ commonParamSet.getIsAdministrator(), commonParamSet.getGridCodeList());
// 设置
objectObjectHashMap.put("qbhs", qbhs);// 取保候审
objectObjectHashMap.put("bqsj", bqsj);// 标签报事-二手交易
@@ -265,6 +271,7 @@
objectObjectHashMap.put("xfzc", xfzc);// 消防自查
objectObjectHashMap.put("xfyhzg", xfyhzg);// 消防隐患整改
objectObjectHashMap.put("jzzsq", jzzsq);// 居住证申请
+ objectObjectHashMap.put("wztj", wztj);// 无诈
return objectObjectHashMap;
}
@@ -288,9 +295,9 @@
taskVO.setUserId(AuthUtil.getUserId());
taskVO.setFrequency(1);
taskVO.setStatus(1);
- Integer disposable = baseMapper.selectTaskCount(taskVO,null,null,null);
+ Integer disposable = baseMapper.selectTaskCount(taskVO, null, null, null);
taskVO.setFrequency(2);
- Integer periodicity = baseMapper.selectTaskCount(taskVO,null,null,null);
+ Integer periodicity = baseMapper.selectTaskCount(taskVO, null, null, null);
objectObjectHashMap.put("disposable", disposable);
objectObjectHashMap.put("periodicity", periodicity);
return objectObjectHashMap;
@@ -603,33 +610,46 @@
}
/**
- * 任务审核
- * @param task
- * @return
+ * 审核任务。
+ * 根据任务的报告类型,更新相应的任务状态,并触发相应的事件更新。
+ *
+ * @param task 任务实体,包含任务信息和报告类型。
+ * @return 返回审核结果,成功为true,失败为false。
*/
@Override
public Boolean examine(TaskEntity task) {
- // 二手交易
- if (task.getReportType().equals(5)) {
- boolean b = updateById(task);
- if (b) {
- ITaskLabelReportingEventService bean = SpringUtils.getBean(ITaskLabelReportingEventService.class);
- return bean.update(Wrappers.<TaskLabelReportingEventEntity>lambdaUpdate()
- .set(TaskLabelReportingEventEntity::getConfirmFlag, task.getStatus())
- .eq(TaskLabelReportingEventEntity::getTaskId, task.getId()));
- }
+ if (task == null || task.getReportType() == null) {
+ // 检查任务和报告类型是否为空,若为空则直接返回false
+ return false;
+ }
+ // 根据任务报告类型,更新任务状态并触发相应的事件更新
+ boolean result = updateById(task);
+ if (!result) {
+ return false;
+ }
+ if (task.getReportType().equals(CommonConstant.REPORT_TYPE_SECONDHAND_TRADE)) {
+ // 如果报告类型匹配,尝试更新任务标签报告事件状态
+ ITaskLabelReportingEventService bean = SpringUtils.getBean(ITaskLabelReportingEventService.class);
+ return bean.update(Wrappers.<TaskLabelReportingEventEntity>lambdaUpdate()
+ .set(TaskLabelReportingEventEntity::getConfirmFlag, task.getStatus())
+ .eq(TaskLabelReportingEventEntity::getTaskId, task.getId()));
+ } else if (task.getReportType().
+ equals(CommonConstant.REPORT_TYPE_FIRE_INSPECTION)) {
+ // 如果报告类型为消防自查,尝试更新消防自查状态
+ ITaskPlaceSelfCheckService bean = SpringUtils.getBean(ITaskPlaceSelfCheckService.class);
+ return bean.update(Wrappers.<TaskPlaceSelfCheckEntity>lambdaUpdate()
+ .set(TaskPlaceSelfCheckEntity::getStatus, task.getStatus())
+ .eq(TaskPlaceSelfCheckEntity::getTaskId, task.getId()));
+ } else if (task.getReportType().equals(CommonConstant.REPORT_TYPE_NO_FRAUD)) {
+ // 如果报告类型为无诈,尝试更新无诈报告状态
+ ITaskNoFraudReportingService bean = SpringUtils.getBean(ITaskNoFraudReportingService.class);
+ return bean.update(Wrappers.<TaskNoFraudReportingEntity>lambdaUpdate()
+ .set(TaskNoFraudReportingEntity::getStatus, task.getStatus())
+ .eq(TaskNoFraudReportingEntity::getTaskId, task.getId()));
}
- // 消防只查
- if (task.getReportType().equals(2)) {
- boolean b = updateById(task);
- if (b) {
- ITaskPlaceSelfCheckService bean = SpringUtils.getBean(ITaskPlaceSelfCheckService.class);
- return bean.update(Wrappers.<TaskPlaceSelfCheckEntity>lambdaUpdate()
- .set(TaskPlaceSelfCheckEntity::getStatus, task.getStatus())
- .eq(TaskPlaceSelfCheckEntity::getTaskId, task.getId()));
- }
- }
+ // 如果没有匹配的报告类型,返回false
return false;
}
+
}
--
Gitblit v1.9.3