Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fulixin
dsk-operate-sys-cscec
Commits
d0051f1b
Commit
d0051f1b
authored
Feb 23, 2024
by
chenyuefang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
成本汇总导入修改
parent
7d0f01ac
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
158 additions
and
91 deletions
+158
-91
CbSummaryController.java
...in/java/com/dsk/cscec/controller/CbSummaryController.java
+1
-1
CbSummaryCostAccountImportListener.java
...sk/cscec/listener/CbSummaryCostAccountImportListener.java
+7
-1
CbSummaryProjectImportListener.java
...om/dsk/cscec/listener/CbSummaryProjectImportListener.java
+14
-7
CbProjectFileMapper.java
...c/main/java/com/dsk/cscec/mapper/CbProjectFileMapper.java
+1
-0
CbSummaryService.java
...src/main/java/com/dsk/cscec/service/CbSummaryService.java
+1
-2
CbSummaryServiceImpl.java
...java/com/dsk/cscec/service/impl/CbSummaryServiceImpl.java
+125
-79
CbProjectFileMapper.xml
...i/src/main/resources/mapper/cscec/CbProjectFileMapper.xml
+9
-1
No files found.
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/controller/CbSummaryController.java
View file @
d0051f1b
...
@@ -134,7 +134,7 @@ public class CbSummaryController extends BaseController {
...
@@ -134,7 +134,7 @@ public class CbSummaryController extends BaseController {
*/
*/
@PostMapping
(
"/analysisData"
)
@PostMapping
(
"/analysisData"
)
public
void
analysisData
(
Long
projectId
){
public
void
analysisData
(
Long
projectId
){
cbSummaryService
.
importCb
Project
(
projectId
);
cbSummaryService
.
importCb
Summary
(
projectId
);
}
}
}
}
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/listener/CbSummaryCostAccountImportListener.java
View file @
d0051f1b
...
@@ -53,6 +53,12 @@ public class CbSummaryCostAccountImportListener extends AnalysisEventListener<Cb
...
@@ -53,6 +53,12 @@ public class CbSummaryCostAccountImportListener extends AnalysisEventListener<Cb
failureMsg
.
append
(
"<br/>"
).
append
(
"第"
+
sort
+
"条数据序号为空"
);
failureMsg
.
append
(
"<br/>"
).
append
(
"第"
+
sort
+
"条数据序号为空"
);
return
;
return
;
}
}
//成本科目不能为空
if
(
StringUtil
.
isBlank
(
importVo
.
getCbName
()))
{
failureNum
++;
failureMsg
.
append
(
"<br/>"
).
append
(
"第"
+
sort
+
"条数据成本科目为空"
);
return
;
}
//父级数据处理
//父级数据处理
if
(
sort
==
1
)
{
if
(
sort
==
1
)
{
...
@@ -74,7 +80,7 @@ public class CbSummaryCostAccountImportListener extends AnalysisEventListener<Cb
...
@@ -74,7 +80,7 @@ public class CbSummaryCostAccountImportListener extends AnalysisEventListener<Cb
@Override
@Override
public
String
getAnalysis
()
{
public
String
getAnalysis
()
{
if
(
failureNum
>
0
)
{
if
(
failureNum
>
0
)
{
failureMsg
.
insert
(
0
,
"
失败原因:
共 "
+
failureNum
+
" 条数据格式不正确,错误如下:"
);
failureMsg
.
insert
(
0
,
"共 "
+
failureNum
+
" 条数据格式不正确,错误如下:"
);
throw
new
ServiceException
(
failureMsg
.
toString
());
throw
new
ServiceException
(
failureMsg
.
toString
());
}
else
{
}
else
{
successMsg
.
insert
(
0
,
"成本科目汇总数据已全部解析成功!共 "
+
getList
().
size
()
+
" 条"
);
successMsg
.
insert
(
0
,
"成本科目汇总数据已全部解析成功!共 "
+
getList
().
size
()
+
" 条"
);
...
...
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/listener/CbSummaryProjectImportListener.java
View file @
d0051f1b
package
com
.
dsk
.
cscec
.
listener
;
package
com
.
dsk
.
cscec
.
listener
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.dsk.common.excel.ExcelListener
;
import
com.dsk.common.excel.ExcelListener
;
...
@@ -42,8 +43,12 @@ public class CbSummaryProjectImportListener extends AnalysisEventListener<CbSumm
...
@@ -42,8 +43,12 @@ public class CbSummaryProjectImportListener extends AnalysisEventListener<CbSumm
@Override
@Override
public
void
invoke
(
CbSummaryProjectImportVo
importVo
,
AnalysisContext
context
)
{
public
void
invoke
(
CbSummaryProjectImportVo
importVo
,
AnalysisContext
context
)
{
//第一个序号不能为空? todo
//名称不能为空
if
(
StringUtil
.
isBlank
(
importVo
.
getCbName
()))
{
failureNum
++;
failureMsg
.
append
(
"<br/>"
).
append
(
"第"
+
sort
+
"条数据名称为空"
);
return
;
}
//添加父级数据
//添加父级数据
if
(
sort
==
0
)
{
if
(
sort
==
0
)
{
CbSummaryProjectImportVo
firstVo
=
new
CbSummaryProjectImportVo
();
CbSummaryProjectImportVo
firstVo
=
new
CbSummaryProjectImportVo
();
...
@@ -63,8 +68,12 @@ public class CbSummaryProjectImportListener extends AnalysisEventListener<CbSumm
...
@@ -63,8 +68,12 @@ public class CbSummaryProjectImportListener extends AnalysisEventListener<CbSumm
//按sort倒序取number不为空的最大level
//按sort倒序取number不为空的最大level
Object
[]
objects
=
resultList
.
stream
().
sorted
(
Comparator
.
comparingInt
(
CbSummaryProjectImportVo:
:
getSort
).
reversed
())
Object
[]
objects
=
resultList
.
stream
().
sorted
(
Comparator
.
comparingInt
(
CbSummaryProjectImportVo:
:
getSort
).
reversed
())
.
filter
(
vo
->
StringUtil
.
isNotBlank
(
vo
.
getNumber
())).
limit
(
1
).
map
(
CbSummaryProjectImportVo:
:
getLevel
).
toArray
();
.
filter
(
vo
->
StringUtil
.
isNotBlank
(
vo
.
getNumber
())).
limit
(
1
).
map
(
CbSummaryProjectImportVo:
:
getLevel
).
toArray
();
//数据序号错误 todo
//数据序号错误
if
(
ObjectUtil
.
isEmpty
(
objects
))
{
failureNum
++;
failureMsg
.
append
(
"<br/>"
).
append
(
"第"
+
sort
+
"条数据序号错误"
);
return
;
}
Integer
lastLevel
=
(
Integer
)
objects
[
0
];
Integer
lastLevel
=
(
Integer
)
objects
[
0
];
importVo
.
setLevel
(
lastLevel
+
1
);
importVo
.
setLevel
(
lastLevel
+
1
);
...
@@ -75,8 +84,6 @@ public class CbSummaryProjectImportListener extends AnalysisEventListener<CbSumm
...
@@ -75,8 +84,6 @@ public class CbSummaryProjectImportListener extends AnalysisEventListener<CbSumm
}
}
// failureNum++;
// failureMsg.append("<br/>").append(failureNum);
resultList
.
add
(
importVo
);
resultList
.
add
(
importVo
);
}
}
...
@@ -93,7 +100,7 @@ public class CbSummaryProjectImportListener extends AnalysisEventListener<CbSumm
...
@@ -93,7 +100,7 @@ public class CbSummaryProjectImportListener extends AnalysisEventListener<CbSumm
@Override
@Override
public
String
getAnalysis
()
{
public
String
getAnalysis
()
{
if
(
failureNum
>
0
)
{
if
(
failureNum
>
0
)
{
failureMsg
.
insert
(
0
,
"
失败原因:
共 "
+
failureNum
+
" 条数据格式不正确,错误如下:"
);
failureMsg
.
insert
(
0
,
"共 "
+
failureNum
+
" 条数据格式不正确,错误如下:"
);
throw
new
ServiceException
(
failureMsg
.
toString
());
throw
new
ServiceException
(
failureMsg
.
toString
());
}
else
{
}
else
{
successMsg
.
insert
(
0
,
"项目汇总数据已全部解析成功!共 "
+
getList
().
size
()
+
" 条"
);
successMsg
.
insert
(
0
,
"项目汇总数据已全部解析成功!共 "
+
getList
().
size
()
+
" 条"
);
...
...
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/mapper/CbProjectFileMapper.java
View file @
d0051f1b
...
@@ -16,5 +16,6 @@ public interface CbProjectFileMapper extends BaseMapper<CbProjectFile> {
...
@@ -16,5 +16,6 @@ public interface CbProjectFileMapper extends BaseMapper<CbProjectFile> {
List
<
CbProjectFile
>
selectAnalysisList
(
@Param
(
"projectId"
)
Long
projectId
,
@Param
(
"cbType"
)
Integer
cbType
,
@Param
(
"cbStage"
)
Integer
cbStage
);
List
<
CbProjectFile
>
selectAnalysisList
(
@Param
(
"projectId"
)
Long
projectId
,
@Param
(
"cbType"
)
Integer
cbType
,
@Param
(
"cbStage"
)
Integer
cbStage
);
int
removeById
(
@Param
(
"id"
)
Long
id
);
}
}
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/service/CbSummaryService.java
View file @
d0051f1b
...
@@ -2,7 +2,6 @@ package com.dsk.cscec.service;
...
@@ -2,7 +2,6 @@ package com.dsk.cscec.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.dsk.common.core.domain.R
;
import
com.dsk.common.core.domain.R
;
import
com.dsk.cscec.domain.CbProjectFile
;
import
com.dsk.cscec.domain.CbSummary
;
import
com.dsk.cscec.domain.CbSummary
;
import
com.dsk.cscec.domain.bo.CbSummaryActualBo
;
import
com.dsk.cscec.domain.bo.CbSummaryActualBo
;
import
com.dsk.cscec.domain.bo.CbSummaryActualListBo
;
import
com.dsk.cscec.domain.bo.CbSummaryActualListBo
;
...
@@ -26,7 +25,7 @@ public interface CbSummaryService extends IService<CbSummary> {
...
@@ -26,7 +25,7 @@ public interface CbSummaryService extends IService<CbSummary> {
* 项目汇总导入
* 项目汇总导入
* @param projectId
* @param projectId
*/
*/
void
importCb
Project
(
Long
projectId
);
void
importCb
Summary
(
Long
projectId
);
/**
/**
* 获取一级名称/成本科目列表
* 获取一级名称/成本科目列表
...
...
dsk-module/dsk-biz-api/src/main/java/com/dsk/cscec/service/impl/CbSummaryServiceImpl.java
View file @
d0051f1b
This diff is collapsed.
Click to expand it.
dsk-module/dsk-biz-api/src/main/resources/mapper/cscec/CbProjectFileMapper.xml
View file @
d0051f1b
...
@@ -7,6 +7,14 @@
...
@@ -7,6 +7,14 @@
del_flag, create_by, create_time, update_by, update_time
del_flag, create_by, create_time, update_by, update_time
FROM cb_project_file
FROM cb_project_file
WHERE ((del_flag = 0 and file_parse_status in (1,3)) or del_flag = 1)
WHERE ((del_flag = 0 and file_parse_status in (1,3)) or del_flag = 1)
and project_id=#{projectId} and cb_stage =#{cbStage} and cb_type = #{cbType}
and project_id=#{projectId}
<if
test=
"cbStage != null"
>
and cb_stage =#{cbStage}
</if>
and cb_type = #{cbType}
</select>
</select>
<update
id=
"removeById"
>
UPDATE cb_project_file SET del_flag=2 WHERE id=#{id}
</update>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment