Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Y
YX_IDENT_beijing_auxiliary_YD
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_beijing_auxiliary_YD
Commits
95e17839
Commit
95e17839
authored
Mar 11, 2019
by
suichenguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
d22f0d42
0d86863d
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
186 additions
and
119 deletions
+186
-119
ExportXMLApi.java
src/main/java/com/yxproject/start/api/ExportXMLApi.java
+108
-37
TagPrintApi.java
src/main/java/com/yxproject/start/api/TagPrintApi.java
+0
-20
FilesMapper.java
src/main/java/com/yxproject/start/mapper/FilesMapper.java
+8
-0
PersonPostMapper.java
...ain/java/com/yxproject/start/mapper/PersonPostMapper.java
+1
-0
QuerySequenceMapper.java
.../java/com/yxproject/start/mapper/QuerySequenceMapper.java
+4
-1
FilesService.java
src/main/java/com/yxproject/start/service/FilesService.java
+13
-0
FilesServiceImpl.java
...va/com/yxproject/start/service/impl/FilesServiceImpl.java
+29
-0
PreproPersonServiceImpl.java
...yxproject/start/service/impl/PreproPersonServiceImpl.java
+2
-1
QuerySequenceSercive.java
.../java/com/yxproject/start/utils/QuerySequenceSercive.java
+6
-2
service.js
src/main/resources/static/js/service.js
+2
-2
receitp.js
src/main/resources/static/views/receitp/receitp.js
+11
-0
tagPrint.html
src/main/resources/static/views/tagPrint/tagPrint.html
+1
-27
tagPrint.js
src/main/resources/static/views/tagPrint/tagPrint.js
+1
-29
No files found.
src/main/java/com/yxproject/start/api/ExportXMLApi.java
View file @
95e17839
...
...
@@ -3,8 +3,10 @@ package com.yxproject.start.api;
import
com.yxproject.start.entity.FilesEntity
;
import
com.yxproject.start.entity.NewFilesEntity
;
import
com.yxproject.start.entity.PreproPersonEntity
;
import
com.yxproject.start.service.FilesService
;
import
com.yxproject.start.service.NewFilesService
;
import
com.yxproject.start.service.PreproPersonService
;
import
com.yxproject.start.utils.QuerySequenceSercive
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.dom4j.Document
;
import
org.dom4j.DocumentHelper
;
...
...
@@ -19,9 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
/**
* @auther zhangyusheng
...
...
@@ -34,6 +34,11 @@ public class ExportXMLApi {
private
PreproPersonService
preproPersonService
;
@Autowired
private
NewFilesService
newFilesService
;
@Autowired
private
FilesService
filesService
;
@Autowired
private
QuerySequenceSercive
querySequenceSercive
;
/**
* 导出制证数据包
...
...
@@ -46,39 +51,105 @@ public class ExportXMLApi {
String
dateTime
=
DateFormatUtils
.
format
(
new
Date
(),
"yyyyMMddHH"
);
//使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String
fout
=
null
;
//todo 更改查询条件
List
<
PreproPersonEntity
>
preproPersonEntities
=
new
ArrayList
<>();
// List<PreproPersonEntity> preproPersonEntities = preproPersonService.selectPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, uploadDate);
if
(
preproPersonEntities
.
size
()>
0
){
List
<
PreproPersonEntity
>
preproPersonEntities
=
preproPersonService
.
selectAllPreproPerson
(
uploadNo
,
IDCard
,
oldFile
,
newFile
,
SSXQDM
,
cardType
,
state
,
uploadDate
);
if
(
preproPersonEntities
.
size
()>
0
){
//todo 查询制证数据包信息
FilesEntity
filesEntity
=
new
FilesEntity
();
filesEntity
.
setVersionCode
(
"3.00"
);
filesEntity
.
setDwdm
(
"410600000000"
);
filesEntity
.
setDwmc
(
"北京市公安局"
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyyMMddhhmmss"
);
filesEntity
.
setCreateTime
(
simpleDateFormat
.
format
(
new
Date
()));
try
{
fout
=
createToMakePackageXML
(
preproPersonEntities
,
filesEntity
,
"\\zhang"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
String
outFile
=
dateTime
+
"制证数据包"
;
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
+
".xml"
);
return
b
;
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
else
{
//将制证详情详细划分
Map
<
Long
,
Object
>
map
=
new
LinkedHashMap
<>();
for
(
PreproPersonEntity
preproPersonEntity:
preproPersonEntities
){
if
(
map
!=
null
&&
map
.
containsKey
(
preproPersonEntity
.
getCardTypeId
())){
List
<
PreproPersonEntity
>
preproPersonEntityList
=
(
List
<
PreproPersonEntity
>)
map
.
get
(
preproPersonEntity
.
getCardTypeId
());
preproPersonEntityList
.
add
(
preproPersonEntity
);
map
.
put
(
preproPersonEntity
.
getCardTypeId
(),
preproPersonEntityList
);
}
else
{
List
<
PreproPersonEntity
>
preproPersonEntityList
=
new
ArrayList
<>();
preproPersonEntityList
.
add
(
preproPersonEntity
);
map
.
put
(
preproPersonEntity
.
getCardTypeId
(),
preproPersonEntityList
);
}
}
List
<
List
<
Map
<
Long
,
Object
>>>
lists
=
new
ArrayList
<>();
for
(
Long
cardTypeId
:
map
.
keySet
()){
List
list
=
new
ArrayList
();
List
<
PreproPersonEntity
>
preproPersonEntityList
=(
List
<
PreproPersonEntity
>)
map
.
get
(
cardTypeId
);
Map
<
Long
,
Object
>
mapFileId
=
new
LinkedHashMap
<>();
for
(
PreproPersonEntity
preproPersonEntity:
preproPersonEntityList
){
if
(
mapFileId
!=
null
&&
mapFileId
.
containsKey
(
preproPersonEntity
.
getFileId
())){
List
<
PreproPersonEntity
>
preproPersonEntityListFileId
=
(
List
<
PreproPersonEntity
>)
map
.
get
(
preproPersonEntity
.
getFileId
());
preproPersonEntityListFileId
.
add
(
preproPersonEntity
);
mapFileId
.
put
(
preproPersonEntity
.
getFileId
(),
preproPersonEntityListFileId
);
}
else
{
List
<
PreproPersonEntity
>
preproPersonEntityListFileId
=
new
ArrayList
<>();
preproPersonEntityListFileId
.
add
(
preproPersonEntity
);
mapFileId
.
put
(
preproPersonEntity
.
getFileId
(),
preproPersonEntityListFileId
);
}
}
list
.
add
(
mapFileId
);
lists
.
add
(
list
);
}
//TODO
//执行生成XML文件方法
for
(
List
<
Map
<
Long
,
Object
>>
mapList
:
lists
){
for
(
Map
<
Long
,
Object
>
objectMap
:
mapList
){
for
(
Long
fileId
:
objectMap
.
keySet
()){
List
<
PreproPersonEntity
>
preproPersonEntityList
=(
List
<
PreproPersonEntity
>)
map
.
get
(
fileId
);
int
i
=
0
;
List
<
List
>
listList
=
new
ArrayList
<>();
List
list
=
new
ArrayList
();
for
(
PreproPersonEntity
preproPersonEntity
:
preproPersonEntityList
){
list
.
add
(
preproPersonEntity
);
i
++;
if
(
i
<
80
){
}
else
{
listList
.
add
(
list
);
list
=
new
ArrayList
();
i
=
0
;
}
}
for
(
List
list1
:
listList
)
{
List
<
PreproPersonEntity
>
preproPersonEntityList1
=
(
List
<
PreproPersonEntity
>)
list1
;
List
<
FilesEntity
>
filesEntities
=
filesService
.
selectFilesEntityById
(
preproPersonEntityList1
.
get
(
0
).
getFileId
().
toString
());
FilesEntity
filesEntity
=
filesEntities
.
get
(
0
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyyMMddhhmmss"
);
filesEntity
.
setCreateTime
(
simpleDateFormat
.
format
(
new
Date
()));
try
{
fout
=
createToMakePackageXML
(
preproPersonEntityList1
,
filesEntity
,
"\\zhang"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
String
outFile
=
dateTime
+
"制证数据包"
;
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
+
".xml"
);
return
b
;
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
}
return
null
;
}
...
...
@@ -89,7 +160,6 @@ public class ExportXMLApi {
* @throws IOException 可能出现文件写入不成功
*/
public
String
createToMakePackageXML
(
List
<
PreproPersonEntity
>
preproPersonEntities
,
FilesEntity
filesEntity
,
String
url
)
throws
IOException
{
//todo 添加生成新包 回写到个人制证信息表中
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
simpleDateFormat2
=
new
SimpleDateFormat
(
"yyyyMMddhhmmss"
);
Document
document
=
DocumentHelper
.
createDocument
();
...
...
@@ -115,7 +185,7 @@ public class ExportXMLApi {
newFilesEntity
.
setRecordNumber
((
long
)
preproPersonEntities
.
size
());
long
l
=
newFilesService
.
saveNewFiles
(
newFilesEntity
);
newFilesEntity
.
setNewFileName
(
simpleDateFormat
.
format
(
new
Date
())+
"-"
+
l
);
newFilesService
.
updateNewFileName
(
newFilesEntity
);
newFilesService
.
saveNewFiles
(
newFilesEntity
);
int
NO
=
1
;
for
(
PreproPersonEntity
preproPersonEntity
:
preproPersonEntities
)
{
...
...
@@ -169,12 +239,13 @@ public class ExportXMLApi {
Element
SJR_TXDZ
=
RECORD
.
addElement
(
"SJR_TXDZ"
);
SJR_TXDZ
.
setText
(
replaceNullString
(
preproPersonEntity
.
getSjrTxdz
()));
NO
++;
preproPersonEntity
.
setNewFileId
(
l
);
preproPersonEntity
.
setNewFileId
(
newFilesEntity
.
getId
()
);
}
preproPersonService
.
updatePreproPerson_NewFileName
(
preproPersonEntities
);
String
files_seq
=
querySequenceSercive
.
selectSequenceNextValue
(
"FILES_SEQ"
);
FileOutputStream
fout
=
null
;
try
{
FileOutputStream
fos
=
new
FileOutputStream
(
"D:\\XML\\"
+
simpleDateFormat
.
format
(
new
Date
())+
"-"
+
l
+
".xml"
);
FileOutputStream
fos
=
new
FileOutputStream
(
"D:\\XML\\"
+
simpleDateFormat
.
format
(
new
Date
())+
"-"
+
files_seq
+
".xml"
);
OutputStreamWriter
osw
=
new
OutputStreamWriter
(
fos
,
"UTF-8"
);
OutputFormat
of
=
new
OutputFormat
();
of
.
setEncoding
(
"UTF-8"
);
...
...
src/main/java/com/yxproject/start/api/TagPrintApi.java
deleted
100644 → 0
View file @
d22f0d42
package
com
.
yxproject
.
start
.
api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.List
;
@RestController
@RequestMapping
(
"tagPrint"
)
public
class
TagPrintApi
{
@RequestMapping
(
"selectTagPrintData"
)
public
List
selectTagPrintData
(
@RequestParam
(
"idCard"
)
String
idCard
){
List
list
=
new
ArrayList
();
return
list
;
}
}
src/main/java/com/yxproject/start/mapper/FilesMapper.java
View file @
95e17839
...
...
@@ -50,4 +50,12 @@ public interface FilesMapper {
"</script>"
})
public
List
<
CountDataEntity
>
selectFilesCount
(
@Param
(
"importDate"
)
String
importDate
);
/**
* 查询XML文件包详情
*
* @param fileId
* @return
*/
@Select
(
"select * from files where id = #{fileId}"
)
public
List
<
FilesEntity
>
selectFilesEntity
(
@Param
(
"fileId"
)
String
fileId
);
}
src/main/java/com/yxproject/start/mapper/PersonPostMapper.java
View file @
95e17839
...
...
@@ -17,6 +17,7 @@ public interface PersonPostMapper {
"( WAYBILL_NUMBER,BACK_WAYBILL_NUMBER,ORDER_NUMBER,CREATE_DATE,OPENID,WC_PLAY_ORDER_NUMBER,PLAY_STATE,ORDER_STATE,APPLICANT_NAME,SENDER_NAME,SENDER_PHONE,SENDER_ADDRESS,RECIPIENT_NAME,RECIPIENT_PHONE,RECIPIENT_ADDRESS,ORDER_BLANK_NUMBER,GET_TO_PROVINCE,GET_TO_CITY,GET_TO_COUNTY,BUSINESS_TYPE,LATTICE_MOUTH_INFORMATION,NATURE_OF_THE_INTERNAL,NATURE_OF_THE_INFORMATION,FIRST_WHITE,FILE_ID) "
+
"values "
+
"(#{waybillNumber},#{backWaybillNumber},#{orderNumber},#{createDate},#{openid},#{wcPlayOrderNumber},#{playState},#{orderState},#{applicantName},#{senderName},#{senderPhone},#{senderAddress},#{recipientName},#{recipientPhone},#{recipientAddress},#{orderBlankNumber},#{getToProvince},#{getToCity},#{getToCounty},#{businessType},#{latticeMouthInformation},#{natureOfTheInternal},#{natureOfTheInformation},#{firstWhite},#{fileId})"
)
@Options
(
useGeneratedKeys
=
true
,
keyProperty
=
"id"
,
keyColumn
=
"id"
)
public
boolean
savePersonPost
(
PersonPostEntity
personPostEntity
);
@Update
(
"update prepro_person p set IS_POST=9 where p.JMSFZSLH in ( select p.JMSFZSLH from prepro_person p left join files files on p.file_id=files.ID \n"
+
...
...
src/main/java/com/yxproject/start/mapper/QuerySequenceMapper.java
View file @
95e17839
...
...
@@ -4,6 +4,9 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
import
java.util.Map
;
/**
* @auther zhangyusheng
* 2019/3/1 15:01
...
...
@@ -11,5 +14,5 @@ import org.apache.ibatis.annotations.Select;
@Mapper
public
interface
QuerySequenceMapper
{
@Select
(
"select #{sequenceName},#{sequenceName} as num2 from dual"
)
public
Object
[]
selectSequenceNextValue
(
@Param
(
"sequenceName"
)
String
sequenceName
);
public
List
<
Map
<
String
,
Object
>>
selectSequenceNextValue
(
@Param
(
"sequenceName"
)
String
sequenceName
);
}
src/main/java/com/yxproject/start/service/FilesService.java
0 → 100644
View file @
95e17839
package
com
.
yxproject
.
start
.
service
;
import
com.yxproject.start.entity.FilesEntity
;
import
java.util.List
;
/**
* @auther zhangyusheng
* 2019/3/11 15:08
*/
public
interface
FilesService
{
public
List
<
FilesEntity
>
selectFilesEntityById
(
String
id
);
}
src/main/java/com/yxproject/start/service/impl/FilesServiceImpl.java
0 → 100644
View file @
95e17839
package
com
.
yxproject
.
start
.
service
.
impl
;
import
com.yxproject.start.entity.FilesEntity
;
import
com.yxproject.start.mapper.FilesMapper
;
import
com.yxproject.start.service.FilesService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @auther zhangyusheng
* 2019/3/11 15:08
*/
@Service
public
class
FilesServiceImpl
implements
FilesService
{
@Autowired
private
FilesMapper
filesMapper
;
/**
* 查询xml原文件名详细信息
*
* @param id
* @return
*/
public
List
<
FilesEntity
>
selectFilesEntityById
(
String
id
){
return
filesMapper
.
selectFilesEntity
(
id
);
}
}
src/main/java/com/yxproject/start/service/impl/PreproPersonServiceImpl.java
View file @
95e17839
...
...
@@ -58,7 +58,8 @@ public class PreproPersonServiceImpl implements PreproPersonService {
*/
@Override
public
List
<
PreproPersonEntity
>
selectAllPreproPerson
(
String
uploadNo
,
String
IDCard
,
String
oldFile
,
String
newFile
,
String
SSXQDM
,
String
cardType
,
String
state
,
String
uploadDate
)
{
return
null
;
List
<
PreproPersonEntity
>
preproPersonEntities
=
preproPersonMapper
.
selectPreproPersonCount
(
replace
(
uploadNo
),
replace
(
IDCard
),
replace
(
oldFile
),
replace
(
newFile
),
replace
(
SSXQDM
),
replace
(
cardType
),
replace
(
state
),
replace
(
uploadDate
));
return
preproPersonEntities
;
}
/**
...
...
src/main/java/com/yxproject/start/utils/QuerySequenceSercive.java
View file @
95e17839
...
...
@@ -4,6 +4,9 @@ import com.yxproject.start.mapper.QuerySequenceMapper;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* @auther zhangyusheng
* 2019/3/1 14:54
...
...
@@ -12,9 +15,10 @@ import org.springframework.stereotype.Service;
public
class
QuerySequenceSercive
{
@Autowired
private
QuerySequenceMapper
querySequenceMapper
;
public
String
selectSequenceNextValue
(
String
sequenceName
){
Object
[]
objects
=
querySequenceMapper
.
selectSequenceNextValue
(
sequenceName
+
".nextval"
);
return
""
;
List
<
Map
<
String
,
Object
>>
mapList
=
querySequenceMapper
.
selectSequenceNextValue
(
sequenceName
+
".nextval"
);
return
mapList
.
get
(
0
).
get
(
"NUM2"
).
toString
()
;
}
...
...
src/main/resources/static/js/service.js
View file @
95e17839
...
...
@@ -420,9 +420,9 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
selectTagPrintData
:
function
(
idCard
,
success
){
$http
({
method
:
'GET'
,
url
:
"../
tagPrint/selectTagPrintData
"
+
urlTimeStamp
(),
url
:
"../
ReceiptApi/createReceiptList
"
+
urlTimeStamp
(),
params
:{
id
Card
:
idCard
id
:
idCard
}
}).
then
(
function
successCallback
(
response
)
{
success
(
response
.
data
)
...
...
src/main/resources/static/views/receitp/receitp.js
View file @
95e17839
...
...
@@ -11,6 +11,16 @@ angular.module('AvatarCheck.receitp', ['ngRoute', 'AvatarCheck.http'])
.
controller
(
'receitpCtrl'
,
function
(
$scope
,
$rootScope
,
$timeout
,
HttpService
,
ngDialog
,
MessageService
,
$filter
)
{
//Date picker
$
(
'#datepicker'
).
datetimepicker
({
minView
:
"month"
,
//选择日期后,不会再跳转去选择时分秒
language
:
'zh-CN'
,
format
:
'yyyy-mm-dd'
,
todayBtn
:
1
,
autoclose
:
1
});
$scope
.
choseDate
=
$filter
(
"date"
)(
new
Date
(),
"yyyy-MM-dd"
);
});
\ No newline at end of file
src/main/resources/static/views/tagPrint/tagPrint.html
View file @
95e17839
<!--<style>-->
<!--.table th, .table td {-->
<!--text-align: center;-->
<!--vertical-align: middle!important;-->
<!--}-->
<!--.ul li{-->
<!--cursor: pointer;-->
<!--}-->
<!--.page-list .pagination {float:left;}-->
<!--.page-list .pagination span {cursor: pointer;}-->
<!--.page-list .pagination .separate span{cursor: default; border-top:none;border-bottom:none;}-->
<!--.page-list .pagination .separate span:hover {background: none;}-->
<!--.page-list .page-total {float:left; margin: 25px 20px;}-->
<!--.page-list .page-total input, .page-list .page-total select{height: 26px; border: 1px solid #ddd;}-->
<!--.page-list .page-total input {width: 40px; padding-left:3px;}-->
<!--.page-list .page-total select {width: 50px;}-->
<!--.page-list:after {-->
<!--display: block;-->
<!--clear: both;-->
<!--content: ""-->
<!--}-->
<!--.page-list{-->
<!--zoom: 1-->
<!--}-->
<!--</style>-->
<style>
form
input
{
border
:
0
;
...
...
@@ -37,7 +11,7 @@
}
</style>
<section
class=
"content"
>
<section
class=
"content
row
"
>
<div
class=
"col-md-12 no-padding"
style=
"margin-top:20px;"
>
<div
class=
"box box-primary "
>
<div
class=
"box-header with-border"
>
...
...
src/main/resources/static/views/tagPrint/tagPrint.js
View file @
95e17839
...
...
@@ -1017,35 +1017,6 @@ angular.module('AvatarCheck.tagPrint', ['ngRoute', 'AvatarCheck.http', 'tm.pagin
isPrint
:
1
,
isEwrite
:
1
}
]
}
...
...
@@ -1054,6 +1025,7 @@ angular.module('AvatarCheck.tagPrint', ['ngRoute', 'AvatarCheck.http', 'tm.pagin
$scope
.
searchTagPrintData
=
function
(){
HttpService
.
selectTagPrintData
(
$scope
.
idCard
,
function
(
data
){
$scope
.
tagPrintData
=
data
;
console
.
log
(
$scope
.
tagPrintData
)
})
}
...
...
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