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
51ded2ca
Commit
51ded2ca
authored
May 18, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
达摩产品情报站
parent
3c420c65
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
169 additions
and
0 deletions
+169
-0
ProductMarketTypeEnum.java
...va/com/gic/enterprise/constant/ProductMarketTypeEnum.java
+60
-0
ProductMarketQO.java
.../src/main/java/com/gic/enterprise/qo/ProductMarketQO.java
+15
-0
TabProductMarketMapper.xml
...vice/src/main/resources/mapper/TabProductMarketMapper.xml
+3
-0
ProductMarketController.java
...ic/enterprise/web/controller/ProductMarketController.java
+90
-0
dubbo-gic-platform-enterprise-web.xml
.../src/main/resources/dubbo-gic-platform-enterprise-web.xml
+1
-0
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/constant/ProductMarketTypeEnum.java
0 → 100644
View file @
51ded2ca
package
com
.
gic
.
enterprise
.
constant
;
/**
* 情报
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/5/18 2:38 PM
*/
public
enum
ProductMarketTypeEnum
{
/**
* 功能更新
*/
FUNCTION_UPDATE
(
"功能更新"
,
1
),
/**
* 产品推广
*/
PRODUCT_PROMOTION
(
"产品推广"
,
2
),
/**
* 成功案例
*/
SUCCESS_STORIES
(
"成功案例"
,
3
);
private
String
name
;
private
int
code
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
private
ProductMarketTypeEnum
(
String
name
,
int
code
)
{
this
.
name
=
name
;
this
.
code
=
code
;
}
/**
* 用于switch
* @param code
* @return
*/
public
static
ProductMarketTypeEnum
getByCode
(
int
code
){
for
(
ProductMarketTypeEnum
transactType
:
values
()){
if
(
transactType
.
getCode
()
==
code
)
{
return
transactType
;
}
}
return
null
;
}
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/qo/ProductMarketQO.java
View file @
51ded2ca
...
...
@@ -25,6 +25,11 @@ public class ProductMarketQO implements Serializable{
private
Integer
pageSize
;
/**
* 是否显示在gic后台的,如果是,则发布时间小于等于此刻的数据 1:是
*/
private
Integer
isShowGic
;
public
String
getTitle
()
{
return
title
;
}
...
...
@@ -67,6 +72,15 @@ public class ProductMarketQO implements Serializable{
return
this
;
}
public
Integer
getShowGic
()
{
return
isShowGic
;
}
public
ProductMarketQO
setShowGic
(
Integer
showGic
)
{
isShowGic
=
showGic
;
return
this
;
}
@Override
public
String
toString
()
{
return
"ProductMarketQO{"
+
...
...
@@ -74,6 +88,7 @@ public class ProductMarketQO implements Serializable{
", infoType="
+
infoType
+
", pageNum="
+
pageNum
+
", pageSize="
+
pageSize
+
", isShowGic="
+
isShowGic
+
'}'
;
}
}
gic-platform-enterprise-service/src/main/resources/mapper/TabProductMarketMapper.xml
View file @
51ded2ca
...
...
@@ -135,6 +135,9 @@
<if
test=
"infoType != null"
>
and info_type = #{infoType}
</if>
<if
test=
"isShowGic != null and isShowGic == 1"
>
and release_time
<
=now()
</if>
order by release_time desc
</select>
...
...
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/ProductMarketController.java
0 → 100644
View file @
51ded2ca
package
com
.
gic
.
enterprise
.
web
.
controller
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.constant.ProductMarketTypeEnum
;
import
com.gic.enterprise.dto.ProductMarketDTO
;
import
com.gic.enterprise.qo.ProductMarketQO
;
import
com.gic.enterprise.service.ProductMarketApiService
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 达摩产品情报站
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/5/18 2:35 PM
*/
@RestController
@RequestMapping
(
"/product-market"
)
public
class
ProductMarketController
{
@Autowired
private
ProductMarketApiService
productMarketApiService
;
@RequestMapping
(
"query-product-market"
)
@ResponseBody
public
RestResponse
queryProductMarket
(
Integer
showCount
)
{
Map
<
String
,
List
<
ProductMarketDTO
>>
result
=
new
HashMap
<>(
8
);
//功能更新
ProductMarketQO
params
=
new
ProductMarketQO
();
if
(
showCount
==
null
)
{
showCount
=
5
;
}
params
.
setShowGic
(
1
);
params
.
setPageNum
(
1
);
params
.
setPageSize
(
showCount
);
params
.
setInfoType
(
ProductMarketTypeEnum
.
FUNCTION_UPDATE
.
getCode
());
ServiceResponse
<
Page
<
ProductMarketDTO
>>
functionUpdate
=
productMarketApiService
.
pageProductMarket
(
params
);
if
(
isNotEmptyList
(
functionUpdate
))
{
result
.
put
(
"functionUpdate"
,
functionUpdate
.
getResult
().
getResult
());
}
else
{
result
.
put
(
"functionUpdate"
,
Collections
.
EMPTY_LIST
);
}
//
params
.
setInfoType
(
ProductMarketTypeEnum
.
PRODUCT_PROMOTION
.
getCode
());
ServiceResponse
<
Page
<
ProductMarketDTO
>>
productPromotion
=
productMarketApiService
.
pageProductMarket
(
params
);
if
(
isNotEmptyList
(
productPromotion
))
{
result
.
put
(
"productPromotion"
,
productPromotion
.
getResult
().
getResult
());
}
else
{
result
.
put
(
"productPromotion"
,
Collections
.
EMPTY_LIST
);
}
//
params
.
setInfoType
(
ProductMarketTypeEnum
.
SUCCESS_STORIES
.
getCode
());
ServiceResponse
<
Page
<
ProductMarketDTO
>>
successStories
=
productMarketApiService
.
pageProductMarket
(
params
);
if
(
isNotEmptyList
(
successStories
))
{
result
.
put
(
"successStories"
,
successStories
.
getResult
().
getResult
());
}
else
{
result
.
put
(
"successStories"
,
Collections
.
EMPTY_LIST
);
}
return
RestResponse
.
success
(
result
);
}
/**
* 首页前端是否需要弹窗
* @return
*/
@RequestMapping
(
"is-need-to-popup"
)
@ResponseBody
public
RestResponse
isNeedToPopup
()
{
return
ResultControllerUtils
.
commonResult
(
productMarketApiService
.
isNeedToPopup
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
UserDetailUtils
.
getUserDetail
().
getUserId
()));
}
private
boolean
isNotEmptyList
(
ServiceResponse
<
Page
<
ProductMarketDTO
>>
response
)
{
return
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
&&
CollectionUtils
.
isNotEmpty
(
response
.
getResult
().
getResult
());
}
}
gic-platform-enterprise-web/src/main/resources/dubbo-gic-platform-enterprise-web.xml
View file @
51ded2ca
...
...
@@ -154,4 +154,5 @@
<dubbo:reference
interface=
"com.gic.auth.service.AccountGroupApiService"
id=
"accountGroupApiService"
timeout=
"6000"
/>
<!--短信签名-->
<dubbo:reference
interface=
"com.gic.marketing.api.service.sms.SmsApiService"
id=
"smsApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.enterprise.service.ProductMarketApiService"
id=
"productMarketApiService"
timeout=
"6000"
/>
</beans>
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