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
27ba25f8
Commit
27ba25f8
authored
Feb 28, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交门店
parent
09bd7ca5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
16 deletions
+25
-16
TabStoreExtendMapper.java
...n/java/com/gic/store/dao/mapper/TabStoreExtendMapper.java
+3
-0
StoreExtendServiceImpl.java
...va/com/gic/store/service/impl/StoreExtendServiceImpl.java
+18
-16
TabStoreExtendMapper.xml
...ervice/src/main/resources/mapper/TabStoreExtendMapper.xml
+4
-0
No files found.
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabStoreExtendMapper.java
View file @
27ba25f8
...
...
@@ -61,4 +61,6 @@ public interface TabStoreExtendMapper {
int
countStoreExtendStoreField
(
@Param
(
"storeField"
)
Integer
storeField
,
@Param
(
"storeFieldSelectId"
)
Integer
storeFieldSelectId
);
int
countExtendByValue
(
@Param
(
"storeFieldId"
)
Integer
storeFieldId
,
@Param
(
"value"
)
String
value
,
@Param
(
"storeExtendId"
)
Integer
storeExtendId
);
void
delete
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"storeInfoId"
)
Integer
storeInfoId
);
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/service/impl/StoreExtendServiceImpl.java
View file @
27ba25f8
package
com
.
gic
.
store
.
service
.
impl
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.error.ErrorCode
;
...
...
@@ -21,6 +11,15 @@ import com.gic.store.entity.TabStoreField;
import
com.gic.store.service.StoreExtendService
;
import
com.gic.store.service.StoreFieldService
;
import
com.gic.store.utils.field.FieldBase
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author zhiwj
...
...
@@ -39,6 +38,9 @@ public class StoreExtendServiceImpl implements StoreExtendService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
saveOrUpdate
(
Integer
enterpriseId
,
Integer
storeInfoId
,
List
<
StoreExtendDTO
>
storeExtendList
)
{
if
(
CollectionUtils
.
isNotEmpty
(
storeExtendList
))
{
this
.
tabStoreExtendMapper
.
delete
(
enterpriseId
,
storeInfoId
);
List
<
TabStoreExtend
>
tabStoreExtendList
=
EntityUtil
.
changeEntityListByOrika
(
TabStoreExtend
.
class
,
storeExtendList
);
for
(
TabStoreExtend
tabStoreExtend
:
tabStoreExtendList
)
{
TabStoreField
field
=
storeFieldService
.
getStoreFieldById
(
tabStoreExtend
.
getStoreFieldId
());
...
...
@@ -56,12 +58,12 @@ public class StoreExtendServiceImpl implements StoreExtendService {
tabStoreExtend
.
setEnterpriseId
(
enterpriseId
);
tabStoreExtend
.
setStoreInfoId
(
storeInfoId
);
if
(
tabStoreExtend
.
getStoreExtendId
()
==
null
)
{
tabStoreExtend
.
setCreateTime
(
new
Date
());
tabStoreExtendMapper
.
insertSelective
(
tabStoreExtend
);
}
else
{
tabStoreExtendMapper
.
updateByPrimaryKeySelective
(
tabStoreExtend
);
}
//
if (tabStoreExtend.getStoreExtendId() == null) {
tabStoreExtend
.
setCreateTime
(
new
Date
());
tabStoreExtendMapper
.
insertSelective
(
tabStoreExtend
);
//
} else {
//
tabStoreExtendMapper.updateByPrimaryKeySelective(tabStoreExtend);
//
}
}
}
}
...
...
gic-store-service/src/main/resources/mapper/TabStoreExtendMapper.xml
View file @
27ba25f8
...
...
@@ -165,4 +165,7 @@
and store_extend_id
<>
#{storeExtendId}
</if>
</select>
<delete
id=
"delete"
>
delete from tab_store_extend where enterprise_id = #{enterpriseId} and store_info_id = #{storeInfoId}
</delete>
</mapper>
\ 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