Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
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
poc
poc-api
Commits
084105cc
Commit
084105cc
authored
Nov 04, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 应用广场-查询条件 标题模糊/应用分类
parent
bb2aa3cb
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
376 additions
and
69 deletions
+376
-69
BizAgentApplicationMallConvert.java
...t_application/convert/BizAgentApplicationMallConvert.java
+62
-0
AgentApplicationMallQueryDto.java
...c/agent_application/dto/AgentApplicationMallQueryDto.java
+26
-0
MallAgentApplicationQuery.sql
...poc/agent_application/query/MallAgentApplicationQuery.sql
+18
-0
MallAgentApplicationQueryCondition.java
...application/query/MallAgentApplicationQueryCondition.java
+33
-0
MallAgentApplicationQueryItem.java
...gent_application/query/MallAgentApplicationQueryItem.java
+142
-0
BizAgentApplicationMallRest.java
...c/agent_application/rest/BizAgentApplicationMallRest.java
+2
-1
BizAgentApplicationMallRestImpl.java
...pplication/rest/impl/BizAgentApplicationMallRestImpl.java
+17
-4
BizAgentApplicationMallService.java
...t_application/service/BizAgentApplicationMallService.java
+8
-4
BizAgentApplicationMallServiceImpl.java
...tion/service/impl/BizAgentApplicationMallServiceImpl.java
+68
-60
No files found.
src/main/java/cn/com/poc/agent_application/convert/BizAgentApplicationMallConvert.java
View file @
084105cc
...
@@ -9,8 +9,10 @@ import cn.com.poc.agent_application.entity.Variable;
...
@@ -9,8 +9,10 @@ import cn.com.poc.agent_application.entity.Variable;
import
cn.com.poc.agent_application.model.BizAgentApplicationMallModel
;
import
cn.com.poc.agent_application.model.BizAgentApplicationMallModel
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationMallEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationMallEntity
;
import
cn.com.poc.agent_application.dto.BizAgentApplicationMallDto
;
import
cn.com.poc.agent_application.dto.BizAgentApplicationMallDto
;
import
cn.com.poc.agent_application.query.MallAgentApplicationQueryItem
;
import
cn.com.poc.agent_application.service.BizAgentApplicationPublishService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationPublishService
;
import
cn.com.poc.agent_application.service.impl.BizAgentApplicationPublishServiceImpl
;
import
cn.com.poc.agent_application.service.impl.BizAgentApplicationPublishServiceImpl
;
import
cn.com.poc.common.constant.CommonConstant
;
import
cn.com.poc.common.utils.SpringUtils
;
import
cn.com.poc.common.utils.SpringUtils
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -108,6 +110,66 @@ public class BizAgentApplicationMallConvert {
...
@@ -108,6 +110,66 @@ public class BizAgentApplicationMallConvert {
return
dto
;
return
dto
;
}
}
public
static
BizAgentApplicationMallDto
itemToDto
(
MallAgentApplicationQueryItem
item
)
throws
Exception
{
BizAgentApplicationMallDto
dto
=
new
BizAgentApplicationMallDto
();
BizAgentApplicationPublishService
agentApplicationPublishService
=
SpringUtils
.
getBean
(
BizAgentApplicationPublishServiceImpl
.
class
);
BizAgentApplicationPublishEntity
publishEntity
=
agentApplicationPublishService
.
get
(
item
.
getAgentPublishId
());
AgentApplicationBaseInfo
baseInfo
=
new
AgentApplicationBaseInfo
();
if
(
publishEntity
!=
null
)
{
baseInfo
.
setMemberId
(
publishEntity
.
getMemberId
());
baseInfo
.
setAgentId
(
publishEntity
.
getAgentId
());
baseInfo
.
setAgentTitle
(
publishEntity
.
getAgentTitle
());
baseInfo
.
setAgentAvatar
(
publishEntity
.
getAgentAvatar
());
baseInfo
.
setAgentDesc
(
publishEntity
.
getAgentDesc
());
baseInfo
.
setAgentSystem
(
publishEntity
.
getAgentSystem
());
baseInfo
.
setAgentPublishStatus
(
publishEntity
.
getAgentPublishStatus
());
baseInfo
.
setPublishTime
(
publishEntity
.
getPublishTime
());
}
AgentApplicationCommConfig
commConfig
=
new
AgentApplicationCommConfig
();
if
(
publishEntity
!=
null
)
{
commConfig
.
setPreamble
(
publishEntity
.
getPreamble
());
commConfig
.
setFeaturedQuestions
(
publishEntity
.
getFeaturedQuestions
());
commConfig
.
setContinuousQuestionStatus
(
publishEntity
.
getContinuousQuestionStatus
());
commConfig
.
setContinuousQuestionSystem
(
publishEntity
.
getContinuousQuestionSystem
());
commConfig
.
setContinuousQuestionTurn
(
publishEntity
.
getContinuousQuestionTurn
());
commConfig
.
setVariableStructure
(
publishEntity
.
getVariableStructure
());
commConfig
.
setIsLongMemory
(
publishEntity
.
getIsLongMemory
());
}
AgentApplicationKnowledgeConfig
knowledgeConfig
=
new
AgentApplicationKnowledgeConfig
();
if
(
publishEntity
!=
null
)
{
knowledgeConfig
.
setKnowledgeIds
(
publishEntity
.
getKnowledgeIds
());
}
AgentApplicationCommModelConfig
commModelConfig
=
new
AgentApplicationCommModelConfig
();
if
(
publishEntity
!=
null
)
{
commModelConfig
.
setLargeModel
(
publishEntity
.
getLargeModel
());
commModelConfig
.
setTopP
(
publishEntity
.
getTopP
());
commModelConfig
.
setCommunicationTurn
(
publishEntity
.
getCommunicationTurn
());
}
dto
.
setId
(
item
.
getId
());
dto
.
setAgentType
(
item
.
getAgentType
());
dto
.
setCollectNumber
(
item
.
getCollectNumber
());
dto
.
setClickNumber
(
item
.
getClickNumber
());
dto
.
setBaseInfo
(
baseInfo
);
dto
.
setCommConfig
(
commConfig
);
dto
.
setKnowledgeConfig
(
knowledgeConfig
);
dto
.
setCommModelConfig
(
commModelConfig
);
if
(
publishEntity
!=
null
)
{
dto
.
setUnitIds
(
publishEntity
.
getUnitIds
());
}
dto
.
setIsCopy
(
item
.
getIsCopy
());
dto
.
setIsSale
(
item
.
getIsSale
());
dto
.
setPopularity
(
item
.
getPopularity
());
return
dto
;
}
public
static
BizAgentApplicationMallEntity
dtoToEntity
(
BizAgentApplicationMallDto
dto
)
{
public
static
BizAgentApplicationMallEntity
dtoToEntity
(
BizAgentApplicationMallDto
dto
)
{
BizAgentApplicationMallEntity
entity
=
new
BizAgentApplicationMallEntity
();
BizAgentApplicationMallEntity
entity
=
new
BizAgentApplicationMallEntity
();
entity
.
setId
(
dto
.
getId
());
entity
.
setId
(
dto
.
getId
());
...
...
src/main/java/cn/com/poc/agent_application/dto/AgentApplicationMallQueryDto.java
0 → 100644
View file @
084105cc
package
cn
.
com
.
poc
.
agent_application
.
dto
;
import
java.io.Serializable
;
public
class
AgentApplicationMallQueryDto
implements
Serializable
{
private
String
agentType
;
private
String
search
;
public
String
getAgentType
()
{
return
agentType
;
}
public
void
setAgentType
(
String
agentType
)
{
this
.
agentType
=
agentType
;
}
public
String
getSearch
()
{
return
search
;
}
public
void
setSearch
(
String
search
)
{
this
.
search
=
search
;
}
}
src/main/java/cn/com/poc/agent_application/query/MallAgentApplicationQuery.sql
0 → 100644
View file @
084105cc
select
baam
.
id
,
baam
.
agent_publish_id
,
baam
.
agent_type
,
baam
.
collect_number
,
baam
.
is_sale
,
baam
.
click_number
,
baam
.
is_copy
,
baam
.
popularity
,
baap
.
agent_id
from
biz_agent_application_mall
baam
left
join
biz_agent_application_publish
baap
on
baap
.
id
=
baam
.
agent_publish_id
and
baap
.
is_deleted
=
'N'
where
baam
.
is_deleted
=
'N'
and
baam
.
is_sale
=
'Y'
<<
and
baam
.
agent_type
=
:
agentType
>>
<<
and
LOCATE
(:
query
,
baap
.
agent_title
)
>>
order
by
baam
.
CREATED_TIME
desc
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/MallAgentApplicationQueryCondition.java
0 → 100644
View file @
084105cc
package
cn
.
com
.
poc
.
agent_application
.
query
;
import
java.io.Serializable
;
/**
* Query Condition class for MallAgentApplicationQuery
*/
public
class
MallAgentApplicationQueryCondition
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
java
.
lang
.
String
agentType
;
public
java
.
lang
.
String
getAgentType
(){
return
this
.
agentType
;
}
public
void
setAgentType
(
java
.
lang
.
String
agentType
){
this
.
agentType
=
agentType
;
}
private
java
.
lang
.
String
query
;
public
String
getQuery
()
{
return
query
;
}
public
void
setQuery
(
String
query
)
{
this
.
query
=
query
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/MallAgentApplicationQueryItem.java
0 → 100644
View file @
084105cc
package
cn
.
com
.
poc
.
agent_application
.
query
;
import
java.io.Serializable
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
cn.com.yict.framemax.data.model.BaseItemClass
;
/**
* Query Item class for MallAgentApplicationQuery
*/
@Entity
public
class
MallAgentApplicationQueryItem
extends
BaseItemClass
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** id
*id
*/
private
java
.
lang
.
Integer
id
;
@Column
(
name
=
"id"
)
public
java
.
lang
.
Integer
getId
(){
return
this
.
id
;
}
public
void
setId
(
java
.
lang
.
Integer
id
){
this
.
id
=
id
;
}
/** agent_publish_id
*agent_publish_id
*/
private
java
.
lang
.
Integer
agentPublishId
;
@Column
(
name
=
"agent_publish_id"
)
public
java
.
lang
.
Integer
getAgentPublishId
(){
return
this
.
agentPublishId
;
}
public
void
setAgentPublishId
(
java
.
lang
.
Integer
agentPublishId
){
this
.
agentPublishId
=
agentPublishId
;
}
/** agent_type
*agent_type
*/
private
java
.
lang
.
String
agentType
;
@Column
(
name
=
"agent_type"
)
public
java
.
lang
.
String
getAgentType
(){
return
this
.
agentType
;
}
public
void
setAgentType
(
java
.
lang
.
String
agentType
){
this
.
agentType
=
agentType
;
}
/** collect_number
*collect_number
*/
private
java
.
lang
.
Integer
collectNumber
;
@Column
(
name
=
"collect_number"
)
public
java
.
lang
.
Integer
getCollectNumber
(){
return
this
.
collectNumber
;
}
public
void
setCollectNumber
(
java
.
lang
.
Integer
collectNumber
){
this
.
collectNumber
=
collectNumber
;
}
/** baam.is_sale = 'Y'
*baam.is_sale = 'Y'
*/
private
java
.
lang
.
String
isSale
;
@Column
(
name
=
"is_sale"
)
public
java
.
lang
.
String
getIsSale
(){
return
this
.
isSale
;
}
public
void
setIsSale
(
String
isSale
)
{
this
.
isSale
=
isSale
;
}
/** click_number
*click_number
*/
private
java
.
lang
.
Integer
clickNumber
;
@Column
(
name
=
"click_number"
)
public
java
.
lang
.
Integer
getClickNumber
(){
return
this
.
clickNumber
;
}
public
void
setClickNumber
(
java
.
lang
.
Integer
clickNumber
){
this
.
clickNumber
=
clickNumber
;
}
/** is_copy
*is_copy
*/
private
java
.
lang
.
String
isCopy
;
@Column
(
name
=
"is_copy"
)
public
java
.
lang
.
String
getIsCopy
(){
return
this
.
isCopy
;
}
public
void
setIsCopy
(
java
.
lang
.
String
isCopy
){
this
.
isCopy
=
isCopy
;
}
/** popularity
*popularity
*/
private
java
.
lang
.
Double
popularity
;
@Column
(
name
=
"popularity"
)
public
java
.
lang
.
Double
getPopularity
(){
return
this
.
popularity
;
}
public
void
setPopularity
(
java
.
lang
.
Double
popularity
){
this
.
popularity
=
popularity
;
}
/** agent_id
*agent_id
*/
private
java
.
lang
.
String
agentId
;
@Column
(
name
=
"agent_id"
)
public
java
.
lang
.
String
getAgentId
(){
return
this
.
agentId
;
}
public
void
setAgentId
(
java
.
lang
.
String
agentId
){
this
.
agentId
=
agentId
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/rest/BizAgentApplicationMallRest.java
View file @
084105cc
package
cn
.
com
.
poc
.
agent_application
.
rest
;
package
cn
.
com
.
poc
.
agent_application
.
rest
;
import
cn.com.poc.agent_application.dto.AgentApplicationMallQueryDto
;
import
cn.com.yict.framemax.core.rest.BaseRest
;
import
cn.com.yict.framemax.core.rest.BaseRest
;
import
cn.com.poc.agent_application.dto.BizAgentApplicationMallDto
;
import
cn.com.poc.agent_application.dto.BizAgentApplicationMallDto
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
...
@@ -30,7 +31,7 @@ public interface BizAgentApplicationMallRest extends BaseRest {
...
@@ -30,7 +31,7 @@ public interface BizAgentApplicationMallRest extends BaseRest {
/**
/**
* 获取【应用广场】的应用列表
* 获取【应用广场】的应用列表
*/
*/
List
<
BizAgentApplicationMallDto
>
getList
(
PagingInfo
pagingInfo
)
throws
Exception
;
List
<
BizAgentApplicationMallDto
>
getList
(
@RequestBody
(
required
=
false
)
AgentApplicationMallQueryDto
dto
,
PagingInfo
pagingInfo
)
throws
Exception
;
BizAgentApplicationMallDto
update
(
@RequestBody
BizAgentApplicationMallDto
dto
)
throws
Exception
;
BizAgentApplicationMallDto
update
(
@RequestBody
BizAgentApplicationMallDto
dto
)
throws
Exception
;
...
...
src/main/java/cn/com/poc/agent_application/rest/impl/BizAgentApplicationMallRestImpl.java
View file @
084105cc
...
@@ -7,9 +7,12 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -7,9 +7,12 @@ import javax.servlet.http.HttpServletRequest;
import
cn.com.poc.agent_application.aggregate.AgentApplicationMallService
;
import
cn.com.poc.agent_application.aggregate.AgentApplicationMallService
;
import
cn.com.poc.agent_application.convert.BizAgentApplicationCategoryConvert
;
import
cn.com.poc.agent_application.convert.BizAgentApplicationCategoryConvert
;
import
cn.com.poc.agent_application.dto.AgentApplicationMallQueryDto
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationCategoryEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationCategoryEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationPublishEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationPublishEntity
;
import
cn.com.poc.agent_application.entity.BizMemberAgentApplicationCollectEntity
;
import
cn.com.poc.agent_application.entity.BizMemberAgentApplicationCollectEntity
;
import
cn.com.poc.agent_application.query.MallAgentApplicationQueryCondition
;
import
cn.com.poc.agent_application.query.MallAgentApplicationQueryItem
;
import
cn.com.poc.agent_application.service.BizAgentApplicationCategoryService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationCategoryService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationPublishService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationPublishService
;
import
cn.com.poc.agent_application.service.BizMemberAgentApplicationCollectService
;
import
cn.com.poc.agent_application.service.BizMemberAgentApplicationCollectService
;
...
@@ -93,11 +96,21 @@ public class BizAgentApplicationMallRestImpl implements BizAgentApplicationMallR
...
@@ -93,11 +96,21 @@ public class BizAgentApplicationMallRestImpl implements BizAgentApplicationMallR
return
null
;
return
null
;
}
}
public
List
<
BizAgentApplicationMallDto
>
getList
(
PagingInfo
pagingInfo
)
throws
Exception
{
public
List
<
BizAgentApplicationMallDto
>
getList
(
AgentApplicationMallQueryDto
dto
,
PagingInfo
pagingInfo
)
throws
Exception
{
List
<
BizAgentApplicationMallDto
>
resultList
=
new
ArrayList
<>();
List
<
BizAgentApplicationMallDto
>
resultList
=
new
ArrayList
<>();
List
<
BizAgentApplicationMallEntity
>
byExample
=
bizAgentApplicationMallService
.
findByExample
(
pagingInfo
);
MallAgentApplicationQueryCondition
mallAgentApplicationQueryCondition
=
new
MallAgentApplicationQueryCondition
();
for
(
BizAgentApplicationMallEntity
entity
:
byExample
)
{
if
(
dto
!=
null
)
{
BizAgentApplicationMallDto
mallDto
=
BizAgentApplicationMallConvert
.
entityToDto
(
entity
);
if
(
StringUtils
.
isNotBlank
(
dto
.
getSearch
()))
{
mallAgentApplicationQueryCondition
.
setQuery
(
dto
.
getSearch
());
}
if
(
StringUtils
.
isNotBlank
(
dto
.
getAgentType
()))
{
mallAgentApplicationQueryCondition
.
setAgentType
(
dto
.
getAgentType
());
}
}
List
<
MallAgentApplicationQueryItem
>
items
=
bizAgentApplicationMallService
.
mallAgentApplicationQuery
(
mallAgentApplicationQueryCondition
,
pagingInfo
);
for
(
MallAgentApplicationQueryItem
item
:
items
)
{
BizAgentApplicationMallDto
mallDto
=
BizAgentApplicationMallConvert
.
itemToDto
(
item
);
// 如果应用上架了
// 如果应用上架了
if
(
CommonConstant
.
IsDeleted
.
Y
.
equals
(
mallDto
.
getIsSale
()))
{
if
(
CommonConstant
.
IsDeleted
.
Y
.
equals
(
mallDto
.
getIsSale
()))
{
// 设置当前用户是否收藏了
// 设置当前用户是否收藏了
...
...
src/main/java/cn/com/poc/agent_application/service/BizAgentApplicationMallService.java
View file @
084105cc
package
cn
.
com
.
poc
.
agent_application
.
service
;
package
cn
.
com
.
poc
.
agent_application
.
service
;
import
cn.com.poc.agent_application.query.MallAgentApplicationQueryCondition
;
import
cn.com.poc.agent_application.query.MallAgentApplicationQueryItem
;
import
cn.com.yict.framemax.core.service.BaseService
;
import
cn.com.yict.framemax.core.service.BaseService
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationMallEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationMallEntity
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
...
@@ -12,10 +14,10 @@ public interface BizAgentApplicationMallService extends BaseService {
...
@@ -12,10 +14,10 @@ public interface BizAgentApplicationMallService extends BaseService {
BizAgentApplicationMallEntity
getByAgentPublishId
(
Integer
agentPublishId
)
throws
Exception
;
BizAgentApplicationMallEntity
getByAgentPublishId
(
Integer
agentPublishId
)
throws
Exception
;
List
<
BizAgentApplicationMallEntity
>
findByExample
(
BizAgentApplicationMallEntity
example
,
PagingInfo
pagingInfo
)
throws
Exception
;
List
<
BizAgentApplicationMallEntity
>
findByExample
(
BizAgentApplicationMallEntity
example
,
PagingInfo
pagingInfo
)
throws
Exception
;
List
<
BizAgentApplicationMallEntity
>
findByExample
(
PagingInfo
pagingInfo
)
throws
Exception
;
List
<
BizAgentApplicationMallEntity
>
findByExample
(
PagingInfo
pagingInfo
)
throws
Exception
;
BizAgentApplicationMallEntity
save
(
BizAgentApplicationMallEntity
entity
)
throws
Exception
;
BizAgentApplicationMallEntity
save
(
BizAgentApplicationMallEntity
entity
)
throws
Exception
;
BizAgentApplicationMallEntity
update
(
BizAgentApplicationMallEntity
entity
)
throws
Exception
;
BizAgentApplicationMallEntity
update
(
BizAgentApplicationMallEntity
entity
)
throws
Exception
;
...
@@ -24,6 +26,8 @@ public interface BizAgentApplicationMallService extends BaseService {
...
@@ -24,6 +26,8 @@ public interface BizAgentApplicationMallService extends BaseService {
void
deletedById
(
java
.
lang
.
Integer
id
)
throws
Exception
;
void
deletedById
(
java
.
lang
.
Integer
id
)
throws
Exception
;
List
<
BizAgentApplicationMallEntity
>
getList
()
throws
Exception
;
List
<
BizAgentApplicationMallEntity
>
getList
()
throws
Exception
;
List
<
MallAgentApplicationQueryItem
>
mallAgentApplicationQuery
(
MallAgentApplicationQueryCondition
condition
,
PagingInfo
pagingInfo
);
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationMallServiceImpl.java
View file @
084105cc
package
cn
.
com
.
poc
.
agent_application
.
service
.
impl
;
package
cn
.
com
.
poc
.
agent_application
.
service
.
impl
;
import
cn.com.poc.agent_application.query.MallAgentApplicationQueryCondition
;
import
cn.com.poc.agent_application.query.MallAgentApplicationQueryItem
;
import
cn.com.yict.framemax.core.service.impl.BaseServiceImpl
;
import
cn.com.yict.framemax.core.service.impl.BaseServiceImpl
;
import
cn.com.poc.agent_application.service.BizAgentApplicationMallService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationMallService
;
import
cn.com.poc.agent_application.model.BizAgentApplicationMallModel
;
import
cn.com.poc.agent_application.model.BizAgentApplicationMallModel
;
...
@@ -10,30 +12,32 @@ import cn.com.yict.framemax.data.model.PagingInfo;
...
@@ -10,30 +12,32 @@ import cn.com.yict.framemax.data.model.PagingInfo;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.List
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
@Service
@Service
public
class
BizAgentApplicationMallServiceImpl
extends
BaseServiceImpl
public
class
BizAgentApplicationMallServiceImpl
extends
BaseServiceImpl
implements
BizAgentApplicationMallService
{
implements
BizAgentApplicationMallService
{
@Resource
@Resource
private
BizAgentApplicationMallRepository
repository
;
private
BizAgentApplicationMallRepository
repository
;
public
BizAgentApplicationMallEntity
get
(
java
.
lang
.
Integer
id
)
throws
Exception
{
public
BizAgentApplicationMallEntity
get
(
java
.
lang
.
Integer
id
)
throws
Exception
{
Assert
.
notNull
(
id
);
Assert
.
notNull
(
id
);
BizAgentApplicationMallModel
model
=
this
.
repository
.
get
(
id
);
BizAgentApplicationMallModel
model
=
this
.
repository
.
get
(
id
);
if
(
model
==
null
){
if
(
model
==
null
)
{
return
null
;
return
null
;
}
}
if
(
"Y"
.
equals
(
model
.
getIsDeleted
())){
if
(
"Y"
.
equals
(
model
.
getIsDeleted
()))
{
return
null
;
return
null
;
}
}
return
BizAgentApplicationMallConvert
.
modelToEntity
(
model
);
return
BizAgentApplicationMallConvert
.
modelToEntity
(
model
);
}
}
@Override
@Override
public
BizAgentApplicationMallEntity
getByAgentPublishId
(
Integer
agentPublishId
)
throws
Exception
{
public
BizAgentApplicationMallEntity
getByAgentPublishId
(
Integer
agentPublishId
)
throws
Exception
{
...
@@ -47,14 +51,14 @@ public class BizAgentApplicationMallServiceImpl extends BaseServiceImpl
...
@@ -47,14 +51,14 @@ public class BizAgentApplicationMallServiceImpl extends BaseServiceImpl
return
null
;
return
null
;
}
}
public
List
<
BizAgentApplicationMallEntity
>
findByExample
(
BizAgentApplicationMallEntity
example
,
PagingInfo
pagingInfo
)
throws
Exception
{
public
List
<
BizAgentApplicationMallEntity
>
findByExample
(
BizAgentApplicationMallEntity
example
,
PagingInfo
pagingInfo
)
throws
Exception
{
List
<
BizAgentApplicationMallEntity
>
result
=
new
ArrayList
<
BizAgentApplicationMallEntity
>();
List
<
BizAgentApplicationMallEntity
>
result
=
new
ArrayList
<
BizAgentApplicationMallEntity
>();
BizAgentApplicationMallModel
model
=
new
BizAgentApplicationMallModel
();
BizAgentApplicationMallModel
model
=
new
BizAgentApplicationMallModel
();
if
(
example
!=
null
){
if
(
example
!=
null
)
{
model
=
BizAgentApplicationMallConvert
.
entityToModel
(
example
);
model
=
BizAgentApplicationMallConvert
.
entityToModel
(
example
);
}
}
model
.
setIsDeleted
(
"N"
);
model
.
setIsDeleted
(
"N"
);
List
<
BizAgentApplicationMallModel
>
models
=
this
.
repository
.
findByExample
(
model
,
pagingInfo
);
List
<
BizAgentApplicationMallModel
>
models
=
this
.
repository
.
findByExample
(
model
,
pagingInfo
);
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
result
=
models
.
stream
().
map
(
BizAgentApplicationMallConvert:
:
modelToEntity
).
collect
(
Collectors
.
toList
());
result
=
models
.
stream
().
map
(
BizAgentApplicationMallConvert:
:
modelToEntity
).
collect
(
Collectors
.
toList
());
}
}
...
@@ -63,55 +67,55 @@ public class BizAgentApplicationMallServiceImpl extends BaseServiceImpl
...
@@ -63,55 +67,55 @@ public class BizAgentApplicationMallServiceImpl extends BaseServiceImpl
@Override
@Override
public
List
<
BizAgentApplicationMallEntity
>
findByExample
(
PagingInfo
pagingInfo
)
throws
Exception
{
public
List
<
BizAgentApplicationMallEntity
>
findByExample
(
PagingInfo
pagingInfo
)
throws
Exception
{
List
<
BizAgentApplicationMallEntity
>
result
=
new
ArrayList
<
BizAgentApplicationMallEntity
>();
List
<
BizAgentApplicationMallEntity
>
result
=
new
ArrayList
<
BizAgentApplicationMallEntity
>();
BizAgentApplicationMallModel
model
=
new
BizAgentApplicationMallModel
();
BizAgentApplicationMallModel
model
=
new
BizAgentApplicationMallModel
();
model
.
setIsDeleted
(
"N"
);
model
.
setIsDeleted
(
"N"
);
List
<
BizAgentApplicationMallModel
>
models
=
this
.
repository
.
findByExample
(
model
,
"id desc"
,
pagingInfo
);
List
<
BizAgentApplicationMallModel
>
models
=
this
.
repository
.
findByExample
(
model
,
"id desc"
,
pagingInfo
);
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
result
=
models
.
stream
().
map
(
BizAgentApplicationMallConvert:
:
modelToEntity
).
collect
(
Collectors
.
toList
());
result
=
models
.
stream
().
map
(
BizAgentApplicationMallConvert:
:
modelToEntity
).
collect
(
Collectors
.
toList
());
}
}
return
result
;
return
result
;
}
}
public
BizAgentApplicationMallEntity
save
(
BizAgentApplicationMallEntity
entity
)
throws
Exception
{
public
BizAgentApplicationMallEntity
save
(
BizAgentApplicationMallEntity
entity
)
throws
Exception
{
Assert
.
notNull
(
entity
);
Assert
.
notNull
(
entity
);
entity
.
setId
(
null
);
entity
.
setId
(
null
);
entity
.
setIsDeleted
(
"N"
);
entity
.
setIsDeleted
(
"N"
);
BizAgentApplicationMallModel
model
=
BizAgentApplicationMallConvert
.
entityToModel
(
entity
);
BizAgentApplicationMallModel
model
=
BizAgentApplicationMallConvert
.
entityToModel
(
entity
);
BizAgentApplicationMallModel
saveModel
=
this
.
repository
.
save
(
model
);
BizAgentApplicationMallModel
saveModel
=
this
.
repository
.
save
(
model
);
return
BizAgentApplicationMallConvert
.
modelToEntity
(
saveModel
);
return
BizAgentApplicationMallConvert
.
modelToEntity
(
saveModel
);
}
}
public
BizAgentApplicationMallEntity
update
(
BizAgentApplicationMallEntity
entity
)
throws
Exception
{
public
BizAgentApplicationMallEntity
update
(
BizAgentApplicationMallEntity
entity
)
throws
Exception
{
Assert
.
notNull
(
entity
);
Assert
.
notNull
(
entity
);
Assert
.
notNull
(
entity
.
getId
(),
"update pk can not be null"
);
Assert
.
notNull
(
entity
.
getId
(),
"update pk can not be null"
);
BizAgentApplicationMallModel
model
=
this
.
repository
.
get
(
entity
.
getId
());
BizAgentApplicationMallModel
model
=
this
.
repository
.
get
(
entity
.
getId
());
if
(
entity
.
getAgentPublishId
()
!=
null
)
{
if
(
entity
.
getAgentPublishId
()
!=
null
)
{
model
.
setAgentPublishId
(
entity
.
getAgentPublishId
());
model
.
setAgentPublishId
(
entity
.
getAgentPublishId
());
}
}
if
(
entity
.
getAgentType
()
!=
null
)
{
if
(
entity
.
getAgentType
()
!=
null
)
{
model
.
setAgentType
(
entity
.
getAgentType
());
model
.
setAgentType
(
entity
.
getAgentType
());
}
}
if
(
entity
.
getCollectNumber
()
!=
null
)
{
if
(
entity
.
getCollectNumber
()
!=
null
)
{
model
.
setCollectNumber
(
entity
.
getCollectNumber
());
model
.
setCollectNumber
(
entity
.
getCollectNumber
());
}
}
if
(
entity
.
getClickNumber
()
!=
null
)
{
if
(
entity
.
getClickNumber
()
!=
null
)
{
model
.
setClickNumber
(
entity
.
getClickNumber
());
model
.
setClickNumber
(
entity
.
getClickNumber
());
}
}
if
(
entity
.
getIsCopy
()
!=
null
)
{
if
(
entity
.
getIsCopy
()
!=
null
)
{
model
.
setIsCopy
(
entity
.
getIsCopy
());
model
.
setIsCopy
(
entity
.
getIsCopy
());
}
}
if
(
entity
.
getIsSale
()
!=
null
)
{
if
(
entity
.
getIsSale
()
!=
null
)
{
model
.
setIsSale
(
entity
.
getIsSale
());
model
.
setIsSale
(
entity
.
getIsSale
());
}
}
if
(
entity
.
getPopularity
()
!=
null
)
{
if
(
entity
.
getPopularity
()
!=
null
)
{
model
.
setPopularity
(
entity
.
getPopularity
());
model
.
setPopularity
(
entity
.
getPopularity
());
}
}
if
(
entity
.
getIsDeleted
()
!=
null
)
{
if
(
entity
.
getIsDeleted
()
!=
null
)
{
model
.
setIsDeleted
(
entity
.
getIsDeleted
());
model
.
setIsDeleted
(
entity
.
getIsDeleted
());
}
}
BizAgentApplicationMallModel
saveModel
=
this
.
repository
.
save
(
model
);
BizAgentApplicationMallModel
saveModel
=
this
.
repository
.
save
(
model
);
return
BizAgentApplicationMallConvert
.
modelToEntity
(
saveModel
);
return
BizAgentApplicationMallConvert
.
modelToEntity
(
saveModel
);
}
}
...
@@ -121,33 +125,37 @@ public class BizAgentApplicationMallServiceImpl extends BaseServiceImpl
...
@@ -121,33 +125,37 @@ public class BizAgentApplicationMallServiceImpl extends BaseServiceImpl
BizAgentApplicationMallModel
model
=
new
BizAgentApplicationMallModel
();
BizAgentApplicationMallModel
model
=
new
BizAgentApplicationMallModel
();
model
.
setAgentPublishId
(
agentPublishId
);
model
.
setAgentPublishId
(
agentPublishId
);
List
<
BizAgentApplicationMallModel
>
models
=
this
.
repository
.
findByExample
(
model
);
List
<
BizAgentApplicationMallModel
>
models
=
this
.
repository
.
findByExample
(
model
);
if
(!
models
.
isEmpty
())
{
if
(!
models
.
isEmpty
())
{
BizAgentApplicationMallModel
mallModel
=
models
.
get
(
0
);
BizAgentApplicationMallModel
mallModel
=
models
.
get
(
0
);
if
(
"N"
.
equals
(
mallModel
.
getIsDeleted
())){
if
(
"N"
.
equals
(
mallModel
.
getIsDeleted
()))
{
mallModel
.
setIsDeleted
(
"Y"
);
mallModel
.
setIsDeleted
(
"Y"
);
this
.
repository
.
save
(
mallModel
);
this
.
repository
.
save
(
mallModel
);
}
}
}
}
}
}
public
void
deletedById
(
java
.
lang
.
Integer
id
)
throws
Exception
{
public
void
deletedById
(
java
.
lang
.
Integer
id
)
throws
Exception
{
Assert
.
notNull
(
id
);
Assert
.
notNull
(
id
);
BizAgentApplicationMallModel
model
=
this
.
repository
.
get
(
id
);
BizAgentApplicationMallModel
model
=
this
.
repository
.
get
(
id
);
if
(
model
!=
null
){
if
(
model
!=
null
)
{
if
(
"N"
.
equals
(
model
.
getIsDeleted
())){
if
(
"N"
.
equals
(
model
.
getIsDeleted
()))
{
model
.
setIsDeleted
(
"Y"
);
model
.
setIsDeleted
(
"Y"
);
this
.
repository
.
save
(
model
);
this
.
repository
.
save
(
model
);
}
}
}
}
}
}
public
List
<
BizAgentApplicationMallEntity
>
getList
()
throws
Exception
{
List
<
BizAgentApplicationMallEntity
>
result
=
new
ArrayList
<
BizAgentApplicationMallEntity
>();
List
<
BizAgentApplicationMallModel
>
models
=
this
.
repository
.
getAll
();
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
result
=
models
.
stream
().
map
(
BizAgentApplicationMallConvert:
:
modelToEntity
).
collect
(
Collectors
.
toList
());
}
return
result
;
}
public
List
<
BizAgentApplicationMallEntity
>
getList
()
throws
Exception
{
List
<
BizAgentApplicationMallEntity
>
result
=
new
ArrayList
<
BizAgentApplicationMallEntity
>();
List
<
BizAgentApplicationMallModel
>
models
=
this
.
repository
.
getAll
();
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
result
=
models
.
stream
().
map
(
BizAgentApplicationMallConvert:
:
modelToEntity
).
collect
(
Collectors
.
toList
());
}
return
result
;
}
@Override
public
List
<
MallAgentApplicationQueryItem
>
mallAgentApplicationQuery
(
MallAgentApplicationQueryCondition
condition
,
PagingInfo
pagingInfo
)
{
return
this
.
sqlDao
.
query
(
condition
,
MallAgentApplicationQueryItem
.
class
,
pagingInfo
);
}
}
}
\ 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