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
96aa67fa
Commit
96aa67fa
authored
Jul 05, 2019
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新门店分组
parent
60458643
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
123 additions
and
9 deletions
+123
-9
FieldBase.java
...pi/src/main/java/com/gic/store/utils/field/FieldBase.java
+35
-0
TextField.java
...pi/src/main/java/com/gic/store/utils/field/TextField.java
+55
-0
StoreImportApiServiceImpl.java
...om/gic/store/service/outer/StoreImportApiServiceImpl.java
+0
-7
StoreTaskServiceImpl.java
...ava/com/gic/store/service/outer/StoreTaskServiceImpl.java
+2
-2
StoreImportController.java
...a/com/gic/store/web/controller/StoreImportController.java
+31
-0
No files found.
gic-store-api/src/main/java/com/gic/store/utils/field/FieldBase.java
0 → 100644
View file @
96aa67fa
package
com
.
gic
.
store
.
utils
.
field
;
/**
* @author zhiwj
* @date 2019/7/5
*/
public
class
FieldBase
{
private
Integer
allowEdit
;
private
Integer
isMust
;
private
Integer
allowRepeat
;
public
void
setAllowEdit
(
Integer
allowEdit
)
{
this
.
allowEdit
=
allowEdit
;
}
public
void
setIsMust
(
Integer
isMust
)
{
this
.
isMust
=
isMust
;
}
public
void
setAllowRepeat
(
Integer
allowRepeat
)
{
this
.
allowRepeat
=
allowRepeat
;
}
public
boolean
getAllowEdit
()
{
return
allowEdit
==
1
;
}
public
boolean
getIsMust
()
{
return
isMust
==
1
;
}
public
boolean
getAllowRepeat
()
{
return
allowRepeat
==
1
;
}
}
gic-store-api/src/main/java/com/gic/store/utils/field/TextField.java
0 → 100644
View file @
96aa67fa
package
com
.
gic
.
store
.
utils
.
field
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author zhiwj
* @date 2019/7/5
*/
public
class
TextField
extends
FieldBase
{
private
String
tipMessage
;
private
String
textType
;
private
Integer
maxLength
;
private
Integer
minLength
;
public
String
getTipMessage
()
{
return
tipMessage
;
}
public
void
setTipMessage
(
String
tipMessage
)
{
this
.
tipMessage
=
tipMessage
;
}
public
List
<
Integer
>
getTextType
()
{
List
<
Integer
>
result
=
new
ArrayList
<>();
String
[]
list
=
textType
.
split
(
","
);
for
(
String
s
:
list
)
{
result
.
add
(
Integer
.
parseInt
(
s
));
}
return
result
;
}
public
void
setTextType
(
String
textType
)
{
this
.
textType
=
textType
;
}
public
Integer
getMaxLength
()
{
return
maxLength
;
}
public
void
setMaxLength
(
Integer
maxLength
)
{
this
.
maxLength
=
maxLength
;
}
public
Integer
getMinLength
()
{
return
minLength
;
}
public
void
setMinLength
(
Integer
minLength
)
{
this
.
minLength
=
minLength
;
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/StoreImportApiServiceImpl.java
View file @
96aa67fa
...
...
@@ -11,8 +11,6 @@ import com.gic.store.entity.TabStoreBrand;
import
com.gic.store.entity.TabStoreExtend
;
import
com.gic.store.entity.TabStoreGroup
;
import
com.gic.store.service.*
;
import
com.gic.store.utils.ErrorCode
;
import
com.task.allocation.exception.TaskAllocationException
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -203,12 +201,7 @@ public class StoreImportApiServiceImpl implements StoreImportApiService {
@Override
public
ServiceResponse
<
String
>
importDataToStore
(
Integer
enterpriseId
,
String
userId
,
String
uuId
)
{
try
{
return
ServiceResponse
.
success
(
storeTaskService
.
importDataToStore
(
enterpriseId
,
userId
,
uuId
));
}
catch
(
TaskAllocationException
e
)
{
logger
.
warn
(
"队列错误"
);
}
return
ServiceResponse
.
failure
(
ErrorCode
.
ERR_3
.
getCode
(),
"队列错误"
);
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/StoreTaskServiceImpl.java
View file @
96aa67fa
...
...
@@ -166,7 +166,7 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
}
@Override
public
String
importDataToStore
(
Integer
enterpriseId
,
String
userId
,
String
uuId
)
throws
TaskAllocationException
{
public
String
importDataToStore
(
Integer
enterpriseId
,
String
userId
,
String
uuId
)
{
// TODO 队列
String
message
=
""
;
InitTaskQo
initTaskQo
=
new
InitTaskQo
();
...
...
@@ -176,8 +176,8 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
initTaskQo
.
setTaskType
(
Constants
.
STORE_BATCH_IMPORT_TASK_TYPE
);
// 任务类型
initTaskQo
.
setParams
(
enterpriseId
.
toString
());
// 你自己处理需要的参数
initTaskQo
.
setTaskSignKey
(
uuId
);
// 任务类型 唯一标识符
TaskAllocationSdkClient
instance
=
TaskAllocationSdkClient
.
getInstance
();
// 初始化sdk
try
{
TaskAllocationSdkClient
instance
=
TaskAllocationSdkClient
.
getInstance
();
// 初始化sdk
instance
.
initTask
(
initTaskQo
);
// 初始化接口
logger
.
info
(
"门店批量导入队列初始化成功"
);
}
catch
(
Exception
e
)
{
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreImportController.java
View file @
96aa67fa
...
...
@@ -57,6 +57,13 @@ public class StoreImportController {
@Autowired
private
StoreFieldApiService
storeFieldApiService
;
/**
* 下载模板
* @param request
* @param response
* @return
* @throws Exception
*/
@RequestMapping
(
"/store-import-template-download"
)
public
Object
download
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
// ClassPathResource res = new ClassPathResource("门店资料导入模板.xlsx");
...
...
@@ -90,6 +97,14 @@ public class StoreImportController {
return
RestResponse
.
success
();
}
/**
* 批量导入
* @param request
* @param file
* @param pageQO
* @return
* @throws IOException
*/
@RequestMapping
(
"/store-tmp-file-upload"
)
public
RestResponse
fileUpload
(
HttpServletRequest
request
,
MultipartFile
file
,
PageQO
pageQO
)
throws
IOException
{
Integer
enterpriseId
=
1111
;
...
...
@@ -169,6 +184,11 @@ public class StoreImportController {
return
RestResponse
.
success
();
}
/**
* 错误日志查看
* @param page
* @return
*/
@RequestMapping
(
"/store-import-load-error-data"
)
public
Object
loadErrorData
(
PageQO
page
)
{
Integer
enterpriseId
=
1111
;
...
...
@@ -184,6 +204,13 @@ public class StoreImportController {
return
RestResponse
.
success
(
result
);
}
/**
* 导出错误日志
* @param request
* @param response
* @return
* @throws IOException
*/
@RequestMapping
(
"/export-error-data"
)
public
RestResponse
exportErrorData
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
Integer
enterpriseId
=
1111
;
...
...
@@ -392,6 +419,10 @@ public class StoreImportController {
storeExtendDTO
.
setStoreFieldId
(
fieldList
.
get
(
i
).
getStoreFieldId
());
storeExtendDTO
.
setValue
(
row
.
get
(
14
+
i
));
storeExtendDTO
.
setSort
(
fieldList
.
get
(
i
).
getSort
());
// 验证
if
(
validate
)
{
// String s = fieldValidate(storeExtendDTO.getValue(), fieldList.get(i).getStoreFieldDetail());
}
extendDTOList
.
add
(
storeExtendDTO
);
}
bean
.
setCustomField
(
JSON
.
toJSONString
(
extendDTOList
));
...
...
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