Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
task-kolon
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
piplus-v3
task-kolon
Commits
e88b2d8b
Commit
e88b2d8b
authored
Jun 24, 2016
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加生日字段
parent
27e012e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
11 deletions
+44
-11
KolonMember.java
src/main/java/com/hdp/pi/domain/kolon/KolonMember.java
+5
-0
KolonMemberDTO.java
src/main/java/com/hdp/pi/dto/kolon/KolonMemberDTO.java
+13
-9
KolonMemberServiceImpl.java
...java/com/hdp/pi/service/kolon/KolonMemberServiceImpl.java
+5
-2
Util.java
src/main/java/com/hdp/pi/utils/kolon/Util.java
+21
-0
No files found.
src/main/java/com/hdp/pi/domain/kolon/KolonMember.java
View file @
e88b2d8b
...
@@ -92,4 +92,9 @@ public class KolonMember implements Serializable {
...
@@ -92,4 +92,9 @@ public class KolonMember implements Serializable {
@Column
(
name
=
"update_time"
,
nullable
=
true
)
@Column
(
name
=
"update_time"
,
nullable
=
true
)
public
Date
updateTime
;
public
Date
updateTime
;
/**
* 生日
*/
@Column
(
name
=
"birthday"
,
nullable
=
true
)
public
Date
birthday
;
}
}
src/main/java/com/hdp/pi/dto/kolon/KolonMemberDTO.java
View file @
e88b2d8b
...
@@ -15,6 +15,8 @@ public class KolonMemberDTO implements Serializable {
...
@@ -15,6 +15,8 @@ public class KolonMemberDTO implements Serializable {
public
String
cardNo
;
public
String
cardNo
;
public
String
birthday
;
public
String
phone
;
public
String
phone
;
public
String
lastName
;
public
String
lastName
;
...
@@ -42,22 +44,24 @@ public class KolonMemberDTO implements Serializable {
...
@@ -42,22 +44,24 @@ public class KolonMemberDTO implements Serializable {
public
KolonMemberDTO
(
String
[]
row
)
{
public
KolonMemberDTO
(
String
[]
row
)
{
super
();
super
();
this
.
csNo
=
Util
.
getByIndex
(
row
,
1
);
this
.
csNo
=
Util
.
getByIndex
(
row
,
1
);
this
.
status
=
CONSTANTS
.
STATUS
.
get
(
Util
.
getByIndex
(
row
,
2
));
this
.
birthday
=
Util
.
getByIndex
(
row
,
2
);
String
b_str
=
Util
.
getByIndex
(
row
,
3
);
this
.
status
=
CONSTANTS
.
STATUS
.
get
(
Util
.
getByIndex
(
row
,
3
));
String
b_str
=
Util
.
getByIndex
(
row
,
4
);
if
(
StringUtils
.
isNotEmpty
(
b_str
)){
if
(
StringUtils
.
isNotEmpty
(
b_str
)){
this
.
bonus
=
Integer
.
valueOf
(
b_str
);
this
.
bonus
=
Integer
.
valueOf
(
b_str
);
}
else
{
}
else
{
this
.
bonus
=
0
;
this
.
bonus
=
0
;
}
}
this
.
cardNo
=
Util
.
getByIndex
(
row
,
4
);
this
.
cardNo
=
Util
.
getByIndex
(
row
,
5
);
this
.
lifecycle
=
Util
.
getByIndex
(
row
,
5
);
this
.
lifecycle
=
Util
.
getByIndex
(
row
,
6
);
this
.
customerType
=
CONSTANTS
.
CUSTERMERTYPE
.
get
(
Util
.
getByIndex
(
row
,
6
));
this
.
customerType
=
CONSTANTS
.
CUSTERMERTYPE
.
get
(
Util
.
getByIndex
(
row
,
7
));
this
.
firstName
=
Util
.
getByIndex
(
row
,
7
);
this
.
firstName
=
Util
.
getByIndex
(
row
,
8
);
this
.
lastName
=
Util
.
getByIndex
(
row
,
8
);
this
.
lastName
=
Util
.
getByIndex
(
row
,
9
);
this
.
email
=
Util
.
getByIndex
(
row
,
9
);
this
.
email
=
Util
.
getByIndex
(
row
,
10
);
this
.
phone
=
Util
.
getByIndex
(
row
,
1
0
);
this
.
phone
=
Util
.
getByIndex
(
row
,
1
1
);
this
.
wechatLastName
=
this
.
lastName
;
this
.
wechatLastName
=
this
.
lastName
;
this
.
wechatFirstName
=
this
.
firstName
;
this
.
wechatFirstName
=
this
.
firstName
;
}
}
}
}
src/main/java/com/hdp/pi/service/kolon/KolonMemberServiceImpl.java
View file @
e88b2d8b
...
@@ -90,8 +90,8 @@ public class KolonMemberServiceImpl implements KolonMemberService {
...
@@ -90,8 +90,8 @@ public class KolonMemberServiceImpl implements KolonMemberService {
String
csNo
=
kolonMemberDTO
.
csNo
;
String
csNo
=
kolonMemberDTO
.
csNo
;
KolonMember
kolonMember
=
null
;
KolonMember
kolonMember
=
null
;
//没有phone和csNo,不处理
//没有phone和csNo
、cardNo
,不处理
if
(!
StringUtils
.
isNotEmpty
(
kolonMemberDTO
.
phone
)
&&
!
StringUtils
.
isNotEmpty
(
csNo
)){
if
(!
StringUtils
.
isNotEmpty
(
kolonMemberDTO
.
phone
)
&&
!
StringUtils
.
isNotEmpty
(
csNo
)
&&
!
StringUtils
.
isNotEmpty
(
kolonMemberDTO
.
cardNo
)
){
return
null
;
return
null
;
}
}
...
@@ -111,6 +111,7 @@ public class KolonMemberServiceImpl implements KolonMemberService {
...
@@ -111,6 +111,7 @@ public class KolonMemberServiceImpl implements KolonMemberService {
kolonMember
.
lifecycle
=
kolonMemberDTO
.
lifecycle
;
kolonMember
.
lifecycle
=
kolonMemberDTO
.
lifecycle
;
kolonMember
.
customerType
=
kolonMemberDTO
.
customerType
;
kolonMember
.
customerType
=
kolonMemberDTO
.
customerType
;
kolonMember
.
dataSource
=
2
;
kolonMember
.
dataSource
=
2
;
kolonMember
.
birthday
=
Util
.
StringToDate
(
kolonMemberDTO
.
birthday
);
Date
date
=
new
Date
();
Date
date
=
new
Date
();
kolonMember
.
joinTime
=
date
;
kolonMember
.
joinTime
=
date
;
kolonMember
.
updateTime
=
date
;
kolonMember
.
updateTime
=
date
;
...
@@ -179,6 +180,7 @@ public class KolonMemberServiceImpl implements KolonMemberService {
...
@@ -179,6 +180,7 @@ public class KolonMemberServiceImpl implements KolonMemberService {
String
sortName
=
name
.
substring
(
name
.
lastIndexOf
(
"/"
)
+
1
,
name
.
length
());
String
sortName
=
name
.
substring
(
name
.
lastIndexOf
(
"/"
)
+
1
,
name
.
length
());
if
(
ftpMemberUtil
.
contains
(
sortName
)){
if
(
ftpMemberUtil
.
contains
(
sortName
)){
List
<
String
[]>
list
=
ftpMemberUtil
.
readCSVFile
(
sortName
);
List
<
String
[]>
list
=
ftpMemberUtil
.
readCSVFile
(
sortName
);
LOGGER
.
info
(
"正在导入"
+
sortName
+
"共"
+
list
.
size
()
+
"条"
);
if
(
list
!=
null
)
{
if
(
list
!=
null
)
{
boolean
firstRow
=
true
;
boolean
firstRow
=
true
;
int
i
=
1
;
int
i
=
1
;
...
@@ -206,6 +208,7 @@ public class KolonMemberServiceImpl implements KolonMemberService {
...
@@ -206,6 +208,7 @@ public class KolonMemberServiceImpl implements KolonMemberService {
kolonMemberRepository
.
save
(
insertKolonMember
);
kolonMemberRepository
.
save
(
insertKolonMember
);
}
}
}
}
LOGGER
.
info
(
"导入完成"
);
ftpMemberUtil
.
moveFile
(
sortName
);
ftpMemberUtil
.
moveFile
(
sortName
);
}
}
}
}
...
...
src/main/java/com/hdp/pi/utils/kolon/Util.java
View file @
e88b2d8b
package
com
.
hdp
.
pi
.
utils
.
kolon
;
package
com
.
hdp
.
pi
.
utils
.
kolon
;
import
java.time.Instant
;
import
java.time.LocalDate
;
import
java.time.ZoneId
;
import
java.util.Date
;
public
class
Util
{
public
class
Util
{
...
@@ -29,4 +34,20 @@ public class Util {
...
@@ -29,4 +34,20 @@ public class Util {
}
}
return
row
[
index
];
return
row
[
index
];
}
}
/**
* 时间转Date
* @param time
* @return
*/
public
static
Date
StringToDate
(
String
time
)
{
if
(!
isNotNull
(
time
)){
return
null
;
}
LocalDate
localDate
=
LocalDate
.
parse
(
time
);
ZoneId
zone
=
ZoneId
.
systemDefault
();
Instant
instant
=
localDate
.
atStartOfDay
().
atZone
(
zone
).
toInstant
();
java
.
util
.
Date
date
=
Date
.
from
(
instant
);
return
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