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
7e8874c7
Commit
7e8874c7
authored
Dec 17, 2024
by
徐俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xujun
parent
5dfead3c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
194 additions
and
6 deletions
+194
-6
ComProjectController.java
...ava/com/yiboshi/science/rest/v1/ComProjectController.java
+9
-0
ComProjectService.java
...n/java/com/yiboshi/science/service/ComProjectService.java
+7
-0
ComProjectServiceImpl.java
...m/yiboshi/science/service/impl/ComProjectServiceImpl.java
+166
-6
UUIDUtils.java
...se/src/main/java/com/yiboshi/science/utils/UUIDUtils.java
+12
-0
No files found.
science-admin/src/main/java/com/yiboshi/science/rest/v1/ComProjectController.java
View file @
7e8874c7
...
...
@@ -143,6 +143,15 @@ public class ComProjectController extends BaseController<ComProjectService, ComP
return
ResponseDataModel
.
ok
(
comProjectService
.
save
(
comProjectDTO
));
}
@ApiOperation
(
value
=
"分步保存项目信息"
,
httpMethod
=
"POST"
,
notes
=
"分步保存项目信息"
)
@PostMapping
@RequestMapping
(
"/SaveByStep"
)
@PreAuthorize
(
"hasAnyRole('REPORT','GOV','ADMIN')"
)
@Logs
(
value
=
CommonEnum
.
logType
.
projectSave
)
public
ResponseDataModel
<
String
>
SaveByStep
(
@RequestBody
ComProjectDTO
comProjectDTO
,
BindingResult
bindingResult
)
{
return
ResponseDataModel
.
ok
(
comProjectService
.
SaveByStep
(
comProjectDTO
));
}
/**
* 保存项目信息
*
...
...
science-admin/src/main/java/com/yiboshi/science/service/ComProjectService.java
View file @
7e8874c7
...
...
@@ -46,6 +46,13 @@ public interface ComProjectService extends BaseService<ComProjectQueryVO, ComPro
*/
String
save
(
ComProjectDTO
dto
);
/**
* 分布保存项目信息
* @param dto
* @return
*/
String
SaveByStep
(
ComProjectDTO
dto
);
/**
* 修改申报单位
*
...
...
science-admin/src/main/java/com/yiboshi/science/service/impl/ComProjectServiceImpl.java
View file @
7e8874c7
...
...
@@ -351,9 +351,9 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
// 项目绩效目标表
LoadProjectKPIInfo
(
dto
);
// 项目合作单位
List
<
ComProjectCooperativeUnitsDTO
>
cooperativeUnits
=
comProjectCooperativeUnitsService
.
getListByObjectId
(
dto
.
getId
(),
1
);
dto
.
setCooperativeUnits
(
cooperativeUnits
);
//
// 项目合作单位
//
List<ComProjectCooperativeUnitsDTO> cooperativeUnits = comProjectCooperativeUnitsService.getListByObjectId(dto.getId(), 1);
//
dto.setCooperativeUnits(cooperativeUnits);
// 项目参与单位
List
<
ComProjectCooperativeUnitsDTO
>
participateUnits
=
comProjectCooperativeUnitsService
.
getListByObjectId
(
dto
.
getId
(),
2
);
...
...
@@ -697,6 +697,167 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
return
dto
.
getId
();
}
public
String
SaveByStep
(
ComProjectDTO
dto
)
{
String
ProjectID
=
""
;
switch
(
dto
.
getStep
())
{
case
0
:
ProjectID
=
ProjectSaveStep0
(
dto
);
break
;
case
1
:
ProjectID
=
ProjectSaveStep1
(
dto
);
break
;
case
2
:
ProjectID
=
ProjectSaveStep2
(
dto
);
break
;
case
3
:
ProjectID
=
ProjectSaveStep3
(
dto
);
break
;
case
4
:
ProjectID
=
ProjectSaveStep4
(
dto
);
break
;
case
5
:
ProjectID
=
ProjectSaveStep5
(
dto
);
break
;
}
return
ProjectID
;
}
private
String
ProjectSaveStep0
(
ComProjectDTO
dto
)
{
String
ProjectID
=
""
;
dto
.
setFileId
(
dto
.
getDownloadId
());
if
(
Objects
.
nonNull
(
dto
.
getGovFunding
()))
{
if
(
dto
.
getGovFunding
().
compareTo
(
new
BigDecimal
(
50
))
>
-
1
)
{
dto
.
setProjClass
(
2
);
}
else
{
dto
.
setProjClass
(
1
);
}
}
if
(
Objects
.
isNull
(
dto
.
getId
()))
ProjectID
=
InsertProjectBaseInfo
(
dto
);
else
{
ComProject
project
=
this
.
entityById
(
dto
.
getId
());
if
(
null
==
project
)
{
ProjectID
=
InsertProjectBaseInfo
(
dto
);
}
ProjectID
=
UpdateProjectBaseInfo
(
dto
);
}
return
ProjectID
;
}
@Transactional
public
String
ProjectSaveStep1
(
ComProjectDTO
dto
)
{
ComProject
comProject
=
convert2Entity
(
dto
);
this
.
update
(
comProject
);
// 项目参加人员
comProjectMembersService
.
insertList
(
dto
.
getMembers
(),
dto
.
getId
());
// 主要参与单位
comProjectCooperativeUnitsService
.
insertList
(
dto
.
getParticipateUnits
(),
dto
.
getId
(),
2
);
return
dto
.
getId
();
}
@Transactional
public
String
ProjectSaveStep2
(
ComProjectDTO
dto
)
{
ComProject
comProject
=
convert2Entity
(
dto
);
this
.
update
(
comProject
);
// 经费预算
comProjectBudgetService
.
insertBudgetList
(
dto
.
getBudget
(),
dto
.
getId
());
// 年度用款计划表
comProjectFundPlanService
.
insertList
(
dto
.
getFundPlan
(),
dto
.
getId
());
if
(
null
!=
dto
.
getDeviceList
()
&&
dto
.
getDeviceList
().
size
()
>
0
)
{
// 购置设备预算明细表
comProjectEquipmentService
.
insertEquipmentList
(
dto
.
getDeviceList
(),
dto
.
getId
());
}
if
(
null
!=
dto
.
getManufactureList
()
&&
dto
.
getManufactureList
().
size
()
>
0
)
{
// 试制设备预算明细表
comProjectManufactureService
.
insertEquipmentList
(
dto
.
getManufactureList
(),
dto
.
getId
());
}
if
(
null
!=
dto
.
getUnitPayment
()
&&
dto
.
getUnitPayment
().
size
()
>
0
)
{
// 单位支出明细预算表
comProjectUnitPaymentService
.
insertList
(
dto
.
getUnitPayment
(),
dto
.
getId
());
}
return
dto
.
getId
();
}
@Transactional
public
String
ProjectSaveStep3
(
ComProjectDTO
dto
)
{
ComProject
comProject
=
convert2Entity
(
dto
);
this
.
update
(
comProject
);
// 项目安排及阶段目标
comProjectStageGoalService
.
insertList
(
dto
.
getStageGoals
(),
dto
.
getId
());
if
(
null
!=
dto
.
getProjectSubList
()
&&
dto
.
getProjectSubList
().
size
()
>
0
)
{
// 项目课颖设置表
comProjectSubService
.
insertList
(
dto
.
getProjectSubList
(),
dto
.
getId
());
}
return
dto
.
getId
();
}
@Transactional
public
String
ProjectSaveStep4
(
ComProjectDTO
dto
)
{
ComProject
comProject
=
convert2Entity
(
dto
);
this
.
update
(
comProject
);
comProjectBasicService
.
insertOrUpdate
(
dto
);
if
(
null
!=
dto
.
getProjectKPI
().
getKpiList
()
||
dto
.
getProjectKPI
().
getKpiList
().
size
()
>
0
)
{
// 项目绩效指标表
comProjectKpitDetailService
.
insertList
(
dto
.
getProjectKPI
().
getKpiList
(),
dto
.
getId
());
}
return
dto
.
getId
();
}
@Transactional
public
String
ProjectSaveStep5
(
ComProjectDTO
dto
)
{
ComProject
comProject
=
convert2Entity
(
dto
);
this
.
update
(
comProject
);
// 附件
ComFileService
.
insertList
(
dto
.
getFileList
(),
dto
.
getId
(),
CommonEnum
.
fileType
.
project
.
getCode
());
return
dto
.
getId
();
}
private
String
InsertProjectBaseInfo
(
ComProjectDTO
dto
)
{
ComBatchDTO
comBatchDTO
=
comBatchService
.
getCurrentYearBatchByType
(
dto
.
getProjType
());
ComProject
comProject
=
convert2Entity
(
dto
);
comProject
.
setAppNo
(
getAppNo
());
comProject
.
setReportYear
(
comBatchDTO
.
getYear
());
comProject
.
setBatch
(
comBatchDTO
.
getBatch
());
dto
.
setSubjectScope
(
"生物医药领域"
);
comProject
.
setCompleted
(
0
);
comProject
.
setAssignState
(
0
);
String
id
=
this
.
insert
(
comProject
);
dto
.
setId
(
id
);
comProjectBasicService
.
insertOrUpdate
(
dto
);
return
id
;
}
private
String
UpdateProjectBaseInfo
(
ComProjectDTO
dto
)
{
ComProject
project
=
this
.
entityById
(
dto
.
getId
());
if
(
null
==
project
)
throw
new
BusinessException
(
"项目不存在或已删除"
);
if
(!
StringUtil
.
isContainsRole
(
SecurityUserHolder
.
getRoles
(),
CommonEnum
.
systemRole
.
sys
.
getCode
().
toString
())
&&
!
StringUtil
.
isContainsRole
(
SecurityUserHolder
.
getRoles
(),
CommonEnum
.
systemRole
.
topGov
.
getCode
().
toString
())
&&
!
project
.
getProjState
().
equals
(
CommonEnum
.
projState
.
draft
.
getCode
())
&&
!
project
.
getProjState
().
equals
(
CommonEnum
.
projState
.
waitSubmit
.
getCode
())
&&
!
project
.
getProjState
().
equals
(
CommonEnum
.
projState
.
returnModify
.
getCode
()))
throw
new
BusinessException
(
"项目已上报!"
);
ComProject
comProject
=
convert2Entity
(
dto
);
comProjectBasicService
.
insertOrUpdate
(
dto
);
return
this
.
update
(
comProject
);
}
@Transactional
//插入
public
String
projectInsert
(
ComProjectDTO
dto
)
{
...
...
@@ -743,8 +904,8 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
comProjectBudgetService
.
insertBudgetList
(
dto
.
getBudget
(),
id
);
// 年度用款计划表
comProjectFundPlanService
.
insertList
(
dto
.
getFundPlan
(),
id
);
// 项目合作单位
comProjectCooperativeUnitsService
.
insertList
(
dto
.
getCooperativeUnits
(),
id
,
1
);
//
// 项目合作单位
//
comProjectCooperativeUnitsService.insertList(dto.getCooperativeUnits(), id, 1);
// 主要参与单位
comProjectCooperativeUnitsService
.
insertList
(
dto
.
getParticipateUnits
(),
id
,
2
);
// 购置设备预算明细表
...
...
@@ -857,7 +1018,6 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
return
date
.
format
(
nowTime
);
}
public
DataStatisticsDTO
getProjectReportCountByGov
(
String
treeCode
)
{
return
comProjectDAO
.
getProjectReportCountByGov
(
treeCode
);
}
...
...
science-base/src/main/java/com/yiboshi/science/utils/UUIDUtils.java
View file @
7e8874c7
...
...
@@ -95,6 +95,18 @@ public class UUIDUtils {
return
new
UUID
(
mostSigBits
,
leastSigBits
).
toString
().
replaceAll
(
"-"
,
""
);
}
public
static
boolean
isValidUUID
(
String
uuid
)
{
// UUID校验
if
(
uuid
==
null
)
{
System
.
out
.
println
(
"uuid is null"
);
}
String
regex
=
"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
;
if
(
uuid
.
matches
(
regex
))
{
return
true
;
}
return
false
;
}
public
static
void
main
(
String
[]
args
)
{
String
uuid
=
String
.
valueOf
(
UUID
.
randomUUID
());
System
.
out
.
println
(
uuid
);
...
...
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