From f321fa3187ce24dada42bc7a6536e59b1c9f184b Mon Sep 17 00:00:00 2001 From: Yen Date: Fri, 31 May 2024 10:07:13 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E8=B4=B9?= =?UTF-8?q?=E7=94=A8=E4=BD=BF=E7=94=A8=E9=A2=84=E7=AE=97=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=20fix:=20=E5=88=9D=E5=A7=8B=E5=8C=96=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E5=8D=95=E6=8D=AE=E7=BC=BA=E5=A4=B1=E8=B4=B9=E7=94=A8=E5=8D=A0?= =?UTF-8?q?=E7=94=A8=E8=84=9A=E6=9C=AC=20fix=EF=BC=9A=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E9=A2=84=E7=AE=97=E7=8A=B6=E6=80=81=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serve/modules/bms/entity/BmsSubject.java | 3 + .../bms/entity/vo/BmsSubjectTreeVo.java | 4 + .../common/util/TbsBudgetLogBuildUtil.java | 3 +- .../tbs/controller/TbsActivityController.java | 3 +- .../controller/TbsBudgetLogController.java | 11 +++ .../mapper/TbsActivityChannelPointMapper.java | 24 ++++++ .../mapper/TbsScheduleItemBudgetMapper.java | 1 - .../TbsActivityDebugApplicationService.java | 38 ++++++--- .../TbsBudgetReleaseApplicationService.java | 79 ++++++++++++++++++- .../impl/TbsBudgetBatchServiceImpl.java | 2 +- .../impl/TbsBudgetManagerServiceImpl.java | 11 ++- .../TbsCostApplyOperationServiceImpl.java | 12 +-- .../service/impl/TbsCostApplyServiceImpl.java | 8 ++ 13 files changed, 172 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/qs/serve/modules/bms/entity/BmsSubject.java b/src/main/java/com/qs/serve/modules/bms/entity/BmsSubject.java index 1461f36f..978357b1 100644 --- a/src/main/java/com/qs/serve/modules/bms/entity/BmsSubject.java +++ b/src/main/java/com/qs/serve/modules/bms/entity/BmsSubject.java @@ -61,6 +61,9 @@ public class BmsSubject implements Serializable { private Integer level; + /** 应用与发布费用时,必选网点拦截 */ + private Integer pointSelectFlag; + /** 备注 */ @Length(max = 255,message = "备注长度不能超过255字") private String remark; diff --git a/src/main/java/com/qs/serve/modules/bms/entity/vo/BmsSubjectTreeVo.java b/src/main/java/com/qs/serve/modules/bms/entity/vo/BmsSubjectTreeVo.java index b950ec07..ce3ed1f1 100644 --- a/src/main/java/com/qs/serve/modules/bms/entity/vo/BmsSubjectTreeVo.java +++ b/src/main/java/com/qs/serve/modules/bms/entity/vo/BmsSubjectTreeVo.java @@ -49,4 +49,8 @@ public class BmsSubjectTreeVo extends TreeNode { /** 是否进场费用 */ private Integer slottingFlag; + + /** 应用与发布费用时,必选网点拦截 */ + private Integer pointSelectFlag; + } diff --git a/src/main/java/com/qs/serve/modules/tbs/common/util/TbsBudgetLogBuildUtil.java b/src/main/java/com/qs/serve/modules/tbs/common/util/TbsBudgetLogBuildUtil.java index ff8e2a9c..3a9815b1 100644 --- a/src/main/java/com/qs/serve/modules/tbs/common/util/TbsBudgetLogBuildUtil.java +++ b/src/main/java/com/qs/serve/modules/tbs/common/util/TbsBudgetLogBuildUtil.java @@ -62,7 +62,8 @@ public class TbsBudgetLogBuildUtil { * @param activity * @return */ - public static TbsBudgetLog buildTbsBudgetLog(BudgetLogOptFlag optType, SysUser sysUser, TbsCostApply costApply, TbsBudgetCostItem item, TbsBudget budget, BigDecimal amount, TbsActivity activity) { + public static TbsBudgetLog buildTbsBudgetLog(BudgetLogOptFlag optType, SysUser sysUser, TbsCostApply costApply, + TbsBudgetCostItem item, TbsBudget budget, BigDecimal amount, TbsActivity activity) { TbsBudgetLog budgetLog = new TbsBudgetLog(); budgetLog.setBudgetId(item.getBudgetId()); budgetLog.setBudgetCode(budget.getBudgetCode()); diff --git a/src/main/java/com/qs/serve/modules/tbs/controller/TbsActivityController.java b/src/main/java/com/qs/serve/modules/tbs/controller/TbsActivityController.java index 1027e5a6..16a38dc4 100644 --- a/src/main/java/com/qs/serve/modules/tbs/controller/TbsActivityController.java +++ b/src/main/java/com/qs/serve/modules/tbs/controller/TbsActivityController.java @@ -110,8 +110,7 @@ public class TbsActivityController { @GetMapping("/resetList") public R reset(){ Long[] ids = new Long[]{ - 1701432L,1701437L,1701438L,1701439L,1701440L,1701441L,1701442L,1701443L,1701444L,1701741L,1701743L,1701744L, - 1701895L,1701898L,1701943L,1701988L,1701989L,1701990L,1701991L,1701993L,1701994L,1701996L,1702000L,1702001L,1702003L,1702005L,1702007L,1702009L,1702010L,1702012L,1702028L,1702207L,1702212L,1702213L,1702214L,1702269L,1702283L,1702284L,1702342L,1702344L,1702345L,1702346L,1702349L,1702380L + 1702815L,1702816L,1702818L,1702819L,1702820L,1702821L,1702822L,1702823L,1702824L,1702826L,1702827L,1702829L,1702834L,1702835L,1702836L,1702837L,1702838L,1702839L,1702840L,1702841L,1702842L,1702843L,1702844L,1702845L,1702846L,1702847L,1702848L,1702849L,1702850L,1702851L,1702852L,1702853L,1702854L,1702855L,1702856L,1702857L,1702858L,1702859L,1702860L,1702861L,1702862L,1702863L,1702864L,1702865L,1702866L,1702867L,1702869L,1702870L,1702871L,1702872L,1702873L,1702874L,1702875L,1702876L,1702877L,1702878L,1702879L,1702880L,1702881L,1702882L,1702883L,1702884L,1702885L,1702886L,1702887L,1702888L,1702889L,1702891L,1702892L,1702899L,1702900L,1702901L,1702903L,1702904L,1702905L,1702906L,1702907L,1702908L,1702909L,1702910L,1702912L,1702913L,1702914L,1702915L,1702916L,1702917L,1702918L,1702919L,1702920L,1702921L,1702923L,1702924L,1702925L,1702926L,1702928L,1702929L,1702930L,1702931L,1702932L,1702933L,1702935L,1702936L,1702937L,1702938L,1702940L,1702948L,1702953L,1702955L,1702958L,1702959L,1702960L,1702961L,1702962L,1702963L,1702964L,1702965L,1702967L,1702968L,1702969L,1702970L,1702971L,1702972L,1702973L,1702974L,1702975L,1702978L,1702982L,1702983L,1702984L,1702985L,1702986L,1702987L,1702988L,1702990L,1702992L,1702993L,1702994L,1702995L,1702996L,1702997L,1702998L,1702999L,1703000L,1703001L,1703002L,1703003L,1703004L,1703007L,1703008L,1703009L,1703010L,1703011L,1703012L,1703013L,1703014L,1703015L,1703016L,1703018L,1703019L,1703020L,1703021L,1703022L,1703023L,1703024L,1703025L,1703026L,1703028L,1703029L,1703030L,1703031L,1703032L,1703033L,1703034L,1703036L,1703037L,1703038L,1703041L,1703043L,1703044L,1703047L,1703048L,1703052L,1703053L,1703054L,1703055L,1703056L,1703057L,1703059L,1703060L,1703061L,1703062L,1703063L,1703064L,1703065L,1703066L,1703067L,1703069L,1703072L,1703073L,1703075L,1703076L,1703077L,1703078L,1703079L,1703081L,1703083L,1703084L,1703086L,1703087L,1703089L,1703095L,1703099L,1703100L,1703101L,1703103L,1703104L,1703105L,1703106L,1703107L,1703108L,1703109L,1703111L,1703112L,1703114L,1703115L,1703116L,1703117L,1703118L,1703119L,1703120L,1703122L,1703123L,1703125L,1703126L,1703127L,1703128L,1703129L,1703130L,1703131L,1703133L,1703135L,1703136L,1703137L,1703138L,1703139L,1703140L,1703141L,1703142L,1703143L,1703144L,1703145L,1703146L,1703147L,1703148L,1703149L,1703150L,1703152L,1703153L,1703154L,1703155L,1703156L,1703157L,1703158L,1703162L,1703164L,1703165L,1703169L,1703170L,1703171L,1703173L,1703174L,1703175L,1703176L,1703177L,1703178L,1703181L,1703182L,1703183L,1703184L,1703187L,1703188L,1703189L,1703190L,1703192L,1703193L,1703194L,1703195L,1703196L,1703197L,1703198L,1703199L,1703200L,1703202L,1703203L,1703205L,1703206L,1703207L,1703209L,1703210L,1703212L,1703213L,1703214L,1703215L,1703217L,1703218L,1703220L,1703221L,1703222L,1703223L,1703224L,1703226L,1703228L,1703229L,1703231L,1703233L,1703234L,1703235L,1703236L,1703237L,1703238L,1703239L,1703240L,1703241L,1703242L,1703243L,1703244L,1703246L,1703247L,1703248L,1703249L,1703250L,1703251L,1703252L,1703253L,1703254L,1703255L,1703256L,1703258L,1703260L,1703262L,1703263L,1703264L,1703265L,1703267L,1703269L,1703270L,1703271L,1703272L,1703273L,1703276L,1703278L,1703280L,1703283L,1703284L,1703285L,1703287L,1703288L,1703291L,1703292L,1703293L,1703294L,1703295L,1703296L,1703297L,1703300L,1703301L,1703302L,1703307L,1703308L,1703309L,1703310L,1703311L,1703313L,1703314L,1703315L,1703316L,1703317L,1703319L,1703320L,1703321L,1703322L,1703325L,1703326L,1703327L,1703328L,1703329L,1703330L,1703331L,1703333L,1703334L,1703335L,1703338L,1703342L,1703345L,1703346L,1703350L,1703351L,1703354L,1703355L,1703356L,1703357L,1703358L,1703360L,1703362L,1703363L,1703364L,1703365L,1703366L,1703368L,1703369L,1703370L,1703371L,1703372L,1703373L,1703374L,1703375L,1703376L,1703377L,1703378L,1703379L,1703380L,1703381L,1703382L,1703383L,1703385L,1703387L,1703391L,1703394L,1703395L,1703396L,1703398L,1703399L,1703400L,1703401L,1703403L,1703404L,1703405L,1703407L,1703408L,1703410L,1703411L,1703412L,1703413L,1703414L,1703415L,1703421L,1703422L,1703423L,1703426L,1703427L,1703428L,1703429L,1703430L,1703431L,1703432L,1703433L,1703435L,1703436L,1703437L,1703438L,1703440L,1703441L,1703442L,1703443L,1703445L,1703446L,1703456L,1703461L,1703479L,1703480L,1703486L,1703488L,1703489L,1703491L,1703494L,1703497L,1703498L,1703506L,1703515L,1703516L,1703517L,1703519L,1703520L,1703521L,1703522L,1703523L,1703524L,1703557L,1703620L,1703631L,1703634L,1703668L,1703850L,1703854L,1703862L,1703863L,1703870L,1703940L,1703941L,1703955L,1703976L,1703982L,1703995L,1704078L,1704214L,1705268L,1705278L,1705282L,1705311L,1705314L,1705349L,1706282L,1706285L,1706286L,1706287L,1706421L,1706422L,1706423L,1706435L,1706440L,1706442L,1707024L,1707025L,1707076L,1707188L,1707190L,1707520L,1707583L,1707584L,1707999L,1708000L,1708777L,1708778L,1708783L,1708836L,1708858L,1708861L,1708863L,1708866L,1708868L,1708869L,1708870L,1708874L,1708876L,1708883L,1708884L,1709451L,1709478L,1709511L,1709513L,1709516L,1709525L,1709527L,1709535L,1709920L,1709921L,1709925L,1709929L,1710310L,1710505L,1710506L,1710527L,1710528L,1710529L,1710531L,1710534L,1710622L,1710623L,1711162L,1711163L,1711288L,1711301L,1711304L,1711313L,1711864L,1711867L,1711869L,1711876L,1711904L,1711907L,1711910L,1711911L,1711912L,1711927L,1711928L,1712196L,1712201L,1712206L,1712231L,1712261L,1712307L,1712309L,1712493L,1712500L,1712743L,1712744L,1712790L,1712791L,1712832L,1712868L,1712869L,1712877L,1712953L,1713120L,1713121L,1713122L,1713124L,1713298L,1713318L,1713321L,1713324L,1713335L,1713340L,1713351L,1713352L,1714129L,1714131L,1714260L,1714261L,1714262L,1716447L,1716448L,1716449L,1716452L,1716660L,1716661L,1716663L,1716664L,1716667L,1716671L,1716674L,1716676L,1716677L,1716678L,1716691L,1716699L,1716700L,1716702L,1716706L,1716707L,1716708L,1716711L,1716712L,1716942L,1717023L,1717027L,1717028L,1717029L,1717033L,1717038L,1717042L,1717043L,1717047L,1717050L,1717053L,1717055L,1717123L,1717125L,1717133L,1717397L,1717398L,1717478L,1717479L,1717483L,1717484L,1717522L,1717523L,1717528L,1717530L,1717531L,1717532L,1717534L,1717537L,1717538L,1717539L,1717540L,1717541L,1717542L,1717543L,1717544L,1717545L,1717546L,1717547L,1717548L,1717847L,1717862L,1717863L,1717876L,1717881L,1717882L,1717883L,1717886L,1717889L,1717890L,1717892L,1717893L,1717894L,1717895L,1717896L,1717897L,1717898L,1717899L,1717900L,1717901L,1717903L,1717905L,1717910L,1717917L,1717941L,1717943L,1718003L,1718120L,1718121L,1718152L,1718154L,1718157L,1718160L,1718162L,1718166L,1718170L,1718171L,1718172L,1718182L,1718183L,1718185L,1718294L,1718297L,1718298L,1718301L,1718572L,1718592L,1718594L,1718789L,1718790L,1718792L,1718793L,1718795L,1718797L,1718798L,1718800L,1718801L,1718809L,1718810L,1718865L,1718888L,1718897L,1718909L,1718913L,1718988L,1718990L,1719020L,1719024L,1719081L,1719083L,1719088L,1719090L,1719091L,1719114L,1719124L,1719147L,1719149L,1719154L,1719157L,1719160L,1719176L,1719178L,1719183L,1719187L,1719188L,1719193L,1719197L,1719202L,1719205L,1719219L,1719221L,1719222L,1719228L,1719259L,1719296L,1719297L,1719299L,1719300L,1719303L,1719309L,1719310L,1719327L,1719331L,1719332L,1719333L,1719339L,1719348L,1719376L,1719378L,1719388L,1719442L,1719444L,1719446L,1719447L,1719458L,1719459L,1719471L,1719472L,1719490L,1720721L,1720722L,1720734L,1720735L,1720786L,1720787L,1720801L,1720821L,1720831L,1720833L,1720834L,1720835L,1720838L,1720844L,1720846L,1720971L,1720976L,1720978L,1720979L,1720980L,1720982L,1721098L,1721132L,1721354L,1721429L,1721430L,1721431L,1721441L,1721443L,1721446L,1721447L,1721448L,1721485L,1721486L,1721487L,1721488L,1721489L,1721490L,1721491L,1721575L,1721576L,1721585L,1721586L,1721589L,1721591L,1721592L,1721593L,1721594L,1721595L,1721596L,1721842L,1721843L,1721844L,1721855L,1721857L,1721859L,1721861L,1721938L,1721939L,1722001L,1722002L,1722010L,1722011L,1722020L,1723421L,1723931L,1723932L,1723939L,1723945L,1723946L,1723947L,1724137L,1724138L,1724140L,1724142L,1724143L,1724148L,1724149L,1724150L,1724151L,1724307L,1724309L,1724313L,1724344L,1724347L,1724348L,1724727L,1724728L,1724733L,1724734L,1724735L,1724736L,1724737L,1724738L,1724740L,1724742L,1724745L,1724790L,1724792L,1724795L,1724875L,1724876L,1724877L,1724878L,1724879L,1724880L,1724881L,1724893L,1724895L,1724897L,1724898L,1724899L,1724900L,1724901L,1724902L,1724903L,1724971L,1725003L,1725004L,1725016L,1725017L,1725019L,1725021L,1725022L,1725095L,1725109L,1725110L,1725111L,1725128L,1725129L,1725563L,1725565L,1725566L,1725569L,1725570L,1725598L,1725602L,1725603L,1725604L,1725708L,1725711L,1725714L,1725717L,1725719L,1725720L,1725721L,1725722L,1725723L,1725725L,1725727L,1725728L,1725733L,1725736L,1725743L,1725772L,1725773L,1726013L,1726195L,1726200L,1726202L,1726203L,1726205L,1726224L,1726225L,1726226L,1726227L,1726228L,1726231L,1726233L,1726236L,1726237L,1726238L,1726239L,1726241L,1726242L,1726248L,1726252L,1726259L,1726290L,1726292L,1726293L,1726294L,1726295L,1726296L,1726297L,1726298L,1726472L,1726473L,1726474L,1726476L,1726477L,1726478L,1726479L,1726480L,1726484L,1726695L,1726696L,1726697L,1726699L,1726700L,1726703L,1726704L,1726705L }; for (Long id : ids) { System.out.println(tbsActivityDebugApplicationService.reset(id)); diff --git a/src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetLogController.java b/src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetLogController.java index a56a1b01..bc220f45 100644 --- a/src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetLogController.java +++ b/src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetLogController.java @@ -65,6 +65,17 @@ public class TbsBudgetLogController { return R.ok(); } + /** + * 初始化活动申请费用 + * @param activityId + * @return + */ + @GetMapping("/debugActivity") + public R debugActivity(Long activityId){ + tbsBudgetReleaseApplicationService.initHis(activityId); + return R.ok(); + } + /** * 翻页 * @param param diff --git a/src/main/java/com/qs/serve/modules/tbs/mapper/TbsActivityChannelPointMapper.java b/src/main/java/com/qs/serve/modules/tbs/mapper/TbsActivityChannelPointMapper.java index a1d0970a..0f19be1e 100644 --- a/src/main/java/com/qs/serve/modules/tbs/mapper/TbsActivityChannelPointMapper.java +++ b/src/main/java/com/qs/serve/modules/tbs/mapper/TbsActivityChannelPointMapper.java @@ -1,7 +1,10 @@ package com.qs.serve.modules.tbs.mapper; +import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.qs.serve.modules.tbs.entity.TbsActivityChannelPoint; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; /** * 活动网点项 Mapper @@ -10,5 +13,26 @@ import com.qs.serve.modules.tbs.entity.TbsActivityChannelPoint; */ public interface TbsActivityChannelPointMapper extends BaseMapper { + /** + * 检查科目必选网点拦截 + * @param activityId + * @return activityId表示被拦截,空表示ok + */ + @InterceptorIgnore(tenantLine = "1") + @Select("select tbs_activity_subject.activity_id from tbs_activity_subject " + + "left join bms_subject on subject_id = bms_subject.id " + + "left join ( " + + " select count(1) as count_point,activity_id from tbs_activity_channel_point " + + " where del_flag = 0 and activity_id = #{activityId} " + + " group by activity_id " + + ") t1 on t1.activity_id = tbs_activity_subject.activity_id " + + "where " + + " bms_subject.del_flag = 0 " + + "and tbs_activity_subject.del_flag = 0 " + + "and bms_subject.point_select_flag = 1 " + + "and (t1.activity_id is null or t1.count_point = 0) " + + "and tbs_activity_subject.activity_id = #{activityId}") + Long checkSubjectPoint(@Param("activityId") Long activityId); + } diff --git a/src/main/java/com/qs/serve/modules/tbs/mapper/TbsScheduleItemBudgetMapper.java b/src/main/java/com/qs/serve/modules/tbs/mapper/TbsScheduleItemBudgetMapper.java index c447d038..6ead8ca8 100644 --- a/src/main/java/com/qs/serve/modules/tbs/mapper/TbsScheduleItemBudgetMapper.java +++ b/src/main/java/com/qs/serve/modules/tbs/mapper/TbsScheduleItemBudgetMapper.java @@ -226,7 +226,6 @@ public interface TbsScheduleItemBudgetMapper extends BaseMapper goodsList = activityCenterGoodsListOfSubject.stream() .filter(a->a.getCenterId().equals(center.getCenterId())&&a.getCenterType().equals(center.getCenterType())) .collect(Collectors.toList()); + if(goodsList.size()==0){ + if(subjectCenterList.size()==1 && activityCenterGoodsListOfSubject.size()==1){ + TbsActivityCenterGoods centerGoods = activityCenterGoodsListOfSubject.get(0); + centerGoods.setCenterType(center.getCenterType()); + centerGoods.setCenterId(center.getCenterId()); + centerGoods.setCenterName(center.getCenterName()); + goodsList = new ArrayList<>(); + goodsList.add(centerGoods); + }else { + log.error("商品数据缺失"); + return "商品数据缺失"; + } + } final BigDecimal centerUsed = center.getUsedAmount(); final BigDecimal centerAmt = center.getCenterAmount(); @@ -358,7 +371,6 @@ public class TbsActivityDebugApplicationService { } - if(activity.getUsedAmount().compareTo(totalSubjectUsedAmt)!=0){ log.error("活动和totalSubjectUsedAmt匹对金额异常:{}",activityId); return "活动和totalSubjectUsedAmt匹对金额异常"; @@ -415,6 +427,10 @@ public class TbsActivityDebugApplicationService { continue; } + if(goodApplyLogs.size()==0){ + return "缺失费用申请log"; + } + // 新log TbsBudgetLog newApplyLog = CopierUtil.copy(goodApplyLogs.get(0),new TbsBudgetLog()); newApplyLog.setId(null); diff --git a/src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetReleaseApplicationService.java b/src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetReleaseApplicationService.java index d01f882a..347299cb 100644 --- a/src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetReleaseApplicationService.java +++ b/src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetReleaseApplicationService.java @@ -38,11 +38,85 @@ public class TbsBudgetReleaseApplicationService { private final TbsActivityCenterGoodsService activityCenterGoodsService; private final TbsCostApplyService costApplyService; private final TbsActivityPayConditionService activityPayConditionService; + private final TbsScheduleItemBudgetService tbsScheduleItemBudgetService; + public void initHis(Long activityId){ + TbsBudget budget = budgetService.getById("1669"); + TbsScheduleItemBudget scheduleItemBudget = tbsScheduleItemBudgetService.getById("4896"); + TbsActivity activity = activityService.getById(activityId); + TbsCostApply costApply = costApplyService.getById(activity.getCostApplyId()); + SysUser sysUser = new SysUser(); + sysUser.setId("0"); + sysUser.setName("系统执行"); + sysUser.setCode("0"); + + List budgetLogList = new ArrayList<>(); + List centerGoodsList = activityCenterGoodsService.listByActivityId(activityId); + for (TbsActivityCenterGoods centerGoods : centerGoodsList) { + BigDecimal amount = centerGoods.getCenterGoodsAmount(); + + TbsBudgetCostItem costItem = new TbsBudgetCostItem(); + costItem.setCenterGoodsCode(centerGoods.getCenterGoodsCode()); + costItem.setCostApplyId(centerGoods.getCostApplyId()); + costItem.setActivityId(centerGoods.getActivityId()); + costItem.setActivityCode(centerGoods.getActivityCode()); + costItem.setSupplierId(centerGoods.getSupplierId()); + costItem.setSupplierCode(centerGoods.getSupplierCode()); + costItem.setSupplierName(centerGoods.getSupplierName()); + costItem.setSubjectId(centerGoods.getSubjectId()); + costItem.setSubjectCode(centerGoods.getSubjectCode()); + costItem.setSubjectName(centerGoods.getSubjectName()); + costItem.setCenterType(centerGoods.getCenterType()); + costItem.setCenterId(centerGoods.getCenterId()); + costItem.setCenterCode(centerGoods.getCenterCode()); + costItem.setCenterName(centerGoods.getCenterName()); + costItem.setCenterAmount(centerGoods.getCenterAmount()); + costItem.setCenterRate(centerGoods.getCenterRate()); + costItem.setCenterGoodsAmount(centerGoods.getCenterGoodsAmount()); + costItem.setCenterGoodsRate(centerGoods.getCenterGoodsRate()); + costItem.setTargetType(centerGoods.getTargetType()); + costItem.setTargetId(centerGoods.getTargetId()); + costItem.setTargetCode(centerGoods.getTargetCode()); + costItem.setTargetName(centerGoods.getTargetName()); + costItem.setTargetLevelPathIds(centerGoods.getTargetLevelPathIds()); + costItem.setTargetLevelPathNames(centerGoods.getTargetLevelPathNames()); + costItem.setActStartDate(centerGoods.getActStartDate()); + costItem.setActEndDate(centerGoods.getActEndDate()); + costItem.setPreStartDate(centerGoods.getPreStartDate()); + costItem.setPreEndDate(centerGoods.getPreEndDate()); + costItem.setPreCheckDate(centerGoods.getPreCheckDate()); + costItem.setCenterGoodItemId(centerGoods.getId()); + + TbsBudgetLog budgetLog = TbsBudgetLogBuildUtil.buildTbsBudgetLog(BudgetLogOptFlag.State_1,sysUser,costApply,costItem ,budget,amount,activity); + budgetLog.setBudgetId(budget.getId()); + + budgetLog.setScheduleItemBudgetId(scheduleItemBudget.getId()); + budgetLog.setScheduleId(scheduleItemBudget.getScheduleId()); + budgetLog.setScheduleItemId(scheduleItemBudget.getScheduleItemId()); + budgetLog.setItemName(scheduleItemBudget.getItemName()); + + budgetLogList.add(budgetLog); + } + //移除历史记录 + budgetLogService.remove(new LambdaQueryWrapper() + .eq(TbsBudgetLog::getCostApplyId,activity.getCostApplyId()) + .eq(TbsBudgetLog::getOptType, BudgetLogOptFlag.State_1.getCode()) + .eq(TbsBudgetLog::getActivityId,activity.getId())); + //重新保存 + if(CollectionUtil.isNotEmpty(budgetLogList)){ + budgetLogService.saveBatch(budgetLogList); + } + + } + + /** + * 依据剩余预算刷新释放金额 + */ public void check(){ //校验活动的核销金额是否匹配,不匹配则中断 //查询需要补偿释放的活动ID - List activityIds = vtbFundFlowMapper.listMissReleaseActivityId(); + //List activityIds = vtbFundFlowMapper.listMissReleaseActivityId(); + Long[] activityIds = new Long[]{229065L,229066L,229067L,229068L,229069L,229070L,229071L,229072L,229073L,229074L,229075L}; for (Long activityId : activityIds) { TbsActivity activity = activityService.getById(activityId); TbsCostApply costApply = costApplyService.getById(activity.getCostApplyId()); @@ -84,6 +158,9 @@ public class TbsBudgetReleaseApplicationService { budgetLogList.add(budgetLog); } + //TODO 二次校验,释放金额是否一致 + + //移除历史记录 fundFlowService.remove( new LambdaQueryWrapper() diff --git a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetBatchServiceImpl.java b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetBatchServiceImpl.java index 9cbf73e4..24c7ec34 100644 --- a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetBatchServiceImpl.java +++ b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetBatchServiceImpl.java @@ -553,7 +553,7 @@ public class TbsBudgetBatchServiceImpl extends ServiceImpl activityGoodsList = goodsListMap.get(activityId); for (TbsActivityGoods goods : activityGoodsList) { boolean isMatch = false; - for (TbsBudgetCondition condition : budgetConditionList) { - if(goods.getTargetLevelPathIds().contains(condition.getTargetLevelPathIds())){ - isMatch = true; - break; + if(CollUtil.isNotEmpty(budgetConditionList)){ + for (TbsBudgetCondition condition : budgetConditionList) { + if(goods.getTargetLevelPathIds().contains(condition.getTargetLevelPathIds())){ + isMatch = true; + break; + } } } if(!isMatch){ diff --git a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyOperationServiceImpl.java b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyOperationServiceImpl.java index f8b2e535..037ab094 100644 --- a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyOperationServiceImpl.java +++ b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyOperationServiceImpl.java @@ -221,12 +221,12 @@ public class TbsCostApplyOperationServiceImpl implements SeeYonOperationService ctpAffairVo.setAffairInfo(ctpAffair); //2已发 if(ctpAffair!=null&&ctpAffair.getState().equals(2)){ - String costId = ctpAffair.getCostApplyId(); - if(costId!=null){ - TbsCostApply costApply1 = costApplyService.getById(costId); - Date date = Date.from(costApply1.getSubmitTime().atZone(ZoneId.systemDefault()).toInstant()); - ctpAffair.setCommentTime(date); - } +// String costId = ctpAffair.getCostApplyId(); +// if(costId!=null){ +// TbsCostApply costApply1 = costApplyService.getById(costId); +// Date date = Date.from(costApply1.getSubmitTime().atZone(ZoneId.systemDefault()).toInstant()); +// ctpAffair.setCommentTime(date); +// } } for (SysUser user : userList) { if(ctpAffair.getMemberId().equals(user.getSyUserId())){ diff --git a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyServiceImpl.java b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyServiceImpl.java index 79a5f336..f99c6140 100644 --- a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyServiceImpl.java +++ b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostApplyServiceImpl.java @@ -88,6 +88,7 @@ import java.util.stream.Collectors; @AllArgsConstructor public class TbsCostApplyServiceImpl extends ServiceImpl implements TbsCostApplyService { + private TbsActivityChannelPointMapper tbsActivityChannelPointMapper; private VtbVerificationMapper vtbVerificationMapper; private TbsBudgetApplicationService budgetApplicationService; private TbsBudgetCostItemService budgetCostItemService; @@ -513,6 +514,13 @@ public class TbsCostApplyServiceImpl extends ServiceImpl activityList = tbsActivityMapper.selectList(actLqw); + for (TbsActivity activity : activityList) { + Long actId = tbsActivityChannelPointMapper.checkSubjectPoint(activity.getId()); + if(actId!=null){ + Assert.throwEx("活动["+activity.getActivityCode() + "]因科目类型,必须选网点"); + } + } + //判断是否进场费 if(tbsCostApply.getContractFlag()!=null&&tbsCostApply.getContractFlag().equals(2)){ if (activityList.size()>1){