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
673f609d
Commit
673f609d
authored
Feb 02, 2023
by
guojx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
目标跟进接口修复
parent
6dc1624c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
3 deletions
+47
-3
TargetController.java
...haoban/manage/web/controller/target/TargetController.java
+45
-3
dubbo-haoban-manage-wx.xml
...ge3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
+2
-0
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/target/TargetController.java
View file @
673f609d
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
target
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.BasePageInfo
;
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.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.target.NewDataTargetConfigDTO
;
import
com.gic.enterprise.api.qdto.target.QueryNewDataTargetConfigQDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.enterprise.api.service.target.NewDataTargetConfigApiService
;
import
com.gic.haoban.manage.web.qo.target.QueryDataStatisticsCommonQO
;
import
com.gic.haoban.manage.web.utils.StoreAuthUtils
;
import
com.gic.haoban.manage.web.utils.target.DataTargetHttpUtils
;
...
...
@@ -18,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -33,6 +39,30 @@ public class TargetController {
private
StoreAuthUtils
storeAuthUtils
;
@Autowired
private
StoreService
storeService
;
@Autowired
private
NewDataTargetConfigApiService
newDataTargetConfigApiService
;
/**
* 是否有配置的发布门店
* @param qo
* @return
*/
@RequestMapping
(
value
=
"get-target-attainment-analysis-overview"
)
@ResponseBody
public
RestResponse
<
Integer
>
validTargetStore
(
QueryDataStatisticsCommonQO
qo
)
{
List
<
String
>
storeIdList
=
getStoreIdList
(
qo
);
QueryNewDataTargetConfigQDTO
param
=
new
QueryNewDataTargetConfigQDTO
();
param
.
setStoreIdList
(
storeIdList
);
param
.
setEnterpriseId
(
qo
.
getEnterpriseId
());
param
.
setReleaseFlag
(
1
);
ServiceResponse
<
Page
<
NewDataTargetConfigDTO
>>
res
=
newDataTargetConfigApiService
.
queryNewDataTargetConfig
(
param
,
new
BasePageInfo
());
if
(
res
.
isSuccess
())
{
if
(
res
.
getResult
().
getTotalCount
()
>
0
)
{
return
RestResponse
.
successResult
(
1
);
}
}
return
RestResponse
.
successResult
(
0
);
}
/**
* 目标跟进达成分析数据概览
...
...
@@ -46,11 +76,17 @@ public class TargetController {
Map
<
String
,
Object
>
res
=
DataTargetHttpUtils
.
http
(
DataTargetHttpUtils
.
getParamNoPage
(
jsonObject
).
toJSONString
(),
"data_mbr_target_store_total"
);
JSONObject
result1
=
DataTargetHttpUtils
.
getData
(
res
);
if
(
result1
==
null
)
{
result1
=
new
JSONObject
();
}
//合并
JSONObject
jsonObject2
=
getCommon
(
qo
,
true
);
Map
<
String
,
Object
>
res2
=
DataTargetHttpUtils
.
http
(
DataTargetHttpUtils
.
getParamNoPage
(
jsonObject2
).
toJSONString
(),
qo
.
getTimeType
()
==
1
?
"data_mbr_target_attainment_analysis_year_overview"
:
"data_mbr_target_attainment_analysis_month_overview"
);
JSONObject
result2
=
DataTargetHttpUtils
.
getData
(
res2
);
if
(
result2
==
null
)
{
result2
=
new
JSONObject
();
}
result1
.
putAll
(
result2
);
List
<
String
>
keyList
=
TargetAnalysisUtils
.
map
.
get
(
1
);
...
...
@@ -199,12 +235,18 @@ public class TargetController {
jsonObject
.
put
(
"month"
,
qo
.
getTime
());
jsonObject
.
put
(
"monthDate"
,
qo
.
getTime
());
}
jsonObject
.
put
(
"storeId"
,
getStoreIdList
(
qo
).
stream
().
collect
(
Collectors
.
joining
(
","
)));
return
jsonObject
;
}
private
List
<
String
>
getStoreIdList
(
QueryDataStatisticsCommonQO
qo
)
{
if
(
StringUtils
.
isBlank
(
qo
.
getStoreId
()))
{
List
<
String
>
storeIdList
=
storeAuthUtils
.
queryClerkStoreIds
(
qo
.
getClerkId
(),
qo
.
getWxEnterpriseId
());
jsonObject
.
put
(
"storeId"
,
storeIdList
.
stream
().
collect
(
Collectors
.
joining
(
","
)))
;
return
storeIdList
;
}
else
{
jsonObject
.
put
(
"storeId"
,
qo
.
getStoreId
());
List
<
String
>
storeIdList
=
new
ArrayList
<>();
storeIdList
.
add
(
qo
.
getStoreId
());
return
storeIdList
;
}
return
jsonObject
;
}
}
haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
View file @
673f609d
...
...
@@ -125,4 +125,6 @@
<dubbo:reference
id=
"settingApiService"
interface=
"com.gic.haoban.app.aggregation.api.service.SettingApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"newDataTargetConfigApiService"
interface=
"com.gic.enterprise.api.service.target.NewDataTargetConfigApiService"
timeout=
"100000"
retries=
"0"
check=
"false"
/>
</beans>
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