Browse Source

fix:拓展生成费用接口提示

checkBack
Yen 1 year ago
parent
commit
0e2c09d82e
  1. 6
      src/main/java/com/qs/serve/modules/tbs/mapper/TbsCostCheckStateMapper.java
  2. 10
      src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetApplicationService.java
  3. 3
      src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java

6
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 " +

10
src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetApplicationService.java

@ -204,7 +204,7 @@ public class TbsBudgetApplicationService {
List<Long> noBudgetActivityIds = new ArrayList<>();
//所有满足条件的考核期,用于加载历史核销费用
List<TbsScheduleItemBudget> scheduleItemList = this.loadScheduleBudgetAndSetting(activityList, budgetIds, noBudgetActivityIds,costSortWrapper);
this.checkPointBudgetId(pointBudgetId, budgetIds,"未满足考核期");
this.checkPointBudgetId(pointBudgetId, budgetIds,"未满足预算考核期");
List<String> centerIds = activityCenterList.stream().map(TbsActivityCenter::getCenterId).collect(Collectors.toList());
List<Long> 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());

3
src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java

@ -894,7 +894,8 @@ public class PortalOfCostApplication {
//不匹配的商品,保存到无预算表
List<TbsBudgetCostItem> unMatchBudgetItem = budgetCostResult.getBudgetUnMatchList();
if(unMatchBudgetItem.size()>0){
Assert.throwEx("未能匹配到预算");
String codes = unMatchBudgetItem.stream().map(a->a.getTargetCode()).collect(Collectors.joining(","));
Assert.throwEx("未能匹配到预算:"+codes);
}
// List<TbsCostUnItem> costUnItemList = new ArrayList<>();
// if(CollectionUtil.isNotEmpty(unMatchBudgetItem)){

Loading…
Cancel
Save