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
3c1b48b4
Commit
3c1b48b4
authored
Jun 27, 2019
by
zhiwj
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/base_platform_enterprise/gic-store
into developer
parents
ab4cfbc1
363a099d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
8 deletions
+84
-8
StoreDictApiServiceImpl.java
.../com/gic/store/service/outer/StoreDictApiServiceImpl.java
+3
-2
TabStoreDictMapper.xml
...-service/src/main/resources/mapper/TabStoreDictMapper.xml
+2
-2
StoreDictController.java
...ava/com/gic/store/web/controller/StoreDictController.java
+38
-4
StoreDictVO.java
...e-web/src/main/java/com/gic/store/web/vo/StoreDictVO.java
+41
-0
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/StoreDictApiServiceImpl.java
View file @
3c1b48b4
...
...
@@ -7,6 +7,7 @@ import com.gic.store.dto.StoreDictDTO;
import
com.gic.store.entity.TabStoreDict
;
import
com.gic.store.service.StoreDictApiService
;
import
com.gic.store.service.StoreDictService
;
import
com.gic.store.utils.ErrorCode
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -45,7 +46,7 @@ public class StoreDictApiServiceImpl implements StoreDictApiService {
@Override
public
ServiceResponse
saveStoreType
(
Integer
enterpriseId
,
String
[]
storeTypeArr
)
{
if
(
enterpriseId
==
null
||
storeTypeArr
==
null
||
(
storeTypeArr
!=
null
&&
storeTypeArr
.
length
==
0
)){
return
ServiceResponse
.
failure
(
"1111"
,
"参数错误"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
ERR_2
.
getCode
(),
ErrorCode
.
ERR_2
.
getMsg
()
);
}
List
<
String
>
listSelected
=
this
.
storeDictService
.
listStoreType
(
enterpriseId
);
for
(
String
storeType
:
storeTypeArr
){
...
...
@@ -69,7 +70,7 @@ public class StoreDictApiServiceImpl implements StoreDictApiService {
@Override
public
ServiceResponse
saveStoreStatus
(
Integer
enterpriseId
,
String
[]
storeStatusArr
)
{
if
(
enterpriseId
==
null
||
storeStatusArr
==
null
||
(
storeStatusArr
!=
null
&&
storeStatusArr
.
length
==
0
)){
return
ServiceResponse
.
failure
(
"1111"
,
"参数错误"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
ERR_2
.
getCode
(),
ErrorCode
.
ERR_2
.
getMsg
()
);
}
List
<
String
>
listSelected
=
this
.
storeDictService
.
listStoreType
(
enterpriseId
);
for
(
String
storeStatus
:
storeStatusArr
){
...
...
gic-store-service/src/main/resources/mapper/TabStoreDictMapper.xml
View file @
3c1b48b4
...
...
@@ -103,13 +103,13 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where store_dict_id = #{storeDictId,jdbcType=INTEGER}
</update>
<select
id=
"listStoreType"
parameterType=
"java.lang.Integer"
resultType=
"
arraylist
"
>
<select
id=
"listStoreType"
parameterType=
"java.lang.Integer"
resultType=
"
java.lang.String
"
>
select
value
from tab_store_dict
where enterprise_id = #{enterpriseId,jdbcType=INTEGER} and type='storeType'
</select>
<select
id=
"listStoreStatus"
parameterType=
"java.lang.Integer"
resultType=
"
arraylist
"
>
<select
id=
"listStoreStatus"
parameterType=
"java.lang.Integer"
resultType=
"
java.lang.String
"
>
select
value
from tab_store_dict
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreDictController.java
View file @
3c1b48b4
package
com
.
gic
.
store
.
web
.
controller
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.store.dto.StoreDictDTO
;
import
com.gic.store.service.StoreDictApiService
;
import
com.gic.store.utils.ErrorCode
;
import
com.gic.store.web.vo.StoreDictVO
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -22,7 +26,7 @@ public class StoreDictController {
Integer
enterpriseId
=
1111
;
ServiceResponse
<
List
<
StoreDictDTO
>>
serviceResponse
=
this
.
storeDictApiService
.
listAllStoreType
(
enterpriseId
);
if
(
serviceResponse
.
isSuccess
()){
return
RestResponse
.
success
(
serviceResponse
.
getResult
(
));
return
RestResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
StoreDictVO
.
class
,
serviceResponse
.
getResult
()
));
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
...
...
@@ -34,7 +38,7 @@ public class StoreDictController {
Integer
enterpriseId
=
1111
;
ServiceResponse
<
List
<
StoreDictDTO
>>
serviceResponse
=
this
.
storeDictApiService
.
listAllStoreStatus
(
enterpriseId
);
if
(
serviceResponse
.
isSuccess
()){
return
RestResponse
.
success
(
serviceResponse
.
getResult
(
));
return
RestResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
StoreDictVO
.
class
,
serviceResponse
.
getResult
()
));
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
...
...
@@ -46,7 +50,7 @@ public class StoreDictController {
Integer
enterpriseId
=
1111
;
ServiceResponse
<
List
<
StoreDictDTO
>>
serviceResponse
=
this
.
storeDictApiService
.
listStoreType
(
enterpriseId
);
if
(
serviceResponse
.
isSuccess
()){
return
RestResponse
.
success
(
serviceResponse
.
getResult
(
));
return
RestResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
StoreDictVO
.
class
,
serviceResponse
.
getResult
()
));
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
...
...
@@ -58,7 +62,37 @@ public class StoreDictController {
Integer
enterpriseId
=
1111
;
ServiceResponse
<
List
<
StoreDictDTO
>>
serviceResponse
=
this
.
storeDictApiService
.
listStoreStatus
(
enterpriseId
);
if
(
serviceResponse
.
isSuccess
()){
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
return
RestResponse
.
success
(
EntityUtil
.
changeEntityListByJSON
(
StoreDictVO
.
class
,
serviceResponse
.
getResult
()));
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
}
@RequestMapping
(
"save-storetype"
)
@ResponseBody
public
RestResponse
saveStoreType
(
String
storeTypes
){
Integer
enterpriseId
=
1111
;
if
(
StringUtils
.
isBlank
(
storeTypes
)){
return
RestResponse
.
failure
(
ErrorCode
.
ERR_2
.
getCode
(),
ErrorCode
.
ERR_2
.
getMsg
());
}
ServiceResponse
serviceResponse
=
this
.
storeDictApiService
.
saveStoreType
(
enterpriseId
,
storeTypes
.
split
(
","
));
if
(
serviceResponse
.
isSuccess
()){
return
RestResponse
.
success
();
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
}
@RequestMapping
(
"save-storestatus"
)
@ResponseBody
public
RestResponse
saveStoreStatus
(
String
storeStatus
){
Integer
enterpriseId
=
1111
;
if
(
StringUtils
.
isBlank
(
storeStatus
)){
return
RestResponse
.
failure
(
ErrorCode
.
ERR_2
.
getCode
(),
ErrorCode
.
ERR_2
.
getMsg
());
}
ServiceResponse
serviceResponse
=
this
.
storeDictApiService
.
saveStoreStatus
(
enterpriseId
,
storeStatus
.
split
(
","
));
if
(
serviceResponse
.
isSuccess
()){
return
RestResponse
.
success
();
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
...
...
gic-store-web/src/main/java/com/gic/store/web/vo/StoreDictVO.java
0 → 100644
View file @
3c1b48b4
package
com
.
gic
.
store
.
web
.
vo
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* tab_store_dict
*/
public
class
StoreDictVO
implements
Serializable
{
private
String
value
;
private
String
key
;
private
Integer
checked
=
0
;
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
public
Integer
getChecked
()
{
return
checked
;
}
public
void
setChecked
(
Integer
checked
)
{
this
.
checked
=
checked
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
}
\ No newline at end of file
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