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
25589ed5
Commit
25589ed5
authored
Feb 11, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加一个接口
parent
aea9d053
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
85 additions
and
11 deletions
+85
-11
StoreBrandDTO.java
...re-api/src/main/java/com/gic/store/dto/StoreBrandDTO.java
+10
-0
StoreBrandApiService.java
...main/java/com/gic/store/service/StoreBrandApiService.java
+12
-0
TabStoreBrand.java
...ice/src/main/java/com/gic/store/entity/TabStoreBrand.java
+19
-5
StoreBrandService.java
...rc/main/java/com/gic/store/service/StoreBrandService.java
+2
-0
StoreBrandServiceImpl.java
...ava/com/gic/store/service/impl/StoreBrandServiceImpl.java
+9
-0
StoreBrandApiServiceImpl.java
...ic/store/service/outer/impl/StoreBrandApiServiceImpl.java
+13
-0
TabStoreBrandMapper.xml
...service/src/main/resources/mapper/TabStoreBrandMapper.xml
+20
-6
No files found.
gic-store-api/src/main/java/com/gic/store/dto/StoreBrandDTO.java
View file @
25589ed5
...
...
@@ -58,6 +58,8 @@ public class StoreBrandDTO implements Serializable {
private
Integer
seq
;
private
Integer
hasRel
;
public
Integer
getStoreBrandId
()
{
return
storeBrandId
;
}
...
...
@@ -145,4 +147,12 @@ public class StoreBrandDTO implements Serializable {
public
void
setStoreBrandCategoryCode
(
String
storeBrandCategoryCode
)
{
this
.
storeBrandCategoryCode
=
storeBrandCategoryCode
;
}
public
Integer
getHasRel
()
{
return
hasRel
;
}
public
void
setHasRel
(
Integer
hasRel
)
{
this
.
hasRel
=
hasRel
;
}
}
gic-store-api/src/main/java/com/gic/store/service/StoreBrandApiService.java
View file @
25589ed5
...
...
@@ -114,4 +114,16 @@ public interface StoreBrandApiService {
* @throws
*/
ServiceResponse
<
StoreBrandDTO
>
getById
(
Integer
storeBrandId
);
/**
* 更新是否和实施运维平台有关联
* @Title: updateRelByOperation
* @Description:
* @author zhiwj
* @param storeBrandId
* @param hasRel
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse
<
Void
>
updateRelByOperation
(
Integer
storeBrandId
,
Integer
hasRel
);
}
gic-store-service/src/main/java/com/gic/store/entity/TabStoreBrand.java
View file @
25589ed5
...
...
@@ -7,7 +7,7 @@ import java.util.Date;
*/
public
class
TabStoreBrand
{
/**
*
*
*/
private
Integer
storeBrandId
;
...
...
@@ -37,25 +37,30 @@ public class TabStoreBrand {
private
Double
sort
;
/**
*
*
*/
private
Integer
enterpriseId
;
/**
*
*
*/
private
Integer
status
;
/**
*
*
*/
private
Date
createTime
;
/**
*
*
*/
private
Date
updateTime
;
/**
* 关联标识 1有 0没有 是否在实时运维平台有关联
*/
private
Integer
hasRel
;
public
Integer
getStoreBrandId
()
{
return
storeBrandId
;
}
...
...
@@ -135,4 +140,12 @@ public class TabStoreBrand {
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Integer
getHasRel
()
{
return
hasRel
;
}
public
void
setHasRel
(
Integer
hasRel
)
{
this
.
hasRel
=
hasRel
;
}
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/service/StoreBrandService.java
View file @
25589ed5
...
...
@@ -42,4 +42,6 @@ public interface StoreBrandService {
List
<
TabStoreBrand
>
listStoreBrandByIds
(
List
<
Integer
>
brandIdList
);
TabStoreBrand
getById
(
Integer
storeBrandId
);
int
updateRelByOperation
(
Integer
storeBrandId
,
Integer
hasRel
);
}
gic-store-service/src/main/java/com/gic/store/service/impl/StoreBrandServiceImpl.java
View file @
25589ed5
...
...
@@ -37,6 +37,7 @@ public class StoreBrandServiceImpl implements StoreBrandService {
storeBrand
.
setEnterpriseId
(
copy
.
getEnterpriseId
());
storeBrand
.
setStatus
(
GlobalInfo
.
DATA_STATUS_NORMAL
);
storeBrand
.
setCreateTime
(
new
Date
());
storeBrand
.
setHasRel
(
GlobalInfo
.
DATA_STATUS_DELETE
);
Double
sort
=
tabStoreBrandMapper
.
getMinSort
(
copy
.
getEnterpriseId
());
storeBrand
.
setSort
(
sort
==
null
?
1
d
:
sort
-
1
d
);
...
...
@@ -188,4 +189,12 @@ public class StoreBrandServiceImpl implements StoreBrandService {
public
TabStoreBrand
getById
(
Integer
storeBrandId
)
{
return
tabStoreBrandMapper
.
selectByPrimaryKey
(
storeBrandId
);
}
@Override
public
int
updateRelByOperation
(
Integer
storeBrandId
,
Integer
hasRel
)
{
TabStoreBrand
tabStoreBrand
=
new
TabStoreBrand
();
tabStoreBrand
.
setStoreBrandId
(
storeBrandId
);
tabStoreBrand
.
setHasRel
(
hasRel
);
return
tabStoreBrandMapper
.
updateByPrimaryKeySelective
(
tabStoreBrand
);
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreBrandApiServiceImpl.java
View file @
25589ed5
...
...
@@ -6,7 +6,9 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.constants.Constants
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
com.gic.enterprise.service.EnterpriseInitApiService
;
import
com.gic.enterprise.service.PlatformBrandApiService
;
import
com.gic.store.dto.StoreBrandDTO
;
...
...
@@ -119,6 +121,11 @@ public class StoreBrandApiServiceImpl implements StoreBrandApiService {
Integer
count
=
storeService
.
countByBrandId
(
id
);
if
(
count
>
0
)
{
notDelList
.
add
(
id
);
}
else
{
TabStoreBrand
tabStoreBrand
=
this
.
storeBrandService
.
getById
(
id
);
if
(
Constants
.
NORMAL_STATUS
.
equals
(
tabStoreBrand
.
getHasRel
()))
{
notDelList
.
add
(
id
);
}
}
return
count
==
0
;
})
...
...
@@ -177,6 +184,12 @@ public class StoreBrandApiServiceImpl implements StoreBrandApiService {
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityByJSON
(
StoreBrandDTO
.
class
,
storeBrand
));
}
@Override
public
ServiceResponse
<
Void
>
updateRelByOperation
(
Integer
storeBrandId
,
Integer
hasRel
)
{
this
.
storeBrandService
.
updateRelByOperation
(
storeBrandId
,
hasRel
);
return
EnterpriseServiceResponse
.
success
();
}
private
void
addRef
(
StoreBrandDTO
storeBrandDTO
)
{
ServiceResponse
<
Integer
>
serviceResponse
=
platformBrandApiService
.
addRef
(
storeBrandDTO
.
getEnterpriseId
(),
storeBrandDTO
.
getStoreBrandId
(),
storeBrandDTO
.
getStoreBrandName
(),
storeBrandDTO
.
getStoreBrandCode
(),
storeBrandDTO
.
getStoreBrandCategoryCode
());
if
(
serviceResponse
.
isSuccess
()
&&
serviceResponse
.
getResult
()
!=
null
)
{
...
...
gic-store-service/src/main/resources/mapper/TabStoreBrandMapper.xml
View file @
25589ed5
...
...
@@ -12,10 +12,11 @@
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"has_rel"
jdbcType=
"INTEGER"
property=
"hasRel"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
store_brand_id, store_brand_code, store_brand_name, store_brand_category_code, store_brand_category,
sort, enterprise_id, status, create_time, update_time
sort, enterprise_id, status, create_time, update_time
, has_rel
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -31,11 +32,13 @@
insert into tab_store_brand (store_brand_id, store_brand_code, store_brand_name,
store_brand_category_code, store_brand_category,
sort, enterprise_id, status,
create_time, update_time)
create_time, update_time, has_rel
)
values (#{storeBrandId,jdbcType=INTEGER}, #{storeBrandCode,jdbcType=VARCHAR}, #{storeBrandName,jdbcType=VARCHAR},
#{storeBrandCategoryCode,jdbcType=VARCHAR}, #{storeBrandCategory,jdbcType=VARCHAR},
#{sort,jdbcType=DOUBLE}, #{enterpriseId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{hasRel,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.store.entity.TabStoreBrand"
>
<selectKey
keyProperty=
"storeBrandId"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
...
...
@@ -73,6 +76,9 @@
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"hasRel != null"
>
has_rel,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"storeBrandId != null"
>
...
...
@@ -105,6 +111,9 @@
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"hasRel != null"
>
#{hasRel,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.store.entity.TabStoreBrand"
>
...
...
@@ -137,6 +146,9 @@
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"hasRel != null"
>
has_rel = #{hasRel,jdbcType=INTEGER},
</if>
</set>
where store_brand_id = #{storeBrandId,jdbcType=INTEGER}
</update>
...
...
@@ -150,9 +162,11 @@
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP},
has_rel = #{hasRel,jdbcType=INTEGER}
where store_brand_id = #{storeBrandId,jdbcType=INTEGER}
</update>
<select
id=
"getMinSort"
resultType=
"java.lang.Double"
>
select sort from tab_store_brand where status = 1 and enterprise_id = #{enterpriseId} order by sort limit 0, 1
</select>
...
...
@@ -165,9 +179,9 @@
<if
test=
"enterpriseId != null "
>
and enterprise_id = #{enterpriseId}
</if>
<!--
<if test="storeBrandCode != null and storeBrandCode != '' ">
-->
<!--
<if test="storeBrandCode != null and storeBrandCode != '' ">
-->
<!-- and store_brand_code = #{storeBrandCode}-->
<!--
</if>
-->
<!--
</if>
-->
<if
test=
"storeBrandName != null and storeBrandName != '' "
>
and store_brand_name = #{storeBrandName}
</if>
...
...
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