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
7747acf1
Commit
7747acf1
authored
Nov 13, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:【应用广场】应用更新发布后,应用不应在应用广场自动下架
parent
876dd01a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
32 deletions
+20
-32
AgentApplicationInfoServiceImpl.java
...ation/aggregate/impl/AgentApplicationInfoServiceImpl.java
+7
-2
BizAgentApplicationPublishConvert.java
...pplication/convert/BizAgentApplicationPublishConvert.java
+0
-2
BizAgentApplicationPublishEntity.java
..._application/entity/BizAgentApplicationPublishEntity.java
+0
-11
BizAgentApplicationPublishRest.java
...gent_application/rest/BizAgentApplicationPublishRest.java
+0
-2
BizAgentApplicationPublishRestImpl.java
...ication/rest/impl/BizAgentApplicationPublishRestImpl.java
+0
-6
BizAgentApplicationPublishServiceImpl.java
...n/service/impl/BizAgentApplicationPublishServiceImpl.java
+13
-9
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationInfoServiceImpl.java
View file @
7747acf1
...
@@ -140,10 +140,15 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -140,10 +140,15 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
}
}
//发布应用
//发布应用
bizAgentApplicationPublishService
.
deleteByAgentId
(
bizAgentApplicationInfoEntity
.
getAgentId
());
BizAgentApplicationPublishEntity
publishEntity
=
new
BizAgentApplicationPublishEntity
();
BizAgentApplicationPublishEntity
publishEntity
=
new
BizAgentApplicationPublishEntity
();
BeanUtil
.
copyProperties
(
bizAgentApplicationInfoEntity
,
publishEntity
);
BeanUtil
.
copyProperties
(
bizAgentApplicationInfoEntity
,
publishEntity
);
bizAgentApplicationPublishService
.
save
(
publishEntity
);
BizAgentApplicationPublishEntity
oldPublishEntity
=
bizAgentApplicationPublishService
.
getByAgentId
(
bizAgentApplicationInfoEntity
.
getAgentId
());
if
(
oldPublishEntity
!=
null
)
{
publishEntity
.
setId
(
oldPublishEntity
.
getId
());
bizAgentApplicationPublishService
.
update
(
publishEntity
);
}
else
{
bizAgentApplicationPublishService
.
save
(
publishEntity
);
}
//【变量】结构改变,删除会话缓存
//【变量】结构改变,删除会话缓存
List
<
DialogsIdsQueryByAgentIdQueryItem
>
items
=
bizAgentApplicationDialoguesRecordService
.
queryDialogsIds
(
bizAgentApplicationInfoEntity
.
getAgentId
());
List
<
DialogsIdsQueryByAgentIdQueryItem
>
items
=
bizAgentApplicationDialoguesRecordService
.
queryDialogsIds
(
bizAgentApplicationInfoEntity
.
getAgentId
());
...
...
src/main/java/cn/com/poc/agent_application/convert/BizAgentApplicationPublishConvert.java
View file @
7747acf1
...
@@ -62,7 +62,6 @@ public class BizAgentApplicationPublishConvert {
...
@@ -62,7 +62,6 @@ public class BizAgentApplicationPublishConvert {
entity
.
setCreatedTime
(
model
.
getCreatedTime
());
entity
.
setCreatedTime
(
model
.
getCreatedTime
());
entity
.
setModifier
(
model
.
getModifier
());
entity
.
setModifier
(
model
.
getModifier
());
entity
.
setModifiedTime
(
model
.
getModifiedTime
());
entity
.
setModifiedTime
(
model
.
getModifiedTime
());
entity
.
setSysVersion
(
model
.
getSysVersion
());
return
entity
;
return
entity
;
}
}
...
@@ -101,7 +100,6 @@ public class BizAgentApplicationPublishConvert {
...
@@ -101,7 +100,6 @@ public class BizAgentApplicationPublishConvert {
model
.
setCreatedTime
(
entity
.
getCreatedTime
());
model
.
setCreatedTime
(
entity
.
getCreatedTime
());
model
.
setModifier
(
entity
.
getModifier
());
model
.
setModifier
(
entity
.
getModifier
());
model
.
setModifiedTime
(
entity
.
getModifiedTime
());
model
.
setModifiedTime
(
entity
.
getModifiedTime
());
model
.
setSysVersion
(
entity
.
getSysVersion
());
return
model
;
return
model
;
}
}
...
...
src/main/java/cn/com/poc/agent_application/entity/BizAgentApplicationPublishEntity.java
View file @
7747acf1
...
@@ -340,16 +340,5 @@ public class BizAgentApplicationPublishEntity {
...
@@ -340,16 +340,5 @@ public class BizAgentApplicationPublishEntity {
public
void
setModifiedTime
(
java
.
util
.
Date
modifiedTime
){
public
void
setModifiedTime
(
java
.
util
.
Date
modifiedTime
){
this
.
modifiedTime
=
modifiedTime
;
this
.
modifiedTime
=
modifiedTime
;
}
}
/** SYS_VERSION
*乐观锁,版本号
*/
private
java
.
lang
.
Integer
sysVersion
;
public
java
.
lang
.
Integer
getSysVersion
(){
return
this
.
sysVersion
;
}
public
void
setSysVersion
(
java
.
lang
.
Integer
sysVersion
){
this
.
sysVersion
=
sysVersion
;
}
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/rest/BizAgentApplicationPublishRest.java
View file @
7747acf1
...
@@ -18,8 +18,6 @@ public interface BizAgentApplicationPublishRest extends BaseRest {
...
@@ -18,8 +18,6 @@ public interface BizAgentApplicationPublishRest extends BaseRest {
BizAgentApplicationPublishDto
save
(
@RequestBody
BizAgentApplicationPublishDto
dto
)
throws
Exception
;
BizAgentApplicationPublishDto
save
(
@RequestBody
BizAgentApplicationPublishDto
dto
)
throws
Exception
;
BizAgentApplicationPublishDto
update
(
@RequestBody
BizAgentApplicationPublishDto
dto
)
throws
Exception
;
void
deletedById
(
@RequestParam
java
.
lang
.
Integer
id
)
throws
Exception
;
void
deletedById
(
@RequestParam
java
.
lang
.
Integer
id
)
throws
Exception
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/rest/impl/BizAgentApplicationPublishRestImpl.java
View file @
7747acf1
...
@@ -38,12 +38,6 @@ public class BizAgentApplicationPublishRestImpl implements BizAgentApplicationPu
...
@@ -38,12 +38,6 @@ public class BizAgentApplicationPublishRestImpl implements BizAgentApplicationPu
return
BizAgentApplicationPublishConvert
.
entityToDto
(
bizAgentApplicationPublishService
.
save
(
entity
));
return
BizAgentApplicationPublishConvert
.
entityToDto
(
bizAgentApplicationPublishService
.
save
(
entity
));
}
}
public
BizAgentApplicationPublishDto
update
(
BizAgentApplicationPublishDto
dto
)
throws
Exception
{
Assert
.
notNull
(
dto
);
BizAgentApplicationPublishEntity
entity
=
BizAgentApplicationPublishConvert
.
dtoToEntity
(
dto
);
return
BizAgentApplicationPublishConvert
.
entityToDto
(
bizAgentApplicationPublishService
.
update
(
entity
));
}
public
void
deletedById
(
java
.
lang
.
Integer
id
)
throws
Exception
{
public
void
deletedById
(
java
.
lang
.
Integer
id
)
throws
Exception
{
Assert
.
notNull
(
id
);
Assert
.
notNull
(
id
);
bizAgentApplicationPublishService
.
deletedById
(
id
);
bizAgentApplicationPublishService
.
deletedById
(
id
);
...
...
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationPublishServiceImpl.java
View file @
7747acf1
...
@@ -14,6 +14,8 @@ import cn.com.poc.agent_application.entity.BizAgentApplicationPublishEntity;
...
@@ -14,6 +14,8 @@ import cn.com.poc.agent_application.entity.BizAgentApplicationPublishEntity;
import
cn.com.poc.agent_application.convert.BizAgentApplicationPublishConvert
;
import
cn.com.poc.agent_application.convert.BizAgentApplicationPublishConvert
;
import
cn.com.poc.agent_application.repository.BizAgentApplicationPublishRepository
;
import
cn.com.poc.agent_application.repository.BizAgentApplicationPublishRepository
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
cn.hutool.core.bean.BeanUtil
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -89,15 +91,17 @@ public class BizAgentApplicationPublishServiceImpl extends BaseServiceImpl
...
@@ -89,15 +91,17 @@ public class BizAgentApplicationPublishServiceImpl extends BaseServiceImpl
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"
);
BizAgentApplicationPublishModel
model
=
this
.
repository
.
get
(
entity
.
getId
());
BizAgentApplicationPublishModel
model
=
this
.
repository
.
get
(
entity
.
getId
());
model
.
setAgentId
(
entity
.
getAgentId
());
if
(
model
==
null
)
{
model
.
setIsDeleted
(
CommonConstant
.
IsDeleted
.
N
);
throw
new
I18nMessageException
(
"exception/publication.failed"
);
List
<
BizAgentApplicationPublishModel
>
models
=
this
.
repository
.
findByExample
(
model
);
}
if
(
CollectionUtils
.
isEmpty
(
models
))
{
BizAgentApplicationPublishModel
updateModel
=
BizAgentApplicationPublishConvert
.
entityToModel
(
entity
);
throw
new
I18nMessageException
(
"exception/data.does.not.exist"
);
updateModel
.
setIsDeleted
(
CommonConstant
.
IsDeleted
.
N
);
}
updateModel
.
setCreator
(
model
.
getCreator
());
model
=
models
.
get
(
0
);
updateModel
.
setCreatedTime
(
model
.
getCreatedTime
());
paramVerificationAndConvert
(
entity
,
model
);
updateModel
.
setModifier
(
null
);
BizAgentApplicationPublishModel
saveModel
=
this
.
repository
.
save
(
model
);
updateModel
.
setModifiedTime
(
null
);
updateModel
.
setSysVersion
(
model
.
getSysVersion
());
BizAgentApplicationPublishModel
saveModel
=
this
.
repository
.
save
(
updateModel
);
return
BizAgentApplicationPublishConvert
.
modelToEntity
(
saveModel
);
return
BizAgentApplicationPublishConvert
.
modelToEntity
(
saveModel
);
}
}
...
...
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