Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
29ecbe81
Commit
29ecbe81
authored
Jan 18, 2022
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:接口返回方式调整
parent
4ae05e80
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
24 deletions
+70
-24
TestQo.java
haoban-manage3-service/src/test/java/TestQo.java
+29
-0
test.java
haoban-manage3-service/src/test/java/test.java
+19
-2
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+6
-7
NotifyController.java
...om/gic/haoban/manage/web/controller/NotifyController.java
+16
-15
No files found.
haoban-manage3-service/src/test/java/TestQo.java
0 → 100644
View file @
29ecbe81
import
com.gic.haoban.base.api.common.AppJSONField
;
import
java.io.Serializable
;
/**
* Created 2018/10/22.
*
* @author hua
*/
public
class
TestQo
implements
Serializable
{
private
String
id
;
private
String
name
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
}
haoban-manage3-service/src/test/java/test.java
View file @
29ecbe81
...
...
@@ -6,8 +6,11 @@ import java.util.List;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
cn.hutool.cache.CacheUtil
;
import
cn.hutool.cache.impl.TimedCache
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.manage.service.entity.TabHaobanPreDealLog
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateFormatUtils
;
...
...
@@ -15,16 +18,30 @@ import org.apache.commons.lang3.time.DateUtils;
public
class
test
{
private
static
final
TimedCache
<
String
,
TestQo
>
cache
=
CacheUtil
.
newTimedCache
(
3000L
);
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
Date
date
=
new
Date
();
Date
tomrrow
=
DateUtils
.
addDays
(
date
,
1
);
Date
yestory
=
DateUtils
.
addDays
(
date
,
-
1
);
long
l
=
DateUtil
.
betweenDay
(
tomrrow
,
date
,
true
);
long
l2
=
DateUtil
.
betweenDay
(
date
,
tomrrow
,
true
);
TestQo
qo
=
new
TestQo
();
qo
.
setName
(
"test"
);
System
.
out
.
println
(
l
+
"="
+
l2
);
cache
.
put
(
"test"
,
qo
);
Thread
.
sleep
(
1000L
);
TestQo
test
=
cache
.
get
(
"test"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
test
));
Thread
.
sleep
(
4000L
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
test
));
test
=
cache
.
get
(
"test"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
test
));
// String key = "3.2.1";
// String[] split = key.split(".");
//
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
29ecbe81
...
...
@@ -676,7 +676,6 @@ public class ClerkController extends WebBaseController {
/**
* 未关联导购列表
*
* @param keyword
* @param wxEnterpriseId
* @param staffId
* @return
...
...
@@ -1174,11 +1173,11 @@ public class ClerkController extends WebBaseController {
*/
@RequestMapping
(
"customer-info"
)
@IgnoreLogin
public
Haoban
Response
customerInfo
(
@RequestBody
@Valid
CommonQO
qo
)
{
public
Rest
Response
customerInfo
(
@RequestBody
@Valid
CommonQO
qo
)
{
CustomerFriendMemberVO
ret
=
new
CustomerFriendMemberVO
();
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
qo
.
getStaffId
());
if
(
staffDTO
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
return
RestResponse
.
failure
(
HaoBanErrCode
.
ERR_6
.
getCode
()+
""
,
HaoBanErrCode
.
ERR_6
.
getMsg
()
);
}
int
friendCount
=
externalClerkRelatedApiService
.
countFriendCountByClerkId
(
qo
.
getWxEnterpriseId
(),
qo
.
getEnterpriseId
(),
staffDTO
.
getWxUserId
(),
qo
.
getClerkId
());
int
memberCount
=
customerApiService
.
countMember
(
qo
.
getEnterpriseId
(),
qo
.
getStoreId
(),
qo
.
getClerkId
());
...
...
@@ -1186,7 +1185,7 @@ public class ClerkController extends WebBaseController {
ret
.
setFriendCount
(
friendCount
);
ret
.
setMemberCount
(
memberCount
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
ret
);
return
RestResponse
.
successResult
(
ret
);
}
/**
...
...
@@ -1196,10 +1195,10 @@ public class ClerkController extends WebBaseController {
*/
@RequestMapping
(
"can-relation-count"
)
@IgnoreLogin
public
Haoban
Response
canRelationCount
(
@RequestBody
@Valid
CommonQO
qo
)
{
public
Rest
Response
canRelationCount
(
@RequestBody
@Valid
CommonQO
qo
)
{
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
qo
.
getWxEnterpriseId
());
if
(
list
==
null
||
list
.
isEmpty
())
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
RestResponse
.
successResult
(
);
}
List
<
String
>
enterpriseIdList
=
list
.
stream
().
filter
(
s
->
{
boolean
over
=
isEnterpriseOver
(
s
.
getEnterpriseId
());
...
...
@@ -1208,7 +1207,7 @@ public class ClerkController extends WebBaseController {
List
<
String
>
storeIds
=
wxEnterpriseRelatedApiService
.
listStoreIdByWxEnterpriseId
(
qo
.
getWxEnterpriseId
());
List
<
ClerkDTO
>
clerkList
=
this
.
getUnbindClerkList
(
enterpriseIdList
,
storeIds
,
qo
.
getStaffId
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
clerkList
.
size
());
return
RestResponse
.
successResult
(
clerkList
.
size
());
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/NotifyController.java
View file @
29ecbe81
...
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.web.controller;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.web.qo.PageQo
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.haoban.base.api.common.PageResult2
;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
...
...
@@ -50,7 +51,7 @@ public class NotifyController extends WebBaseController {
* @return
*/
@RequestMapping
(
"/commission/list"
)
public
Haoban
Response
pendingList
(
@RequestBody
@Valid
PendingListQO
qo
)
{
public
Rest
Response
pendingList
(
@RequestBody
@Valid
PendingListQO
qo
)
{
PendingListQDTO
pendingListQDTO
=
EntityUtil
.
changeEntityByOrika
(
PendingListQDTO
.
class
,
qo
);
pendingListQDTO
.
setFinishFlag
(
0
);
pendingListQDTO
.
setOverdueFlag
(
0
);
...
...
@@ -63,7 +64,7 @@ public class NotifyController extends WebBaseController {
ServiceResponse
<
Page
<
PendingTaskDetailDTO
>>
retPage
=
pendingTaskApiService
.
pagePendingTask
(
pendingListQDTO
,
qo
.
getBasePageInfo
());
PageResult2
pageInfo
=
PageUtil
.
getPageInfo
(
retPage
.
getResult
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageInfo
);
return
RestResponse
.
successResult
(
pageInfo
);
}
/**
...
...
@@ -72,10 +73,10 @@ public class NotifyController extends WebBaseController {
* @return
*/
@RequestMapping
(
"/commission/today-list"
)
public
Haoban
Response
pendingToday
(
@RequestBody
@Valid
CommonQO
qo
)
{
public
Rest
Response
pendingToday
(
@RequestBody
@Valid
CommonQO
qo
)
{
ServiceResponse
<
List
<
PendingTaskDetailDTO
>>
response
=
pendingTaskApiService
.
listPendingTaskToday
(
qo
.
getEnterpriseId
(),
qo
.
getStoreId
(),
qo
.
getClerkId
(),
false
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
response
.
getResult
());
return
RestResponse
.
successResult
(
response
.
getResult
());
}
...
...
@@ -85,7 +86,7 @@ public class NotifyController extends WebBaseController {
* @return
*/
@RequestMapping
(
"/commission/filter-info"
)
public
Haoban
Response
filterInfo
(
@RequestBody
@Valid
CommonQO
qo
)
{
public
Rest
Response
filterInfo
(
@RequestBody
@Valid
CommonQO
qo
)
{
Map
<
String
,
Object
>
ret
=
new
HashMap
<
String
,
Object
>();
List
<
PairValVO
>
taskTypes
=
new
ArrayList
<
PairValVO
>();
...
...
@@ -112,7 +113,7 @@ public class NotifyController extends WebBaseController {
ret
.
put
(
"taskTypes"
,
taskTypes
);
ret
.
put
(
"filter"
,
filter
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
ret
);
return
RestResponse
.
successResult
(
ret
);
}
...
...
@@ -122,9 +123,9 @@ public class NotifyController extends WebBaseController {
* @return
*/
@RequestMapping
(
"/message/list"
)
public
Haoban
Response
list
(
@RequestBody
@Valid
MessageListQO
qo
)
{
public
Rest
Response
list
(
@RequestBody
@Valid
MessageListQO
qo
)
{
ServiceResponse
<
Page
<
NoticeMessageInfoDTO
>>
retPage
=
noticeMessageService
.
pageNoticeMessage
(
qo
.
getEnterpriseId
(),
qo
.
getStoreId
(),
qo
.
getClerkId
(),
qo
.
getCategoryType
(),
qo
.
getBasePageInfo
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
PageUtil
.
getPageInfo
(
retPage
.
getResult
()));
return
RestResponse
.
successResult
(
PageUtil
.
getPageInfo
(
retPage
.
getResult
()));
}
/**
...
...
@@ -133,12 +134,12 @@ public class NotifyController extends WebBaseController {
* @return
*/
@RequestMapping
(
"/message/read"
)
public
Haoban
Response
readSingle
(
Long
noticeMessageId
)
{
public
Rest
Response
readSingle
(
Long
noticeMessageId
)
{
if
(
noticeMessageId
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
RestResponse
.
failure
(
HaoBanErrCode
.
ERR_2
.
getCode
()+
""
,
HaoBanErrCode
.
ERR_2
.
getMsg
()
);
}
noticeMessageService
.
updateReadFlagById
(
noticeMessageId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
RestResponse
.
successResult
(
);
}
/**
...
...
@@ -158,7 +159,7 @@ public class NotifyController extends WebBaseController {
* @return
*/
@RequestMapping
(
"/message/category"
)
public
Haoban
Response
category
(
@RequestBody
@Valid
MessageListQO
qo
)
{
public
Rest
Response
category
(
@RequestBody
@Valid
MessageListQO
qo
)
{
List
<
PairValVO
>
ret
=
new
ArrayList
<
PairValVO
>();
NoticeMessageCategoryTypeEnum
[]
values
=
NoticeMessageCategoryTypeEnum
.
values
();
for
(
NoticeMessageCategoryTypeEnum
val
:
values
)
{
...
...
@@ -167,7 +168,7 @@ public class NotifyController extends WebBaseController {
vo
.
setName
(
val
.
getName
());
ret
.
add
(
vo
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
ret
);
return
RestResponse
.
successResult
(
ret
);
}
...
...
@@ -177,9 +178,9 @@ public class NotifyController extends WebBaseController {
* @return
*/
@RequestMapping
(
"/message/count"
)
public
Haoban
Response
messageCount
(
@RequestBody
@Valid
MessageListQO
qo
)
{
public
Rest
Response
messageCount
(
@RequestBody
@Valid
MessageListQO
qo
)
{
ServiceResponse
<
Integer
>
ret
=
noticeMessageService
.
countUnReadNoticeMessage
(
qo
.
getEnterpriseId
(),
qo
.
getStoreId
(),
qo
.
getClerkId
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
ret
.
getResult
());
return
RestResponse
.
successResult
(
ret
.
getResult
());
}
...
...
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