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
0c011dae
Commit
0c011dae
authored
Mar 09, 2019
by
dahai
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
776c6e99
757cae48
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
10 deletions
+109
-10
FailedCardApi.java
src/main/java/com/yxproject/start/api/FailedCardApi.java
+53
-4
FailedCardMapper.java
...ain/java/com/yxproject/start/mapper/FailedCardMapper.java
+30
-5
FailedCardService.java
...n/java/com/yxproject/start/service/FailedCardService.java
+6
-1
FailedCardServiceImpl.java
...m/yxproject/start/service/impl/FailedCardServiceImpl.java
+20
-0
No files found.
src/main/java/com/yxproject/start/api/FailedCardApi.java
View file @
0c011dae
package
com
.
yxproject
.
start
.
api
;
package
com
.
yxproject
.
start
.
api
;
import
com.yxproject.start.entity.TaskEntity
;
import
com.yxproject.start.entity.TaskList.TaskListEntity
;
import
com.yxproject.start.service.FailedCardService
;
import
com.yxproject.start.service.FailedCardService
;
import
net.sf.json.JSON
;
import
com.yxproject.start.service.TaskListService
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -21,6 +24,8 @@ import java.util.Map;
...
@@ -21,6 +24,8 @@ import java.util.Map;
public
class
FailedCardApi
{
public
class
FailedCardApi
{
@Autowired
@Autowired
private
FailedCardService
failedCardService
;
private
FailedCardService
failedCardService
;
@Autowired
private
TaskListService
taskListService
;
/**
/**
* 查询所有废证类型
* 查询所有废证类型
...
@@ -54,13 +59,57 @@ public class FailedCardApi {
...
@@ -54,13 +59,57 @@ public class FailedCardApi {
* @return
* @return
*/
*/
@RequestMapping
(
"insertFailedCard"
)
@RequestMapping
(
"insertFailedCard"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
insertFailedCard
(
@RequestBody
String
jsonStr
){
public
Boolean
insertFailedCard
(
@RequestBody
String
jsonStr
){
JSONArray
jsonarray
=
JSONArray
.
fromObject
(
jsonStr
);
JSONArray
jsonarray
=
JSONArray
.
fromObject
(
jsonStr
);
for
(
Object
o:
jsonarray
){
for
(
Object
o:
jsonarray
){
JSONObject
jsonObject
=(
JSONObject
)
o
;
JSONObject
jsonObject
=(
JSONObject
)
o
;
Map
<
String
,
Object
>
idMap
=
failedCardService
.
selectCountIdByCardId
(
jsonObject
.
get
(
"cardId"
).
toString
());
Map
<
String
,
Object
>
idMap
=
failedCardService
.
selectCountIdByCardId
(
jsonObject
.
getString
(
"cardId"
));
failedCardService
.
insertFailedCard
(
jsonObject
.
get
(
"failedCardReasonId"
).
toString
(),
idMap
.
get
(
"acceptNo"
).
toString
(),
idMap
.
get
(
"taskId"
).
toString
(),
jsonObject
.
get
(
"initiator"
).
toString
(),
jsonObject
.
get
(
"note"
).
toString
());
failedCardService
.
insertFailedCard
(
jsonObject
.
getString
(
"failedCardReasonId"
),
idMap
.
get
(
"ACCEPT_NO"
).
toString
(),
idMap
.
get
(
"TASK_ID"
).
toString
(),
jsonObject
.
getString
(
"initiator"
),
jsonObject
.
getString
(
"note"
));
}
}
return
true
;
}
/**
* 查询所有废证类型
* @return
*/
@RequestMapping
(
"selectRemainingCardDic"
)
public
List
<
String
>
selectRemainingCardDic
(){
List
<
String
>
resultList
=
failedCardService
.
selectFailedCardDic
();
return
resultList
;
}
/**
* 生成余证(每个余证生成一个任务单)
* @param jsonStr
* @return
*/
@RequestMapping
(
"insertRemaining"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
insertRemaining
(
@RequestBody
String
jsonStr
){
JSONArray
jsonarray
=
JSONArray
.
fromObject
(
jsonStr
);
TaskEntity
taskEntity
=
new
TaskEntity
();
List
<
Object
>
taskEntityList
=
new
ArrayList
<>();
//TODO 多张余证可以生成一张任务单 判断是否是同一个countyCode
for
(
Object
o:
jsonarray
)
{
JSONObject
jsonObject
=(
JSONObject
)
o
;
/*查询生成任务单需要的数据*/
Map
<
String
,
Object
>
resultMap
=
failedCardService
.
selectTaskListDate
(
jsonObject
.
getString
(
"ACCEPT_NO"
));
String
countyCode
=
resultMap
.
get
(
"COUNTY_CODE"
).
toString
();
Long
cardType
=
(
Long
)
resultMap
.
get
(
"CARD_TYPE_ID"
);
taskEntity
.
setCountyCode
(
countyCode
);
taskEntity
.
setCardType
(
cardType
);
taskEntity
.
setTaskStateId
((
long
)
1
);
taskEntityList
.
add
(
taskEntity
);
taskListService
.
saveTask
(
taskEntity
);
/*特证表添加特证*/
failedCardService
.
addSpecialCard
(
jsonObject
.
getString
(
"ACCEPT_NO"
));
/*特证数+1*/
failedCardService
.
specialCardAdd
(
jsonObject
.
getString
(
"ACCEPT_NO"
));
}
return
true
;
return
true
;
}
}
...
...
src/main/java/com/yxproject/start/mapper/FailedCardMapper.java
View file @
0c011dae
package
com
.
yxproject
.
start
.
mapper
;
package
com
.
yxproject
.
start
.
mapper
;
import
org.apache.ibatis.annotations.Insert
;
import
org.apache.ibatis.annotations.*
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.omg.CORBA.PUBLIC_MEMBER
;
import
org.omg.CORBA.PUBLIC_MEMBER
;
import
java.util.List
;
import
java.util.List
;
...
@@ -44,7 +41,7 @@ public interface FailedCardMapper {
...
@@ -44,7 +41,7 @@ public interface FailedCardMapper {
* @param note
* @param note
* @return
* @return
*/
*/
@Insert
(
"INSERT INTO FAILED_CARD (FAILED_CARD_REASON_ID,ACCEPT_NO,TASK_ID,STATE,INITIATOR,NOTE) VALUES (#{failedCardReasonId},#{acceptNo},#{taskId},
0
,#{initiator},#{note})\n"
)
@Insert
(
"INSERT INTO FAILED_CARD (FAILED_CARD_REASON_ID,ACCEPT_NO,TASK_ID,STATE,INITIATOR,NOTE) VALUES (#{failedCardReasonId},#{acceptNo},#{taskId},
1
,#{initiator},#{note})\n"
)
public
boolean
insertFailedCard
(
@Param
(
"failedCardReasonId"
)
String
failedCardReasonId
,
@Param
(
"acceptNo"
)
String
acceptNo
,
@Param
(
"taskId"
)
String
taskId
,
@Param
(
"initiator"
)
String
initiator
,
@Param
(
"note"
)
String
note
);
public
boolean
insertFailedCard
(
@Param
(
"failedCardReasonId"
)
String
failedCardReasonId
,
@Param
(
"acceptNo"
)
String
acceptNo
,
@Param
(
"taskId"
)
String
taskId
,
@Param
(
"initiator"
)
String
initiator
,
@Param
(
"note"
)
String
note
);
...
@@ -54,4 +51,32 @@ public interface FailedCardMapper {
...
@@ -54,4 +51,32 @@ public interface FailedCardMapper {
"WHERE PROD_CARD_T.ID_NO=#{cardId} or PROD_CARD_T.ACCEPT_NO=#{cardId}"
)
"WHERE PROD_CARD_T.ID_NO=#{cardId} or PROD_CARD_T.ACCEPT_NO=#{cardId}"
)
public
Map
<
String
,
Object
>
selectCountIdByCardId
(
String
cardId
);
public
Map
<
String
,
Object
>
selectCountIdByCardId
(
String
cardId
);
/*余证*/
@Update
(
"update group_no \n"
+
"set group_no.SPECIAL_CARD_COUNT=group_no.SPECIAL_CARD_COUNT+1 \n"
+
"where group_no.group_no=(select group_no from PROD_CARD_T@PROD_LINK \n"
+
"left join group_no on group_no.GROUP_NO=subStr(PROD_CARD_T.ACCEPT_NO,0,8)\n"
+
"where PROD_CARD_T.accept_no =#{acceptNo}) "
)
public
boolean
specialCardAdd
(
@Param
(
"acceptNo"
)
String
acceptNo
);
@Insert
(
"insert into SPECIAL_CARD (ACCEPT_NO,TASK_ID,SPECIAL_TYPE,GROUP_NO,INITIATOR,FILL_IN_DATE,REMARK)\n"
+
"values(\n"
+
"#{acceptNo},(select TASK_ID from group_no where group_no=subStr(#{acceptNo})),1,"
+
"subStr(#{acceptNo}),#{initiator},#{date},#{remark})\n"
)
public
boolean
addSpecialCard
(
@Param
(
"acceptNo"
)
String
acceptNo
);
@Select
(
"select SPECIAL_CARD.SPECIAL_TYPE,subStr(prod_card_t.UPLOAD_NO,0,6),SPECIAL_CARD.INITIATOR,PREPRO_PERSON.CARD_TYPE_ID\n"
+
"from prod_card_t@prod_link\n"
+
"left join SPECIAL_CARD on prod_card_t.accept_no = SPECIAL_CARD.accept_no\n"
+
"left join PREPRO_PERSON on PREPRO_PERSON.JMSFZSLH=prod_card_t.UPLOAD_NO\n"
+
"where prod_card_t.accept_no=#{acceptNo}"
)
public
Map
<
String
,
Object
>
selectTaskListDate
(
String
acceptNo
);
}
}
src/main/java/com/yxproject/start/service/FailedCardService.java
View file @
0c011dae
package
com
.
yxproject
.
start
.
service
;
package
com
.
yxproject
.
start
.
service
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.omg.CORBA.PUBLIC_MEMBER
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -15,4 +14,10 @@ public interface FailedCardService {
...
@@ -15,4 +14,10 @@ public interface FailedCardService {
public
boolean
insertFailedCard
(
@Param
(
"failedCardReasonId"
)
String
failedCardReasonId
,
@Param
(
"acceptNo"
)
String
acceptNo
,
@Param
(
"taskId"
)
String
taskId
,
@Param
(
"initiator"
)
String
initiator
,
@Param
(
"note"
)
String
note
);
public
boolean
insertFailedCard
(
@Param
(
"failedCardReasonId"
)
String
failedCardReasonId
,
@Param
(
"acceptNo"
)
String
acceptNo
,
@Param
(
"taskId"
)
String
taskId
,
@Param
(
"initiator"
)
String
initiator
,
@Param
(
"note"
)
String
note
);
public
Map
<
String
,
Object
>
selectCountIdByCardId
(
String
cardId
);
public
Map
<
String
,
Object
>
selectCountIdByCardId
(
String
cardId
);
public
boolean
specialCardAdd
(
@Param
(
"acceptNo"
)
String
acceptNo
);
public
boolean
addSpecialCard
(
@Param
(
"acceptNo"
)
String
acceptNo
);
public
Map
<
String
,
Object
>
selectTaskListDate
(
@Param
(
"acceptNo"
)
String
acceptNo
);
}
}
src/main/java/com/yxproject/start/service/impl/FailedCardServiceImpl.java
View file @
0c011dae
...
@@ -35,4 +35,24 @@ public class FailedCardServiceImpl implements FailedCardService {
...
@@ -35,4 +35,24 @@ public class FailedCardServiceImpl implements FailedCardService {
Map
<
String
,
Object
>
result
=
failedCardMapper
.
selectCountIdByCardId
(
cardId
);
Map
<
String
,
Object
>
result
=
failedCardMapper
.
selectCountIdByCardId
(
cardId
);
return
result
;
return
result
;
}
}
@Override
public
boolean
specialCardAdd
(
String
acceptNo
)
{
failedCardMapper
.
specialCardAdd
(
acceptNo
);
return
true
;
}
@Override
public
boolean
addSpecialCard
(
String
acceptNo
)
{
failedCardMapper
.
addSpecialCard
(
acceptNo
);
return
true
;
}
@Override
public
Map
<
String
,
Object
>
selectTaskListDate
(
String
acceptNo
)
{
Map
<
String
,
Object
>
resultList
=
failedCardMapper
.
selectTaskListDate
(
acceptNo
);
return
resultList
;
}
}
}
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