From 0e2c09d82efbe1beda0f6c0bff88343628d06fb2 Mon Sep 17 00:00:00 2001 From: Yen Date: Wed, 8 May 2024 14:02:03 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=8B=93=E5=B1=95=E7=94=9F?= =?UTF-8?q?=E6=88=90=E8=B4=B9=E7=94=A8=E6=8E=A5=E5=8F=A3=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tbs/mapper/TbsCostCheckStateMapper.java | 6 ++++++ .../tbs/service/TbsBudgetApplicationService.java | 10 ++++++++-- .../modules/third/service/PortalOfCostApplication.java | 3 ++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/qs/serve/modules/tbs/mapper/TbsCostCheckStateMapper.java b/src/main/java/com/qs/serve/modules/tbs/mapper/TbsCostCheckStateMapper.java index da97934b..8ee879cc 100644 --- a/src/main/java/com/qs/serve/modules/tbs/mapper/TbsCostCheckStateMapper.java +++ b/src/main/java/com/qs/serve/modules/tbs/mapper/TbsCostCheckStateMapper.java @@ -1,5 +1,6 @@ package com.qs.serve.modules.tbs.mapper; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; @@ -19,23 +20,28 @@ import java.util.List; */ public interface TbsCostCheckStateMapper { + @InterceptorIgnore(tenantLine = "1") @Update("update tbs_cost_apply set check_state = 0 where charge_state is null ") int updateCheckState0(); + @InterceptorIgnore(tenantLine = "1") @Update("update tbs_cost_apply set check_state = 0 " + "where id not in ( " + " select vtb.cost_apply_id from vtb_verification vtb where vtb.del_flag = 0 AND vtb.verification_state in (0,1) and vtb.cost_apply_id is not null group by vtb.cost_apply_id " + ") and del_flag = 0 and charge_state = 2") int updateCheckState0ByVtb(); + @InterceptorIgnore(tenantLine = "1") @Update("update tbs_cost_apply set check_state = 1 where charge_state = 3 ") int updateCheckState1(); + @InterceptorIgnore(tenantLine = "1") @Update("update tbs_cost_apply set check_state = 2 where id in ( " + " SELECT cost_apply_id from vtb_verification where verification_state = 0 and del_flag = 0 " + ")") int updateCheckState2(); + @InterceptorIgnore(tenantLine = "1") @Select("select cost_apply_id " + " from tbs_activity " + " group by cost_apply_id " + diff --git a/src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetApplicationService.java b/src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetApplicationService.java index e93c2ebb..a92b6738 100644 --- a/src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetApplicationService.java +++ b/src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetApplicationService.java @@ -204,7 +204,7 @@ public class TbsBudgetApplicationService { List noBudgetActivityIds = new ArrayList<>(); //所有满足条件的考核期,用于加载历史核销费用 List scheduleItemList = this.loadScheduleBudgetAndSetting(activityList, budgetIds, noBudgetActivityIds,costSortWrapper); - this.checkPointBudgetId(pointBudgetId, budgetIds,"未满足考核期"); + this.checkPointBudgetId(pointBudgetId, budgetIds,"未满足预算考核期"); List centerIds = activityCenterList.stream().map(TbsActivityCenter::getCenterId).collect(Collectors.toList()); List subjectIds = activitySubjects.stream().map(TbsActivitySubject::getSubjectId).collect(Collectors.toList()); //通过模板限制,选中指定的预算 @@ -237,7 +237,13 @@ public class TbsBudgetApplicationService { //科目限制>品类之间>时间区间 budgetLqw.orderByDesc(TbsBudget::getSubjectId); budgetList = tbsBudgetMapper.selectList(budgetLqw); + if(throwEx&&budgetList.size()<1){ + Assert.throwEx("无可用相关的成本中心或科目的预算"); + } }else { + if(throwEx){ + Assert.throwEx("因预算考核期未命预算"); + } budgetList = new ArrayList<>(); } costSortWrapper.initializeBudget(budgetList); @@ -676,7 +682,7 @@ public class TbsBudgetApplicationService { //无匹配的预算 if(!isMatch){ if (throwEx){ - Assert.throwEx("品类["+ activityCostItem.getTargetName()+"]预算不足"); + Assert.throwEx("匹配品类时预算不足["+ activityCostItem.getTargetCode()+"]"); } log.warn("[{}]{} 预算不足,成本中心:{},科目:{}",activityCostItem.getTargetCode() ,activityCostItem.getTargetName(),activityCostItem.getCenterName(),activityCostItem.getSubjectName()); diff --git a/src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java b/src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java index f017877a..ed985a1d 100644 --- a/src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java +++ b/src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java @@ -894,7 +894,8 @@ public class PortalOfCostApplication { //不匹配的商品,保存到无预算表 List unMatchBudgetItem = budgetCostResult.getBudgetUnMatchList(); if(unMatchBudgetItem.size()>0){ - Assert.throwEx("未能匹配到预算"); + String codes = unMatchBudgetItem.stream().map(a->a.getTargetCode()).collect(Collectors.joining(",")); + Assert.throwEx("未能匹配到预算:"+codes); } // List costUnItemList = new ArrayList<>(); // if(CollectionUtil.isNotEmpty(unMatchBudgetItem)){