Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
80f87523
Commit
80f87523
authored
Aug 17, 2021
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.app 任务统计
parent
eb7fd81d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
135 additions
and
174 deletions
+135
-174
CalendarStatusCountRespone.java
...ance/core/common/response/CalendarStatusCountRespone.java
+2
-2
StatisticsController.java
...maintenance/business/controller/StatisticsController.java
+42
-0
PlanTaskMapper.java
.../amos/maintenance/business/dao/mapper/PlanTaskMapper.java
+1
-0
EquipFeign.java
...m/yeejoin/amos/maintenance/business/feign/EquipFeign.java
+10
-4
Remote3D.java
...com/yeejoin/amos/maintenance/business/feign/Remote3D.java
+0
-37
Remote3DServer.java
...ejoin/amos/maintenance/business/feign/Remote3DServer.java
+0
-131
StatisticsServiceImpl.java
...ntenance/business/service/impl/StatisticsServiceImpl.java
+43
-0
IStatisticsService.java
...aintenance/business/service/intfc/IStatisticsService.java
+16
-0
dbTemplate_plan_task.xml
...nce/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+21
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-maintenance-api/src/main/java/com/yeejoin/amos/maintenance/core/common/response/CalendarStatusCountRespone.java
View file @
80f87523
...
...
@@ -6,7 +6,7 @@ public class CalendarStatusCountRespone {
/**
* 个数
*/
private
Double
count
;
private
Long
count
;
/**
* 状态
*/
...
...
@@ -16,7 +16,7 @@ public class CalendarStatusCountRespone {
public
double
getCount
()
{
return
count
;
}
public
void
setCount
(
double
count
)
{
public
void
setCount
(
Long
count
)
{
this
.
count
=
count
;
}
public
String
getStatus
()
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/StatisticsController.java
0 → 100644
View file @
80f87523
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
controller
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IStatisticsService
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponse
;
import
com.yeejoin.amos.maintenance.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.maintenance.core.framework.PersonIdentify
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @author DELL
*/
@RestController
@RequestMapping
(
value
=
"/api/statistics"
)
@Api
(
tags
=
"统计api"
)
public
class
StatisticsController
extends
AbstractBaseController
{
@Autowired
IStatisticsService
iStatisticsService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PersonIdentify
@GetMapping
(
value
=
"/task"
)
@ApiOperation
(
value
=
"app首页任务统计"
)
public
CommonResponse
taskStatusStatistics
(){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
Map
<
String
,
Object
>
result
=
iStatisticsService
.
taskStatusStatistics
(
opIdentifyInfo
(),
loginOrgCode
);
return
CommonResponseUtil
.
success
(
result
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/dao/mapper/PlanTaskMapper.java
View file @
80f87523
...
...
@@ -179,4 +179,5 @@ public interface PlanTaskMapper extends BaseMapper {
List
<
Map
<
String
,
Object
>>
queryTimeAxis
(
HashMap
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
statisticsTaskWithAuth
(
Map
<
String
,
Object
>
param
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/feign/EquipFeign.java
View file @
80f87523
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
feign
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
...
...
@@ -37,5 +34,14 @@ public interface EquipFeign {
*/
@RequestMapping
(
value
=
"${equip.fegin.prefix}"
+
"/area/tree"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
LinkedHashMap
<
String
,
Object
>
getRegionTress
();
/**
* 查询维保到期设备
* @param type
* @param companyId
* @return
*/
@GetMapping
(
value
=
"${equip.fegin.prefix}+/facility"
)
List
<
Map
<
String
,
Object
>>
overTimeMaintenanceFacility
(
@RequestParam
String
type
,
String
companyId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/feign/Remote3D.java
deleted
100644 → 0
View file @
eb7fd81d
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
feign
;
//@RequestLine
//@FeignClient(name = "${Remote3D.fegin.name}",configuration=FeignConfiguration.class)
//public interface Remote3D {
// @RequestMapping(value = "/patrol/check", method = RequestMethod.POST)
// @ResponseBody
// CommonResponse checkStatusPush( @RequestBody List<PointCheckInfoRespone> pointCheckInfo);
//
//
// @RequestMapping(value = "/patrol/task", method = RequestMethod.POST)
// CommonResponse errorTaskPushTo3D( @RequestBody List<TaskInfoRespone> taskInfoRespone);
//
//
// @RequestMapping(value = "/view3d/synchronous/points", method = RequestMethod.POST)
// CommonResponse pointInfoPush( @RequestBody List<PointInfoSyn3DRespone> pointInfoResponseList);
//
//
// @RequestMapping(value = "/view3d/synchronous/routes", method = RequestMethod.POST)
// CommonResponse routeInfoPush( @RequestBody List<RouteResponse> routeResponseList);
//
//
//
//
//
//
//
//}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/feign/Remote3DServer.java
deleted
100644 → 0
View file @
eb7fd81d
//package com.yeejoin.amos.maintenance.business.feign;
//
//import java.util.List;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.http.HttpEntity;
//import org.springframework.http.HttpHeaders;
//import org.springframework.http.MediaType;
//import org.springframework.stereotype.Service;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.client.RestTemplate;
//
//import com.yeejoin.amos.maintenance.business.util.CommonResponse;
//import com.yeejoin.amos.maintenance.business.util.CommonResponseUtil;
//import com.yeejoin.amos.maintenance.core.common.response.PointCheckInfoRespone;
//import com.yeejoin.amos.maintenance.core.common.response.PointInfoSyn3DRespone;
//import com.yeejoin.amos.maintenance.core.common.response.RouteResponse;
//import com.yeejoin.amos.maintenance.core.common.response.TaskInfoRespone;
//
//
//
////三维远程访问
//@Service("remote3DServer")
//public class Remote3DServer {
// @Autowired
// private RestTemplate restTemplate;
//
// @Value("${Remote3D.fegin.name}")
// private String Remote3DFeginName;
//
//
// private static String checkStatusPush = "/patrol/check";
//
// private static String errorTaskPushTo3D = "/patrol/task";
//
// private static String pointInfoPush = "/view3d/synchronous/points";
//
// private static String routeInfoPush = "/view3d/synchronous/routes";
//
//
//
// public String geturls(String url){
// return "http://"+Remote3DFeginName+url;
// }
// public HttpHeaders getHeader(String toke,String product,String appKey){
// HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.APPLICATION_JSON);
// headers.set("Content-Type", "application/json");
// headers.set("token", toke);
// headers.set("product",product);
// headers.set("appKey", appKey);
// return headers;
// }
//
//
// public CommonResponse checkStatusPush( String toke,String product,String appKey, List<PointCheckInfoRespone> pointCheckInfo){
// try {
// HttpEntity httpEntity = new HttpEntity<>(pointCheckInfo, getHeader( toke, product, appKey));
// CommonResponse commonResponse1 = restTemplate.postForObject(geturls(checkStatusPush),httpEntity, CommonResponse.class);
// return commonResponse1;
// } catch (Exception e) {
// e.printStackTrace();
// return CommonResponseUtil.failure("发送失败");
//
// }
// }
//
//
//
// public CommonResponse errorTaskPushTo3D( String toke,String product,String appKey, List<TaskInfoRespone> taskInfoRespone){
// try {
// HttpEntity httpEntity = new HttpEntity<>(taskInfoRespone, getHeader( toke, product, appKey));
// CommonResponse commonResponse1 = restTemplate.postForObject(geturls(errorTaskPushTo3D),httpEntity, CommonResponse.class);
// return commonResponse1;
// } catch (Exception e) {
// e.printStackTrace();
// return CommonResponseUtil.failure("发送失败");
//
// }
// }
//
//
// public CommonResponse pointInfoPush(String toke,String product,String appKey,List<PointInfoSyn3DRespone> pointInfoResponseList){
// try {
// HttpEntity httpEntity = new HttpEntity<>(pointInfoResponseList, getHeader( toke, product, appKey));
// CommonResponse commonResponse1 = restTemplate.postForObject(geturls(pointInfoPush),httpEntity, CommonResponse.class);
// return commonResponse1;
// } catch (Exception e) {
// e.printStackTrace();
// return CommonResponseUtil.failure("发送失败");
//
// }
// }
//
//
// public CommonResponse routeInfoPush( String toke,String product,String appKey, List<RouteResponse> routeResponseList){
// try {
// HttpEntity httpEntity = new HttpEntity<>(routeResponseList, getHeader( toke, product, appKey));
// CommonResponse commonResponse1 = restTemplate.postForObject(geturls(routeInfoPush),httpEntity, CommonResponse.class);
// return commonResponse1;
// } catch (Exception e) {
// e.printStackTrace();
// return CommonResponseUtil.failure("发送失败");
//
// }
// }
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/StatisticsServiceImpl.java
0 → 100644
View file @
80f87523
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
impl
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper
;
import
com.yeejoin.amos.maintenance.business.feign.EquipFeign
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IStatisticsService
;
import
com.yeejoin.amos.maintenance.common.enums.PlanTaskDetailIsFinishEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @author DELL
*/
@Service
public
class
StatisticsServiceImpl
implements
IStatisticsService
{
@Autowired
PlanTaskMapper
planTaskMapper
;
@Autowired
EquipFeign
equipFeign
;
@Override
public
Map
<
String
,
Object
>
taskStatusStatistics
(
ReginParams
.
PersonIdentity
opIdentifyInfo
,
String
orgCode
)
{
Map
<
String
,
Object
>
param
=
Bean
.
BeantoMap
(
opIdentifyInfo
);
param
.
put
(
"orgCode"
,
orgCode
);
List
<
Map
<
String
,
Object
>>
list
=
planTaskMapper
.
statisticsTaskWithAuth
(
param
);
Map
<
Integer
,
Long
>
statusNumberMap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
map
->
Integer
.
parseInt
(
map
.
get
(
"is_finish"
).
toString
()),
v
->
Long
.
parseLong
(
v
.
get
(
"total"
).
toString
())));
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"waitExecuteTask"
,
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
UNFINISHED
.
getValue
())
==
null
?
0L
:
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
UNFINISHED
.
getValue
()));
resultMap
.
put
(
"overTimeTask"
,
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
OVERTIME
.
getValue
())
==
null
?
0L
:
statusNumberMap
.
get
(
PlanTaskDetailIsFinishEnum
.
OVERTIME
.
getValue
()));
List
<
Map
<
String
,
Object
>>
overTimeFacility
=
new
ArrayList
<>();
//overTimeFacility = equipFeign.overTimeMaintenanceFacility(opIdentifyInfo.getIdentityType(),opIdentifyInfo.getCompanyId());
resultMap
.
put
(
"overTimeFacility"
,
overTimeFacility
.
size
());
return
resultMap
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/intfc/IStatisticsService.java
0 → 100644
View file @
80f87523
package
com
.
yeejoin
.
amos
.
maintenance
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
java.util.Map
;
/**
* @author DELL
*/
public
interface
IStatisticsService
{
/**
* 维保任务统计
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
taskStatusStatistics
(
ReginParams
.
PersonIdentity
opIdentifyInfo
,
String
loginOrgCode
);
}
amos-boot-system-maintenance/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
80f87523
...
...
@@ -833,4 +833,24 @@
ORDER BY
ppk.begin_time DESC LIMIT 60
</select>
<select
id=
"statisticsTaskWithAuth"
resultType=
"java.util.Map"
>
SELECT
count(1) as total,
td.is_finish
from p_plan_task_detail td ,
p_plan_task t,
p_route r
where
td.task_no = t.id
and t.route_id = r.id
<choose>
<when
test=
"identityType==1"
>
and (t.org_code LIKE CONCAT( #{orgCode}, '-%' ) or t.org_code= #{orgCode} )
</when>
<when
test=
"identityType==2"
>
And r.owner_id = #{companyId}
</when>
</choose>
GROUP BY td.is_finish
</select>
</mapper>
\ No newline at end of file
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