diff --git a/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java b/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java index 11218721..e83440a0 100644 --- a/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java +++ b/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java @@ -147,6 +147,7 @@ public class TbsCostApplyController { TbsCostApply entity = CopierUtil.copy(param,new TbsCostApply()); LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(entity); lqw.orderByDesc(TbsCostApply::getId); + lqw.in(TbsCostApply::getUserId,userIds); PageUtil.startPage(); List list = tbsCostApplyService.list(lqw); return R.byPageHelperList(list); diff --git a/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostUnItemController.java b/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostUnItemController.java new file mode 100644 index 00000000..9133fd2e --- /dev/null +++ b/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostUnItemController.java @@ -0,0 +1,66 @@ +package com.qs.serve.modules.tbs.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.qs.serve.common.model.annotation.SysLog; +import com.qs.serve.common.model.dto.PageVo; +import com.qs.serve.common.model.dto.R; +import com.qs.serve.common.model.enums.BizType; +import com.qs.serve.common.model.enums.SystemModule; +import com.qs.serve.common.util.PageUtil; +import com.qs.serve.common.util.CopierUtil; +import com.qs.serve.common.util.StringUtils; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import com.qs.serve.modules.tbs.entity.so.TbsCostUnItemSo; +import com.qs.serve.modules.tbs.entity.TbsCostUnItem; +import com.qs.serve.modules.tbs.service.TbsCostUnItemService; + +import javax.validation.Valid; +import java.util.List; + +/** + * 预算 无预算的费用明细 + * @author YenHex + * @since 2023-02-02 + */ +@Slf4j +@AllArgsConstructor +@RestController +@RequestMapping("tbs/noBudgetCost") +public class TbsCostUnItemController { + + private TbsCostUnItemService tbsCostUnItemService; + + /** + * 翻页 + * @param param + * @return + */ + @GetMapping("/page") + @PreAuthorize("hasRole('tbs:costUnItem:query')") + public R> getPage(TbsCostUnItemSo param){ + TbsCostUnItem entity = CopierUtil.copy(param,new TbsCostUnItem()); + LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(entity); + PageUtil.startPage(); + List list = tbsCostUnItemService.list(lqw); + return R.byPageHelperList(list); + } + + /** + * ID查询 + * @param id + * @return + */ + @GetMapping("/getById/{id}") + @SysLog(module = SystemModule.Budget, title = "无预算的费用明细", biz = BizType.QUERY) + @PreAuthorize("hasRole('tbs:costUnItem:query')") + public R getById(@PathVariable("id") String id){ + TbsCostUnItem tbsCostUnItem = tbsCostUnItemService.getById(id); + return R.ok(tbsCostUnItem); + } + +} + diff --git a/src/main/java/com/qs/serve/modules/tbs/entity/TbsCostUnItem.java b/src/main/java/com/qs/serve/modules/tbs/entity/TbsCostUnItem.java new file mode 100644 index 00000000..d781edfc --- /dev/null +++ b/src/main/java/com/qs/serve/modules/tbs/entity/TbsCostUnItem.java @@ -0,0 +1,205 @@ +package com.qs.serve.modules.tbs.entity; + +import java.time.LocalDate; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.NotBlank; + +/** + * 无预算的费用明细 实体类 + * @author YenHex + * @since 2023-02-02 + */ +@Data +@TableName("tbs_cost_un_item") +public class TbsCostUnItem implements Serializable { + + private static final long serialVersionUID = 1L; + + /** id */ + @TableId(type = IdType.AUTO) + private Long id; + + /** 成本明细编码 */ + @Length(max = 30,message = "成本明细编码长度不能超过30字") + private String centerGoodsCode; + + /** 费用申请id */ + @NotNull(message = "费用申请id不能为空") + private Long costApplyId; + + /** 活动id */ + @NotNull(message = "活动id不能为空") + private Long activityId; + + /** 活动编码 */ + @Length(max = 30,message = "活动编码长度不能超过30字") + private String activityCode; + + /** 科目id */ + @NotNull(message = "科目id不能为空") + private Long subjectId; + + /** 科目编码 */ + @NotBlank(message = "科目编码不能为空") + @Length(max = 50,message = "科目编码长度不能超过50字") + private String subjectCode; + + /** 科目名称 */ + @NotBlank(message = "科目名称不能为空") + @Length(max = 50,message = "科目名称长度不能超过50字") + private String subjectName; + + /** 成本中心类型 */ + @NotBlank(message = "成本中心类型不能为空") + @Length(max = 50,message = "成本中心类型长度不能超过50字") + private String centerType; + + /** 成本中心id */ + @NotBlank(message = "成本中心id不能为空") + @Length(max = 32,message = "成本中心id长度不能超过32字") + private String centerId; + + /** 成本中心编码 */ + @NotBlank(message = "成本中心编码不能为空") + @Length(max = 50,message = "成本中心编码长度不能超过50字") + private String centerCode; + + /** 成本中心名称 */ + @NotBlank(message = "成本中心名称不能为空") + @Length(max = 50,message = "成本中心名称长度不能超过50字") + private String centerName; + + /** 成本中心金额 */ + @NotNull(message = "成本中心金额不能为空") + private BigDecimal centerAmount; + + /** 成本中心占比 */ + @NotNull(message = "成本中心占比不能为空") + private BigDecimal centerRate; + + /** 费用额度 */ + @NotNull(message = "费用额度不能为空") + private BigDecimal centerGoodsAmount; + + /** 费用占比 */ + @NotNull(message = "费用占比不能为空") + private BigDecimal centerGoodsRate; + + /** 目标类型(brand、category、series、spu、sku) */ + @NotBlank(message = "目标类型(brand、category、series、spu、sku)不能为空") + @Length(max = 30,message = "目标类型(brand、category、series、spu、sku)长度不能超过30字") + private String targetType; + + /** 目标id */ + @NotNull(message = "目标id不能为空") + private Long targetId; + + /** 目标编码 */ + @NotBlank(message = "目标编码不能为空") + @Length(max = 30,message = "目标编码长度不能超过30字") + private String targetCode; + + /** 目标名称 */ + @NotBlank(message = "目标名称不能为空") + @Length(max = 30,message = "目标名称长度不能超过30字") + private String targetName; + + /** 目标等级路径 */ + @Length(max = 600,message = "目标等级路径长度不能超过600字") + private String targetLevelPathIds; + + /** 目标等级路径 */ + @Length(max = 600,message = "目标等级路径长度不能超过600字") + private String targetLevelPathNames; + + /** 备注 */ + @Length(max = 255,message = "备注长度不能超过255字") + private String remark; + + /** 创建时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** 最后更新时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @TableField(fill = FieldFill.UPDATE) + private LocalDateTime updateTime; + + /** 所属租户 */ + @JsonIgnore + @JsonProperty + private String tenantId; + + /** 创建人 */ + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** 更新人 */ + @TableField(fill = FieldFill.UPDATE) + private String updateBy; + + /** 逻辑删除标记(0:显示;1:隐藏) */ + @JsonIgnore + @JsonProperty + private String delFlag; + + /** 活动开始时间 */ + @NotNull(message = "活动开始时间不能为空") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private LocalDate actStartDate; + + /** 活动结束时间 */ + @NotNull(message = "活动结束时间不能为空") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private LocalDate actEndDate; + + /** 预算开始时间 */ + @NotNull(message = "预算开始时间不能为空") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private LocalDate preStartDate; + + /** 预算结束时间 */ + @NotNull(message = "预算结束时间不能为空") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private LocalDate preEndDate; + + /** 预计核销时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private LocalDate preCheckDate; + + /** 客户id */ + @NotNull(message = "客户id不能为空") + private Long supplierId; + + /** 客户编码 */ + @NotBlank(message = "客户编码不能为空") + @Length(max = 30,message = "客户编码长度不能超过30字") + private String supplierCode; + + /** 客户名称 */ + @NotBlank(message = "客户名称不能为空") + @Length(max = 30,message = "客户名称长度不能超过30字") + private String supplierName; + +} + diff --git a/src/main/java/com/qs/serve/modules/tbs/entity/so/TbsCostUnItemSo.java b/src/main/java/com/qs/serve/modules/tbs/entity/so/TbsCostUnItemSo.java new file mode 100644 index 00000000..67c250d7 --- /dev/null +++ b/src/main/java/com/qs/serve/modules/tbs/entity/so/TbsCostUnItemSo.java @@ -0,0 +1,151 @@ +package com.qs.serve.modules.tbs.entity.so; + +import java.time.LocalDate; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.NotBlank; + +/** + * 无预算的费用明细 查询参数 + * @author YenHex + * @since 2023-02-02 + */ +@Data +public class TbsCostUnItemSo implements Serializable { + + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 成本明细编码 */ + private String centerGoodsCode; + + /** 费用申请id */ + private Long costApplyId; + + /** 活动id */ + private Long activityId; + + /** 活动编码 */ + private String activityCode; + + /** 科目id */ + private Long subjectId; + + /** 科目编码 */ + private String subjectCode; + + /** 科目名称 */ + private String subjectName; + + /** 成本中心类型 */ + private String centerType; + + /** 成本中心id */ + private String centerId; + + /** 成本中心编码 */ + private String centerCode; + + /** 成本中心名称 */ + private String centerName; + + /** 成本中心金额 */ + private BigDecimal centerAmount; + + /** 成本中心占比 */ + private BigDecimal centerRate; + + /** 费用额度 */ + private BigDecimal centerGoodsAmount; + + /** 费用占比 */ + private BigDecimal centerGoodsRate; + + /** 目标类型(brand、category、series、spu、sku) */ + private String targetType; + + /** 目标id */ + private Long targetId; + + /** 目标编码 */ + private String targetCode; + + /** 目标名称 */ + private String targetName; + + /** 目标等级路径 */ + private String targetLevelPathIds; + + /** 目标等级路径 */ + private String targetLevelPathNames; + + /** 备注 */ + private String remark; + + /** 创建时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + /** 最后更新时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + /** 所属租户 */ + @JsonIgnore + @JsonProperty + private String tenantId; + + /** 创建人 */ + private String createBy; + + /** 更新人 */ + private String updateBy; + + /** 逻辑删除标记(0:显示;1:隐藏) */ + @JsonIgnore + @JsonProperty + private String delFlag; + + /** 活动开始时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDate actStartDate; + + /** 活动结束时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDate actEndDate; + + /** 预算开始时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDate preStartDate; + + /** 预算结束时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDate preEndDate; + + /** 预计核销时间 */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDate preCheckDate; + + /** 客户id */ + private Long supplierId; + + /** 客户编码 */ + private String supplierCode; + + /** 客户名称 */ + private String supplierName; + +} + diff --git a/src/main/java/com/qs/serve/modules/tbs/mapper/TbsCostUnItemMapper.java b/src/main/java/com/qs/serve/modules/tbs/mapper/TbsCostUnItemMapper.java new file mode 100644 index 00000000..e6f14fb8 --- /dev/null +++ b/src/main/java/com/qs/serve/modules/tbs/mapper/TbsCostUnItemMapper.java @@ -0,0 +1,14 @@ +package com.qs.serve.modules.tbs.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.qs.serve.modules.tbs.entity.TbsCostUnItem; + +/** + * 无预算的费用明细 Mapper + * @author YenHex + * @date 2023-02-02 + */ +public interface TbsCostUnItemMapper extends BaseMapper { + +} + 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 dc9a21d3..da6964cc 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 @@ -17,6 +17,7 @@ public interface TbsScheduleItemBudgetMapper extends BaseMapper(); } - - List budgetItemIds = budgetCostItems.stream().map(TbsBudgetCostItem::getScheduleItemBudgetId) - .distinct().collect(Collectors.toList()); - List scheduleItemList; - if(CollectionUtil.isNotEmpty(budgetItemIds)){ - scheduleItemList = tbsScheduleItemBudgetService.listByIds(budgetItemIds); - }else { - scheduleItemList = new ArrayList<>(); - } TbsBudgetTableVo tableVo = new TbsBudgetTableVo(); List topTheadHeaders = new ArrayList<>(); Map> tmpMap = budgetCostItems.stream().collect(Collectors.groupingBy(TbsBudgetCostItem::getScheduleItemBudgetId)); @@ -175,11 +166,6 @@ public class TbsBudgetApplicationService { List noBudgetActivityIds = new ArrayList<>(); //所有满足条件的考核期,用于加载历史核销费用 List scheduleItemList = this.loadScheduleBudgetAndSetting(activityList, budgetIds, noBudgetActivityIds); - //加载预算占用历史 - List scheduleItemBudgetIds = scheduleItemList.stream().map(TbsScheduleItemBudget::getId).collect(Collectors.toList()); - List hisBudgetCostItemList = tbsBudgetCostItemService.listByScheduleItemBudgetIds(scheduleItemBudgetIds,costApplyId); - Map> hisCostGroupByItemBudget = hisBudgetCostItemList.stream() - .collect(Collectors.groupingBy(TbsBudgetCostItem::getScheduleItemBudgetId)); //补充添加 科目与成本中心拦截 List centerGoodsList = tbsActivityCenterGoodsService.listByCostApplyId(costApplyId); List activityCenterList = tbsActivityCenterService.listByCostApplyId(costApplyId); @@ -205,11 +191,17 @@ public class TbsBudgetApplicationService { if(!budgetNoCondition){ this.handleNoBudgetActivity(throwEx, overspend, activityList, noBudgetActivityIds,activityAllowBudgetIdMap); } + //统计所有占用预算金额 + Map budgetItemAmountMap = new HashMap<>(scheduleItemList.size()); //统计费用申请占用金额 Map budgetItemApplyAmountMap = new HashMap<>(scheduleItemList.size()); for (TbsScheduleItemBudget itemBudget : scheduleItemList) { BigDecimal budgetItemApplyAmount = tbsScheduleItemBudgetMapper.totalApplyAmount(itemBudget.getId(),costApplyId); budgetItemApplyAmountMap.put(itemBudget.getId(),budgetItemApplyAmount); + BigDecimal budgetItemAmount = tbsScheduleItemBudgetMapper.totalCostAmount(itemBudget.getBudgetId(),itemBudget.getScheduleItemId(),costApplyId); + //因为结果为负数,需去相反数 + budgetItemAmount = budgetItemAmount==null?BigDecimal.ZERO:budgetItemAmount.negate(); + budgetItemAmountMap.put(itemBudget.getId(),budgetItemAmount); } //统计当前活动前置项占用预算 Map counterMap = new HashMap<>(); @@ -217,7 +209,7 @@ public class TbsBudgetApplicationService { final List actMatchList = new ArrayList<>(); final List actUnMatchList = new ArrayList<>(); for (TbsActivityCenterGoods activityCostItem : centerGoodsList) { - this.matchActivityMain(activityCostItem,throwEx, overspend, activityList, hisCostGroupByItemBudget, budgetList, + this.matchActivityMain(activityCostItem,throwEx, overspend, activityList, budgetItemAmountMap, budgetList, noConditionBudgetList, counterMap, actMatchList, actUnMatchList,activityAllowBudgetIdMap,budgetItemApplyAmountMap); } List budgetMatchList = actMatchList.stream() @@ -227,7 +219,7 @@ public class TbsBudgetApplicationService { TbsBudgetTableVo tableVo = null; if(buildTableFlag){ //构建tableDTO - tableVo = this.buildBudgetTableVo(activityList, scheduleItemList, hisCostGroupByItemBudget, budgetList, budgetMatchList, budgetUnMatchList); + tableVo = this.buildBudgetTableVo(activityList, budgetItemAmountMap, budgetList, budgetMatchList, budgetUnMatchList); } TbsBudgetCostResult result = new TbsBudgetCostResult(); result.setBudgetMatchList(budgetMatchList); @@ -300,16 +292,14 @@ public class TbsBudgetApplicationService { /** * 建立费用预算表 * @param activityList - * @param scheduleItemList - * @param hisCostGroupByItemBudget + * @param budgetItemAmountMap * @param budgetList * @param budgetMatchList * @param budgetUnMatchList * @return */ private TbsBudgetTableVo buildBudgetTableVo(List activityList, - List scheduleItemList, - Map> hisCostGroupByItemBudget, + Map budgetItemAmountMap, List budgetList, List budgetMatchList, List budgetUnMatchList) { @@ -334,7 +324,7 @@ public class TbsBudgetApplicationService { TbsBudgetTableVo.TopTheadHeader theadHeader = new TbsBudgetTableVo.TopTheadHeader(); theadHeader.setId(scheduleItemBudgetId+""); theadHeader.setLabel(budgetCode+"("+scheduleItemName+")"); - BigDecimal totalUsed = TbsBudgetCostUtil.totalHisCost(hisCostGroupByItemBudget.get(scheduleItemBudgetId)); + BigDecimal totalUsed = budgetItemAmountMap.get(scheduleItemBudgetId); theadHeader.setBudgetAmount(budgetAmount.subtract(totalUsed)); theadHeader.setTotalAmount(budgetAmount); BigDecimal applyAmount = budgetCostItem.getScheduleItemAmountApply()==null?BigDecimal.ZERO:budgetCostItem.getScheduleItemAmountApply(); @@ -400,7 +390,7 @@ public class TbsBudgetApplicationService { * @param throwEx 预算不够时抛出异常 * @param overspend 超值标识 * @param activityList 所有活动 - * @param hisCostGroupByItemBudget 历史费用组 + * @param budgetItemAmountMap 统计所有占用预算金额 * @param allBudgetList 所有预算 * @param noConditionBudgetList 没有条件的预算列表 * @param counterMap 历史预算占用 @@ -413,7 +403,7 @@ public class TbsBudgetApplicationService { Boolean throwEx, boolean overspend, List activityList, - Map> hisCostGroupByItemBudget, + Map budgetItemAmountMap, final List allBudgetList, List noConditionBudgetList, Map counterMap, @@ -463,7 +453,7 @@ public class TbsBudgetApplicationService { boolean isMatch = false; for (TbsScheduleItemBudget itemBudget : currentScheduleItemBudgets) { //历史费用(含申请占用金额) - BigDecimal totalUsed = TbsBudgetCostUtil.totalHisCost(hisCostGroupByItemBudget.get(itemBudget.getId())); + BigDecimal totalUsed = budgetItemAmountMap.get(itemBudget.getId()); //当前项费用 BigDecimal budgetAmount = itemBudget.getBudgetAmount(); //前置费用 diff --git a/src/main/java/com/qs/serve/modules/tbs/service/TbsCostUnItemService.java b/src/main/java/com/qs/serve/modules/tbs/service/TbsCostUnItemService.java new file mode 100644 index 00000000..ea18c75a --- /dev/null +++ b/src/main/java/com/qs/serve/modules/tbs/service/TbsCostUnItemService.java @@ -0,0 +1,14 @@ +package com.qs.serve.modules.tbs.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.qs.serve.modules.tbs.entity.TbsCostUnItem; + +/** + * 无预算的费用明细 服务接口 + * @author YenHex + * @date 2023-02-02 + */ +public interface TbsCostUnItemService extends IService { + +} + diff --git a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetLogServiceImpl.java b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetLogServiceImpl.java index ebc83106..9d02becc 100644 --- a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetLogServiceImpl.java +++ b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetLogServiceImpl.java @@ -36,9 +36,6 @@ public class TbsBudgetLogServiceImpl extends ServiceImpl budgetLog.setScheduleId(scheduleItemBudget.getScheduleId()); budgetLog.setScheduleItemId(scheduleItemBudget.getScheduleItemId()); budgetLog.setScheduleItemBudgetId(scheduleItemBudget.getId()); - budgetLog.setScheduleOrgId(scheduleItemBudget.getScheduleId()); - budgetLog.setScheduleItemOrgId(scheduleItemBudget.getScheduleItemId()); - budgetLog.setScheduleItemBudgetOrgId(scheduleItemBudget.getId()); budgetLog.setItemName(scheduleItemBudget.getItemName()); budgetLog.setStartDate(scheduleItemBudget.getStartDate()); budgetLog.setEndDate(scheduleItemBudget.getEndDate()); 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 d0d44ea7..075c42ed 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 @@ -50,6 +50,7 @@ public class TbsCostApplyServiceImpl extends ServiceImpl costUnItems = result.getBudgetUnMatchList().stream() + .map(obj-> CopierUtil.copy(obj,new TbsCostUnItem())).collect(Collectors.toList()); + tbsCostUnItemService.saveBatch(costUnItems); + } //重新保存 List allBudgetItem = new ArrayList<>(); allBudgetItem.addAll(result.getBudgetMatchList()); diff --git a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostUnItemServiceImpl.java b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostUnItemServiceImpl.java new file mode 100644 index 00000000..2d1ac038 --- /dev/null +++ b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsCostUnItemServiceImpl.java @@ -0,0 +1,22 @@ +package com.qs.serve.modules.tbs.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import com.qs.serve.modules.tbs.entity.TbsCostUnItem; +import com.qs.serve.modules.tbs.service.TbsCostUnItemService; +import com.qs.serve.modules.tbs.mapper.TbsCostUnItemMapper; + +/** + * 无预算的费用明细 服务实现类 + * @author YenHex + * @since 2023-02-02 + */ +@Slf4j +@Service +@AllArgsConstructor +public class TbsCostUnItemServiceImpl extends ServiceImpl implements TbsCostUnItemService { + +} +