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
a25d8490
Commit
a25d8490
authored
Nov 08, 2018
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
77a372e3
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1292 additions
and
2 deletions
+1292
-2
AdminApi.java
src/main/java/com/yxproject/start/api/AdminApi.java
+849
-0
UserInfoApi.java
src/main/java/com/yxproject/start/api/UserInfoApi.java
+2
-2
JerseyConfig.java
src/main/java/com/yxproject/start/config/JerseyConfig.java
+2
-0
CardBodyInfoEntity.java
...n/java/com/yxproject/start/entity/CardBodyInfoEntity.java
+99
-0
CountyListInfoEntity.java
...java/com/yxproject/start/entity/CountyListInfoEntity.java
+106
-0
CardBodyInfoMapper.java
...n/java/com/yxproject/start/mapper/CardBodyInfoMapper.java
+19
-0
CountyListInfoMapper.java
...java/com/yxproject/start/mapper/CountyListInfoMapper.java
+17
-0
PoliceStationVailedInfoMapper.java
...yxproject/start/mapper/PoliceStationVailedInfoMapper.java
+22
-0
UserInfoMapper.java
src/main/java/com/yxproject/start/mapper/UserInfoMapper.java
+2
-0
UtilMapper.java
src/main/java/com/yxproject/start/mapper/UtilMapper.java
+5
-0
CardBodyInfoService.java
...java/com/yxproject/start/service/CardBodyInfoService.java
+16
-0
CountyListInfoService.java
...va/com/yxproject/start/service/CountyListInfoService.java
+14
-0
CardBodyInfoServiceImpl.java
...yxproject/start/service/impl/CardBodyInfoServiceImpl.java
+56
-0
CountyListInfoServiceImpl.java
...project/start/service/impl/CountyListInfoServiceImpl.java
+29
-0
CardBodyInfoMapper.xml
src/main/resources/mapper/CardBodyInfoMapper.xml
+34
-0
CountyListInfoMapper.xml
src/main/resources/mapper/CountyListInfoMapper.xml
+20
-0
No files found.
src/main/java/com/yxproject/start/api/AdminApi.java
0 → 100644
View file @
a25d8490
package
com
.
yxproject
.
start
.
api
;
import
com.yxproject.start.service.*
;
import
com.yxproject.start.entity.CardBodyInfoEntity
;
import
com.yxproject.start.entity.CountyListInfoEntity
;
import
com.yxproject.start.entity.GroupinfoEntity
;
import
com.yxproject.start.entity.ProductionTaskListEntity
;
import
com.yxproject.start.service.CardBodyInfoService
;
import
com.yxproject.start.service.CountyListInfoService
;
import
com.yxproject.start.utils.YXJSONResponse
;
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.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.ws.rs.*
;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.MediaType
;
import
java.io.*
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created by Administrator on 2018/11/7.
*/
@Path
(
"admin"
)
public
class
AdminApi
{
@Autowired
private
CardBodyInfoService
cardBodyInfoService
;
@Autowired
private
CountyListInfoService
countyListInfoService
;
@Autowired
private
GroupinfoService
groupinfoService
;
@Autowired
private
ProductionTaskListService
productionTaskListService
;
/**
* 通过任务单查询区县列表;
*
* @return
*/
@GET
@Path
(
"getCountyList"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
getCountyListInfoByTaskListID
(
@QueryParam
(
"taskListID"
)
String
tasklistid
,
@Context
HttpServletResponse
resp
)
{
List
<
CountyListInfoEntity
>
countyListInfoEntity
=
countyListInfoService
.
findCountyListByTaskListID
(
tasklistid
);
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
yxjsonResponse
.
outPutSuccess
(
countyListInfoEntity
);
Map
map
=
new
HashMap
();
// map.put("MakeType",productionTaskListEntity);
return
yxjsonResponse
.
toJSONString
();
}
/**
* 更新卡机表;
*
* @return
*/
@GET
@Path
(
"updateCardBody"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
updateCardBodyInfo
(
@QueryParam
(
"CardBody"
)
String
cardBodyInfoId
,
@Context
HttpServletResponse
resp
)
{
String
map
=
"{\"CardBody\":\"20181016001\",\"makeType\":4,\"oldMakeType\":6}"
;
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
map
);
CardBodyInfoEntity
cardBodyInfoEntity
=
(
CardBodyInfoEntity
)
jsonObject
.
toBean
(
jsonObject
,
CardBodyInfoEntity
.
class
);
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
int
i
=
cardBodyInfoService
.
updateCardBodyInfo
(
cardBodyInfoEntity
);
yxjsonResponse
.
outPutSuccess
(
i
+
"更新成功"
);
return
yxjsonResponse
.
toJSONString
();
}
/**
* 保存卡机表;
*
* @return
*/
@GET
@Path
(
"addCardBody"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@RequiresPermissions
(
"userInfo.add"
)
//权限管理;
public
String
addCardBodyInfo
(
@QueryParam
(
"CardBody"
)
String
cardBodyInfoId
,
@Context
HttpServletResponse
resp
)
{
String
map
=
"{\"CardBody\":\"20181016001\",\"makeType\":4,\"oldMakeType\":7}"
;
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
map
);
Object
cardBodyInfo
=
jsonObject
.
get
(
"CardBody"
);
Object
groupInfoList
=
jsonObject
.
get
(
"groupInfoList"
);
List
<
GroupinfoEntity
>
groupinfoEntities
=
(
List
<
GroupinfoEntity
>)
groupInfoList
;
CardBodyInfoEntity
cardBodyInfoEntity
=
(
CardBodyInfoEntity
)
cardBodyInfo
;
YXJSONResponse
yxjsonResponse
=
new
YXJSONResponse
();
resp
.
setCharacterEncoding
(
"UTF-8"
);
int
i
=
cardBodyInfoService
.
addCardBodyInfoEntity
(
cardBodyInfoEntity
,
groupinfoEntities
);
yxjsonResponse
.
outPutSuccess
(
i
+
"添加成功"
);
return
yxjsonResponse
.
toJSONString
();
}
@GET
@Path
(
"downloadPackingList"
)
@Produces
(
MediaType
.
APPLICATION_OCTET_STREAM
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
// @RequiresPermissions("userInfo.add")//权限管理;
public
byte
[]
downloadPackingList
(
@QueryParam
(
"cyclesheetID"
)
String
cyclesheetID
,
@Context
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
=
groupinfoService
.
findCountyInfoList
(
cyclesheetID
);
List
<
ProductionTaskListEntity
>
productionTaskListEntityList
=
productionTaskListService
.
findProductionTaskListEntityByID
(
cyclesheetID
);
fout
=
exportExcel
(
countyInfoList
,
productionTaskListEntityList
.
get
(
0
).
getMake_Type
()+
""
,
productionTaskListEntityList
.
get
(
0
).
getWorkshop
(),
6000
,
productionTaskListEntityList
.
get
(
0
).
getCitycode
()
,
dateTime
,
cyclesheetID
);
String
outFile
=
dateTime
+
productionTaskListEntityList
.
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
;
}
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
(
"E:\\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
"E:\\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/api/UserInfoApi.java
View file @
a25d8490
...
@@ -1222,7 +1222,7 @@ public class UserInfoApi {
...
@@ -1222,7 +1222,7 @@ public class UserInfoApi {
//第六步将生成excel文件保存到指定路径下
//第六步将生成excel文件保存到指定路径下
FileOutputStream
fout
=
null
;
FileOutputStream
fout
=
null
;
try
{
try
{
fout
=
new
FileOutputStream
(
"
F
:\\Excel\\"
+
simpleDateFormat
.
format
(
new
Date
())
+
countyInfoList
.
get
(
0
).
get
(
"countyName"
)
+
".xls"
);
fout
=
new
FileOutputStream
(
"
E
:\\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");
// fout = new FileOutputStream("D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("countyName") + ".xls");
wb
.
write
(
fout
);
wb
.
write
(
fout
);
fout
.
close
();
fout
.
close
();
...
@@ -1231,7 +1231,7 @@ public class UserInfoApi {
...
@@ -1231,7 +1231,7 @@ public class UserInfoApi {
}
}
System
.
out
.
println
(
"Excel文件生成成功..."
+
new
Date
());
System
.
out
.
println
(
"Excel文件生成成功..."
+
new
Date
());
return
"
F
:\\Excel\\"
+
simpleDateFormat
.
format
(
new
Date
())
+
countyInfoList
.
get
(
0
).
get
(
"countyName"
)
+
".xls"
;
return
"
E
:\\Excel\\"
+
simpleDateFormat
.
format
(
new
Date
())
+
countyInfoList
.
get
(
0
).
get
(
"countyName"
)
+
".xls"
;
// return "D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("countyName") + ".xls";
// return "D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("countyName") + ".xls";
}
}
...
...
src/main/java/com/yxproject/start/config/JerseyConfig.java
View file @
a25d8490
package
com
.
yxproject
.
start
.
config
;
package
com
.
yxproject
.
start
.
config
;
import
com.yxproject.start.api.AdminApi
;
import
com.yxproject.start.api.UserInfoApi
;
import
com.yxproject.start.api.UserInfoApi
;
import
org.glassfish.jersey.server.ResourceConfig
;
import
org.glassfish.jersey.server.ResourceConfig
;
public
class
JerseyConfig
extends
ResourceConfig
{
public
class
JerseyConfig
extends
ResourceConfig
{
public
JerseyConfig
()
{
public
JerseyConfig
()
{
register
(
UserInfoApi
.
class
);
register
(
UserInfoApi
.
class
);
register
(
AdminApi
.
class
);
}
}
}
}
src/main/java/com/yxproject/start/entity/CardBodyInfoEntity.java
0 → 100644
View file @
a25d8490
package
com
.
yxproject
.
start
.
entity
;
import
javax.persistence.*
;
import
java.util.Objects
;
/**
* Created liuxinben on 2018/11/7.9:21
*/
@Entity
@Table
(
name
=
"CARD_BODY_INFO"
,
schema
=
"DAHAI"
,
catalog
=
""
)
public
class
CardBodyInfoEntity
{
private
String
card_Body_Info_Id
;
private
String
card_Body_Info_Save_Date
;
private
String
card_Body_Type
;
private
String
cyclesheetid
;
private
Long
is_Active
;
private
Long
card_Body_Count
;
@Id
@Column
(
name
=
"CARD_BODY_INFO_ID"
,
nullable
=
false
,
length
=
20
)
public
String
getCardBodyInfoId
()
{
return
card_Body_Info_Id
;
}
public
void
setCardBodyInfoId
(
String
cardBodyInfoId
)
{
this
.
card_Body_Info_Id
=
cardBodyInfoId
;
}
@Basic
@Column
(
name
=
"CARD_BODY_INFO_SAVE_DATE"
,
nullable
=
false
,
length
=
20
)
public
String
getCardBodyInfoSaveDate
()
{
return
card_Body_Info_Save_Date
;
}
public
void
setCardBodyInfoSaveDate
(
String
cardBodyInfoSaveDate
)
{
this
.
card_Body_Info_Save_Date
=
cardBodyInfoSaveDate
;
}
@Basic
@Column
(
name
=
"CARD_BODY_TYPE"
,
nullable
=
false
,
length
=
20
)
public
String
getCardBodyType
()
{
return
card_Body_Type
;
}
public
void
setCardBodyType
(
String
cardBodyType
)
{
this
.
card_Body_Type
=
cardBodyType
;
}
@Basic
@Column
(
name
=
"CYCLESHEETID"
,
nullable
=
true
,
length
=
20
)
public
String
getCyclesheetid
()
{
return
cyclesheetid
;
}
public
void
setCyclesheetid
(
String
cyclesheetid
)
{
this
.
cyclesheetid
=
cyclesheetid
;
}
@Basic
@Column
(
name
=
"IS_ACTIVE"
,
nullable
=
false
,
length
=
20
)
public
Long
getIsActive
()
{
return
is_Active
;
}
public
void
setIsActive
(
Long
isActive
)
{
this
.
is_Active
=
isActive
;
}
@Basic
@Column
(
name
=
"CARD_BODY_COUNT"
,
nullable
=
false
,
length
=
20
)
public
Long
getCardBodyCount
()
{
return
card_Body_Count
;
}
public
void
setCardBodyCount
(
Long
cardBodyCount
)
{
this
.
card_Body_Count
=
cardBodyCount
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
CardBodyInfoEntity
that
=
(
CardBodyInfoEntity
)
o
;
return
Objects
.
equals
(
card_Body_Info_Id
,
that
.
card_Body_Info_Id
)
&&
Objects
.
equals
(
card_Body_Info_Save_Date
,
that
.
card_Body_Info_Save_Date
)
&&
Objects
.
equals
(
is_Active
,
that
.
is_Active
)
&&
Objects
.
equals
(
cyclesheetid
,
that
.
cyclesheetid
)
&&
Objects
.
equals
(
card_Body_Type
,
that
.
card_Body_Type
)
&&
Objects
.
equals
(
card_Body_Count
,
that
.
card_Body_Count
)
;
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
card_Body_Info_Id
,
card_Body_Info_Save_Date
,
is_Active
,
card_Body_Count
,
cyclesheetid
,
card_Body_Type
);
}
}
src/main/java/com/yxproject/start/entity/CountyListInfoEntity.java
0 → 100644
View file @
a25d8490
package
com
.
yxproject
.
start
.
entity
;
import
javax.persistence.*
;
import
java.util.List
;
import
java.util.Objects
;
/**
* Created by liuxinben on 2018/11/6.10:14
*/
@Entity
@Table
(
name
=
"COUNTY_LIST_INFO"
,
schema
=
"DAHAI"
,
catalog
=
""
)
public
class
CountyListInfoEntity
{
private
String
county_List_Id
;
private
String
save_Date
;
private
String
cyclesheetid
;
private
String
county_Code
;
private
Long
finish_Count
;
private
Long
put_In_Storage_Count
;
private
Long
out_Bound_Count
;
@Id
@Column
(
name
=
"COUNTY_LIST_ID"
,
nullable
=
false
,
length
=
20
)
public
String
getCountyListId
()
{
return
county_List_Id
;
}
public
void
setCountyListId
(
String
countyListId
)
{
this
.
county_List_Id
=
countyListId
;
}
@Basic
@Column
(
name
=
"SAVE_DATE"
,
nullable
=
true
,
length
=
20
)
public
String
getSaveDate
()
{
return
save_Date
;}
public
void
setSaveDate
(
String
saveDate
)
{
this
.
save_Date
=
saveDate
;
}
@Basic
@Column
(
name
=
"CYCLESHEETID"
,
nullable
=
true
,
length
=
20
)
public
String
getCyclesheetid
()
{
return
cyclesheetid
;
}
public
void
setCyclesheetid
(
String
cyclesheetid
)
{
this
.
cyclesheetid
=
cyclesheetid
;
}
@Basic
@Column
(
name
=
"COUNTY_CODE"
,
nullable
=
true
,
length
=
20
)
public
String
getCountyCode
()
{
return
county_Code
;
}
public
void
setCountyCode
(
String
county_Code
)
{
this
.
county_Code
=
county_Code
;}
@Basic
@Column
(
name
=
"FINISH_COUNT"
,
nullable
=
true
,
precision
=
0
)
public
Long
getFinishCount
()
{
return
finish_Count
;
}
public
void
setFinishCount
(
Long
finishCount
)
{
this
.
finish_Count
=
finishCount
;
}
@Basic
@Column
(
name
=
"PUT_IN_STORAGE_COUNT"
,
nullable
=
true
,
precision
=
0
)
public
Long
getPutInStorageCount
()
{
return
put_In_Storage_Count
;
}
public
void
setPutInStorageCount
(
Long
putInStorageCount
)
{
this
.
put_In_Storage_Count
=
putInStorageCount
;
}
@Basic
@Column
(
name
=
"OUT_BOUND_COUNT"
,
nullable
=
true
,
precision
=
0
)
public
Long
getOutBoundCount
()
{
return
out_Bound_Count
;
}
public
void
setOutBoundCount
(
Long
outBoundCount
)
{
this
.
out_Bound_Count
=
outBoundCount
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
CountyListInfoEntity
that
=
(
CountyListInfoEntity
)
o
;
return
Objects
.
equals
(
county_List_Id
,
that
.
county_List_Id
)
&&
Objects
.
equals
(
save_Date
,
that
.
save_Date
)
&&
Objects
.
equals
(
cyclesheetid
,
that
.
cyclesheetid
)
&&
Objects
.
equals
(
county_Code
,
that
.
county_Code
)
&&
Objects
.
equals
(
finish_Count
,
that
.
finish_Count
)
&&
Objects
.
equals
(
put_In_Storage_Count
,
that
.
put_In_Storage_Count
)
&&
Objects
.
equals
(
out_Bound_Count
,
that
.
out_Bound_Count
)
;
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
county_List_Id
,
save_Date
,
cyclesheetid
,
county_Code
,
finish_Count
,
put_In_Storage_Count
,
out_Bound_Count
);
}
}
src/main/java/com/yxproject/start/mapper/CardBodyInfoMapper.java
0 → 100644
View file @
a25d8490
package
com
.
yxproject
.
start
.
mapper
;
import
com.yxproject.start.entity.CardBodyInfoEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* Created by liuxinben on 2018/11/6.10:26
*/
@Mapper
public
interface
CardBodyInfoMapper
{
public
int
insertCardBodyInfoEntity
(
CardBodyInfoEntity
cardBodyInfoEntity
);
public
int
updateCardBodyInfo
(
CardBodyInfoEntity
cardBodyInfoEntity
);
}
\ No newline at end of file
src/main/java/com/yxproject/start/mapper/CountyListInfoMapper.java
0 → 100644
View file @
a25d8490
package
com
.
yxproject
.
start
.
mapper
;
import
com.yxproject.start.entity.CountyListInfoEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* Created by liuxinben on 2018/11/6.10:26
*/
@Mapper
public
interface
CountyListInfoMapper
{
public
List
<
CountyListInfoEntity
>
findCountyListByTaskListID
(
String
tasklistID
);
}
src/main/java/com/yxproject/start/mapper/PoliceStationVailedInfoMapper.java
View file @
a25d8490
...
@@ -29,3 +29,24 @@ public interface PoliceStationVailedInfoMapper {
...
@@ -29,3 +29,24 @@ public interface PoliceStationVailedInfoMapper {
@Result
(
property
=
"sava_Date"
,
column
=
"sava_Date"
)})
@Result
(
property
=
"sava_Date"
,
column
=
"sava_Date"
)})
public
List
<
PoliceStationVailedInfoEntity
>
findPoliceStationVailedInfoEntityByID
(
String
id
);
public
List
<
PoliceStationVailedInfoEntity
>
findPoliceStationVailedInfoEntityByID
(
String
id
);
}
}
//@Mapper
//interface Inter {
// public static final int num=3;
// public abstract void show();
//}
//
//class Test implements Inter {
// public void show(){
//
// }
//}
//public class InterfaceDome{
//// public static void mian(String[] args){
//// Test t = new Test();
//// System.out.println(t.num);
//// System.out.println(Test.num);
//// System.out.println(Inter.num);
//// }
//
//}
\ No newline at end of file
src/main/java/com/yxproject/start/mapper/UserInfoMapper.java
View file @
a25d8490
...
@@ -82,3 +82,5 @@ public interface UserInfoMapper {
...
@@ -82,3 +82,5 @@ public interface UserInfoMapper {
@Update
(
"UPDATE USER_INFO SET USERNAME=#{username},NAME=#{name} where ID=#{id}"
)
@Update
(
"UPDATE USER_INFO SET USERNAME=#{username},NAME=#{name} where ID=#{id}"
)
public
void
updateUserInfo
(
UserInfo
userInfo
);
public
void
updateUserInfo
(
UserInfo
userInfo
);
}
}
src/main/java/com/yxproject/start/mapper/UtilMapper.java
View file @
a25d8490
...
@@ -12,17 +12,22 @@ public interface UtilMapper {
...
@@ -12,17 +12,22 @@ public interface UtilMapper {
* 查询任务单序列值
* 查询任务单序列值
*/
*/
public
int
findProductionTaskListSequenceNextValue
();
public
int
findProductionTaskListSequenceNextValue
();
/**
/**
* 查询组号信息序列值
* 查询组号信息序列值
*/
*/
public
int
findGroupInfoSequenceNextValue
();
public
int
findGroupInfoSequenceNextValue
();
/**
/**
* 查询派出所照片质量表序列值
* 查询派出所照片质量表序列值
*/
*/
public
int
findPoliceStationVailedSequenceNextValue
();
public
int
findPoliceStationVailedSequenceNextValue
();
/**
/**
* 查询废证信息表序列值
* 查询废证信息表序列值
*/
*/
@Select
(
" select FAILEDINFO_SEQ.nextval from dual"
)
@Select
(
" select FAILEDINFO_SEQ.nextval from dual"
)
public
int
findFailedinfoSequenceNextValue
();
public
int
findFailedinfoSequenceNextValue
();
}
}
src/main/java/com/yxproject/start/service/CardBodyInfoService.java
0 → 100644
View file @
a25d8490
package
com
.
yxproject
.
start
.
service
;
import
com.yxproject.start.entity.CardBodyInfoEntity
;
import
com.yxproject.start.entity.GroupinfoEntity
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* Created by Administrator on 2018/11/7.
*/
public
interface
CardBodyInfoService
{
public
int
addCardBodyInfoEntity
(
CardBodyInfoEntity
cardBodyInfoEntity
,
List
<
GroupinfoEntity
>
groupinfoEntities
);
public
int
updateCardBodyInfo
(
CardBodyInfoEntity
map
);
}
src/main/java/com/yxproject/start/service/CountyListInfoService.java
0 → 100644
View file @
a25d8490
package
com
.
yxproject
.
start
.
service
;
import
com.yxproject.start.entity.CountyListInfoEntity
;
import
java.util.List
;
/**
* Created by liuxinben on 2018/11/6.10:30
*/
public
interface
CountyListInfoService
{
public
List
<
CountyListInfoEntity
>
findCountyListByTaskListID
(
String
tasklistID
);
}
src/main/java/com/yxproject/start/service/impl/CardBodyInfoServiceImpl.java
0 → 100644
View file @
a25d8490
package
com
.
yxproject
.
start
.
service
.
impl
;
import
com.yxproject.start.entity.CardBodyInfoEntity
;
import
com.yxproject.start.entity.GroupinfoEntity
;
import
com.yxproject.start.mapper.CardBodyInfoMapper
;
import
com.yxproject.start.mapper.GroupinfoMapper
;
import
com.yxproject.start.mapper.UtilMapper
;
import
com.yxproject.start.service.CardBodyInfoService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created by Administrator on 2018/11/7.
*/
@Service
public
class
CardBodyInfoServiceImpl
implements
CardBodyInfoService
{
@Autowired
public
CardBodyInfoMapper
cardBodyInfoMapper
;
@Autowired
private
UtilMapper
utilMapper
;
@Autowired
public
GroupinfoMapper
groupinfoMapper
;
@Override
public
int
updateCardBodyInfo
(
CardBodyInfoEntity
cardBodyInfoEntity
)
{
//todo 状态更新时间
return
cardBodyInfoMapper
.
updateCardBodyInfo
(
cardBodyInfoEntity
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
int
addCardBodyInfoEntity
(
CardBodyInfoEntity
cardBodyInfoEntity
,
List
<
GroupinfoEntity
>
groupinfoEntities
)
{
int
production_task_list_seq
=
utilMapper
.
findProductionTaskListSequenceNextValue
();
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
cardBodyInfoEntity
.
setCardBodyInfoId
(
simpleDateFormat
.
format
(
new
Date
())
+
production_task_list_seq
);
cardBodyInfoMapper
.
insertCardBodyInfoEntity
(
cardBodyInfoEntity
);
for
(
GroupinfoEntity
groupinfoEntity
:
groupinfoEntities
)
{
int
groupInfoSequenceValue
=
utilMapper
.
findGroupInfoSequenceNextValue
();
groupinfoEntity
.
setGroupid
(
simpleDateFormat
.
format
(
new
Date
())
+
groupInfoSequenceValue
);
groupinfoEntity
.
setCyclesheetid
(
simpleDateFormat
.
format
(
new
Date
())
+
production_task_list_seq
);
groupinfoMapper
.
insertGroupinfoEntity
(
groupinfoEntity
);
}
return
1
;
}
}
src/main/java/com/yxproject/start/service/impl/CountyListInfoServiceImpl.java
0 → 100644
View file @
a25d8490
package
com
.
yxproject
.
start
.
service
.
impl
;
import
com.yxproject.start.entity.CountyListInfoEntity
;
import
com.yxproject.start.mapper.CountyListInfoMapper
;
import
com.yxproject.start.service.CountyListInfoService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* Created by liuxinben on 2018/11/6.13:42
*/
@Service
public
class
CountyListInfoServiceImpl
implements
CountyListInfoService
{
@Autowired
public
CountyListInfoMapper
countyListInfoMapper
;
@Override
public
List
<
CountyListInfoEntity
>
findCountyListByTaskListID
(
String
tasklistid
)
{
List
<
CountyListInfoEntity
>
byTaskListID
=
countyListInfoMapper
.
findCountyListByTaskListID
(
tasklistid
);
return
byTaskListID
;
}
}
\ No newline at end of file
src/main/resources/mapper/CardBodyInfoMapper.xml
0 → 100644
View file @
a25d8490
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.yxproject.start.mapper.CardBodyInfoMapper"
>
<resultMap
id=
"CardBodyInfoMapper"
type=
"com.yxproject.start.entity.CardBodyInfoEntity"
>
<id
column=
"card_Body_Info_Id"
property=
"card_Body_Info_Id"
/>
<result
column=
"card_Body_Info_Save_Date"
property=
"card_Body_Info_Save_Date"
/>
<result
column=
"is_Active"
property=
"is_Active"
/>
<result
column=
"card_Body_Count"
property=
"card_Body_Count"
/>
<result
column=
"card_Body_Type"
property=
"card_Body_Type"
/>
<result
column=
"cyclesheetid"
property=
"cyclesheetid"
/>
</resultMap>
<insert
id=
"insertCardBodyInfoEntity"
parameterType=
"com.yxproject.start.entity.CardBodyInfoEntity"
>
Insert into CARD_BODY_INFO (CARD_BODY_INFO_ID,CARD_BODY_INFO_SAVE_DATE,CARD_BODY_COUNT,CARD_BODY_TYPE,CYCLESHEETID,IS_ACTIVE)
values (#{card_Body_Info_Id},#{card_Body_Info_Save_Date},#{is_Active},#{card_Body_Count},#{card_Body_Type},#{cyclesheetid})
</insert>
<update
id=
"updateCardBodyInfo"
parameterType=
"com.yxproject.start.entity.CardBodyInfoEntity"
>
update CARD_BODY_INFO
<set>
<if
test=
"card_Body_Info_Save_Date "
>
CARD_BODY_INFO_SAVE_DATE =#{card_Body_Info_Save_Date},
</if>
<if
test=
"is_Active "
>
IS_ACTIVE =#{is_Active},
</if>
<if
test=
"card_Body_Count "
>
CARD_BODY_COUNT =#{card_Body_Count},
</if>
<if
test=
"card_Body_Type"
>
CARD_BODY_TYPE =#{card_Body_Type},
</if>
<if
test=
"cyclesheetid "
>
CYCLESHEETID =#{cyclesheetid},
</if>
<if
test=
"state!=null"
>
STATE =#{state},
</if>
<if
test=
"putinstorage_Date!=null"
>
PUTINSTORAGE_DATE =#{putinstorage_Date},
</if>
</set>
where CARD_BODY_INFO_ID =#{card_Body_Info_Id}
</update>
</mapper>
\ No newline at end of file
src/main/resources/mapper/CountyListInfoMapper.xml
0 → 100644
View file @
a25d8490
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.yxproject.start.mapper.CountyListInfoMapper"
>
<resultMap
id=
"CountyListInfoMapper"
type=
"com.yxproject.start.entity.CountyListInfoEntity"
>
<id
column=
"county_List_Id"
property=
"county_List_Id"
/>
<result
column=
"save_Date"
property=
"save_Date"
/>
<result
column=
"cyclesheetid"
property=
"cyclesheetid"
/>
<result
column=
"county_Code"
property=
"county_Code"
/>
<result
column=
"finish_Count"
property=
"finish_Count"
/>
<result
column=
"put_In_Storage_Count"
property=
"put_In_Storage_Count"
/>
<result
column=
"out_Bound_Count"
property=
"out_Bound_Count"
/>
</resultMap>
<!--<insert id="addPermissionByMap" parameterType="com.yxproject.start.entity.SysPermission">-->
<!--Insert into DAHAI.SYS_PERMISSION (ID,AVAILABLE,NAME,PARENT_ID,PARENT_IDS,PERMISSION,RESOURCE_TYPE,URL) values (PERMISSION_seq.nextval,0,#{name},#{parentId},#{parentIds},#{permission},#{resourceType},#{url})-->
<!--</insert>-->
<select
id=
"findCountyListByTaskListID"
resultType=
"com.yxproject.start.entity.CountyListInfoEntity"
parameterType=
"String"
>
SELECT * FROM COUNTY_LIST_INFO where CYCLESHEETID=#{tasklistID}
</select>
</mapper>
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