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
9e20f8a4
Commit
9e20f8a4
authored
Aug 05, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
7167a564
79db24c8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
38 deletions
+70
-38
TabAppletServiceConfigMapper.java
...c/enterprise/dao/mapper/TabAppletServiceConfigMapper.java
+5
-0
AppletServiceConfigServiceImpl.java
...terprise/service/impl/AppletServiceConfigServiceImpl.java
+41
-34
TabAppletServiceConfigMapper.xml
...rc/main/resources/mapper/TabAppletServiceConfigMapper.xml
+19
-1
EnterpriseController.java
...om/gic/operation/web/controller/EnterpriseController.java
+5
-3
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/dao/mapper/TabAppletServiceConfigMapper.java
View file @
9e20f8a4
...
...
@@ -65,5 +65,9 @@ public interface TabAppletServiceConfigMapper {
TabAppletServiceConfig
getAppByAppId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"appId"
)
String
appId
);
TabAppletServiceConfig
getByConfigId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"configId"
)
Long
configId
);
void
updateTime
(
@Param
(
"appId"
)
String
appId
,
@Param
(
"type"
)
int
type
,
@Param
(
"updateTime"
)
Date
date
);
void
delByConfigIdList
(
@Param
(
"ids"
)
List
<
Long
>
configIdList
,
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
}
\ No newline at end of file
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/impl/AppletServiceConfigServiceImpl.java
View file @
9e20f8a4
...
...
@@ -16,8 +16,10 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -48,45 +50,50 @@ public class AppletServiceConfigServiceImpl implements AppletServiceConfigServic
@Override
public
void
syncApplet
(
List
<
AppletsConfigSimpleOutputDTO
>
responseResult
,
Integer
enterpriseId
)
{
if
(
CollectionUtils
.
isNotEmpty
(
responseResult
))
{
List
<
TabAppletServiceConfig
>
configList
=
responseResult
.
stream
()
.
filter
(
e
->
tabAppletServiceConfigMapper
.
getAppByAppId
(
enterpriseId
,
e
.
getAppId
())
==
null
)
.
map
(
e
->
{
TabAppletServiceConfig
appletServiceConfig
=
new
TabAppletServiceConfig
();
appletServiceConfig
.
setEnterpriseId
(
enterpriseId
);
appletServiceConfig
.
setAppId
(
e
.
getAppId
());
appletServiceConfig
.
setName
(
e
.
getAppletConfigName
());
appletServiceConfig
.
setType
(
AppletServiceConfigEnum
.
APPLET
.
getCode
());
appletServiceConfig
.
setConfigId
(
e
.
getAppletConfigId
());
appletServiceConfig
.
setCreateTime
(
new
Date
());
appletServiceConfig
.
setUpdateTime
(
new
Date
());
return
appletServiceConfig
;
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
configList
))
{
tabAppletServiceConfigMapper
.
insertList
(
configList
);
}
// 先删除configId不在入参里的 如果入参是空的 就全部删除
List
<
Long
>
configIdList
=
Optional
.
ofNullable
(
responseResult
).
orElse
(
Collections
.
emptyList
())
.
stream
().
map
(
AppletsConfigSimpleOutputDTO:
:
getAppletConfigId
).
collect
(
Collectors
.
toList
());
tabAppletServiceConfigMapper
.
delByConfigIdList
(
configIdList
,
enterpriseId
);
List
<
TabAppletServiceConfig
>
configList
=
Optional
.
ofNullable
(
responseResult
).
orElse
(
Collections
.
emptyList
()).
stream
()
.
filter
(
e
->
tabAppletServiceConfigMapper
.
getByConfigId
(
enterpriseId
,
e
.
getAppletConfigId
())
==
null
)
.
map
(
e
->
{
TabAppletServiceConfig
appletServiceConfig
=
new
TabAppletServiceConfig
();
appletServiceConfig
.
setEnterpriseId
(
enterpriseId
);
appletServiceConfig
.
setAppId
(
e
.
getAppId
());
appletServiceConfig
.
setName
(
e
.
getAppletConfigName
());
appletServiceConfig
.
setType
(
AppletServiceConfigEnum
.
APPLET
.
getCode
());
appletServiceConfig
.
setConfigId
(
e
.
getAppletConfigId
());
appletServiceConfig
.
setCreateTime
(
new
Date
());
appletServiceConfig
.
setUpdateTime
(
new
Date
());
return
appletServiceConfig
;
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
configList
))
{
tabAppletServiceConfigMapper
.
insertList
(
configList
);
}
}
@Override
public
void
syncServiceConfig
(
List
<
ServiceConfigSimpleOutputDTO
>
responseResult
,
Integer
enterpriseId
)
{
if
(
CollectionUtils
.
isNotEmpty
(
responseResult
))
{
List
<
TabAppletServiceConfig
>
configList
=
responseResult
.
stream
()
.
filter
(
e
->
tabAppletServiceConfigMapper
.
getAppByAppId
(
enterpriseId
,
e
.
getAppId
())
==
null
)
.
map
(
e
->
{
TabAppletServiceConfig
appletServiceConfig
=
new
TabAppletServiceConfig
();
appletServiceConfig
.
setEnterpriseId
(
enterpriseId
);
appletServiceConfig
.
setAppId
(
e
.
getAppId
());
appletServiceConfig
.
setName
(
e
.
getServiceConfigName
());
appletServiceConfig
.
setType
(
AppletServiceConfigEnum
.
SERVICE_CONFIG
.
getCode
());
appletServiceConfig
.
setConfigId
(
e
.
getServiceConfigId
());
appletServiceConfig
.
setCreateTime
(
new
Date
());
appletServiceConfig
.
setUpdateTime
(
new
Date
());
return
appletServiceConfig
;
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
configList
))
{
tabAppletServiceConfigMapper
.
insertList
(
configList
);
}
List
<
Long
>
configIdList
=
Optional
.
ofNullable
(
responseResult
).
orElse
(
Collections
.
emptyList
())
.
stream
().
map
(
ServiceConfigSimpleOutputDTO:
:
getServiceConfigId
).
collect
(
Collectors
.
toList
());
tabAppletServiceConfigMapper
.
delByConfigIdList
(
configIdList
,
enterpriseId
);
List
<
TabAppletServiceConfig
>
configList
=
Optional
.
ofNullable
(
responseResult
).
orElse
(
Collections
.
emptyList
()).
stream
()
.
filter
(
e
->
tabAppletServiceConfigMapper
.
getByConfigId
(
enterpriseId
,
e
.
getServiceConfigId
())
==
null
)
.
map
(
e
->
{
TabAppletServiceConfig
appletServiceConfig
=
new
TabAppletServiceConfig
();
appletServiceConfig
.
setEnterpriseId
(
enterpriseId
);
appletServiceConfig
.
setAppId
(
e
.
getAppId
());
appletServiceConfig
.
setName
(
e
.
getServiceConfigName
());
appletServiceConfig
.
setType
(
AppletServiceConfigEnum
.
SERVICE_CONFIG
.
getCode
());
appletServiceConfig
.
setConfigId
(
e
.
getServiceConfigId
());
appletServiceConfig
.
setCreateTime
(
new
Date
());
appletServiceConfig
.
setUpdateTime
(
new
Date
());
return
appletServiceConfig
;
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
configList
))
{
tabAppletServiceConfigMapper
.
insertList
(
configList
);
}
}
...
...
gic-platform-enterprise-service/src/main/resources/mapper/TabAppletServiceConfigMapper.xml
View file @
9e20f8a4
...
...
@@ -157,7 +157,6 @@
#{item.configId,jdbcType=BIGINT}
)
</foreach>
-- ON DUPLICATE KEY UPDATE name = VALUES(name)
</insert>
<select
id=
"list"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -186,6 +185,14 @@
and enterprise_id = #{enterpriseId}
and status = 1
</select>
<select
id=
"getByConfigId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_applet_service_config
where config_id = #{configId}
and enterprise_id = #{enterpriseId}
and status = 1
</select>
<update
id=
"delByAppIdList"
>
update tab_applet_service_config set status = 0
where enterprise_id = #{enterpriseId}
...
...
@@ -202,4 +209,14 @@
<update
id=
"updateTime"
>
update tab_applet_service_config set update_time = #{updateTime} where app_id = #{appId} and type = #{type}
</update>
<!-- delByConfigIdList-->
<update
id=
"delByConfigIdList"
>
update tab_applet_service_config set status = 0 where enterprise_id = #{enterpriseId}
<if
test=
"null != ids and ids.size > 0"
>
and config_id not in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</update>
</mapper>
\ No newline at end of file
gic-platform-operation-web/src/main/java/com/gic/operation/web/controller/EnterpriseController.java
View file @
9e20f8a4
...
...
@@ -611,9 +611,11 @@ public class EnterpriseController {
if
(
CollectionUtils
.
isNotEmpty
(
orderVOList
))
{
for
(
OrderVO
orderVO
:
orderVOList
)
{
EnterpriseDTO
enterpriseDTO
=
enterpriseInfoMap
.
get
(
orderVO
.
getEnterpriseId
().
intValue
());
orderVO
.
setCompanyName
(
enterpriseDTO
.
getCompanyName
());
orderVO
.
setLogo
(
enterpriseDTO
.
getLogo
());
orderVO
.
setApprover
(
approvalInfoMap
.
get
(
orderVO
.
getOrderNum
()));
if
(
enterpriseDTO
!=
null
){
orderVO
.
setCompanyName
(
enterpriseDTO
.
getCompanyName
());
orderVO
.
setLogo
(
enterpriseDTO
.
getLogo
());
orderVO
.
setApprover
(
approvalInfoMap
.
get
(
orderVO
.
getOrderNum
()));
}
}
}
resultPage
.
setResult
(
orderVOList
);
...
...
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