Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
Overview
Overview
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
base_platform_enterprise
gic-store
Commits
d57a6d48
Commit
d57a6d48
authored
Dec 20, 2019
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clerk store
parent
b6ee0d38
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
24 deletions
+32
-24
ClerkTaskServiceImpl.java
...om/gic/store/service/outer/impl/ClerkTaskServiceImpl.java
+6
-6
StoreTaskServiceImpl.java
...om/gic/store/service/outer/impl/StoreTaskServiceImpl.java
+8
-8
ClerkController.java
...in/java/com/gic/store/web/controller/ClerkController.java
+1
-2
ClerkImportController.java
...a/com/gic/store/web/controller/ClerkImportController.java
+13
-6
StoreImportController.java
...a/com/gic/store/web/controller/StoreImportController.java
+4
-2
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/impl/ClerkTaskServiceImpl.java
View file @
d57a6d48
...
...
@@ -100,12 +100,12 @@ public class ClerkTaskServiceImpl extends AbstractTaskAllocationOperation implem
ClerkDTO
clerkDTO
=
new
ClerkDTO
();
clerkDTO
.
setEnterpriseId
(
t
.
getEnterpriseId
());
clerkDTO
.
setStoreInfoId
(
store
.
getStoreInfoId
());
clerkDTO
.
setClerkName
(
t
.
getClerkName
());
clerkDTO
.
setClerkCode
(
t
.
getClerkCode
());
clerkDTO
.
setClerkGender
(
GenderEnum
.
parseMessage
(
t
.
getClerkGender
()).
getCode
());
clerkDTO
.
setNationcode
(
t
.
getNationcode
());
clerkDTO
.
setPhoneNumber
(
t
.
getPhoneNumber
());
clerkDTO
.
setPositionName
(
t
.
getPositionName
());
clerkDTO
.
setClerkName
(
t
.
getClerkName
()
.
trim
()
);
clerkDTO
.
setClerkCode
(
t
.
getClerkCode
()
.
trim
()
);
clerkDTO
.
setClerkGender
(
GenderEnum
.
parseMessage
(
t
.
getClerkGender
()
.
trim
()
).
getCode
());
clerkDTO
.
setNationcode
(
t
.
getNationcode
()
.
trim
()
);
clerkDTO
.
setPhoneNumber
(
t
.
getPhoneNumber
()
.
trim
()
);
clerkDTO
.
setPositionName
(
t
.
getPositionName
()
.
trim
()
);
clerkDTO
.
setReason
(
ClerkLogReasonEnum
.
WEB
.
getCode
());
clerkDTO
.
setRemark
(
"批量导入"
);
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreTaskServiceImpl.java
View file @
d57a6d48
...
...
@@ -117,14 +117,14 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
storeImportService
.
updateData
(
t
);
}
}
storeDTO
.
setStoreCode
(
t
.
getStoreCode
());
storeDTO
.
setStoreCode
(
t
.
getStoreCode
()
.
trim
()
);
storeDTO
.
setRegionId
(
t
.
getRegionId
());
storeDTO
.
setConactsPhone
(
t
.
getConactsPhone
());
storeDTO
.
setAddress
(
t
.
getAddress
());
storeDTO
.
setConactsPhone
(
t
.
getConactsPhone
()
.
trim
()
);
storeDTO
.
setAddress
(
t
.
getAddress
()
.
trim
()
);
// 判断门店品牌
String
brands
=
t
.
getBrands
();
if
(
StringUtils
.
isNotBlank
(
brands
))
{
String
[]
brandArr
=
brands
.
split
(
"、"
);
String
[]
brandArr
=
brands
.
trim
().
split
(
"、"
);
List
<
TabStoreBrand
>
storeBrandList
=
storeBrandService
.
listAllStoreBrand
(
t
.
getEnterpriseId
(),
null
);
List
<
Integer
>
list
=
new
ArrayList
<>();
for
(
String
brandName
:
brandArr
)
{
...
...
@@ -142,26 +142,26 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
ServiceResponse
<
List
<
CountyDTO
>>
countyResponse
=
provincesApiService
.
selectAllCounty
();
ServiceResponse
<
List
<
ProvinceDTO
>>
provinceResponse
=
provincesApiService
.
selectAllProvince
();
StringBuilder
address
=
new
StringBuilder
();
if
(
StringUtils
.
isNotBlank
(
t
.
getProvince
()))
{
if
(
StringUtils
.
isNotBlank
(
t
.
getProvince
()
.
trim
()
))
{
List
<
ProvinceDTO
>
provinceDTOList
=
provinceResponse
.
getResult
();
Optional
<
ProvinceDTO
>
provinceDTO
=
provinceDTOList
.
stream
().
filter
(
e
->
StringUtils
.
equals
(
e
.
getProvinceName
(),
t
.
getProvince
())).
findFirst
();
storeDTO
.
setProvinceId
(
provinceDTO
.
get
().
getProvinceId
());
address
.
append
(
provinceDTO
.
get
().
getProvinceName
()).
append
(
"/"
);
}
if
(
StringUtils
.
isNotBlank
(
t
.
getCity
()))
{
if
(
StringUtils
.
isNotBlank
(
t
.
getCity
()
.
trim
()
))
{
List
<
CityDTO
>
cityDTOList
=
cityResponse
.
getResult
();
Optional
<
CityDTO
>
cityDTO
=
cityDTOList
.
stream
().
filter
(
e
->
StringUtils
.
equals
(
e
.
getCityName
(),
t
.
getCity
())).
findFirst
();
storeDTO
.
setCityId
(
cityDTO
.
get
().
getCityId
());
address
.
append
(
cityDTO
.
get
().
getCityName
()).
append
(
"/"
);
}
if
(
StringUtils
.
isNotBlank
(
t
.
getCounty
()))
{
if
(
StringUtils
.
isNotBlank
(
t
.
getCounty
()
.
trim
()
))
{
List
<
CountyDTO
>
countyDTOList
=
countyResponse
.
getResult
();
Optional
<
CountyDTO
>
countyDTO
=
countyDTOList
.
stream
().
filter
(
e
->
StringUtils
.
equals
(
e
.
getCountyName
(),
t
.
getCounty
())).
findFirst
();
storeDTO
.
setAreaId
(
countyDTO
.
get
().
getCountyId
());
address
.
append
(
countyDTO
.
get
().
getCountyName
());
}
String
addressStr
=
address
.
toString
();
storeDTO
.
setProvinces
(
addressStr
);
storeDTO
.
setProvinces
(
addressStr
.
trim
()
);
if
(
StringUtils
.
isBlank
(
t
.
getLongitude
())
&&
StringUtils
.
isBlank
(
t
.
getLatitude
())
&&
StringUtils
.
isNotBlank
(
addressStr
))
{
Location
location
=
BaiduMapUtils
.
get
(
addressStr
.
replace
(
"/"
,
""
));
if
(
location
!=
null
)
{
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/ClerkController.java
View file @
d57a6d48
...
...
@@ -25,7 +25,6 @@ import com.gic.store.service.ClerkApiService;
import
com.gic.store.service.ClerkLogApiService
;
import
com.gic.store.web.qo.PageQO
;
import
com.gic.store.web.qo.clerk.ClerkQO
;
import
com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIConversion
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -138,7 +137,7 @@ public class ClerkController extends DownloadUtils {
logger
.
warn
(
"下载错误"
,
e
);
}
});
return
RestResponse
.
success
();
return
RestResponse
.
success
(
reportId
);
}
private
String
getDataContent
()
{
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/ClerkImportController.java
View file @
d57a6d48
...
...
@@ -233,11 +233,13 @@ public class ClerkImportController {
// 验证导购名
String
clerkName
=
row
.
get
(
1
);
bean
.
setClerkName
(
clerkName
);
if
(
StringUtils
.
isBlank
(
clerkName
))
{
bean
.
setErrorMessage
(
"导购名称不能为空"
);
validate
=
false
;
}
clerkName
=
clerkName
.
trim
();
bean
.
setClerkName
(
clerkName
);
if
(
validate
)
{
if
(
this
.
lengthValidate
(
clerkName
,
20
))
{
bean
.
setErrorMessage
(
"导购名称长度超过20个字"
);
...
...
@@ -246,13 +248,14 @@ public class ClerkImportController {
}
// 验证导购code
String
clerkCode
=
row
.
get
(
2
);
bean
.
setClerkCode
(
clerkCode
);
if
(
validate
)
{
if
(
StringUtils
.
isBlank
(
clerkCode
))
{
bean
.
setErrorMessage
(
"导购关联主键不能为空"
);
validate
=
false
;
}
}
clerkCode
=
clerkCode
.
trim
();
bean
.
setClerkCode
(
clerkCode
);
if
(
validate
)
{
if
(
this
.
lengthValidate
(
clerkCode
,
20
))
{
bean
.
setErrorMessage
(
"导购关联主键超过20个字"
);
...
...
@@ -261,13 +264,14 @@ public class ClerkImportController {
}
// 验证门店name
String
storeName
=
row
.
get
(
3
);
bean
.
setStoreName
(
storeName
);
if
(
validate
)
{
if
(
StringUtils
.
isBlank
(
storeName
))
{
bean
.
setErrorMessage
(
"门店名不能为空"
);
validate
=
false
;
}
}
storeName
=
storeName
.
trim
();
bean
.
setStoreName
(
storeName
);
if
(
validate
)
{
if
(
this
.
lengthValidate
(
storeName
,
20
))
{
bean
.
setErrorMessage
(
"门店名超过20个字"
);
...
...
@@ -276,13 +280,14 @@ public class ClerkImportController {
}
// 验证门店code
String
storeCode
=
row
.
get
(
4
);
bean
.
setStoreCode
(
storeCode
);
if
(
validate
)
{
if
(
StringUtils
.
isBlank
(
storeCode
))
{
bean
.
setErrorMessage
(
"门店关联主键不能为空"
);
validate
=
false
;
}
}
storeCode
=
storeCode
.
trim
();
bean
.
setStoreCode
(
storeCode
);
if
(
validate
)
{
if
(
this
.
lengthValidate
(
storeCode
,
20
))
{
bean
.
setErrorMessage
(
"门店关联主键超过20个字"
);
...
...
@@ -305,13 +310,14 @@ public class ClerkImportController {
}
// 验证岗位
String
positionName
=
row
.
get
(
5
);
bean
.
setPositionName
(
positionName
);
if
(
validate
)
{
if
(
StringUtils
.
isNotBlank
(
positionName
)
&&
this
.
lengthValidate
(
storeCode
,
20
))
{
bean
.
setErrorMessage
(
"岗位超过20个字"
);
validate
=
false
;
}
}
positionName
=
positionName
.
trim
();
bean
.
setPositionName
(
positionName
);
// 验证性别
String
gender
=
row
.
get
(
6
);
bean
.
setClerkGender
(
gender
);
...
...
@@ -329,10 +335,11 @@ public class ClerkImportController {
}
// 验证区号
String
nationcode
=
row
.
get
(
7
);
bean
.
setNationcode
(
nationcode
);
if
(
StringUtils
.
isBlank
(
nationcode
))
{
nationcode
=
"086"
;
}
nationcode
=
nationcode
.
trim
();
bean
.
setNationcode
(
nationcode
);
if
(
validate
)
{
if
(
this
.
lengthValidate
(
nationcode
,
10
))
{
bean
.
setErrorMessage
(
"区号超过10个字"
);
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreImportController.java
View file @
d57a6d48
...
...
@@ -308,11 +308,12 @@ public class StoreImportController {
// 验证门店名称
String
storeName
=
row
.
get
(
1
);
bean
.
setStoreName
(
storeName
);
if
(
StringUtils
.
isBlank
(
storeName
))
{
bean
.
setErrorMessage
(
"门店名称不能为空"
);
validate
=
false
;
}
storeName
=
storeName
.
trim
();
bean
.
setStoreName
(
storeName
);
if
(
validate
)
{
if
(
this
.
lengthValidate
(
storeName
,
20
))
{
bean
.
setErrorMessage
(
"门店名称长度超过20个字"
);
...
...
@@ -328,13 +329,14 @@ public class StoreImportController {
}
// 验证门店代码
String
storeCode
=
row
.
get
(
2
);
bean
.
setStoreCode
(
storeCode
);
if
(
validate
)
{
if
(
StringUtils
.
isBlank
(
storeCode
))
{
bean
.
setErrorMessage
(
"门店关联主键不能为空"
);
validate
=
false
;
}
}
storeCode
=
storeCode
.
trim
();
bean
.
setStoreCode
(
storeCode
);
if
(
validate
)
{
if
(
this
.
lengthValidate
(
storeCode
,
20
))
{
bean
.
setErrorMessage
(
"门店关联主键长度超过20个字"
);
...
...
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