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
61a1a95e
Commit
61a1a95e
authored
Jul 04, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
e2556f29
cb185b9d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
89 additions
and
42 deletions
+89
-42
Constants.java
...e-api/src/main/java/com/gic/store/constant/Constants.java
+11
-0
StoreImportApiService.java
...ain/java/com/gic/store/service/StoreImportApiService.java
+2
-0
TabStoreTmpMapper.java
...main/java/com/gic/store/dao/mapper/TabStoreTmpMapper.java
+4
-1
StoreImportServiceImpl.java
...va/com/gic/store/service/impl/StoreImportServiceImpl.java
+2
-2
StoreTaskServiceImpl.java
...java/com/gic/store/service/impl/StoreTaskServiceImpl.java
+4
-4
StoreImportApiServiceImpl.java
...om/gic/store/service/outer/StoreImportApiServiceImpl.java
+10
-9
TabStoreTmpMapper.xml
...e-service/src/main/resources/mapper/TabStoreTmpMapper.xml
+10
-5
pom.xml
gic-store-web/pom.xml
+6
-0
Main.java
gic-store-web/src/main/java/com/gic/store/web/Main.java
+13
-2
StoreImportController.java
...a/com/gic/store/web/controller/StoreImportController.java
+27
-19
No files found.
gic-store-api/src/main/java/com/gic/store/constant/Constants.java
0 → 100644
View file @
61a1a95e
package
com
.
gic
.
store
.
constant
;
/**
* @author zhiwj
* @date 2019/7/4
*/
public
interface
Constants
{
String
STORE_BATCH_IMPORT_MQ_KEY
=
"tmpStoreBatchImportTaskMq4"
;
// String STORE_BATCH_IMPORT_MQ_KEY = "tmpStoreBatchImportTaskMq4.0";
Integer
STORE_BATCH_IMPORT_TASK_TYPE
=
6
;
}
gic-store-api/src/main/java/com/gic/store/service/StoreImportApiService.java
View file @
61a1a95e
...
...
@@ -32,4 +32,6 @@ public interface StoreImportApiService {
ServiceResponse
<
String
>
isExistStoreGroup
(
Integer
enterpriseId
,
String
storeGroupName
);
ServiceResponse
<
List
<
String
>>
listBrandByNotExist
(
Integer
enterpriseId
,
String
brands
);
// List<StoreTmpDTO> listStoreTmp(Integer enterpriseId, Boolean isSuccess, Boolean isWait);
}
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabStoreTmpMapper.java
View file @
61a1a95e
...
...
@@ -58,5 +58,7 @@ public interface TabStoreTmpMapper {
void
delStoreTmp
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
List
<
TabStoreTmp
>
listStoreTmp
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"isSuccess"
)
Boolean
isSuccess
,
@Param
(
"isWait"
)
Boolean
isWait
);
List
<
TabStoreTmp
>
listStoreTmp
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"isSuccess"
)
Boolean
isSuccess
);
List
<
TabStoreTmp
>
listUnImportStore
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/service/impl/StoreImportServiceImpl.java
View file @
61a1a95e
...
...
@@ -43,12 +43,12 @@ public class StoreImportServiceImpl implements StoreImportService {
@Override
public
Page
listStoreTmp
(
Integer
enterpriseId
,
boolean
isSuccess
,
Integer
currentPage
,
Integer
pageSize
)
{
PageHelper
.
startPage
(
currentPage
,
pageSize
);
return
(
Page
)
tabStoreTmpMapper
.
listStoreTmp
(
enterpriseId
,
isSuccess
,
null
);
return
(
Page
)
tabStoreTmpMapper
.
listStoreTmp
(
enterpriseId
,
isSuccess
);
}
@Override
public
List
<
TabStoreTmp
>
listUnImportStore
(
String
enterpriseId
)
{
return
tabStoreTmpMapper
.
list
StoreTmp
(
Integer
.
parseInt
(
enterpriseId
),
null
,
true
);
return
tabStoreTmpMapper
.
list
UnImportStore
(
Integer
.
parseInt
(
enterpriseId
)
);
}
@Override
...
...
gic-store-service/src/main/java/com/gic/store/service/impl/StoreTaskServiceImpl.java
View file @
61a1a95e
...
...
@@ -133,8 +133,8 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
if
(
erpStatusResponse
.
isSuccess
())
{
List
<
StoreDictDTO
>
erpList
=
erpStatusResponse
.
getResult
();
final
String
erpStatusTmp
=
t
.
getErpStatus
().
replace
(
"\\s+"
,
""
);
Optional
<
StoreDictDTO
>
erpStatusDTO
=
erpList
.
stream
().
filter
(
e
->
e
.
get
Value
().
equals
(
erpStatusTmp
)).
findFirst
();
storeDTO
.
setErpStatus
(
Integer
.
parseInt
(
erpStatusDTO
.
get
().
get
Key
()));
Optional
<
StoreDictDTO
>
erpStatusDTO
=
erpList
.
stream
().
filter
(
e
->
e
.
get
Key
().
equals
(
erpStatusTmp
)).
findFirst
();
storeDTO
.
setErpStatus
(
Integer
.
parseInt
(
erpStatusDTO
.
get
().
get
Value
()));
}
else
{
logger
.
warn
(
"字典模块调用失败"
);
}
...
...
@@ -143,8 +143,8 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
if
(
storeTypeResponse
.
isSuccess
())
{
List
<
StoreDictDTO
>
typeList
=
storeTypeResponse
.
getResult
();
final
String
typeTmp
=
t
.
getStoreType
().
replace
(
"\\s+"
,
""
);
Optional
<
StoreDictDTO
>
typeTmpDTO
=
typeList
.
stream
().
filter
(
e
->
e
.
get
Value
().
equals
(
typeTmp
)).
findFirst
();
storeDTO
.
setStoreType
(
Integer
.
parseInt
(
typeTmpDTO
.
get
().
get
Key
()));
Optional
<
StoreDictDTO
>
typeTmpDTO
=
typeList
.
stream
().
filter
(
e
->
e
.
get
Key
().
equals
(
typeTmp
)).
findFirst
();
storeDTO
.
setStoreType
(
Integer
.
parseInt
(
typeTmpDTO
.
get
().
get
Value
()));
}
else
{
logger
.
warn
(
"字典模块调用失败"
);
}
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/StoreImportApiServiceImpl.java
View file @
61a1a95e
...
...
@@ -34,9 +34,6 @@ public class StoreImportApiServiceImpl implements StoreImportApiService {
private
StoreBrandService
storeBrandService
;
@Autowired
private
StoreApiService
storeApiService
;
@Autowired
private
StoreService
storeService
;
@Autowired
...
...
@@ -46,12 +43,6 @@ public class StoreImportApiServiceImpl implements StoreImportApiService {
private
StoreGroupService
storeGroupService
;
@Autowired
private
ProvincesApiService
provincesApiService
;
@Autowired
private
StoreDictApiService
storeDictApiService
;
@Autowired
private
StoreTaskService
storeTaskService
;
@Override
...
...
@@ -118,4 +109,14 @@ public class StoreImportApiServiceImpl implements StoreImportApiService {
}
return
ServiceResponse
.
failure
(
ErrorCode
.
ERR_3
.
getCode
(),
"队列错误"
);
}
// @Autowired
// TabStoreTmpMapper tabStoreTmpMapper;
//
// @Override
// public List<StoreTmpDTO> listStoreTmp(Integer enterpriseId, Boolean isSuccess, Boolean isWait) {
// return EntityUtil.changeEntityListByOrika(StoreTmpDTO.class, tabStoreTmpMapper.listStoreTmp(enterpriseId, isSuccess, isWait));
// }
}
gic-store-service/src/main/resources/mapper/TabStoreTmpMapper.xml
View file @
61a1a95e
...
...
@@ -327,14 +327,18 @@
<include
refid=
"Base_Column_List"
/>
from tab_store_tmp
where enterprise_id = #{enterpriseId}
<if
test=
"isSuccess != null and isSuccess"
>
<if
test=
"isSuccess != null and isSuccess
== true
"
>
and error_message = 'success'
</if>
<if
test=
"isSuccess != null and
!isSuccess
"
>
<if
test=
"isSuccess != null and
isSuccess == false
"
>
and error_message
<>
'success' and error_message
<>
'wait'
</if>
<if
test=
"isWait != null and isWait"
>
and error_message = 'wait'
</if>
</select>
<select
id=
"listUnImportStore"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_store_tmp
where enterprise_id = #{enterpriseId}
and error_message = 'wait'
</select>
</mapper>
\ No newline at end of file
gic-store-web/pom.xml
View file @
61a1a95e
...
...
@@ -21,6 +21,7 @@
<libraryVersion>
4.0-SNAPSHOT
</libraryVersion>
<!-- api依赖,正式版会在 gic-pom-base 里生成 -->
<gic-store-api>
4.0-SNAPSHOT
</gic-store-api>
<gic-redis-data>
4.0-SNAPSHOT
</gic-redis-data>
</properties>
<dependencies>
...
...
@@ -107,6 +108,11 @@
<artifactId>
poi-ooxml
</artifactId>
<version>
3.11
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-redis-data
</artifactId>
<version>
${gic-redis-data}
</version>
</dependency>
</dependencies>
<build>
...
...
gic-store-web/src/main/java/com/gic/store/web/Main.java
View file @
61a1a95e
...
...
@@ -3,6 +3,9 @@ package com.gic.store.web;
import
com.gic.dubbo.util.DubboContextUtil
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
;
import
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration
;
import
org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ImportResource
;
...
...
@@ -11,12 +14,20 @@ import org.springframework.context.annotation.ImportResource;
*
* @author zhurz
*/
@SpringBootApplication
@SpringBootApplication
(
scanBasePackages
=
"com.gic"
,
exclude
=
{
RedisAutoConfiguration
.
class
,
RedisRepositoriesAutoConfiguration
.
class
,
QuartzAutoConfiguration
.
class
}
)
@ImportResource
(
value
=
{
"classpath*:applicationContext-init.xml"
,
"classpath*:dubbo-setting.xml"
,
"classpath*:dubbo-gic-store-web.xml"
,
"classpath*:spring-interceptor.xml"
"classpath*:spring-interceptor.xml"
,
"classpath*:redis-init.xml"
})
public
class
Main
{
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreImportController.java
View file @
61a1a95e
...
...
@@ -59,7 +59,7 @@ public class StoreImportController {
if
(
StringUtils
.
isBlank
(
regionIdStr
))
{
return
RestResponse
.
failure
(
ErrorCode
.
ERR_5
.
getCode
(),
"请选择门店域"
);
}
Integer
enterpriseId
=
1
0000
;
Integer
enterpriseId
=
1
111
;
List
<
List
<
String
>>
list
=
new
ArrayList
<>();
ServiceResponse
<
List
<
List
<
String
>>>
titleServiceResponse
=
storeApiService
.
listImportTitle
(
enterpriseId
,
Integer
.
parseInt
(
regionIdStr
));
...
...
@@ -95,7 +95,7 @@ public class StoreImportController {
@RequestMapping
(
"/store-tmp-file-upload"
)
public
RestResponse
fileUpload
(
HttpServletRequest
request
,
MultipartFile
file
,
PageQO
pageQO
)
throws
IOException
{
Integer
enterpriseId
=
1
0000
;
Integer
enterpriseId
=
1
111
;
if
(
file
==
null
||
file
.
isEmpty
())
{
return
RestResponse
.
failure
(
ErrorCode
.
ERR_5
.
getCode
(),
"文件不存在"
);
}
...
...
@@ -140,7 +140,7 @@ public class StoreImportController {
}
try
{
if
(
!
storeImportApiService
.
hasImportingStore
(
enterpriseId
).
getResult
())
{
if
(
storeImportApiService
.
hasImportingStore
(
enterpriseId
).
getResult
())
{
// TODO userId
String
r
=
storeImportApiService
.
importDataToStore
(
enterpriseId
,
"123"
,
uuId
).
getResult
();
if
(
StringUtils
.
isNotBlank
(
r
))
{
...
...
@@ -223,12 +223,13 @@ public class StoreImportController {
validate
=
false
;
}
}
if
(
validate
)
{
if
(
this
.
storeTypeValidate
(
enterpriseId
,
storeType
)
==
-
1
)
{
bean
.
setErrorMessage
(
"门店类型不存在"
);
validate
=
false
;
}
}
// todo
// if (validate) {
// if (this.storeTypeValidate(enterpriseId, storeType) == -1) {
// bean.setErrorMessage("门店类型不存在");
// validate = false;
// }
// }
// 验证门店状态
String
erpStatus
=
row
.
get
(
4
);
bean
.
setErpStatus
(
erpStatus
);
...
...
@@ -238,12 +239,13 @@ public class StoreImportController {
validate
=
false
;
}
}
if
(
validate
)
{
if
(
this
.
erpStatusValidate
(
enterpriseId
,
erpStatus
)
==
-
1
)
{
bean
.
setErrorMessage
(
"门店状态不存在"
);
validate
=
false
;
}
}
//todo
// if (validate) {
// if (this.erpStatusValidate(enterpriseId, erpStatus) == -1) {
// bean.setErrorMessage("门店状态不存在");
// validate = false;
// }
// }
// 验证门店电话
String
conactsPhone
=
row
.
get
(
5
);
bean
.
setConactsPhone
(
conactsPhone
);
...
...
@@ -364,7 +366,7 @@ public class StoreImportController {
if
(
serviceResponse
.
isSuccess
())
{
List
<
StoreDictDTO
>
list
=
serviceResponse
.
getResult
();
final
String
erpStatusTmp
=
erpStatus
.
replace
(
"\\s+"
,
""
);
long
count
=
list
.
stream
().
filter
(
e
->
e
.
get
Value
().
equals
(
erpStatusTmp
)).
count
();
long
count
=
list
.
stream
().
filter
(
e
->
e
.
get
Key
().
equals
(
erpStatusTmp
)).
count
();
if
(
count
>
0
)
{
return
(
int
)
count
;
}
...
...
@@ -377,7 +379,7 @@ public class StoreImportController {
if
(
serviceResponse
.
isSuccess
())
{
List
<
StoreDictDTO
>
list
=
serviceResponse
.
getResult
();
final
String
storeTypeTmp
=
storeType
.
replace
(
"\\s+"
,
""
);
long
count
=
list
.
stream
().
filter
(
e
->
e
.
get
Value
().
equals
(
storeTypeTmp
)).
count
();
long
count
=
list
.
stream
().
filter
(
e
->
e
.
get
Key
().
equals
(
storeTypeTmp
)).
count
();
if
(
count
>
0
)
{
return
(
int
)
count
;
}
...
...
@@ -394,10 +396,16 @@ public class StoreImportController {
XSSFSheet
sheet
=
workbook
.
getSheetAt
(
0
);
XSSFRow
row
=
sheet
.
getRow
(
0
);
XSSFCell
cell
=
row
.
getCell
(
0
);
String
regionId
=
cell
.
getStringCellValue
();
ServiceResponse
<
StoreRegionDTO
>
serviceResponse
=
storeRegionApiService
.
getStoreRegionByRegion
(
enterpriseId
,
Integer
.
parseInt
(
regionId
));
ServiceResponse
<
StoreRegionDTO
>
serviceResponse
=
storeRegionApiService
.
getStoreRegionByRegion
(
enterpriseId
,
(
int
)
cell
.
getNumericCellValue
());
return
serviceResponse
.
isSuccess
()
?
serviceResponse
.
getResult
()
:
null
;
}
// @RequestMapping("/test")
// public Object re() {
// List<StoreTmpDTO> storeTmpDTOS = storeImportApiService.listStoreTmp(1111, null, true);
// System.out.println(storeTmpDTOS);
// return null;
// }
}
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