Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
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-platform-enterprise
Commits
171642dc
Commit
171642dc
authored
Aug 09, 2019
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
品牌库
parent
3223a155
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
221 additions
and
73 deletions
+221
-73
Constants.java
.../src/main/java/com/gic/enterprise/constant/Constants.java
+2
-6
DictDTO.java
...ise-api/src/main/java/com/gic/enterprise/dto/DictDTO.java
+30
-0
PlatformBrandDTO.java
...rc/main/java/com/gic/enterprise/dto/PlatformBrandDTO.java
+5
-5
DictApiService.java
.../main/java/com/gic/enterprise/service/DictApiService.java
+13
-0
PlatformBrandApiService.java
...a/com/gic/enterprise/service/PlatformBrandApiService.java
+6
-7
pom.xml
gic-platform-enterprise-service/pom.xml
+6
-0
RedisCacheBizdictServiceConfig.java
...gic/enterprise/config/RedisCacheBizdictServiceConfig.java
+9
-0
TabPlatformBrand.java
...main/java/com/gic/enterprise/entity/TabPlatformBrand.java
+6
-6
PlatformBrandRefService.java
...a/com/gic/enterprise/service/PlatformBrandRefService.java
+1
-1
PlatformBrandRefServiceImpl.java
.../enterprise/service/impl/PlatformBrandRefServiceImpl.java
+2
-2
PlatformBrandServiceImpl.java
...gic/enterprise/service/impl/PlatformBrandServiceImpl.java
+2
-2
DictApiServiceImpl.java
.../com/gic/enterprise/service/outer/DictApiServiceImpl.java
+46
-0
PlatformBrandApiServiceImpl.java
...enterprise/service/outer/PlatformBrandApiServiceImpl.java
+37
-17
dubbo-gic-platform-enterprise-service.xml
.../main/resources/dubbo-gic-platform-enterprise-service.xml
+3
-0
TabPlatformBrandMapper.xml
...vice/src/main/resources/mapper/TabPlatformBrandMapper.xml
+14
-17
TabPlatformBrandRefMapper.xml
...e/src/main/resources/mapper/TabPlatformBrandRefMapper.xml
+0
-3
DictController.java
...java/com/gic/operation/web/controller/DictController.java
+29
-0
PlatformBrandController.java
...gic/operation/web/controller/PlatformBrandController.java
+2
-2
PlatformBrandQO.java
...c/main/java/com/gic/operation/web/qo/PlatformBrandQO.java
+5
-5
dubbo-gic-platform-operation-web.xml
...b/src/main/resources/dubbo-gic-platform-operation-web.xml
+3
-0
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/constant/Constants.java
View file @
171642dc
package
com
.
gic
.
stor
e
.
constant
;
package
com
.
gic
.
enterpris
e
.
constant
;
/**
* @author zhiwj
* @date 2019/7/4
*/
public
interface
Constants
{
String
STORE_BATCH_IMPORT_MQ_KEY
=
"storeBulkImport"
;
// String STORE_BATCH_IMPORT_MQ_KEY = "tmpStoreBatchImportTaskMq4.0";
Integer
STORE_BATCH_IMPORT_TASK_TYPE
=
6
;
String
dateformat
=
"YYYY-MM-dd HH:mm:ss"
;
String
BUSINESS_CATEGORY
=
"businessCategory"
;
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/DictDTO.java
0 → 100644
View file @
171642dc
package
com
.
gic
.
enterprise
.
dto
;
import
java.io.Serializable
;
/**
* tab_store_dict
*/
public
class
DictDTO
implements
Serializable
{
private
String
value
;
private
String
key
;
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
}
\ No newline at end of file
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/dto/PlatformBrandDTO.java
View file @
171642dc
...
...
@@ -10,7 +10,7 @@ public class PlatformBrandDTO implements Serializable {
/**
* 经营类目
*/
private
Integer
platformBrandCategoryId
;
private
String
platformBrandCategoryCode
;
/**
* 经营类目名
...
...
@@ -37,12 +37,12 @@ public class PlatformBrandDTO implements Serializable {
this
.
platformBrandId
=
platformBrandId
;
}
public
Integer
getPlatformBrandCategoryId
()
{
return
platformBrandCategory
Id
;
public
String
getPlatformBrandCategoryCode
()
{
return
platformBrandCategory
Code
;
}
public
void
setPlatformBrandCategory
Id
(
Integer
platformBrandCategoryId
)
{
this
.
platformBrandCategory
Id
=
platformBrandCategoryId
;
public
void
setPlatformBrandCategory
Code
(
String
platformBrandCategoryCode
)
{
this
.
platformBrandCategory
Code
=
platformBrandCategoryCode
;
}
public
String
getPlatformBrandCategoryName
()
{
...
...
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/DictApiService.java
0 → 100644
View file @
171642dc
package
com
.
gic
.
enterprise
.
service
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.enterprise.dto.DictDTO
;
import
java.util.List
;
public
interface
DictApiService
{
ServiceResponse
<
List
<
DictDTO
>>
listBusinessCategory
();
ServiceResponse
<
DictDTO
>
getDict
(
String
categoryCode
,
String
code
);
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/PlatformBrandApiService.java
View file @
171642dc
...
...
@@ -21,12 +21,12 @@ public interface PlatformBrandApiService {
* @Title: addBrandFromGic
* @Description:
* @author zhiwj
* @param category
Id
* @param category
Code
* @param platformBrandName
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer> id
* @throws
*/
ServiceResponse
<
Integer
>
saveBrandFromGic
(
Integer
categoryId
,
String
platformBrandName
);
ServiceResponse
<
Integer
>
saveBrandFromGic
(
String
categoryCode
,
String
platformBrandName
);
/**
* 运维平台添加一个平台级品牌
* @Title: addBrandFromOperation
...
...
@@ -70,7 +70,7 @@ public interface PlatformBrandApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer> 影响行数
* @throws
*/
ServiceResponse
<
Integer
>
addRef
(
Integer
enterpriseId
,
Integer
enterpriseBrandId
,
String
enterpriseBrandName
,
String
enterpriseBrandCode
,
Integer
categoryId
);
ServiceResponse
<
Integer
>
addRef
(
Integer
enterpriseId
,
Integer
enterpriseBrandId
,
String
enterpriseBrandName
,
String
enterpriseBrandCode
,
String
categoryCode
);
/**
* 删除一个关联关系
...
...
@@ -88,7 +88,6 @@ public interface PlatformBrandApiService {
* @Title: delRef
* @Description: 删除一个关联关系
* @author zhiwj
* @param enterpriseBrandId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @throws
*/
...
...
@@ -104,18 +103,18 @@ public interface PlatformBrandApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @throws
*/
ServiceResponse
<
Integer
>
updateRef
(
Integer
enterpriseId
,
Integer
enterpriseBrandId
,
String
enterpriseBrandName
,
String
enterpriseBrandCode
,
Integer
categoryId
);
ServiceResponse
<
Integer
>
updateRef
(
Integer
enterpriseId
,
Integer
enterpriseBrandId
,
String
enterpriseBrandName
,
String
enterpriseBrandCode
,
String
categoryCode
);
/**
* 按品牌名去查询详情
* @Title: getByBrandName
* @Description:
* @author zhiwj
* @param
enterpriseB
randName
* @param
b
randName
* @return com.gic.api.base.commons.ServiceResponse<com.gic.enterprise.dto.PlatformBrandDTO>
* @throws
*/
ServiceResponse
<
PlatformBrandDTO
>
getByBrandName
(
String
enterpriseB
randName
);
ServiceResponse
<
PlatformBrandDTO
>
getByBrandName
(
String
b
randName
);
/**
* 查询平台品牌对应的商品品牌
...
...
gic-platform-enterprise-service/pom.xml
View file @
171642dc
...
...
@@ -23,6 +23,7 @@
<gic-store-api>
4.0-SNAPSHOT
</gic-store-api>
<gic-redis-data>
4.0-SNAPSHOT
</gic-redis-data>
<gic-bizdict-api>
4.0.0-SNAPSHOT
</gic-bizdict-api>
<gic-bizdict-sdk>
4.0.0-SNAPSHOT
</gic-bizdict-sdk>
<gic-platform-enterprise-api>
4.0-SNAPSHOT
</gic-platform-enterprise-api>
</properties>
...
...
@@ -104,6 +105,11 @@
<version>
${gic-bizdict-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic.bizdict
</groupId>
<artifactId>
gic-bizdict-sdk
</artifactId>
<version>
${gic-bizdict-sdk}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-enterprise-base-api
</artifactId>
<version>
${gic-enterprise-base-api}
</version>
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/config/RedisCacheBizdictServiceConfig.java
0 → 100644
View file @
171642dc
package
com
.
gic
.
enterprise
.
config
;
import
com.gic.bizdict.sdk.service.anno.EnableRedisCacheBizdictService
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@EnableRedisCacheBizdictService
public
class
RedisCacheBizdictServiceConfig
{
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/entity/TabPlatformBrand.java
View file @
171642dc
...
...
@@ -12,9 +12,9 @@ public class TabPlatformBrand {
private
Integer
platformBrandId
;
/**
* 经营类目
* 经营类目
code
*/
private
Integer
platformBrandCategoryId
;
private
String
platformBrandCategoryCode
;
/**
* 经营类目名
...
...
@@ -54,12 +54,12 @@ public class TabPlatformBrand {
this
.
platformBrandId
=
platformBrandId
;
}
public
Integer
getPlatformBrandCategoryId
()
{
return
platformBrandCategory
Id
;
public
String
getPlatformBrandCategoryCode
()
{
return
platformBrandCategory
Code
;
}
public
void
setPlatformBrandCategory
Id
(
Integer
platformBrandCategoryId
)
{
this
.
platformBrandCategory
Id
=
platformBrandCategoryId
;
public
void
setPlatformBrandCategory
Code
(
String
platformBrandCategoryCode
)
{
this
.
platformBrandCategory
Code
=
platformBrandCategoryCode
;
}
public
String
getPlatformBrandCategoryName
()
{
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/PlatformBrandRefService.java
View file @
171642dc
...
...
@@ -18,7 +18,7 @@ public interface PlatformBrandRefService {
Integer
delRef
(
Integer
enterpriseId
,
List
<
Integer
>
enterpriseBrandIds
);
Page
<
TabPlatformBrandRef
>
listByPlatformBrandRef
(
String
brandName
);
Page
<
TabPlatformBrandRef
>
listByPlatformBrandRef
(
Integer
platformBrandId
);
Integer
updateRef
(
Integer
fromBrandId
,
Integer
toBrandId
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/impl/PlatformBrandRefServiceImpl.java
View file @
171642dc
...
...
@@ -63,9 +63,9 @@ public class PlatformBrandRefServiceImpl implements PlatformBrandRefService {
}
@Override
public
Page
<
TabPlatformBrandRef
>
listByPlatformBrandRef
(
String
brandName
)
{
public
Page
<
TabPlatformBrandRef
>
listByPlatformBrandRef
(
Integer
platformBrandId
)
{
TabPlatformBrandRef
brandRef
=
new
TabPlatformBrandRef
();
brandRef
.
set
EnterpriseBrandName
(
brandName
);
brandRef
.
set
PlatformBrandId
(
platformBrandId
);
return
tabPlatformBrandRefMapper
.
listByPlatformBrandRef
(
brandRef
);
}
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/impl/PlatformBrandServiceImpl.java
View file @
171642dc
...
...
@@ -26,7 +26,7 @@ public class PlatformBrandServiceImpl implements PlatformBrandService {
@Override
public
Integer
save
(
PlatformBrandDTO
platformBrandDTO
)
{
TabPlatformBrand
tabPlatformBrand
=
new
TabPlatformBrand
();
tabPlatformBrand
.
setPlatformBrandCategory
Id
(
platformBrandDTO
.
getPlatformBrandCategoryId
());
tabPlatformBrand
.
setPlatformBrandCategory
Code
(
platformBrandDTO
.
getPlatformBrandCategoryCode
());
tabPlatformBrand
.
setPlatformBrandCategoryName
(
platformBrandDTO
.
getPlatformBrandCategoryName
());
tabPlatformBrand
.
setPlatformBrandName
(
platformBrandDTO
.
getPlatformBrandName
());
tabPlatformBrand
.
setCreateType
(
platformBrandDTO
.
getCreateType
());
...
...
@@ -39,7 +39,7 @@ public class PlatformBrandServiceImpl implements PlatformBrandService {
@Override
public
Integer
update
(
PlatformBrandDTO
platformBrandDTO
)
{
TabPlatformBrand
tabPlatformBrand
=
new
TabPlatformBrand
();
tabPlatformBrand
.
setPlatformBrandCategory
Id
(
platformBrandDTO
.
getPlatformBrandCategoryId
());
tabPlatformBrand
.
setPlatformBrandCategory
Code
(
platformBrandDTO
.
getPlatformBrandCategoryCode
());
tabPlatformBrand
.
setPlatformBrandCategoryName
(
platformBrandDTO
.
getPlatformBrandCategoryName
());
tabPlatformBrand
.
setPlatformBrandName
(
platformBrandDTO
.
getPlatformBrandName
());
return
tabPlatformBrandMapper
.
updateByPrimaryKeySelective
(
tabPlatformBrand
);
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/DictApiServiceImpl.java
0 → 100644
View file @
171642dc
package
com
.
gic
.
enterprise
.
service
.
outer
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.bizdict.api.dto.BizdictDTO
;
import
com.gic.bizdict.sdk.service.impl.RedisCacheBizdictService
;
import
com.gic.enterprise.constant.Constants
;
import
com.gic.enterprise.dto.DictDTO
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.service.DictApiService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
(
"dictApiService"
)
public
class
DictApiServiceImpl
implements
DictApiService
{
@Autowired
private
RedisCacheBizdictService
bizdictService
;
@Override
public
ServiceResponse
<
List
<
DictDTO
>>
listBusinessCategory
()
{
List
<
BizdictDTO
>
bizDictList
=
bizdictService
.
treeByCategoryCode
(
Constants
.
BUSINESS_CATEGORY
);
List
<
DictDTO
>
list
=
bizDictList
.
stream
().
map
(
e
->
{
DictDTO
dictDTO
=
new
DictDTO
();
dictDTO
.
setKey
(
e
.
getName
());
dictDTO
.
setValue
(
e
.
getCode
());
return
dictDTO
;
}).
collect
(
Collectors
.
toList
());
return
ServiceResponse
.
success
(
list
);
}
@Override
public
ServiceResponse
<
DictDTO
>
getDict
(
String
categoryCode
,
String
code
)
{
BizdictDTO
bizdictDTO
=
bizdictService
.
getByCode
(
categoryCode
,
code
);
if
(
bizdictDTO
!=
null
)
{
DictDTO
dictDTO
=
new
DictDTO
();
dictDTO
.
setKey
(
bizdictDTO
.
getName
());
dictDTO
.
setValue
(
bizdictDTO
.
getCode
());
return
ServiceResponse
.
success
(
dictDTO
);
}
else
{
return
ServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
ErrorCode
.
NOTEXISTS
.
getMsg
());
}
}
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/PlatformBrandApiServiceImpl.java
View file @
171642dc
package
com
.
gic
.
enterprise
.
service
.
outer
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.constant.BrandCreateTypeEnum
;
import
com.gic.enterprise.constant.Constants
;
import
com.gic.enterprise.dto.DictDTO
;
import
com.gic.enterprise.dto.PlatformBrandDTO
;
import
com.gic.enterprise.dto.PlatformBrandRefDTO
;
import
com.gic.enterprise.entity.TabPlatformBrand
;
import
com.gic.enterprise.entity.TabPlatformBrandRef
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.service.DictApiService
;
import
com.gic.enterprise.service.PlatformBrandApiService
;
import
com.gic.enterprise.service.PlatformBrandRefService
;
import
com.gic.enterprise.service.PlatformBrandService
;
import
com.github.pagehelper.PageHelper
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -26,14 +32,18 @@ import java.util.stream.Collectors;
@Service
(
"platformBrandApiService"
)
public
class
PlatformBrandApiServiceImpl
implements
PlatformBrandApiService
{
Logger
logger
=
LogManager
.
getLogger
(
PlatformBrandApiServiceImpl
.
class
);
@Autowired
private
PlatformBrandService
platformBrandService
;
@Autowired
private
PlatformBrandRefService
platformBrandRefService
;
@Autowired
private
DictApiService
dictApiService
;
@Override
public
ServiceResponse
<
Integer
>
saveBrandFromGic
(
Integer
categoryId
,
String
platformBrandName
)
{
if
(
StringUtils
.
isBlank
(
platformBrandName
)
||
categoryId
==
null
)
{
public
ServiceResponse
<
Integer
>
saveBrandFromGic
(
String
categoryCode
,
String
platformBrandName
)
{
if
(
StringUtils
.
isBlank
(
platformBrandName
)
||
StringUtils
.
isBlank
(
categoryCode
)
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
MISS_PARAMETER
.
getCode
(),
ErrorCode
.
MISS_PARAMETER
.
getMsg
());
}
TabPlatformBrand
platformBrand
=
platformBrandService
.
getByBrandName
(
platformBrandName
);
...
...
@@ -42,9 +52,12 @@ public class PlatformBrandApiServiceImpl implements PlatformBrandApiService {
return
ServiceResponse
.
success
(
platformBrand
.
getPlatformBrandId
());
}
PlatformBrandDTO
platformBrandDTO
=
new
PlatformBrandDTO
();
platformBrandDTO
.
setPlatformBrandCategoryId
(
categoryId
);
// todo
// platformBrandDTO.setPlatformBrandCategoryName();
platformBrandDTO
.
setPlatformBrandCategoryCode
(
categoryCode
);
ServiceResponse
<
DictDTO
>
dictService
=
dictApiService
.
getDict
(
Constants
.
BUSINESS_CATEGORY
,
platformBrandDTO
.
getPlatformBrandCategoryCode
());
if
(!
dictService
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
dictService
.
getCode
(),
dictService
.
getMessage
());
}
platformBrandDTO
.
setPlatformBrandCategoryName
(
dictService
.
getResult
().
getKey
());
platformBrandDTO
.
setCreateType
(
BrandCreateTypeEnum
.
GIC
.
getCode
());
platformBrandDTO
.
setPlatformBrandName
(
platformBrandName
);
Integer
id
=
platformBrandService
.
save
(
platformBrandDTO
);
...
...
@@ -53,20 +66,23 @@ public class PlatformBrandApiServiceImpl implements PlatformBrandApiService {
@Override
public
ServiceResponse
<
Integer
>
saveOrUpdateBrandFromOperation
(
PlatformBrandDTO
platformBrandDTO
)
{
if
(
StringUtils
.
isBlank
(
platformBrandDTO
.
getPlatformBrandName
())
||
platformBrandDTO
.
getPlatformBrandCategoryId
()
==
null
)
{
if
(
StringUtils
.
isBlank
(
platformBrandDTO
.
getPlatformBrandName
())
||
StringUtils
.
isBlank
(
platformBrandDTO
.
getPlatformBrandCategoryCode
())
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
MISS_PARAMETER
.
getCode
(),
ErrorCode
.
MISS_PARAMETER
.
getMsg
());
}
TabPlatformBrand
platformBrand
=
platformBrandService
.
getByBrandName
(
platformBrandDTO
.
getPlatformBrandName
());
// 如果平台品牌已存在, 直接返回; 这里先判断后执行,可能会出现并发问题,出问题了再加锁
if
(
platformBrand
!=
null
)
{
return
ServiceResponse
.
success
(
platformBrand
.
getPlatformBrandId
());
return
ServiceResponse
.
failure
(
ErrorCode
.
DATA_EXISTS
.
getCode
(),
platformBrand
.
getPlatformBrandId
().
toString
());
}
// todo
// platformBrandDTO.setPlatformBrandCategoryName();
ServiceResponse
<
DictDTO
>
dictService
=
dictApiService
.
getDict
(
Constants
.
BUSINESS_CATEGORY
,
platformBrandDTO
.
getPlatformBrandCategoryCode
());
if
(!
dictService
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
dictService
.
getCode
(),
dictService
.
getMessage
());
}
platformBrandDTO
.
setPlatformBrandCategoryName
(
dictService
.
getResult
().
getKey
());
if
(
platformBrandDTO
.
getPlatformBrandId
()
==
null
)
{
// 新增
Integer
id
=
platformBrandService
.
save
(
platformBrandDTO
);
platformBrandDTO
.
setCreateType
(
BrandCreateTypeEnum
.
PLATFORM
.
getCode
());
Integer
id
=
platformBrandService
.
save
(
platformBrandDTO
);
platformBrandDTO
.
setPlatformBrandId
(
id
);
}
else
{
// 编辑
...
...
@@ -105,12 +121,12 @@ public class PlatformBrandApiServiceImpl implements PlatformBrandApiService {
}
@Override
public
ServiceResponse
<
Integer
>
addRef
(
Integer
enterpriseId
,
Integer
enterpriseBrandId
,
String
enterpriseBrandName
,
String
enterpriseBrandCode
,
Integer
categoryId
)
{
public
ServiceResponse
<
Integer
>
addRef
(
Integer
enterpriseId
,
Integer
enterpriseBrandId
,
String
enterpriseBrandName
,
String
enterpriseBrandCode
,
String
categoryCode
)
{
// 先判断后执行 可能并发
TabPlatformBrand
platformBrand
=
platformBrandService
.
getByBrandName
(
enterpriseBrandName
);
Integer
platformBrandId
;
if
(
platformBrand
==
null
)
{
ServiceResponse
<
Integer
>
serviceResponse
=
this
.
saveBrandFromGic
(
category
Id
,
enterpriseBrandName
);
ServiceResponse
<
Integer
>
serviceResponse
=
this
.
saveBrandFromGic
(
category
Code
,
enterpriseBrandName
);
if
(
serviceResponse
.
isSuccess
())
{
platformBrandId
=
serviceResponse
.
getResult
();
}
else
{
...
...
@@ -126,38 +142,42 @@ public class PlatformBrandApiServiceImpl implements PlatformBrandApiService {
platformBrandRefDTO
.
setEnterpriseBrandName
(
enterpriseBrandName
);
platformBrandRefDTO
.
setEnterpriseBrandCode
(
enterpriseBrandCode
);
Integer
platformBrandRefId
=
platformBrandRefService
.
save
(
platformBrandRefDTO
);
logger
.
info
(
"添加关联:{}"
,
JSON
.
toJSONString
(
platformBrandRefDTO
));
return
ServiceResponse
.
success
(
platformBrandRefId
);
}
@Override
public
ServiceResponse
<
Integer
>
delRef
(
Integer
enterpriseId
,
Integer
enterpriseBrandId
)
{
Integer
line
=
platformBrandRefService
.
delRef
(
enterpriseId
,
enterpriseBrandId
);
logger
.
info
(
"删除关联:[enterpriseId:{}, enterpriseBrandId:{}]"
,
enterpriseId
,
enterpriseBrandId
);
return
ServiceResponse
.
success
(
line
);
}
@Override
public
ServiceResponse
<
Integer
>
delRef
(
Integer
enterpriseId
,
List
<
Integer
>
enterpriseBrandIds
)
{
Integer
line
=
platformBrandRefService
.
delRef
(
enterpriseId
,
enterpriseBrandIds
);
logger
.
info
(
"删除关联:[enterpriseId:{}, enterpriseBrandId:{}]"
,
enterpriseId
,
enterpriseBrandIds
);
return
ServiceResponse
.
success
(
line
);
}
@Override
public
ServiceResponse
<
Integer
>
updateRef
(
Integer
enterpriseId
,
Integer
enterpriseBrandId
,
String
enterpriseBrandName
,
String
enterpriseBrandCode
,
Integer
categoryId
)
{
public
ServiceResponse
<
Integer
>
updateRef
(
Integer
enterpriseId
,
Integer
enterpriseBrandId
,
String
enterpriseBrandName
,
String
enterpriseBrandCode
,
String
categoryCode
)
{
// 先删除原来的
platformBrandRefService
.
delRef
(
enterpriseId
,
enterpriseBrandId
);
return
this
.
addRef
(
enterpriseId
,
enterpriseBrandId
,
enterpriseBrandName
,
enterpriseBrandCode
,
category
Id
);
return
this
.
addRef
(
enterpriseId
,
enterpriseBrandId
,
enterpriseBrandName
,
enterpriseBrandCode
,
category
Code
);
}
@Override
public
ServiceResponse
<
PlatformBrandDTO
>
getByBrandName
(
String
enterpriseB
randName
)
{
TabPlatformBrand
platformBrand
=
this
.
platformBrandService
.
getByBrandName
(
enterpriseB
randName
);
public
ServiceResponse
<
PlatformBrandDTO
>
getByBrandName
(
String
b
randName
)
{
TabPlatformBrand
platformBrand
=
this
.
platformBrandService
.
getByBrandName
(
b
randName
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityByOrika
(
PlatformBrandDTO
.
class
,
platformBrand
));
}
@Override
public
ServiceResponse
<
Page
<
PlatformBrandRefDTO
>>
listByPlatformBrandRef
(
String
brandName
,
Integer
pageNum
,
Integer
pageSize
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
com
.
github
.
pagehelper
.
Page
<
TabPlatformBrandRef
>
brandRefPage
=
this
.
platformBrandRefService
.
listByPlatformBrandRef
(
brandName
);
TabPlatformBrand
brand
=
this
.
platformBrandService
.
getByBrandName
(
brandName
);
com
.
github
.
pagehelper
.
Page
<
TabPlatformBrandRef
>
brandRefPage
=
this
.
platformBrandRefService
.
listByPlatformBrandRef
(
brand
==
null
?
null
:
brand
.
getPlatformBrandId
());
Page
<
PlatformBrandRefDTO
>
page
=
PageHelperUtils
.
changePageHelperToCurrentPage
(
brandRefPage
,
PlatformBrandRefDTO
.
class
);
return
ServiceResponse
.
success
(
page
);
}
...
...
gic-platform-enterprise-service/src/main/resources/dubbo-gic-platform-enterprise-service.xml
View file @
171642dc
...
...
@@ -26,4 +26,7 @@
<dubbo:reference
interface=
"com.gic.auth.service.UserApiService"
id=
"userApiService"
timeout=
"60000"
/>
<!--品牌库-->
<dubbo:service
interface=
"com.gic.enterprise.service.PlatformBrandApiService"
ref=
"platformBrandApiService"
timeout=
"60000"
/>
<!-- 字典 -->
<dubbo:reference
interface=
"com.gic.bizdict.api.service.BizdictService"
id=
"bizdictService"
timeout=
"60000"
/>
<dubbo:service
interface=
"com.gic.enterprise.service.DictApiService"
ref=
"dictApiService"
timeout=
"60000"
/>
</beans>
gic-platform-enterprise-service/src/main/resources/mapper/TabPlatformBrandMapper.xml
View file @
171642dc
...
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"com.gic.enterprise.dao.mapper.TabPlatformBrandMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.enterprise.entity.TabPlatformBrand"
>
<id
column=
"platform_brand_id"
jdbcType=
"INTEGER"
property=
"platformBrandId"
/>
<result
column=
"platform_brand_category_
id"
jdbcType=
"INTEGER"
property=
"platformBrandCategoryId
"
/>
<result
column=
"platform_brand_category_
code"
jdbcType=
"VARCHAR"
property=
"platformBrandCategoryCode
"
/>
<result
column=
"platform_brand_category_name"
jdbcType=
"VARCHAR"
property=
"platformBrandCategoryName"
/>
<result
column=
"platform_brand_name"
jdbcType=
"VARCHAR"
property=
"platformBrandName"
/>
<result
column=
"create_type"
jdbcType=
"INTEGER"
property=
"createType"
/>
...
...
@@ -12,7 +12,7 @@
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
platform_brand_id, platform_brand_category_
id
, platform_brand_category_name, platform_brand_name,
platform_brand_id, platform_brand_category_
code
, platform_brand_category_name, platform_brand_name,
create_type, create_time, update_time, status
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
...
...
@@ -26,26 +26,23 @@
where platform_brand_id = #{platformBrandId,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.enterprise.entity.TabPlatformBrand"
>
insert into tab_platform_brand (platform_brand_id, platform_brand_category_
id
,
insert into tab_platform_brand (platform_brand_id, platform_brand_category_
code
,
platform_brand_category_name, platform_brand_name,
create_type, create_time, update_time,
status)
values (#{platformBrandId,jdbcType=INTEGER}, #{platformBrandCategory
Id,jdbcType=INTEGE
R},
values (#{platformBrandId,jdbcType=INTEGER}, #{platformBrandCategory
Code,jdbcType=VARCHA
R},
#{platformBrandCategoryName,jdbcType=VARCHAR}, #{platformBrandName,jdbcType=VARCHAR},
#{createType,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{status,jdbcType=INTEGER})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.enterprise.entity.TabPlatformBrand"
>
<selectKey
keyProperty=
"platformBrandId"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_platform_brand
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"platformBrandId != null"
>
platform_brand_id,
</if>
<if
test=
"platformBrandCategory
Id
!= null"
>
platform_brand_category_
id
,
<if
test=
"platformBrandCategory
Code
!= null"
>
platform_brand_category_
code
,
</if>
<if
test=
"platformBrandCategoryName != null"
>
platform_brand_category_name,
...
...
@@ -70,8 +67,8 @@
<if
test=
"platformBrandId != null"
>
#{platformBrandId,jdbcType=INTEGER},
</if>
<if
test=
"platformBrandCategory
Id
!= null"
>
#{platformBrandCategory
Id,jdbcType=INTEGE
R},
<if
test=
"platformBrandCategory
Code
!= null"
>
#{platformBrandCategory
Code,jdbcType=VARCHA
R},
</if>
<if
test=
"platformBrandCategoryName != null"
>
#{platformBrandCategoryName,jdbcType=VARCHAR},
...
...
@@ -96,8 +93,8 @@
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.enterprise.entity.TabPlatformBrand"
>
update tab_platform_brand
<set>
<if
test=
"platformBrandCategory
Id
!= null"
>
platform_brand_category_
id = #{platformBrandCategoryId,jdbcType=INTEGE
R},
<if
test=
"platformBrandCategory
Code
!= null"
>
platform_brand_category_
code = #{platformBrandCategoryCode,jdbcType=VARCHA
R},
</if>
<if
test=
"platformBrandCategoryName != null"
>
platform_brand_category_name = #{platformBrandCategoryName,jdbcType=VARCHAR},
...
...
@@ -122,7 +119,7 @@
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.enterprise.entity.TabPlatformBrand"
>
update tab_platform_brand
set platform_brand_category_
id = #{platformBrandCategoryId,jdbcType=INTEGE
R},
set platform_brand_category_
code = #{platformBrandCategoryCode,jdbcType=VARCHA
R},
platform_brand_category_name = #{platformBrandCategoryName,jdbcType=VARCHAR},
platform_brand_name = #{platformBrandName,jdbcType=VARCHAR},
create_type = #{createType,jdbcType=INTEGER},
...
...
@@ -147,10 +144,10 @@
and create_type = #{createType}
</if>
<if
test=
"platformBrandName != null and platformBrandName != '' "
>
and platform_brand_name
= #{platformBrandName}
and platform_brand_name
like concat('%', #{platformBrandName} ,'%')
</if>
<if
test=
"platformBrandCategory
Id
!= null "
>
and platform_brand_category_
id = #{platformBrandCategoryId
}
<if
test=
"platformBrandCategory
Code
!= null "
>
and platform_brand_category_
code = #{platformBrandCategoryCode
}
</if>
order by update_time desc
</select>
...
...
gic-platform-enterprise-service/src/main/resources/mapper/TabPlatformBrandRefMapper.xml
View file @
171642dc
...
...
@@ -166,9 +166,6 @@
<if
test=
"platformBrandId != null "
>
and platform_brand_id = #{platformBrandId}
</if>
<if
test=
"brandName != null and brandName != '' "
>
and brand_name = #{brandName}
</if>
</select>
<update
id=
"delRefs"
>
update tab_platform_brand_ref set status = 0 where enterprise_id = #{enterpriseId} and status = 1
...
...
gic-platform-operation-web/src/main/java/com/gic/operation/web/controller/DictController.java
0 → 100644
View file @
171642dc
package
com
.
gic
.
operation
.
web
.
controller
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.dto.DictDTO
;
import
com.gic.enterprise.service.DictApiService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
public
class
DictController
{
@Autowired
private
DictApiService
dictApiService
;
@RequestMapping
(
"/list-all-businesscategory"
)
public
RestResponse
listAllBusinessCategory
()
{
ServiceResponse
<
List
<
DictDTO
>>
serviceResponse
=
dictApiService
.
listBusinessCategory
();
if
(
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
else
{
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
}
}
gic-platform-operation-web/src/main/java/com/gic/operation/web/controller/PlatformBrandController.java
View file @
171642dc
...
...
@@ -30,7 +30,7 @@ public class PlatformBrandController {
public
RestResponse
saveBrand
(
@Validated
({
PlatformBrandQO
.
SavePlatformBrandValid
.
class
})
PlatformBrandQO
platformBrandQO
)
{
PlatformBrandDTO
platformBrandDTO
=
new
PlatformBrandDTO
();
platformBrandDTO
.
setPlatformBrandName
(
platformBrandQO
.
getPlatformBrandName
());
platformBrandDTO
.
setPlatformBrandCategory
Id
(
platformBrandQO
.
getPlatformBrandCategoryId
());
platformBrandDTO
.
setPlatformBrandCategory
Code
(
platformBrandQO
.
getPlatformBrandCategoryCode
());
ServiceResponse
<
Integer
>
serviceResponse
=
platformBrandApiService
.
saveOrUpdateBrandFromOperation
(
platformBrandDTO
);
if
(
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
...
...
@@ -40,7 +40,7 @@ public class PlatformBrandController {
}
@RequestMapping
(
"/brand-del"
)
public
RestResponse
delBrand
(
@Validated
({
PlatformBrandQO
.
Save
PlatformBrandValid
.
class
})
PlatformBrandQO
platformBrandQO
)
{
public
RestResponse
delBrand
(
@Validated
({
PlatformBrandQO
.
Del
PlatformBrandValid
.
class
})
PlatformBrandQO
platformBrandQO
)
{
ServiceResponse
<
Integer
>
serviceResponse
=
platformBrandApiService
.
delBrandById
(
platformBrandQO
.
getPlatformBrandId
());
if
(
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
...
...
gic-platform-operation-web/src/main/java/com/gic/operation/web/qo/PlatformBrandQO.java
View file @
171642dc
...
...
@@ -15,7 +15,7 @@ public class PlatformBrandQO implements Serializable {
@NotNull
(
message
=
"品牌名不能为空"
,
groups
=
{
SavePlatformBrandValid
.
class
})
private
String
platformBrandName
;
@NotNull
(
message
=
"经营类目不能为空"
,
groups
=
{
SavePlatformBrandValid
.
class
})
private
Integer
platformBrandCategoryId
;
private
String
platformBrandCategoryCode
;
private
Integer
createType
;
...
...
@@ -35,12 +35,12 @@ public class PlatformBrandQO implements Serializable {
this
.
platformBrandName
=
platformBrandName
;
}
public
Integer
getPlatformBrandCategoryId
()
{
return
platformBrandCategory
Id
;
public
String
getPlatformBrandCategoryCode
()
{
return
platformBrandCategory
Code
;
}
public
void
setPlatformBrandCategory
Id
(
Integer
platformBrandCategoryId
)
{
this
.
platformBrandCategory
Id
=
platformBrandCategoryId
;
public
void
setPlatformBrandCategory
Code
(
String
platformBrandCategoryCode
)
{
this
.
platformBrandCategory
Code
=
platformBrandCategoryCode
;
}
public
Integer
getCreateType
()
{
...
...
gic-platform-operation-web/src/main/resources/dubbo-gic-platform-operation-web.xml
View file @
171642dc
...
...
@@ -45,4 +45,6 @@
<dubbo:reference
interface=
"com.gic.enterprise.service.TransferAccountsApprovalApiService"
id=
"transferAccountsApprovalApiService"
timeout=
"60000"
/>
<!-- 平台品牌库 -->
<dubbo:reference
interface=
"com.gic.enterprise.service.PlatformBrandApiService"
id=
"platformBrandApiService"
timeout=
"60000"
/>
<!--字典 -->
<dubbo:reference
interface=
"com.gic.enterprise.service.DictApiService"
id=
"dictApiService"
timeout=
"60000"
/>
</beans>
\ 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