Commit 44a08733 authored by 施翔轲's avatar 施翔轲

修复直接费文件解析bug

parent d785a610
......@@ -5,10 +5,14 @@ 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.bo.CbSceneExpenseMonthBo;
import com.dsk.cscec.domain.vo.CbSceneExpenseMenuVo;
import com.dsk.cscec.service.CbSceneExpenseChildrenService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
......@@ -52,7 +56,15 @@ public class CbSceneExpenseChildrenController extends BaseController {
* 获取现场经费二级分类数据
*/
@GetMapping("/getChildrenData")
public R<List<CbSceneExpenseChildren>> getChildrenData(@Validated @RequestBody CbSceneExpenseChildrenDataBo childrenDataBo) {
public R<List<CbSceneExpenseChildren>> getChildrenData(@Validated CbSceneExpenseChildrenDataBo childrenDataBo) {
return R.ok(baseService.getChildrenData(childrenDataBo));
}
/**
* 获取现场经费已添加成本数据月份
*/
@GetMapping("/getMonthList/")
public R<List<String>> getMonthList(@Validated CbSceneExpenseMonthBo monthBo) {
return baseService.getMonthList(monthBo);
}
}
\ No newline at end of file
......@@ -130,9 +130,9 @@ public class CbDirectExpense extends BaseEntity implements Serializable {
@Excel(name = "盈亏率")
private String profitLossRatio;
/**
* 标准成本费用
* 标准费用项库
*/
@Excel(name = "标准成本费用")
@Excel(name = "标准费用项库")
private String standardCbItem;
/**
* 备注
......
package com.dsk.cscec.domain.bo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author sxk
* @date 2024.03.12
* @time 17:02
*/
@Data
public class CbSceneExpenseMonthBo {
/**
* 文件ID
*/
@NotNull(message = "文件ID不能为空")
private Long fileId;
/**
* 菜单层级
*/
@NotBlank(message = "菜单层级不能为空")
private Integer menuLevel;
}
package com.dsk.cscec.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.common.core.domain.R;
import com.dsk.cscec.domain.CbSceneExpenseChildren;
import org.springframework.data.repository.query.Param;
import java.util.List;
/**
* 现场经费-工资统筹、其他费用、现场管理费表(CbSceneExpenseChildren)表数据库访问层
......@@ -10,6 +14,14 @@ import com.dsk.cscec.domain.CbSceneExpenseChildren;
* @since 2024-02-22 09:58:57
*/
public interface CbSceneExpenseChildrenMapper extends BaseMapper<CbSceneExpenseChildren> {
/**
* 获取现场经费汇总已添加成本数据月份
*/
R<List<String>> getSceneExpenseSummaryMonthList(@Param("fileId") Long fileId, @Param("deleteFlagExist") Integer deleteFlagExist);
/**
* 获取现场经费二级分类已添加成本数据月份
*/
R<List<String>> getSceneExpenseChildrenMonthList(@Param("fileId") Long fileId, @Param("deleteFlagExist") Integer deleteFlagExist);
}
package com.dsk.cscec.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsk.common.core.domain.R;
import com.dsk.cscec.domain.CbSceneExpenseChildren;
import com.dsk.cscec.domain.bo.CbSceneExpenseChildrenDataBo;
import com.dsk.cscec.domain.bo.CbSceneExpenseMonthBo;
import com.dsk.cscec.domain.vo.CbSceneExpenseMenuVo;
import java.util.List;
......@@ -38,4 +40,12 @@ public interface CbSceneExpenseChildrenService extends IService<CbSceneExpenseCh
* @return 现场经费二级分类数据
*/
List<CbSceneExpenseChildren> getChildrenData(CbSceneExpenseChildrenDataBo childrenDataBo);
/**
* 获取已添加成本数据月份
*
* @param monthBo 查询体
* @return 月份集合
*/
R<List<String>> getMonthList(CbSceneExpenseMonthBo monthBo);
}
......@@ -5,7 +5,9 @@ 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.dsk.common.core.domain.R;
import com.dsk.common.excel.ExcelUtils;
import com.dsk.common.exception.ServiceException;
import com.dsk.common.utils.StringUtils;
import com.dsk.cscec.constant.CbProjectConstants;
import com.dsk.cscec.constant.CbSceneExpenseConstants;
......@@ -14,6 +16,7 @@ import com.dsk.cscec.domain.CbProjectRecord;
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.bo.CbSceneExpenseMonthBo;
import com.dsk.cscec.domain.vo.CbSceneExpenseMenuVo;
import com.dsk.cscec.mapper.CbProjectFileMapper;
import com.dsk.cscec.mapper.CbProjectRecordMapper;
......@@ -29,6 +32,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
......@@ -198,6 +202,24 @@ public class CbSceneExpenseChildrenServiceImpl extends ServiceImpl<CbSceneExpens
.eq(CbSceneExpenseChildren::getProjectFileId, childrenDataBo.getFileId()));
}
/**
* 获取已添加成本数据月份
*
* @param monthBo 查询体
* @return 月份集合
*/
@Override
public R<List<String>> getMonthList(CbSceneExpenseMonthBo monthBo) {
//汇总和二级数据分开返
if (Objects.equals(monthBo.getMenuLevel(), CbSceneExpenseConstants.MENU_LEVEL1)) {
return baseMapper.getSceneExpenseSummaryMonthList(monthBo.getFileId(), CbProjectConstants.DELETE_FLAG_EXIST);
} else if (Objects.equals(monthBo.getMenuLevel(), CbSceneExpenseConstants.MENU_LEVEL2)) {
return baseMapper.getSceneExpenseChildrenMonthList(monthBo.getFileId(), CbProjectConstants.DELETE_FLAG_EXIST);
} else {
throw new ServiceException("菜单层级无效");
}
}
/**
* 校验项目是否存在
*
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsk.cscec.mapper.CbSceneExpenseChildrenMapper">
<!--获取现场经费汇总已添加成本数据月份-->
<select id="getSceneExpenseSummaryMonthList" resultType="java.util.List">
</select>
<!--获取现场经费二级分类已添加成本数据月份-->
<select id="getSceneExpenseChildrenMonthList" resultType="java.util.List">
</select>
</mapper>
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