Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
yn-health-science
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
徐俊
yn-health-science
Commits
60026cb7
Commit
60026cb7
authored
Dec 05, 2024
by
wangxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
77
parent
b4e73a88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
50 deletions
+35
-50
ComProjectServiceImpl.java
...m/yiboshi/science/service/impl/ComProjectServiceImpl.java
+35
-50
No files found.
science-admin/src/main/java/com/yiboshi/science/service/impl/ComProjectServiceImpl.java
View file @
60026cb7
package
com
.
yiboshi
.
science
.
service
.
impl
;
package
com
.
yiboshi
.
science
.
service
.
impl
;
import
com.alibaba.excel.util.StringUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.itextpdf.html2pdf.html.HtmlUtils
;
import
com.yiboshi.arch.exception.BusinessException
;
import
com.yiboshi.arch.exception.BusinessException
;
import
com.yiboshi.science.Constants
;
import
com.yiboshi.science.base.BaseServiceImpl
;
import
com.yiboshi.science.base.BaseServiceImpl
;
import
com.yiboshi.science.base.Pagination
;
import
com.yiboshi.science.base.Pagination
;
import
com.yiboshi.science.config.bean.SystemProperties
;
import
com.yiboshi.science.config.bean.SystemProperties
;
...
@@ -25,17 +22,13 @@ import org.springframework.web.bind.annotation.PathVariable;
...
@@ -25,17 +22,13 @@ import org.springframework.web.bind.annotation.PathVariable;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.ByteArrayInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
yiboshi
.
science
.
utils
.
HtmlBuilder
.
loop
;
/**
/**
* 项目表 Service 实现类
* 项目表 Service 实现类
*
*
...
@@ -271,7 +264,7 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
...
@@ -271,7 +264,7 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
NewProjectKPIInfo
(
dto
);
NewProjectKPIInfo
(
dto
);
// 附件
// 附件
List
<
ComFileDTO
>
fileList
=
processAttachment
List
(
projType
);
List
<
ComFileDTO
>
fileList
=
configureFile
List
(
projType
);
dto
.
setFileList
(
fileList
);
dto
.
setFileList
(
fileList
);
dto
.
setReportYear
(
comBatchService
.
getReportYear
(
projType
));
dto
.
setReportYear
(
comBatchService
.
getReportYear
(
projType
));
...
@@ -309,13 +302,6 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
...
@@ -309,13 +302,6 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
if
(
null
!=
comUnitDTO
)
{
if
(
null
!=
comUnitDTO
)
{
dto
.
setAppUnitName
(
comUnitDTO
.
getUnitName
());
dto
.
setAppUnitName
(
comUnitDTO
.
getUnitName
());
dto
.
setUnitTypeName
(
comUnitDTO
.
getUnitTypeName
());
dto
.
setUnitTypeName
(
comUnitDTO
.
getUnitTypeName
());
// dto.setOrganizationCode(comUnitDTO.getOrganizationCode());
// dto.setAddress(comUnitDTO.getUnitAddress());
// dto.setLegalPerson(null);
// dto.setDepositBank(null);
// dto.setBankAccount(null);
// dto.setDepositBankAddress(null);
// dto.setInterbankNumber(null);
}
}
// 项目合作单位
// 项目合作单位
...
@@ -380,11 +366,14 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
...
@@ -380,11 +366,14 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
//附件列表
//附件列表
List
<
ComFileDTO
>
fileList
=
ComFileService
.
getListByObjectId
(
dto
.
getId
(),
CommonEnum
.
fileType
.
project
.
getCode
());
List
<
ComFileDTO
>
fileList
=
ComFileService
.
getListByObjectId
(
dto
.
getId
(),
CommonEnum
.
fileType
.
project
.
getCode
());
if
(
null
==
fileList
||
fileList
.
size
()
==
0
)
if
(
null
==
fileList
||
fileList
.
size
()
==
0
)
fileList
=
processAttachment
List
(
dto
.
getProjType
());
fileList
=
configureFile
List
(
dto
.
getProjType
());
else
else
fileList
=
checkNecessaryAttachmentFile
(
dto
.
getProjType
(),
fileList
);
fileList
=
checkNecessaryAttachmentFile
(
dto
.
getProjType
(),
fileList
);
dto
.
setFileList
(
fileList
);
dto
.
setFileList
(
fileList
);
//审核记录列表
//审核记录列表
List
<
ComProjectAuditNoteDTO
>
auditList
=
comProjectAuditNoteService
.
getListByObjectId
(
dto
.
getId
());
List
<
ComProjectAuditNoteDTO
>
auditList
=
comProjectAuditNoteService
.
getListByObjectId
(
dto
.
getId
());
dto
.
setAuditList
(
auditList
);
dto
.
setAuditList
(
auditList
);
...
@@ -449,6 +438,33 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
...
@@ -449,6 +438,33 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
dto
.
setProjectKPI
(
kpiDTO
);
dto
.
setProjectKPI
(
kpiDTO
);
}
}
private
List
<
ComFileDTO
>
configureFileList
(
Integer
projType
)
{
List
<
ComFileDTO
>
fileList
=
new
ArrayList
<>();
List
<
SystemParameter
>
parameterList
;
//健康领域科技项目
if
(
projType
==
CommonEnum
.
projType
.
num
.
getCode
())
parameterList
=
systemParameterService
.
getListByType
(
61
);
else
//临床科技项目
parameterList
=
systemParameterService
.
getListByType
(
13
);
parameterList
.
forEach
(
e
->
{
fileList
.
add
(
configureFile
(
e
.
getName
(),
e
.
getDisplayOrder
(),
e
.
getIsRequired
()));
});
return
fileList
;
}
private
ComFileDTO
configureFile
(
String
FileExplain
,
int
showIndex
,
Boolean
isRequired
)
{
ComFileDTO
file
=
new
ComFileDTO
();
file
.
setFileType
(
CommonEnum
.
fileType
.
project
.
getCode
());
file
.
setFileExplain
(
FileExplain
);
file
.
setShowIndex
(
showIndex
);
file
.
setRequired
(
true
);
if
(!
isRequired
.
equals
(
null
))
file
.
setIsRequired
(
isRequired
);
else
file
.
setIsRequired
(
false
);
return
file
;
}
public
List
<
ComFileDTO
>
checkNecessaryAttachmentFile
(
Integer
projType
,
List
<
ComFileDTO
>
fileList
)
{
public
List
<
ComFileDTO
>
checkNecessaryAttachmentFile
(
Integer
projType
,
List
<
ComFileDTO
>
fileList
)
{
List
<
SystemParameter
>
parameterList
;
List
<
SystemParameter
>
parameterList
;
//健康领域科技项目
//健康领域科技项目
...
@@ -456,6 +472,7 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
...
@@ -456,6 +472,7 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
parameterList
=
systemParameterService
.
getListByType
(
61
);
parameterList
=
systemParameterService
.
getListByType
(
61
);
else
//临床科技项目
else
//临床科技项目
parameterList
=
systemParameterService
.
getListByType
(
13
);
parameterList
=
systemParameterService
.
getListByType
(
13
);
AtomicInteger
allCount
=
new
AtomicInteger
(
parameterList
.
size
()
+
1
);
AtomicInteger
allCount
=
new
AtomicInteger
(
parameterList
.
size
()
+
1
);
fileList
.
forEach
(
e
->
{
fileList
.
forEach
(
e
->
{
AtomicInteger
num
=
new
AtomicInteger
(
1
);
AtomicInteger
num
=
new
AtomicInteger
(
1
);
...
@@ -477,8 +494,8 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
...
@@ -477,8 +494,8 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
parameterList
.
forEach
(
p
->
{
parameterList
.
forEach
(
p
->
{
List
<
ComFileDTO
>
findList
=
fileList
.
stream
().
filter
(
e
->
null
!=
e
.
getFileExplain
()
&&
e
.
getFileExplain
().
equals
(
p
.
getName
())).
collect
(
Collectors
.
toList
());
List
<
ComFileDTO
>
findList
=
fileList
.
stream
().
filter
(
e
->
null
!=
e
.
getFileExplain
()
&&
e
.
getFileExplain
().
equals
(
p
.
getName
())).
collect
(
Collectors
.
toList
());
if
(
findList
.
size
()
==
0
)
{
if
(
findList
.
size
()
==
0
)
{
ComFileDTO
fileDTO
=
processAttachmentFile
(
p
.
getName
(),
p
.
getDisplayOrder
());
ComFileDTO
fileDTO
=
configureFile
(
p
.
getName
(),
p
.
getDisplayOrder
(),
p
.
getIsRequired
());
fileList
.
add
(
0
,
fileDTO
);
fileList
.
add
(
fileDTO
);
}
}
});
});
...
@@ -488,38 +505,6 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
...
@@ -488,38 +505,6 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
}
}
private
List
<
ComFileDTO
>
processAttachmentList
(
Integer
projType
)
{
List
<
ComFileDTO
>
fileList
=
new
ArrayList
<>();
List
<
SystemParameter
>
parameterList
;
//健康领域科技项目
if
(
projType
==
CommonEnum
.
projType
.
num
.
getCode
())
parameterList
=
systemParameterService
.
getListByType
(
61
);
else
//临床科技项目
parameterList
=
systemParameterService
.
getListByType
(
13
);
parameterList
.
forEach
(
e
->
{
ComFileDTO
AttachentFile
=
processAttachmentFile
(
e
.
getName
(),
e
.
getDisplayOrder
());
if
(
null
!=
e
.
getIsRequired
()
&&
e
.
getIsRequired
().
equals
(
true
))
AttachentFile
.
setIsRequired
(
true
);
else
AttachentFile
.
setIsRequired
(
false
);
fileList
.
add
(
AttachentFile
);
});
return
fileList
;
}
private
ComFileDTO
processAttachmentFile
(
String
FileExplain
,
int
showIndex
)
{
ComFileDTO
fileDTO
=
new
ComFileDTO
();
fileDTO
.
setFileType
(
CommonEnum
.
fileType
.
project
.
getCode
());
fileDTO
.
setFileExplain
(
FileExplain
);
fileDTO
.
setShowIndex
(
showIndex
);
fileDTO
.
setRequired
(
true
);
return
fileDTO
;
}
private
void
loadPersonInfo
(
ComProjectDTO
dto
,
ComPersonDTO
comPersonDTO
)
{
private
void
loadPersonInfo
(
ComProjectDTO
dto
,
ComPersonDTO
comPersonDTO
)
{
dto
.
setAppPersonName
(
comPersonDTO
.
getPersonName
());
dto
.
setAppPersonName
(
comPersonDTO
.
getPersonName
());
dto
.
setSex
(
comPersonDTO
.
getSex
());
dto
.
setSex
(
comPersonDTO
.
getSex
());
...
...
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