Commit c303d8bd authored by huangjie's avatar huangjie

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys...

Merge branch 'V20231129-中建一局二公司' of http://192.168.60.201/root/dsk-operate-sys into V20231129-中建一局二公司
parents 7ba6de78 abc41225
package com.dsk.cscec.constant;
/**
* 二期项目常量信息
*
* @author sxk
* @date 2024.02.05
* @time 15:29
*/
public interface CbSceneExpenseConstants {
/**
* 菜单来源:文件表
*/
Integer MENU_SOURCE_FILE_TABLE = 0;
/**
* 菜单来源:财务一体化系统
*/
Integer MENU_SOURCE_FINANCE_SYSTEM = 1;
/**
* 菜单层级一级(顶级)
*/
Integer MENU_LEVEL1 = 1;
/**
* 菜单层级二级
*/
Integer MENU_LEVEL2 = 2;
}
...@@ -58,9 +58,9 @@ public class CbProjectOtherController { ...@@ -58,9 +58,9 @@ public class CbProjectOtherController {
public R<List<CbProjectExpenseSummary>> statistics(@PathVariable Long projectId) { public R<List<CbProjectExpenseSummary>> statistics(@PathVariable Long projectId) {
CbProjectExpenseSummary expenseSummary = new CbProjectExpenseSummary(); CbProjectExpenseSummary expenseSummary = new CbProjectExpenseSummary();
expenseSummary.setProjectId(projectId); expenseSummary.setProjectId(projectId);
expenseSummary.setDataType(2); expenseSummary.setDataType(3);
QueryWrapper<CbProjectExpenseSummary> queryWrapper = Wrappers.query(expenseSummary); QueryWrapper<CbProjectExpenseSummary> queryWrapper = Wrappers.query(expenseSummary);
queryWrapper.select("id","expense_name as expenseName","expense_value as expenseValue"); queryWrapper.select("id","expense_name as expenseName","expense_value as expenseValue","proportion");
queryWrapper.orderByAsc("id"); queryWrapper.orderByAsc("id");
List<CbProjectExpenseSummary> expenseSummaryList = this.cbProjectExpenseSummaryService.list(queryWrapper); List<CbProjectExpenseSummary> expenseSummaryList = this.cbProjectExpenseSummaryService.list(queryWrapper);
if (ObjectUtil.isEmpty(expenseSummaryList)) { if (ObjectUtil.isEmpty(expenseSummaryList)) {
......
package com.dsk.cscec.controller; package com.dsk.cscec.controller;
import com.dsk.common.core.controller.BaseController; import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.R;
import com.dsk.common.helper.LoginHelper;
import com.dsk.cscec.domain.CbSceneExpenseChildren;
import com.dsk.cscec.domain.bo.CbSceneExpenseChildrenDataBo;
import com.dsk.cscec.domain.vo.CbSceneExpenseMenuVo;
import com.dsk.cscec.service.CbSceneExpenseChildrenService; import com.dsk.cscec.service.CbSceneExpenseChildrenService;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Objects;
/** /**
* 现场经费-工资统筹、其他费用、现场管理费表(CbSceneExpenseChildren)表控制层 * 现场经费-工资统筹、其他费用、现场管理费表(CbSceneExpenseChildren)表控制层
...@@ -22,6 +30,29 @@ public class CbSceneExpenseChildrenController extends BaseController { ...@@ -22,6 +30,29 @@ public class CbSceneExpenseChildrenController extends BaseController {
@Resource @Resource
private CbSceneExpenseChildrenService baseService; private CbSceneExpenseChildrenService baseService;
/**
* 获取现场经费菜单
*/
@GetMapping("/getMenuList/{projectId}")
public R<List<CbSceneExpenseMenuVo>> getMenuList(@NotNull(message = "项目ID不能为空") @PathVariable Long projectId) {
return R.ok(baseService.getMenuList(projectId));
}
} /**
* 现场经费二级分类数据解析
*/
@GetMapping("/parseChildrenData/{projectId}")
public R<Void> parseSceneExpenseChildrenData(@PathVariable Long projectId) throws Exception {
String username = Objects.requireNonNull(LoginHelper.getLoginUser()).getUsername();
baseService.parseSceneExpenseChildrenData(projectId, 1, username);
return R.ok();
}
/**
* 获取现场经费二级分类数据
*/
@GetMapping("/getChildrenData")
public R<List<CbSceneExpenseChildren>> getChildrenData(@Validated @RequestBody CbSceneExpenseChildrenDataBo childrenDataBo) {
return R.ok(baseService.getChildrenData(childrenDataBo));
}
}
\ No newline at end of file
package com.dsk.cscec.domain; package com.dsk.cscec.domain;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableLogic;
import com.dsk.common.core.domain.BaseEntity; import com.dsk.common.annotation.Excel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
* 现场经费-工资统筹、其他费用、现场管理费表(CbSceneExpenseChildren)实体类 * 现场经费-工资统筹、其他费用、现场管理费表(CbSceneExpenseChildren)实体类
...@@ -14,9 +16,8 @@ import java.io.Serializable; ...@@ -14,9 +16,8 @@ import java.io.Serializable;
* @author sxk * @author sxk
* @since 2024-02-22 09:59:00 * @since 2024-02-22 09:59:00
*/ */
@EqualsAndHashCode(callSuper = true)
@Data @Data
public class CbSceneExpenseChildren extends BaseEntity implements Serializable { public class CbSceneExpenseChildren implements Serializable {
private static final long serialVersionUID = 895279707061984760L; private static final long serialVersionUID = 895279707061984760L;
/** /**
* 主键ID * 主键ID
...@@ -28,64 +29,73 @@ public class CbSceneExpenseChildren extends BaseEntity implements Serializable { ...@@ -28,64 +29,73 @@ public class CbSceneExpenseChildren extends BaseEntity implements Serializable {
*/ */
private Long projectId; private Long projectId;
/** /**
* 成本阶段(0:标前成本、1:标后成本、2:转固成本) * 项目文件ID
*/ */
private Integer cbStage; private Long projectFileId;
/**
* 父级ID
*/
private Long parentId;
/** /**
* 序号 * 序号
*/ */
@Excel(name = "序号")
private String number; private String number;
/**
* 排序
*/
private Integer sort;
/**
* 数据类型(0:工资统筹、1:现场管理费、2:其他费用)
*/
private Integer dataType;
/** /**
* 名称 * 名称
*/ */
@Excel(name = "名称")
private String expenseName; private String expenseName;
/** /**
* 单位 * 单位
*/ */
@Excel(name = "单位")
private String unit; private String unit;
/** /**
* 成本数量-工资统筹表 * 成本数量-工资统筹表
*/ */
private Integer cbCount; @Excel(name = "成本数量")
private String cbCount;
/** /**
* 使用时间-其他费用表 * 使用时间-其他费用表
*/ */
private Integer useTime; @Excel(name = "使用时间")
private String useTime;
/** /**
* 工程量-现场管理费表 * 工程量-现场管理费表
*/ */
@Excel(name = "工程量")
private String engineeringVolume; private String engineeringVolume;
/**
* 增值税税率-现场管理费表
*/
@Excel(name = "增值税税率")
private String addedTaxRate;
/** /**
* 公司单价/不含税单价 * 公司单价/不含税单价
*/ */
@Excel(name = "公司单价")
private String unitPrice; private String unitPrice;
/** /**
* 目标成本合价(不含税)/不含税合价 * 目标成本合价(不含税)/不含税合价
*/ */
private String excludeTaxSumPrice; @Excel(name = "目标成本合价(不含税)")
private String targetCbSumPriceExcludeTax;
/** /**
* 目标成本合价(含税)/含税合价 * 目标成本合价(含税)/含税合价
*/ */
private String includeTaxSumPrice; @Excel(name = "目标成本合价(含税)")
private String targetCbSumPriceIncludeTax;
/**
* 备注
*/
@Excel(name = "备注")
private String remark;
/** /**
* 成本科目 * 成本科目
*/ */
@Excel(name = "成本科目")
private String cbSubject; private String cbSubject;
/** /**
* 税金类型 * 税金类型
*/ */
@Excel(name = "税金类型")
private String taxType; private String taxType;
/** /**
* 删除状态(0:否、2:是) * 删除状态(0:否、2:是)
...@@ -93,7 +103,13 @@ public class CbSceneExpenseChildren extends BaseEntity implements Serializable { ...@@ -93,7 +103,13 @@ public class CbSceneExpenseChildren extends BaseEntity implements Serializable {
@TableLogic(value = "0", delval = "2") @TableLogic(value = "0", delval = "2")
private Integer delFlag; private Integer delFlag;
/** /**
* 备注 * 创建者
*/ */
private String remark; @TableField(fill = FieldFill.INSERT)
private String createBy;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
} }
package com.dsk.cscec.domain.bo;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @author sxk
* @date 2024.02.22
* @time 15:22
*/
@Data
public class CbSceneExpenseChildrenDataBo {
/**
* 项目ID
*/
@NotNull(message = "项目ID不能为空")
private Long projectId;
/**
* 项目文件ID
*/
@NotNull(message = "文件ID不能为空")
private Long fileId;
}
package com.dsk.cscec.domain.bo;
import com.dsk.common.annotation.Excel;
import com.dsk.cscec.domain.CbSceneExpenseChildren;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author sxk
* @date 2024.02.26
* @time 16:38
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class CbSceneExpenseChildrenImportBo extends CbSceneExpenseChildren {
/**
* 公司单价/不含税单价
*/
@Excel(name = "不含税单价(元)")
private String excludeTaxUnitPrice;
/**
* 目标成本合价(不含税)/不含税合价
*/
@Excel(name = "不含税合价(元)")
private String excludeTaxSumPrice;
/**
* 目标成本合价(含税)/含税合价
*/
@Excel(name = "含税合价(元)")
private String includeTaxSumPrice;
}
...@@ -65,7 +65,7 @@ public interface CbSummaryMapper extends BaseMapper<CbSummary> { ...@@ -65,7 +65,7 @@ public interface CbSummaryMapper extends BaseMapper<CbSummary> {
CbGainLossAnalysisListVo getGainLossAnalysisById(@Param("id") Long id, @Param("expenseDate") String expenseDate); CbGainLossAnalysisListVo getGainLossAnalysisById(@Param("id") Long id, @Param("expenseDate") String expenseDate);
List<CbGainLossAnalysisListVo> getGainLossAnalysisByParentId(@Param("id") Long parentId, @Param("expenseDate") String expenseDate); List<CbGainLossAnalysisListVo> getGainLossAnalysisByParentId(@Param("parentId") Long parentId, @Param("expenseDate") String expenseDate);
......
...@@ -2,6 +2,10 @@ package com.dsk.cscec.service; ...@@ -2,6 +2,10 @@ package com.dsk.cscec.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.cscec.domain.CbSceneExpenseChildren; import com.dsk.cscec.domain.CbSceneExpenseChildren;
import com.dsk.cscec.domain.bo.CbSceneExpenseChildrenDataBo;
import com.dsk.cscec.domain.vo.CbSceneExpenseMenuVo;
import java.util.List;
/** /**
* 现场经费-工资统筹、其他费用、现场管理费表(CbSceneExpenseChildren)表服务接口 * 现场经费-工资统筹、其他费用、现场管理费表(CbSceneExpenseChildren)表服务接口
...@@ -10,5 +14,28 @@ import com.dsk.cscec.domain.CbSceneExpenseChildren; ...@@ -10,5 +14,28 @@ import com.dsk.cscec.domain.CbSceneExpenseChildren;
* @since 2024-02-22 09:59:01 * @since 2024-02-22 09:59:01
*/ */
public interface CbSceneExpenseChildrenService extends IService<CbSceneExpenseChildren> { public interface CbSceneExpenseChildrenService extends IService<CbSceneExpenseChildren> {
/**
* 获取现场经费菜单
*
* @param projectId 项目ID
* @return 菜单
*/
List<CbSceneExpenseMenuVo> getMenuList(Long projectId);
/**
* 现场经费二级分类数据解析
*
* @param projectId 项目ID
* @param cbStage 成本阶段
* @param username 用户名
*/
void parseSceneExpenseChildrenData(Long projectId, Integer cbStage, String username) throws Exception;
/**
* 获取现场经费二级分类数据
*
* @param childrenDataBo 查询体
* @return 现场经费二级分类数据
*/
List<CbSceneExpenseChildren> getChildrenData(CbSceneExpenseChildrenDataBo childrenDataBo);
} }
...@@ -22,10 +22,7 @@ import com.dsk.cscec.domain.vo.CbProjectCbStageNotDraftVo; ...@@ -22,10 +22,7 @@ import com.dsk.cscec.domain.vo.CbProjectCbStageNotDraftVo;
import com.dsk.cscec.domain.vo.CbProjectRecordSearchVo; import com.dsk.cscec.domain.vo.CbProjectRecordSearchVo;
import com.dsk.cscec.mapper.CbProjectFileMapper; import com.dsk.cscec.mapper.CbProjectFileMapper;
import com.dsk.cscec.mapper.CbProjectRecordMapper; import com.dsk.cscec.mapper.CbProjectRecordMapper;
import com.dsk.cscec.service.CbProjectExpenseSummaryService; import com.dsk.cscec.service.*;
import com.dsk.cscec.service.CbProjectOtherService;
import com.dsk.cscec.service.CbProjectRecordService;
import com.dsk.cscec.service.CbSummaryService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -54,6 +51,8 @@ public class CbProjectRecordServiceImpl extends ServiceImpl<CbProjectRecordMappe ...@@ -54,6 +51,8 @@ public class CbProjectRecordServiceImpl extends ServiceImpl<CbProjectRecordMappe
@Resource @Resource
private CbProjectExpenseSummaryService projectExpenseSummaryService; private CbProjectExpenseSummaryService projectExpenseSummaryService;
@Resource @Resource
private CbSceneExpenseChildrenService sceneExpenseChildrenService;
@Resource
private CbProjectOtherService projectOtherService; private CbProjectOtherService projectOtherService;
/** /**
...@@ -134,6 +133,7 @@ public class CbProjectRecordServiceImpl extends ServiceImpl<CbProjectRecordMappe ...@@ -134,6 +133,7 @@ public class CbProjectRecordServiceImpl extends ServiceImpl<CbProjectRecordMappe
projectOtherService.projectOtherDataAnalysis(projectBaseBo); projectOtherService.projectOtherDataAnalysis(projectBaseBo);
//现场经费 //现场经费
projectExpenseSummaryService.parseSceneExpenseSummaryData(projectId, cbStage, username); projectExpenseSummaryService.parseSceneExpenseSummaryData(projectId, cbStage, username);
sceneExpenseChildrenService.parseSceneExpenseChildrenData(projectId, cbStage, username);
//成本汇总 //成本汇总
cbSummaryService.importCbSummary(projectId); cbSummaryService.importCbSummary(projectId);
} }
......
package com.dsk.cscec.service.impl; package com.dsk.cscec.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.excel.ExcelUtils;
import com.dsk.common.utils.StringUtils;
import com.dsk.cscec.constant.CbProjectConstants;
import com.dsk.cscec.constant.CbSceneExpenseConstants;
import com.dsk.cscec.domain.CbProjectFile;
import com.dsk.cscec.domain.CbProjectRecord;
import com.dsk.cscec.domain.CbSceneExpenseChildren; import com.dsk.cscec.domain.CbSceneExpenseChildren;
import com.dsk.cscec.domain.bo.CbSceneExpenseChildrenDataBo;
import com.dsk.cscec.domain.bo.CbSceneExpenseChildrenImportBo;
import com.dsk.cscec.domain.vo.CbSceneExpenseMenuVo;
import com.dsk.cscec.mapper.CbProjectFileMapper;
import com.dsk.cscec.mapper.CbProjectRecordMapper;
import com.dsk.cscec.mapper.CbSceneExpenseChildrenMapper; import com.dsk.cscec.mapper.CbSceneExpenseChildrenMapper;
import com.dsk.cscec.service.CbSceneExpenseChildrenService; import com.dsk.cscec.service.CbSceneExpenseChildrenService;
import com.dsk.system.service.ISysOssService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.support.TransactionTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* 现场经费-工资统筹、其他费用、现场管理费表(CbSceneExpenseChildren)表服务实现类 * 现场经费-工资统筹、其他费用、现场管理费表(CbSceneExpenseChildren)表服务实现类
...@@ -18,5 +41,167 @@ import javax.annotation.Resource; ...@@ -18,5 +41,167 @@ import javax.annotation.Resource;
public class CbSceneExpenseChildrenServiceImpl extends ServiceImpl<CbSceneExpenseChildrenMapper, CbSceneExpenseChildren> implements CbSceneExpenseChildrenService { public class CbSceneExpenseChildrenServiceImpl extends ServiceImpl<CbSceneExpenseChildrenMapper, CbSceneExpenseChildren> implements CbSceneExpenseChildrenService {
@Resource @Resource
private CbSceneExpenseChildrenMapper baseMapper; private CbSceneExpenseChildrenMapper baseMapper;
@Resource
private CbProjectRecordMapper projectRecordMapper;
@Resource
private CbProjectFileMapper projectFileMapper;
@Resource
private ISysOssService ossService;
@Resource
private TransactionTemplate transactionTemplate;
/**
* 获取现场经费菜单
*
* @param projectId 项目ID
* @return 菜单
*/
@Override
public List<CbSceneExpenseMenuVo> getMenuList(Long projectId) {
//校验项目是否存在
this.checkProjectExist(projectId);
//TODO:菜单来源分为两部分,1、导入的文件,2、财务一体化系统
//从导入文件获取菜单
List<CbSceneExpenseMenuVo> menuList = projectFileMapper.getSceneExpenseMenuFromFile(projectId, CbProjectConstants.DELETE_FLAG_EXIST, CbProjectConstants.CB_TYPE_SCENE_EXPENSE, CbProjectConstants.PROJECT_FILE_STATUS_PARSE_SUCCESS);
menuList.forEach(menu -> {
//菜单名称去除文件格式尾缀
menu.setMenuName(menu.getMenuName().substring(0, menu.getMenuName().lastIndexOf(".")));
//若是现场经费汇总,则是一级,否则均为二级
if (CbProjectConstants.CB_TYPE_SCENE_EXPENSE_NAME.equals(menu.getMenuName())) {
menu.setMenuLevel(CbSceneExpenseConstants.MENU_LEVEL1);
} else {
menu.setMenuLevel(CbSceneExpenseConstants.MENU_LEVEL2);
}
//菜单来源
menu.setMenuSource(CbSceneExpenseConstants.MENU_SOURCE_FILE_TABLE);
});
//TODO:从财务一体化系统获取菜单
return menuList;
}
/**
* 现场经费二级分类数据解析
*
* @param projectId 项目ID
* @param cbStage 成本阶段
* @param username 用户名
*/
@Override
@Async
public void parseSceneExpenseChildrenData(Long projectId, Integer cbStage, String username) throws Exception {
//查找该项目下所有相关文件
List<CbProjectFile> projectFileList = projectFileMapper.selectAnalysisList(projectId, CbProjectConstants.CB_TYPE_SCENE_EXPENSE, cbStage);
//待解析文件
List<CbProjectFile> waitParseList = new ArrayList<>();
//提取非现场经费汇总文件
projectFileList.forEach(projectFile -> {
if (!CbProjectConstants.CB_TYPE_SCENE_EXPENSE_NAME.equals(projectFile.getFileName().substring(0, projectFile.getFileName().lastIndexOf(".")))) {
//待解析文件
waitParseList.add(projectFile);
}
});
//处理待解析文件
for (CbProjectFile projectFile : waitParseList) {
if (ObjectUtil.isNull(projectFile)) {
continue;
}
//文件下载
InputStream inputStream = ossService.downFileIO(projectFile.getFileOssId());
if (ObjectUtil.isNull(inputStream)) {
projectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL);
projectFile.setFailRemark("文件数据不存在");
projectFileMapper.updateById(projectFile);
continue;
}
//解析数据
List<CbSceneExpenseChildrenImportBo> importList = new ExcelUtils<>(CbSceneExpenseChildrenImportBo.class).importExcelAllSheet(inputStream, 0);
if (importList.isEmpty()) {
projectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL);
projectFile.setFailRemark("表格中不存在待导入数据");
projectFileMapper.updateById(projectFile);
continue;
}
//筛选有效数据
List<CbSceneExpenseChildrenImportBo> summaryList = importList.stream().parallel()
//筛选名称列不为空数据
.filter(item -> StringUtils.isNotBlank(item.getExpenseName()))
.peek(item -> {
item.setProjectId(projectId);
item.setProjectFileId(projectFile.getId());
//因为现场管理费Excel表中字段名称不一样,所以做以下单独映射
//公司单价/不含税单价
if (StringUtils.isNotBlank(item.getExcludeTaxUnitPrice())) {
item.setUnitPrice(item.getExcludeTaxUnitPrice());
}
//目标成本合价(不含税)/不含税合价
if (StringUtils.isNotBlank(item.getExcludeTaxSumPrice())) {
item.setTargetCbSumPriceExcludeTax(item.getExcludeTaxSumPrice());
}
//目标成本合价(含税)/含税合价
if (StringUtils.isNotBlank(item.getIncludeTaxSumPrice())) {
item.setTargetCbSumPriceIncludeTax(item.getIncludeTaxSumPrice());
}
item.setCreateBy(username);
item.setCreateTime(new Date());
})
.collect(Collectors.toList());
if (summaryList.size() != importList.size()) {
projectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL);
projectFile.setFailRemark("表格中存在\"名称\"列为空数据!");
projectFileMapper.updateById(projectFile);
continue;
}
transactionTemplate.execute(status -> {
try {
//批量插入数据
CbSceneExpenseChildrenServiceImpl impl = new CbSceneExpenseChildrenServiceImpl();
Assert.isTrue(impl.saveBatch(BeanUtil.copyToList(summaryList, CbSceneExpenseChildren.class)), "数据插入失败");
//更新文件状态
projectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_SUCCESS);
Assert.isTrue(projectFileMapper.updateById(projectFile) > 0, "解析成功后文件状态更新失败");
} catch (Exception e) {
status.setRollbackOnly();
projectFile.setFileParseStatus(CbProjectConstants.PROJECT_FILE_STATUS_PARSE_FAIL);
projectFile.setFailRemark(e.getMessage());
projectFileMapper.updateById(projectFile);
}
return Boolean.TRUE;
});
}
}
/**
* 获取现场经费二级分类数据
*
* @param childrenDataBo 查询体
* @return 现场经费二级分类数据
*/
@Override
public List<CbSceneExpenseChildren> getChildrenData(CbSceneExpenseChildrenDataBo childrenDataBo) {
//校验项目是否存在
this.checkProjectExist(childrenDataBo.getProjectId());
return baseMapper.selectList(new LambdaQueryWrapper<CbSceneExpenseChildren>()
.eq(CbSceneExpenseChildren::getProjectId, childrenDataBo.getProjectId())
.eq(CbSceneExpenseChildren::getProjectFileId, childrenDataBo.getFileId()));
}
/**
* 校验项目是否存在
*
* @param projectId 项目ID
* @return 项目实体
*/
private CbProjectRecord checkProjectExist(Long projectId) {
CbProjectRecord projectRecord = projectRecordMapper.selectById(projectId);
Assert.notNull(projectRecord, "该项目不存在");
return projectRecord;
}
} }
<template> <template>
<div class="project-side-menu-container"> <div class="project-side-menu-container">
<el-menu mode="vertical" class="project-side-menu-instance" :unique-opened="uniqueOpened" :default-active="defaultActive" @select="menuSelect" <el-menu mode="vertical" class="project-side-menu-instance" :unique-opened="uniqueOpened" :default-active="comDefaultActive" @select="menuSelect"
@open="subMenuOpen" @close="subMenuClose" ref="customElMenu"> @open="subMenuOpen" @close="subMenuClose" ref="customElMenu">
<template v-for="(item,index) of tempMenuTree"> <template v-for="(item,index) of tempMenuTree">
<project-menu-item :menuItem="item" :key="item.nodeValue"> <project-menu-item :menuItem="item" :key="item.nodeValue">
...@@ -56,6 +56,11 @@ export default { ...@@ -56,6 +56,11 @@ export default {
}, },
deep: true, deep: true,
immediate: true immediate: true
},
defaultActive: {
handler(newValue) {
this.comDefaultActive = newValue;
}
} }
}, },
data() { data() {
...@@ -69,7 +74,8 @@ export default { ...@@ -69,7 +74,8 @@ export default {
}, },
tempMenuOptions: {}, tempMenuOptions: {},
tempMenuTree: [], tempMenuTree: [],
comMenuTree: this.menuTree comMenuTree: this.menuTree,
comDefaultActive: this.defaultActive
}; };
}, },
//可访问data属性 //可访问data属性
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment