lin
2024-04-11 0ecbf017eba6b832e50e4905d62acfcf12914bf6
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,19 +226,19 @@
      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.setCommunityCode(neiCode);
@@ -289,9 +290,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;
@@ -604,33 +605,47 @@
   }
   /**
    * 任务审核
    * @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) {
      if (task == null || task.getReportType() == null) {
         // 检查任务和报告类型是否为空,若为空则直接返回false
         return false;
      }
      // 根据任务报告类型,更新任务状态并触发相应的事件更新
      boolean result = updateById(task);
      if (task.getReportType().equals(CommonConstant.REPORT_TYPE_SECONDHAND_TRADE)) {
         // 如果报告类型匹配,尝试更新任务标签报告事件状态
         if (result) {
            ITaskLabelReportingEventService bean = SpringUtils.getBean(ITaskLabelReportingEventService.class);
            return bean.update(Wrappers.<TaskLabelReportingEventEntity>lambdaUpdate()
               .set(TaskLabelReportingEventEntity::getConfirmFlag, task.getStatus())
               .eq(TaskLabelReportingEventEntity::getTaskId, task.getId()));
         }
      }
      // 消防只查
      if (task.getReportType().equals(2)) {
         boolean b = updateById(task);
         if (b) {
      } else if (task.getReportType().equals(CommonConstant.REPORT_TYPE_FIRE_INSPECTION)) {
         // 如果报告类型为消防自查,尝试更新消防自查状态
         if (result) {
            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)) {
         // 如果报告类型为无诈,尝试更新无诈报告状态
         if (result) {
            ITaskNoFraudReportingService bean = SpringUtils.getBean(ITaskNoFraudReportingService.class);
            return bean.update(Wrappers.<TaskNoFraudReportingEntity>lambdaUpdate()
               .set(TaskNoFraudReportingEntity::getStatus, task.getStatus())
               .eq(TaskNoFraudReportingEntity::getTaskId, task.getId()));
         }
      }
      // 如果没有匹配的报告类型,返回false
      return false;
   }
}