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
d9706c09
Commit
d9706c09
authored
Mar 17, 2019
by
dahai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改保存交接单详单
parent
f6bafd24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
66 deletions
+80
-66
ReceiptApi.java
src/main/java/com/yxproject/start/api/ReceiptApi.java
+70
-56
ReceiptMapper.java
src/main/java/com/yxproject/start/mapper/ReceiptMapper.java
+4
-4
ReceiptService.java
...main/java/com/yxproject/start/service/ReceiptService.java
+1
-1
ReceiptServiceImpl.java
.../com/yxproject/start/service/impl/ReceiptServiceImpl.java
+5
-5
No files found.
src/main/java/com/yxproject/start/api/ReceiptApi.java
View file @
d9706c09
...
...
@@ -76,66 +76,80 @@ public class ReceiptApi {
//根据身份证号查组号
String
groupNo
=
receiptService
.
selectGroupNoById
(
id
);
//查询交接单所需数据
Map
<
String
,
Object
>
receiptListDate
=
receiptService
.
selectReceiptListDate2
(
groupNo
);
ReceiptListEntity
receiptListEntity
=
new
ReceiptListEntity
();
receiptListEntity
.
setPoliceCode
(
receiptListDate
.
get
(
"GAJG_DM"
).
toString
());
receiptListEntity
.
setCardTypeId
(
Long
.
valueOf
((
BigDecimal
)
receiptListDate
.
get
(
"CARD_TYPE"
)+
""
));
if
(
"null"
.
equals
(
receiptListDate
.
get
(
"OLD_CARD_TYPE"
)+
""
)){
}
else
{
receiptListEntity
.
setOldCardTypeId
(
Long
.
valueOf
(
receiptListDate
.
get
(
"OLD_CARD_TYPE"
)+
""
));
}
receiptListEntity
.
setFinishCount
(
Long
.
valueOf
(
receiptListDate
.
get
(
"VALID_COUNT"
).
toString
()));
receiptListEntity
.
setQrCode
(
receiptListDate
.
get
(
"GROUP_NO"
).
toString
());
receiptListEntity
.
setState
((
long
)
0
);
//查询这个组号是否生成了交接单
int
countGroup
=
receiptService
.
selectByGroupNo
(
receiptListDate
.
get
(
"GROUP_NO"
).
toString
());
//没有生成交接单
if
(
countGroup
==
0
)
{
//生成交接单
receiptService
.
createReceiptList
(
receiptListEntity
);
//查询这个身份证是否生成了详单
int
receiptCount
=
receiptService
.
selectReceiptById
(
id
);
//没有生成交接单详单
if
(
receiptCount
==
0
)
{
Map
<
String
,
Object
>
detailedData
=
receiptService
.
selectDetailedData
(
id
);
String
uploadNo
=
(
String
)
detailedData
.
get
(
"UPLOAD_NO"
);
String
acceptNo2
=
(
String
)
detailedData
.
get
(
"ACCEPT_NO"
);
String
name
=
(
String
)
detailedData
.
get
(
"NAME"
);
String
sex
=
(
String
)
detailedData
.
get
(
"SEX"
);
String
cardId
=
(
String
)
detailedData
.
get
(
"CARD_ID"
);
String
gajg_dm
=
(
String
)
detailedData
.
get
(
"GAJG_DM"
);
int
receiptId
=
Integer
.
parseInt
((
BigDecimal
)
detailedData
.
get
(
"ID"
)
+
""
);
//生成详单
receiptService
.
createDetailedList
(
uploadNo
,
acceptNo2
,
name
,
id
,
gajg_dm
,
receiptId
,
sex
);
}
else
{
//不做操作
List
<
Map
<
String
,
Object
>>
receiptListDate
=
receiptService
.
selectReceiptListDate2
(
groupNo
);
for
(
int
i
=
0
;
i
<
receiptListDate
.
size
();
i
++){
ReceiptListEntity
receiptListEntity
=
new
ReceiptListEntity
();
receiptListEntity
.
setPoliceCode
(
receiptListDate
.
get
(
i
).
get
(
"GAJG_DM"
).
toString
());
receiptListEntity
.
setCardTypeId
(
Long
.
valueOf
((
BigDecimal
)
receiptListDate
.
get
(
i
).
get
(
"CARD_TYPE"
)+
""
));
if
(
"null"
.
equals
(
receiptListDate
.
get
(
i
).
get
(
"OLD_CARD_TYPE"
)+
""
)){
}
else
{
receiptListEntity
.
setOldCardTypeId
(
Long
.
valueOf
(
receiptListDate
.
get
(
i
).
get
(
"OLD_CARD_TYPE"
)+
""
));
}
}
else
{
//已生成交接单
//查询这个身份证是否生成了详单
int
receiptCount
=
receiptService
.
selectReceiptById
(
id
);
//未生成交接单详单
if
(
receiptCount
==
0
)
{
//查询交接单详单数据
Map
<
String
,
Object
>
detailedData
=
receiptService
.
selectDetailedData
(
id
);
String
uploadNo
=
(
String
)
detailedData
.
get
(
"UPLOAD_NO"
);
String
acceptNo2
=
(
String
)
detailedData
.
get
(
"ACCEPT_NO"
);
String
name
=
(
String
)
detailedData
.
get
(
"NAME"
);
String
sex
=
(
String
)
detailedData
.
get
(
"SEX"
);
String
gajg_dm
=
(
String
)
detailedData
.
get
(
"GAJG_DM"
);
int
receiptId
=
Integer
.
parseInt
((
BigDecimal
)
detailedData
.
get
(
"ID"
)
+
""
);
//生成详单
receiptService
.
createDetailedList
(
uploadNo
,
acceptNo2
,
name
,
id
,
gajg_dm
,
receiptId
,
sex
);
receiptListEntity
.
setFinishCount
((
long
)
receiptListDate
.
size
());
receiptListEntity
.
setQrCode
(
receiptListDate
.
get
(
i
).
get
(
"GROUP_NO"
).
toString
());
receiptListEntity
.
setState
((
long
)
0
);
//查询这个组号是否生成了交接单
int
countGroup
=
receiptService
.
selectByGroupNo
(
receiptListDate
.
get
(
i
).
get
(
"GROUP_NO"
).
toString
());
//没有生成交接单
if
(
countGroup
==
0
)
{
//生成交接单
receiptService
.
createReceiptList
(
receiptListEntity
);
//todo 查询交接单对应的详单 循环遍历 是否生成对应详单 生成 不做操作 没有生成 遍历插入
for
(
int
n
=
0
;
n
<
receiptListDate
.
size
();
n
++){
// receiptService.
//查询这个身份证是否生成了详单
int
receiptCount
=
receiptService
.
selectReceiptById
(
receiptListDate
.
get
(
n
).
get
(
"ID_NO"
).
toString
());
//没有生成交接单详单
if
(
receiptCount
==
0
)
{
Map
<
String
,
Object
>
detailedData
=
receiptService
.
selectDetailedData
(
receiptListDate
.
get
(
n
).
get
(
"ID_NO"
).
toString
());
String
uploadNo
=
(
String
)
detailedData
.
get
(
"UPLOAD_NO"
);
String
acceptNo2
=
(
String
)
detailedData
.
get
(
"ACCEPT_NO"
);
String
name
=
(
String
)
detailedData
.
get
(
"NAME"
);
String
sex
=
(
String
)
detailedData
.
get
(
"SEX"
);
String
gajg_dm
=
(
String
)
detailedData
.
get
(
"GAJG_DM"
);
int
receiptId
=
Integer
.
parseInt
((
BigDecimal
)
detailedData
.
get
(
"ID"
)
+
""
);
//生成详单
receiptService
.
createDetailedList
(
uploadNo
,
acceptNo2
,
name
,
receiptListDate
.
get
(
i
).
get
(
"GROUP_NO"
).
toString
(),
gajg_dm
,
receiptId
,
sex
);
}
else
{
//不做操作
}
}
}
else
{
//已生成详单,不做操作。
//已生成交接单
//查询这个身份证是否生成了详单
int
receiptCount
=
receiptService
.
selectReceiptById
(
id
);
//未生成交接单详单
if
(
receiptCount
==
0
)
{
//查询交接单详单数据
Map
<
String
,
Object
>
detailedData
=
receiptService
.
selectDetailedData
(
id
);
String
uploadNo
=
(
String
)
detailedData
.
get
(
"UPLOAD_NO"
);
String
acceptNo2
=
(
String
)
detailedData
.
get
(
"ACCEPT_NO"
);
String
name
=
(
String
)
detailedData
.
get
(
"NAME"
);
String
sex
=
(
String
)
detailedData
.
get
(
"SEX"
);
String
gajg_dm
=
(
String
)
detailedData
.
get
(
"GAJG_DM"
);
int
receiptId
=
Integer
.
parseInt
((
BigDecimal
)
detailedData
.
get
(
"ID"
)
+
""
);
//生成详单
receiptService
.
createDetailedList
(
uploadNo
,
acceptNo2
,
name
,
id
,
gajg_dm
,
receiptId
,
sex
);
}
else
{
//已生成详单,不做操作。
}
}
//查询有几个特证
int
specialCardCount
=
receiptService
.
selectSpecialCard
(
receiptListDate
.
get
(
i
).
get
(
"GROUP_NO"
).
toString
());
//减去特证个数
int
finishCount
=
receiptService
.
selectCount
(
receiptListDate
.
get
(
i
).
get
(
"GROUP_NO"
).
toString
())
-
specialCardCount
;
receiptService
.
updateFinishCount
(
receiptListDate
.
get
(
i
).
get
(
"GROUP_NO"
).
toString
(),
finishCount
);
}
//查询有几个特证
int
specialCardCount
=
receiptService
.
selectSpecialCard
(
receiptListDate
.
get
(
"GROUP_NO"
).
toString
());
//减去特证个数
int
finishCount
=
receiptService
.
selectCount
(
receiptListDate
.
get
(
"GROUP_NO"
).
toString
())
-
specialCardCount
;
receiptService
.
updateFinishCount
(
receiptListDate
.
get
(
"GROUP_NO"
).
toString
(),
finishCount
);
}
...
...
src/main/java/com/yxproject/start/mapper/ReceiptMapper.java
View file @
d9706c09
...
...
@@ -26,11 +26,11 @@ public interface ReceiptMapper {
//根据身份证号查组号
@Select
(
"select subStr(ACCEPT_NO,0,8) as groupNo from prod_card_t@PROD_LINK where ID_NO=#{id}"
)
public
String
selectGroupNoById
(
String
id
);
public
List
<
Map
<
String
,
Object
>>
selectGroupNoById
(
String
id
);
//根据组号查询普通证交接单信息
@Select
(
"select prod_group_t.group_no,prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,9) as GAJG_DM,\n"
+
"count(prod_card_t.accept_no) valid_count,GAJG_DM.GAJG_MC, task.CARD_TYPE,task.OLD_CARD_TYPE \n"
+
"count(prod_card_t.accept_no) valid_count,GAJG_DM.GAJG_MC, task.CARD_TYPE,task.OLD_CARD_TYPE
,prod_card_t.id_no,prod_card_t.sex_no,prod_card_t.upload_no
\n"
+
"from prod_card_t@PROD_LINK \n"
+
"left join prod_group_t@PROD_LINK on subStr(prod_card_t.accept_no,0,8)= prod_group_t.group_no \n"
+
"left join group_no on group_no.group_no = prod_group_t.group_no \n"
+
...
...
@@ -38,8 +38,8 @@ public interface ReceiptMapper {
"left join GAJG_DM on subStr(prod_card_t.UPLOAD_NO,0,9)= GAJG_DM.GAJG_DM \n"
+
"where prod_group_t.group_no=#{id} and prod_card_t.accept_no not in (select accept_no from SPECIAL_CARD ) \n"
+
"group by prod_group_t.group_no, prod_card_t.accept_no, subStr(prod_card_t.UPLOAD_NO,0,9), GAJG_DM.GAJG_MC, task.CARD_TYPE, \n"
+
"task.OLD_CARD_TYPE "
)
public
Map
<
String
,
Object
>
selectReceiptListDate2
(
String
id
);
"task.OLD_CARD_TYPE
,prod_card_t.id_no,prod_card_t.sex_no,prod_card_t.upload_no
"
)
public
List
<
Map
<
String
,
Object
>
>
selectReceiptListDate2
(
String
id
);
...
...
src/main/java/com/yxproject/start/service/ReceiptService.java
View file @
d9706c09
...
...
@@ -67,7 +67,7 @@ public interface ReceiptService {
public
Map
<
String
,
Object
>
selectDetailedData2
(
String
id
);
public
Map
<
String
,
Object
>
selectReceiptListDate2
(
String
id
);
public
List
<
Map
<
String
,
Object
>
>
selectReceiptListDate2
(
String
id
);
public
String
selectGroupNoById
(
String
id
);
...
...
src/main/java/com/yxproject/start/service/impl/ReceiptServiceImpl.java
View file @
d9706c09
...
...
@@ -175,15 +175,15 @@ public class ReceiptServiceImpl implements ReceiptService {
}
@Override
public
Map
<
String
,
Object
>
selectReceiptListDate2
(
String
id
)
{
Map
<
String
,
Object
>
resultMap
=
receiptMapper
.
selectReceiptListDate2
(
id
);
return
resultMap
;
public
List
<
Map
<
String
,
Object
>
>
selectReceiptListDate2
(
String
id
)
{
List
<
Map
<
String
,
Object
>>
mapList
=
receiptMapper
.
selectReceiptListDate2
(
id
);
return
mapList
;
}
@Override
public
String
selectGroupNoById
(
String
id
)
{
String
groupNo
=
receiptMapper
.
selectGroupNoById
(
id
);
return
groupNo
;
List
<
Map
<
String
,
Object
>>
mapList
=
receiptMapper
.
selectGroupNoById
(
id
);
return
mapList
.
get
(
0
).
get
(
"GROUPNO"
).
toString
()
;
}
private
List
<
Map
<
String
,
Object
>>
formateMap
(
List
<
Map
<
String
,
Object
>>
maplist
)
{
...
...
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