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
e417adb1
Commit
e417adb1
authored
Jul 30, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
巡检统计接口
parent
bae71972
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
204 additions
and
0 deletions
+204
-0
ControlScreenController.java
...s/patrol/business/controller/ControlScreenController.java
+21
-0
PlanTaskMapper.java
...ejoin/amos/patrol/business/dao/mapper/PlanTaskMapper.java
+2
-0
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+37
-0
IPlanTaskService.java
.../amos/patrol/business/service/intfc/IPlanTaskService.java
+3
-0
dbTemplate_plan_task.xml
...rol/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+141
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/ControlScreenController.java
View file @
e417adb1
...
@@ -50,4 +50,25 @@ public class ControlScreenController extends AbstractBaseController {
...
@@ -50,4 +50,25 @@ public class ControlScreenController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
iPlanTaskService
.
getStatics
(
companyCode
,
bizOrgCode
));
return
CommonResponseUtil
.
success
(
iPlanTaskService
.
getStatics
(
companyCode
,
bizOrgCode
));
}
}
@GetMapping
(
"/center/statics"
)
@ApiOperation
(
value
=
"消防巡检统计"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
public
CommonResponse
getCenterStatics
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
();
}
return
CommonResponseUtil
.
success
(
iPlanTaskService
.
getCenterStatics
(
bizOrgCode
));
}
@GetMapping
(
"/station/statics"
)
@ApiOperation
(
value
=
"消防巡检统计"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
public
CommonResponse
getStationStatics
(
@RequestParam
(
required
=
false
)
String
bizOrgCode
)
{
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
bizOrgCode
=
reginParams
.
getPersonIdentity
().
getCompanyBizOrgCode
();
}
return
CommonResponseUtil
.
success
(
iPlanTaskService
.
getStationStatics
(
bizOrgCode
));
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/mapper/PlanTaskMapper.java
View file @
e417adb1
...
@@ -333,6 +333,8 @@ public interface PlanTaskMapper extends BaseMapper {
...
@@ -333,6 +333,8 @@ public interface PlanTaskMapper extends BaseMapper {
String
queryByCompanyCode
(
@Param
(
"companyCode"
)
String
companyCode
);
String
queryByCompanyCode
(
@Param
(
"companyCode"
)
String
companyCode
);
List
<
Map
<
String
,
Object
>>
getStatics
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getStatics
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getCenterStatics
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
getStationStatics
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
Map
<
String
,
Object
>
queryPatrolInfoList
(
@Param
(
value
=
"bizOrgCode"
)
String
bizOrgCode
,
@Param
(
value
=
"startDate"
)
Date
startDate
,
@Param
(
value
=
"endDate"
)
Date
endDate
);
Map
<
String
,
Object
>
queryPatrolInfoList
(
@Param
(
value
=
"bizOrgCode"
)
String
bizOrgCode
,
@Param
(
value
=
"startDate"
)
Date
startDate
,
@Param
(
value
=
"endDate"
)
Date
endDate
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PlanTaskServiceImpl.java
View file @
e417adb1
...
@@ -77,6 +77,8 @@ import java.io.File;
...
@@ -77,6 +77,8 @@ import java.io.File;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.text.DateFormat
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -2123,11 +2125,46 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -2123,11 +2125,46 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
}
@Override
@Override
public
Map
<
String
,
Number
>
getCenterStatics
(
String
bizOrgCode
)
{
List
<
Map
<
String
,
Object
>>
statics
=
planTaskMapper
.
getCenterStatics
(
bizOrgCode
);
Map
<
String
,
Number
>
resultMap
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
item
:
statics
)
{
resultMap
.
put
((
String
)
item
.
get
(
"code"
),
Long
.
valueOf
(
item
.
getOrDefault
(
"value"
,
"0"
).
toString
()));
}
// 今日漏查率 = 今日漏查点位(JRLCDW) / 今日应巡查点(JRYXCD)
resultMap
.
put
(
"JRLCL"
,
getPercent
(
resultMap
.
get
(
"JRLCDW"
).
floatValue
(),
resultMap
.
get
(
"JRYXCD"
).
floatValue
()));
// 今日巡查点位合格占比 = 合格(HG) / 今日应巡查点(JRYXCD)
resultMap
.
put
(
"JRHGZB"
,
getPercent
(
resultMap
.
get
(
"HG"
).
floatValue
(),
resultMap
.
get
(
"JRYXCD"
).
floatValue
()));
return
resultMap
;
}
@Override
public
Map
<
String
,
Number
>
getStationStatics
(
String
bizOrgCode
)
{
List
<
Map
<
String
,
Object
>>
statics
=
planTaskMapper
.
getStationStatics
(
bizOrgCode
);
Map
<
String
,
Number
>
resultMap
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
item
:
statics
)
{
resultMap
.
put
((
String
)
item
.
get
(
"code"
),
Long
.
valueOf
(
item
.
getOrDefault
(
"value"
,
"0"
).
toString
()));
}
// 执行进度
resultMap
.
put
(
"ZXJD"
,
getPercent
(
resultMap
.
get
(
"JRLJXCDW"
).
floatValue
(),
resultMap
.
get
(
"JRYXCD"
).
floatValue
()));
return
resultMap
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryPatrolInfo
(
String
bizOrgCode
,
Date
startDate
,
Date
endDate
)
{
public
List
<
Map
<
String
,
Object
>>
queryPatrolInfo
(
String
bizOrgCode
,
Date
startDate
,
Date
endDate
)
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
return
planTaskMapper
.
queryPatrolInfo
(
bizOrgCode
,
startDate
,
endDate
);
return
planTaskMapper
.
queryPatrolInfo
(
bizOrgCode
,
startDate
,
endDate
);
}
}
private
float
getPercent
(
double
num1
,
double
num2
)
{
if
(
num2
==
0
)
{
return
0
;
}
double
result
=
(
num1
/
num2
)
*
100
;
BigDecimal
decimal
=
new
BigDecimal
(
result
).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
return
decimal
.
floatValue
();
}
public
static
byte
[]
file2byte
(
File
file
)
{
public
static
byte
[]
file2byte
(
File
file
)
{
try
(
try
(
FileInputStream
in
=
new
FileInputStream
(
file
);
FileInputStream
in
=
new
FileInputStream
(
file
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/intfc/IPlanTaskService.java
View file @
e417adb1
...
@@ -203,4 +203,7 @@ public interface IPlanTaskService {
...
@@ -203,4 +203,7 @@ public interface IPlanTaskService {
List
<
Map
<
String
,
Object
>>
queryPatrolInfo
(
String
bizOrgCode
,
Date
startDate
,
Date
endDate
);
List
<
Map
<
String
,
Object
>>
queryPatrolInfo
(
String
bizOrgCode
,
Date
startDate
,
Date
endDate
);
Map
<
String
,
Number
>
getCenterStatics
(
String
bizOrgCode
);
Map
<
String
,
Number
>
getStationStatics
(
String
bizOrgCode
);
}
}
amos-boot-system-patrol/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
e417adb1
...
@@ -1442,6 +1442,147 @@
...
@@ -1442,6 +1442,147 @@
'xfxclcl' AS code
'xfxclcl' AS code
</select>
</select>
<select
id=
"getCenterStatics"
resultType=
"java.util.Map"
>
SELECT
ifnull( sum( p_plan_task.point_num ), 0 ) AS value,
'今日应巡查点' AS name,
'JRYXCD' AS code
FROM
p_plan_task
<where>
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
UNION ALL
SELECT
ifnull( sum( p_plan_task.finish_num ), 0 ) AS value,
'今日累计巡查点位' AS name,
'JRLJXCDW' AS code
FROM
p_plan_task
<where>
finish_status = 2
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
UNION ALL
SELECT
count(1) AS value,
'合格' AS name,
'HG' AS code
FROM
p_plan_task ppk
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
<where>
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 1
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
UNION ALL
SELECT
count(1) AS value,
'不合格' AS name,
'BHG' AS code
FROM
p_plan_task ppk
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
<where>
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 2
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
UNION ALL
SELECT
ifnull( sum( p_plan_task.point_num ), 0 ) AS value,
'今日漏查点位' AS name,
'JRLCDW' AS code
FROM
p_plan_task
<where>
finish_status = 3
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
UNION ALL
SELECT
ifnull( count( DISTINCT LEFT(p_plan_task.point_num, 18) ), 0 ) AS value,
'今日已巡查站' AS name,
'JRYXCZ' AS code
FROM
p_plan_task
<where>
finish_status = 2
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
</select>
<select
id=
"getStationStatics"
resultType=
"java.util.Map"
>
SELECT
ifnull( sum( p_plan_task.point_num ), 0 ) AS value,
'今日应巡查点' AS name,
'JRYXCD' AS code
FROM
p_plan_task
<where>
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
UNION ALL
SELECT
ifnull( sum( p_plan_task.finish_num ), 0 ) AS value,
'今日累计巡查点位' AS name,
'JRLJXCDW' AS code
FROM
p_plan_task
<where>
finish_status = 2
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
UNION ALL
SELECT
ifnull( sum( p_plan_task.point_num ), 0 ) AS value,
'今日漏查点位' AS name,
'JRLCDW' AS code
FROM
p_plan_task
<where>
finish_status = 3
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if
test=
"bizOrgCode != null and bizOrgCode != ''"
>
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
</select>
<select
id=
"queryByCompanyCode"
resultType=
"java.lang.String"
>
<select
id=
"queryByCompanyCode"
resultType=
"java.lang.String"
>
SELECT biz_org_code
SELECT biz_org_code
FROM cb_org_usr
FROM cb_org_usr
...
...
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