Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-plan
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
INET-TWO
server
dcs-plan
Commits
c41d2718
Commit
c41d2718
authored
Jul 26, 2024
by
wangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ExtPlanController:业务代码迁入(2.x版本->4.1版本)--暂时还未编译通过
parent
91afe366
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1674 additions
and
3 deletions
+1674
-3
Constants.java
...n/java/com/yonde/dcs/plan/common/constants/Constants.java
+396
-0
ExcelUtils.java
...main/java/com/yonde/dcs/plan/common/utils/ExcelUtils.java
+49
-0
FileUtils.java
.../main/java/com/yonde/dcs/plan/common/utils/FileUtils.java
+498
-0
ResourceHelper.java
.../java/com/yonde/dcs/plan/common/utils/ResourceHelper.java
+34
-0
PlanExcelVO.java
...c/main/java/com/yonde/dcs/plan/common/vo/PlanExcelVO.java
+128
-0
ExtPlanController.java
...com/yonde/dcs/plan/core/controller/ExtPlanController.java
+29
-0
ExtPlanService.java
.../java/com/yonde/dcs/plan/core/service/ExtPlanService.java
+21
-0
ExtPlanServiceImpl.java
.../yonde/dcs/plan/core/service/impl/ExtPlanServiceImpl.java
+519
-3
No files found.
dcs-plan-common/src/main/java/com/yonde/dcs/plan/common/constants/Constants.java
0 → 100644
View file @
c41d2718
This diff is collapsed.
Click to expand it.
dcs-plan-common/src/main/java/com/yonde/dcs/plan/common/utils/ExcelUtils.java
0 → 100644
View file @
c41d2718
package
com
.
yonde
.
dcs
.
plan
.
common
.
utils
;
import
cn.hutool.poi.excel.ExcelReader
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* @author xfchai
* @ClassName ExcelUtils.java
* @Description 操作excel工具类
* @createTime 2021/09/06 09:38:00
*/
@Slf4j
public
class
ExcelUtils
{
/**
* 通过名称读取Excel
*
* @param uploadFile
* @param sheetName
* @return
*/
public
static
ExcelReader
excelUtil
(
MultipartFile
uploadFile
,
String
sheetName
)
{
try
{
ExcelReader
reader
=
ExcelUtil
.
getReader
(
uploadFile
.
getInputStream
(),
sheetName
);
return
reader
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
null
;
}
}
/**
* 通过sheetIndex读取Excel
*
* @param uploadFile
* @param sheetIndex
* @return
*/
public
static
ExcelReader
excelReader
(
MultipartFile
uploadFile
,
int
sheetIndex
)
{
try
{
ExcelReader
reader
=
ExcelUtil
.
getReader
(
uploadFile
.
getInputStream
(),
sheetIndex
);
return
reader
;
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
return
null
;
}
}
}
dcs-plan-common/src/main/java/com/yonde/dcs/plan/common/utils/FileUtils.java
0 → 100644
View file @
c41d2718
This diff is collapsed.
Click to expand it.
dcs-plan-common/src/main/java/com/yonde/dcs/plan/common/utils/ResourceHelper.java
0 → 100644
View file @
c41d2718
package
com
.
yonde
.
dcs
.
plan
.
common
.
utils
;
import
lombok.extern.slf4j.Slf4j
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.util.Properties
;
/**
* @program: service
* @description: 外部资源配置类
* @author: dang wei
* @create: 2021-01-04 11:29
*/
@Slf4j
public
class
ResourceHelper
{
/**
* 获取外部资源配置
* @return
*/
public
static
Properties
getResource
(){
Properties
prop
=
new
Properties
();
try
{
prop
.
load
(
new
FileInputStream
(
"resource/esignConfig.properties"
));
}
catch
(
FileNotFoundException
e
){
log
.
error
(
"找不到配置资源文件:"
+
e
.
getMessage
());
}
catch
(
IOException
e
){
log
.
error
(
"读取外部配置资源文件报错:"
+
e
.
getMessage
());
}
return
prop
;
}
}
dcs-plan-common/src/main/java/com/yonde/dcs/plan/common/vo/PlanExcelVO.java
0 → 100644
View file @
c41d2718
package
com
.
yonde
.
dcs
.
plan
.
common
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @author xfchai
* @ClassName ExtPlanEntity.java
* @Description 计划导入实体
* @createTime 2021/09/09 10:59:00
*/
@Data
public
class
PlanExcelVO
implements
Serializable
{
/**
* 操作
*/
private
String
operate
;
/**
* 计划名称
*/
private
String
name
;
/**
* 计划编号
*/
private
String
number
;
/**
* 父级计划编号
*/
private
String
superPlanCode
;
/**
* 业务计划类型
*/
private
String
businessPlanType
;
/**
* 反馈类型
*/
private
String
feedbackType
;
/**
* 是否产生计划任务
*/
private
String
hasPlanTasks
;
/**
* 合同编号
*/
private
String
contractNo
;
/**
* 计划执行人
*/
private
String
planExecutor
;
/**
* 工期
*/
private
String
constructPeriod
;
/**
* 开始时间
*/
private
Date
startTime
;
/**
* 完成时间
*/
private
Date
completeTime
;
/**
* 文件分类
*/
private
String
fileType
;
/**
* 文件名称
*/
private
String
fileName
;
/**
* 文件编号
*/
private
String
fileNumber
;
/**
* 文件代号
*/
private
String
fileCode
;
/**
* 项目代号
*/
private
String
projectCode
;
/**
* 管理信息系统编码
*/
private
String
systemCode
;
/**
* 审核者
*/
private
String
review
;
/**
* 批准者
*/
private
String
approver
;
/**
* 审定者
*/
private
String
verifier
;
/**
* 状态
*/
// private String state;
/**
* 阶段状态
*/
private
String
phaseState
;
/**
* 计划级别
*/
private
String
planLevel
;
/**
* 密级
*/
private
String
secretCode
;
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/controller/ExtPlanController.java
View file @
c41d2718
...
@@ -3,6 +3,8 @@ package com.yonde.dcs.plan.core.controller;
...
@@ -3,6 +3,8 @@ package com.yonde.dcs.plan.core.controller;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.List
;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
...
@@ -13,7 +15,10 @@ import com.yonde.dcs.plan.core.service.ExtPlanService;
...
@@ -13,7 +15,10 @@ import com.yonde.dcs.plan.core.service.ExtPlanService;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
com.yonde.dcs.plan.core.controller.shadow.ExtPlanControllerShadow
;
import
com.yonde.dcs.plan.core.controller.shadow.ExtPlanControllerShadow
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.multipart.MultipartFile
;
/**
/**
* @description: ExtPlan-Controller
* @description: ExtPlan-Controller
...
@@ -27,6 +32,30 @@ import org.springframework.stereotype.Controller;
...
@@ -27,6 +32,30 @@ import org.springframework.stereotype.Controller;
@Controller
(
ExtPlanController
.
BEAN_NAME
)
@Controller
(
ExtPlanController
.
BEAN_NAME
)
public
class
ExtPlanController
<
V
extends
ExtPlanVO
,
S
extends
ExtPlanService
<
V
>>
extends
ExtPlanControllerShadow
<
V
,
S
>
{
public
class
ExtPlanController
<
V
extends
ExtPlanVO
,
S
extends
ExtPlanService
<
V
>>
extends
ExtPlanControllerShadow
<
V
,
S
>
{
@Autowired
private
ExtPlanService
extPlanService
;
@ApiOperation
(
"下载计划模板"
)
@GetMapping
(
value
=
"/downloadTemplate"
)
public
void
downloadTemplate
(
HttpServletResponse
response
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
)
throws
IOException
{
extPlanService
.
downloadTemplate
(
response
,
name
);
}
/**
* 新增计划
*
* @param uploadFile
* @return
* @throws IOException
*/
@ApiOperation
(
"新增计划"
)
@PostMapping
(
value
=
"/insertPlan/{projectId}"
)
public
ApiResult
insertPlan
(
@RequestParam
(
"file"
)
MultipartFile
uploadFile
,
@PathVariable
(
"projectId"
)
Long
projectId
)
throws
IOException
{
ApiResult
apiResult
=
extPlanService
.
insertPlan
(
uploadFile
,
projectId
);
return
apiResult
;
}
}
}
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtPlanService.java
View file @
c41d2718
...
@@ -2,8 +2,12 @@ package com.yonde.dcs.plan.core.service;
...
@@ -2,8 +2,12 @@ package com.yonde.dcs.plan.core.service;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
com.yonde.dcs.plan.core.service.shadow.ExtPlanServiceShadow
;
import
com.yonde.dcs.plan.core.service.shadow.ExtPlanServiceShadow
;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -22,4 +26,21 @@ public interface ExtPlanService<V extends ExtPlanVO> extends ExtPlanServiceShado
...
@@ -22,4 +26,21 @@ public interface ExtPlanService<V extends ExtPlanVO> extends ExtPlanServiceShado
*/
*/
List
<
DxOrganizationVO
>
searchOrgNameByUserId
(
Long
userId
,
String
code
);
List
<
DxOrganizationVO
>
searchOrgNameByUserId
(
Long
userId
,
String
code
);
/**
* 导出计划
*
* @param response
* @param name
*/
void
downloadTemplate
(
HttpServletResponse
response
,
String
name
)
throws
IOException
;
/**
* 新增计划
*
* @param uploadFile
*/
ApiResult
insertPlan
(
MultipartFile
uploadFile
,
Long
projectId
);
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtPlanServiceImpl.java
View file @
c41d2718
This diff is collapsed.
Click to expand it.
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