Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AmosBankPatrolRoot
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
1
Merge Requests
1
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
bank
AmosBankPatrolRoot
Commits
f57d7759
Commit
f57d7759
authored
Aug 24, 2020
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)修改bug
parent
c7e8b237
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
117 deletions
+37
-117
IPointClassifyDao.java
...ol/service/business/dao/repository/IPointClassifyDao.java
+1
-1
CheckServiceImpl.java
...atrol/service/business/service/impl/CheckServiceImpl.java
+28
-19
dbTemplate_check.xml
...olStart/src/main/resources/db/mapper/dbTemplate_check.xml
+8
-97
No files found.
AmosBankPatrolService/src/main/java/com/yeejoin/amos/patrol/service/business/dao/repository/IPointClassifyDao.java
View file @
f57d7759
...
...
@@ -14,7 +14,7 @@ public interface IPointClassifyDao extends BaseDao<PointClassify, Long> {
@Modifying
@Transactional
@Query
(
value
=
"select * from p_point_classify where point_id = ?1"
,
nativeQuery
=
true
)
@Query
(
value
=
"select * from p_point_classify where point_id = ?1
order by order_no
"
,
nativeQuery
=
true
)
List
<
PointClassify
>
getPointClassifyByPointId
(
long
id
);
@Modifying
...
...
AmosBankPatrolService/src/main/java/com/yeejoin/amos/patrol/service/business/service/impl/CheckServiceImpl.java
View file @
f57d7759
...
...
@@ -30,6 +30,7 @@ import com.yeejoin.amos.patrol.service.core.util.DateUtil;
import
com.yeejoin.amos.patrol.service.core.util.PoiUtil
;
import
com.yeejoin.amos.patrol.service.core.util.ReflectUtil
;
import
com.yeejoin.amos.patrol.service.core.util.StringUtil
;
import
com.yeejoin.amos.patrol.service.exception.YeeException
;
import
com.yeejoin.amos.patrol.service.remote.RemoteSecurityService
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
...
...
@@ -121,7 +122,7 @@ public class CheckServiceImpl implements ICheckService {
//deptMap = deptList.stream().collect(Collectors.toMap(DepartmentModel::getSequenceNbr, DepartmentModel::getDepartmentName));
for
(
int
i
=
0
;
i
<
deptList
.
size
();
i
++)
{
deptMap
.
put
(
deptList
.
get
(
i
).
get
(
"sequenceNbr"
).
toString
(),
deptList
.
get
(
i
).
get
(
"departmentName"
).
toString
(
));
deptMap
.
put
(
String
.
valueOf
(
deptList
.
get
(
i
).
get
(
"sequenceNbr"
)),
String
.
valueOf
(
deptList
.
get
(
i
).
get
(
"departmentName"
)
));
}
...
...
@@ -166,11 +167,11 @@ public class CheckServiceImpl implements ICheckService {
planTask
=
planTaskDao
.
findById
(
requestParam
.
getPlanTaskId
()).
get
();
// routeParam.put("routeId", planTask.getRouteId());
// routeParam.put("pointId", requestParam.getPointId());
check
.
setPlanTaskDetailId
(
Long
.
parseLong
(
detail
.
get
(
"planTaskDetailId"
).
toString
(
)));
check
.
setRouteId
(
Long
.
parseLong
(
detail
.
get
(
"routeId"
).
toString
(
)));
check
.
setPlanTaskDetailId
(
Long
.
parseLong
(
String
.
valueOf
(
detail
.
get
(
"planTaskDetailId"
)
)));
check
.
setRouteId
(
Long
.
parseLong
(
String
.
valueOf
(
detail
.
get
(
"routeId"
)
)));
check
.
setPlanTaskId
(
requestParam
.
getPlanTaskId
());
check
.
setPlanId
(
planTask
.
getPlanId
());
check
.
setDepId
(
detail
.
get
(
"depId"
).
toString
(
));
check
.
setDepId
(
String
.
valueOf
(
detail
.
get
(
"depId"
)
));
}
}
else
{
planTask
=
new
PlanTask
();
...
...
@@ -1013,8 +1014,8 @@ public class CheckServiceImpl implements ICheckService {
//新安全
checkAnalysisVos
.
forEach
(
s
->
{
listd
.
forEach
(
s1
->
{
if
(
s
.
getName
().
equals
(
s1
.
get
(
"sequenceNbr"
)
+
""
))
{
s
.
setName
(
s1
.
get
(
"departmentName"
)
+
""
);
if
(
s
.
getName
().
equals
(
String
.
valueOf
(
s1
.
get
(
"sequenceNbr"
))
))
{
s
.
setName
(
String
.
valueOf
(
s1
.
get
(
"departmentName"
))
);
}
});
});
...
...
@@ -1090,8 +1091,8 @@ public class CheckServiceImpl implements ICheckService {
//新安全
checkAnalysisVos
.
forEach
(
s
->
{
listd
.
forEach
(
s1
->
{
if
(!
ObjectUtils
.
isEmpty
(
s
.
getName
())
&&
s
.
getName
().
equals
(
s1
.
get
(
"sequenceNbr"
)))
{
s
.
setName
(
DeptEnum
.
getEnumCode
(
s1
.
get
(
"departmentName"
)
+
""
));
if
(!
ObjectUtils
.
isEmpty
(
s
.
getName
())
&&
s
.
getName
().
equals
(
String
.
valueOf
(
s1
.
get
(
"sequenceNbr"
)
)))
{
s
.
setName
(
DeptEnum
.
getEnumCode
(
String
.
valueOf
(
s1
.
get
(
"departmentName"
))
));
}
});
});
...
...
@@ -1147,7 +1148,11 @@ public class CheckServiceImpl implements ICheckService {
titles
.
add
(
"巡检点"
);
titles
.
add
(
"分类"
);
titles
.
add
(
"检查内容"
);
String
beginTimeStr
=
checkMapper
.
getCheckInfoGroupCheckDate
(
param
).
get
(
0
).
getBeginTimeStr
();
CheckInputBo
checkInputBo
=
checkMapper
.
getCheckInfoGroupCheckDate
(
param
).
get
(
0
);
if
(
ObjectUtils
.
isEmpty
(
checkInputBo
))
{
throw
new
YeeException
(
"技术部门巡检计划为空"
);
}
String
beginTimeStr
=
checkInputBo
.
getBeginTimeStr
();
sp
=
beginTimeStr
.
split
(
","
);
for
(
int
i
=
0
;
i
<
sp
.
length
;
i
++)
{
titles
.
add
(
sp
[
i
].
substring
(
11
,
sp
[
i
].
length
()));
...
...
@@ -1243,11 +1248,15 @@ public class CheckServiceImpl implements ICheckService {
setRow
(
checkInfoList
,
sheet
,
contentStyle
,
alignLeftStyle
);
}
PoiUtil
.
export
(
wb
,
response
);
//PoiUtil.export(wb, response);
PoiUtil
.
exportLocal
(
wb
,
"D:/upload"
,
"机构客户信息表.xls"
);
}
private
Map
<
String
,
Object
>
getStateMap
(
String
idState
)
{
Map
<
String
,
Object
>
idStateMap
=
Maps
.
newHashMap
();
if
(
ObjectUtils
.
isEmpty
(
idState
))
{
return
idStateMap
;
}
String
[]
split
=
idState
.
split
(
","
);
for
(
int
i
=
0
;
i
<
split
.
length
;
i
++)
{
String
[]
sp
=
split
[
i
].
split
(
"_"
);
...
...
@@ -1396,8 +1405,8 @@ public class CheckServiceImpl implements ICheckService {
boolean
flag2
=
true
;
for
(
int
i
=
0
;
i
<
checkInfoList
.
size
();
i
++)
{
String
pointName
=
checkInfoList
.
get
(
i
).
get
(
"pointName"
).
toString
(
);
String
classifyName
=
checkInfoList
.
get
(
i
).
get
(
"classifyName"
).
toString
(
);
String
pointName
=
String
.
valueOf
(
checkInfoList
.
get
(
i
).
get
(
"pointName"
)
);
String
classifyName
=
String
.
valueOf
(
checkInfoList
.
get
(
i
).
get
(
"classifyName"
)
);
if
(
flag1
)
{
lastPointName
=
pointName
;
flag1
=
false
;
...
...
@@ -1442,14 +1451,14 @@ public class CheckServiceImpl implements ICheckService {
}
row
=
sheet
.
createRow
(
i
+
3
);
HSSFCell
cell
=
row
.
createCell
(
0
);
cell
.
setCellValue
(
checkInfoList
.
get
(
i
).
get
(
"pointName"
).
toString
(
));
cell
.
setCellValue
(
String
.
valueOf
(
checkInfoList
.
get
(
i
).
get
(
"pointName"
)
));
cell
.
setCellStyle
(
contentStyle
);
HSSFCell
cell1
=
row
.
createCell
(
1
);
cell1
.
setCellValue
(
checkInfoList
.
get
(
i
).
get
(
"classifyName"
).
toString
(
));
cell1
.
setCellValue
(
String
.
valueOf
(
checkInfoList
.
get
(
i
).
get
(
"classifyName"
)
));
cell1
.
setCellStyle
(
contentStyle
);
HSSFCell
cell2
=
row
.
createCell
(
2
);
cell2
.
setCellStyle
(
contentStyle
);
cell2
.
setCellValue
(
checkInfoList
.
get
(
i
).
get
(
"inputItemName"
).
toString
(
));
cell2
.
setCellValue
(
String
.
valueOf
(
checkInfoList
.
get
(
i
).
get
(
"inputItemName"
)
));
for
(
int
j
=
0
;
j
<
sp
.
length
;
j
++)
{
Map
<
String
,
Object
>
checkInfoMap
=
checkInfoList
.
get
(
i
);
HSSFCell
cellA
=
row
.
createCell
(
3
+
j
);
...
...
@@ -1468,9 +1477,9 @@ public class CheckServiceImpl implements ICheckService {
children
.
forEach
(
y
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
key
=
DeptEnum
.
getEnumCode
(
y
.
get
(
"departmentName"
).
toString
(
));
String
key
=
DeptEnum
.
getEnumCode
(
String
.
valueOf
(
y
.
get
(
"departmentName"
)
));
map
.
put
(
"key"
,
key
);
map
.
put
(
"label"
,
y
.
get
(
"departmentName"
).
toString
(
));
map
.
put
(
"label"
,
String
.
valueOf
(
y
.
get
(
"departmentName"
)
));
list
.
add
(
map
);
}
);
...
...
@@ -1502,7 +1511,7 @@ public class CheckServiceImpl implements ICheckService {
Collection
<
Map
>
children
=
x
.
getChildren
();
children
.
forEach
(
y
->
{
String
key
=
DeptEnum
.
getEnumCode
(
y
.
get
(
"departmentName"
).
toString
(
));
String
key
=
DeptEnum
.
getEnumCode
(
String
.
valueOf
(
y
.
get
(
"departmentName"
)
));
List
<
CheckAnalysisVo
>
collect
=
checkAnalysisVos
.
stream
().
filter
(
z
->
key
.
equals
(
z
.
getName
())
&&
z
.
getCheckTime
().
equals
(
day
)).
collect
(
Collectors
.
toList
());
String
plantaskCount
=
getCount
(
collect
,
PLANTASK_COUNT
);
String
checkCount
=
getCount
(
collect
,
CHECK_COUNT
);
...
...
@@ -1555,7 +1564,7 @@ public class CheckServiceImpl implements ICheckService {
private
void
getTotal
(
Map
<
String
,
Object
>
totalMap
,
String
type
,
String
key
,
Long
num
)
{
long
total
=
0
;
if
(!
ObjectUtils
.
isEmpty
(
totalMap
.
get
(
type
+
key
)))
{
total
=
Long
.
valueOf
(
totalMap
.
get
(
type
+
key
).
toString
(
));
total
=
Long
.
valueOf
(
String
.
valueOf
(
totalMap
.
get
(
type
+
key
)
));
}
num
+=
total
;
totalMap
.
put
(
type
+
key
,
num
.
toString
());
...
...
AmosBankPatrolStart/src/main/resources/db/mapper/dbTemplate_check.xml
View file @
f57d7759
...
...
@@ -1832,99 +1832,10 @@
</select>
<select
id=
"getCheckStatisticalByCheck"
resultType=
"com.yeejoin.amos.patrol.service.business.vo.CheckAnalysisVo"
>
<!-- select-->
<!-- a.deptName name,-->
<!-- count(a.checkId) planTaskCount,-->
<!-- sum(a.finish ) checkCount,-->
<!-- sum(a.ok) ok,-->
<!-- sum(a.faild) faild,-->
<!-- sum(a.missed) missed,-->
<!-- sum(a.score) score,-->
<!-- sum(a.missed) / count(a.checkId) * 100 missedRate,-->
<!-- sum(a.faild) / count(a.checkId) * 100 faildRate,-->
<!-- a.checkTime-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- CASE-->
<!-- WHEN c.plan_id = 0 THEN-->
<!-- '计划外'-->
<!-- ELSE-->
<!-- p. NAME-->
<!-- END planName,-->
<!-- c.plan_id planId,-->
<!-- r. NAME routeName,-->
<!-- r.id routeId,-->
<!-- pt. NAME pointName,-->
<!-- pt.id pointId,-->
<!-- c.user_id userId,-->
<!-- c.score,-->
<!-- c.dep_id departmentId,-->
<!-- c.dep_id deptName ,-->
<!-- c.user_id userName ,-->
<!-- c.id checkId,-->
<!-- c.plan_task_detail_id taskDetailId,-->
<!-- c.is_ok isOk,-->
<!-- c.plan_task_id,-->
<!-- DATE_FORMAT(c.check_time,'%Y-%m-%d') checkTime,-->
<!-- DATE_FORMAT(c.check_time,'%Y-%m') checkMonth,-->
<!-- CASE-->
<!-- WHEN c.is_ok = 1 THEN-->
<!-- 1-->
<!-- ELSE-->
<!-- 0-->
<!-- END ok,-->
<!-- CASE-->
<!-- WHEN c.is_ok = 2 THEN-->
<!-- 1-->
<!-- ELSE-->
<!-- 0-->
<!-- END faild,-->
<!-- CASE-->
<!-- WHEN c.is_ok = 3 THEN-->
<!-- 1-->
<!-- ELSE-->
<!-- 0-->
<!-- END missed,-->
<!-- CASE-->
<!-- WHEN c.is_ok = 3 THEN-->
<!-- 0-->
<!-- ELSE-->
<!-- 1-->
<!-- END finish-->
<!-- FROM-->
<!-- p_check c-->
<!-- LEFT JOIN p_plan p ON c.plan_id = p.id-->
<!-- LEFT JOIN p_plan_task pnt ON c.plan_task_id = pnt.id-->
<!-- LEFT JOIN p_route r ON c.route_id = r.id-->
<!-- LEFT JOIN p_point pt ON c.point_id = pt.id-->
<!-- WHERE c.org_code LIKE CONCAT(#{orgCode}, '%')-->
<!-- <if test="userName !=null and userName != '' ">and c.user_name like CONCAT('%', #{userName}, '%')</if>-->
<!-- <if test="pointNo !=null and pointNo != '' ">and pt.point_no like CONCAT('%', #{pointNo}, '%')</if>-->
<!-- <if test="pointName !=null and pointName != '' ">and pt.name like CONCAT('%', #{pointName}, '%')</if>-->
<!-- <if test="isFixed !=null and isFixed != '' ">and pt.is_fixed = #{isFixed}</if>-->
<!-- <choose>-->
<!-- <when test=" processType > 0 and processType == 4 ">-->
<!-- and <![CDATA[ c.plan_id = 0 ]]>-->
<!-- </when>-->
<!-- <when test="processType > 0 and processType != 4 ">-->
<!-- and pnt.status = #{processType}-->
<!-- </when>-->
<!-- </choose>-->
<!-- <if test="isOk !=null and isOk != '' ">and c.isOk = #{isOk}</if>-->
<!-- <if test="planId !=null and planId != '' ">and c.plan_id = #{planId}</if>-->
<!-- <if test="routeId !=null and routeId != '' ">and c.route_id = #{routeId}</if>-->
<!-- <if test="startTime !=null and startTime!= '' "> <![CDATA[ AND c.check_time >= #{startTime} ]]> </if>-->
<!-- <if test="endTime !=null and endTime!='' "><![CDATA[AND c.check_time <= #{endTime} ]]></if>-->
<!-- ) a-->
<!-- GROUP BY-->
<!-- a.deptName,-->
<!-- a.checkTime-->
SELECT
a.deptName `name`,
sum(a.planTaskCount
) planTaskCount,
sum(a.finish
) checkCount,
count(1
) planTaskCount,
sum(a.finish) checkCount,
sum(a.ok) ok,
sum(a.faild) faild,
sum(a.missed) missed,
...
...
@@ -1983,16 +1894,16 @@
0
END finish
FROM
p_plan_task pnt
p_plan_task_detail ptd
LEFT JOIN p_plan_task pnt ON pnt.id = ptd.task_no
LEFT JOIN p_plan p ON p.id = pnt.plan_id
LEFT JOIN p_point pt ON pt.id = ptd.id
LEFT JOIN p_route r ON r.id = pnt.route_id
LEFT JOIN p_route_point prp ON prp.route_id = r.id
LEFT JOIN p_point pt ON pt.route_id = r.id
LEFT JOIN p_check c on c.plan_task_id = pnt.id
LEFT JOIN p_plan p ON c.plan_id = p.id
LEFT JOIN p_check c ON c.plan_task_id = pnt.id
WHERE pnt.org_code LIKE CONCAT(#{orgCode}, '%')
<if
test=
"startTime !=null and startTime!= '' "
>
<![CDATA[ AND pnt.check_date >= #{startTime} ]]>
</if>
<if
test=
"endTime !=null and endTime!='' "
>
<![CDATA[AND pnt.check_date <= #{endTime} ]]>
</if>
GROUP BY pnt.id, c
.id
GROUP BY ptd
.id
) a
GROUP BY
a.deptName,
...
...
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