Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qianhe-ydsj
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangyun
qianhe-ydsj
Commits
b0994c27
Commit
b0994c27
authored
Jul 31, 2024
by
tyk
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
f69f6df5
010835bf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
201 additions
and
62 deletions
+201
-62
qianhe-admin/src/main/java/com/qianhe/web/controller/system/SysUserController.java
+1
-1
qianhe-admin/src/main/resources/application-druid.yml
+5
-2
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfFjxbzController.java
+7
-7
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfKhpjbzController.java
+11
-7
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfZsdwfjxcjController.java
+18
-13
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfZsdwkhpjController.java
+0
-0
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfZsdwkhpjfjxController.java
+115
-7
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfZsdwwtcjController.java
+23
-13
qianhe-ydsj/src/main/java/com/qianhe/domain/SjZdbfZsdwkhpj.java
+8
-8
qianhe-ydsj/src/main/java/com/qianhe/domain/SjZdbfZsdwkhpjZb.java
+2
-2
qianhe-ydsj/src/main/java/com/qianhe/service/impl/SjZdbfZsdwkhpjServiceImpl.java
+8
-1
qianhe-ydsj/src/main/resources/mapper/SjZdbfKhpjbzMapper.xml
+2
-0
qianhe-ydsj/src/main/resources/mapper/SjZdbfZsdwkhpjZbMapper.xml
+1
-1
qianhe-ydsj/src/main/resources/static/zsdwfjx.xlsx
+0
-0
qianhe-ydsj/src/main/resources/static/zsdwkhpj.xlsx
+0
-0
No files found.
qianhe-admin/src/main/java/com/qianhe/web/controller/system/SysUserController.java
View file @
b0994c27
...
...
@@ -242,7 +242,7 @@ public class SysUserController extends BaseController
/**
* 获取部门树列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:user:list')"
)
//
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping
(
"/deptTree"
)
public
AjaxResult
deptTree
(
SysDept
dept
)
{
...
...
qianhe-admin/src/main/resources/application-druid.yml
View file @
b0994c27
...
...
@@ -6,9 +6,12 @@ spring:
druid
:
# 主库数据源
master
:
url
:
jdbc:mysql://1.116.38.25:3986/qianhe_ydsj?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
# url: jdbc:mysql://1.116.38.25:3986/qianhe_ydsj?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
# username: root
# password: qianhe2022
url
:
jdbc:mysql://192.168.31.167:3306/qianhe_ydsj?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
username
:
root
password
:
qianhe202
2
password
:
qianhe202
4
# 从库数据源
slave
:
# 从数据源开关/默认关闭
...
...
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfFjxbzController.java
View file @
b0994c27
...
...
@@ -40,7 +40,7 @@ public class SjZdbfFjxbzController extends BaseController
/**
* 查询指导帮扶-否决项标准列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfFjxbz:list')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfFjxbz:list')")
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SjZdbfFjxbz
sjZdbfFjxbz
)
{
...
...
@@ -51,7 +51,7 @@ public class SjZdbfFjxbzController extends BaseController
/**
* 查询指导帮扶-否决项标准列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfFjxbz:cxlist')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfFjxbz:cxlist')")
@GetMapping
(
"/cxlist"
)
public
TableDataInfo
cxlist
(
SjZdbfFjxbz
sjZdbfFjxbz
)
{
...
...
@@ -63,7 +63,7 @@ public class SjZdbfFjxbzController extends BaseController
/**
* 导出指导帮扶-否决项标准列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfFjxbz:export')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfFjxbz:export')")
@Log
(
title
=
"指导帮扶-否决项标准"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SjZdbfFjxbz
sjZdbfFjxbz
)
...
...
@@ -76,7 +76,7 @@ public class SjZdbfFjxbzController extends BaseController
/**
* 获取指导帮扶-否决项标准详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfFjxbz:query')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfFjxbz:query')")
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -86,7 +86,7 @@ public class SjZdbfFjxbzController extends BaseController
/**
* 新增指导帮扶-否决项标准
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfFjxbz:add')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfFjxbz:add')")
@Log
(
title
=
"指导帮扶-否决项标准"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
SjZdbfFjxbz
sjZdbfFjxbz
)
...
...
@@ -97,7 +97,7 @@ public class SjZdbfFjxbzController extends BaseController
/**
* 修改指导帮扶-否决项标准
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfFjxbz:edit')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfFjxbz:edit')")
@Log
(
title
=
"指导帮扶-否决项标准"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
SjZdbfFjxbz
sjZdbfFjxbz
)
...
...
@@ -108,7 +108,7 @@ public class SjZdbfFjxbzController extends BaseController
/**
* 删除指导帮扶-否决项标准
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfFjxbz:remove')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfFjxbz:remove')")
@Log
(
title
=
"指导帮扶-否决项标准"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
...
...
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfKhpjbzController.java
View file @
b0994c27
...
...
@@ -3,6 +3,7 @@ package com.qianhe.controller;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
com.qianhe.common.utils.StringUtils
;
import
com.qianhe.domain.SjZdbfKhpjbzCb
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -39,7 +40,7 @@ public class SjZdbfKhpjbzController extends BaseController
/**
* 查询指导帮扶-考核评价标准列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfKhpjbz:list')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfKhpjbz:list')")
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SjZdbfKhpjbz
sjZdbfKhpjbz
)
{
...
...
@@ -52,7 +53,7 @@ public class SjZdbfKhpjbzController extends BaseController
/**
* 查询指导帮扶-考核评价标准列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfKhpjbz:cxlist')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfKhpjbz:cxlist')")
@GetMapping
(
"/cxlist"
)
public
TableDataInfo
cxlist
(
SjZdbfKhpjbz
sjZdbfKhpjbz
)
{
...
...
@@ -64,7 +65,7 @@ public class SjZdbfKhpjbzController extends BaseController
/**
* 导出指导帮扶-考核评价标准列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfKhpjbz:export')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfKhpjbz:export')")
@Log
(
title
=
"指导帮扶-考核评价标准"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SjZdbfKhpjbz
sjZdbfKhpjbz
)
...
...
@@ -77,7 +78,7 @@ public class SjZdbfKhpjbzController extends BaseController
/**
* 获取指导帮扶-考核评价标准详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfKhpjbz:query')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfKhpjbz:query')")
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -87,7 +88,7 @@ public class SjZdbfKhpjbzController extends BaseController
/**
* 新增指导帮扶-考核评价标准
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfKhpjbz:add')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfKhpjbz:add')")
@Log
(
title
=
"指导帮扶-考核评价标准"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
SjZdbfKhpjbz
sjZdbfKhpjbz
)
...
...
@@ -98,7 +99,7 @@ public class SjZdbfKhpjbzController extends BaseController
/**
* 修改指导帮扶-考核评价标准
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfKhpjbz:edit')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfKhpjbz:edit')")
@Log
(
title
=
"指导帮扶-考核评价标准"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
SjZdbfKhpjbz
sjZdbfKhpjbz
)
...
...
@@ -109,7 +110,7 @@ public class SjZdbfKhpjbzController extends BaseController
/**
* 删除指导帮扶-考核评价标准
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfKhpjbz:remove')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfKhpjbz:remove')")
@Log
(
title
=
"指导帮扶-考核评价标准"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
...
...
@@ -127,6 +128,9 @@ public class SjZdbfKhpjbzController extends BaseController
String
nd
=
cb
.
getNd
();
cb
.
setNd
(
nd
.
substring
(
0
,
4
));
if
(
StringUtils
.
isEmpty
(
cb
.
getLx
())){
return
AjaxResult
.
error
(
"该单位未设置类型"
);
}
List
<
String
>
khnrList
=
sjZdbfKhpjbzService
.
getKhnrList
(
cb
);
return
success
(
khnrList
);
}
...
...
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfZsdwfjxcjController.java
View file @
b0994c27
...
...
@@ -5,11 +5,13 @@ import java.io.InputStream;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
com.qianhe.common.core.domain.entity.SysDept
;
import
com.qianhe.common.exception.BusinessException
;
import
com.qianhe.common.utils.DateUtils
;
import
com.qianhe.common.utils.StringUtils
;
import
com.qianhe.domain.SjZdbfFjxbzCb
;
import
com.qianhe.domain.SjZdbfKhpjbzCb
;
...
...
@@ -120,7 +122,7 @@ public class SjZdbfZsdwfjxcjController extends BaseController
/**
* 获取指导帮扶-直属单位否决项采集详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfZsdwfjxcj:query')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfZsdwfjxcj:query')")
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -161,7 +163,7 @@ public class SjZdbfZsdwfjxcjController extends BaseController
}
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfZsdwfjxcj:importData')"
)
@PostMapping
(
"/importData"
)
public
AjaxResult
importData
(
MultipartFile
file
,
boolean
updateSupport
)
throws
Exception
{
...
...
@@ -188,41 +190,45 @@ public class SjZdbfZsdwfjxcjController extends BaseController
//日期
String
rq
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
1
));
if
(
StringUtils
.
isEmpty
(
rq
)){
return
AjaxResult
.
error
(
"导入失败,日期不能为空"
);
return
AjaxResult
.
error
(
"导入失败,第"
+(
i
+
1
)+
"行日期不能为空"
);
}
Date
date
=
DateUtils
.
parseDate
(
rq
);
if
(
date
==
null
){
return
AjaxResult
.
error
(
"导入失败,第"
+(
i
+
1
)+
"行日期格式错误"
);
}
zsdwwtcj
.
setRq
(
rq
);
zsdwwtcj
.
setRq
(
DateUtils
.
parseDateToStr
(
"yyyy-MM"
,
date
));
//单位
String
dw
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
2
))
;
if
(
StringUtils
.
isEmpty
(
dw
)){
return
AjaxResult
.
error
(
"导入失败,单位不能为空"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
单位不能为空"
);
}
//查询单位id
String
[]
split
=
dw
.
split
(
"/"
);
if
(
split
.
length
<
2
){
return
AjaxResult
.
error
(
"导入失败,输入的单位格式有误!"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
输入的单位格式有误!"
);
}
String
ejdw
=
split
[
0
];
SysDept
ejdept
=
deptList
.
stream
().
filter
(
dept
->
dept
.
getDeptName
().
equals
(
ejdw
)).
findFirst
().
orElse
(
null
);
if
(
ejdept
==
null
){
return
AjaxResult
.
error
(
"导入失败,未匹配到二级单位"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
未匹配到二级单位"
);
}
String
sjdw
=
split
[
1
];
SysDept
sjdept
=
deptList
.
stream
().
filter
(
dept
->
dept
.
getDeptName
().
equals
(
sjdw
)
&&
dept
.
getParentId
().
equals
(
ejdept
.
getDeptId
())).
findFirst
().
orElse
(
null
);
if
(
sjdept
==
null
){
return
AjaxResult
.
error
(
"导入失败,未匹配到三级单位"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
未匹配到三级单位"
);
}
zsdwwtcj
.
setDeptId
(
sjdept
.
getDeptId
());
//分类名称
String
flmc
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
3
))
;
if
(
StringUtils
.
isEmpty
(
flmc
)){
return
AjaxResult
.
error
(
"导入失败,分类名称不能为空"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
分类名称不能为空"
);
}
zsdwwtcj
.
setFlmc
(
flmc
);
//评价标准
String
pjbz
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
4
))
;
if
(
StringUtils
.
isEmpty
(
pjbz
)){
return
AjaxResult
.
error
(
"导入失败,评价标准不能为空"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
评价标准不能为空"
);
}
//匹配评价标准
String
substring
=
pjbz
.
substring
(
4
);
...
...
@@ -233,13 +239,12 @@ public class SjZdbfZsdwfjxcjController extends BaseController
sjZdbfFjxbzCb
.
setNd
(
rq
.
substring
(
0
,
4
));
SjZdbfFjxbzCb
cb
=
sjZdbfFjxbzMapper
.
selectSjZdbfFjxbzCb
(
sjZdbfFjxbzCb
);
if
(
cb
==
null
){
return
AjaxResult
.
error
(
"导入失败,未匹配到评价标准"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
未匹配到评价标准"
);
}
zsdwwtcj
.
setPjbzid
(
cb
.
getId
()+
""
);
zsdwwtcj
.
setPjbzmc
(
cb
.
getPjbz
());
String
wtms
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
5
))
;
zsdwwtcj
.
setWtmc
(
wtms
);
list
.
add
(
zsdwwtcj
);
}
if
(
list
.
size
()>
0
){
...
...
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfZsdwkhpjController.java
View file @
b0994c27
This diff is collapsed.
Click to expand it.
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfZsdwkhpjfjxController.java
View file @
b0994c27
package
com
.
qianhe
.
controller
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletResponse
;
import
com.qianhe.common.exception.BusinessException
;
import
com.qianhe.common.utils.StringUtils
;
import
com.qianhe.domain.SjZdbfZsdwkhpj
;
import
org.apache.poi.ss.usermodel.DataFormatter
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.ss.util.CellRangeAddress
;
import
org.apache.poi.xssf.usermodel.XSSFRow
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.http.MediaType
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -60,20 +67,121 @@ public class SjZdbfZsdwkhpjfjxController extends BaseController
/**
* 导出指导帮扶-直属单位考核评价否决项列表
*/
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfZsdwkhpjfjx:export')")
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfZsdwkhpjfjx:export')"
)
@Log
(
title
=
"指导帮扶-直属单位考核评价否决项"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SjZdbfZsdwkhpjfjx
sjZdbfZsdwkhpjfjx
)
{
List
<
SjZdbfZsdwkhpjfjx
>
list
=
sjZdbfZsdwkhpjfjxService
.
selectSjZdbfZsdwkhpjfjxList
(
sjZdbfZsdwkhpjfjx
);
ExcelUtil
<
SjZdbfZsdwkhpjfjx
>
util
=
new
ExcelUtil
<
SjZdbfZsdwkhpjfjx
>(
SjZdbfZsdwkhpjfjx
.
class
);
util
.
exportExcel
(
response
,
list
,
"指导帮扶-直属单位考核评价否决项数据"
);
Workbook
exl
=
null
;
OutputStream
out
=
null
;
InputStream
in
=
null
;
try
{
in
=
this
.
getClass
().
getResourceAsStream
(
"/static/zsdwfjx.xlsx"
);
exl
=
WorkbookFactory
.
create
(
in
);
out
=
response
.
getOutputStream
();
response
.
reset
();
String
filename
=
URLEncoder
.
encode
(
"否决项.xlsx"
,
"UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
filename
);
response
.
setContentType
(
MediaType
.
APPLICATION_OCTET_STREAM_VALUE
);
Sheet
sheet
=
exl
.
getSheet
(
"Sheet1"
);
// sheet.getRow(0).getCell(0).setCellValue(sjZdbfZsdwkhpj.getNd()+"年"+sjZdbfZsdwkhpj.getZqfw()+sjZdbfZsdwkhpj.getDeptName());
CellStyle
cellStyle
=
exl
.
createCellStyle
();
cellStyle
.
setWrapText
(
true
);
cellStyle
.
setAlignment
(
HorizontalAlignment
.
LEFT
);
cellStyle
.
setVerticalAlignment
(
VerticalAlignment
.
CENTER
);
cellStyle
.
setBorderBottom
(
BorderStyle
.
THIN
);
cellStyle
.
setBottomBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
cellStyle
.
setBorderLeft
(
BorderStyle
.
THIN
);
cellStyle
.
setLeftBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
cellStyle
.
setBorderRight
(
BorderStyle
.
THIN
);
cellStyle
.
setRightBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
cellStyle
.
setBorderTop
(
BorderStyle
.
THIN
);
cellStyle
.
setTopBorderColor
(
IndexedColors
.
BLACK
.
getIndex
());
String
deptName
=
""
;
int
lastRow
=
sheet
.
getLastRowNum
()+
1
;
for
(
SjZdbfZsdwkhpjfjx
zsdwkhpj:
list
){
deptName
=
zsdwkhpj
.
getDeptName
();;
Row
row
=
sheet
.
createRow
(
lastRow
);
row
.
setHeightInPoints
(
18
);
int
m
=
0
;
Cell
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getFlmc
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getPjbzmc
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getSffs
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getWtms
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getId
());
cell
=
row
.
createCell
(
m
++);
cell
.
setCellStyle
(
cellStyle
);
cell
.
setCellValue
(
zsdwkhpj
.
getZbId
());
lastRow
++;
}
//合并行
mergeCellsByColumn
(
sheet
,
0
);
sheet
.
getRow
(
0
).
getCell
(
0
).
setCellValue
(
sjZdbfZsdwkhpjfjx
.
getNd
()+
sjZdbfZsdwkhpjfjx
.
getZqfw
()+
deptName
+
"否决项评价"
);
exl
.
write
(
out
);
exl
.
close
();
}
catch
(
Exception
e
){
e
.
getMessage
();
throw
new
BusinessException
(
"导出Excel失败,请联系网站管理员!"
);
}
finally
{
if
(
exl
!=
null
)
{
try
{
exl
.
close
();
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
}
if
(
out
!=
null
)
{
try
{
out
.
close
();
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
}
}
}
// 根据某一列的值是否相同,对其他列的单元格进行合并
private
static
void
mergeCellsByColumn
(
Sheet
sheet
,
int
columnIndex
)
{
Map
<
String
,
Integer
>
groups
=
new
HashMap
<>();
// 遍历该列,记录相同值的行索引
int
start
=
1
;
int
end
=
1
;
String
old
=
""
;
for
(
int
i
=
1
;
i
<=
sheet
.
getLastRowNum
();
i
++)
{
Row
row
=
sheet
.
getRow
(
i
);
Cell
cell
=
row
.
getCell
(
columnIndex
);
String
cellValue
=
cell
.
getStringCellValue
();
if
(!
groups
.
containsKey
(
cellValue
))
{
if
(
groups
.
get
(
old
)!=
null
){
start
=
groups
.
get
(
old
);
}
old
=
cellValue
;
groups
.
put
(
cellValue
,
i
);
//合并行
mergeCellsInRange
(
sheet
,
columnIndex
,
start
,
end
);
start
=
i
;
end
=
i
;
}
else
{
end
++;
if
(
i
==
sheet
.
getLastRowNum
()){
mergeCellsInRange
(
sheet
,
columnIndex
,
start
,
end
);
}
}
}
}
// 合并指定范围内的单元格
private
static
void
mergeCellsInRange
(
Sheet
sheet
,
int
columnIndex
,
int
startIndex
,
int
endIndex
)
{
if
(
startIndex
!=
endIndex
){
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
startIndex
,
endIndex
,
columnIndex
,
columnIndex
));
}
}
/**
* 获取指导帮扶-直属单位考核评价否决项详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfZsdwkhpjfjx:query')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfZsdwkhpjfjx:query')")
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -116,7 +224,7 @@ public class SjZdbfZsdwkhpjfjxController extends BaseController
/**
* 修改指导帮扶-直属单位考核评价否决项
*/
// @PreAuthorize("@ss.hasPermi('system:sjZdbfZsdwkhpjfjx:
edit')")
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfZsdwkhpjfjx:pl
edit')"
)
@Log
(
title
=
"指导帮扶-直属单位考核评价否决项"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
(
"/pledit"
)
public
AjaxResult
pledit
(
@RequestBody
List
<
SjZdbfZsdwkhpjfjx
>
list
)
...
...
@@ -124,7 +232,7 @@ public class SjZdbfZsdwkhpjfjxController extends BaseController
return
toAjax
(
sjZdbfZsdwkhpjfjxService
.
pledit
(
list
));
}
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfZsdwkhpjfjx:importData')"
)
@PostMapping
(
"/importData"
)
public
AjaxResult
importData
(
MultipartFile
file
,
boolean
updateSupport
)
throws
Exception
{
...
...
qianhe-ydsj/src/main/java/com/qianhe/controller/SjZdbfZsdwwtcjController.java
View file @
b0994c27
...
...
@@ -5,11 +5,13 @@ import java.io.InputStream;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
com.qianhe.common.core.domain.entity.SysDept
;
import
com.qianhe.common.exception.BusinessException
;
import
com.qianhe.common.utils.DateUtils
;
import
com.qianhe.common.utils.StringUtils
;
import
com.qianhe.domain.SjZdbfKhpjbz
;
import
com.qianhe.domain.SjZdbfKhpjbzCb
;
...
...
@@ -118,7 +120,7 @@ public class SjZdbfZsdwwtcjController extends BaseController
/**
* 获取指导帮扶-直属单位问题采集详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfZsdwwtcj:query')"
)
//
@PreAuthorize("@ss.hasPermi('system:sjZdbfZsdwwtcj:query')")
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -160,7 +162,7 @@ public class SjZdbfZsdwwtcjController extends BaseController
}
@PreAuthorize
(
"@ss.hasPermi('system:sjZdbfZsdwwtcj:importData')"
)
@PostMapping
(
"/importData"
)
public
AjaxResult
importData
(
MultipartFile
file
,
boolean
updateSupport
)
throws
Exception
{
...
...
@@ -187,51 +189,56 @@ public class SjZdbfZsdwwtcjController extends BaseController
//日期
String
rq
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
1
));
if
(
StringUtils
.
isEmpty
(
rq
)){
return
AjaxResult
.
error
(
"导入失败,日期不能为空"
);
return
AjaxResult
.
error
(
"导入失败,第"
+(
i
+
1
)+
"行日期不能为空"
);
}
Date
date
=
DateUtils
.
parseDate
(
rq
);
if
(
date
==
null
){
return
AjaxResult
.
error
(
"导入失败,第"
+(
i
+
1
)+
"行日期格式错误"
);
}
zsdwwtcj
.
setRq
(
rq
);
zsdwwtcj
.
setRq
(
DateUtils
.
parseDateToStr
(
"yyyy-MM"
,
date
)
);
//单位
String
dw
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
2
))
;
if
(
StringUtils
.
isEmpty
(
dw
)){
return
AjaxResult
.
error
(
"导入失败,单位不能为空"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
单位不能为空"
);
}
//查询单位id
String
[]
split
=
dw
.
split
(
"/"
);
if
(
split
.
length
<
2
){
return
AjaxResult
.
error
(
"导入失败,输入的单位格式有误!"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
输入的单位格式有误!"
);
}
String
ejdw
=
split
[
0
];
SysDept
ejdept
=
deptList
.
stream
().
filter
(
dept
->
dept
.
getDeptName
().
equals
(
ejdw
)).
findFirst
().
orElse
(
null
);
if
(
ejdept
==
null
){
return
AjaxResult
.
error
(
"导入失败,未匹配到二级单位"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
未匹配到二级单位"
);
}
String
sjdw
=
split
[
1
];
SysDept
sjdept
=
deptList
.
stream
().
filter
(
dept
->
dept
.
getDeptName
().
equals
(
sjdw
)
&&
dept
.
getParentId
().
equals
(
ejdept
.
getDeptId
())).
findFirst
().
orElse
(
null
);
if
(
sjdept
==
null
){
return
AjaxResult
.
error
(
"导入失败,未匹配到三级单位"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
未匹配到三级单位"
);
}
zsdwwtcj
.
setDeptId
(
sjdept
.
getDeptId
());
//问题描述
String
wtms
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
3
))
;
if
(
StringUtils
.
isEmpty
(
wtms
)){
return
AjaxResult
.
error
(
"导入失败,问题描述不能为空"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
问题描述不能为空"
);
}
zsdwwtcj
.
setWtmc
(
wtms
);
//考核内容
String
khnr
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
4
))
;
if
(
StringUtils
.
isEmpty
(
khnr
)){
return
AjaxResult
.
error
(
"导入失败,考核内容不能为空"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
考核内容不能为空"
);
}
zsdwwtcj
.
setKhnr
(
khnr
);
//考核项点
String
khxd
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
5
))
;
if
(
StringUtils
.
isEmpty
(
khxd
)){
return
AjaxResult
.
error
(
"导入失败,考核项点不能为空"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
考核项点不能为空"
);
}
zsdwwtcj
.
setKhxd
(
khxd
);
String
pjbz
=
new
DataFormatter
().
formatCellValue
(
row
.
getCell
(
6
))
;
if
(
StringUtils
.
isEmpty
(
pjbz
)){
return
AjaxResult
.
error
(
"导入失败,评价标准不能为空"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
评价标准不能为空"
);
}
//匹配评价标准
String
substring
=
pjbz
.
substring
(
4
);
...
...
@@ -240,11 +247,14 @@ public class SjZdbfZsdwwtcjController extends BaseController
sjZdbfKhpjbzCb
.
setKhxd
(
khxd
);
sjZdbfKhpjbzCb
.
setKhnr
(
khnr
);
sjZdbfKhpjbzCb
.
setLx
(
sjdept
.
getDeptLx
());
if
(
StringUtils
.
isEmpty
(
sjdept
.
getDeptLx
())){
return
AjaxResult
.
error
(
"导入失败,第"
+(
i
+
1
)+
"行单位未设置类型"
);
}
sjZdbfKhpjbzCb
.
setPx
(
l
);
sjZdbfKhpjbzCb
.
setNd
(
rq
.
substring
(
0
,
4
));
SjZdbfKhpjbzCb
cb
=
sjZdbfKhpjbzMapper
.
selectSjZdbfKhpjbzCb
(
sjZdbfKhpjbzCb
);
if
(
cb
==
null
){
return
AjaxResult
.
error
(
"导入失败,未匹配到评价标准"
);
return
AjaxResult
.
error
(
"导入失败,
第"
+(
i
+
1
)+
"行
未匹配到评价标准"
);
}
zsdwwtcj
.
setPjbzid
(
cb
.
getId
()+
""
);
zsdwwtcj
.
setPjbzmc
(
cb
.
getPjbz
());
...
...
qianhe-ydsj/src/main/java/com/qianhe/domain/SjZdbfZsdwkhpj.java
View file @
b0994c27
...
...
@@ -19,14 +19,14 @@ public class SjZdbfZsdwkhpj extends BaseEntity
private
static
final
long
serialVersionUID
=
1L
;
@Excel
(
name
=
"单位名称"
)
//
@Excel(name = "单位名称")
private
String
deptName
;
/** 年度 */
@Excel
(
name
=
"年度"
)
//
@Excel(name = "年度")
private
String
nd
;
/** 周期范围(第一季度-第四季度、上半年、下半年) */
@Excel
(
name
=
"周期范围"
)
//
@Excel(name = "周期范围")
private
String
zqfw
;
/** 周期类型(季度、半年度、年度) */
...
...
@@ -38,17 +38,17 @@ public class SjZdbfZsdwkhpj extends BaseEntity
private
String
jb
;
/** 考核内容 */
@Excel
(
name
=
"考核内容"
)
@Excel
(
name
=
"考核内容"
,
needMerge
=
true
)
private
String
khnr
;
/** 考核项点 */
@Excel
(
name
=
"考核项点"
)
@Excel
(
name
=
"考核项点"
,
needMerge
=
true
)
private
String
khxd
;
/** 评价标准名称 */
@Excel
(
name
=
"评价标准
名称
"
)
@Excel
(
name
=
"评价标准"
)
private
String
pjbzmc
;
/** 数量 */
...
...
@@ -92,10 +92,10 @@ public class SjZdbfZsdwkhpj extends BaseEntity
private
Long
zbId
;
/** 单位id */
@Excel
(
name
=
"单位id(勿动)"
,
headerColor
=
IndexedColors
.
RED1
)
//
@Excel(name = "单位id(勿动)",headerColor= IndexedColors.RED1)
private
Long
deptId
;
/** 评价标准id */
@Excel
(
name
=
"评价标准id"
)
//
@Excel(name = "评价标准id")
private
String
pjbzid
;
}
qianhe-ydsj/src/main/java/com/qianhe/domain/SjZdbfZsdwkhpjZb.java
View file @
b0994c27
...
...
@@ -39,11 +39,11 @@ public class SjZdbfZsdwkhpjZb extends BaseEntity
private
String
nd
;
/** 周期范围(第一季度-第四季度、上半年、下半年) */
@Excel
(
name
=
"周期范围"
)
//
@Excel(name = "周期范围")
private
String
zqfw
;
/** 周期类型(季度、半年度、年度) */
@Excel
(
name
=
"周期类型"
)
//
@Excel(name = "周期类型")
private
String
zqlx
;
/** 级别(直属单位(半年度)、基层单位(季度)、三基帮扶组(年度)) */
...
...
qianhe-ydsj/src/main/java/com/qianhe/service/impl/SjZdbfZsdwkhpjServiceImpl.java
View file @
b0994c27
...
...
@@ -201,12 +201,19 @@ public class SjZdbfZsdwkhpjServiceImpl implements ISjZdbfZsdwkhpjService
sjZdbfZsdwkhpjZb
.
setZhdf
(
sunfs
.
multiply
(
new
BigDecimal
(
0.9
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
}
else
if
(
"C类"
.
equals
(
deptDfl
))
{
sjZdbfZsdwkhpjZb
.
setZhdf
(
sunfs
.
multiply
(
new
BigDecimal
(
0.85
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
}
}
else
{
sjZdbfZsdwkhpjZb
.
setZhdf
(
sunfs
);
}
}
//更新主表
sjZdbfZsdwkhpjZbMapper
.
updateSjZdbfZsdwkhpjZb
(
sjZdbfZsdwkhpjZb
);
return
sjZdbfZsdwkhpjMapper
.
pledit
(
list
);
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
Double
.
parseDouble
(
"-5"
));
System
.
out
.
println
(
Double
.
parseDouble
(
"+5"
));
}
}
qianhe-ydsj/src/main/resources/mapper/SjZdbfKhpjbzMapper.xml
View file @
b0994c27
...
...
@@ -99,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where 1=1
<if
test=
"khnr != null and khnr != ''"
>
and khnr = #{khnr}
</if>
<if
test=
"nd != null and nd != ''"
>
and nd = #{nd}
</if>
<if
test=
"lx != null and lx != ''"
>
and lx = #{lx}
</if>
</select>
<select
id=
"getPjbzList"
resultType=
"com.qianhe.domain.SjZdbfKhpjbzCb"
>
...
...
@@ -106,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where 1=1
<if
test=
"khxd != null and khxd != ''"
>
and khxd = #{khxd}
</if>
<if
test=
"nd != null and nd != ''"
>
and nd = #{nd}
</if>
<if
test=
"lx != null and lx != ''"
>
and lx = #{lx}
</if>
</select>
<select
id=
"selectSjZdbfKhpjbzCb"
resultType=
"com.qianhe.domain.SjZdbfKhpjbzCb"
>
select * from sj_zdbf_khpjbz_cb where lx=#{lx} and khnr=#{khnr} and khxd=#{khxd} and px=#{px} and nd=#{nd}
...
...
qianhe-ydsj/src/main/resources/mapper/SjZdbfZsdwkhpjZbMapper.xml
View file @
b0994c27
...
...
@@ -142,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
order by zhdf desc
</select>
<select
id=
"selectSjZdbfZsdwkhpjZbById"
parameterType=
"Long"
resultMap=
"SjZdbfZsdwkhpjZbResult"
>
...
...
qianhe-ydsj/src/main/resources/static/zsdwfjx.xlsx
0 → 100644
View file @
b0994c27
File added
qianhe-ydsj/src/main/resources/static/zsdwkhpj.xlsx
0 → 100644
View file @
b0994c27
File added
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