Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Y
YX_IDENT_REFACTORING
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
zhangyusheng
YX_IDENT_REFACTORING
Commits
d16f6b79
Commit
d16f6b79
authored
Nov 19, 2018
by
liboyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整合完成
parent
5d871a1d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
868 additions
and
33 deletions
+868
-33
pom.xml
pom.xml
+1
-5
AdminApi.java
src/main/java/com/yxproject/start/api/AdminApi.java
+6
-13
UserApi.java
src/main/java/com/yxproject/start/api/UserApi.java
+860
-13
MyShiroRealm.java
src/main/java/com/yxproject/start/config/MyShiroRealm.java
+0
-1
PoliceStationVailedMapper.java
...com/yxproject/start/mapper/PoliceStationVailedMapper.java
+1
-1
No files found.
pom.xml
View file @
d16f6b79
...
...
@@ -29,11 +29,7 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<!--引入jersey作为http rest接口实现-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jersey
</artifactId>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
...
...
src/main/java/com/yxproject/start/api/AdminApi.java
View file @
d16f6b79
package
com
.
yxproject
.
start
.
api
;
import
com.yxproject.start.entity.*
;
import
com.yxproject.start.service.ProductionTaskListService
;
import
com.yxproject.start.entity.SysPermission
;
import
com.yxproject.start.entity.SysRole
;
import
com.yxproject.start.entity.UserInfo
;
import
com.yxproject.start.service.SysPermissionService
;
import
com.yxproject.start.service.SysRoleService
;
import
com.yxproject.start.service.UserInfoService
;
import
com.yxproject.start.utils.Md5Utils
;
import
com.yxproject.start.utils.YXJSONResponse
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.authc.IncorrectCredentialsException
;
import
org.apache.shiro.authc.UnknownAccountException
;
import
org.apache.shiro.authc.UsernamePasswordToken
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresRoles
;
import
org.apache.shiro.subject.Subject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.ws.rs.POST
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
/**
...
...
src/main/java/com/yxproject/start/api/UserApi.java
View file @
d16f6b79
...
...
@@ -5,6 +5,9 @@ import com.yxproject.start.service.*;
import
com.yxproject.start.utils.YXJSONResponse
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.apache.poi.hssf.usermodel.*
;
import
org.apache.poi.ss.util.CellRangeAddress
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.authc.IncorrectCredentialsException
;
import
org.apache.shiro.authc.UnknownAccountException
;
...
...
@@ -13,10 +16,11 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import
org.apache.shiro.subject.Subject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
/**
* @author Administrator
...
...
@@ -29,10 +33,10 @@ public class UserApi {
@Autowired
private
UserInfoService
userInf
oService
;
private
GroupNoService
groupN
oService
;
@Autowired
private
SysRoleService
sysRole
Service
;
private
PoliceStationApplyReasonService
policeStationApplyReason
Service
;
@Autowired
private
SysPermissionService
sysPermissionService
;
...
...
@@ -81,7 +85,7 @@ public class UserApi {
*/
@RequestMapping
(
value
=
"/getProductionTaskListByID"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
String
getProductionTaskListByID
(
@RequestParam
(
"id"
)
String
id
,
@Context
HttpServletResponse
resp
)
{
public
String
getProductionTaskListByID
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
)
{
List
<
TaskEntity
>
productionTaskListEntity
=
taskService
.
findProductionTaskListEntityByID
(
Long
.
valueOf
(
id
));
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
...
...
@@ -99,7 +103,7 @@ public class UserApi {
@RequestMapping
(
value
=
"/updateProductionTask"
,
method
=
RequestMethod
.
GET
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
@ResponseBody
public
String
updateProductionTask
(
@RequestParam
(
"id"
)
String
id
,
@Context
HttpServletResponse
resp
)
{
public
String
updateProductionTask
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
)
{
String
map
=
"{\"production_Task_List_Id\":\"20181016001\",\"make_Type\":8,\"old_Make_Type\":8,} "
;
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
map
);
TaskEntity
productionTaskListEntity
=
(
TaskEntity
)
jsonObject
.
toBean
(
jsonObject
,
TaskEntity
.
class
);
...
...
@@ -118,7 +122,7 @@ public class UserApi {
@RequestMapping
(
value
=
"/addProductionTaskList"
,
method
=
RequestMethod
.
GET
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
@ResponseBody
public
String
addProductionTaskList
(
@RequestParam
(
"id"
)
String
id
,
@Context
HttpServletResponse
resp
)
{
public
String
addProductionTaskList
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
)
{
String
map
=
"{\"productionTaskListId\":\"20181016001\",\"makeType\":4,\"oldMakeType\":7}"
;
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
map
);
Object
taskList
=
jsonObject
.
get
(
"taskList"
);
...
...
@@ -140,7 +144,7 @@ public class UserApi {
@RequestMapping
(
value
=
"/findCardInfoByCardIDOrAcceptNo"
,
method
=
RequestMethod
.
GET
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
@ResponseBody
public
String
findCardInfoByCardIDOrAcceptNo
(
@RequestParam
(
"id"
)
String
id
,
@Context
HttpServletResponse
resp
)
{
public
String
findCardInfoByCardIDOrAcceptNo
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
)
{
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
...
...
@@ -156,7 +160,7 @@ public class UserApi {
@RequestMapping
(
value
=
"/addQuickCyclesheetInfo"
,
method
=
RequestMethod
.
GET
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
@ResponseBody
public
String
addQuickCyclesheetInfo
(
@RequestParam
(
"id"
)
String
id
,
@Context
HttpServletResponse
resp
)
{
public
String
addQuickCyclesheetInfo
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
)
{
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
...
...
@@ -173,7 +177,7 @@ public class UserApi {
@RequestMapping
(
value
=
"/savePoliceStationVailedInfoEntity"
,
method
=
RequestMethod
.
GET
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
@ResponseBody
public
String
savePoliceStationVailedInfoEntity
(
@RequestParam
(
"id"
)
String
id
,
@Context
HttpServletResponse
resp
)
{
public
String
savePoliceStationVailedInfoEntity
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
)
{
String
map
=
"[{\"cyclesheetid\":\"20181016001\",\"invalid_Count\":1,\"police_Station_Code\":\"41108201\",\"police_Station_Vailed_Info_Id\":\"1\",\"sava_Date\":\"20181025\",\"vailed_Count\":1}]"
;
JSONArray
jsonArray
=
JSONArray
.
fromObject
(
map
);
List
<
PoliceStationVailedEntity
>
policeStationVailedInfoEntities
=
new
ArrayList
<>();
...
...
@@ -197,7 +201,8 @@ public class UserApi {
@RequestMapping
(
"/test"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
@ResponseBody
public
String
test
(
@RequestParam
(
"id"
)
String
permissionId
,
@Context
HttpServletResponse
resp
)
{
public
String
test
(
@RequestParam
(
"id"
)
String
permissionId
,
HttpServletResponse
resp
)
{
//TODO
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
List
<
PoliceStationVailedEntity
>
policeStationVailedEntities
=
taskService
.
find
(
permissionId
);
...
...
@@ -206,5 +211,847 @@ public class UserApi {
return
yxjsonResponse
.
toJSONString
();
}
/**
* 保存废证详情;
* @return
*/
@RequestMapping
(
"addFailedinfo"
)
public
String
addFailedinfo
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
){
String
map
=
"[{\"failedinfoid\":\"20181016002\",\"failed_Reason\":1,\"groupno\":\"41108201\",\"cyclesheetid\":\"20181016001\"}]"
;
JSONArray
jsonArray
=
JSONArray
.
fromObject
(
map
);
List
<
FailedCardEntity
>
failedinfoEntityList
=
new
ArrayList
<>();
for
(
Object
object:
jsonArray
)
{
FailedCardEntity
o
=
(
FailedCardEntity
)
JSONObject
.
toBean
((
JSONObject
)
object
,
FailedCardEntity
.
class
);
failedinfoEntityList
.
add
(
o
);
}
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
int
i
=
failedCardService
.
saveFailedinfo
(
failedinfoEntityList
);
yxjsonResponse
.
outPutSuccess
(
i
+
"添加成功"
);
return
yxjsonResponse
.
toJSONString
();
}
/**
* 更新废证详情;
* @return
*/
@RequestMapping
(
"updateFailedinfo"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
updateFailedinfo
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
){
String
map
=
"[{\"failedinfoid\":\"201810302\",\"failed_Reason\":1,\"groupno\":\"411081\",\"cyclesheetid\":\"20181016001\"}]"
;
JSONArray
jsonArray
=
JSONArray
.
fromObject
(
map
);
List
<
FailedCardEntity
>
failedinfoEntityList
=
new
ArrayList
<>();
for
(
Object
object:
jsonArray
)
{
FailedCardEntity
o
=
(
FailedCardEntity
)
JSONObject
.
toBean
((
JSONObject
)
object
,
FailedCardEntity
.
class
);
failedinfoEntityList
.
add
(
o
);
}
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
int
i
=
failedCardService
.
updateFailedinfo
(
failedinfoEntityList
);
yxjsonResponse
.
outPutSuccess
(
i
+
"更新成功"
);
return
yxjsonResponse
.
toJSONString
();
}
/**
* 查询废证详情;
* @return
*/
@RequestMapping
(
"findFailedinfo"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
findFailedinfo
(
@RequestParam
(
"id"
)
String
id
,
HttpServletResponse
resp
){
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
List
<
Map
<
String
,
Object
>>
maps
=
failedCardService
.
selectFailedinfo
(
Integer
.
valueOf
(
id
));
yxjsonResponse
.
outPutSuccess
(
maps
+
"------添加成功---"
+
maps
.
size
());
return
yxjsonResponse
.
toJSONString
();
}
/**
* 查询任务单详情;
* @return
*/
@RequestMapping
(
"findProductionTaskListByState"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
findProductionTaskListByState
(
@RequestParam
(
"state"
)
String
state
,
HttpServletResponse
resp
){
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
List
<
Map
<
String
,
Object
>>
productionTaskInfoList
=
taskService
.
findProductionTaskListEntityByState
(
Integer
.
valueOf
(
state
));
yxjsonResponse
.
outPutSuccess
(
productionTaskInfoList
);
return
yxjsonResponse
.
toJSONString
();
}
/**
* 查询区县列表详情;
* @return
*/
@RequestMapping
(
"findProdCountyList"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
findProdCountyList
(
@RequestParam
(
"cyclesheetID"
)
String
cyclesheetID
,
HttpServletResponse
resp
){
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
List
<
Map
<
String
,
Object
>>
countyInfoList
=
groupNoService
.
findCountyInfoList
(
cyclesheetID
);
yxjsonResponse
.
outPutSuccess
(
countyInfoList
);
return
yxjsonResponse
.
toJSONString
();
}
/**
* 保存派出所申请类型数量;
* @return
*/
@RequestMapping
(
"savePoliceApplyCount"
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
savePoliceApplyCount
(
@RequestParam
(
"cyclesheetID"
)
String
cyclesheetID
,
HttpServletResponse
resp
){
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
int
i
=
policeStationApplyReasonService
.
savePoliceStationApplyReasonEntity
(
cyclesheetID
);
yxjsonResponse
.
outPutSuccess
(
i
+
""
);
return
yxjsonResponse
.
toJSONString
();
}
/**
* 下载装箱单
*/
@RequestMapping
(
"printPackingList"
)
// @RequiresPermissions("userInfo.add")//权限管理;
public
byte
[]
printPackingList
(
@RequestParam
(
"cyclesheetID"
)
String
taskID
,
HttpServletResponse
response
)
{
// cyclesheetID ="20180802032";
response
.
setContentType
(
"application/x-download"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
String
dateTime
=
DateFormatUtils
.
format
(
new
Date
(),
"yyyyMMddHH"
);
// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String
fout
=
null
;
List
<
Map
<
String
,
Object
>>
countyInfoList
=
groupNoService
.
findCountyInfoList
(
taskID
);
List
<
TaskEntity
>
taskEntities
=
taskService
.
findProductionTaskListEntityByID
(
Long
.
valueOf
(
taskID
));
fout
=
exportExcel
(
countyInfoList
,
taskEntities
.
get
(
0
).
getCard_Type
()+
""
,
"p1"
,
6000
,
taskEntities
.
get
(
0
).
getCitycode
()
,
dateTime
,
taskID
);
String
outFile
=
dateTime
+
taskEntities
.
get
(
0
).
getCitycode
()
+
"二代身份证统计表"
;
try
{
FileInputStream
fis
=
new
FileInputStream
(
new
File
(
fout
));
byte
[]
b
=
new
byte
[
fis
.
available
()];
fis
.
read
(
b
);
fis
.
close
();
response
.
addHeader
(
"Content-Disposition"
,
"attachment;filename="
+
outFile
+
".xls"
);
return
b
;
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
/**
* 下载装箱单
*
* @param countyInfoList 装箱单信息
* @param typeName 制证类型
* @param workShop 制证车间
* @param sum 总数
* @param cityName 地市
*/
private
String
exportExcel
(
List
<
Map
<
String
,
Object
>>
countyInfoList
,
String
typeName
,
String
workShop
,
int
sum
,
String
cityName
,
String
permanentPositionDate
,
String
cyclesheetid
)
{
if
(
typeName
.
contains
(
"null"
)){
typeName
=
typeName
.
replace
(
"null"
,
""
);
}
//第一步创建workbook
HSSFWorkbook
wb
=
new
HSSFWorkbook
();
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
HSSFSheet
sheet
=
wb
.
createSheet
(
"二代身份证统计表"
);
sheet
.
setColumnWidth
(
0
,
(
int
)
30
*
100
);
sheet
.
setColumnWidth
(
1
,
(
int
)
30
*
70
);
sheet
.
setColumnWidth
(
2
,
(
int
)
30
*
80
);
sheet
.
setColumnWidth
(
3
,
(
int
)
30
*
50
);
sheet
.
setColumnWidth
(
4
,
(
int
)
30
*
110
);
HSSFPrintSetup
ps
=
sheet
.
getPrintSetup
();
ps
.
setLandscape
(
true
);
// 打印方向,true:横向,false:纵向
ps
.
setPaperSize
(
HSSFPrintSetup
.
B5_PAPERSIZE
);
//纸张
sheet
.
setColumnWidth
(
0
,
(
int
)
35.7
*
100
);
//第三步创建行row:添加表头0行
HSSFRow
row
=
sheet
.
createRow
(
0
);
HSSFCellStyle
style
=
wb
.
createCellStyle
();
//样式
style
.
setVerticalAlignment
(
HSSFCellStyle
.
ALIGN_LEFT
);
//设置垂直居中
style
.
setAlignment
(
HSSFCellStyle
.
ALIGN_LEFT
);
style
.
setWrapText
(
true
);
//设置自动换行
style
.
setBorderBottom
(
HSSFCellStyle
.
BORDER_THIN
);
//下边框
style
.
setBorderLeft
(
HSSFCellStyle
.
BORDER_THIN
);
//左边框
style
.
setBorderTop
(
HSSFCellStyle
.
BORDER_THIN
);
//上边框
style
.
setBorderRight
(
HSSFCellStyle
.
BORDER_THIN
);
//右边框
HSSFFont
font
=
wb
.
createFont
();
font
.
setFontHeightInPoints
((
short
)
12
);
style
.
setFont
(
font
);
HSSFCellStyle
style2
=
wb
.
createCellStyle
();
//表头样式
style2
.
setVerticalAlignment
(
HSSFCellStyle
.
VERTICAL_CENTER
);
//设置垂直居中
style2
.
setAlignment
(
HSSFCellStyle
.
ALIGN_CENTER
);
HSSFFont
font2
=
wb
.
createFont
();
font2
.
setBoldweight
(
HSSFFont
.
BOLDWEIGHT_BOLD
);
//粗体显示
font2
.
setFontHeightInPoints
((
short
)
14
);
style2
.
setFont
(
font2
);
row
=
sheet
.
createRow
(
0
);
//创建下标为0的单元格
row
.
setHeightInPoints
(
Short
.
parseShort
(
"20"
));
//设置行高
HSSFCell
cell
=
row
.
createCell
(
0
);
//设定值
cell
.
setCellValue
(
"二代身份证统计表"
);
cell
.
setCellStyle
(
style2
);
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
cell
=
row
.
createCell
(
i
+
1
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style2
);
}
CellRangeAddress
callRangeAddress
=
new
CellRangeAddress
(
0
,
0
,
0
,
4
);
//起始行,结束行,起始列,结束列
sheet
.
addMergedRegion
(
callRangeAddress
);
row
=
sheet
.
createRow
(
1
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"单位"
);
//设定值
cell
.
setCellStyle
(
style
);
//内容居中
cell
=
row
.
createCell
(
1
);
//第二个单元格
cell
.
setCellValue
(
"数量"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
//第三个单元格
cell
.
setCellValue
(
"质检号"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
//第四个单元格
cell
.
setCellValue
(
"盒数"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
//第五个单元格
cell
.
setCellValue
(
"入库日期"
);
cell
.
setCellStyle
(
style
);
row
=
sheet
.
createRow
(
2
);
//i+2行之后开始创建
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
cityName
);
cell
.
setCellStyle
(
style
);
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
cell
=
row
.
createCell
(
i
+
1
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
//第五步插入数据
int
num
=
0
;
for
(
int
i
=
0
;
i
<
countyInfoList
.
size
();
i
++)
{
Map
<
String
,
Object
>
map
=
countyInfoList
.
get
(
i
);
//创建行
row
=
sheet
.
createRow
(
i
+
3
);
//i+2行之后开始创建
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
((
String
)
map
.
get
(
"COUNTYNAME"
));
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
map
.
get
(
"DOWNLOAD"
).
toString
().
equals
(
"0"
)
?
""
:
map
.
get
(
"DOWNLOAD"
).
toString
());
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
+
1
))
+
""
);
num
+=
((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
).
toString
())
/
250
+
1
));
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
if
(
countyInfoList
.
size
()
<
16
)
{
for
(
int
i
=
0
;
i
<=
16
-
countyInfoList
.
size
();
i
++)
{
//创建行
row
=
sheet
.
createRow
(
countyInfoList
.
size
()
+
3
+
i
);
// 行之后开始创建
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
for
(
int
j
=
0
;
j
<
5
;
j
++)
{
cell
=
row
.
createCell
(
j
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
}
row
=
sheet
.
createRow
(
18
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"合计"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
sum
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"制证车间"
);
cell
.
setCellStyle
(
style
);
if
(
"p1"
.
equals
(
workShop
)
||
"p3"
.
equals
(
workShop
))
{
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
" 平 一 "
);
cell
.
setCellStyle
(
style2
);
}
else
{
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"平二"
);
cell
.
setCellStyle
(
style2
);
}
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(
num
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
permanentPositionDate
);
cell
.
setCellStyle
(
style
);
row
=
sheet
.
createRow
(
19
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"类型"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
typeName
);
cell
.
setCellStyle
(
style
);
for
(
int
j
=
0
;
j
<
3
;
j
++)
{
cell
=
row
.
createCell
(
j
+
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
CellRangeAddress
callRangeNum1
=
new
CellRangeAddress
(
19
,
19
,
1
,
4
);
//起始行,结束行,起始列,结束列
sheet
.
addMergedRegion
(
callRangeNum1
);
row
=
sheet
.
createRow
(
20
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"32"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"循环单"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
cyclesheetid
);
cell
.
setCellStyle
(
style
);
for
(
int
j
=
0
;
j
<
3
;
j
++)
{
cell
=
row
.
createCell
(
j
+
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
CellRangeAddress
callRangeNum
=
new
CellRangeAddress
(
20
,
20
,
1
,
4
);
//起始行,结束行,起始列,结束列
sheet
.
addMergedRegion
(
callRangeNum
);
row
=
sheet
.
createRow
(
21
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"出库日期"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
"20 年 月 日"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
CellRangeAddress
callRangedate
=
new
CellRangeAddress
(
21
,
21
,
1
,
4
);
//起始行,结束行,起始列,结束列
sheet
.
addMergedRegion
(
callRangedate
);
}
if
(
countyInfoList
.
size
()
>=
16
)
{
row
=
sheet
.
createRow
(
countyInfoList
.
size
()
+
3
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"合计"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
sum
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"制证车间"
);
cell
.
setCellStyle
(
style
);
if
(
"p1"
.
equals
(
workShop
)
||
"p3"
.
equals
(
workShop
))
{
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"平一"
);
cell
.
setCellStyle
(
style
);
}
else
{
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"平二"
);
cell
.
setCellStyle
(
style
);
}
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(
num
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
permanentPositionDate
);
cell
.
setCellStyle
(
style
);
row
=
sheet
.
createRow
(
countyInfoList
.
size
()
+
4
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"类型"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
typeName
);
cell
.
setCellStyle
(
style
);
for
(
int
j
=
0
;
j
<
3
;
j
++)
{
cell
=
row
.
createCell
(
j
+
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
row
=
sheet
.
createRow
(
countyInfoList
.
size
()
+
5
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"32"
));
//设置行高
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"循环单"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
cyclesheetid
);
cell
.
setCellStyle
(
style
);
for
(
int
j
=
0
;
j
<
3
;
j
++)
{
cell
=
row
.
createCell
(
j
+
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
CellRangeAddress
callRangeNum
=
new
CellRangeAddress
(
countyInfoList
.
size
()
+
5
,
countyInfoList
.
size
()
+
5
,
1
,
4
);
//起始行,结束行,起始列,结束列
sheet
.
addMergedRegion
(
callRangeNum
);
row
=
sheet
.
createRow
(
countyInfoList
.
size
()
+
6
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"出库日期"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
"20 年 月 日"
);
cell
.
setCellStyle
(
style
);
for
(
int
j
=
0
;
j
<
3
;
j
++)
{
cell
=
row
.
createCell
(
j
+
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
CellRangeAddress
callRangedate
=
new
CellRangeAddress
(
countyInfoList
.
size
()
+
6
,
countyInfoList
.
size
()
+
6
,
1
,
4
);
//起始行,结束行,起始列,结束列
sheet
.
addMergedRegion
(
callRangedate
);
}
//创建分单
//创建辖区合单
HSSFSheet
mergeSheet
=
wb
.
createSheet
(
"辖区合单"
);
mergeSheet
.
setColumnWidth
(
0
,
(
int
)
30
*
115
);
mergeSheet
.
setColumnWidth
(
1
,
(
int
)
30
*
70
);
mergeSheet
.
setColumnWidth
(
2
,
(
int
)
30
*
80
);
mergeSheet
.
setColumnWidth
(
3
,
(
int
)
30
*
50
);
mergeSheet
.
setColumnWidth
(
4
,
(
int
)
30
*
110
);
HSSFPrintSetup
ps1
=
mergeSheet
.
getPrintSetup
();
ps1
.
setLandscape
(
true
);
// 打印方向,true:横向,false:纵向
ps1
.
setPaperSize
(
HSSFPrintSetup
.
B5_PAPERSIZE
);
//纸张
//计算合单的行数
int
lineNum
=
0
;
//计算合单的总数
int
mergeSum
=
0
;
//计算合单的盒数
int
boxNum
=
0
;
for
(
int
a
=
0
;
a
<
countyInfoList
.
size
();
a
++)
{
Map
<
String
,
Object
>
map
=
countyInfoList
.
get
(
a
);
//第二步创建sheet
if
(
map
.
get
(
"COUNTYNAME"
).
toString
().
contains
(
"区"
))
{
//第三步创建行row:添加表头0行
row
=
mergeSheet
.
createRow
(
0
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"20"
));
//设置行高
cell
=
row
.
createCell
(
0
);
//第一个单元格
cell
.
setCellValue
(
"二代身份证统计表"
);
//设定值
cell
.
setCellStyle
(
style2
);
for
(
int
j
=
0
;
j
<
4
;
j
++)
{
cell
=
row
.
createCell
(
j
+
1
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style2
);
}
CellRangeAddress
callRange
=
new
CellRangeAddress
(
0
,
0
,
0
,
4
);
//起始行,结束行,起始列,结束列
mergeSheet
.
addMergedRegion
(
callRange
);
row
=
mergeSheet
.
createRow
(
1
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//第四步创建单元格
cell
=
row
.
createCell
(
0
);
//第一个单元格
cell
.
setCellValue
(
"单位"
);
//设定值
cell
.
setCellStyle
(
style
);
//内容居中
cell
=
row
.
createCell
(
1
);
//第二个单元格
cell
.
setCellValue
(
"数量"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
//第三个单元格
cell
.
setCellValue
(
"质检号"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
//第四个单元格
cell
.
setCellValue
(
"盒数"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
//第五个单元格
cell
.
setCellValue
(
"入库日期"
);
cell
.
setCellStyle
(
style
);
//第五步插入数据
//创建行
row
=
mergeSheet
.
createRow
(
2
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
cityName
);
cell
.
setCellStyle
(
style
);
for
(
int
j
=
0
;
j
<
4
;
j
++)
{
cell
=
row
.
createCell
(
j
+
1
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
row
=
mergeSheet
.
createRow
(
lineNum
+
3
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
map
.
get
(
"COUNTYNAME"
).
toString
());
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
map
.
get
(
"DOWNLOAD"
)
+
""
);
mergeSum
+=
Integer
.
valueOf
(
map
.
get
(
"DOWNLOAD"
)
+
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellStyle
(
style
);
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
))
+
""
);
boxNum
+=
((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
));
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
//创建空的行和列
for
(
int
i
=
0
;
i
<=
14
-
lineNum
;
i
++)
{
//创建行
row
=
mergeSheet
.
createRow
(
lineNum
+
4
+
i
);
// 行之后开始创建
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
for
(
int
j
=
0
;
j
<
5
;
j
++)
{
cell
=
row
.
createCell
(
j
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
}
row
=
mergeSheet
.
createRow
(
18
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"合计"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
mergeSum
+
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"制证车间"
);
cell
.
setCellStyle
(
style
);
if
(
"p1"
.
equals
(
workShop
)
||
"p3"
.
equals
(
workShop
))
{
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"平一"
);
cell
.
setCellStyle
(
style
);
}
else
{
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"平二"
);
cell
.
setCellStyle
(
style
);
}
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(
boxNum
+
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
permanentPositionDate
);
cell
.
setCellStyle
(
style
);
//创建单元格并且添加数据
row
=
mergeSheet
.
createRow
(
19
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"类型"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
typeName
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
CellRangeAddress
callRangea
=
new
CellRangeAddress
(
19
,
19
,
1
,
4
);
//起始行,结束行,起始列,结束列
mergeSheet
.
addMergedRegion
(
callRangea
);
//创建单元格并且添加数据
row
=
mergeSheet
.
createRow
(
20
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"32"
));
//设置行高
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"编号"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
cyclesheetid
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"循环单"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
CellRangeAddress
callRangea1
=
new
CellRangeAddress
(
20
,
20
,
1
,
4
);
//起始行,结束行,起始列,结束列
mergeSheet
.
addMergedRegion
(
callRangea1
);
row
=
mergeSheet
.
createRow
(
21
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"出库日期"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
"20 年 月 日"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
CellRangeAddress
callRangeb
=
new
CellRangeAddress
(
21
,
21
,
1
,
4
);
//起始行,结束行,起始列,结束列
mergeSheet
.
addMergedRegion
(
callRangeb
);
lineNum
++;
}
else
{
sheet
=
wb
.
createSheet
(
a
+
"-"
+
(
String
)
map
.
get
(
"COUNTYNAME"
));
sheet
.
setColumnWidth
(
0
,
(
int
)
30
*
100
);
sheet
.
setColumnWidth
(
1
,
(
int
)
30
*
70
);
sheet
.
setColumnWidth
(
2
,
(
int
)
30
*
80
);
sheet
.
setColumnWidth
(
3
,
(
int
)
30
*
50
);
sheet
.
setColumnWidth
(
4
,
(
int
)
30
*
110
);
HSSFPrintSetup
ps2
=
sheet
.
getPrintSetup
();
ps2
.
setLandscape
(
true
);
// 打印方向,true:横向,false:纵向
ps2
.
setPaperSize
(
HSSFPrintSetup
.
B5_PAPERSIZE
);
//第三步创建行row:添加表头0行
row
=
sheet
.
createRow
(
0
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"20"
));
//设置行高
cell
=
row
.
createCell
(
0
);
//第一个单元格
cell
.
setCellValue
(
"二代身份证统计表"
);
//设定值
cell
.
setCellStyle
(
style2
);
for
(
int
j
=
0
;
j
<
4
;
j
++)
{
cell
=
row
.
createCell
(
j
+
1
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style2
);
}
CellRangeAddress
callRange
=
new
CellRangeAddress
(
0
,
0
,
0
,
4
);
//起始行,结束行,起始列,结束列
sheet
.
addMergedRegion
(
callRange
);
row
=
sheet
.
createRow
(
1
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//第四步创建单元格
cell
=
row
.
createCell
(
0
);
//第一个单元格
cell
.
setCellValue
(
"单位"
);
//设定值
cell
.
setCellStyle
(
style
);
//内容居中
cell
=
row
.
createCell
(
1
);
//第二个单元格
cell
.
setCellValue
(
"数量"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
//第三个单元格
cell
.
setCellValue
(
"质检号"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
//第四个单元格
cell
.
setCellValue
(
"盒数"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
//第五个单元格
cell
.
setCellValue
(
"入库日期"
);
cell
.
setCellStyle
(
style
);
//第五步插入数据
//创建行
row
=
sheet
.
createRow
(
2
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
// cell.setCellValue(typeName);
cell
.
setCellValue
(
cityName
);
cell
.
setCellStyle
(
style
);
for
(
int
j
=
0
;
j
<
4
;
j
++)
{
cell
=
row
.
createCell
(
j
+
1
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
row
=
sheet
.
createRow
(
3
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
map
.
get
(
"COUNTYNAME"
).
toString
());
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
map
.
get
(
"DOWNLOAD"
)
+
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellStyle
(
style
);
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
))
+
""
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
//创建空的行和列
for
(
int
i
=
0
;
i
<=
14
;
i
++)
{
//创建行
row
=
sheet
.
createRow
(
4
+
i
);
// 行之后开始创建
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
for
(
int
j
=
0
;
j
<
5
;
j
++)
{
cell
=
row
.
createCell
(
j
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
}
}
row
=
sheet
.
createRow
(
18
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"合计"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
Integer
.
valueOf
(
map
.
get
(
"DOWNLOAD"
)
+
""
));
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"制证车间"
);
cell
.
setCellStyle
(
style
);
if
(
"p1"
.
equals
(
workShop
)
||
"p3"
.
equals
(
workShop
))
{
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"平一"
);
cell
.
setCellStyle
(
style
);
}
else
{
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
"平二"
);
cell
.
setCellStyle
(
style
);
}
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(((
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
%
250
==
0
?
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
:
Integer
.
parseInt
(
map
.
get
(
"DOWNLOAD"
)
+
""
)
/
250
+
1
))
+
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
permanentPositionDate
);
cell
.
setCellStyle
(
style
);
//创建单元格并且添加数据
row
=
sheet
.
createRow
(
19
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"类型"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
typeName
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
CellRangeAddress
callRangea
=
new
CellRangeAddress
(
19
,
19
,
1
,
4
);
//起始行,结束行,起始列,结束列
sheet
.
addMergedRegion
(
callRangea
);
//创建单元格并且添加数据
row
=
sheet
.
createRow
(
20
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"32"
));
//设置行高
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"编号"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
cyclesheetid
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"循环单"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
CellRangeAddress
callRangea1
=
new
CellRangeAddress
(
20
,
20
,
1
,
4
);
//起始行,结束行,起始列,结束列
sheet
.
addMergedRegion
(
callRangea1
);
row
=
sheet
.
createRow
(
21
);
row
.
setHeightInPoints
(
Short
.
parseShort
(
"16"
));
//设置行高
//创建单元格并且添加数据
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
"出库日期"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
1
);
cell
.
setCellValue
(
"20 年 月 日"
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
2
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
3
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
cell
=
row
.
createCell
(
4
);
cell
.
setCellValue
(
""
);
cell
.
setCellStyle
(
style
);
CellRangeAddress
callRangeb
=
new
CellRangeAddress
(
21
,
21
,
1
,
4
);
//起始行,结束行,起始列,结束列
sheet
.
addMergedRegion
(
callRangeb
);
}
}
//第六步将生成excel文件保存到指定路径下
FileOutputStream
fout
=
null
;
try
{
fout
=
new
FileOutputStream
(
"F:\\Excel\\"
+
simpleDateFormat
.
format
(
new
Date
())
+
countyInfoList
.
get
(
0
).
get
(
"COUNTYNAME"
)
+
".xls"
);
// fout = new FileOutputStream("D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("COUNTYNAME") + ".xls");
wb
.
write
(
fout
);
fout
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
System
.
out
.
println
(
"Excel文件生成成功..."
+
new
Date
());
return
"F:\\Excel\\"
+
simpleDateFormat
.
format
(
new
Date
())
+
countyInfoList
.
get
(
0
).
get
(
"COUNTYNAME"
)
+
".xls"
;
// return "D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("COUNTYNAME") + ".xls";
}
}
src/main/java/com/yxproject/start/config/MyShiroRealm.java
View file @
d16f6b79
package
com
.
yxproject
.
start
.
config
;
import
com.yxproject.start.entity.ProductionTaskListEntity
;
import
com.yxproject.start.entity.SysPermission
;
import
com.yxproject.start.entity.SysRole
;
import
com.yxproject.start.entity.UserInfo
;
...
...
src/main/java/com/yxproject/start/mapper/PoliceStationVailedMapper.java
View file @
d16f6b79
...
...
@@ -12,7 +12,7 @@ import java.util.List;
public
interface
PoliceStationVailedMapper
{
/**
* 保存派出所照片质量报表
* @param policeStationVailed
Info
Entity
* @param policeStationVailedEntity
* @return
*/
@Insert
(
"INSERT INTO POLICE_STATION_VAILED_INFO (POLICE_STATION_VAILED_INFO_ID,CYCLESHEETID,POLICE_STATION_CODE,VAILED_COUNT,INVALID_COUNT,SAVA_DATE) "
+
...
...
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