Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
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-auth
Commits
4bb8ce10
Commit
4bb8ce10
authored
Oct 09, 2019
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源添加判空
parent
e57f58fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
25 deletions
+56
-25
AuditorApiServiceImpl.java
...om/gic/auth/service/outer/impl/AuditorApiServiceImpl.java
+35
-9
ResourceController.java
.../java/com/gic/auth/web/controller/ResourceController.java
+21
-16
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/AuditorApiServiceImpl.java
View file @
4bb8ce10
...
...
@@ -3,12 +3,16 @@ package com.gic.auth.service.outer.impl;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.AuditorDTO
;
import
com.gic.auth.entity.*
;
import
com.gic.auth.entity.TabAuditor
;
import
com.gic.auth.entity.TabAuditorAuditedGroupRel
;
import
com.gic.auth.entity.TabAuditorProjectItemRel
;
import
com.gic.auth.entity.TabSysUser
;
import
com.gic.auth.qo.AuditorListQO
;
import
com.gic.auth.service.*
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.constants.Constants
;
import
com.gic.enterprise.dto.ProjectItemDTO
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.qo.ProjectItemQO
;
...
...
@@ -59,7 +63,7 @@ public class AuditorApiServiceImpl implements AuditorApiService {
private
ServiceUserApiService
serviceUserApiService
;
@Autowired
private
UserService
userService
;
// 服务号APPKEY
public
static
final
String
APPKEY
=
"wxc6fd9beaf9a9dbe9"
;
@Override
...
...
@@ -249,15 +253,34 @@ public class AuditorApiServiceImpl implements AuditorApiService {
@Override
public
ServiceResponse
<
Void
>
genAuditProject
(
Integer
projectItemId
,
Integer
userId
,
Integer
enterpriseId
)
{
ServiceResponse
<
List
<
AuditorDTO
>>
serviceResponse
=
this
.
listAuditorByProject
(
projectItemId
,
userId
,
enterpriseId
);
if
(
serviceResponse
.
isSuccess
())
{
List
<
AuditorDTO
>
auditorList
=
serviceResponse
.
getResult
();
ServiceResponse
<
List
<
AuditorDTO
>>
auditorServiceResponse
=
this
.
listAuditorByProject
(
projectItemId
,
userId
,
enterpriseId
);
if
(!
auditorServiceResponse
.
isSuccess
())
{
return
EnterpriseServiceResponse
.
failure
(
auditorServiceResponse
.
getCode
(),
auditorServiceResponse
.
getMessage
());
}
ServiceResponse
<
ProjectItemDTO
>
projectItemService
=
projectItemApiService
.
getById
(
projectItemId
);
if
(!
projectItemService
.
isSuccess
())
{
return
EnterpriseServiceResponse
.
failure
(
projectItemService
.
getCode
(),
projectItemService
.
getMessage
());
}
List
<
AuditorDTO
>
auditorList
=
auditorServiceResponse
.
getResult
();
for
(
AuditorDTO
auditorDTO
:
auditorList
)
{
// todo 发送微信模板消息
// todo 如果审核员是管理员 插入后台待办事项
return
ServiceResponse
.
success
();
}
else
{
return
EnterpriseServiceResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
// sendWxMessage();
if
(
auditorDTO
.
getUserId
()
!=
null
)
{
TabSysUser
user
=
userService
.
getUserById
(
auditorDTO
.
getUserId
());
if
(
user
!=
null
)
{
// todo 如果审核员是管理员 插入后台待办事项
// saveToDoList();
}
}
}
ProjectItemDTO
projectItemDTO
=
projectItemService
.
getResult
();
if
(
Constants
.
NORMAL_STATUS
.
equals
(
projectItemDTO
.
getIsPlatform
()))
{
// todo 如果是平台审批项, 还要发送给实施
// sendWxMessage();
}
return
ServiceResponse
.
success
();
}
private
String
getTempQrCodeUrl
(
Integer
auditorId
)
{
...
...
@@ -289,4 +312,7 @@ public class AuditorApiServiceImpl implements AuditorApiService {
}
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
1
);
}
}
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/ResourceController.java
View file @
4bb8ce10
...
...
@@ -23,6 +23,7 @@ import com.gic.enterprise.utils.ResultControllerUtils;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.store.dto.StoreWidgetDTO
;
import
com.gic.store.service.StoreWidgetApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -55,25 +56,29 @@ public class ResourceController {
if
(
storeWidgetResponse
.
isSuccess
()){
resourceDTO
.
setStoreResource
(
storeWidgetResponse
.
getResult
().
longValue
());
// 订单资源
List
<
OrderResourceQO
>
orderResource
=
resourceQO
.
getOrderResourceJSON
();
JSONArray
orderResourceArray
=
new
JSONArray
();
for
(
OrderResourceQO
orderResourceQO
:
orderResource
)
{
List
<
Integer
>
storeIds
;
if
(
OrderResourceChannelEnum
.
OFFLINE
.
getCode
().
equals
(
orderResourceQO
.
getChannel
()))
{
ServiceResponse
<
Integer
>
widgetResponse
=
saveStoreWidget
(
orderResourceQO
.
getStoreResouceJSON
());
Integer
storeId
=
widgetResponse
.
getResult
();
storeIds
=
Collections
.
singletonList
(
storeId
);
}
else
{
storeIds
=
orderResourceQO
.
getStoreContent
();
if
(
CollectionUtils
.
isNotEmpty
(
resourceQO
.
getOrderResourceJSON
()))
{
List
<
OrderResourceQO
>
orderResource
=
resourceQO
.
getOrderResourceJSON
();
JSONArray
orderResourceArray
=
new
JSONArray
();
for
(
OrderResourceQO
orderResourceQO
:
orderResource
)
{
List
<
Integer
>
storeIds
;
if
(
OrderResourceChannelEnum
.
OFFLINE
.
getCode
().
equals
(
orderResourceQO
.
getChannel
()))
{
ServiceResponse
<
Integer
>
widgetResponse
=
saveStoreWidget
(
orderResourceQO
.
getStoreResouceJSON
());
Integer
storeId
=
widgetResponse
.
getResult
();
storeIds
=
Collections
.
singletonList
(
storeId
);
}
else
{
storeIds
=
orderResourceQO
.
getStoreContent
();
}
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"channel"
,
orderResourceQO
.
getChannel
());
jsonObject
.
put
(
"storeContent"
,
storeIds
);
orderResourceArray
.
add
(
jsonObject
);
}
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"channel"
,
orderResourceQO
.
getChannel
());
jsonObject
.
put
(
"storeContent"
,
storeIds
);
orderResourceArray
.
add
(
jsonObject
);
resourceDTO
.
setOrderResourceJson
(
JSON
.
toJSONString
(
orderResourceArray
));
}
resourceDTO
.
setOrderResourceJson
(
JSON
.
toJSONString
(
orderResourceArray
));
// 应用资源
resourceDTO
.
setAppResourceJson
(
JSON
.
toJSONString
(
resourceQO
.
getAppResourceJSON
()));
if
(
CollectionUtils
.
isNotEmpty
(
resourceQO
.
getAppResourceJSON
()))
{
resourceDTO
.
setAppResourceJson
(
JSON
.
toJSONString
(
resourceQO
.
getAppResourceJSON
()));
}
ServiceResponse
<
Integer
>
response
=
resourceApiService
.
saveOrUpdateResource
(
resourceDTO
);
if
(
response
.
isSuccess
()){
...
...
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